next up previous contents index
Next: Reading a list Up: Analysing Terms via the Previous: Reading data from a   Contents   Index

Exchanging text using length and string

All internal text-representation of SWI-Prolog is represented using char * plus length and allow for 0-bytes in them. The foreign library supports this by implementing a *_nchars() function for each applicable *_chars() function. Below we briefly present the signatures of these functions. For full documentation consult the *_chars() function.

intPL_get_atom_ncharsterm_t t, unsigned int len, char **s intPL_get_list_ncharsterm_t t, unsigned int len, char **s intPL_get_ncharsterm_t t, unsigned int len, char **s, unsigned int flags intPL_put_atom_ncharsterm_t t, unsigned int len, const char *s intPL_put_string_ncharsterm_t t, unsigned int len, const char *s intPL_put_list_ncodesterm_t t, unsigned int len, const char *s intPL_put_list_ncharsterm_t t, unsigned int len, const char *s intPL_unify_atom_ncharsterm_t t, unsigned int len, const char *s intPL_unify_string_ncharsterm_t t, unsigned int len, const char *s intPL_unify_list_ncodesterm_t t, unsigned int len, const char *s intPL_unify_list_ncharsterm_t t, unsigned int len, const char *s

In addition, the following functions are available for creating and inspecting atoms:

atom_tPL_new_atom_ncharsunsigned int len, const char *s Create a new atom as PL_new_atom, but from length and characters. const char *PL_atom_ncharsatom_t a, unsigned int *len Extract text and length of an atom.


next up previous contents index
Next: Reading a list Up: Analysing Terms via the Previous: Reading data from a   Contents   Index
Dr. Richard Botting 2001-12-12