Package: cffi
Function mem-ref
Lambda Listmem-ref (ptr type &optional offset) ArgumentsReturn ValueThe value ptr points to. DetailsExamplesCFFI> (with-foreign-string (ptr "Saluton") (setf (mem-ref ptr :char 3) (char-code #a)) (loop for i from 0 below 8 collect (code-char (mem-ref ptr :char i)))) => (#S #a #l #a #t #o #n #Null) CFFI> (setq ptr-to-int (foreign-alloc :int)) => #<A Mac Pointer #x1047D0> CFFI> (mem-ref ptr-to-int :int) => 1054619 CFFI> (setf (mem-ref ptr-to-int :int) 1984) => 1984 CFFI> (mem-ref ptr-to-int :int) => 1984 | See also |