Re: type friction C <-> scheme

2017-06-09 Thread Catonano
2017-06-10 0:33 GMT+02:00 Matt Wette : I think Mike caught your real error: you were passing (list ‘* ‘int ‘*) and > it wants (list ‘* int ‘*). `int’ is a variable defined by guile. > And isn't `*' a variable defined in guile too ? > > scheme@(guile-user)> (use-modules (system foreign)) > sche

Re: type friction C <-> scheme

2017-06-09 Thread Matt Wette
> On Jun 9, 2017, at 2:39 PM, Catonano wrote: > > > > 2017-06-09 22:56 GMT+02:00 Matt Wette >: > > I think your outcome-ptr should be (bytevector->pointer (make-bytevector > (sizeof unsigned-int))) > > Thank you, Matt > > The reason why I wrote it that way is

Re: type friction C <-> scheme

2017-06-09 Thread Catonano
2017-06-09 22:56 GMT+02:00 Matt Wette : > > I think your outcome-ptr should be (bytevector->pointer (make-bytevector > (sizeof unsigned-int))) Thank you, Matt The reason why I wrote it that way is because the previous function (freexl_open) takes a pointer (a handler) and then more or less arbi

Re: type friction C <-> scheme

2017-06-09 Thread Catonano
Mike, 2017-06-09 22:52 GMT+02:00 Mike Gran : > > It appears that when I did bindings for guile-aspell, > I used the form (list '* int '*), so that that int was > used as a syntax or variable. > > https://github.com/spk121/guile-aspell/blob/master/aspell.scm#L165 > > Your suggestion eliminated tha

Re: type friction C <-> scheme

2017-06-09 Thread Matt Wette
> On Jun 9, 2017, at 1:36 PM, Catonano wrote: > > Here we go again > > After successfully wrapping freexl_open, I can't do the same with > freexl_get_info > > One of the arguments expected by such function is "unsigned short" > > When I load the namespace at the REPL I get > > scheme@(guile-

type friction C <-> scheme

2017-06-09 Thread Catonano
Here we go again After successfully wrapping freexl_open, I can't do the same with freexl_get_info One of the arguments expected by such function is "unsigned short" When I load the namespace at the REPL I get scheme@(guile-user)> ,m (freexl common) While executing meta-command: ERROR: In proce

Re: segmenation fault

2017-06-09 Thread Catonano
Chris, 2017-06-09 13:18 GMT+02:00 Chris Vine : > On Fri, 9 Jun 2017 10:17:18 +0200 > Catonano wrote: > > 2017-06-09 10:00 GMT+02:00 Amirouche Boubekki > > : > > > > > It's something like (bytevector->pointer (make-vector)) there is a > > > make-double-pointer procedure in guile git > > > > Tha

Re: segmenation fault

2017-06-09 Thread Josh Datko
> On Fri, 9 Jun 2017 10:17:18 +0200 > Catonano wrote: > >  > If you want to manipulate a scheme bytevector at the C level you can > also look at the c-write procedure here for ideas: > https://github.com/ChrisVine/guile-a-sync/blob/master/lib/unix_write. > c > > (As a point of detail, this proced

Re: segmenation fault

2017-06-09 Thread Chris Vine
On Fri, 9 Jun 2017 10:17:18 +0200 Catonano wrote: > 2017-06-09 10:00 GMT+02:00 Amirouche Boubekki > : > > > It's something like (bytevector->pointer (make-vector)) there is a > > make-double-pointer procedure in guile git > > Thank you !! > > I took a look at the guile-gcrypt code and I found

Re: segmenation fault

2017-06-09 Thread Catonano
Thomas, 2017-06-09 9:43 GMT+02:00 Thomas Danckaert : > From: Catonano > Subject: segmenation fault > Date: Fri, 9 Jun 2017 09:21:35 +0200 > > probably this line >> (scm->pointer 0) >> is not correct >> >> But I don't know how to produce a void pointer and then pass it to >> freexl-open >> > > It

Re: segmenation fault

2017-06-09 Thread Catonano
Amirouche, 2017-06-09 10:00 GMT+02:00 Amirouche Boubekki : > It's something like (bytevector->pointer (make-vector)) there is a > make-double-pointer procedure in guile git > > Thank you !! I took a look at the guile-gcrypt code and I found (bytevector->pointer (make-bytevector (sizeof '*))

Re: segmenation fault

2017-06-09 Thread Amirouche Boubekki
It's something like (bytevector->pointer (make-vector)) there is a make-double-pointer procedure in guile git Le 9 juin 2017 9:47 AM, "Thomas Danckaert" a écrit : > From: Catonano > Subject: segmenation fault > Date: Fri, 9 Jun 2017 09:21:35 +0200 > > probably this line >> (scm->pointer 0) >>

Re: segmenation fault

2017-06-09 Thread Thomas Danckaert
From: Catonano Subject: segmenation fault Date: Fri, 9 Jun 2017 09:21:35 +0200 probably this line (scm->pointer 0) is not correct But I don't know how to produce a void pointer and then pass it to freexl-open It seems you need a void ** (pointer to void pointer). I'm not familiar with Guil

segmenation fault

2017-06-09 Thread Catonano
in using the guile FFI I am having a segmentation fault This is the C unction that I'm trying to wrap https://www.gaia-gis.it/gaia-sins/freexl-1.0.1-doxy-doc/html/freexl_8h.html#acbd27ba5bc7b21d4ae32c0542d51f1e4 My code is here https://gitlab.com/humanitiesNerd/guile-freexl (configure is to be c