YAP should not try to control cwd, that's the OS task

This commit is contained in:
Vitor Santos Costa 2015-03-28 19:38:54 +00:00
parent 666b68c1fb
commit 9709c590bf
3 changed files with 34 additions and 21 deletions

View File

@ -189,9 +189,9 @@ typedef struct {
} cmdline;
struct
{ char * CWDdir;
size_t CWDlen;
char * executable; /* Running executable */
{ //char * CWDdir;
//size_t CWDlen;
//char * executable; /* Running executable */
#ifdef __WINDOWS__
char * module; /* argv[0] module passed */
#endif

View File

@ -601,7 +601,7 @@ extern bool toldString(void);
void closeFiles(int);
atom_t PrologPrompt(void);
word pl_exists_file(term_t name);
char *DirName(const char *f, char *dir);
char *DirName(const char *f);
void outOfCore(void);
word pl_noprotocol(void);
@ -697,6 +697,34 @@ extern int Unsetenv(char *name);
extern int System(char *cmd);
extern char *expandVars(const char *pattern, char *expanded, int maxlen);
PL_EXPORT(bool) ChDir(const char *X);
#if _WIN32 || defined(__MINGW32__)
PL_EXPORT(char *) BaseName(const char *X);
PL_EXPORT(char *) DirName(const char *f);
#else
#define BaseName basename
#define DirName dirname
#endif
PL_EXPORT(char *) OsPath(const char *X, char *Y);
#define DeleteTemporaryFile(F) RemoveFile(stringAtom(F))
PL_EXPORT(intptr_t) lengthList(term_t list, int errors);
PL_EXPORT(int) promoteToFloatNumber(Number n);
PL_EXPORT(char *) PrologPath(const char *ospath, char *plpath, size_t len);
PL_EXPORT(char *) ExpandOneFile(const char *spec, char *file);
PL_EXPORT(char *) AbsoluteFile(const char *spec, char *path);
PL_EXPORT(int) IsAbsolutePath(const char *p);
PL_EXPORT(char *) OsPath(const char *plpath, char *ospath);
PL_EXPORT(int) IsAbsolutePath(const char *spec);
PL_EXPORT(bool) sysError(const char *fm, ...);
PL_EXPORT(int) setDoubleQuotes(atom_t a, unsigned int *flagp);
PL_EXPORT(int) getAccessLevelMask(atom_t a, access_level_t *val);
/**** SWI stuff (emulated in pl-yap.c) ****/
extern int writeAtomToStream(IOSTREAM *so, atom_t at);
extern int valueExpression(term_t t, Number r ARG_LD);

View File

@ -5,6 +5,8 @@
#include "Yatom.h"
#include <libgen.h>
/* depends on tag schema, but 4 should always do */
#define LMASK_BITS 4 /* total # mask bits */
@ -88,23 +90,6 @@ get_procedure(term_t descr, predicate_t *proc, term_t he, int f) {
return TRUE;
}
COMMON(intptr_t) lengthList(term_t list, int errors);
COMMON(int) promoteToFloatNumber(Number n);
COMMON(char *) PrologPath(const char *ospath, char *plpath, size_t len);
COMMON(char *) ExpandOneFile(const char *spec, char *file);
COMMON(char *) AbsoluteFile(const char *spec, char *path);
COMMON(char *) BaseName(const char *f);
COMMON(bool) ChDir(const char *path);
COMMON(char *) OsPath(const char *plpath, char *ospath);
COMMON(bool) ChDir(const char *path);
COMMON(int) DeleteTemporaryFile(atom_t name);
COMMON(int) IsAbsolutePath(const char *spec);
COMMON(bool) sysError(const char *fm, ...);
COMMON(int) setDoubleQuotes(atom_t a, unsigned int *flagp);
COMMON(int) getAccessLevelMask(atom_t a, access_level_t *val);
/* TBD */