felix winkelmann scripsit:

> I will try to come up with a usable implementation for the
> other direction, passing string-lists to C, but I'm not sure
> where to allocate the storage for the list, and what to do
> for callbacks that might trigger GC. Perhaps allocate
> an array via alloca()? Any ideas are welcome.

I suggest that you use the same general machinery as c-string and
c-string*, except that instead of a single null-terminated string
you have a NULL-terminated array immediately followed by null-terminated
strings.  So when passing these to C, malloc() a single block for them
(you know all the sizes in advance), and if the result type is
c-string-list*, then after copying the strings, simply cast
the char** to void* and free() it.

-- 
John Cowan    [EMAIL PROTECTED]    http://ccil.org/~cowan
Half the lies they tell about me are true.
        -- Tallulah Bankhead, American actress


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to