FFI, Ogg Vorbis, and char[]

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Fri Nov 22 20:03:22 UTC 2002


On Fri, 22 Nov 2002, Jason Dufair wrote:

> I'm building a number of ExternalStructures and have mostly run into 
> types that FFI supports.  I'm not sure how to define something declared 
> in a struct like the following, though:
> 
> foo char[123];
> 
> Should that be char* in the fields method of my subclass of 
> ExternalStructure?  If so, how does it know how big the array is?

That *is* ugly. I guess you have to dissect the structure by yourself
(pointer arithmetics). What does the structure actually look like?

> Also, if anyone has any pointers, or better yet code, for calling an 
> existing lib via FFI (something more extensive than the examples in the 
> image), please let me know.

Here's an example I did a looong time ago:
http://swiki.gsug.org:8080/sqfixes/511.html

-- Bert




More information about the Squeak-dev mailing list