| Did you know ... | Search Documentation: |
| PL_get_chars() |
BUF_STACK implies, if the data is not static (as from an
atom), that the data is pushed on a stack. If BUF_MALLOC is
used, the data must be freed using PL_free()
when no longer needed.
With the introduction of wide characters (see section
2.18.1), not all atoms can be converted into a char*.
This function fails if t is of the wrong type, but also if
the text cannot be represented. See the REP_* flags below
for details. See also PL_get_wchars()
and PL_get_nchars().
The first set of flags (CVT_ATOM through CVT_VARIABLE,
if set, are tested in order, using the first that matches. If none of
these match, then a check is made for one of CVT_WRITE,
CVT_WRITE_CANONICAL, CVT_WRITEQ being set. If
none of the “CVT_WRITE*” flags are set, then a type_error
is raised.
CVT_RATIONAL to represent rational numbers using
hexadecimal notation. Hexadecimal notation is notably useful for
transferring big integers to other programming environments if the
target system can read hexadecimal notation because the result is both
more compact and faster to write and read.CVT_RATIONAL|CVT_FLOAT.
Note that
CVT_INTEGER is implied by CVT_RATIONAL.CVT_NUMBER|CVT_ATOM|CVT_STRING.CVT_XINTEGER is not
implied). Note that this does not include variables or terms (with the
exception of a list of characters/codes). Equivalent to
CVT_ATOMIC|CVT_LIST._3290).BUF_* is provided, BUF_STACK is implied.CVT_WRITE, but using writeq/2.CVT_WRITE, but using write_canonical/2.BUF_STACK is safe, but slower. Also, some flags
can cause BUF_DISCARDABLE to be treated as
BUF_STACK. See section
12.4.14.BUF_RING is an alias
for
BUF_STACK. BUF_STACK is the default if
BUF_MALLOC is not specified. BUF_STACK should
not be used inside a loop, unless it is within a (PL_STRINGS_MARK-PL_STRINGS_RELEASE).
See
section 12.4.14.BUF_MALLOC is specified, BUF_STACK
is ignored. See section
12.4.14.