cleanup YapExecutable

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@602 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-09-23 17:06:13 +00:00
parent edee8a955f
commit 97c2bd2105
13 changed files with 42 additions and 42 deletions

View File

@ -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");
}

View File

@ -43,17 +43,19 @@
#endif
#include <a.out.h>
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;

View File

@ -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;

View File

@ -26,14 +26,12 @@
#include <stdio.h>
/*
* 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");
}

View File

@ -20,12 +20,15 @@
#include <malloc.h>
#include <stdio.h>
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;

View File

@ -24,14 +24,12 @@
#include <windows.h>
/*
* 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");
}

View File

@ -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);
YAP_FindExecutable("yap");
else
YAPFindExecutable(yap_args[0]);
YAP_FindExecutable(yap_args[0]);
InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag);
InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag);
}

View File

@ -14,18 +14,20 @@
#include "Yap.h"
#include "Foreign.h"
#include "Heap.h"
#ifdef HAVE_STRING_H
#include <string.h>
#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");
}

View File

@ -12,14 +12,12 @@
#include <stdio.h>
/*
* 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" );
}

View File

@ -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));

View File

@ -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;

View File

@ -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() \
{ \

View File

@ -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 */