FFI, Ogg Vorbis, and char[]

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Sat Nov 23 00:28:54 UTC 2002


On Fri, 22 Nov 2002, Jason Dufair wrote:

> Bert Freudenberg wrote:
> 
> >That *is* ugly. I guess you have to dissect the structure by yourself
> >(pointer arithmetics). What does the structure actually look like?
> 
> Here's what the struct looks like:
> 
> typedef struct {
>   [...]
>   unsigned char    header[282];      /* working space for header encode */
>   [...]
> } ogg_stream_state;
> 
> The outer structure (OggVorbis_File) has various fields and nested 
> structures (one of which is this ogg_stream_state).  This is the only 
> place where I actually see an array of chars - I realize I typed the 
> declaration incorrectly in my earlier email.  I doubt I'll ever need to 
> use that buffer in my code, but I'm not sure how to tell 
> ExternalStructure to just move ahead 282 bytes.  Any ideas?

I think the field specs can have a byteSize parameter. Maybe this just
works?

#( ...
   (header 'char' 282)
   ... ) 

-- Bert




More information about the Squeak-dev mailing list