Subject: [clisp-list] FFI:C-POINTER and C null pointers

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Fri Jul 19 07:02:04 2002

Aurelio Bignoli wrote:

>    Jorg> (ffi::lookup-foreign-variable "ffi_user_pointer"
>    Jorg> (ffi::parse-c-type 'ffi:c-pointer))) 'ffi:foreign-variable)
>really interesting! I didn't know of ffi::lookup-foreign-variable.

I should have said that you shouldn't use that in application code. I feel that I ought to document internals so people can propose high-level forms, built on the internals, for inclusion in CLISP's FFI.

For access to the variable now in CVS CLISP, existing forms are sufficient:

(eval-when (load eval)
  (ffi:def-c-var an-ffi-pointer (:name "ffi_user_pointer") (:type ffi:c-pointer)))

The EVAL-WHEN is important so that compilation of the containing file generates no C code as a side effect of compiling FFI:DEF-C-* forms.

Regards,
	Jorg Hohle.