[Up] [Contents] [Index] [Summary]

5.6.2 Atoms and functors

The following functions provide for communication using atoms and functors.

atom_t PL_new_atom(const char *)
Return an atom handle for the given C-string. This function always succeeds. The returned handle is valid for the entire session.

char * PL_atom_chars(atom_t atom)
Return a C-string for the text represented by the given atom. The returned text will not be changed by Prolog. It is not allowed to modify the contents, not even `temporary' as the string may reside in read-only memory.

functor_t PL_new_functor(atom_t name, int arity)
Returns a functor identifier, a handle for the name/arity pair. The returned handle is valid for the entire Prolog session.

atom_t PL_functor_name(functor_t f)
Return an atom representing the name of the given functor.

int PL_functor_arity(functor_t f)
Return the arity of the given functor.