cleanup YapExecutable
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@602 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
edee8a955f
commit
97c2bd2105
@ -27,10 +27,8 @@
|
|||||||
* locate the executable of Yap
|
* locate the executable of Yap
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
YAPFindExecutable(char *name)
|
YAP_FindExecutable(char *name)
|
||||||
{
|
{
|
||||||
/* not really needed for dl version */
|
|
||||||
strcpy(YapExecutable,"./yap");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,17 +43,19 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <a.out.h>
|
#include <a.out.h>
|
||||||
|
|
||||||
|
static char YapExecutable[YAP_FILE_MAX];
|
||||||
|
|
||||||
#define oktox(n) \
|
#define oktox(n) \
|
||||||
(0==stat(n,&stbuf)&&(stbuf.st_mode&S_IFMT)==S_IFREG&&0==access(n,X_OK))
|
(0==stat(n,&stbuf)&&(stbuf.st_mode&S_IFMT)==S_IFREG&&0==access(n,X_OK))
|
||||||
#define oktow(n) \
|
#define oktow(n) \
|
||||||
(0==stat(n,&stbuf)&&(stbuf.st_mode&S_IFMT)==S_IFDIR&&0==access(n,W_OK))
|
(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
|
* locate the executable of Yap
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
YAPFindExecutable(char *name)
|
YAP_FindExecutable(char *name)
|
||||||
{
|
{
|
||||||
register char *cp, *cp2;
|
register char *cp, *cp2;
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
|
@ -45,13 +45,15 @@
|
|||||||
|
|
||||||
#define N_TXTOFF(x) (sizeof(struct filehdr)+(x).f_opthdr+(x).f_nscns*sizeof(struct scnhdr))
|
#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
|
* locate the executable of Yap
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
YAPFindExecutable(char *name)
|
YAP_FindExecutable(char *name)
|
||||||
{
|
{
|
||||||
register char *cp, *cp2;
|
register char *cp, *cp2;
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
|
@ -26,14 +26,12 @@
|
|||||||
#include <stdio.h>
|
#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
|
* locate the executable of Yap
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
YAPFindExecutable(char *name)
|
YAP_FindExecutable(char *name)
|
||||||
{
|
{
|
||||||
/* not really needed for dl version */
|
|
||||||
strcpy(YapExecutable,"yap");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,12 +20,15 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <stdio.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
|
* locate the executable of Yap
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
YAPFindExecutable(char *name)
|
YAP_FindExecutable(char *name)
|
||||||
{
|
{
|
||||||
/* use dld_find_executable */
|
/* use dld_find_executable */
|
||||||
char *res;
|
char *res;
|
||||||
|
@ -24,14 +24,12 @@
|
|||||||
#include <windows.h>
|
#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
|
* locate the executable of Yap
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
YAPFindExecutable(char *name)
|
YAP_FindExecutable(char *name)
|
||||||
{
|
{
|
||||||
/* not really needed for dl version */
|
|
||||||
strcpy(YapExecutable,"yap");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,6 @@ static char SccsId[] = "%W% %G%.2";
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
char LoadMsg[512];
|
char LoadMsg[512];
|
||||||
char YapExecutable[YAP_FILENAME_MAX];
|
|
||||||
|
|
||||||
STD_PROTO(Int p_load_foreign, (void));
|
STD_PROTO(Int p_load_foreign, (void));
|
||||||
|
|
||||||
@ -110,9 +109,9 @@ void
|
|||||||
InitLoadForeign(void)
|
InitLoadForeign(void)
|
||||||
{
|
{
|
||||||
if (yap_args == NULL)
|
if (yap_args == NULL)
|
||||||
YAPFindExecutable(NULL);
|
YAP_FindExecutable("yap");
|
||||||
else
|
else
|
||||||
YAPFindExecutable(yap_args[0]);
|
YAP_FindExecutable(yap_args[0]);
|
||||||
InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag);
|
InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag);
|
||||||
InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag);
|
InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag);
|
||||||
}
|
}
|
||||||
|
@ -14,18 +14,20 @@
|
|||||||
|
|
||||||
#include "Yap.h"
|
#include "Yap.h"
|
||||||
#include "Foreign.h"
|
#include "Foreign.h"
|
||||||
|
#include "Heap.h"
|
||||||
|
#ifdef HAVE_STRING_H
|
||||||
|
#include <string.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NO_DYN
|
#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
|
* locate the executable of Yap
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
YAPFindExecutable(char *name)
|
YAP_FindExecutable(char *name)
|
||||||
{
|
{
|
||||||
/* signal name not found */
|
|
||||||
strcpy(YapExecutable,"./yap");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,14 +12,12 @@
|
|||||||
#include <stdio.h>
|
#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
|
* locate the executable of Yap
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void YAPFindExecutable(char *name)
|
void YAP_FindExecutable(char *name)
|
||||||
{
|
{
|
||||||
/* not really needed for shl version */
|
|
||||||
strcpy( YapExecutable, "yap" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,8 +79,6 @@
|
|||||||
#endif
|
#endif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern char YapExecutable[];
|
|
||||||
|
|
||||||
extern char LoadMsg[];
|
extern char LoadMsg[];
|
||||||
|
|
||||||
#define LOAD_SUCCEEDED 0
|
#define LOAD_SUCCEEDED 0
|
||||||
@ -106,7 +104,7 @@ typedef void (*YapInitProc)(void);
|
|||||||
#define STD_PROTO(F,A) F A
|
#define STD_PROTO(F,A) F A
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void STD_PROTO(YAPFindExecutable,(char *));
|
void STD_PROTO(YAP_FindExecutable,(char *));
|
||||||
Int STD_PROTO(LoadForeign,(StringList, StringList, char *, YapInitProc *));
|
Int STD_PROTO(LoadForeign,(StringList, StringList, char *, YapInitProc *));
|
||||||
Int STD_PROTO(ReLoadForeign,(StringList, StringList, char *, YapInitProc *));
|
Int STD_PROTO(ReLoadForeign,(StringList, StringList, char *, YapInitProc *));
|
||||||
void STD_PROTO(ReOpenLoadForeign,(void));
|
void STD_PROTO(ReOpenLoadForeign,(void));
|
||||||
|
14
H/Heap.h
14
H/Heap.h
@ -10,7 +10,7 @@
|
|||||||
* File: Heap.h *
|
* File: Heap.h *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: Heap Init Structure *
|
* 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 */
|
/* information that can be stored in Code Space */
|
||||||
@ -116,7 +116,7 @@ typedef struct various_codes {
|
|||||||
Term mutable_list;
|
Term mutable_list;
|
||||||
Term atts_mutable_list;
|
Term atts_mutable_list;
|
||||||
#endif
|
#endif
|
||||||
PredEntry *wake_up_code;
|
struct pred_entry *wake_up_code;
|
||||||
#endif
|
#endif
|
||||||
struct pred_entry *creep_code;
|
struct pred_entry *creep_code;
|
||||||
struct pred_entry *undef_code;
|
struct pred_entry *undef_code;
|
||||||
@ -288,11 +288,11 @@ typedef struct various_codes {
|
|||||||
term_prolog,
|
term_prolog,
|
||||||
term_refound_var;
|
term_refound_var;
|
||||||
void *last_wtime;
|
void *last_wtime;
|
||||||
PredEntry *pred_goal_expansion;
|
struct pred_entry *pred_goal_expansion;
|
||||||
PredEntry *pred_meta_call;
|
struct pred_entry *pred_meta_call;
|
||||||
PredEntry *pred_dollar_catch;
|
struct pred_entry *pred_dollar_catch;
|
||||||
PredEntry *pred_throw;
|
struct pred_entry *pred_throw;
|
||||||
PredEntry *pred_handle_throw;
|
struct pred_entry *pred_handle_throw;
|
||||||
struct array_entry *dyn_array_list;
|
struct array_entry *dyn_array_list;
|
||||||
struct DB_STRUCT *db_erased_marker;
|
struct DB_STRUCT *db_erased_marker;
|
||||||
UInt n_of_file_aliases;
|
UInt n_of_file_aliases;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* File: Yap.h.m4 *
|
* File: Yap.h.m4 *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: main header file for YAP *
|
* 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"
|
#include "config.h"
|
||||||
@ -787,6 +787,10 @@ extern int yap_argc;
|
|||||||
/******************* controlling debugging ****************************/
|
/******************* controlling debugging ****************************/
|
||||||
extern int creep_on;
|
extern int creep_on;
|
||||||
|
|
||||||
|
/******************* number of modules ****************************/
|
||||||
|
|
||||||
|
#define MaxModules 256
|
||||||
|
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
#define YAPEnterCriticalSection() \
|
#define YAPEnterCriticalSection() \
|
||||||
{ \
|
{ \
|
||||||
|
@ -390,8 +390,6 @@ typedef enum {
|
|||||||
DBWithRefs = 0x40
|
DBWithRefs = 0x40
|
||||||
} db_term_flags;
|
} db_term_flags;
|
||||||
|
|
||||||
#define MaxModules 256
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Prop NextOfPE; /* used to chain properties */
|
Prop NextOfPE; /* used to chain properties */
|
||||||
PropFlags KindOfPE; /* kind of property */
|
PropFlags KindOfPE; /* kind of property */
|
||||||
|
Reference in New Issue
Block a user