[Ecls-list] :CSTRING cannot be used anymore as FFI argument(sockets.lisp does not compile)

Juan Jose Garcia Ripoll lisp at arrakis.es
Mon Oct 10 05:15:03 UTC 2005


On Mon, 2005-10-10 at 13:50 +0200, Goffioul Michael wrote:
> OK, but I was talking about the case where the calling routine gave
> a :CSTRING argument to the function, expecting the C function to fill
> it in with some value. As the C function gets a copy of the argument,
> the original one is left untouched, which might not be what the calling
> routine expects.

Ok. But then you understand that this problem was already present
before.

Actually it is not a problem, but a misunderstanding of what you can
expect from UFFI. You cannot expect that the C functions are allowed to
manipulate lisp data. If you want to use strings for i/o arguments, you
have to use WITH-CSTRING around your code and reference _that_ string.
Or even better, use a foreign data region.

Regards,

Juanjo





More information about the ecl-devel mailing list