Stasinos noticed that _YAP_ breaks C standard: use Yap_ instead.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@691 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -47,7 +47,7 @@ p_load_foreign(void)
|
||||
StringList new;
|
||||
Int returncode = FALSE;
|
||||
|
||||
strcpy(_YAP_ErrorSay,"Invalid arguments");
|
||||
strcpy(Yap_ErrorSay,"Invalid arguments");
|
||||
|
||||
/* collect the list of object files */
|
||||
t = Deref(ARG1);
|
||||
@@ -55,7 +55,7 @@ p_load_foreign(void)
|
||||
if (t == TermNil) break;
|
||||
t1 = HeadOfTerm(t);
|
||||
t = TailOfTerm(t);
|
||||
new = (StringList) _YAP_AllocCodeSpace(sizeof(StringListItem));
|
||||
new = (StringList) Yap_AllocCodeSpace(sizeof(StringListItem));
|
||||
new->next = ofiles;
|
||||
new->s = RepAtom(AtomOfTerm(t1))->StrOfAE;
|
||||
ofiles = new;
|
||||
@@ -67,7 +67,7 @@ p_load_foreign(void)
|
||||
if (t == TermNil) break;
|
||||
t1 = HeadOfTerm(t);
|
||||
t = TailOfTerm(t);
|
||||
new = (StringList) _YAP_AllocCodeSpace(sizeof(StringListItem));
|
||||
new = (StringList) Yap_AllocCodeSpace(sizeof(StringListItem));
|
||||
new->next = libs;
|
||||
new->s = RepAtom(AtomOfTerm(t1))->StrOfAE;
|
||||
libs = new;
|
||||
@@ -80,14 +80,14 @@ p_load_foreign(void)
|
||||
|
||||
|
||||
/* call the OS specific function for dynamic loading */
|
||||
if(_YAP_LoadForeign(ofiles,libs,InitProcName,&InitProc)==LOAD_SUCCEEDED) {
|
||||
if(Yap_LoadForeign(ofiles,libs,InitProcName,&InitProc)==LOAD_SUCCEEDED) {
|
||||
(*InitProc)();
|
||||
returncode = TRUE;
|
||||
}
|
||||
|
||||
/* I should recover space if load foreign fails */
|
||||
if (returncode == TRUE) {
|
||||
ForeignObj *f_code = (ForeignObj *)_YAP_AllocCodeSpace(sizeof(ForeignObj));
|
||||
ForeignObj *f_code = (ForeignObj *)Yap_AllocCodeSpace(sizeof(ForeignObj));
|
||||
f_code->objs = ofiles;
|
||||
f_code->libs = libs;
|
||||
f_code->f = InitProcName;
|
||||
@@ -100,22 +100,22 @@ p_load_foreign(void)
|
||||
|
||||
static Int
|
||||
p_obj_suffix(void) {
|
||||
return(_YAP_unify(_YAP_StringToList(SHLIB_SUFFIX),ARG1));
|
||||
return(Yap_unify(Yap_StringToList(SHLIB_SUFFIX),ARG1));
|
||||
}
|
||||
|
||||
void
|
||||
_YAP_InitLoadForeign(void)
|
||||
Yap_InitLoadForeign(void)
|
||||
{
|
||||
if (_YAP_argv == NULL)
|
||||
_YAP_FindExecutable("yap");
|
||||
if (Yap_argv == NULL)
|
||||
Yap_FindExecutable("yap");
|
||||
else
|
||||
_YAP_FindExecutable(_YAP_argv[0]);
|
||||
_YAP_InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag);
|
||||
_YAP_InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag);
|
||||
Yap_FindExecutable(Yap_argv[0]);
|
||||
Yap_InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag);
|
||||
Yap_InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag);
|
||||
}
|
||||
|
||||
void
|
||||
_YAP_ReOpenLoadForeign(void)
|
||||
Yap_ReOpenLoadForeign(void)
|
||||
{
|
||||
ForeignObj *f_code = ForeignCodeLoaded;
|
||||
SMALLUNSGN OldModule = CurrentModule;
|
||||
@@ -123,7 +123,7 @@ _YAP_ReOpenLoadForeign(void)
|
||||
|
||||
while (f_code != NULL) {
|
||||
CurrentModule = f_code->module;
|
||||
if(_YAP_ReLoadForeign(f_code->objs,f_code->libs,f_code->f,&InitProc)==LOAD_SUCCEEDED) {
|
||||
if(Yap_ReLoadForeign(f_code->objs,f_code->libs,f_code->f,&InitProc)==LOAD_SUCCEEDED) {
|
||||
(*InitProc)();
|
||||
}
|
||||
f_code = f_code->next;
|
||||
|
Reference in New Issue
Block a user