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

Álvaro Castro-Castilla alvaro.castro.castilla at gmail.com
Tue Mar 30 10:31:07 EDT 2010


2010/3/30 Alex Queiroz <asandroq at gmail.com>

> 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/
>


It seems that ___FECTH__U8 needs two arguments, what do you mean by not
needed then?
With ___INT(0) it works fine, but is interesting if there is a shorter way
to express the same also.

Thanks :)

Álvaro Castro-Castilla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20100330/327e4f34/attachment.htm>


More information about the Gambit-list mailing list