TrueFileName changed name :)
This commit is contained in:
parent
52a2d00d0c
commit
48db20515f
|
@ -142,6 +142,7 @@ Yap_LoadForeignFile(char *file, int flags)
|
||||||
dlflag |= RTLD_LOCAL;
|
dlflag |= RTLD_LOCAL;
|
||||||
#endif
|
#endif
|
||||||
if (!Yap_TrueFileName(file, LOCAL_FileNameBuf, true)){
|
if (!Yap_TrueFileName(file, LOCAL_FileNameBuf, true)){
|
||||||
|
if (!Yap_locateFile(file, LOCAL_FileNameBuf, true)){
|
||||||
/* use LD_LIBRARY_PATH */
|
/* use LD_LIBRARY_PATH */
|
||||||
strncpy(LOCAL_FileNameBuf,file, YAP_FILENAME_MAX-1);
|
strncpy(LOCAL_FileNameBuf,file, YAP_FILENAME_MAX-1);
|
||||||
strncat(LOCAL_FileNameBuf,".", YAP_FILENAME_MAX-1);
|
strncat(LOCAL_FileNameBuf,".", YAP_FILENAME_MAX-1);
|
||||||
|
@ -194,7 +195,7 @@ LoadForeign(StringList ofiles, StringList libs,
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
|
|
||||||
while (libs) {
|
while (libs) {
|
||||||
if (!Yap_TrueFileName((char *)AtomName(libs->name), LOCAL_FileNameBuf, true)) {
|
if (!Yap_locateFile((char *)AtomName(libs->name), LOCAL_FileNameBuf, true)) {
|
||||||
/* use LD_LIBRARY_PATH */
|
/* use LD_LIBRARY_PATH */
|
||||||
strncpy(LOCAL_FileNameBuf, (char *)AtomName(libs->name), YAP_FILENAME_MAX);
|
strncpy(LOCAL_FileNameBuf, (char *)AtomName(libs->name), YAP_FILENAME_MAX);
|
||||||
}
|
}
|
||||||
|
@ -218,7 +219,6 @@ LoadForeign(StringList ofiles, StringList libs,
|
||||||
other routines */
|
other routines */
|
||||||
|
|
||||||
/* dlopen wants to follow the LD_CONFIG_PATH */
|
/* dlopen wants to follow the LD_CONFIG_PATH */
|
||||||
if (!Yap_TrueFileName((char *)AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE)) {
|
|
||||||
strcpy(LOCAL_ErrorSay, "%% Trying to open unexisting file in LoadForeign");
|
strcpy(LOCAL_ErrorSay, "%% Trying to open unexisting file in LoadForeign");
|
||||||
return LOAD_FAILLED;
|
return LOAD_FAILLED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ LoadForeign(StringList ofiles, StringList libs,
|
||||||
while (ofiles) {
|
while (ofiles) {
|
||||||
HINSTANCE handle;
|
HINSTANCE handle;
|
||||||
|
|
||||||
if (Yap_TrueFileName(AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE) &&
|
if (Yap_locateFile(AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE) &&
|
||||||
(handle=LoadLibrary(LOCAL_FileNameBuf)) != 0)
|
(handle=LoadLibrary(LOCAL_FileNameBuf)) != 0)
|
||||||
{
|
{
|
||||||
LOCAL_ErrorSay[0]=~'\0';
|
LOCAL_ErrorSay[0]=~'\0';
|
||||||
|
|
|
@ -158,7 +158,7 @@ LoadForeign(StringList ofiles, StringList libs,
|
||||||
void *handle;
|
void *handle;
|
||||||
|
|
||||||
/* mydlopen wants to follow the LD_CONFIG_PATH */
|
/* mydlopen wants to follow the LD_CONFIG_PATH */
|
||||||
if (!Yap_TrueFileName(AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE)) {
|
if (!Yap_locateFile(AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE)) {
|
||||||
strcpy(LOCAL_ErrorSay, "%% Trying to open unexisting file in LoadForeign");
|
strcpy(LOCAL_ErrorSay, "%% Trying to open unexisting file in LoadForeign");
|
||||||
return LOAD_FAILLED;
|
return LOAD_FAILLED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ LoadForeign( StringList ofiles, StringList libs,
|
||||||
int valid_fname;
|
int valid_fname;
|
||||||
|
|
||||||
/* shl_load wants to follow the LD_CONFIG_PATH */
|
/* shl_load wants to follow the LD_CONFIG_PATH */
|
||||||
valid_fname = Yap_TrueFileName( AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE );
|
valid_fname = Yap_locateFile( AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE );
|
||||||
|
|
||||||
if( !valid_fname ) {
|
if( !valid_fname ) {
|
||||||
strcpy( LOCAL_ErrorSay, "%% Trying to open non-existing file in LoadForeign" );
|
strcpy( LOCAL_ErrorSay, "%% Trying to open non-existing file in LoadForeign" );
|
||||||
|
|
5
C/save.c
5
C/save.c
|
@ -1400,7 +1400,7 @@ commit_to_saved_state(char *s, CELL *Astate, CELL *ATrail, CELL *AStack, CELL *A
|
||||||
LOCAL_PrologMode = BootMode;
|
LOCAL_PrologMode = BootMode;
|
||||||
if (Yap_HeapBase) {
|
if (Yap_HeapBase) {
|
||||||
if (falseGlobalPrologFlag( HALT_AFTER_CONSULT_FLAG ) && !silentMode( )) {
|
if (falseGlobalPrologFlag( HALT_AFTER_CONSULT_FLAG ) && !silentMode( )) {
|
||||||
Yap_AbsoluteFileInBuffer(s,LOCAL_FileNameBuf2, YAP_FILENAME_MAX, true);
|
Yap_locateFile(s,LOCAL_FileNameBuf2, YAP_FILENAME_MAX);
|
||||||
fprintf(stderr, "%% Restoring file %s\n", LOCAL_FileNameBuf2);
|
fprintf(stderr, "%% Restoring file %s\n", LOCAL_FileNameBuf2);
|
||||||
}
|
}
|
||||||
Yap_CloseStreams(TRUE);
|
Yap_CloseStreams(TRUE);
|
||||||
|
@ -1442,7 +1442,8 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
|
||||||
int mode;
|
int mode;
|
||||||
char fname[PATH_MAX+1];
|
char fname[PATH_MAX+1];
|
||||||
|
|
||||||
if (!Yap_AbsoluteFileInBuffer( inpf, fname, PATH_MAX, true))
|
|
||||||
|
if (!Yap_findFile( inpf, YAP_STARTUP, YapLibDir, fname, true, YAP_SAVED_STATE, true, true))
|
||||||
return false;
|
return false;
|
||||||
if (fname[0] &&
|
if (fname[0] &&
|
||||||
(mode = try_open(fname,Astate,ATrail,AStack,AHeap,streamp)) != FAIL_RESTORE) {
|
(mode = try_open(fname,Astate,ATrail,AStack,AHeap,streamp)) != FAIL_RESTORE) {
|
||||||
|
|
Reference in New Issue