add words to deal with void** to contrib/alien

darcs
erg 2006-11-15 18:36:09 +00:00
parent 887a53ea80
commit 5ee8a82429
1 changed files with 9 additions and 1 deletions

View File

@ -9,4 +9,12 @@ dup length "float" <c-array> copy-seq-to-float-array ;
: float-array>array ( byte-array n -- array ) [ swap float-nth ] map-with ;
PROVIDE: contrib/alien ;
: >void*-array
[ length "void*" <c-array> ] keep
dup length [ pick set-char*-nth ] 2each ;
: seq>void*-array ( seq -- seq byte-array )
#! output seq is an array of pointers that must be freed
[ <malloc-string> ] map dup >void*-array ;
PROVIDE: contrib/alien ;