Each argument of a foreign function (except for the control argument)
is of type term_t
, an opaque handle to a Prolog term. Three
groups of functions are available for the analysis of terms. The first
just validates the type, like the Prolog predicates var/1, atom/1,
etc and are called PL_is_*(). The second group attempts to
translate the argument into a C primitive type. These predicates take a term_t
and a pointer to the appropriate C-type and return TRUE
or
FALSE
depending on successful or unsuccessful translation.
If the translation fails, the pointed-to data is never modified.