unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Catonano <catonano@gmail.com>
To: Amirouche Boubekki <amirouche.boubekki@gmail.com>
Cc: guile-user@gnu.org, Matt Wette <matt.wette@gmail.com>
Subject: Re: segmenation fault
Date: Mon, 12 Jun 2017 00:09:36 +0200	[thread overview]
Message-ID: <CAJ98PDyPxrVbDXPaejs-YuO2YaecNUvu8dSXBKd5s0=rvyNvJw@mail.gmail.com> (raw)
In-Reply-To: <CAJ98PDyUVucV6-PBvQyFOhOaCUTTt7u-_Z=4WDh4u5cPK=wPFA@mail.gmail.com>

2017-06-11 22:56 GMT+02:00 Catonano <catonano@gmail.com>:

> Amirouche, Thomas,
>
>
> 2017-06-09 10:00 GMT+02:00 Amirouche Boubekki <
> amirouche.boubekki@gmail.com>:
>
>>  It's something like (bytevector->pointer (make-vector)) there is a
>> make-double-pointer procedure in guile git
>>
>
> I have overlooked both your remarks and Thomas's remarks
>
> I apologize, I was not understanding the issue correctly
>
> I have found define-wrapped-pointer-type in the manual only now and of
> course both of you are right.
>
> The case described in the manual is slightly different than the one freexl
> poses
>
> I can't wrap a pointer created by the C funtion. I have to pass one
> created in scheme land
>
> The make-double-pointer  procedure in guile-git seems appropriate. Thanks,
> Amirouche
>


Ok, I finally managed to make it work !

Amirouche, I didn't remember but I had written a line exactly equal to
yours:
(bytevector->pointer (make-bytevector (sizeof '*)))

in order to create e void pointer in scheme land !

The thing is that when I passed it in as an argument it was a void pointer:
void *

but when freexl_open had run it was a double pointer: handler **

Subsequent functions expected a simple pointer: handler *

So it simply had to be dereferenced ! Like this

(dereference-pointer handler **double-pointer)

this returns a handler *single-pointer

It's impossible discussing pointer types without becoming psychedelic in a
few lines ! :-/

Now, to make thing really tidy, I should also use the wrap unwrap mechanism

Thank you all people !


  reply	other threads:[~2017-06-11 22:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09  7:21 segmenation fault Catonano
2017-06-09  7:43 ` Thomas Danckaert
2017-06-09  8:00   ` Amirouche Boubekki
2017-06-09  8:17     ` Catonano
2017-06-09 11:18       ` Chris Vine
2017-06-09 16:36         ` Josh Datko
2017-06-09 20:18         ` Catonano
2017-06-11 20:56     ` Catonano
2017-06-11 22:09       ` Catonano [this message]
2017-06-09  8:42   ` Catonano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ98PDyPxrVbDXPaejs-YuO2YaecNUvu8dSXBKd5s0=rvyNvJw@mail.gmail.com' \
    --to=catonano@gmail.com \
    --cc=amirouche.boubekki@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=matt.wette@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).