All Manuals > Foreign Language Interface User Guide and Reference Manual > 8 Type Reference

:ef-wc-string FLI Type Descriptor

Summary

Converts between a Lisp string and a C wide-character string.

Package

keyword

Syntax

:ef-wc-string &key limit external-format null-terminated-p

Arguments
limit
The maximum number of characters of the C wide-character string.
external-format
An external format specification.
null-terminated-p
A boolean controlling the null termination byte.
Description

The FLI type :ef-wc-string converts between a Lisp string and a C wide-character string. The C string may have a maximum length of limit characters. limit can be omitted in cases where a new foreign string is being allocated.

external-format is used to specify the encoding of the foreign string. It defaults to an encoding appropriate for C string of type wchar_t*. For Unicode encoded strings, specify :unicode. If you want to pass a string to the Windows API, known as WSTR in the Windows API terminology, also specify :unicode. To change the default, call set-locale or set-locale-encodings.

If null-terminated-p is non-nil, a NULL word is added to the end of the string.

See also

:ef-mb-string
set-locale
set-locale-encodings
2.2.2 Strings


Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:59