Converts a foreign string to a Lisp string.
fli
convert-from-foreign-string pointer &key external-format length null-terminated-p allow-null => string
pointer⇩ |
A pointer to a foreign string. |
external-format⇩ |
An external format specification. |
length⇩ |
The length of the string to convert. |
null-terminated-p⇩ |
If t , it is assumed the string terminates with a null character. The default value for null-terminated-p is t . |
allow-null⇩ |
A boolean. The default is false. |
string |
A Lisp string, or nil . |
The function convert-from-foreign-string
, given a pointer to a foreign string, converts the foreign string to a Lisp string. The pointer does not need to be of the correct type, as it will automatically be coerced to the correct type as specified by external-format.
external-format is interpreted as by with-foreign-string. The names of available external formats are listed in section 26.6 External Formats to translate Lisp characters from/to external encodings in the LispWorks® User Guide and Reference Manual.
Either length or null-terminated-p must be non-nil. If null-terminated-p is true and length is not specified, it is assumed that the foreign string to be converted is terminated with a null character.
If allow-null is true and pointer is a null pointer then nil
is returned. Otherwise, an error is signalled if pointer is a null pointer.
convert-to-foreign-string
set-locale
set-locale-encodings
with-foreign-string
26.6 External Formats to translate Lisp characters from/to external encodings in the LispWorks® User Guide and Reference Manual
5.2.4 Modifying a string in a C function
5.2.9 Mapping nil
to a Null Pointer
Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:58