Atom Construction

Functions:

1. static UInt cvtFlags(unsigned flags):

1. X_API PL_agc_hook_t PL_agc_hook(PL_agc_hook_t entry): : Atom garbage collection hook.

1. X_API int PL_get_nchars(term_t l, size_t *lengthp, char s, unsigned flags)**: : extract a text representing the term ref.

A pointer to a string with the text will be output to s, and the size of the string will be written to length, if length is not null.

The following flags are recognised (as in the SWI manual ) CVT_ATOM Convert if term is an atom. CVT_STRING Convert if term is a string. CVT_LIST Convert if term is a list of of character codes. CVT_INTEGER Convert if term is an integer. CVT_FLOAT Convert if term is a float. The characters returned are the same as write_49 "write/1" would write for the floating point number. CVT_NUMBER Convert if term is an integer or float. CVT_ATOMIC Convert if term is atomic. CVT_VARIABLE Convert variable to print-name CVT_WRITE Convert any term that is not converted by any of the other flags using @ref write_49 @"write/1". * If no BUF_ is provided, BUF_RING is implied. CVT_WRITE_CANONICAL As CVT_WRITE, but using @ref write_canonical_50 @"write_canonical/2". CVT_WRITEQ As CVT_WRITE, but using @ref writeq_50 @"writeq/2". CVT_ALL Convert if term is any of the above, except for CVT_VARIABLE and CVT_WRITE. *CVT_EXCEPTION* If conversion fails due to a type error, raise a Prolog type error exception in addition to failure BUF_DISCARDABLE Data must copied immediately BUF_RING Data is stored in a ring of buffers, currenty implemented as BUF_DISCARDABLE BUF_MALLOC Data is copied to a new buffer returned by PL_malloc(3). When no longer needed the user must call PL_free() on the data. *REP_ISO_LATIN_1 Text is in ISO Latin-1 encoding and the call fails if text cannot be represented. This flag has the value 0 and is thus the default. REP_UTF8 Convert the text to a UTF-8 string. This works for all text. REP_MB Convert the text using the current locale

1. int PL_get_chars(term_t t, char s, unsigned flags)**:

1. int PL_get_wchars(term_t l, size_t *lengthp, wchar_t s, unsigned flags)**:

1. X_API int PL_unify_chars(term_t l, int flags, size_t length, const char *s):

1. X_API char * PL_atom_chars(atom_t a): : extract the text representation from atom

1. X_API char * PL_atom_nchars(atom_t a, size_t *len): : extract the text representation from atom, including its length

1. int PL_chars_to_term(const char *s, term_t t):