FFI, Ogg Vorbis, and char[]

Jason Dufair jase at dufair.org
Fri Nov 22 18:43:37 UTC 2002


I'm proceeding to enable Squeak to play Ogg Vorbis by using FFI. 
 Xiph.org provides a platform-independent library that can decode .ogg 
files, so FFI seemed an easier and maybe cleaner way of doing this. 
 While I understand that FFI is a bit slower than a plugin, the calls 
should be fairly infrequent as the external lib will be doing all the work.

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?

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.

-- 
Jason Dufair - jase at dufair.org
http://www.dufair.org/
"Wish I was a headlight on a northbound train
I'd shine my light through the cool Colorado rain"
-- The Grateful Dead





More information about the Squeak-dev mailing list