#include <sicstus/sicstus.h> int SP_get_functor(SP_term_ref term, SP_atom *name, int *arity);
*arity the canonical representation
and arity of the principal functor of a Prolog compound
term. If the value of
term is an atom, then that atom
is assigned to
*name and 0 is assigned to
*arity. This is
similar to calling
functor/3 with the first argument
bound to a compound term or an atom and the second and
third arguments unbound.
The SP_term_ref holding the value
The location to assign to the functor name
The location to assign to the functor arity
Zero if the conversion fails (as far as failure can be detected), and a nonzero value otherwise.
Accessing Prolog Terms.