This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Accessing smob data
Dirk Herrman writes:
> (2) Is SCM_SMOB_DATA the recommended way to extract a struct pointer
> from a smob SCM value?
Actually, SCM_SMOB_DATA is the recommended way to extract arbitrary data
from a smob SCM value, not only to extract struct pointers. Thus, it was
decided that SCM_SMOB_DATA should return a value of type scm_bits_t, which
is guile's type for any kind of raw data that can be stored in scheme
cells. Two weeks ago (about), SCM_SMOB_DATA returned a value of type SCM,
which at that time was of type void*.
A first attempt at explaining the relationship between scm_bits_t and SCM
can be found in the file api.txt in the doc directory of the current cvs.
Cool. So, just to confirm my understanding, SCM_SMOB_DATA returns
(notionally) a scm_bits_t, and it's correct to cast a scm_bits_t to a
pointer.
Many thanks!
Neil