- Documentation
- Reference manual
- Packages
_chars().
int PL_get_nchars(term_t
t, size_t *len, char **s, unsigned int flags) See PL_get_chars().
The len pointer may be
int PL_put_atom_nchars(term_t
t, size_t len, const char *s) See PL_put_atom_chars().
int PL_put_string_nchars(term_t
t, size_t len, const char *s) See PL_put_string_chars().
int PL_put_list_ncodes(term_t
t, size_t len, const char *s) See PL_put_list_codes().
int PL_put_list_nchars(term_t
t, size_t len, const char *s) See PL_put_list_chars().
int PL_unify_atom_nchars(term_t
t, size_t len, const char *s) See PL_unify_atom_chars().
int PL_unify_string_nchars(term_t
t, size_t len, const char *s) See PL_unify_string_chars().
int PL_unify_list_ncodes(term_t
t, size_t len, const char *s) See PL_unify_codes().
int PL_unify_list_nchars(term_t
t, size_t len, const char *s) See PL_unify_list_chars().
NULL
.In addition, the following functions are available for creating and inspecting atoms:
- atom_t PL_new_atom_nchars(size_t len, const char *s)
- Create a new atom as PL_new_atom(),
but using the given length and characters. If len is
(size_t)-1
, it is computed from s using strlen(). See PL_new_atom() for error handling. - const char * PL_atom_nchars(atom_t a, size_t *len)
- Extract the text and length of an atom. If you do not need the length, pass NULL as the value of len. If PL_atom_nchars() is called for a blob, NULL is returned.
12.4.4.4 Wide-character versions
Support for exchange of wide-character strings is still under
consideration. The functions dealing with 8-bit character strings return
failure when operating on a wide-character atom or Prolog string object.
The functions below can extract and unify both 8-bit and wide atoms and
string objects. Wide character strings are represented as C arrays of
objects of the type pl_wchar_t
, which is guaranteed to be
the same as wchar_t
on platforms supporting this type. For
example, on MS-Windows, this represents a 16-bit UTF-16 string, while
using the GNU C library (glibc) this represents 32-bit UCS4 characters.