diff --git a/C/load_aix.c b/C/load_aix.c index dc8c36f97..a36f0a94b 100644 --- a/C/load_aix.c +++ b/C/load_aix.c @@ -27,10 +27,8 @@ * locate the executable of Yap */ void -YAPFindExecutable(char *name) +YAP_FindExecutable(char *name) { - /* not really needed for dl version */ - strcpy(YapExecutable,"./yap"); } diff --git a/C/load_aout.c b/C/load_aout.c index d0ce2a1da..862299349 100644 --- a/C/load_aout.c +++ b/C/load_aout.c @@ -43,17 +43,19 @@ #endif #include +static char YapExecutable[YAP_FILE_MAX]; + #define oktox(n) \ (0==stat(n,&stbuf)&&(stbuf.st_mode&S_IFMT)==S_IFREG&&0==access(n,X_OK)) #define oktow(n) \ (0==stat(n,&stbuf)&&(stbuf.st_mode&S_IFMT)==S_IFDIR&&0==access(n,W_OK)) /* - * YAPFindExecutable(argv[0]) should be called on yap initialization to + * YAP_FindExecutable(argv[0]) should be called on yap initialization to * locate the executable of Yap */ void -YAPFindExecutable(char *name) +YAP_FindExecutable(char *name) { register char *cp, *cp2; struct stat stbuf; diff --git a/C/load_coff.c b/C/load_coff.c index 88c39ba83..58290b5c8 100644 --- a/C/load_coff.c +++ b/C/load_coff.c @@ -45,13 +45,15 @@ #define N_TXTOFF(x) (sizeof(struct filehdr)+(x).f_opthdr+(x).f_nscns*sizeof(struct scnhdr)) +static char YapExecutable[YAP_FILE_MAX]; + /* - * YAPFindExecutable(argv[0]) should be called on yap initialization to + * YAP_FindExecutable(argv[0]) should be called on yap initialization to * locate the executable of Yap */ void -YAPFindExecutable(char *name) +YAP_FindExecutable(char *name) { register char *cp, *cp2; struct stat stbuf; diff --git a/C/load_dl.c b/C/load_dl.c index 2811f09f8..4f8e7d845 100644 --- a/C/load_dl.c +++ b/C/load_dl.c @@ -26,14 +26,12 @@ #include /* - * YAPFindExecutable(argv[0]) should be called on yap initialization to + * YAP_FindExecutable(argv[0]) should be called on yap initialization to * locate the executable of Yap */ void -YAPFindExecutable(char *name) +YAP_FindExecutable(char *name) { - /* not really needed for dl version */ - strcpy(YapExecutable,"yap"); } diff --git a/C/load_dld.c b/C/load_dld.c index 7af777525..5974cc5bf 100644 --- a/C/load_dld.c +++ b/C/load_dld.c @@ -20,12 +20,15 @@ #include #include +static char YapExecutable[YAP_FILE_MAX]; + + /* - * YAPFindExecutable(argv[0]) should be called on yap initialization to + * YAP_FindExecutable(argv[0]) should be called on yap initialization to * locate the executable of Yap */ void -YAPFindExecutable(char *name) +YAP_FindExecutable(char *name) { /* use dld_find_executable */ char *res; diff --git a/C/load_dll.c b/C/load_dll.c index 962c16c0d..36cafb8ce 100644 --- a/C/load_dll.c +++ b/C/load_dll.c @@ -24,14 +24,12 @@ #include /* - * YAPFindExecutable(argv[0]) should be called on yap initialization to + * YAP_FindExecutable(argv[0]) should be called on yap initialization to * locate the executable of Yap */ void -YAPFindExecutable(char *name) +YAP_FindExecutable(char *name) { - /* not really needed for dl version */ - strcpy(YapExecutable,"yap"); } diff --git a/C/load_foreign.c b/C/load_foreign.c index 0931ced75..80de6e7b0 100644 --- a/C/load_foreign.c +++ b/C/load_foreign.c @@ -35,7 +35,6 @@ static char SccsId[] = "%W% %G%.2"; #endif char LoadMsg[512]; -char YapExecutable[YAP_FILENAME_MAX]; STD_PROTO(Int p_load_foreign, (void)); @@ -110,9 +109,9 @@ void InitLoadForeign(void) { if (yap_args == NULL) - YAPFindExecutable(NULL); - else - YAPFindExecutable(yap_args[0]); + YAP_FindExecutable("yap"); + else + YAP_FindExecutable(yap_args[0]); InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag); InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag); } diff --git a/C/load_none.c b/C/load_none.c index f20751f47..2e530d084 100644 --- a/C/load_none.c +++ b/C/load_none.c @@ -14,18 +14,20 @@ #include "Yap.h" #include "Foreign.h" +#include "Heap.h" +#ifdef HAVE_STRING_H +#include +#endif #ifdef NO_DYN /* - * YAPFindExecutable(argv[0]) should be called on yap initialization to + * YAP_FindExecutable(argv[0]) should be called on yap initialization to * locate the executable of Yap */ void -YAPFindExecutable(char *name) +YAP_FindExecutable(char *name) { - /* signal name not found */ - strcpy(YapExecutable,"./yap"); } diff --git a/C/load_shl.c b/C/load_shl.c index 2e41e0d4c..a960b0021 100644 --- a/C/load_shl.c +++ b/C/load_shl.c @@ -12,14 +12,12 @@ #include /* - * YAPFindExecutable(argv[0]) should be called on yap initialization to + * YAP_FindExecutable(argv[0]) should be called on yap initialization to * locate the executable of Yap */ -void YAPFindExecutable(char *name) +void YAP_FindExecutable(char *name) { - /* not really needed for shl version */ - strcpy( YapExecutable, "yap" ); } diff --git a/H/Foreign.h b/H/Foreign.h index 44373a2c0..6de209b53 100644 --- a/H/Foreign.h +++ b/H/Foreign.h @@ -79,8 +79,6 @@ #endif */ -extern char YapExecutable[]; - extern char LoadMsg[]; #define LOAD_SUCCEEDED 0 @@ -106,7 +104,7 @@ typedef void (*YapInitProc)(void); #define STD_PROTO(F,A) F A #endif -void STD_PROTO(YAPFindExecutable,(char *)); +void STD_PROTO(YAP_FindExecutable,(char *)); Int STD_PROTO(LoadForeign,(StringList, StringList, char *, YapInitProc *)); Int STD_PROTO(ReLoadForeign,(StringList, StringList, char *, YapInitProc *)); void STD_PROTO(ReOpenLoadForeign,(void)); diff --git a/H/Heap.h b/H/Heap.h index 2323b1431..48ab2b74a 100644 --- a/H/Heap.h +++ b/H/Heap.h @@ -10,7 +10,7 @@ * File: Heap.h * * mods: * * comments: Heap Init Structure * -* version: $Id: Heap.h,v 1.30 2002-09-03 14:28:07 vsc Exp $ * +* version: $Id: Heap.h,v 1.31 2002-09-23 17:06:12 vsc Exp $ * *************************************************************************/ /* information that can be stored in Code Space */ @@ -116,7 +116,7 @@ typedef struct various_codes { Term mutable_list; Term atts_mutable_list; #endif - PredEntry *wake_up_code; + struct pred_entry *wake_up_code; #endif struct pred_entry *creep_code; struct pred_entry *undef_code; @@ -288,11 +288,11 @@ typedef struct various_codes { term_prolog, term_refound_var; void *last_wtime; - PredEntry *pred_goal_expansion; - PredEntry *pred_meta_call; - PredEntry *pred_dollar_catch; - PredEntry *pred_throw; - PredEntry *pred_handle_throw; + struct pred_entry *pred_goal_expansion; + struct pred_entry *pred_meta_call; + struct pred_entry *pred_dollar_catch; + struct pred_entry *pred_throw; + struct pred_entry *pred_handle_throw; struct array_entry *dyn_array_list; struct DB_STRUCT *db_erased_marker; UInt n_of_file_aliases; diff --git a/m4/Yap.h.m4 b/m4/Yap.h.m4 index 5eea2d0cc..c947d7ff5 100644 --- a/m4/Yap.h.m4 +++ b/m4/Yap.h.m4 @@ -10,7 +10,7 @@ * File: Yap.h.m4 * * mods: * * comments: main header file for YAP * -* version: $Id: Yap.h.m4,v 1.30 2002-09-03 14:28:08 vsc Exp $ * +* version: $Id: Yap.h.m4,v 1.31 2002-09-23 17:06:13 vsc Exp $ * *************************************************************************/ #include "config.h" @@ -787,6 +787,10 @@ extern int yap_argc; /******************* controlling debugging ****************************/ extern int creep_on; +/******************* number of modules ****************************/ + +#define MaxModules 256 + #ifdef YAPOR #define YAPEnterCriticalSection() \ { \ diff --git a/m4/Yatom.h.m4 b/m4/Yatom.h.m4 index f78da24ff..b0153580d 100644 --- a/m4/Yatom.h.m4 +++ b/m4/Yatom.h.m4 @@ -390,8 +390,6 @@ typedef enum { DBWithRefs = 0x40 } db_term_flags; -#define MaxModules 256 - typedef struct { Prop NextOfPE; /* used to chain properties */ PropFlags KindOfPE; /* kind of property */