Author(s): Jose Morales, Manuel Carro.
Version: 1.10#7 (2006/4/26, 19:22:13 CEST)
Version of last change: 1.9#229 (2003/12/22, 17:34:59 CET)
The foreign language interface uses some properties to specify linking regimes, foreign files to be compiled, types of data available, memory allocation policies, etc.
foreign_interface_properties
)foreign_interface_properties
)
Usage: int_list(List)
List
is a list of integers.
Usage: byte_list(List)
List
is a list of bytes.
Usage: byte(Byte)
Byte
is a byte.
Usage: null(Address)
Address
is a null adress.
Usage: address(Address)
Address
is a memory address.
Usage: any_term(X)
X
is any term. The foreign interface passes it to C functions as a general term.
Usage: native(Name)
Usage: native(PrologName, ForeignName)
Usage: size_of(Name, ListVar, SizeVar)
Usage: foreign(Name)
Usage: foreign(PrologName, ForeignName)
Usage: returns(Name, Var)
Usage: do_not_free(Name, Var)
Name
, the C argument passed to (returned from) the foreign function will not be freed after calling the foreign function.
foreign_interface_properties
)
Usage: :- use_foreign_source(Files)
.
Files
is the (list of) foreign file(s) that will be linked with the glue-code file.
Files
is an atom or a list of atoms.
(basic_props:atm_or_atm_list/1
)
Usage: :- use_foreign_source(OsArch, Files)
.
Files
are the OS and architecture dependant foreign files. This allows compiling and linking different files depending on the O.S. and architecture.
OsArch
is an atom.
(basic_props:atm/1
)
Files
is an atom or a list of atoms.
(basic_props:atm_or_atm_list/1
)
Usage: :- use_foreign_library(Libs)
.
Libs
is the (list of) external library(es) needed to link the C files. Only the short name of the library (i.e., what would follow the -l
in the linker is needed.
Libs
is an atom or a list of atoms.
(basic_props:atm_or_atm_list/1
)
Usage: :- use_foreign_library(OsArch, Libs)
.
Libs
are the OS and architecture dependant libraries.
OsArch
is an atom.
(basic_props:atm/1
)
Libs
is an atom or a list of atoms.
(basic_props:atm_or_atm_list/1
)
Usage: :- extra_compiler_opts(Opts)
.
Opts
is the list of additional compiler options (e.g., optimization options) that will be used during the compilation.
Opts
is an atom or a list of atoms.
(basic_props:atm_or_atm_list/1
)
Usage: :- extra_compiler_opts(OsArch, Opts)
.
Opts
are the OS and architecture dependant additional compiler options.
OsArch
is an atom.
(basic_props:atm/1
)
Opts
is an atom or a list of atoms.
(basic_props:atm_or_atm_list/1
)
Usage: :- use_compiler(Compiler)
.
Usage: :- use_compiler(OsArch, Compiler)
.
Usage: :- extra_linker_opts(Opts)
.
Opts
is the list of additional linker options that will be used during the linkage.
Opts
is an atom or a list of atoms.
(basic_props:atm_or_atm_list/1
)
Usage: :- extra_linker_opts(OsArch, Opts)
.
Opts
are the OS and architecture dependant additional linker options.
OsArch
is an atom.
(basic_props:atm/1
)
Opts
is an atom or a list of atoms.
(basic_props:atm_or_atm_list/1
)
Usage: :- use_linker(Linker)
.
Usage: :- use_linker(OsArch, Linker)
.
foreign_interface_properties
)size_of/3
property has an empty definition
Go to the first, previous, next, last section, table of contents.