ensure-char-integer
— Ensures that a dereferenced :char
pointer is
an integer.
(ensure-char-integer
object)
| Either a character or a integer specifying a character code. |
returns | An integer. |
(let ((fs (convert-to-foreign-string "a"))) (prog1 (ensure-char-integer (deref-pointer fs :char)) (free-foreign-object fs))) => 96
Depending upon the implementation and what UFFI expects, this macro may signal an error if the object is not a character or integer.