ensure-char-character — Ensures that a dereferenced :char pointer is
a character.
(ensure-char-character object)
| Either a character or a integer specifying a character code. |
returns | A character. |
Ensures that an objects obtained by dereferencing
:char and :unsigned-char
pointers are a lisp character.
(let ((fs (convert-to-foreign-string "a")))
(prog1
(ensure-char-character (deref-pointer fs :char))
(free-foreign-object fs)))
=> #\aDepending upon the implementation and what UFFI expects, this macro may signal an error if the object is not a character or integer.