Need foreign string method for translate-into-foreign-memory?

Liam Healy lnp at healy.washington.dc.us
Tue Oct 1 16:28:43 UTC 2013


OK. On superficial examination, it seems like foreign-string-alloc and
lisp-string-to-foreign have significant duplicated code. Is there a reason
for that rather than having the former call the latter?

Thanks,
Liam


On Tue, Oct 1, 2013 at 4:43 AM, Luís Oliveira <loliveira at common-lisp.net>wrote:

> On Tue, Oct 1, 2013 at 4:17 AM, Liam Healy <lnp at healy.washington.dc.us>
> wrote:
> > Based on this report http://paste.lisp.org/display/139232 it seems like
> we
> > need a method translate-into-foreign-memory for foreign-string in order
> that
> > cffi-libffi works when there are both structures by value and strings in
> the
> > arguments (or return). I looked at the code for translate-to-foreign for
> > inspiration, but I'm not clear on how strings work. Is this simply a
> memcpy?
>
> Not quite a memcpy since we need to convert from Lisp characters to
> one or more bytes depending on the desired target encoding.
> LISP-STRING-TO-FOREIGN is the function for job.
>
> Cheers,
>
> --
> Luís Oliveira
> http://kerno.org/~luis/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20131001/799323a5/attachment.html>


More information about the cffi-devel mailing list