[Openmcl-devel] FFI questions

R. Matthew Emerson rme at clozure.com
Wed Oct 31 11:22:54 PDT 2007


On Oct 31, 2007, at 1:10 PM, Ron Garret wrote:

> Couple o' questions about the FFI:
>
> 1.  Is there an FFI equivalent to the C sizeof operator?

ccl::foreign-size should do the job.

Welcome to Clozure Common Lisp Version 1.1-r7569 (DarwinX8664)!
? (ccl::foreign-size :id)
64
? (ccl::foreign-size :<NSR>ect)
256
? (ccl::foreign-size (:struct :timeval))
128

By default, the size is returned in bits, but you can ask for the size  
in bytes or machine words by specifying :bytes or :words as an  
optional last argument.

? (ccl::foreign-size :<NSR>ect :bytes)
32




More information about the Openmcl-devel mailing list