This module defines a Quintus compatible foreign language interface
based on the foreign_file/2 and foreign/3 declarations.
- Load all foreign files defined with foreign_file/2 statement
in the current module.
- load_foreign_files(+Files, +Libs)
- Load specified foreign files, linking them with the given
- load_foreign_files(+SharedObject, +Files, +Libs)
- As load_foreign_files/2, but first tries to load `SharedObject'.
If the SharedObject exists it is loaded using load_foreign_library/1.
Otherwise it is first created with make_shared_object/3.
- make_shared_object(+SharedObject, +Files, +Libs)
- Generate a wrapper and link it using plld to the given SharedObject.
- make_foreign_wrapper_file(+Files, +OutBase)
- Generate wrapper for the named object files in OutBase.c.
- Generate wrapper for all declared object files in OutBase.c.
foreign(sin, c, sin(+float, [-float])).
|atom||atom||atom identifier (type atomic)|
NOTE This modules requires a correctly functioning swipl-ld and
load_foreign_library/1 on your system. If this isn't the
case use make_foreign_wrapper_file/[1,2] to generate a
wrapper and use static embedding.
- - Only supports C-interface
- - Insufficient checking for misusage.
- - Documentation is too short and very outdated
- load_foreign_files is det
- load_foreign_files(:Files, +Libs) is det
- load_foreign_files(+SharedObject, :Files, +Libs) is det
make_foreign_wrapper_file(+File), compiles the wrapper
and loads the predicates.
- make_shared_object(+Object, :Files, +Libs) is det
- Generate a wrapper and link it using plld to the given
- make_foreign_wrapper_file(:OutFile) is det
- make_foreign_wrapper_file(:Files, +OutFile) is det
- Just output the wrapper file to the named .c file. May be used
to prepare for static linking or the preparation of the native
- make_foreign_resource_wrapper(:Resource, +ResBase, +FileBase)
- Create a wrapper-file for the given foreign resource
- load_foreign_resource(:Resource, +Dir)
- Load a foreign module. First try to load from the same direcory
as the Prolog file. Otherwise load using SWI-Prolog's default