Remove attempt to emulate SWI I/O

add YAP_getcwd and PL_cwd to interface
This commit is contained in:
Vítor Santos Costa
2008-12-13 16:07:55 +00:00
parent e0531d0743
commit 2b0c27deb6
8 changed files with 86 additions and 1137 deletions

View File

@@ -356,6 +356,9 @@
#include "cut_c.h"
#endif /* CUT_C */
#if !HAVE_STRNCPY
#define strncpy(X,Y,Z) strcpy(X,Y)
#endif
#define YAP_BOOT_FROM_PROLOG 0
#define YAP_BOOT_FROM_SAVED_CODE 1
@@ -2382,3 +2385,17 @@ YAP_AGCRegisterHook(Agc_hook hook)
return old;
}
X_API char *
YAP_cwd(void)
{
char *buf;
int len;
if (!Yap_getcwd(Yap_FileNameBuf, YAP_FILENAME_MAX))
return FALSE;
len = strlen(Yap_FileNameBuf);
buf = malloc(+1);
if (!buf)
return NULL;
strncpy(buf, Yap_FileNameBuf, len);
return buf;
}