On Fri, 30 Dec 2022, Damien Mattei <damien.mat...@gmail.com> wrote:
> there was a mistake in my previous post, i wanted to say int cfunc
> (int,int,char *), suggestion answered to use '*:
>
> (define cfunc (foreign-library-function "libguile-cfunc" "cfunc"
> #:return-type int #:arg-types (list int int '*)))
>
> works at this step but gives an error later:
>
> (cfunc 3 27 "toto")
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> In procedure foreign-call: Wrong type argument in position 1 (expecting
> POINTER_P): "toto"

Try (cfunc 3 27 (string->pointer "toto")). It's available in the module
(system foreign).

-- 
Olivier Dion
oldiob.dev

Reply via email to