Converts a Lisp string to a foreign string within the scope of the body of a with-dynamic-foreign-objects
command.
convert-to-dynamic-foreign-string string &key external-format null-terminated-p => pointer length
A Lisp string.
A keyword specifying the format to be used for the foreign string.
If t
, the foreign string terminates with a null character. The default value is t
.
An FLI pointer to the foreign string.
The length of the string (including the terminating null character if there is one).
The function convert-to-dynamic-foreign-string
converts a Lisp string to a foreign string, and returns a pointer to the string and the length of the string. The memory allocation for the string and pointer is within the scope of the body of a with-dynamic-foreign-objects
command.
The external-format keyword is used to specify the format of the foreign string. It defaults to a format appropriate for C string of type char*
. For Unicode encoded strings, specify :unicode
. If you want to pass a string to the Win32 API, known as STR
in the Win32 API terminology, specify *multibyte-code-page-ef*
, which is a variable holding the external format corresponding to the current Windows multi-byte code page.
The null-terminated-p keyword specifies whether the foreign string is terminated with a null character. It defaults to t
.