Author(s): Jose Morales, Manuel Carro.
Version: 1.11#222 (2004/5/24, 13:8:7 CEST)
Version of last change: 1.11#216 (2004/3/26, 20:8:6 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).
Usage 1: :- foreign_inline(Term, Text).
Term is a predicate name. Text is a source C code that define the predicate Term. Term is present for future use with the analyzers. Example of this can be viewed in the hrtimer library.
Term is a Name/Arity structure denoting a predicate name:
predname(P/A) :-
atm(P),
nnegint(A).
(basic_props:predname/1)
Text is a string (a list of character codes).
(basic_props:string/1)
Usage 2: :- foreign_inline(Term, Text).
Text.
Term is a free variable.
(term_typing:var/1)
Text is a string (a list of character codes).
(basic_props:string/1)
foreign_interface_properties)size_of/3 property has an empty definition
Go to the first, previous, next, last section, table of contents.