next up previous contents index
Next: Prolog exceptions in foreign Up: The Foreign Include File Previous: Discarding Data   Contents   Index

Foreign Code and Modules

Modules are identified via a unique handle. The following functions are available to query and manipulate modules.

module_tPL_context Return the module identifier of the context module of the currently active foreign predicate. intPL_strip_moduleterm_t +raw, module_t *m, term_t -plain Utility function. If raw is a term, possibly holding the module construct module:rest this function will make plain a reference to rest and fill module * with module. For further nested module constructs the inner most module is returned via module *. If raw is not a module construct arg will simply be put in plain. If module * is NULL it will be set to the context module. Otherwise it will be left untouched. The following example shows how to obtain the plain term and module if the default module is the user module:


\begin{code}
{ module m = PL_new_module(PL_new_atom(''user''));
term_t plain = PL_new_term_ref();
\par PL_strip_module(term, &m, plain);
...
\end{code}

atom_tPL_module_namemodule_t Return the name of module as an atom. module_tPL_new_moduleatom_t name Find an existing or create a new module with name specified by the atom name.


next up previous contents index
Next: Prolog exceptions in foreign Up: The Foreign Include File Previous: Discarding Data   Contents   Index
Dr. Richard Botting 2001-12-12