FFI questions

Joshua 'Schwa' Gargus schwa at cc.gatech.edu
Fri Sep 5 05:40:35 UTC 2003


On Fri, Sep 05, 2003 at 03:45:00AM +0200, Andreas Raab wrote:
> Stdio>>puts: aString
> 	<cdecl: void 'puts' (char*)>
> 
> will allow you to use 
> 
> 	Stdio new puts: 'Hello World'.
> 
> whereas using 'byte*' in the above will print out half of Squeak's object
> memory.

:-)


> > - What the heck do I do for 'byte**'?  
> >   (The C function expects an array of null-terminated strings)
> 
> You need to assemble the arguments manually. Bert had a nice example for
> this some time back (it was some socket related stuff) you may want to
> google for it.

I found it, but it only has reading from **s, not writting them.
Bweh.  But now that I know what the problem was, I can hack something
together.  "Null-termininated array of null-terminated strings" is a 
common enough concept that it would be probably be handy for lots of 
people.

Thanks for the help,
Joshua

> 
> Cheers,
>   - Andreas
> 



More information about the Squeak-dev mailing list