[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing C pointers through guile
From: |
Ludovic Courtès |
Subject: |
Re: Passing C pointers through guile |
Date: |
Sun, 06 Jul 2008 21:20:31 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Hi,
"Kjetil S. Matheussen" <address@hidden> writes:
> I haven't heard of the "uo" field before, but at least using a SMOB
> is really inconvenient, and using an unsigned long for storing
> pointers is really convenient. (BTW. How does swig and gwrap handle
> pointers?)
G-Wrap has "wrapped C types" (WCTs):
http://www.nongnu.org/g-wrap/manual/Wrapping-a-C-Pointer-Type.html
IIRC, it uses a SMOB containing additional information behind the
scenes.
> I agree with Maciek that it would at least be mind-comforting to have
> functions like scm_to_ptr/etc, although not strictly necessary,
> since using integers works just fine.
`scm_{to,from}_uintptr ()' could be handy (patches welcome!).
That said, using a Scheme integer to represent a pointer wouldn't be
efficient (pointers would likely translate to bignums).
Thanks,
Ludovic.
Re: Passing C pointers through guile, Kjetil S. Matheussen, 2008/07/10