diff --git a/.gitattributes b/.gitattributes index 6284ea769b24102b59f9a9b0d87a92790c38e3e6..997a5d7b9a92cd51a42c4e171716729a5f920b59 100644 --- a/.gitattributes +++ b/.gitattributes @@ -221,6 +221,8 @@ testfont binary /src/modules/Oracle/acconfig.h foreign_ident /src/modules/Oracle/configure.in foreign_ident /src/modules/Oracle/oracle.c foreign_ident +/src/modules/Perl/Makefile.in foreign_ident +/src/modules/Perl/configure.in foreign_ident /src/modules/Pipe/Makefile.in foreign_ident /src/modules/Pipe/acconfig.h foreign_ident /src/modules/Pipe/configure.in foreign_ident diff --git a/src/ChangeLog b/src/ChangeLog index ae269f30497ad93d905b1c7b2b91db63bc48f0cb..5817f03dc979c4fa4182cd825ca2c14ae1ce7cbd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -167,7 +167,7 @@ Mon Dec 22 09:33:59 1997 Fredrik Hubinette <hubbe@cytocin.hubbe.net> * smartlink: -L options are now uniq-ified * encode.c: doesn't attempt to allocate mappings with negative sizes any more - * interpret.c: allows trace up to -t2 without #define DEBUG + * interpret.c: allows trace up to -t2 without #define PIKE_DEBUG Wed Dec 17 20:05:46 1997 Henrik Grubbström <grubba@idonex.se> @@ -1259,7 +1259,7 @@ Wed Nov 15 10:56:45 1995 Fredrik Hubinette <hubbe@sparky.signum.se> * sprintf.c: now includes memory.h (for xalloc) * configure.in: added check to see if -pipe works, fixed caching of oneshot signal tests. - * builtin_efuns.c: exit() now only deallocates memory when DEBUG + * builtin_efuns.c: exit() now only deallocates memory when PIKE_DEBUG is defined. Tue Nov 14 04:57:29 1995 Fredrik Hubinette <hubbe@sparky.signum.se> @@ -1326,7 +1326,7 @@ Thu Nov 2 00:13:20 1995 Fredrik Hubinette <hubbe@sparky.signum.se> Tue Oct 31 18:57:49 1995 Fredrik Hubinette <hubbe@sparky.signum.se> - * Makefile.in, config.h: moved DEBUG to Makefile + * Makefile.in, config.h: moved PIKE_DEBUG to Makefile * signal_handler.c: fixed a warning Sun Oct 29 04:02:03 1995 Fredrik Hubinette <hubbe@sparky.signum.se> @@ -1416,7 +1416,7 @@ Sat Oct 14 01:58:13 1995 Fredrik Hubinette <hubbe@sparky.signum.se> * v1.1E-15 Released * call_out.c (verify_call_outs): Fixed so that this function - is actually run (when compiled with DEBUG and usint -d) + is actually run (when compiled with PIKE_DEBUG and usint -d) Also fixed a bug when doing call_out 0 or less... * interpret.c (strict_apply_svalue): Moved fix to a bug diff --git a/src/README b/src/README index 14cd851eebf7e01cc2e3ca74a9f86eb3acb63fd8..75f76eca5da0b9bb153b578e7648963e37550c3a 100644 --- a/src/README +++ b/src/README @@ -83,7 +83,7 @@ What to do when it doesn't work: 8) If you find a bug in the interpreter, the first thing to do is to make sure -the interpreter is compiled with DEBUG defined. If not recompile with DEBUG +the interpreter is compiled with PIKE_DEBUG defined. If not recompile with PIKE_DEBUG and see if you get another error. When you've done this, please report the bug to hubbe@hubbe.net and include as much as you can muster of the following: diff --git a/src/acconfig.h b/src/acconfig.h index ba48b07815beb33ad4c735ad76ad0a4d7a694b5a..d54ecada802f64a2d8d6153d273d8175cef4cdda 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -1,5 +1,5 @@ /* - * $Id: acconfig.h,v 1.34 1998/11/18 20:16:09 marcus Exp $ + * $Id: acconfig.h,v 1.35 1998/11/22 11:02:30 hubbe Exp $ */ #ifndef MACHINE_H #define MACHINE_H @@ -13,7 +13,7 @@ #define DEFAULT_MASTER "@prefix@/lib/pike/master.pike" /* Define this if you want run time self tests */ -#undef DEBUG +#undef PIKE_DEBUG /* Define this if you want malloc debugging */ #undef DEBUG_MALLOC @@ -148,7 +148,7 @@ #undef DECLARE_ENVIRON /* What byteorder does your machie use most machines use 4321, PC use 1234 */ -#define BYTEORDER 0 +#define PIKE_BYTEORDER 0 /* Number of possible filedesriptors */ #define MAX_OPEN_FILEDESCRIPTORS 1024 diff --git a/src/array.c b/src/array.c index 4dab2f2b14f95d1217446c8518d0543f1ef73a61..6f8467397be7aa5115d96f6cfba8d9839d09d710 100644 --- a/src/array.c +++ b/src/array.c @@ -19,7 +19,7 @@ #include "gc.h" #include "main.h" -RCSID("$Id: array.c,v 1.41 1998/10/14 05:48:44 hubbe Exp $"); +RCSID("$Id: array.c,v 1.42 1998/11/22 11:02:31 hubbe Exp $"); struct array empty_array= { @@ -104,12 +104,12 @@ static void array_free_no_free(struct array *v) void really_free_array(struct array *v) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(v == & empty_array) fatal("Tried to free the empty_array.\n"); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(v); #endif @@ -129,7 +129,7 @@ void do_free_array(struct array *a) */ void array_index_no_free(struct svalue *s,struct array *v,INT32 index) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(index<0 || index>=v->size) fatal("Illegal index in low level index routine.\n"); #endif @@ -142,7 +142,7 @@ void array_index_no_free(struct svalue *s,struct array *v,INT32 index) */ void array_index(struct svalue *s,struct array *v,INT32 index) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(index<0 || index>=v->size) fatal("Illegal index in low level index routine.\n"); #endif @@ -190,7 +190,7 @@ void simple_array_index_no_free(struct svalue *s, */ void array_free_index(struct array *v,INT32 index) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(index<0 || index>=v->size) fatal("Illegal index in low level free index routine.\n"); #endif @@ -203,7 +203,7 @@ void array_free_index(struct array *v,INT32 index) */ void array_set_index(struct array *v,INT32 index, struct svalue *s) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(index<0 || index>v->size) fatal("Illegal index in low level array set routine.\n"); #endif @@ -239,7 +239,7 @@ void simple_set_index(struct array *a,struct svalue *ind,struct svalue *s) */ struct array *array_insert(struct array *v,struct svalue *s,INT32 index) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(index<0 || index>v->size) fatal("Illegal index in low level insert routine.\n"); #endif @@ -284,7 +284,7 @@ struct array *array_insert(struct array *v,struct svalue *s,INT32 index) */ struct array *resize_array(struct array *a, INT32 size) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(a); #endif @@ -327,7 +327,7 @@ struct array *array_shrink(struct array *v,INT32 size) { struct array *a; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(v->refs>2) /* Odd, but has to be two */ fatal("Array shrink on array with many references.\n"); @@ -359,7 +359,7 @@ struct array *array_remove(struct array *v,INT32 index) { struct array *a; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(v->refs>1) fatal("Array remove on array with many references.\n"); @@ -402,7 +402,7 @@ struct array *array_remove(struct array *v,INT32 index) INT32 array_search(struct array *v, struct svalue *s,INT32 start) { INT32 e; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(start<0) fatal("Start of find_index is less than zero.\n"); #endif @@ -410,7 +410,7 @@ INT32 array_search(struct array *v, struct svalue *s,INT32 start) check_destructed(s); /* Why search for something that is not there? */ -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(v); #endif if(v->type_field & (1 << s->type)) @@ -440,7 +440,7 @@ struct array *slice_array(struct array *v,INT32 start,INT32 end) { struct array *a; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(start > end || end>v->size || start<0) fatal("Illegal arguments to slice_array()\n"); @@ -469,7 +469,7 @@ struct array *friendly_slice_array(struct array *v,INT32 start,INT32 end) { struct array *a; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(start > end || end>v->size || start<0) fatal("Illegal arguments to slice_array()\n"); @@ -508,7 +508,7 @@ void check_array_for_destruct(struct array *v) INT16 types; types = 0; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(v); #endif if(v->type_field & (BIT_OBJECT | BIT_FUNCTION)) @@ -543,7 +543,7 @@ INT32 array_find_destructed_object(struct array *v) { INT32 e; TYPE_FIELD types; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(v); #endif if(v->type_field & (BIT_OBJECT | BIT_FUNCTION)) @@ -560,7 +560,7 @@ INT32 array_find_destructed_object(struct array *v) } v->type_field = types; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(v); #endif return -1; @@ -765,7 +765,7 @@ static INT32 low_lookup(struct array *v, INT32 set_lookup(struct array *a, struct svalue *s) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(a); #endif /* face it, it's not there */ @@ -782,7 +782,7 @@ INT32 set_lookup(struct array *a, struct svalue *s) INT32 switch_lookup(struct array *a, struct svalue *s) { /* face it, it's not there */ -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(a); #endif if( (((2 << s->type) -1) & a->type_field) == 0) @@ -838,7 +838,7 @@ void array_fix_type_field(struct array *v) for(e=0; e<v->size; e++) t |= 1 << ITEM(v)[e].type; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(t & ~(v->type_field)) { describe(v); @@ -848,7 +848,7 @@ void array_fix_type_field(struct array *v) v->type_field = t; } -#ifdef DEBUG +#ifdef PIKE_DEBUG /* Maybe I should have a 'clean' flag for this computation */ void array_check_type_field(struct array *v) { @@ -927,7 +927,7 @@ INT32 * merge(struct array *a,struct array *b,INT32 opcode) INT32 ap,bp,i,*ret,*ptr; ap=bp=0; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) { array_check_type_field(a); @@ -939,12 +939,12 @@ INT32 * merge(struct array *a,struct array *b,INT32 opcode) /* do smart optimizations */ switch(opcode) { - case OP_AND: + case PIKE_ARRAY_OP_AND: ret=(INT32 *)xalloc(sizeof(INT32)); *ret=0; return ret; - case OP_SUB: + case PIKE_ARRAY_OP_SUB: ptr=ret=(INT32 *)xalloc(sizeof(INT32)*(a->size+1)); *(ptr++)=a->size; for(i=0;i<a->size;i++) *(ptr++)=i; @@ -965,14 +965,14 @@ INT32 * merge(struct array *a,struct array *b,INT32 opcode) else i=opcode >> 4; - if(i & OP_A) *(ptr++)=ap; - if(i & OP_B) *(ptr++)=~bp; - if(i & OP_SKIP_A) ap++; - if(i & OP_SKIP_B) bp++; + if(i & PIKE_ARRAY_OP_A) *(ptr++)=ap; + if(i & PIKE_ARRAY_OP_B) *(ptr++)=~bp; + if(i & PIKE_ARRAY_OP_SKIP_A) ap++; + if(i & PIKE_ARRAY_OP_SKIP_B) bp++; } - if((opcode >> 8) & OP_A) while(ap<a->size) *(ptr++)=ap++; - if(opcode & OP_B) while(bp<b->size) *(ptr++)=~(bp++); + if((opcode >> 8) & PIKE_ARRAY_OP_A) while(ap<a->size) *(ptr++)=ap++; + if(opcode & PIKE_ARRAY_OP_B) while(bp<b->size) *(ptr++)=~(bp++); *ret=(ptr-ret-1); @@ -1046,7 +1046,7 @@ int array_equal_p(struct array *a, struct array *b, struct processing *p) if(a->size != b->size) return 0; if(!a->size) return 1; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) { array_check_type_field(a); @@ -1169,7 +1169,7 @@ struct array *merge_array_without_order(struct array *a, /* subtract an array from another */ struct array *subtract_arrays(struct array *a, struct array *b) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) { array_check_type_field(b); @@ -1179,7 +1179,7 @@ struct array *subtract_arrays(struct array *a, struct array *b) if(a->type_field & b->type_field) { - return merge_array_with_order(a, b, OP_SUB); + return merge_array_with_order(a, b, PIKE_ARRAY_OP_SUB); }else{ if(a->refs == 1) { @@ -1193,7 +1193,7 @@ struct array *subtract_arrays(struct array *a, struct array *b) /* and two arrays */ struct array *and_arrays(struct array *a, struct array *b) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) { array_check_type_field(b); @@ -1203,7 +1203,7 @@ struct array *and_arrays(struct array *a, struct array *b) if(a->type_field & b->type_field) { - return merge_array_without_order(a, b, OP_AND); + return merge_array_without_order(a, b, PIKE_ARRAY_OP_AND); }else{ return allocate_array_no_init(0,0); } @@ -1469,7 +1469,7 @@ struct array *copy_array_recursively(struct array *a,struct processing *p) struct processing doing; struct array *ret; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(a); #endif @@ -1536,7 +1536,7 @@ void array_replace(struct array *a, while((i=array_search(a,from,i+1)) >= 0) array_set_index(a,i,to); } -#ifdef DEBUG +#ifdef PIKE_DEBUG void check_array(struct array *a) { INT32 e; @@ -1573,7 +1573,7 @@ void check_all_arrays(void) fatal("Null pointer in array list.\n"); } while (a != & empty_array); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ void gc_mark_array_as_referenced(struct array *a) @@ -1589,7 +1589,7 @@ void gc_check_all_arrays(void) a=&empty_array; do { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) array_check_type_field(a); #endif if(a->type_field & BIT_COMPLEX) @@ -1651,7 +1651,7 @@ void gc_free_all_unreferenced_arrays(void) } -#ifdef DEBUG +#ifdef PIKE_DEBUG void debug_dump_type_field(TYPE_FIELD t) { @@ -1690,7 +1690,7 @@ void zap_all_arrays(void) do { -#if defined(DEBUG) && defined(DEBUG_MALLOC) +#if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC) if(verbose_debug_exit && a!=&empty_array) describe(a); #endif @@ -1798,7 +1798,7 @@ struct array *implode_array(struct array *a, struct array *b) ITEM(a)[e].u.array->type_field); size+=ITEM(a)[e].u.array->size; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(size != ret->size) fatal("Implode_array failed miserably\n"); #endif diff --git a/src/array.h b/src/array.h index a8e9ad4e2995acf6360122280a85f9f48fa95735..f6bfc7cefdab60a6b90cd352341cd44e07e543e2 100644 --- a/src/array.h +++ b/src/array.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: array.h,v 1.13 1998/04/17 05:08:00 hubbe Exp $ + * $Id: array.h,v 1.14 1998/11/22 11:02:32 hubbe Exp $ */ #ifndef ARRAY_H #define ARRAY_H @@ -33,7 +33,7 @@ struct array extern struct array empty_array; -#if defined(DEBUG_MALLOC) && defined(DEBUG) +#if defined(DEBUG_MALLOC) && defined(PIKE_DEBUG) #define ITEM(X) (((struct array *)(debug_malloc_pass((X))))->item) #else #define ITEM(X) ((X)->item) @@ -42,19 +42,19 @@ extern struct array empty_array; /* These are arguments for the function 'merge' which merges two sorted * set stored in arrays in the way you specify */ -#define OP_A 1 -#define OP_SKIP_A 2 -#define OP_TAKE_A 3 -#define OP_B 4 -#define OP_SKIP_B 8 -#define OP_TAKE_B 12 -#define MINTERM(X,Y,Z) (((X)<<8)+((Y)<<4)+(Z)) - -#define OP_AND MINTERM(OP_SKIP_A,OP_SKIP_A | OP_TAKE_B,OP_SKIP_B) -#define OP_OR MINTERM(OP_TAKE_A,OP_SKIP_A | OP_TAKE_B,OP_TAKE_B) -#define OP_XOR MINTERM(OP_TAKE_A,OP_SKIP_A | OP_SKIP_B,OP_TAKE_B) -#define OP_ADD MINTERM(OP_TAKE_A,OP_TAKE_A | OP_TAKE_B ,OP_TAKE_B) -#define OP_SUB MINTERM(OP_TAKE_A,OP_SKIP_A ,OP_SKIP_B) +#define PIKE_ARRAY_OP_A 1 +#define PIKE_ARRAY_OP_SKIP_A 2 +#define PIKE_ARRAY_OP_TAKE_A 3 +#define PIKE_ARRAY_OP_B 4 +#define PIKE_ARRAY_OP_SKIP_B 8 +#define PIKE_ARRAY_OP_TAKE_B 12 +#define PIKE_MINTERM(X,Y,Z) (((X)<<8)+((Y)<<4)+(Z)) + +#define PIKE_ARRAY_OP_AND PIKE_MINTERM(PIKE_ARRAY_OP_SKIP_A,PIKE_ARRAY_OP_SKIP_A | PIKE_ARRAY_OP_TAKE_B,PIKE_ARRAY_OP_SKIP_B) +#define PIKE_ARRAY_OP_OR PIKE_MINTERM(PIKE_ARRAY_OP_TAKE_A,PIKE_ARRAY_OP_SKIP_A | PIKE_ARRAY_OP_TAKE_B,PIKE_ARRAY_OP_TAKE_B) +#define PIKE_ARRAY_OP_XOR PIKE_MINTERM(PIKE_ARRAY_OP_TAKE_A,PIKE_ARRAY_OP_SKIP_A | PIKE_ARRAY_OP_SKIP_B,PIKE_ARRAY_OP_TAKE_B) +#define PIKE_ARRAY_OP_ADD PIKE_MINTERM(PIKE_ARRAY_OP_TAKE_A,PIKE_ARRAY_OP_TAKE_A | PIKE_ARRAY_OP_TAKE_B ,PIKE_ARRAY_OP_TAKE_B) +#define PIKE_ARRAY_OP_SUB PIKE_MINTERM(PIKE_ARRAY_OP_TAKE_A,PIKE_ARRAY_OP_SKIP_A ,PIKE_ARRAY_OP_SKIP_B) #define free_array(V) do{ struct array *v_=(V); debug_malloc_touch(v_); if(!--v_->refs) really_free_array(v_); }while(0) diff --git a/src/backend.c b/src/backend.c index fd94495f407f6af138446e33e75f66bed0e9bee0..14b36774a147f971ffbfeaa030b02b70cc6698ce 100644 --- a/src/backend.c +++ b/src/backend.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: backend.c,v 1.39 1998/11/05 23:30:42 grubba Exp $"); +RCSID("$Id: backend.c,v 1.40 1998/11/22 11:02:33 hubbe Exp $"); #include "fdlib.h" #include "backend.h" #include <errno.h> @@ -251,7 +251,7 @@ void set_read_callback(int fd,file_callback cb,void *data) #ifdef HAVE_POLL int was_set = (fds[fd].read.callback!=0); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -298,7 +298,7 @@ void set_write_callback(int fd,file_callback cb,void *data) #ifdef HAVE_POLL int was_set = (fds[fd].write.callback!=0); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -357,7 +357,7 @@ void set_read_oob_callback(int fd,file_callback cb,void *data) #ifdef HAVE_POLL int was_set = (fds[fd].read_oob.callback!=0); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -400,7 +400,7 @@ void set_write_oob_callback(int fd,file_callback cb,void *data) #ifdef HAVE_POLL int was_set = (fds[fd].write_oob.callback!=0); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -449,7 +449,7 @@ void set_write_oob_callback(int fd,file_callback cb,void *data) file_callback query_read_callback(int fd) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -459,7 +459,7 @@ file_callback query_read_callback(int fd) file_callback query_write_callback(int fd) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -470,7 +470,7 @@ file_callback query_write_callback(int fd) #ifdef WITH_OOB file_callback query_read_oob_callback(int fd) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -480,7 +480,7 @@ file_callback query_read_oob_callback(int fd) file_callback query_write_oob_callback(int fd) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -491,7 +491,7 @@ file_callback query_write_oob_callback(int fd) void *query_read_callback_data(int fd) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -501,7 +501,7 @@ void *query_read_callback_data(int fd) void *query_write_callback_data(int fd) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -512,7 +512,7 @@ void *query_write_callback_data(int fd) #ifdef WITH_OOB void *query_read_oob_callback_data(int fd) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -522,7 +522,7 @@ void *query_read_oob_callback_data(int fd) void *query_write_oob_callback_data(int fd) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd>=MAX_OPEN_FILEDESCRIPTORS) fatal("File descriptor out of range.\n %d",fd); #endif @@ -531,7 +531,7 @@ void *query_write_oob_callback_data(int fd) } #endif /* WITH_OOB */ -#ifdef DEBUG +#ifdef PIKE_DEBUG struct callback_list do_debug_callbacks; @@ -657,7 +657,7 @@ void backend(void) #endif alloca(0); /* Do garbage collect */ -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) do_debug(); #endif @@ -694,9 +694,9 @@ void backend(void) if (!i) { /* Timeout */ } else if (i>0) { -#ifdef DEBUG +#ifdef PIKE_DEBUG int num_active = i; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ #ifndef HAVE_POLL /* FIXME: OOB? */ for(i=0; i<max_fd+1; i++) @@ -724,9 +724,9 @@ void backend(void) for(i=0; i<active_num_in_poll; i++) { int fd = active_poll_fds[i].fd; -#ifdef DEBUG +#ifdef PIKE_DEBUG int handled = 0; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ if(active_poll_fds[i].revents & POLLNVAL) { int j; @@ -745,37 +745,37 @@ void backend(void) break; } } -#ifdef DEBUG +#ifdef PIKE_DEBUG handled = 1; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ } #ifdef WITH_OOB if ((active_poll_fds[i].revents & POLLRDBAND) && fds[fd].read_oob.callback) { (*(fds[fd].read_oob.callback))(fd, fds[fd].read_oob.data); -#ifdef DEBUG +#ifdef PIKE_DEBUG handled = 1; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ } #endif /* WITH_OOB */ if((active_poll_fds[i].revents & POLLHUP) || (active_poll_fds[i].revents & POLLERR)) { /* Closed or error */ -#ifdef DEBUG +#ifdef PIKE_DEBUG if (active_poll_fds[i].revents & POLLERR) { fprintf(stderr, "Got POLLERR on fd %d\n", i); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ if (fds[fd].read.callback) { (*(fds[fd].read.callback))(fd,fds[fd].read.data); } /* We don't want to keep this fd anymore. */ POLL_FD_CLR(fd, ~0); -#ifdef DEBUG +#ifdef PIKE_DEBUG handled = 1; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ } if(active_poll_fds[i].revents & POLLRDNORM) { @@ -784,18 +784,18 @@ void backend(void) } else { POLL_FD_CLR(fd, POLLRDNORM); } -#ifdef DEBUG +#ifdef PIKE_DEBUG handled = 1; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ } #ifdef WITH_OOB if ((active_poll_fds[i].revents & POLLWRBAND) && fds[fd].write_oob.callback) { (*(fds[fd].write_oob.callback))(fd, fds[fd].write_oob.data); -#ifdef DEBUG +#ifdef PIKE_DEBUG handled = 1; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ } #endif /* WITH_OOB */ @@ -805,20 +805,20 @@ void backend(void) } else { POLL_FD_CLR(fd, POLLOUT); } -#ifdef DEBUG +#ifdef PIKE_DEBUG handled = 1; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ } -#ifdef DEBUG +#ifdef PIKE_DEBUG num_active -= handled; if (!handled && active_poll_fds[i].revents) { fprintf(stderr, "BACKEND: fd %d has revents 0x%08x, " "but hasn't been handled.\n", active_poll_fds[i].fd, active_poll_fds[i].revents); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ } -#ifdef DEBUG +#ifdef PIKE_DEBUG if (num_active) { fprintf(stderr, "BACKEND: %d more active fds than were handled.\n", num_active); @@ -828,7 +828,7 @@ void backend(void) active_poll_fds[i].revents); } } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ #endif }else{ switch(errno) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index 8100a28fa8891ff5691c1b44d06f976fbc46d04a..c552286b82be83e603b809cfd9342781b09855de 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.139 1998/11/17 06:39:50 grubba Exp $"); +RCSID("$Id: builtin_functions.c,v 1.140 1998/11/22 11:02:35 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -69,7 +69,7 @@ void f_equal(INT32 args) void f_aggregate(INT32 args) { struct array *a; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(args < 0) fatal("Negative args to f_aggregate()\n"); #endif @@ -412,7 +412,7 @@ static char *combine_path(char *cwd,char *file) } #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!cwd) fatal("No cwd in combine_path!\n"); #endif @@ -623,7 +623,7 @@ void f_string_to_unicode(INT32 args) /* FIXME: Should we check for 0xfffe & 0xffff here too? */ len = in->len * 2; out = begin_shared_string(len); -#if (BYTEORDER == 4321) +#if (PIKE_BYTEORDER == 4321) /* Big endian -- We don't need to do much... * * FIXME: Future optimization: Check if refcount is == 1, @@ -689,11 +689,11 @@ void f_string_to_unicode(INT32 args) out->str[j + 1] = c & 0xff; out->str[j] = c >> 8; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if (j) { fatal("string_to_unicode(): Indexing error: len:%d, j:%d.\n", len, j); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ out = end_shared_string(out); } break; @@ -722,7 +722,7 @@ void f_unicode_to_string(INT32 args) len = in->len / 2; out = begin_wide_shared_string(len, 1); -#if (BYTEORDER == 4321) +#if (PIKE_BYTEORDER == 4321) /* Big endian * * FIXME: Future optimization: Perform sufficient magic @@ -740,7 +740,7 @@ void f_unicode_to_string(INT32 args) ((unsigned char *)in->str)[i*2 + 1]; } } -#endif /* BYTEORDER == 4321 */ +#endif /* PIKE_BYTEORDER == 4321 */ out = end_shared_string(out); pop_n_elems(args); push_string(out); @@ -852,12 +852,12 @@ void f_string_to_utf8(INT32 args) out->str[j++] = 0x80 | (c & 0x3f); } } -#ifdef DEBUG +#ifdef PIKE_DEBUG if (len != j) { fatal("string_to_utf8(): Calculated and actual lengths differ: %d != %d\n", len, j); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ out = end_shared_string(out); pop_n_elems(args); push_string(out); @@ -993,12 +993,12 @@ void f_utf8_to_string(INT32 args) } low_set_index(out, j++, c); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if (j != len) { fatal("utf8_to_string(): Calculated and actual lengths differ: %d != %d\n", len, j); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ out = end_shared_string(out); pop_n_elems(args); push_string(out); @@ -1898,7 +1898,7 @@ void f_column(INT32 args) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG void f__verify_internals(INT32 args) { INT32 tmp=d_flag; @@ -2216,11 +2216,11 @@ static void f_interleave_array(INT32 args) INT32 e; struct keypair *k; INT_TYPE low = 0x7fffffff; -#ifdef DEBUG +#ifdef PIKE_DEBUG if (ITEM(arr)[i].type != T_MAPPING) { error("interleave_array(): Element %d is not a mapping!\n", i); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ m = ITEM(arr)[i].u.mapping; MAPPING_LOOP(m) { if (k->ind.type != T_INT) { @@ -2694,13 +2694,13 @@ static struct array *diff_longest_sequence(struct array *cmptbl, int blen) #ifdef DIFF_DEBUG fprintf(stderr, "DIFF: j=%d, x=%d\n", j, x); #endif /* DIFF_DEBUG */ -#ifdef DEBUG +#ifdef PIKE_DEBUG if (x >= blen) { fatal("diff_longest_sequence(): x:%d >= blen:%d\n", x, blen); } else if (x < 0) { fatal("diff_longest_sequence(): x:%d < 0\n", x); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ if (!marks[x]) { int pos; @@ -2737,13 +2737,13 @@ static struct array *diff_longest_sequence(struct array *cmptbl, int blen) #ifdef DIFF_DEBUG fprintf(stderr, "DIFF: New j=%d, x=%d\n", j, x); #endif /* DIFF_DEBUG */ -#ifdef DEBUG +#ifdef PIKE_DEBUG if (x >= blen) { fatal("diff_longest_sequence(): x:%d >= blen:%d\n", x, blen); } else if (x < 0) { fatal("diff_longest_sequence(): x:%d < 0\n", x); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ /* Put x on the stack. */ marks[x] = 1; @@ -2987,11 +2987,11 @@ static struct array *diff_dyn_longest_sequence(struct array *cmptbl, int blen) i = 0; while(dml) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if (i >= sz) { fatal("Consistency error in diff_dyn_longest_sequence()\n"); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ #ifdef DIFF_DEBUG fprintf(stderr, " %02d: %d\n", i, dml->x); #endif /* DIFF_DEBUG */ @@ -3001,11 +3001,11 @@ static struct array *diff_dyn_longest_sequence(struct array *cmptbl, int blen) dml = dml->prev; i++; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if (i != sz) { fatal("Consistency error in diff_dyn_longest_sequence()\n"); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ dml_free_pools(dml_pool); return(res); @@ -3446,7 +3446,7 @@ void f_splice(INT32 args) INT32 size=0x7fffffff; INT32 i,j,k; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(args < 0) fatal("Negative args to f_splice()\n"); #endif @@ -3483,7 +3483,7 @@ void f_everynth(INT32 args) struct array *a; struct array *ina; INT32 size=0; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(args < 0) fatal("Negative args to f_everynth()\n"); #endif @@ -3523,7 +3523,7 @@ void f_transpose(INT32 args) INT32 inner=0; INT32 j,i; TYPE_FIELD type=0; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(args < 0) fatal("Negative args to f_transpose()\n"); #endif @@ -3592,7 +3592,7 @@ void f__reset_dmalloc(INT32 args) } #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG void f__locate_references(INT32 args) { if(args) @@ -3727,7 +3727,7 @@ void init_builtin_efuns(void) add_efun("mktime",f_mktime,"function(int,int,int,int,int,int,int,void|int:int)|function(object|mapping:int)",OPT_TRY_OPTIMIZE); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG add_efun("_verify_internals",f__verify_internals,"function(:void)",OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); add_efun("_debug",f__debug,"function(int:int)",OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); #ifdef YYDEBUG @@ -3753,7 +3753,7 @@ void init_builtin_efuns(void) #ifdef DEBUG_MALLOC add_efun("_reset_dmalloc",f__reset_dmalloc,"function(void:void)",OPT_SIDE_EFFECT); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG add_efun("_locate_references",f__locate_references,"function(1=mixed:1)",OPT_SIDE_EFFECT); #endif } diff --git a/src/callback.c b/src/callback.c index 0fddca23cdbe05ea1ad91d4ba56843d10bea161a..4448fa3d16e2870e011fd6c06232d49868828c08 100644 --- a/src/callback.c +++ b/src/callback.c @@ -9,7 +9,7 @@ #include "error.h" #include "block_alloc.h" -RCSID("$Id: callback.c,v 1.14 1998/03/28 15:39:14 grubba Exp $"); +RCSID("$Id: callback.c,v 1.15 1998/11/22 11:02:36 hubbe Exp $"); struct callback_list fork_child_callback; @@ -30,14 +30,14 @@ struct callback }; #define CALLBACK_CHUNK 128 -#ifdef DEBUG +#ifdef PIKE_DEBUG #undef PRE_INIT_BLOCK #define PRE_INIT_BLOCK(X) X->free_func=(callback_func)remove_callback; #endif BLOCK_ALLOC(callback, CALLBACK_CHUNK) -#ifdef DEBUG +#ifdef PIKE_DEBUG extern int d_flag; static int is_in_free_list(struct callback * c) @@ -161,7 +161,7 @@ void call_callback(struct callback_list *lst, void *arg) *ptr=l->next; free_callback(l); -#ifdef DEBUG +#ifdef PIKE_DEBUG l->free_func=(callback_func)remove_callback; #endif }else{ diff --git a/src/compilation.h b/src/compilation.h index 9d471f858c5101701818181ebbac03cd470d9d12..bedb44017e9e4bb8d5161c0a11a8ac9fdf2789f3 100644 --- a/src/compilation.h +++ b/src/compilation.h @@ -1,5 +1,5 @@ /* - * $Id: compilation.h,v 1.12 1998/11/09 07:21:30 hubbe Exp $ + * $Id: compilation.h,v 1.13 1998/11/22 11:02:37 hubbe Exp $ * * Compilator state push / pop operator construction file * @@ -21,7 +21,7 @@ * define PROGRAM_STATE to select the program state */ -#ifdef DEBUG +#ifdef PIKE_DEBUG #define DO_DEBUG_CODE(X) X #else #define DO_DEBUG_CODE(X) @@ -93,7 +93,7 @@ #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG #define STRMEMBER(X,Y) \ PCODE(if(X) fatal("Variable %s not deallocated properly.\n",Y);) \ ZMEMBER(struct pike_string *,X) diff --git a/src/configure.in b/src/configure.in index 85537a7fac8e86a5367ec5e6446aa7f538c5d3a5..3c95b43e19c9b364d89d25165bdc2f87dca9682c 100644 --- a/src/configure.in +++ b/src/configure.in @@ -1,4 +1,4 @@ -AC_REVISION("$Id: configure.in,v 1.253 1998/11/18 20:16:11 marcus Exp $") +AC_REVISION("$Id: configure.in,v 1.254 1998/11/22 11:02:38 hubbe Exp $") AC_INIT(interpret.c) AC_CONFIG_HEADER(machine.h) @@ -230,7 +230,7 @@ if test "x$with_rtldebug" = x ; then fi if test "x$with_rtldebug" = xyes ; then - AC_DEFINE(DEBUG) + AC_DEFINE(PIKE_DEBUG) fi ############################################################################# @@ -1572,7 +1572,7 @@ pike_cv_hardware_byteorder=0 )]) AC_MSG_RESULT($pike_cv_hardware_byteorder) -AC_DEFINE_UNQUOTED(BYTEORDER,$pike_cv_hardware_byteorder) +AC_DEFINE_UNQUOTED(PIKE_BYTEORDER,$pike_cv_hardware_byteorder) dnl##################################################################### diff --git a/src/cpp.c b/src/cpp.c index 048373aa17caa322c9c3bae2a1c5b7c58c639709..50b2aa33d8d4697683d1d5c2335a5268f42e87b6 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -5,7 +5,7 @@ \*/ /* - * $Id: cpp.c,v 1.29 1998/10/09 17:56:31 hubbe Exp $ + * $Id: cpp.c,v 1.30 1998/11/22 11:02:39 hubbe Exp $ */ #include "global.h" #include "dynamic_buffer.h" @@ -496,6 +496,11 @@ void PUSH_STRING(char *str, low_my_putchar(((c>>6)&7)+'0', buf); low_my_putchar(((c>>3)&7)+'0', buf); low_my_putchar((c&7)+'0', buf); + if(EXTRACT_UCHAR(str+p2+1)>='0' && EXTRACT_UCHAR(str+p2+1)<='7') + { + low_my_putchar('"',buf); + low_my_putchar('"',buf); + } } break; } @@ -1298,7 +1303,7 @@ static INT32 low_cpp(struct cpp *this, str.s.len--; if(!str.s.len && sp-partbase>1) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(sp[-1].type != T_INT) fatal("Internal error in CPP\n"); #endif @@ -1393,7 +1398,7 @@ static INT32 low_cpp(struct cpp *this, partbase[e*2+2].u.string); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(def->num_parts==1 && (def->parts[0].argument & DEF_ARG_MASK) > MAX_ARGS) fatal("Internal error in define\n"); @@ -1537,7 +1542,7 @@ static INT32 calcC(struct cpp *this,char *data,INT32 len,INT32 pos) } default: -#ifdef DEBUG +#ifdef PIKE_DEBUG if(isidchar(data[pos])) error("Syntax error in #if (should not happen)\n"); #endif diff --git a/src/docode.c b/src/docode.c index 8d78e520f0e9e91d4fc4954a29a7b9c33d670301..c013ee81700899a8ae3e532b26a751145b9b02b0 100644 --- a/src/docode.c +++ b/src/docode.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: docode.c,v 1.41 1998/11/16 22:14:49 hubbe Exp $"); +RCSID("$Id: docode.c,v 1.42 1998/11/22 11:02:41 hubbe Exp $"); #include "las.h" #include "program.h" #include "language.h" @@ -318,7 +318,7 @@ static int do_docode2(node *n,int flags) case F_MOD_EQ: case F_DIV_EQ: tmp1=do_docode(CAR(n),DO_LVALUE); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(tmp1 != 2) fatal("HELP! FATAL INTERNAL COMPILER ERROR (7)\n"); #endif @@ -460,7 +460,7 @@ static int do_docode2(node *n,int flags) case F_INC: case F_POST_INC: tmp1=do_docode(CAR(n),DO_LVALUE); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(tmp1 != 2) fatal("HELP! FATAL INTERNAL COMPILER ERROR (1)\n"); #endif @@ -477,7 +477,7 @@ static int do_docode2(node *n,int flags) case F_DEC: case F_POST_DEC: tmp1=do_docode(CAR(n),DO_LVALUE); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(tmp1 != 2) fatal("HELP! FATAL INTERNAL COMPILER ERROR (2)\n"); #endif @@ -534,7 +534,7 @@ static int do_docode2(node *n,int flags) tmp2=do_docode(CAR(n),DO_NOT_COPY); emit2(F_CONST0); -#ifdef DEBUG +#ifdef PIKE_DEBUG /* This is really ugly because there is always a chance that the bug * will disappear when new instructions are added to the code, but * think it is worth it. @@ -550,7 +550,7 @@ static int do_docode2(node *n,int flags) do_jump(n->token,tmp1); ins_label(current_break); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag) emit2(F_POP_MARK); #endif @@ -576,7 +576,7 @@ static int do_docode2(node *n,int flags) current_continue=alloc_label(); tmp2=do_docode(CAR(n),0); -#ifdef DEBUG +#ifdef PIKE_DEBUG /* This is really ugly because there is always a chance that the bug * will disappear when new instructions are added to the code, but * think it is worth it. @@ -592,7 +592,7 @@ static int do_docode2(node *n,int flags) emit(F_LABEL,tmp3); do_jump(n->token,tmp1); ins_label(current_break); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag) emit2(F_POP_MARK); #endif @@ -746,7 +746,7 @@ static int do_docode2(node *n,int flags) INT32 prev_switch_default = current_switch_default; INT32 *prev_switch_jumptable = current_switch_jumptable; INT32 break_save = current_break; -#ifdef DEBUG +#ifdef PIKE_DEBUG struct svalue *save_sp=sp; #endif @@ -776,7 +776,7 @@ static int do_docode2(node *n,int flags) DO_CODE_BLOCK(CDR(n)); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(sp-save_sp != cases) fatal("Count cases is wrong!\n"); #endif @@ -829,7 +829,7 @@ static int do_docode2(node *n,int flags) emit(F_LABEL, current_break); current_break=break_save; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(recoveries && sp-evaluator_stack < recoveries->sp) fatal("Stack error after F_SWITCH (underflow)\n"); #endif @@ -967,7 +967,7 @@ static int do_docode2(node *n,int flags) case F_ARRAY_LVALUE: tmp1=do_docode(CAR(n),DO_LVALUE); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(tmp1 & 1) fatal("Very internal compiler error.\n"); #endif @@ -1003,7 +1003,7 @@ static int do_docode2(node *n,int flags) mklval ? DO_LVALUE_IF_POSSIBLE : 0); if(tmp1==2) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!mklval) fatal("Unwanted lvalue!\n"); #endif @@ -1069,7 +1069,7 @@ static int do_docode2(node *n,int flags) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG case T_OBJECT: if(n->u.sval.u.object->next == n->u.sval.u.object) fatal("Internal error: Pointer to parent cannot be a compile time constant!\n"); diff --git a/src/dynamic_buffer.c b/src/dynamic_buffer.c index 152072c5d636dfdacd895ea958cf4f525f7acad8..cfcc4b281268f7c780094d1c4e552c4efa10556c 100644 --- a/src/dynamic_buffer.c +++ b/src/dynamic_buffer.c @@ -9,14 +9,14 @@ #include "error.h" #include "pike_memory.h" -RCSID("$Id: dynamic_buffer.c,v 1.8 1998/03/28 15:33:52 grubba Exp $"); +RCSID("$Id: dynamic_buffer.c,v 1.9 1998/11/22 11:02:42 hubbe Exp $"); static dynamic_buffer buff; char *low_make_buf_space(INT32 space, dynamic_buffer *buf) { char *ret; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!buf->s.str) fatal("ARRRRGH! Deadly Trap!\n"); #endif @@ -39,7 +39,7 @@ char *low_make_buf_space(INT32 space, dynamic_buffer *buf) void low_my_putchar(char b,dynamic_buffer *buf) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!buf->s.str) fatal("Error in internal buffering.\n"); #endif @@ -48,7 +48,7 @@ void low_my_putchar(char b,dynamic_buffer *buf) void low_my_binary_strcat(const char *b,INT32 l,dynamic_buffer *buf) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!buf->s.str) fatal("Error in internal buffering.\n"); #endif @@ -83,7 +83,7 @@ void low_init_buf_with_string(string s, dynamic_buffer *buf) the bufsize back */ for(buf->bufsize=BUFFER_BEGIN_SIZE;buf->bufsize<buf->s.len;buf->bufsize*=2); buf->s.str=realloc(buf->s.str,buf->bufsize); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!buf->s.str) fatal("Realloc failed.\n"); #endif diff --git a/src/encode.c b/src/encode.c index 57e774b9d654a309d75f112762be19bed7de7dba..a5d4c5ed291cba7e5db0678f52de36c2e63a427c 100644 --- a/src/encode.c +++ b/src/encode.c @@ -23,7 +23,7 @@ #include "stuff.h" #include "version.h" -RCSID("$Id: encode.c,v 1.25 1998/10/22 05:02:22 hubbe Exp $"); +RCSID("$Id: encode.c,v 1.26 1998/11/22 11:02:43 hubbe Exp $"); #ifdef _AIX #include <net/nh.h> @@ -56,7 +56,7 @@ double LDEXP(double x, int exp) } #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG #define encode_value2 encode_value2_ #define decode_value2 decode_value2_ #endif @@ -224,7 +224,7 @@ one_more_type: static void encode_value2(struct svalue *val, struct encode_data *data) -#ifdef DEBUG +#ifdef PIKE_DEBUG #undef encode_value2 #define encode_value2(X,Y) do { struct svalue *_=sp; encode_value2_(X,Y); if(sp!=_) fatal("encode_value2 failed!\n"); } while(0) #endif @@ -674,7 +674,7 @@ one_more_type: static void decode_value2(struct decode_data *data) -#ifdef DEBUG +#ifdef PIKE_DEBUG #undef decode_value2 #define decode_value2(X) do { struct svalue *_=sp; decode_value2_(X); if(sp!=_+1) fatal("decode_value2 failed!\n"); } while(0) #endif diff --git a/src/error.c b/src/error.c index ff8be2a2ae632e9c9c2fdc41b53d260714f2ea01..80ca318fd404b9ad599b3b2228460d5977b2fc89 100644 --- a/src/error.c +++ b/src/error.c @@ -16,7 +16,7 @@ #include "backend.h" #include "operators.h" -RCSID("$Id: error.c,v 1.21 1998/07/16 23:09:39 hubbe Exp $"); +RCSID("$Id: error.c,v 1.22 1998/11/22 11:02:44 hubbe Exp $"); #undef ATTRIBUTE #define ATTRIBUTE(X) @@ -25,7 +25,7 @@ JMP_BUF *recoveries=0; JMP_BUF *init_recovery(JMP_BUF *r DEBUG_LINE_ARGS) { -#ifdef DEBUG +#ifdef PIKE_DEBUG r->line=line; r->file=file; #endif @@ -55,14 +55,14 @@ void pike_throw(void) ATTRIBUTE((noreturn)) if(!recoveries) fatal("No error recovery context.\n"); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(sp - evaluator_stack < recoveries->sp) fatal("Stack error in error.\n"); #endif while(fp != recoveries->fp) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!fp) fatal("Popped out of stack frames.\n"); #endif @@ -120,7 +120,7 @@ void va_error(const char *fmt, va_list args) ATTRIBUTE((noreturn)) if(!recoveries) { -#ifdef DEBUG +#ifdef PIKE_DEBUG dump_backlog(); #endif @@ -156,7 +156,7 @@ void new_error(const char *name, const char *text, struct svalue *oldsp, if(!recoveries) { -#ifdef DEBUG +#ifdef PIKE_DEBUG dump_backlog(); #endif @@ -198,7 +198,7 @@ void new_error(const char *name, const char *text, struct svalue *oldsp, void exit_on_error(void *msg) { -#ifdef DEBUG +#ifdef PIKE_DEBUG dump_backlog(); #endif fprintf(stderr,"%s\n",(char *)msg); @@ -207,7 +207,7 @@ void exit_on_error(void *msg) void fatal_on_error(void *msg) { -#ifdef DEBUG +#ifdef PIKE_DEBUG dump_backlog(); #endif fprintf(stderr,"%s\n",(char *)msg); @@ -236,7 +236,7 @@ void debug_fatal(const char *fmt, ...) ATTRIBUTE((noreturn,format (printf, 1, 2) abort(); } in_fatal = 1; -#ifdef DEBUG +#ifdef PIKE_DEBUG dump_backlog(); #endif diff --git a/src/error.h b/src/error.h index fcf39f18520e7bd64754586d8cb6c9359244064b..41bf2bdd3b83c1fca977ce1582edc7b39ac8ab30 100644 --- a/src/error.h +++ b/src/error.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: error.h,v 1.24 1998/07/17 12:33:52 grubba Exp $ + * $Id: error.h,v 1.25 1998/11/22 11:02:45 hubbe Exp $ */ #ifndef ERROR_H #define ERROR_H @@ -44,17 +44,17 @@ struct frame; typedef struct ONERROR { struct ONERROR *previous; -#ifdef DEBUG +#ifdef PIKE_DEBUG const char *file; int line; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ error_call func; void *arg; } ONERROR; typedef struct JMP_BUF { -#ifdef DEBUG +#ifdef PIKE_DEBUG int line; char *file; #endif @@ -71,7 +71,7 @@ extern JMP_BUF *recoveries; extern struct svalue throw_value; extern int throw_severity; -#ifdef DEBUG +#ifdef PIKE_DEBUG #define UNSETJMP(X) do{ \ if(recoveries != &X) { \ if(recoveries) \ @@ -90,7 +90,7 @@ extern int throw_severity; #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG #define SET_ONERROR(X,Y,Z) \ do{ \ OED_FPRINTF((stderr, "SET_ONERROR(%p, %p, %p) %s:%d\n", \ @@ -129,7 +129,7 @@ extern int throw_severity; __FILE__, __LINE__, &(X)); \ } \ }while(0) -#else /* !DEBUG */ +#else /* !PIKE_DEBUG */ #define SET_ONERROR(X,Y,Z) \ do{ \ if(!recoveries) break; \ @@ -142,16 +142,16 @@ extern int throw_severity; #define UNSET_ONERROR(X) recoveries && (recoveries->onerror=X.previous) #define ASSERT_ONERROR(X) -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ -#if defined(DEBUG) && 0 +#if defined(PIKE_DEBUG) && 0 /* Works, but probably not interresting for most people * /grubba 1998-04-11 */ #define PIKE_ERROR(NAME, TEXT, SP, ARGS) new_error(NAME, TEXT, SP, ARGS, __FILE__, __LINE__); #else #define PIKE_ERROR(NAME, TEXT, SP, ARGS) new_error(NAME, TEXT, SP, ARGS, NULL, 0); -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ /* Prototypes begin here */ JMP_BUF *init_recovery(JMP_BUF *r DEBUG_LINE_ARGS); diff --git a/src/fd_control.c b/src/fd_control.c index 31667319ba16350ae17ca620d6007cc1f847e6a6..eb44319ed0ebe0f14863b4a236622026b973513e 100644 --- a/src/fd_control.c +++ b/src/fd_control.c @@ -9,7 +9,7 @@ #include "error.h" #include "fdlib.h" -RCSID("$Id: fd_control.c,v 1.21 1998/09/01 20:28:08 hubbe Exp $"); +RCSID("$Id: fd_control.c,v 1.22 1998/11/22 11:02:46 hubbe Exp $"); #else /* TESTING */ #ifndef _LARGEFILE_SOURCE @@ -22,7 +22,7 @@ RCSID("$Id: fd_control.c,v 1.21 1998/09/01 20:28:08 hubbe Exp $"); # define __STDC_EXT__ #endif /* !__STDC_EXT__ */ #include <sys/types.h> -#undef DEBUG +#undef PIKE_DEBUG #define fd_ioctl ioctl #endif @@ -63,7 +63,7 @@ RCSID("$Id: fd_control.c,v 1.21 1998/09/01 20:28:08 hubbe Exp $"); int set_nonblocking(int fd,int which) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd >MAX_OPEN_FILEDESCRIPTORS) fatal("Filedescriptor %d out of range [0,%d).\n", fd, MAX_OPEN_FILEDESCRIPTORS); @@ -95,7 +95,7 @@ int set_nonblocking(int fd,int which) int query_nonblocking(int fd) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fd<0 || fd > MAX_OPEN_FILEDESCRIPTORS) fatal("Filedescriptor out of range.\n"); #endif diff --git a/src/fdlib.h b/src/fdlib.h index 29a6eb331dc63c714d6c660bcbf439cbea3247ac..c8b42bf561ef0a11d1517c42c3498fe899a53c03 100644 --- a/src/fdlib.h +++ b/src/fdlib.h @@ -1,5 +1,5 @@ /* - * $Id: fdlib.h,v 1.20 1998/07/16 19:12:12 hubbe Exp $ + * $Id: fdlib.h,v 1.21 1998/11/22 11:02:47 hubbe Exp $ */ #ifndef FDLIB_H #define FDLIB_H @@ -147,7 +147,7 @@ struct my_fd_set_s typedef struct my_fd_set_s my_fd_set; -#ifdef DEBUG +#ifdef PIKE_DEBUG #define fd_check_fd(X) do { if(fd_type[X]>=0) fatal("FD_SET on closed fd %d (%d) %s:%d.\n",X,da_handle[X],__FILE__,__LINE__); }while(0) #else #define fd_check_fd(X) diff --git a/src/gc.c b/src/gc.c index 36a5de659b98260e0a8245cdd5934e0142040254..cbad3a6bb773161b3b906fa72a474f61158faf8b 100644 --- a/src/gc.c +++ b/src/gc.c @@ -25,7 +25,7 @@ struct callback *gc_evaluator_callback=0; #include "main.h" #include <math.h> -RCSID("$Id: gc.c,v 1.38 1998/04/29 15:06:29 noring Exp $"); +RCSID("$Id: gc.c,v 1.39 1998/11/22 11:02:48 hubbe Exp $"); /* Run garbage collect approximate every time we have * 20 percent of all arrays, objects and programs is @@ -62,7 +62,7 @@ struct callback *add_gc_callback(callback_func call, struct marker { INT32 refs; -#ifdef DEBUG +#ifdef PIKE_DEBUG INT32 xrefs; #endif INT32 flags; @@ -105,7 +105,7 @@ static struct marker *getmark(void *a) hashval=(unsigned long)a; hashval%=hashsize; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(hashval >= hashsize) fatal("Compiler has buggy modulo operator.\n"); #endif @@ -117,7 +117,7 @@ static struct marker *getmark(void *a) m=new_marker(); m->marked=a; m->refs=0; -#ifdef DEBUG +#ifdef PIKE_DEBUG m->xrefs=0; #endif m->flags=0; @@ -127,7 +127,7 @@ static struct marker *getmark(void *a) return m; } -#ifdef DEBUG +#ifdef PIKE_DEBUG time_t last_gc; @@ -394,7 +394,7 @@ void describe(void *x) INT32 gc_check(void *a) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(check_for) { if(check_for == a) @@ -437,7 +437,7 @@ static void exit_gc(void) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG void locate_references(void *a) { if(!in_gc) @@ -477,7 +477,7 @@ int gc_is_referenced(void *a) { struct marker *m; m=getmark(a); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(m->refs + m->xrefs > *(INT32 *)a || (!(m->refs < *(INT32 *)a) && m->xrefs) ) { @@ -499,7 +499,7 @@ int gc_is_referenced(void *a) return m->refs < *(INT32 *)a; } -#ifdef DEBUG +#ifdef PIKE_DEBUG int gc_external_mark(void *a) { struct marker *m; @@ -542,7 +542,7 @@ int gc_do_free(void *a) { struct marker *m; m=getmark(a); -#ifdef DEBUG +#ifdef PIKE_DEBUG if( !(m->flags & GC_REFERENCED) && m->flags & GC_XREFERENCED ) { INT32 refs=m->refs; @@ -580,7 +580,7 @@ void do_gc(void) tmp2=num_objects; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(t_flag) fprintf(stderr,"Garbage collecting ... "); if(num_objects < 0) @@ -652,7 +652,7 @@ void do_gc(void) alloc_threshold = MAX_ALLOC_THRESHOLD; num_allocs=0; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(t_flag) fprintf(stderr,"done (freed %ld of %ld objects).\n", (long)(tmp2-num_objects),(long)tmp2); diff --git a/src/gc.h b/src/gc.h index 519e9fa288e42e23f5f1f04628d510a35c1429f5..ea4fa1654cb90b6dfa07a03ec7590555efe476e1 100644 --- a/src/gc.h +++ b/src/gc.h @@ -1,5 +1,5 @@ /* - * $Id: gc.h,v 1.19 1998/04/29 15:06:28 noring Exp $ + * $Id: gc.h,v 1.20 1998/11/22 11:02:49 hubbe Exp $ */ #ifndef GC_H #define GC_H @@ -15,7 +15,7 @@ extern INT32 alloc_threshold; extern struct callback *gc_evaluator_callback; extern struct callback_list evaluator_callbacks; -#ifdef DEBUG +#ifdef PIKE_DEBUG extern void *gc_svalue_location; #endif @@ -51,7 +51,7 @@ int gc_do_free(void *a); void do_gc(void); /* Prototypes end here */ -#ifdef DEBUG +#ifdef PIKE_DEBUG #define GC_FREE() do { num_objects-- ; if(num_objects < 0) fatal("Panic!! less than zero objects!\n"); }while(0) #else #define debug_gc_check_svalues(S,N,T,V) gc_check_svalues(S,N) diff --git a/src/global.h b/src/global.h index b729eda064c7d96d916031d1a18a20e1a3b796b8..cd6b76d2d85435ffcb64c65de383f2261a48d0c5 100644 --- a/src/global.h +++ b/src/global.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: global.h,v 1.25 1998/10/11 11:18:51 hubbe Exp $ + * $Id: global.h,v 1.26 1998/11/22 11:02:50 hubbe Exp $ */ #ifndef GLOBAL_H #define GLOBAL_H @@ -203,7 +203,7 @@ typedef unsigned INT32 p_wchar2; static char *rcsid = X #endif -#if defined(__GNUC__) && !defined(DEBUG) && !defined(lint) +#if defined(__GNUC__) && !defined(PIKE_DEBUG) && !defined(lint) #define INLINE inline #else #define INLINE diff --git a/src/hashtable.c b/src/hashtable.c index 03e2e3f243b5e634813ab5610042a7d9d3f5634e..237b3d537f499aeab0942b639534783f3c73bd72 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -9,7 +9,7 @@ #include "stuff.h" #include "error.h" -RCSID("$Id: hashtable.c,v 1.4 1998/03/28 15:14:56 grubba Exp $"); +RCSID("$Id: hashtable.c,v 1.5 1998/11/22 11:02:51 hubbe Exp $"); static unsigned INT32 gobble(struct pike_string *s) { @@ -82,7 +82,7 @@ struct hash_table *hash_rehash(struct hash_table *h,int size) struct hash_table *new; int e; -#ifdef DEBUG +#ifdef PIKE_DEBUG if( 1 << my_log2(size) != size) fatal("Size is not a exponent of two!\n"); #endif @@ -140,7 +140,7 @@ struct hash_table *hash_unlink(struct hash_table *h, struct hash_entry *s) return h; } } -#ifdef DEBUG +#ifdef PIKE_DEBUG fatal("hash_entry not in hashtable\n"); #endif return h; diff --git a/src/interpret.c b/src/interpret.c index 580448b472cfc2075f2482ded9e975cf350d3ff5..afd87ae6c7602af5170eb3fc796200eb9dbd2ce8 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: interpret.c,v 1.110 1998/11/20 19:01:06 hubbe Exp $"); +RCSID("$Id: interpret.c,v 1.111 1998/11/22 11:02:53 hubbe Exp $"); #include "interpret.h" #include "object.h" #include "program.h" @@ -83,7 +83,7 @@ void push_sp_mark(void) } int pop_sp_mark(void) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(mark_sp < mark_stack) fatal("Mark stack underflow!\n"); #endif @@ -92,7 +92,7 @@ int pop_sp_mark(void) struct frame *fp; /* frame pointer */ -#ifdef DEBUG +#ifdef PIKE_DEBUG static void gc_check_stack_callback(struct callback *foo, void *bar, void *gazonk) { struct frame *f; @@ -177,7 +177,7 @@ use_malloc: mark_sp=mark_stack; fp=0; -#ifdef DEBUG +#ifdef PIKE_DEBUG { static struct callback *spcb; if(!spcb) @@ -375,7 +375,7 @@ union anything *get_pointer_if_this_type(struct svalue *lval, TYPE_T t) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG void print_return_value(void) { if(t_flag>3) @@ -402,7 +402,7 @@ void print_return_value(void) struct callback_list evaluator_callbacks; -#ifdef DEBUG +#ifdef PIKE_DEBUG static char trace_buffer[200]; #define GET_ARG() (backlog[backlogp].arg=(\ instr=prefix,\ @@ -484,7 +484,7 @@ void reset_evaluator(void) pop_n_elems(sp - evaluator_stack); } -#ifdef DEBUG +#ifdef PIKE_DEBUG #define BACKLOG 512 struct backlog { @@ -536,7 +536,7 @@ static int eval_instruction(unsigned char *pc) fp->pc = pc; instr=EXTRACT_UCHAR(pc++); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag) { #if defined(_REENTRANT) && !defined(__NT__) @@ -690,7 +690,7 @@ static int eval_instruction(unsigned char *pc) { if(inherit->parent_offset) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(t_flag>4) { sprintf(trace_buffer,"- Following o->parent (accumulator+=%d)\n",inherit->parent_offset-1); @@ -702,7 +702,7 @@ static int eval_instruction(unsigned char *pc) o=o->parent; accumulator+=inherit->parent_offset-1; }else{ -#ifdef DEBUG +#ifdef PIKE_DEBUG if(t_flag>4) { sprintf(trace_buffer,"- Following inherit->parent (accumulator+=%d)\n",inherit->parent_offset-1); @@ -1463,7 +1463,7 @@ static int eval_instruction(unsigned char *pc) CASE(F_RETURN); do_return: -#if defined(DEBUG) && defined(GC2) +#if defined(PIKE_DEBUG) && defined(GC2) if(d_flag>2) do_gc(); if(d_flag>3) do_debug(); check_threads_etc(); @@ -1863,7 +1863,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) case T_FUNCTION: if(s->subtype == FUNCTION_BUILTIN) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(t_flag>1) { init_buf(); @@ -1881,7 +1881,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) break; case T_ARRAY: -#ifdef DEBUG +#ifdef PIKE_DEBUG if(t_flag>1) { init_buf(); @@ -1893,7 +1893,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) break; case T_PROGRAM: -#ifdef DEBUG +#ifdef PIKE_DEBUG if(t_flag>1) { init_buf(); @@ -1913,7 +1913,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) } call_lfun: -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fun < 0 || fun >= NUM_LFUNS) fatal("Apply lfun on illegal value!\n"); #endif @@ -1945,7 +1945,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) check_mark_stack(256); check_c_stack(8192); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag>2) do_debug(); #endif @@ -1953,7 +1953,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) if(!p) PIKE_ERROR("destructed object->function", "Cannot call functions in destructed objects.\n", sp, args); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fun>=(int)p->num_identifier_references) { fprintf(stderr,"Function index out of range. %d >= %d\n",fun,(int)p->num_identifier_references); @@ -1966,7 +1966,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) #endif ref = p->identifier_references + fun; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(ref->inherit_offset>=p->num_inherits) fatal("Inherit offset out of range in program.\n"); #endif @@ -2089,7 +2089,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) clear_svalues(sp, num_locals - args); sp += num_locals - args; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(num_locals < num_args) fatal("Wrong number of arguments or locals in function def.\n"); #endif @@ -2101,13 +2101,13 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) { struct svalue **save_mark_sp=mark_sp; tailrecurse=eval_instruction(pc); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(mark_sp < save_mark_sp) fatal("Popped below save_mark_sp!\n"); #endif mark_sp=save_mark_sp; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(sp<evaluator_stack) fatal("Stack error (also simple).\n"); #endif @@ -2123,7 +2123,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) time_passed = gethrtime() - time_base - start_time; self_time=time_passed - time_in_children; accounted_time+=self_time; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(self_time < 0 || children_base <0 || accounted_time <0) fatal("Time is negative\n self_time=%ld\n time_passed=%ld\n time_in_children=%ld\n children_base=%ld\n accounted_time=%ld!\n time_base=%ld\n start_time=%ld\n", (long)(self_time/100000), @@ -2146,7 +2146,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) { pop_n_elems(sp - new_frame.locals -1); }else if(sp - new_frame.locals < 1){ -#ifdef DEBUG +#ifdef PIKE_DEBUG if(sp - new_frame.locals<0) fatal("Frame underflow.\n"); #endif sp->u.integer = 0; @@ -2249,7 +2249,7 @@ int apply_low_safe_and_stupid(struct object *o, INT32 offset) int tmp=eval_instruction(o->prog->program + offset); if(tmp!=-1) mega_apply(APPLY_STACK, tmp, 0,0); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(sp<evaluator_stack) fatal("Stack error (simple).\n"); #endif @@ -2307,7 +2307,7 @@ void safe_apply_low(struct object *o,int fun,int args) void safe_apply(struct object *o, char *fun ,INT32 args) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!o->prog) fatal("Apply safe on destructed object.\n"); #endif safe_apply_low(o, find_identifier(fun, o->prog), args); @@ -2315,7 +2315,7 @@ void safe_apply(struct object *o, char *fun ,INT32 args) void apply_lfun(struct object *o, int fun, int args) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fun < 0 || fun >= NUM_LFUNS) fatal("Apply lfun on illegal value!\n"); #endif @@ -2356,14 +2356,14 @@ void apply_svalue(struct svalue *s, INT32 args) { push_int(0); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(sp < (expected_stack + evaluator_stack)) fatal("Stack underflow!\n"); #endif } } -#ifdef DEBUG +#ifdef PIKE_DEBUG void slow_check_stack(void) { struct svalue *s,**m; @@ -2411,7 +2411,7 @@ void slow_check_stack(void) void cleanup_interpret(void) { -#ifdef DEBUG +#ifdef PIKE_DEBUG int e; #endif @@ -2423,7 +2423,7 @@ void cleanup_interpret(void) fp = fp->parent_frame; } -#ifdef DEBUG +#ifdef PIKE_DEBUG for(e=0;e<BACKLOG;e++) { if(backlog[e].program) diff --git a/src/interpret.h b/src/interpret.h index 6bc393f5b58af9d0d4a853b94434912cc048bbc8..2c810ffa59dae2db01223e373581d830566c1934 100644 --- a/src/interpret.h +++ b/src/interpret.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: interpret.h,v 1.23 1998/11/20 01:57:23 hubbe Exp $ + * $Id: interpret.h,v 1.24 1998/11/22 11:02:54 hubbe Exp $ */ #ifndef INTERPRET_H #define INTERPRET_H @@ -31,7 +31,7 @@ struct frame INT16 num_args; }; -#ifdef DEBUG +#ifdef PIKE_DEBUG #define debug_check_stack() do{if(sp<evaluator_stack)fatal("Stack error.\n");}while(0) #define check__positive(X,Y) if((X)<0) fatal(Y) #include "error.h" @@ -113,7 +113,7 @@ do{ \ #define check_threads_etc() \ call_callback(& evaluator_callbacks, (void *)0) -#ifdef DEBUG +#ifdef PIKE_DEBUG #define fast_check_threads_etc(X) do { \ static int div_; if(d_flag || !(div_++& ((1<<(X))-1))) check_threads_etc(); } while(0) diff --git a/src/language.yacc b/src/language.yacc index 0533afb5a1557af681568601f98555cfce1ea076..7a9ec216caf34ef50e7d73f38b8de57f594fdd9a 100644 --- a/src/language.yacc +++ b/src/language.yacc @@ -179,7 +179,7 @@ /* This is the grammar definition of Pike. */ #include "global.h" -RCSID("$Id: language.yacc,v 1.107 1998/11/16 22:14:52 hubbe Exp $"); +RCSID("$Id: language.yacc,v 1.108 1998/11/22 11:02:55 hubbe Exp $"); #ifdef HAVE_MEMORY_H #include <memory.h> #endif @@ -201,7 +201,7 @@ RCSID("$Id: language.yacc,v 1.107 1998/11/16 22:14:52 hubbe Exp $"); #define YYMAXDEPTH 1000 -#ifdef DEBUG +#ifdef PIKE_DEBUG #ifndef YYDEBUG /* May also be defined by machine.h */ #define YYDEBUG 1 @@ -639,7 +639,7 @@ def: modifiers type_or_error optional_stars F_IDENTIFIER } f=dooptcode($4->u.sval.u.string, $10, $<n>9->u.sval.u.string, $1); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(recoveries && sp-evaluator_stack < recoveries->sp) fatal("Stack error (underflow)\n"); #endif @@ -2035,7 +2035,7 @@ void yyerror(char *str) extern int num_parse_error; extern int cumulative_parse_error; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(recoveries && sp-evaluator_stack < recoveries->sp) fatal("Stack error (underflow)\n"); #endif diff --git a/src/las.c b/src/las.c index 98b1a38e523d5a27c54b364d553ac8baee90dc8f..1716c0317be66268b93297297264923f4c8bd2ad 100644 --- a/src/las.c +++ b/src/las.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: las.c,v 1.70 1998/11/17 23:16:39 hubbe Exp $"); +RCSID("$Id: las.c,v 1.71 1998/11/22 11:02:56 hubbe Exp $"); #include "language.h" #include "interpret.h" @@ -74,7 +74,7 @@ int cdr_is_node(node *n) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG void check_tree(node *n, int depth) { if(!d_flag) return; @@ -210,7 +210,7 @@ void free_all_nodes(void) struct node_chunk *tmp2; int e=0; -#ifndef DEBUG +#ifndef PIKE_DEBUG if(cumulative_parse_error) { #endif @@ -231,7 +231,7 @@ void free_all_nodes(void) if(!tmp) { tmp=tmp2->nodes+e; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!cumulative_parse_error) { fprintf(stderr,"Free node at %p, (%s:%d) (token=%d).\n",tmp, tmp->current_file->str, tmp->line_number, tmp->token); @@ -251,12 +251,12 @@ void free_all_nodes(void) } } } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!cumulative_parse_error) fatal("Failed to free %d nodes when compiling!\n",e2); #endif } -#ifndef DEBUG +#ifndef PIKE_DEBUG } #endif while(node_chunks) @@ -273,7 +273,7 @@ void free_all_nodes(void) void free_node(node *n) { if(!n) return; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(l_flag>9) print_tree(n); #endif @@ -294,7 +294,7 @@ void free_node(node *n) } n->token=USHRT_MAX; if(n->type) free_string(n->type); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(n->current_file) free_string(n->current_file); #endif CAR(n)=free_nodes; @@ -322,7 +322,7 @@ static node *mkemptynode(void) free_nodes=CAR(res); res->token=0; res->line_number=lex.current_line; -#ifdef DEBUG +#ifdef PIKE_DEBUG copy_shared_string(res->current_file, lex.current_file); #endif res->type=0; @@ -335,7 +335,7 @@ static node *mkemptynode(void) node *mknode(short token,node *a,node *b) { node *res; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(a && a==b) fatal("mknode: a and be are the same!\n"); #endif @@ -414,7 +414,7 @@ node *mknode(short token,node *a,node *b) res->type = 0; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 3) verify_shared_strings_tables(); #endif @@ -426,7 +426,7 @@ node *mknode(short token,node *a,node *b) check_tree(res,0); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 3) verify_shared_strings_tables(); #endif @@ -1427,7 +1427,7 @@ static int depend_p3(node *a,node *b) return depend_p2(a,b); } -#ifdef DEBUG +#ifdef PIKE_DEBUG static int depend_p(node *a,node *b) { int ret; @@ -1785,7 +1785,7 @@ static void optimize(node *n) fix_type_field(n); debug_malloc_touch(n->type); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(l_flag > 3 && n) { fprintf(stderr,"Optimizing (tree info=%x):",n->tree_info); @@ -2159,7 +2159,7 @@ static void optimize(node *n) if(tmp1) tmp1->parent = n->parent; free_node(n); n=tmp1; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(l_flag > 3) { fprintf(stderr,"Result: "); @@ -2198,7 +2198,7 @@ int eval_low(node *n) struct svalue *save_sp = sp; int ret; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(l_flag > 3 && n) { fprintf(stderr,"Evaluating (tree info=%x):",n->tree_info); @@ -2410,7 +2410,7 @@ int dooptcode(struct pike_string *name, check_tree(n,0); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(a_flag > 1) fprintf(stderr,"Doing function '%s' at %x\n",name->str,PC); #endif @@ -2426,7 +2426,7 @@ int dooptcode(struct pike_string *name, if(compiler_pass==1) { tmp.offset=-1; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(a_flag > 4) { fprintf(stderr,"Making prototype (pass 1) for: "); @@ -2447,7 +2447,7 @@ int dooptcode(struct pike_string *name, IDENTIFIER_C_FUNCTION | vargs, &tmp); free_node(n); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(a_flag > 1) fprintf(stderr,"Identifer (C) = %d\n",ret); #endif @@ -2459,7 +2459,7 @@ int dooptcode(struct pike_string *name, add_to_program(compiler_frame->max_number_of_locals); add_to_program(args); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(a_flag > 2) { fprintf(stderr,"Coding: "); @@ -2483,7 +2483,7 @@ int dooptcode(struct pike_string *name, &tmp); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(a_flag > 1) fprintf(stderr,"Identifer = %d\n",ret); #endif diff --git a/src/las.h b/src/las.h index 8b63e0dc0442ecf73f8805046ab8a43ea6eaeac8..635766e50bc0ae34a4065653268604b7fb24c3f2 100644 --- a/src/las.h +++ b/src/las.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: las.h,v 1.16 1998/08/29 22:15:18 grubba Exp $ + * $Id: las.h,v 1.17 1998/11/22 11:02:57 hubbe Exp $ */ #ifndef LAS_H #define LAS_H @@ -125,7 +125,7 @@ int dooptcode(struct pike_string *name, #define INHERIT(i) (new_program->inherits+(i)) #define PC (new_program->num_program) -#ifndef DEBUG +#ifndef PIKE_DEBUG #define check_tree(X,Y) #endif diff --git a/src/lex.c b/src/lex.c index 39766b8e5c6becc3f291d5227a029467e7cf02fd..80b403e33051a66213b0fe315d5f6b5a94a5197f 100644 --- a/src/lex.c +++ b/src/lex.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: lex.c,v 1.57 1998/11/16 22:14:53 hubbe Exp $"); +RCSID("$Id: lex.c,v 1.58 1998/11/22 11:02:58 hubbe Exp $"); #include "language.h" #include "array.h" #include "lex.h" @@ -44,7 +44,7 @@ int last_instruction=0; void exit_lex(void) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(p_flag) { int e; diff --git a/src/lex.h b/src/lex.h index aa4e1b1927b652c66a9de6be20a4a74c22ecf541..5b241428da54245be0abd27c07f83e6ff83186e4 100644 --- a/src/lex.h +++ b/src/lex.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: lex.h,v 1.11 1998/03/31 21:52:21 hubbe Exp $ + * $Id: lex.h,v 1.12 1998/11/22 11:03:00 hubbe Exp $ */ #ifndef LEX_H #define LEX_H @@ -26,7 +26,7 @@ struct keyword #define I_ISJUMP 7 #define I_DATA 9 -#ifdef DEBUG +#ifdef PIKE_DEBUG #define INSTR_PROFILING #endif @@ -36,7 +36,7 @@ extern int last_instruction; struct instr { -#ifdef DEBUG +#ifdef PIKE_DEBUG #ifdef INSTR_PROFILING long reruns[256]; #endif @@ -47,7 +47,7 @@ struct instr char *name; }; -#ifdef DEBUG +#ifdef PIKE_DEBUG #define ADD_COMPILED(X) instrs[(X)-F_OFFSET].compiles++ #ifdef INSTR_PROFILING #define ADD_RUNNED(X) do { int _x=(X)-F_OFFSET; instrs[last_instruction].reruns[_x]++; instrs[last_instruction=_x].runs++; } while(0) diff --git a/src/main.c b/src/main.c index 38877aaf4b273f537d8acb0c46c62d5393e35bb4..5a74e9f82ca656c20a70580f4ad0c36577e35f52 100644 --- a/src/main.c +++ b/src/main.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: main.c,v 1.59 1998/10/22 00:33:31 hubbe Exp $"); +RCSID("$Id: main.c,v 1.60 1998/11/22 11:03:01 hubbe Exp $"); #include "fdlib.h" #include "backend.h" #include "module.h" @@ -509,7 +509,7 @@ void low_exit_main(void) free_svalue(& throw_value); throw_value.type=T_INT; -#if defined(DEBUG) && defined(DEBUG_MALLOC) +#if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC) if(verbose_debug_exit) { INT32 num,size,recount=0; diff --git a/src/mapping.c b/src/mapping.c index 63411002ceab12d312c9ef30de423e253f65aba2..d3f5e82d2b316a41b0738f8c2ce6e9bcc8754df5 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: mapping.c,v 1.36 1998/08/05 22:48:36 hubbe Exp $"); +RCSID("$Id: mapping.c,v 1.37 1998/11/22 11:03:02 hubbe Exp $"); #include "main.h" #include "object.h" #include "mapping.h" @@ -27,7 +27,7 @@ RCSID("$Id: mapping.c,v 1.36 1998/08/05 22:48:36 hubbe Exp $"); struct mapping *first_mapping; -#ifdef DEBUG +#ifdef PIKE_DEBUG /* This function checks that the type field isn't lacking any bits. * It is used for debugging purposes only. */ @@ -64,7 +64,7 @@ static void init_mapping(struct mapping *m, INT32 size) INT32 e; INT32 hashsize,hashspace; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(size < 0) fatal("init_mapping with negative value.\n"); #endif if(size) @@ -125,7 +125,7 @@ void really_free_mapping(struct mapping *m) { INT32 e; struct keypair *k; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(m->refs) fatal("really free mapping on mapping with nonzero refs.\n"); #endif @@ -179,7 +179,7 @@ static void mapping_rehash_backwards(struct mapping *m, struct keypair *p) */ static struct mapping *rehash(struct mapping *m, int new_size) { -#ifdef DEBUG +#ifdef PIKE_DEBUG INT32 tmp=m->size; #endif INT32 e,hashsize; @@ -198,12 +198,12 @@ static struct mapping *rehash(struct mapping *m, int new_size) free((char *)hash); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(m->size != tmp) fatal("Rehash failed, size not same any more.\n"); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif @@ -228,7 +228,7 @@ void mapping_fix_type_field(struct mapping *m) ind_types |= 1 << k->ind.type; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(val_types & ~(m->val_types)) fatal("Mapping value types out of order!\n"); @@ -254,7 +254,7 @@ void mapping_insert(struct mapping *m, { h=h2 % m->hashsize; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif if(m->ind_types & (1 << key->type)) @@ -270,7 +270,7 @@ void mapping_insert(struct mapping *m, m->val_types |= 1 << val->type; assign_svalue(& k->val, val); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif return; @@ -297,7 +297,7 @@ void mapping_insert(struct mapping *m, assign_svalue_no_free(& k->val, val); m->size++; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif } @@ -315,7 +315,7 @@ union anything *mapping_get_item_ptr(struct mapping *m, { h=h2 % m->hashsize; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif @@ -329,7 +329,7 @@ union anything *mapping_get_item_ptr(struct mapping *m, if(k->val.type == t) return & ( k->val.u ); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif @@ -360,7 +360,7 @@ union anything *mapping_get_item_ptr(struct mapping *m, if(t != T_INT) return 0; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif @@ -391,7 +391,7 @@ void map_delete(struct mapping *m, if(m->size < (m->hashsize + 1) * MIN_LINK_LENGTH) rehash(m, MAP_SLOTS(m->size)); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif return; @@ -405,7 +405,7 @@ void check_mapping_for_destruct(struct mapping *m) struct keypair *k, **prev; TYPE_FIELD ind_types, val_types; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif @@ -442,7 +442,7 @@ void check_mapping_for_destruct(struct mapping *m) m->val_types = val_types; m->ind_types = ind_types; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif } @@ -454,7 +454,7 @@ struct svalue *low_mapping_lookup(struct mapping *m, unsigned INT32 h; struct keypair *k, **prev; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif if(!m->size) return 0; @@ -540,7 +540,7 @@ struct array *mapping_indices(struct mapping *m) a->type_field = m->ind_types; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif @@ -561,7 +561,7 @@ struct array *mapping_values(struct mapping *m) a->type_field = m->val_types; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif @@ -601,7 +601,7 @@ void mapping_replace(struct mapping *m,struct svalue *from, struct svalue *to) m->val_types |= 1 << to->type; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif @@ -613,7 +613,7 @@ struct mapping *mkmapping(struct array *ind, struct array *val) struct svalue *i,*v; INT32 e; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(ind->size != val->size) fatal("mkmapping on different sized arrays.\n"); #endif @@ -932,7 +932,7 @@ void mapping_search_no_free(struct svalue *to, } -#ifdef DEBUG +#ifdef PIKE_DEBUG void check_mapping(struct mapping *m) { @@ -1045,7 +1045,7 @@ void gc_check_all_mappings(void) m->val_types |= debug_gc_check_svalues(&k->val, 1, T_MAPPING, m); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 1) check_mapping_type_fields(m); #endif @@ -1104,7 +1104,7 @@ void gc_free_all_unreferenced_mappings(void) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG void simple_describe_mapping(struct mapping *m) { @@ -1145,7 +1145,7 @@ void zap_all_mappings(void) { add_ref(m); -#if defined(DEBUG) && defined(DEBUG_MALLOC) +#if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC) if(verbose_debug_exit) debug_dump_mapping(m); #endif diff --git a/src/modules/Odbc/odbc.c b/src/modules/Odbc/odbc.c index fffc61e05ed5c332ede53b97a1f347f45c568322..4d408a746f86616ba2acf0bff0470ca8ae7076ab 100644 --- a/src/modules/Odbc/odbc.c +++ b/src/modules/Odbc/odbc.c @@ -1,5 +1,5 @@ /* - * $Id: odbc.c,v 1.11 1998/10/19 00:56:26 grubba Exp $ + * $Id: odbc.c,v 1.12 1998/11/22 11:04:48 hubbe Exp $ * * Pike interface to ODBC compliant databases. * @@ -16,7 +16,7 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ -RCSID("$Id: odbc.c,v 1.11 1998/10/19 00:56:26 grubba Exp $"); +RCSID("$Id: odbc.c,v 1.12 1998/11/22 11:04:48 hubbe Exp $"); #include "interpret.h" #include "object.h" @@ -238,9 +238,9 @@ static void f_big_query(INT32 args) ONERROR ebuf; HSTMT hstmt = SQL_NULL_HSTMT; struct pike_string *q = NULL; -#ifdef DEBUG +#ifdef PIKE_DEBUG struct svalue *save_sp = sp + 1 - args; -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ get_all_args("odbc->big_query", args, "%S", &q); @@ -281,11 +281,11 @@ static void f_big_query(INT32 args) } else { pop_stack(); /* Keep the result object */ } -#ifdef DEBUG +#ifdef PIKE_DEBUG if (sp != save_sp) { fatal("Stack error in odbc->big_query().\n"); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ } static void f_create_db(INT32 args) diff --git a/src/modules/Perl/.cvsignore b/src/modules/Perl/.cvsignore new file mode 100644 index 0000000000000000000000000000000000000000..9b21632dac574882ee50614562c19c46f0b8db1d --- /dev/null +++ b/src/modules/Perl/.cvsignore @@ -0,0 +1,11 @@ +.pure +Makefile +config.log +config.status +configure +dependencies +linker_options +modlist_headers +modlist_segment +module_testsuite +stamp-h diff --git a/src/modules/Perl/.gitignore b/src/modules/Perl/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3bbebf26966fb9f3a9b7f7f65d201c8388eeb5f7 --- /dev/null +++ b/src/modules/Perl/.gitignore @@ -0,0 +1,11 @@ +/.pure +/Makefile +/config.log +/config.status +/configure +/dependencies +/linker_options +/modlist_headers +/modlist_segment +/module_testsuite +/stamp-h diff --git a/src/modules/Perl/Makefile.in b/src/modules/Perl/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..4b24b886023925ff7e159bd87bbfc9d97713e8c3 --- /dev/null +++ b/src/modules/Perl/Makefile.in @@ -0,0 +1,14 @@ +# $Id: Makefile.in,v 1.1 1998/11/22 11:05:03 hubbe Exp $ +SRCDIR=@srcdir@ +VPATH=@srcdir@:@srcdir@/../..:../.. +MODULE_LDFLAGS=@LDFLAGS@ @LIBS@ @PERL_LDFLAGS@ +OBJS=perlmod.o perlxsi.o +PERL=@perl@ +MODULE_CFLAGS=@PERL_CCFLAGS@ + +@dynamic_module_makefile@ + +perlxsi.c: + $(PERL) -MExtUtils::Embed -e xsinit -- -o perlxsi.c + +@dependencies@ diff --git a/src/modules/Perl/configure.in b/src/modules/Perl/configure.in new file mode 100644 index 0000000000000000000000000000000000000000..7c61d38091d76a281d58a623caf2c642af8a9f78 --- /dev/null +++ b/src/modules/Perl/configure.in @@ -0,0 +1,22 @@ +# $Id: configure.in,v 1.1 1998/11/22 11:05:04 hubbe Exp $ +AC_INIT(perlmod.c) + +AC_MODULE_INIT() + +AC_CHECK_PROGS(perl, perl perl5, x) + +if test x$perl != xx ; then + # We have perl, but do we have perlembed? +# PERL_LDFLAGS=`perl -V:lddlflags | sed "s/^lddlflags='\(.*\);$/\1/"` +# PERL_CCFLAGS=`perl -V:ccflags | sed "s/^ccflags='\(.*\);$/\1/"` + + PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts` + PERL_CCFLAGS=`perl -MExtUtils::Embed -e ccopts` +fi + +AC_SUBST(perl) +AC_SUBST(PERL_LDFLAGS) +AC_SUBST(PERL_CCFLAGS) +AC_OUTPUT(Makefile,echo FOO >stamp-h ) + + diff --git a/src/modules/Perl/perlmod.c b/src/modules/Perl/perlmod.c new file mode 100644 index 0000000000000000000000000000000000000000..da42897d5876a15bbcc09cc160d6e7a3f0030d0b --- /dev/null +++ b/src/modules/Perl/perlmod.c @@ -0,0 +1,224 @@ +#include <global.h> +#include <svalue.h> +#include <array.h> +#include <stralloc.h> +#include <interpret.h> +#include <module_support.h> +#include <threads.h> +#include <mapping.h> + +#include <EXTERN.h> +#include <perl.h> + + +static int num_perl_interpreters=0; +DEFINE_MUTEX(perl_running); + +#ifdef MULTIPLICITY +#endif + +struct perlmod_storage +{ + char **argv; + char **env; + char *env_block; + struct array *argv_strings; + PerlInterpreter *my_perl; +}; + +#define THIS ((struct perlmod_storage *)(fp->current_storage)) +#define PERL THIS->my_perl + +static void init_perl_glue(struct object *o) +{ + PerlInterpreter *p; + THIS->argv=0; + THIS->env=0; + THIS->env_block=0; + THIS->argv_strings=0; + +#ifndef MULTIPLICITY + if(num_perl_interpreters>0) + { + PERL=0; + fprintf(stderr,"num_perl_interpreters=%d\n",num_perl_interpreters); +/* error("Perl: There can be only one!\n"); */ + return; + } +#endif + THREADS_ALLOW(); + mt_lock(&perl_running); + p=perl_alloc(); + if(p) perl_construct(p); + mt_unlock(&perl_running); + THREADS_DISALLOW(); + PERL=p; + if(p) num_perl_interpreters++; +} + +static void exit_perl_glue(struct object *o) +{ + if(PERL) + { + PerlInterpreter *p=PERL; + THREADS_ALLOW(); + mt_lock(&perl_running); + perl_destruct(p); + perl_free(p); + mt_unlock(&perl_running); + THREADS_DISALLOW(); + num_perl_interpreters--; + } + if(THIS->argv) + { + free((char *)THIS->argv); + THIS->argv=0; + } + if(THIS->argv_strings) + { + free_array(THIS->argv_strings); + THIS->argv_strings=0; + } + if(THIS->env) + { + free((char *)THIS->env); + THIS->env=0; + } + if(THIS->env_block) + { + free((char *)THIS->env_block); + THIS->env_block=0; + } +} + +static void perlmod_run(INT32 args) +{ + INT32 i; + PerlInterpreter *p=PERL; + if(!p) error("No perl interpreter available.\n"); + pop_n_elems(args); + + THREADS_ALLOW(); + mt_lock(&perl_running); + i=perl_run(p); + mt_unlock(&perl_running); + THREADS_DISALLOW(); + push_int(i); +} + +static void perlmod_parse(INT32 args) +{ + extern void xs_init(void); + int e; + struct mapping *env_mapping=0; + PerlInterpreter *p=PERL; + struct perlmod_storage *storage=THIS; + + check_all_args("Perl->parse",args,BIT_ARRAY, BIT_MAPPING|BIT_VOID, 0); + if(!p) error("No perl interpreter available.\n"); + + if(THIS->argv_strings) + error("Perl->parse() can only be called once.\n"); + + switch(args) + { + default: + env_mapping=sp[1-args].u.mapping; + mapping_fix_type_field(env_mapping); + + if(m_ind_types(env_mapping) & ~BIT_STRING) + error("Bad argument 2 to Perl->parse().\n"); + if(m_val_types(env_mapping) & ~BIT_STRING) + error("Bad argument 2 to Perl->parse().\n"); + + case 1: + THIS->argv_strings=sp[-args].u.array; + add_ref(THIS->argv_strings); + array_fix_type_field(THIS->argv_strings); + + if(THIS->argv_strings->type_field & ~BIT_STRING) + error("Bad argument 2 to Perl->parse().\n"); + } + + THIS->argv=(char **)xalloc(sizeof(char *)*THIS->argv_strings->size); + for(e=0;e<THIS->argv_strings->size;e++) + THIS->argv[e]=ITEM(THIS->argv_strings)[e].u.string->str; + + if(env_mapping) + { + INT32 d; + int env_block_size=0; + char *env_blockp; + struct keypair *k; + MAPPING_LOOP(env_mapping) + env_block_size+=k->ind.u.string->len+k->val.u.string->len+2; + + THIS->env_block=xalloc(env_block_size); + THIS->env=(char **)xalloc(m_sizeof(env_mapping)+1); + + env_blockp=THIS->env_block; + d=0; + MAPPING_LOOP(env_mapping) + { + THIS->env[d++]=env_blockp; + MEMCPY(env_blockp,k->ind.u.string->str,k->ind.u.string->len); + env_blockp+=k->ind.u.string->len; + + *(env_blockp++)='='; + + MEMCPY(env_blockp,k->val.u.string->str,k->ind.u.string->len); + env_blockp+=k->val.u.string->len; + + *(env_blockp++)='0'; + } + THIS->env[d]=0; + } + + THREADS_ALLOW(); + mt_lock(&perl_running); + e=perl_parse(p, + xs_init, + storage->argv_strings->size, + storage->argv, + storage->env); + mt_unlock(&perl_running); + THREADS_DISALLOW(); + pop_n_elems(args); + push_int(e); +} + +static void perlmod_eval(INT32 args) +{ + error("Perl->eval not yet implemented.\n"); +} + +static void perlmod_call(INT32 args) +{ + error("Perl->call not yet implemented.\n"); +} + +void pike_module_init(void) +{ + perl_destruct_level=1; + start_new_program(); + add_storage(sizeof(struct perlmod_storage)); + add_function("parse",perlmod_parse,"function(array(string),void|mapping(string:string):int)",0); + add_function("run",perlmod_run,"function(:int)",0); + add_function("eval",perlmod_eval,"function(string:int)",0); + add_function("call",perlmod_call,"function(string,mixed...:int)",0); + set_init_callback(init_perl_glue); + set_exit_callback(exit_perl_glue); + end_class("Perl",0); + + add_integer_constant("MULTIPLICITY", +#ifdef MULTIPLICITY + 1, +#else + 0, +#endif + 0); +} + +void pike_module_exit(void) +{ +} diff --git a/src/modules/Perl/testsuite.in b/src/modules/Perl/testsuite.in new file mode 100644 index 0000000000000000000000000000000000000000..c09d3ac019109910686e5f68f4cfac9b5d39c001 --- /dev/null +++ b/src/modules/Perl/testsuite.in @@ -0,0 +1,5 @@ +cond( [[ master()->resolv("Perl")->Perl ]], +[[ + test_true(Perl.Perl) + test_true(Perl.Perl()) +]]) diff --git a/src/modules/Postgres/postgres.c b/src/modules/Postgres/postgres.c index 2d209f3f4d71d284e36a064342143ad6caac03c5..c2391a6da9b36df765ecac4e5bf9b70e81712cc6 100644 --- a/src/modules/Postgres/postgres.c +++ b/src/modules/Postgres/postgres.c @@ -32,9 +32,9 @@ #include "operators.h" /* Postgres includes */ -/* A hack, because DEBUG is defined both in pike's machine.h and in postgres */ -#ifdef DEBUG -#undef DEBUG +/* A hack, because PIKE_DEBUG is defined both in pike's machine.h and in postgres */ +#ifdef PIKE_DEBUG +#undef PIKE_DEBUG #endif #include <postgres.h> @@ -62,7 +62,7 @@ static void pgdebug (char * a, ...) {} struct program * postgres_program; -RCSID("$Id: postgres.c,v 1.9 1998/08/25 13:11:52 grubba Exp $"); +RCSID("$Id: postgres.c,v 1.10 1998/11/22 11:05:17 hubbe Exp $"); #define THIS ((struct pgres_object_data *) fp->current_storage) diff --git a/src/modules/Regexp/pike_regexp.c b/src/modules/Regexp/pike_regexp.c index e1ca8bc78ddff4811ba78be3f157ecdc80d3d5f6..e5b8e630b6dd4b982ef0b96774942c2faa191a74 100644 --- a/src/modules/Regexp/pike_regexp.c +++ b/src/modules/Regexp/pike_regexp.c @@ -1,5 +1,5 @@ /* - * $Id: pike_regexp.c,v 1.12 1998/03/28 14:36:45 grubba Exp $ + * $Id: pike_regexp.c,v 1.13 1998/11/22 11:05:36 hubbe Exp $ * * regexp.c - regular expression matching * @@ -764,7 +764,7 @@ STATIC int regtry(regexp *, char *); STATIC int regmatch(char *); STATIC int regrepeat(char *); -#ifdef DEBUG +#ifdef PIKE_DEBUG int regnarrate = 0; void regdump(regexp *); STATIC char *regprop(char *op); @@ -887,12 +887,12 @@ char *prog; char *nxt; /* nxt node. */ scan = prog; -#ifdef DEBUG +#ifdef PIKE_DEBUG if (scan != (char *)NULL && regnarrate) fprintf(stderr, "%s(\n", regprop(scan)); #endif while (scan != (char *)NULL) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if (regnarrate) fprintf(stderr, "%s...\n", regprop(scan)); #endif @@ -1147,7 +1147,7 @@ register char *p; return (p + offset); } -#ifdef DEBUG +#ifdef PIKE_DEBUG STATIC char *regprop(char *); diff --git a/src/modules/call_out/call_out.c b/src/modules/call_out/call_out.c index 2bb3530832f55ebd2d092e2ef295cb2496edaaaf..9e880b9e685e1bae6c4b5aed178fb38b6a59ff10 100644 --- a/src/modules/call_out/call_out.c +++ b/src/modules/call_out/call_out.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: call_out.c,v 1.22 1998/11/17 05:12:41 hubbe Exp $"); +RCSID("$Id: call_out.c,v 1.23 1998/11/22 11:05:56 hubbe Exp $"); #include "array.h" #include "dynamic_buffer.h" #include "object.h" @@ -45,7 +45,7 @@ struct call_out_s #include "block_alloc.h" -#ifdef DEBUG +#ifdef PIKE_DEBUG #define MESS_UP_BLOCK(X) \ (X)->next_arr=(struct call_out_s *)-1; \ (X)->next_fun=(struct call_out_s *)-1; \ @@ -95,7 +95,7 @@ static struct hash_ent *call_hash=0; #define CMP(X,Y) my_timercmp(& CALL(X)->tv, <, & CALL(Y)->tv) #define SWAP(X,Y) do{ call_out *_tmp=CALL(X); (CALL(X)=CALL(Y))->pos=(X); (CALL(Y)=_tmp)->pos=(Y); } while(0) -#ifdef DEBUG +#ifdef PIKE_DEBUG static int inside_call_out=0; #define PROTECT_CALL_OUTS() \ if(inside_call_out) fatal("Recursive call in call_out module.\n"); \ @@ -108,7 +108,7 @@ static int inside_call_out=0; #define UNPROTECT_CALL_OUTS() #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG static void verify_call_outs(void) { struct array *v; @@ -218,7 +218,7 @@ static int adjust_up(int pos) { int parent=PARENT(pos); int from; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(pos <0 || pos>=num_pending_calls) fatal("Bad argument to adjust_up(%d)\n",pos); #endif @@ -412,7 +412,7 @@ static struct callback *call_out_backend_callback=0; static struct callback *mem_callback=0; void do_call_outs(struct callback *ignored, void *ignored_too, void *arg); -#ifdef DEBUG +#ifdef PIKE_DEBUG static void mark_call_outs(struct callback *foo, void *bar, void *gazonk) { int e; @@ -452,7 +452,7 @@ void f_call_out(INT32 args) if(!mem_callback) mem_callback=add_memory_usage_callback(count_memory_in_call_outs,0,0); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!verify_call_out_callback) { verify_call_out_callback=add_to_callback(& do_debug_callbacks, @@ -556,7 +556,7 @@ static int find_call_out(struct svalue *fun) { if(c->args == fun->u.array) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(CALL(c->pos) != c) fatal("Call_out->pos not correct!\n"); #endif @@ -571,7 +571,7 @@ static int find_call_out(struct svalue *fun) { if(is_eq(fun, ITEM(c->args))) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(CALL(c->pos) != c) fatal("Call_out->pos not correct!\n"); #endif diff --git a/src/modules/files/file.c b/src/modules/files/file.c index 247ba262826d3a2212c6f6ddc07baf7f55280c7e..b3e8c369426542251cde05acdc29b1a4879d2b6f 100644 --- a/src/modules/files/file.c +++ b/src/modules/files/file.c @@ -5,7 +5,7 @@ \*/ #include "global.h" -RCSID("$Id: file.c,v 1.127 1998/10/22 00:10:13 grubba Exp $"); +RCSID("$Id: file.c,v 1.128 1998/11/22 11:08:04 hubbe Exp $"); #include "fdlib.h" #include "interpret.h" #include "svalue.h" @@ -122,7 +122,7 @@ static struct my_file *get_file_storage(struct object *o) return 0; } -#ifdef DEBUG +#ifdef PIKE_DEBUG #ifdef WITH_OOB #define OOBOP(X) X #else @@ -1633,7 +1633,7 @@ static void exit_file_struct(struct object *o) /* map_variable will free callbacks */ } -#ifdef DEBUG +#ifdef PIKE_DEBUG static void gc_mark_file_struct(struct object *o) { DEBUG_CHECK_INTERNAL_REFERENCE(THIS); @@ -2198,7 +2198,7 @@ static void exit_file_lock_key(struct object *o) { int fd=THIS_KEY->f->fd; int err; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(THIS_KEY->f->key != o) fatal("File lock key is wrong!\n"); #endif @@ -2291,7 +2291,7 @@ void PIKE_CONCAT(Y,_ref) (INT32 args) {\ #include "file_functions.h" -#ifdef DEBUG +#ifdef PIKE_DEBUG void check_static_file_data(struct callback *a, void *b, void *c) { if(file_program) @@ -2329,7 +2329,7 @@ void pike_module_init(void) init_file_locking(); set_init_callback(init_file_struct); set_exit_callback(exit_file_struct); -#ifdef DEBUG +#ifdef PIKE_DEBUG set_gc_check_callback(gc_mark_file_struct); #endif @@ -2371,7 +2371,7 @@ void pike_module_init(void) #ifdef WITH_OOB add_integer_constant("__HAVE_OOB__",1,0); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG add_to_callback(&do_debug_callbacks, check_static_file_data, 0, diff --git a/src/modules/files/socket.c b/src/modules/files/socket.c index 44d931bba34eb5843789242d6a67779d130fc5d0..1ff61217a299d68a9ddc187eb445b546a4be3e18 100644 --- a/src/modules/files/socket.c +++ b/src/modules/files/socket.c @@ -18,7 +18,7 @@ #include "file_machine.h" #include "file.h" -RCSID("$Id: socket.c,v 1.39 1998/08/06 23:38:52 grubba Exp $"); +RCSID("$Id: socket.c,v 1.40 1998/11/22 11:08:06 hubbe Exp $"); #ifdef HAVE_SYS_TYPE_H #include <sys/types.h> @@ -116,7 +116,7 @@ static void port_accept_callback(int fd,void *data) struct port *f; f=(struct port *)data; #ifndef __NT__ -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!query_nonblocking(f->fd)) fatal("Port is in blocking mode in port accept callback!!!\n"); #endif diff --git a/src/modules/spider/spider.c b/src/modules/spider/spider.c index 2d375698627903529e604ec280b55cb406c75284..7f7b4d0ccff585ff310f3f3854c973ef36efdfd4 100644 --- a/src/modules/spider/spider.c +++ b/src/modules/spider/spider.c @@ -43,7 +43,7 @@ #include "threads.h" #include "operators.h" -RCSID("$Id: spider.c,v 1.75 1998/07/22 18:10:42 grubba Exp $"); +RCSID("$Id: spider.c,v 1.76 1998/11/22 11:08:31 hubbe Exp $"); #ifdef HAVE_PWD_H #include <pwd.h> @@ -953,7 +953,7 @@ void do_html_parse_lines(struct pike_string *ss, } *(sp++)=sval1; -#ifdef DEBUG +#ifdef PIKE_DEBUG sval1.type=99; #endif (*strings)++; @@ -980,7 +980,7 @@ void do_html_parse_lines(struct pike_string *ss, else if (sval1.type!=T_INT) { *(sp++)=sval2; -#ifdef DEBUG +#ifdef PIKE_DEBUG sval2.type=99; #endif k=push_parsed_tag(s+j,len-j); @@ -1004,7 +1004,7 @@ void do_html_parse_lines(struct pike_string *ss, if (sval1.type==T_STRING) { *(sp++)=sval1; -#ifdef DEBUG +#ifdef PIKE_DEBUG sval1.type=99; #endif (*strings)++; @@ -1018,7 +1018,7 @@ void do_html_parse_lines(struct pike_string *ss, else if (sval1.type != T_INT) { *(sp++)=sval2; -#ifdef DEBUG +#ifdef PIKE_DEBUG sval2.type=99; #endif m = push_parsed_tag(s+j, len-j) + j; diff --git a/src/modules/sprintf/sprintf.c b/src/modules/sprintf/sprintf.c index 25490b63b255421eb9db41a92045953e8247997d..f49d2e71b8d5fb0907042503c3161b8b00c56dda 100644 --- a/src/modules/sprintf/sprintf.c +++ b/src/modules/sprintf/sprintf.c @@ -99,7 +99,7 @@ */ #include "global.h" -RCSID("$Id: sprintf.c,v 1.30 1998/11/02 22:04:42 hubbe Exp $"); +RCSID("$Id: sprintf.c,v 1.31 1998/11/22 11:08:52 hubbe Exp $"); #include "error.h" #include "array.h" #include "svalue.h" @@ -730,7 +730,7 @@ static void low_pike_sprintf(struct string_builder *r, int num_snurkel; fsp++; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fsp < format_info_stack) fatal("sprintf: fsp out of bounds.\n"); #endif @@ -856,7 +856,7 @@ static void low_pike_sprintf(struct string_builder *r, { struct array *w; struct string_builder b; -#ifdef DEBUG +#ifdef PIKE_DEBUG struct format_info *fsp_save=fsp; #endif DO_OP(); @@ -906,7 +906,7 @@ static void low_pike_sprintf(struct string_builder *r, low_pike_sprintf(&b,ADD_PCHARP(a,1),e-2,s,sp-s,0); pop_n_elems(sp-s); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fsp < format_info_stack) fatal("sprintf: fsp out of bounds.\n"); if(fsp!=fsp_save) @@ -1139,7 +1139,7 @@ static void low_pike_sprintf(struct string_builder *r, while(fsp>start) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(fsp < format_info_stack) fatal("sprintf: fsp out of bounds.\n"); #endif diff --git a/src/multiset.c b/src/multiset.c index 5fa48f70b2e56df95178bcecdfb087d40f0503f4..ba843857c85ca5ff7732afbb2b28e4cba54d5df6 100644 --- a/src/multiset.c +++ b/src/multiset.c @@ -15,7 +15,7 @@ #include "builtin_functions.h" #include "gc.h" -RCSID("$Id: multiset.c,v 1.11 1998/04/20 18:53:19 grubba Exp $"); +RCSID("$Id: multiset.c,v 1.12 1998/11/22 11:03:03 hubbe Exp $"); struct multiset *first_multiset; @@ -47,7 +47,7 @@ static struct multiset *allocate_multiset(struct array *ind) */ void really_free_multiset(struct multiset *l) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(l->refs) fatal("really free multiset on multiset with nonzero refs.\n"); #endif @@ -152,19 +152,19 @@ struct multiset *add_multisets(struct svalue *argp,INT32 args) break; case 2: - ret=merge_multisets(argp[0].u.multiset,argp[1].u.multiset,OP_ADD); + ret=merge_multisets(argp[0].u.multiset,argp[1].u.multiset,PIKE_ARRAY_OP_ADD); break; case 3: - a=merge_multisets(argp[0].u.multiset, argp[1].u.multiset, OP_ADD); - ret=merge_multisets(a, argp[2].u.multiset, OP_ADD); + a=merge_multisets(argp[0].u.multiset, argp[1].u.multiset, PIKE_ARRAY_OP_ADD); + ret=merge_multisets(a, argp[2].u.multiset, PIKE_ARRAY_OP_ADD); free_multiset(a); break; default: a=add_multisets(argp,args/2); b=add_multisets(argp+args/2,args-args/2); - ret=merge_multisets(a,b,OP_ADD); + ret=merge_multisets(a,b,PIKE_ARRAY_OP_ADD); free_multiset(a); free_multiset(b); break; diff --git a/src/object.c b/src/object.c index f0c32330fa4ec582edaa1be29be3f26589a0c243..0e2a51786cff708d354c4a0d4686831d42112a49 100644 --- a/src/object.c +++ b/src/object.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: object.c,v 1.52 1998/05/25 10:38:46 hubbe Exp $"); +RCSID("$Id: object.c,v 1.53 1998/11/22 11:03:04 hubbe Exp $"); #include "object.h" #include "dynamic_buffer.h" #include "interpret.h" @@ -299,7 +299,7 @@ void destruct(struct object *o) struct frame frame; struct program *p; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag > 20) do_debug(); #endif @@ -395,7 +395,7 @@ void destruct_objects_to_destruct(void) while((o=objects_to_destruct)) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(o->refs) fatal("Object to be destructed grew extra references.\n"); #endif @@ -782,7 +782,7 @@ union anything *object_get_item_ptr(struct object *o, return 0; } -#ifdef DEBUG +#ifdef PIKE_DEBUG void verify_all_objects(void) { struct object *o; @@ -1053,7 +1053,7 @@ void gc_check_all_objects(void) struct program *p; add_ref(o); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(o->parent) if(debug_gc_check(o->parent,T_OBJECT,o)==-2) fprintf(stderr,"(in object at %lx -> parent)\n",(long)o); diff --git a/src/opcodes.c b/src/opcodes.c index c41df7c0af5d3a12b7f5a4e9dade531a55417ca8..528f92f2055b85051ceeef595d2a44a0408a7bb7 100644 --- a/src/opcodes.c +++ b/src/opcodes.c @@ -22,7 +22,7 @@ #include "builtin_functions.h" #include "module_support.h" -RCSID("$Id: opcodes.c,v 1.31 1998/10/09 23:33:39 grubba Exp $"); +RCSID("$Id: opcodes.c,v 1.32 1998/11/22 11:03:05 hubbe Exp $"); void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) { @@ -340,7 +340,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(run_time_type != sp[-1].type) fatal("Internal error: Cast failed (run_time_type = %d, sp[-1].type = %d.)\n",run_time_type,sp[-1].type); #endif @@ -367,7 +367,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) }else{ INT32 e,i; struct pike_string *s; -#ifdef DEBUG +#ifdef PIKE_DEBUG struct svalue *save_sp=sp+1; #endif push_array(a=allocate_array(tmp->size)); @@ -380,7 +380,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) array_set_index(a,e,sp-1); pop_stack(); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(save_sp!=sp) fatal("o_cast left stack droppings.\n"); #endif @@ -397,12 +397,12 @@ void o_cast(struct pike_string *type, INT32 run_time_type) void f_cast(void) { -#ifdef DEBUG +#ifdef PIKE_DEBUG struct svalue *save_sp=sp; #endif o_cast(sp[-2].u.string, compile_type_to_runtime_type(sp[-2].u.string)); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(save_sp != sp) fatal("Internal error: o_cast() left droppings on stack.\n"); #endif @@ -607,7 +607,7 @@ static INT32 really_low_sscanf(char *input, return matches; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(match[cnt]!='%' || match[cnt+1]=='%') { fatal("Error in sscanf.\n"); @@ -1109,7 +1109,7 @@ static INT32 really_low_sscanf(char *input, }else{ check_stack(1); *sp++=sval; -#ifdef DEBUG +#ifdef PIKE_DEBUG sval.type=99; #endif } @@ -1121,7 +1121,7 @@ static INT32 really_low_sscanf(char *input, void o_sscanf(INT32 args) { -#ifdef DEBUG +#ifdef PIKE_DEBUG extern int t_flag; #endif INT32 e,i; @@ -1149,7 +1149,7 @@ void o_sscanf(INT32 args) assign_lvalue(save_sp-args+2+x*2,save_sp+x); pop_n_elems(sp-save_sp +args); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(t_flag >2) { int nonblock; @@ -1166,7 +1166,7 @@ void o_sscanf(INT32 args) void f_sscanf(INT32 args) { -#ifdef DEBUG +#ifdef PIKE_DEBUG extern int t_flag; #endif INT32 e,i; diff --git a/src/operators.c b/src/operators.c index d8fc9aae74f818c4d09c6dcd29001e4c2f7749b3..e57e14d7c71ea4782418c65c7a2f17b4924071b8 100644 --- a/src/operators.c +++ b/src/operators.c @@ -5,7 +5,7 @@ \*/ #include "global.h" #include <math.h> -RCSID("$Id: operators.c,v 1.43 1998/10/14 05:48:45 hubbe Exp $"); +RCSID("$Id: operators.c,v 1.44 1998/11/22 11:03:06 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "multiset.h" @@ -339,7 +339,7 @@ static node *optimize_eq(node *n) first_arg=my_get_arg(&CDR(n), 0); second_arg=my_get_arg(&CDR(n), 1); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!first_arg || !second_arg) fatal("Couldn't find argument!\n"); #endif @@ -368,7 +368,7 @@ static node *optimize_not(node *n) if(count_args(CDR(n))==1) { first_arg=my_get_arg(&CDR(n), 0); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!first_arg) fatal("Couldn't find argument!\n"); #endif @@ -404,7 +404,7 @@ static node *optimize_binary(node *n) first_arg=my_get_arg(&CDR(n), 0); second_arg=my_get_arg(&CDR(n), 1); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!first_arg || !second_arg) fatal("Couldn't find argument!\n"); #endif @@ -551,7 +551,7 @@ void o_subtract(void) case T_MAPPING: { struct mapping *m; - m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping,OP_SUB); + m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping,PIKE_ARRAY_OP_SUB); pop_n_elems(2); push_mapping(m); return; @@ -560,7 +560,7 @@ void o_subtract(void) case T_MULTISET: { struct multiset *l; - l=merge_multisets(sp[-2].u.multiset, sp[-1].u.multiset, OP_SUB); + l=merge_multisets(sp[-2].u.multiset, sp[-1].u.multiset, PIKE_ARRAY_OP_SUB); pop_n_elems(2); push_multiset(l); return; @@ -658,7 +658,7 @@ void o_and(void) case T_MAPPING: { struct mapping *m; - m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping, OP_AND); + m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping, PIKE_ARRAY_OP_AND); pop_n_elems(2); push_mapping(m); return; @@ -667,7 +667,7 @@ void o_and(void) case T_MULTISET: { struct multiset *l; - l=merge_multisets(sp[-2].u.multiset, sp[-1].u.multiset, OP_AND); + l=merge_multisets(sp[-2].u.multiset, sp[-1].u.multiset, PIKE_ARRAY_OP_AND); pop_n_elems(2); push_multiset(l); return; @@ -839,7 +839,7 @@ void o_or(void) case T_MAPPING: { struct mapping *m; - m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping, OP_OR); + m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping, PIKE_ARRAY_OP_OR); pop_n_elems(2); push_mapping(m); return; @@ -848,7 +848,7 @@ void o_or(void) case T_MULTISET: { struct multiset *l; - l=merge_multisets(sp[-2].u.multiset, sp[-1].u.multiset, OP_OR); + l=merge_multisets(sp[-2].u.multiset, sp[-1].u.multiset, PIKE_ARRAY_OP_OR); pop_n_elems(2); push_multiset(l); return; @@ -857,7 +857,7 @@ void o_or(void) case T_ARRAY: { struct array *a; - a=merge_array_without_order(sp[-2].u.array, sp[-1].u.array, OP_OR); + a=merge_array_without_order(sp[-2].u.array, sp[-1].u.array, PIKE_ARRAY_OP_OR); pop_n_elems(2); push_array(a); return; @@ -929,7 +929,7 @@ void o_xor(void) case T_MAPPING: { struct mapping *m; - m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping, OP_XOR); + m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping, PIKE_ARRAY_OP_XOR); pop_n_elems(2); push_mapping(m); return; @@ -938,7 +938,7 @@ void o_xor(void) case T_MULTISET: { struct multiset *l; - l=merge_multisets(sp[-2].u.multiset, sp[-1].u.multiset, OP_XOR); + l=merge_multisets(sp[-2].u.multiset, sp[-1].u.multiset, PIKE_ARRAY_OP_XOR); pop_n_elems(2); push_multiset(l); return; @@ -947,7 +947,7 @@ void o_xor(void) case T_ARRAY: { struct array *a; - a=merge_array_without_order(sp[-2].u.array, sp[-1].u.array, OP_XOR); + a=merge_array_without_order(sp[-2].u.array, sp[-1].u.array, PIKE_ARRAY_OP_XOR); pop_n_elems(2); push_array(a); return; @@ -1737,7 +1737,7 @@ void o_range(void) if(from>to+1) from=to+1; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(from < 0 || (to-from+1) < 0) fatal("Error in o_range.\n"); #endif diff --git a/src/peep.c b/src/peep.c index 73a7ee2438ad70836306143896ad6b9e938ab8f5..e7cf6447f02da65a5669e606fff96fd3f9f0a0ed 100644 --- a/src/peep.c +++ b/src/peep.c @@ -13,7 +13,7 @@ #include "dmalloc.h" #include "stuff.h" -RCSID("$Id: peep.c,v 1.24 1998/05/12 23:51:26 hubbe Exp $"); +RCSID("$Id: peep.c,v 1.25 1998/11/22 11:03:07 hubbe Exp $"); struct p_instr_s { @@ -58,7 +58,7 @@ int insert_opcode(unsigned int f, { p_instr *p; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!hasarg(f) && b) fatal("hasarg(%d) is wrong!\n",f); #endif @@ -66,7 +66,7 @@ int insert_opcode(unsigned int f, p=(p_instr *)low_make_buf_space(sizeof(p_instr), &instrbuf); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!instrbuf.s.len) fatal("Low make buf space failed!!!!!!\n"); #endif @@ -81,7 +81,7 @@ int insert_opcode(unsigned int f, int insert_opcode2(int f,int current_line, struct pike_string *current_file) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(hasarg(f)) fatal("hasarg(%d) is wrong!\n",f); #endif @@ -92,7 +92,7 @@ int insert_opcode2(int f,int current_line, struct pike_string *current_file) void update_arg(int instr,INT32 arg) { p_instr *p; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(instr > (long)instrbuf.s.len / (long)sizeof(p_instr) || instr < 0) fatal("update_arg outside known space.\n"); #endif @@ -105,13 +105,13 @@ void update_arg(int instr,INT32 arg) void ins_f_byte(unsigned int b) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(store_linenumbers && b<F_MAX_OPCODE) ADD_COMPILED(b); -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ b-=F_OFFSET; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(b>255) error("Instruction too big %d\n",b); #endif @@ -235,7 +235,7 @@ void assemble(void) c=(p_instr *)instrbuf.s.str; for(e=0;e<length;e++) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(a_flag > 2 && store_linenumbers) { if(hasarg(c->opcode)) @@ -264,7 +264,7 @@ void assemble(void) break; case F_LABEL: -#ifdef DEBUG +#ifdef PIKE_DEBUG if(c->arg > max_label || c->arg < 0) fatal("max_label calculation failed!\n"); @@ -280,7 +280,7 @@ void assemble(void) case I_ISJUMP: ins_f_byte(c->opcode); case I_ISPOINTER: -#ifdef DEBUG +#ifdef PIKE_DEBUG if(c->arg > max_label || c->arg < 0) fatal("Jump to unknown label?\n"); #endif tmp=PC; @@ -296,7 +296,7 @@ void assemble(void) ins_f_byte(c->opcode); break; -#ifdef DEBUG +#ifdef PIKE_DEBUG default: fatal("Unknown instruction type.\n"); #endif @@ -312,7 +312,7 @@ void assemble(void) while(jumps[e]!=-1) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(labels[e]==-1) fatal("Hyperspace error: unknown jump point.\n"); #endif @@ -340,7 +340,7 @@ int insopt(int f, INT32 b, int cl, struct pike_string *cf) { p_instr *p; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!hasarg(f) && b) fatal("hasarg(%d) is wrong!\n",f); #endif @@ -353,7 +353,7 @@ int insopt(int f, INT32 b, int cl, struct pike_string *cf) p-=fifo_len; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!instrbuf.s.len) fatal("Low make buf space failed!!!!!!\n"); #endif @@ -368,7 +368,7 @@ int insopt(int f, INT32 b, int cl, struct pike_string *cf) int insopt2(int f, int cl, struct pike_string *cf) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(hasarg(f)) fatal("hasarg(%d) is wrong!\n",f); #endif @@ -379,7 +379,7 @@ static void debug(void) { if(fifo_len > (long)instrbuf.s.len / (long)sizeof(p_instr)) fifo_len=(long)instrbuf.s.len / (long)sizeof(p_instr); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(eye < 0) fatal("Popped beyond start of code.\n"); @@ -454,7 +454,7 @@ static void pop_n_opcodes(int n) d=n; if(d>fifo_len) d=fifo_len; -#ifdef DEBUG +#ifdef PIKE_DEBUG if((long)d > (long)instrbuf.s.len / (long)sizeof(p_instr)) fatal("Popping out of instructions.\n"); #endif @@ -514,7 +514,7 @@ static void do_optimization(int topop, ...) static void asm_opt(void) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(a_flag > 3) { p_instr *c; @@ -536,7 +536,7 @@ static void asm_opt(void) #include "peep_engine.c" -#ifdef DEBUG +#ifdef PIKE_DEBUG if(a_flag > 4) { p_instr *c; diff --git a/src/pike_memory.c b/src/pike_memory.c index 896a5535f66fb86070e7de8fe73869cb7f3370a6..1df110618b812ee9055cda3154ba22ecadf56a72 100644 --- a/src/pike_memory.c +++ b/src/pike_memory.c @@ -9,7 +9,7 @@ #include "pike_macros.h" #include "gc.h" -RCSID("$Id: pike_memory.c,v 1.27 1998/10/14 05:48:46 hubbe Exp $"); +RCSID("$Id: pike_memory.c,v 1.28 1998/11/22 11:03:09 hubbe Exp $"); /* strdup() is used by several modules, so let's provide it */ #ifndef HAVE_STRDUP @@ -288,7 +288,7 @@ void init_memsearch(struct mem_searcher *s, q=(unsigned char *)needle; -#if BYTEORDER == 4321 +#if PIKE_BYTEORDER == 4321 for(tmp=e=0;e<sizeof(INT32)-1;e++) { tmp<<=8; @@ -298,7 +298,7 @@ void init_memsearch(struct mem_searcher *s, for(e=0;e<max;e++) { -#if BYTEORDER == 4321 +#if PIKE_BYTEORDER == 4321 tmp<<=8; tmp|=*(q++); #else @@ -1091,7 +1091,7 @@ void cleanup_memhdrs() fprintf(stderr, "LEAK: (%p) %ld bytes\n",p, m->size); -#ifdef DEBUG +#ifdef PIKE_DEBUG describe_something(p, attempt_to_identify(p),0); #endif mt_lock(&debug_malloc_mutex); diff --git a/src/pike_types.c b/src/pike_types.c index 157108bbf52be2d2ff460465b1a1b1fd98236d5b..3826353000ff57a0b0c45f353c737a32825bc697 100644 --- a/src/pike_types.c +++ b/src/pike_types.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: pike_types.c,v 1.48 1998/11/06 03:08:01 hubbe Exp $"); +RCSID("$Id: pike_types.c,v 1.49 1998/11/22 11:03:10 hubbe Exp $"); #include <ctype.h> #include "svalue.h" #include "pike_types.h" @@ -86,7 +86,7 @@ static void clear_markers(void) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG static void CHECK_TYPE(struct pike_string *s) { if(debug_findstring(s) != s) @@ -201,7 +201,7 @@ void pop_type_stack(void) void type_stack_pop_to_mark(void) { type_stackp-=pop_stack_mark(); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(type_stackp<type_stack) fatal("Type stack underflow\n"); #endif @@ -611,7 +611,7 @@ static void internal_parse_type(char **s) struct pike_string *parse_type(char *s) { struct pike_string *ret; -#ifdef DEBUG +#ifdef PIKE_DEBUG unsigned char *ts=type_stackp; unsigned char **ptms=pike_type_mark_stackp; #endif @@ -623,7 +623,7 @@ struct pike_string *parse_type(char *s) ret=pop_unfinished_type(); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(ts!=type_stackp || ptms!=pike_type_mark_stackp) fatal("Type stack whacked in parse_type.\n"); #endif @@ -631,7 +631,7 @@ struct pike_string *parse_type(char *s) return ret; } -#ifdef DEBUG +#ifdef PIKE_DEBUG void stupid_describe_type(char *a,INT32 len) { INT32 e; diff --git a/src/pike_types.h b/src/pike_types.h index da325d7f459950e6d5fea7e536bd72974d0e2ce2..28bc57c33fc430340d8a162b6cae5f7b441f51aa 100644 --- a/src/pike_types.h +++ b/src/pike_types.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: pike_types.h,v 1.15 1998/11/06 03:08:02 hubbe Exp $ + * $Id: pike_types.h,v 1.16 1998/11/22 11:03:11 hubbe Exp $ */ #ifndef PIKE_TYPES_H #define PIKE_TYPES_H @@ -18,7 +18,7 @@ struct node_s INT16 line_number; INT16 node_info; INT16 tree_info; -#ifdef DEBUG +#ifdef PIKE_DEBUG struct pike_string *current_file; #endif struct pike_string *type; @@ -66,7 +66,7 @@ extern struct pike_string *mixed_type_string; extern struct pike_string *void_type_string; extern struct pike_string *any_type_string; -#ifdef DEBUG +#ifdef PIKE_DEBUG #define init_type_stack() type_stack_mark() #define exit_type_stack() do {\ int q_q_q_q=pop_stack_mark(); \ diff --git a/src/port.c b/src/port.c index 0bf0818e7333976ad062aa9c31902557cf15aaf1..586413ed90897f8e62cc48f6e4ddcae6c1d76cbe 100644 --- a/src/port.c +++ b/src/port.c @@ -17,7 +17,7 @@ #include <float.h> #include <string.h> -RCSID("$Id: port.c,v 1.17 1998/05/29 20:40:01 grubba Exp $"); +RCSID("$Id: port.c,v 1.18 1998/11/22 11:03:12 hubbe Exp $"); #ifdef sun time_t time PROT((time_t *)); @@ -534,7 +534,7 @@ int VFPRINTF(FILE *f,char *s,va_list args) } #endif -#if defined(DEBUG) && !defined(HANDLES_UNALIGNED_MEMORY_ACCESS) +#if defined(PIKE_DEBUG) && !defined(HANDLES_UNALIGNED_MEMORY_ACCESS) unsigned INT16 EXTRACT_UWORD_(unsigned char *p) { diff --git a/src/port.h b/src/port.h index bd257002a21d99f97764f274f7c5c43fe589b335..23af90707b13e071f4017468b92d05c98034faad 100644 --- a/src/port.h +++ b/src/port.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: port.h,v 1.19 1998/05/29 20:40:33 grubba Exp $ + * $Id: port.h,v 1.20 1998/11/22 11:03:13 hubbe Exp $ */ #ifndef PORT_H #define PORT_H @@ -167,7 +167,7 @@ static INLINE int EXTRACT_CHAR(char *p) { return *p > 0x7f ? *p - 0x100 : *p; } # define EXTRACT_WORD(p) (*(INT16 *)(p)) # define EXTRACT_INT(p) (*(INT32 *)(p)) #else -#ifdef DEBUG +#ifdef PIKE_DEBUG unsigned INT16 EXTRACT_UWORD_(unsigned char *p); INT16 EXTRACT_WORD_(unsigned char *p); INT32 EXTRACT_INT_(unsigned char *p); diff --git a/src/program.c b/src/program.c index 131676b8c33c82e7806abee2dfdd65ffb7f4938a..b9cc4c9ad0ca18c3a96180e9c07c56d1b8dbfc38 100644 --- a/src/program.c +++ b/src/program.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: program.c,v 1.104 1998/11/13 01:28:44 hubbe Exp $"); +RCSID("$Id: program.c,v 1.105 1998/11/22 11:03:14 hubbe Exp $"); #include "program.h" #include "object.h" #include "dynamic_buffer.h" @@ -113,7 +113,7 @@ static struct mapping *module_index_cache=0; /* So what if we don't have templates? / Hubbe */ -#ifdef DEBUG +#ifdef PIKE_DEBUG #define CHECK_FOO(NUMTYPE,TYPE,NAME) \ if(malloc_size_program-> PIKE_CONCAT(num_,NAME) < new_program-> PIKE_CONCAT(num_,NAME)) \ fatal("new_program->num_" #NAME " is out of order\n"); \ @@ -196,7 +196,7 @@ void use_module(struct svalue *s) void unuse_modules(INT32 howmany) { if(!howmany) return; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(howmany *sizeof(struct svalue) > used_modules.s.len) fatal("Unusing too many modules.\n"); #endif @@ -437,7 +437,7 @@ void fixate_program(void) { INT32 i,e,t; if(new_program->flags & PROGRAM_FIXED) return; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(new_program->flags & PROGRAM_OPTIMIZED) fatal("Cannot fixate optimized program\n"); #endif @@ -545,7 +545,7 @@ void low_start_new_program(struct program *p, } malloc_size_program = ALLOC_STRUCT(program); -#ifdef DEBUG +#ifdef PIKE_DEBUG fake_object=(struct object *)xalloc(sizeof(struct object) + 256*sizeof(struct svalue)); /* Stipple to find illegal accesses */ MEMSET(fake_object,0x55,sizeof(struct object) + 256*sizeof(struct svalue)); @@ -603,7 +603,7 @@ void low_start_new_program(struct program *p, push_compiler_frame(); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(lex.current_file) store_linenumber(last_pc, lex.current_file); #endif @@ -681,7 +681,7 @@ void really_free_program(struct program *p) GC_FREE(); } -#ifdef DEBUG +#ifdef PIKE_DEBUG void dump_program_desc(struct program *p) { int e,d,q; @@ -781,7 +781,7 @@ static int alignof_variable(int run_time_type) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG void check_program(struct program *p) { INT32 size,e; @@ -924,7 +924,7 @@ struct program *end_first_pass(int finish) prog=new_program; add_ref(prog); -#ifdef DEBUG +#ifdef PIKE_DEBUG check_program(prog); if(l_flag) dump_program_desc(prog); @@ -980,7 +980,7 @@ SIZE_T low_add_storage(SIZE_T size, SIZE_T alignment) SIZE_T offset; offset=DO_ALIGN(new_program->storage_needed, alignment); new_program->storage_needed = offset + size; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(alignment <=0) fatal("Alignment must be at least 1\n"); if(new_program->storage_needed<0) fatal("add_storage failed horribly!\n"); @@ -1076,7 +1076,7 @@ static int middle_reference_inherited_identifier( int e,i; struct program *p=state?state->new_program:new_program; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(function_name!=debug_findstring(function_name)) fatal("reference_inherited_function on nonshared string.\n"); #endif @@ -1174,7 +1174,7 @@ void low_inherit(struct program *p, struct object *o; for(o=fake_object->parent;o!=parent;o=o->parent) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!o) fatal("low_inherit with odd fake_object as parent!\n"); #endif inherit.parent_offset++; @@ -1402,7 +1402,7 @@ int low_define_variable(struct pike_string *name, struct identifier dummy; struct reference ref; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(new_program->flags & (PROGRAM_FIXED | PROGRAM_OPTIMIZED)) fatal("Attempting to add variable to fixed program\n"); @@ -1460,7 +1460,7 @@ int define_variable(struct pike_string *name, { int n, run_time_type; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(name!=debug_findstring(name)) fatal("define_variable on nonshared string.\n"); #endif @@ -1478,7 +1478,7 @@ int define_variable(struct pike_string *name, return n; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(new_program->flags & (PROGRAM_FIXED | PROGRAM_OPTIMIZED)) fatal("Attempting to add variable to fixed program\n"); #endif @@ -1545,7 +1545,7 @@ int add_constant(struct pike_string *name, struct identifier dummy; struct reference ref; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(name!=debug_findstring(name)) fatal("define_constant on nonshared string.\n"); #endif @@ -1576,7 +1576,7 @@ int add_constant(struct pike_string *name, } } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(new_program->flags & (PROGRAM_FIXED | PROGRAM_OPTIMIZED)) fatal("Attempting to add constant to fixed program\n"); @@ -1816,7 +1816,7 @@ INT32 define_function(struct pike_string *name, } } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(compiler_pass==2) fatal("Internal error: Not allowed to add more identifiers during second compiler pass.\n"); #endif @@ -1906,7 +1906,7 @@ int low_find_shared_string_identifier(struct pike_string *name, { unsigned short *funindex = prog->identifier_index; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!funindex) fatal("No funindex in fixed program\n"); #endif @@ -2252,7 +2252,7 @@ void my_yyerror(char *fmt,...) ATTRIBUTE((format(printf,1,2))) struct program *compile(struct pike_string *prog) { -#ifdef DEBUG +#ifdef PIKE_DEBUG JMP_BUF tmp; #endif struct program *p; @@ -2263,7 +2263,7 @@ struct program *compile(struct pike_string *prog) INT32 num_used_modules_save = num_used_modules; void yyparse(void); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(SETJMP(tmp)) fatal("Compiler exited with longjump!\n"); #endif @@ -2310,12 +2310,12 @@ struct program *compile(struct pike_string *prog) p=end_program(); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if (threads_disabled < saved_threads_disabled) { fatal("compile(): threads_disabled:%d saved_threads_disabled:%d\n", threads_disabled, saved_threads_disabled); } -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ threads_disabled = saved_threads_disabled + 1; /* fprintf(stderr, "compile() Leave: threads_disabled:%d, compilation_depth:%d\n", threads_disabled, compilation_depth); */ @@ -2325,7 +2325,7 @@ struct program *compile(struct pike_string *prog) lex=save_lex; unuse_modules(1); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(num_used_modules) fatal("Failed to pop modules properly.\n"); #endif @@ -2335,7 +2335,7 @@ struct program *compile(struct pike_string *prog) used_modules = used_modules_save; num_used_modules = num_used_modules_save ; -#ifdef DEBUG +#ifdef PIKE_DEBUG UNSETJMP(tmp); #endif @@ -2372,7 +2372,7 @@ int add_function(char *name,void (*cfun)(INT32),char *type,INT16 flags) return ret; } -#ifdef DEBUG +#ifdef PIKE_DEBUG void check_all_programs(void) { struct program *p; @@ -2453,7 +2453,7 @@ void gc_check_all_programs(void) { if(p->inherits[e].parent) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(debug_gc_check(p->inherits[e].parent,T_PROGRAM,p)==-2) fprintf(stderr,"(program at 0x%lx -> inherit[%d].parent)\n", (long)p, @@ -2470,7 +2470,7 @@ void gc_check_all_programs(void) debug_gc_check(p->inherits[e].prog, T_PROGRAM, p); } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag) { int e; @@ -2567,7 +2567,7 @@ void pop_compiler_frame(void) struct compiler_frame *f; int e; f=compiler_frame; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!f) fatal("Popping out of compiler frames\n"); #endif @@ -2599,7 +2599,7 @@ int low_get_storage(struct program *o, struct program *p) pid=p->id; hval=oid*9248339 + pid; hval%=GET_STORAGE_CACHE_SIZE; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(hval>GET_STORAGE_CACHE_SIZE) fatal("hval>GET_STORAGE_CACHE_SIZE"); #endif @@ -2690,7 +2690,7 @@ int find_child(struct program *parent, struct program *child) { unsigned INT32 h=(parent->id * 9248339 + child->id); h= h % FIND_CHILD_HASHSIZE; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(h>=FIND_CHILD_HASHSIZE) fatal("find_child failed to hash within boundaries.\n"); #endif @@ -2771,7 +2771,7 @@ int implements(struct program *a, struct program *b) hval = a->id*9248339 + b->id; hval %= IMPLEMENTS_CACHE_SIZE; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(hval >= IMPLEMENTS_CACHE_SIZE) fatal("Implements_cache failed!\n"); #endif diff --git a/src/program.h b/src/program.h index 4fb72e8328d2f6c83416f05385acf4edb6e6592f..e59af25bea7a2da0f30742330e226a73ded27317 100644 --- a/src/program.h +++ b/src/program.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: program.h,v 1.45 1998/11/13 01:28:45 hubbe Exp $ + * $Id: program.h,v 1.46 1998/11/22 11:03:15 hubbe Exp $ */ #ifndef PROGRAM_H #define PROGRAM_H @@ -199,7 +199,7 @@ struct program void (*exit)(struct object *); void (*gc_marked)(struct object *); void (*gc_check)(struct object *); -#ifdef DEBUG +#ifdef PIKE_DEBUG unsigned INT32 checksum; #endif #ifdef PROFILING diff --git a/src/signal_handler.c b/src/signal_handler.c index 2023cb08d07eb04d74d4706c9d796fcdc7d1c0e3..fc1144cd7f77eaa49c12cb721836e03897b8a4d6 100644 --- a/src/signal_handler.c +++ b/src/signal_handler.c @@ -22,7 +22,7 @@ #include "builtin_functions.h" #include <signal.h> -RCSID("$Id: signal_handler.c,v 1.88 1998/10/22 00:33:32 hubbe Exp $"); +RCSID("$Id: signal_handler.c,v 1.89 1998/11/22 11:03:17 hubbe Exp $"); #ifdef HAVE_PASSWD_H # include <passwd.h> @@ -1675,7 +1675,7 @@ static void unset_signalling(void *notused) { signalling=0; } void check_signals(struct callback *foo, void *bar, void *gazonk) { ONERROR ebuf; -#ifdef DEBUG +#ifdef PIKE_DEBUG extern int d_flag; if(d_flag>5) do_debug(); #endif @@ -1907,7 +1907,7 @@ static void f_ualarm(INT32 args) } #endif /* HAVE_UALARM || HAVE_SETITIMER */ -#ifdef DEBUG +#ifdef PIKE_DEBUG static RETSIGTYPE fatal_signal(int signum) { my_signal(signum,SIG_DFL); @@ -1927,7 +1927,7 @@ void init_signals(void) my_signal(SIGPIPE, SIG_IGN); #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG #ifdef SIGSEGV /* my_signal(SIGSEGV, fatal_signal); */ #endif diff --git a/src/stralloc.c b/src/stralloc.c index 31b64218f1d60dfb359d2f8f750bb53b9219c24a..f2685932ca1c4347f6f3527e24df7b9a5675e8c9 100644 --- a/src/stralloc.c +++ b/src/stralloc.c @@ -15,7 +15,7 @@ #include <ctype.h> -RCSID("$Id: stralloc.c,v 1.49 1998/10/29 16:37:33 grubba Exp $"); +RCSID("$Id: stralloc.c,v 1.50 1998/11/22 11:03:18 hubbe Exp $"); #define BEGIN_HASH_SIZE 997 #define MAX_AVG_LINK_LENGTH 3 @@ -90,7 +90,7 @@ static INLINE unsigned INT32 generic_extract (const void *str, int size, int pos INLINE unsigned INT32 index_shared_string(struct pike_string *s, int pos) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(pos > s->len || pos<0) { if (s->len) { fatal("String index %d is out of range [0 - %d]!\n", pos, s->len-1); @@ -104,7 +104,7 @@ INLINE unsigned INT32 index_shared_string(struct pike_string *s, int pos) INLINE void low_set_index(struct pike_string *s, int pos, int value) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(pos > s->len || pos<0) fatal("string index out of range!\n"); @@ -121,7 +121,7 @@ INLINE void low_set_index(struct pike_string *s, int pos, int value) } } -#ifdef DEBUG +#ifdef PIKE_DEBUG struct INLINE pike_string *debug_check_size_shift(struct pike_string *a,int shift) { if(a->size_shift != shift) @@ -208,7 +208,7 @@ INLINE void pike_string_cpy(PCHARP to, } -#ifdef DEBUG +#ifdef PIKE_DEBUG #ifdef DEBUG_MALLOC #define DM(X) X #else @@ -272,7 +272,7 @@ static struct pike_string *internal_findstring(const char *s, for(base = prev = base_table + h;( curr=*prev ); prev=&curr->next) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(curr->refs<1) { debug_dump_pike_string(curr, 70); @@ -323,7 +323,7 @@ static struct pike_string *propagate_shared_string(const struct pike_string *s, *base=curr; return curr; } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(curr->refs<1) { debug_dump_pike_string(curr, 70); @@ -374,7 +374,7 @@ static void rehash(void) struct pike_string *debug_begin_shared_string(int len) { struct pike_string *t; -#ifdef DEBUG +#ifdef PIKE_DEBUG extern int d_flag; if(d_flag>10) verify_shared_strings_tables(); @@ -400,7 +400,7 @@ static void link_pike_string(struct pike_string *s, int h) struct pike_string *debug_begin_wide_shared_string(int len, int shift) { struct pike_string *t; -#ifdef DEBUG +#ifdef PIKE_DEBUG extern int d_flag; if(d_flag>10) verify_shared_strings_tables(); @@ -424,7 +424,7 @@ struct pike_string *low_end_shared_string(struct pike_string *s) len=s->len; h=do_hash(s); s2=internal_findstring(s->str,len,s->size_shift,h); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(s2==s) fatal("end_shared_string called twice! (or something like that)\n"); #endif @@ -600,7 +600,7 @@ void unlink_pike_string(struct pike_string *s) h=do_hash(s); propagate_shared_string(s,h); base_table[h]=s->next; -#ifdef DEBUG +#ifdef PIKE_DEBUG s->next=(struct pike_string *)-1; #endif num_strings--; @@ -608,7 +608,7 @@ void unlink_pike_string(struct pike_string *s) void really_free_string(struct pike_string *s) { -#ifdef DEBUG +#ifdef PIKE_DEBUG extern int d_flag; if(d_flag > 2) { @@ -683,8 +683,8 @@ struct pike_string *add_string_status(int verbose) return free_buf(); } -/*** DEBUG ***/ -#ifdef DEBUG +/*** PIKE_DEBUG ***/ +#ifdef PIKE_DEBUG void check_string(struct pike_string *s) { @@ -1052,7 +1052,7 @@ struct pike_string *modify_shared_string(struct pike_string *a, INT32 c) { INT32 old_value; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(index<0 || index>=a->len) fatal("Index out of range in modify_shared_string()\n"); #endif @@ -1248,7 +1248,7 @@ struct pike_string *string_slice(struct pike_string *s, INT32 start, INT32 len) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(start < 0 || len<0 || start+len>s->len ) { fatal("string_slice, start = %d, len = %d, s->len = %d\n",start,len,s->len); @@ -1385,7 +1385,7 @@ void cleanup_shared_string_table(void) unsigned INT32 e; struct pike_string *s,*next; -#if defined(DEBUG) && defined(DEBUG_MALLOC) +#if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC) while(all_shared_string_locations) { struct shared_string_location *x=all_shared_string_locations; @@ -1441,7 +1441,7 @@ void count_memory_in_strings(INT32 *num, INT32 *size) size_+=sizeof(struct pike_string)+(p->len<<p->size_shift); } } -#ifdef DEBUG +#ifdef PIKE_DEBUG if(num_strings != num_) fatal("Num strings is wrong! %d!=%d.\n",num_strings, num_); #endif @@ -1545,7 +1545,7 @@ void string_builder_fill(struct string_builder *s, INT32 offset) { INT32 tmp; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(len<=0) fatal("Cannot fill with zero length strings!\n"); #endif diff --git a/src/stralloc.h b/src/stralloc.h index 62fb88629c5a65aa22fe0dda3893fccfb5e0419d..3993f9401f1071c7320f664c035184cea4c434ce 100644 --- a/src/stralloc.h +++ b/src/stralloc.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: stralloc.h,v 1.25 1998/10/27 00:45:58 js Exp $ + * $Id: stralloc.h,v 1.26 1998/11/22 11:03:19 hubbe Exp $ */ #ifndef STRALLOC_H #define STRALLOC_H @@ -33,7 +33,7 @@ struct string_builder int known_shift; }; -#ifdef DEBUG +#ifdef PIKE_DEBUG struct pike_string *debug_findstring(const struct pike_string *foo); #endif @@ -43,7 +43,7 @@ struct pike_string *debug_findstring(const struct pike_string *foo); #define my_order_strcmp(X,Y) ((char *)(X)-(char *)(Y)) #define is_same_string(X,Y) ((X)==(Y)) -#ifdef DEBUG +#ifdef PIKE_DEBUG #define STR0(X) ((p_wchar0 *)debug_check_size_shift((X),0)->str) #define STR1(X) ((p_wchar1 *)debug_check_size_shift((X),1)->str) #define STR2(X) ((p_wchar2 *)debug_check_size_shift((X),2)->str) @@ -77,7 +77,7 @@ typedef struct p_wchar_p #define LOW_COMPARE_PCHARP(X,CMP,Y) (((char *)((X).ptr)) CMP ((char *)((Y).ptr))) #define LOW_SUBTRACT_PCHARP(X,Y) LOW_COMPARE_PCHARP((X),-,(Y)) -#ifdef DEBUG +#ifdef PIKE_DEBUG #define SUBTRACT_PCHARP(X,Y) ((X).shift!=(Y).shift?(fatal("Subtracting different size charp!\n")),0:LOW_SUBTRACT_PCHARP((X),(Y))) #define COMPARE_PCHARP(X,CMP,Y) ((X).shift!=(Y).shift?(fatal("Subtracting different size charp!\n")),0:LOW_COMPARE_PCHARP((X),CMP,(Y))) #else diff --git a/src/svalue.c b/src/svalue.c index 9cb1d735630c826c03c174f424bfd0fe7b219aa5..ccbcdb0b7b733ee0d834fdaae5908b91c47585b1 100644 --- a/src/svalue.c +++ b/src/svalue.c @@ -21,7 +21,7 @@ #include <ctype.h> #include "queue.h" -RCSID("$Id: svalue.c,v 1.38 1998/10/09 17:56:33 hubbe Exp $"); +RCSID("$Id: svalue.c,v 1.39 1998/11/22 11:03:20 hubbe Exp $"); struct svalue dest_ob_zero = { T_INT, 0 }; @@ -61,7 +61,7 @@ void really_free_short_svalue(union anything *s, TYPE_T type) really_free_string(tmp.string); break; -#ifdef DEBUG +#ifdef PIKE_DEBUG default: fatal("Bad type in free_short_svalue.\n"); #endif @@ -76,21 +76,21 @@ void really_free_svalue(struct svalue *s) { case T_ARRAY: really_free_array(s->u.array); -#ifdef DEBUG +#ifdef PIKE_DEBUG s->type = 99; #endif break; case T_MAPPING: really_free_mapping(s->u.mapping); -#ifdef DEBUG +#ifdef PIKE_DEBUG s->type = 99; #endif break; case T_MULTISET: really_free_multiset(s->u.multiset); -#ifdef DEBUG +#ifdef PIKE_DEBUG s->type = 99; #endif break; @@ -109,19 +109,19 @@ void really_free_svalue(struct svalue *s) case T_PROGRAM: really_free_program(s->u.program); -#ifdef DEBUG +#ifdef PIKE_DEBUG s->type = 99; #endif break; case T_STRING: really_free_string(s->u.string); -#ifdef DEBUG +#ifdef PIKE_DEBUG s->type = 99; #endif break; -#ifdef DEBUG +#ifdef PIKE_DEBUG default: fatal("Bad type in free_svalue.\n"); #endif @@ -223,7 +223,7 @@ void assign_svalues_no_free(struct svalue *to, INT32 num, INT32 type_hint) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(d_flag) { INT32 e; @@ -905,7 +905,7 @@ void copy_svalues_recursively_no_free(struct svalue *to, } } -#ifdef DEBUG +#ifdef PIKE_DEBUG void check_short_svalue(union anything *u, TYPE_T type) { static int inside=0; @@ -959,7 +959,7 @@ TYPE_FIELD gc_check_svalues(struct svalue *s, int num) check_type(s->type); check_refs(s); -#ifdef DEBUG +#ifdef PIKE_DEBUG gc_svalue_location=(void *)s; #endif @@ -982,7 +982,7 @@ TYPE_FIELD gc_check_svalues(struct svalue *s, int num) case T_OBJECT: if(s->u.object->prog) { -#ifdef DEBUG +#ifdef PIKE_DEBUG if(gc_check(s->u.object) == -2) fprintf(stderr,"(in svalue at %lx, type = %d)\n",(long)s,s->type); #else @@ -1008,14 +1008,14 @@ TYPE_FIELD gc_check_svalues(struct svalue *s, int num) f|= 1 << s->type; } -#ifdef DEBUG +#ifdef PIKE_DEBUG gc_svalue_location=0; #endif return f; } -#ifdef DEBUG +#ifdef PIKE_DEBUG void gc_xmark_svalues(struct svalue *s, int num) { INT32 e; @@ -1029,14 +1029,14 @@ void gc_xmark_svalues(struct svalue *s, int num) check_type(s->type); check_refs(s); -#ifdef DEBUG +#ifdef PIKE_DEBUG gc_svalue_location=(void *)s; #endif if(s->type <= MAX_REF_TYPE) gc_external_mark(s->u.refs); } -#ifdef DEBUG +#ifdef PIKE_DEBUG gc_svalue_location=0; #endif } @@ -1044,7 +1044,7 @@ void gc_xmark_svalues(struct svalue *s, int num) void gc_check_short_svalue(union anything *u, TYPE_T type) { -#ifdef DEBUG +#ifdef PIKE_DEBUG gc_svalue_location=(void *)u; #endif switch(type) @@ -1073,7 +1073,7 @@ void gc_check_short_svalue(union anything *u, TYPE_T type) gc_check(u->refs); break; } -#ifdef DEBUG +#ifdef PIKE_DEBUG gc_svalue_location=0; #endif } diff --git a/src/svalue.h b/src/svalue.h index 65225ad12b7c627bf6ea63a1e27530a03cc94f52..820962ad280cd98ca12678d54df0bd3adc797db6 100644 --- a/src/svalue.h +++ b/src/svalue.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: svalue.h,v 1.18 1998/09/18 21:31:42 hubbe Exp $ + * $Id: svalue.h,v 1.19 1998/11/22 11:03:21 hubbe Exp $ */ #ifndef SVALUE_H #define SVALUE_H @@ -175,7 +175,7 @@ do{ \ } \ }while(0) -#ifdef DEBUG +#ifdef PIKE_DEBUG #define check_type(T) if(T > MAX_TYPE && T!=T_LVALUE && T!=T_SHORT_LVALUE && T!=T_VOID && T!=T_DELETED && T!=T_ARRAY_LVALUE) fatal("Type error\n") #define check_refs(S) if((S)->type < MAX_REF_TYPE && (!(S)->u.refs || (S)->u.refs[0] < 0)) fatal("Svalue to object without references.\n") #define check_refs2(S,T) if((T) < MAX_REF_TYPE && (S)->refs && (S)->refs[0] <= 0) fatal("Svalue to object without references.\n") diff --git a/src/threads.c b/src/threads.c index fb863c7db0aff5a94db53c7606244cba9fc4fe84..7008960d45962df3001f297d80f7f4178a2f7411 100644 --- a/src/threads.c +++ b/src/threads.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: threads.c,v 1.84 1998/09/05 19:40:50 grubba Exp $"); +RCSID("$Id: threads.c,v 1.85 1998/11/22 11:03:22 hubbe Exp $"); int num_threads = 1; int threads_disabled = 0; @@ -24,7 +24,7 @@ size_t thread_stack_size=1024 * 1204; #ifdef __NT__ -#ifdef DEBUG +#ifdef PIKE_DEBUG static int IsValidHandle(HANDLE h) { __try { @@ -82,7 +82,7 @@ int co_wait(COND_T *c, MUTEX_T *m) event_destroy(& me.event); /* Cancellation point?? */ -#ifdef DEBUG +#ifdef PIKE_DEBUG if(me.next) fatal("Wait on event return prematurely!!\n"); #endif @@ -258,10 +258,10 @@ void exit_threads_disable(struct object *o) THREADS_FPRINTF(0, (stderr, "_exit_threads_disable(): Wake up!\n")); co_broadcast(&threads_disabled_change); } -#ifdef DEBUG +#ifdef PIKE_DEBUG } else { fatal("exit_threads_disable() called too many times!\n"); -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ } } @@ -334,7 +334,7 @@ void thread_table_insert(struct object *o) { struct thread_state *s = (struct thread_state *)o->storage; unsigned INT32 h = thread_table_hash(&s->id); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(h>=THREAD_TABLE_SIZE) fatal("thread_table_hash failed miserably!\n"); #endif @@ -360,7 +360,7 @@ struct thread_state *thread_state_for_id(THREAD_T tid) { unsigned INT32 h = thread_table_hash(&tid); struct thread_state *s = NULL; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(h>=THREAD_TABLE_SIZE) fatal("thread_table_hash failed miserably!\n"); #endif @@ -729,7 +729,7 @@ void exit_mutex_key_obj(struct object *o) { struct mutex_storage *mut = THIS_KEY->mut; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(mut->key != o) fatal("Mutex unlock from wrong key %p != %p!\n",THIS_KEY->mut->key,o); #endif @@ -869,7 +869,7 @@ static void thread_was_marked(struct object *o) struct thread_state *tmp=(struct thread_state *)(o->storage); if(tmp->thread_local != NULL) gc_mark_mapping_as_referenced(tmp->thread_local); -#ifdef DEBUG +#ifdef PIKE_DEBUG if(tmp->swapped) { debug_gc_xmark_svalues(tmp->evaluator_stack,tmp->sp-tmp->evaluator_stack-1,"idle thread stack"); @@ -1008,7 +1008,7 @@ void th_init(void) set_exit_callback(exit_mutex_key_obj); mutex_key=end_program(); mutex_key->flags|=PROGRAM_DESTRUCT_IMMEDIATE; -#ifdef DEBUG +#ifdef PIKE_DEBUG if(!mutex_key) fatal("Failed to initialize mutex_key program!\n"); #endif diff --git a/src/threads.h b/src/threads.h index 14051f9448903b41f7b70150fbefcfce766f8f0d..46680ccf36c6da5445ed7c5d0ac7b6ad6d7cf63d 100644 --- a/src/threads.h +++ b/src/threads.h @@ -1,5 +1,5 @@ /* - * $Id: threads.h,v 1.59 1998/11/20 19:33:46 hubbe Exp $ + * $Id: threads.h,v 1.60 1998/11/22 11:03:23 hubbe Exp $ */ #ifndef THREADS_H #define THREADS_H @@ -350,7 +350,7 @@ struct thread_state { #define DO_IF_PROFILING(X) #endif -#ifdef DEBUG +#ifdef PIKE_DEBUG #define DO_IF_DEBUG(X) X #else #define DO_IF_DEBUG(X) @@ -403,7 +403,7 @@ struct thread_state { SWAP_IN_THREAD(_tmp);\ } while(0) -#if defined(DEBUG) && ! defined(DONT_HIDE_GLOBALS) +#if defined(PIKE_DEBUG) && ! defined(DONT_HIDE_GLOBALS) /* Note that scalar types are used in place of pointers and vice versa * below. This is intended to cause compiler warnings/errors if * there is an attempt to use the global variables in an unsafe @@ -421,10 +421,10 @@ struct thread_state { * in case there is a label before the macro. */ #define REVEAL_GLOBAL_VARIABLES() ; } while(0) -#else /* DEBUG */ +#else /* PIKE_DEBUG */ #define HIDE_GLOBAL_VARIABLES() #define REVEAL_GLOBAL_VARIABLES() -#endif /* DEBUG */ +#endif /* PIKE_DEBUG */ #define THREADS_ALLOW() do { \ @@ -559,7 +559,7 @@ void exit_interleave_mutex(IMUTEX_T *im); #endif /* _REENTRANT */ #ifdef __NT__ -#ifndef DEBUG +#ifndef PIKE_DEBUG #define CheckValidHandle(X) 0 #else void CheckValidHandle(HANDLE h);