[gambit-list] How to pass a u8vector to the FFI

Alex Queiroz asandroq at gmail.com
Tue Mar 30 10:11:19 EDT 2010


Hallo,

2010/3/30 Mikael <mikael.trash at gmail.com>:
> You do this, by declaring the passed u8vector as a scheme-object in the
> c-lambda definition.
> The memory pointer to the u8vector's contents in the C code is resolved by
>      void *u8vectorptr =
> ___CAST(void*,&___FETCH_U8(___BODY(theu8vectorschemeobjectvariable),___INT(0)));
> Remember that the pointer is only to be kept until the next return to
> Scheme.

     AFAIK you do not need the last ___INT().

Cheers,
-- 
-alex
@asandroq
http://www.ventonegro.org/



More information about the Gambit-list mailing list