This module defines a Quintus compatible foreign language interface based on the foreign_file/2 and foreign/3 declarations.
Predicates:
Example:
foreign_file('-lm', [sin/2]). foreign(sin, c, sin(+float, [-float])). :- load_foreign_files, abolish(foreign_file, 2), abolish(foreign, 3).
Supported types:
Spec | Prolog | C |
integer | integer | long |
float | float,integer | double |
single | float,integer | single |
string | atom,string | char * |
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.
Of the supported PL_FA_<FLAGS>, TRANSPARENT may be declared by looking at the transparent (meta_predivate) attribute of the predicate.
make_foreign_wrapper_file(+File)
, compiles the wrapper
and loads the predicates.The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
make_foreign_wrapper_file(+File)
, compiles the wrapper
and loads the predicates.make_foreign_wrapper_file(+File)
, compiles the wrapper
and loads the predicates.