Re: Passing C pointers through guile

2008-07-23 Thread Greg Troxel
Ken Raeburn <[EMAIL PROTECTED]> writes: > On Jul 9, 2008, at 12:55, Kjetil S. Matheussen wrote: >> On Wed, 9 Jul 2008, Greg Troxel wrote: >>> Does C guarantee that pointers fit in unsigned long? >> I don't know. But in practice: Yes. > > According to various sources, 64-bit Windows uses an LLP64 m

Re: Passing C pointers through guile

2008-07-22 Thread Ken Raeburn
On Jul 9, 2008, at 12:55, Kjetil S. Matheussen wrote: On Wed, 9 Jul 2008, Greg Troxel wrote: Does C guarantee that pointers fit in unsigned long? I don't know. But in practice: Yes. According to various sources, 64-bit Windows uses an LLP64 model -- meaning long is 32 bits, long long and po

Re: Passing C pointers through guile

2008-07-10 Thread Kjetil S. Matheussen
Ludovic Courtès: > Sure, if you just do this now and then, SMOBs aren't a problem. > But that doesn't change the fact that all the functionality SMOB > provides is overkill when the only thing you need is to hold > a pointer. It's not overkill, it's exactly what you need: disjoint SMOB type, `f

Re: Passing C pointers through guile

2008-07-09 Thread Ludovic Courtès
Hi, "Kjetil S. Matheussen" <[EMAIL PROTECTED]> writes: > On Wed, 9 Jul 2008, Greg Troxel wrote: >> Does C guarantee that pointers fit in unsigned long? > > I don't know. But in practice: Yes. That's usually the case but it's not guaranteed, which is why C99 provides `uintptr_t' in . > Sure, if

Re: Passing C pointers through guile

2008-07-09 Thread Greg Troxel
"Kjetil S. Matheussen" <[EMAIL PROTECTED]> writes: > Ludovic Court?s: >> Hi, >> >> "Maciek Godek" <[EMAIL PROTECTED]> writes: >> >>> is there any portable and recommended way for passing C pointers around >>> in guile environment? >>> I think of something like scm_to_ptr (analogous to scm_to_int e

Re: Passing C pointers through guile

2008-07-09 Thread Kjetil S. Matheussen
On Wed, 9 Jul 2008, Greg Troxel wrote: > "Kjetil S. Matheussen" <[EMAIL PROTECTED]> writes: > > > Ludovic Court?s: > >> Hi, > >> > >> "Maciek Godek" <[EMAIL PROTECTED]> writes: > >> > >>> is there any portable and recommended way for passing C pointers around > >>> in guile environment? > >>> I t

Re: Passing C pointers through guile

2008-07-06 Thread Ludovic Courtès
Hi, "Kjetil S. Matheussen" <[EMAIL PROTECTED]> 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 t

Re: Passing C pointers through guile

2008-07-06 Thread Kjetil S. Matheussen
Ludovic Court?s: Hi, "Maciek Godek" <[EMAIL PROTECTED]> writes: is there any portable and recommended way for passing C pointers around in guile environment? I think of something like scm_to_ptr (analogous to scm_to_int etc.). Certainly such a value would be completely useless for the interpr

Re: Passing C pointers through guile

2008-07-05 Thread Ludovic Courtès
Hi, "Maciek Godek" <[EMAIL PROTECTED]> writes: > is there any portable and recommended way for passing C pointers around > in guile environment? > I think of something like scm_to_ptr (analogous to scm_to_int etc.). > Certainly such a value would be completely useless for the interpreter. > One c

Passing C pointers through guile

2008-07-04 Thread Maciek Godek
Hi, is there any portable and recommended way for passing C pointers around in guile environment? I think of something like scm_to_ptr (analogous to scm_to_int etc.). Certainly such a value would be completely useless for the interpreter. One can achieve simillar functionality using the aforementio