GNU Info

Info Node: (g-wrap.info)Guile Types

(g-wrap.info)Guile Types


Next: RScheme Types Prev: Types available by default Up: Types available by default
Enter node , (file) or (file)node

Guile Types
===========

`void'
     nothing, on both the C and Scheme sides.

`char'
     a C `char' and a Scheme character.

`int'
     a C `int' and a Scheme number.

`unsigned-int'
     a C `unsigned int' and a Scheme number.

`unsigned-long'
     a C `unsigned long' and a Scheme number.

`unsigned-long-long'
     a C `unsigned long long' and a Scheme number.

`float'
     a C `float' and a Scheme number.

`double'
     a C `double' and a Scheme number.

`bool'
     a C `int' and a Scheme boolean.

`string-as-symbol'
     a C `char *' and a Scheme symbol.  This type lets you pass symbols
     to C as strings and get them back as symbols.  Note that by
     default it is assumed that C returns freshly malloced strings, so
     they'll be deleted immediately.  You can override this on a per
     function basis with the 'no-cleanup option.  For details see the
     description of `make-complex-c-type' in the section on Note:
     Defining basic Scheme/C types.  WARNING, this type is new and
     subject to change.  Don't rely on it unless you're willing to
     possibly have to rewrite your spec file a bit when things stablize.

`const-string'
     a C `char *' and a Scheme string.  This type lets you pass strings
     from Scheme to C and back, but bear in mind that by default, it
     takes the conservative (but leaky) position of assuming that the C
     code might store for later use any strings passed in as arguments,
     and might pass back as return values strings that are shared
     elsewhere, or for some other reason cannot be disposed of.  This
     means that g-wrap will not, by default free the strings it
     allocates to pass to the underlying C function as parameters, and
     it will not free any string that the C function might return.  You
     can override this behavior on a per function basis with the
     'cleanup option; for details see the description of
     `make-complex-c-type' in the section on Note: Defining basic
     Scheme/C types.  WARNING, the cleanup functionality is new and
     subject to change.  Don't rely on it unless you're willing to
     possibly have to rewrite your spec file a bit when things stablize.

     FIXME: we need a node covering memory allocation.  Combine it with
     the final node discussing garbage collection.  In the end we need
     a more general approach in g-wrap.

`tSCM'
     This is a "transparent" type that allows you to pass a Scheme
     object directly to a C function, or receive one as a return value
     through the standard Guile SCM type.

The Guile side also supports pointer tokens and pointer arrays.  For
more information, see Note: Pointer Tokens and Pointer Arrays.

Pointer Tokens and Pointer Arrays

automatically generated by info2www version 1.2.2.9