OSX portability updates

start of support for commons prolog initiative
This commit is contained in:
Vitor Santos Costa
2009-02-16 12:25:03 +00:00
parent 9c9444bece
commit a000af113b
177 changed files with 110 additions and 63460 deletions

View File

@@ -186,15 +186,25 @@ char *libdir = NULL;
void
Yap_InitSysPath(void) {
int len;
#if _MSC_VER || defined(__MINGW32__)
int dir_done = FALSE;
int commons_done = FALSE;
{
char *dir;
if ((dir = Yap_RegistryGetString("library"))) {
Yap_PutValue(AtomSystemLibraryDir,
MkAtomTerm(Yap_LookupAtom(dir)));
return;
dir_done = TRUE;
}
if ((dir = Yap_RegistryGetString("prolog_commons"))) {
Yap_PutValue(AtomPrologCommonsDir,
MkAtomTerm(Yap_LookupAtom(dir)));
commons_done = TRUE;
}
}
if (dir_done && commons_done)
return;
#endif
strncpy(Yap_FileNameBuf, SHARE_DIR, YAP_FILENAME_MAX);
#if _MSC_VER || defined(__MINGW32__)
@@ -243,9 +253,24 @@ Yap_InitSysPath(void) {
#else
strncat(Yap_FileNameBuf,"/", YAP_FILENAME_MAX);
#endif
len = strlen(Yap_FileNameBuf);
strncat(Yap_FileNameBuf, "Yap", YAP_FILENAME_MAX);
Yap_PutValue(AtomSystemLibraryDir,
MkAtomTerm(Yap_LookupAtom(Yap_FileNameBuf)));
#if _MSC_VER || defined(__MINGW32__)
if (!dir_done)
#endif
{
Yap_PutValue(AtomSystemLibraryDir,
MkAtomTerm(Yap_LookupAtom(Yap_FileNameBuf)));
}
#if _MSC_VER || defined(__MINGW32__)
if (!commons_done)
#endif
{
Yap_FileNameBuf[len] = '\0';
strncat(Yap_FileNameBuf, "PrologCommons", YAP_FILENAME_MAX);
Yap_PutValue(AtomPrologCommonsDir,
MkAtomTerm(Yap_LookupAtom(Yap_FileNameBuf)));
}
}
static Int