Fills a foreign object, given a pointer to it.
fli
fill-foreign-object pointer &key nelems byte => pointer
pointer⇩ |
A foreign pointer. |
nelems⇩ |
A non-negative integer. The default is 1 . |
byte⇩ |
An integer. The default is 0 . |
pointer |
The foreign pointer. |
The function fill-foreign-object
fills the pointer pointer with the value byte. If nelems is greater than 1, an array of objects starting at pointer is filled.
(fli:with-dynamic-foreign-objects () (let ((pp (fli:allocate-dynamic-foreign-object :type :char :initial-element 66 :nelems 6))) (fli:fill-foreign-object pp :nelems 3 :byte 65) (loop for i below 6 collect (fli:dereference pp :type :char :index i)))) => (#\A #\A #\A #\B #\B #\B)
Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:58