[Openmcl-devel] FFI questions

Ron Garret ron at awun.net
Wed Oct 31 18:37:05 UTC 2007


Just what I was looking for.  Thanks!

rg

On Oct 31, 2007, at 11:22 AM, R. Matthew Emerson wrote:

>
> 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