[cffi-devel] Mutable Pointers
Stuart Sierra
mail at stuartsierra.com
Fri Jul 14 01:38:05 UTC 2006
Stephen Compall <s11 at member.fsf.org> writes:
> Stuart Sierra wrote:
>> I'm working on a CFFI interface to the Perl API (I thought
>> it would be fun - ha!) and I need to be able to do C-style
>> pointer arithmetic. That is, I have a foreign pointer
>> declared with DEFCVAR and I need to alter the address stored
>> there. I couldn't see a way to do this with CFFI, so I
>
> You've got one half of the answer already -- `make-pointer'. Now see
> `pointer-address'
> (http://common-lisp.net/project/cffi/manual/html_node/pointer_002daddress.html).
But POINTER-ADDRESS is not setf-able, is it? I want to do
this:
(defcvar "stack_pointer" :pointer)
(incf (pointer-address *stack-pointer*))
where "stack_pointer" is a global variable in an external
library. But...
The function (SETF POINTER-ADDRESS) is undefined.
[Condition of type UNDEFINED-FUNCTION]
-Stuart
More information about the cffi-devel
mailing list