The maximum number of bytes of the C multi-byte string.
An external format specification.
null-terminated-p
A boolean controlling the null termination byte.
The FLI :ef-mb-string
type converts between a Lisp string and a C multi-byte string. The C string may have a maximum length of limit bytes. The limit can be omitted in cases where a new foreign string is being allocated.
The external-format is used to specify the encoding of the foreign string. It defaults to an encoding appropriate for C string of type char*
. If you want to pass a string to the Windows API, known as STR
in the Windows API terminology, specify win32:*multibyte-code-page-ef*
, which is a variable holding the external format corresponding to the current Windows multi-byte code page. To change the default, call set-locale or set-locale-encodings.
If null-terminated-p is non-nil, a NULL byte is added to the end of the string.
If you want to pass a string argument by reference but also allow conversion from Lisp nil
to a null pointer, specify the :reference
type :allow-null
argument, for example:
(:reference-pass :ef-mb-string :allow-null t)
LispWorks Foreign Language Interface User Guide and Reference Manual - 29 Sep 2017