6.4.3 Creating Prolog Terms

The following functions create a term and store it as the value of an SP_term_ref, which must exist prior to the call. They return zero if the conversion fails (as far as failure can be detected), and a nonzero value otherwise, assigning to t the converted value.

SP_put_variable()
Creates a variable.
SP_put_integer()
Creates an integer.
SP_put_float()
Creates a float.
SP_put_atom()
Creates an atom.
SP_put_string()
Creates an atom.
SP_put_address()
Creates an integer representing a pointer.
SP_put_list_codes()
Creates a char-list.
SP_put_list_n_codes()
Creates a char-list.
SP_put_list_n_bytes()
Creates a byte-list.
SP_put_integer_bytes()
Creates an arbitrarily sized integer.
SP_put_number_codes()
Creates a char-list denoting a number.
SP_put_functor()
Creates a compound term.
SP_put_list()
Creates a list.
SP_cons_functor()
Creates a compound term with arguments filled in.
SP_cons_list()
Creates a list with arguments filled in.
SP_read_from_string() (C function)
Reads a term from its textual representation, replacing variables by specified terms.

Send feedback on this subject.