shared_object routines support: SWI compatibility and more flexibility.
This commit is contained in:
21
C/load_dll.c
21
C/load_dll.c
@@ -32,6 +32,27 @@ Yap_FindExecutable(char *name)
|
||||
{
|
||||
}
|
||||
|
||||
void *
|
||||
Yap_LoadForeignFile(char *file, int flags)
|
||||
{
|
||||
return (void *)LoadLibrary(file);
|
||||
}
|
||||
|
||||
int
|
||||
Yap_CallForeignFile(void *handle, char *f)
|
||||
{
|
||||
YapInitProc proc = (YapInitProc)GetProcAddress((HMODULE)handle, f);
|
||||
if (!proc)
|
||||
return FALSE;
|
||||
(*proc)();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
Yap_CloseForeignFile(void *handle)
|
||||
{
|
||||
return FreeLibrary((HMODULE)handle);
|
||||
}
|
||||
|
||||
/*
|
||||
* LoadForeign(ofiles,libs,proc_name,init_proc) dynamically loads foreign
|
||||
|
Reference in New Issue
Block a user