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

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