[cffi-devel] defcstruct bz_stream

Brad Anderson brad at sankaty.com
Tue Jan 17 19:25:29 UTC 2006


Kilian Sprotte wrote:
> Hi,
> 
> I was playing around with libbz2 with bindings generated
>  from the cffi backend of SWIG, which latest cvs 
> works very nicely now. Basic reading, writing has been a joy.
> 
>  The only thing is that cffi gave me an error 
> (division-by-zero) when evaluating the following defcstruct:
> 
> (defcstruct bz_stream
> 	(next_in :char)
> 	(avail_in :unsigned-int)
> 	(total_in_lo32 :unsigned-int)
> 	(total_in_hi32 :unsigned-int)
> 	(next_out :char)
> 	(avail_out :unsigned-int)
> 	(total_out_lo32 :unsigned-int)
> 	(total_out_hi32 :unsigned-int)
> 	(state :void)
> 	(bzalloc :void)
> 	(bzfree :void)
> 	(opaque :void))
> 

I'm not sure if my error was division-by-zero, but in libxml2, which I used SWIG/CFFI to bind, the :void types
were actually void*, and so I switched all of them to :pointer.

Maybe this would help you?

BA



More information about the cffi-devel mailing list