Availability:C-language interface function
bool PL_unify_chars(term_t
?t, int flags, size_t len, const char *chars)New function to deal with unification of char*
with various
encodings to a Prolog representation. The flags argument is a
bitwise or specifying the Prolog target type and the encoding
of
chars. A Prolog type is one of PL_ATOM
, PL_STRING
,
PL_CODE_LIST
or PL_CHAR_LIST
. A representation
is one of
REP_ISO_LATIN_1
, REP_UTF8
or REP_MB
.
See
PL_get_chars()
for a definition of the representation types. If
len is -1
chars must be
zero-terminated and the length is computed from chars using strlen().
If flags includes PL_DIFF_LIST
and type is
one of
PL_CODE_LIST
or PL_CHAR_LIST
, the text is
converted to a difference list. The tail of the difference list
is
t+1.