Next: , Previous: , Up: G-Wrap's High-level API   [Contents][Index]


3.2.5 C Types Provided in the Standard Wrapset

Beside the generic wrapped C pointer type (WCT) and wrapped enumerate type, G-Wrap comes with a standard wrapset that includes a number of commonly used wrappers for C types (see Wrapsets). This wrapset can be made available by using the (g-wrap ws standard) module.

When creating a wrapset that depends on the wrapped types defined in the standard wrapset, make sure you specify standard among the dependencies of you wrapset class as shown in See Wrapsets.

The table below summarizes the wrapped provided by the standard wrapset:

G-Wrap NameC NameScheme Type
voidvoidunspecified
boolintboolean
charcharcharacter
floatfloatinexact number
doubledoubleinexact number
size_tsize_texact number
intintexact number
unsigned-intunsigned intexact number
mcharschar *string
scmSCMany Scheme type

Similarly, other integer types not listed here are available (e.g., short, unsigned-long-long, etc.), as well as variants with a specified ranged (e.g., int8, unsigned-int32, etc.).

The type mchars denotes strings, i.e., null-terminated character arrays on the C side. Note that mchars alone does not specify any memory ownership semantics. Therefore, when wrapping C functions that manipulate strings, you may in turn specify the memory management semantics that are valid for this functions and the strings it operates on. This is done by adding appropriate type qualifiers to the string argument of the wrapped function, such as caller-owned (see Wrapping a C Function).


Next: , Previous: , Up: G-Wrap's High-level API   [Contents][Index]