FFI: PLT Scheme Foreign Interface

1`` | Overview
2`` | Loading Foreign Libraries
3`` | C Types
4`` | Pointer Functions
5`` | Miscellaneous Support
6`` | Derived Utilities
7`` | Unexported Primitive Functions
8`` | Macros for Unsafety
| Index

On this page:

_ pointer
_ scheme
_ fpointer

Version: 4.0.2
contents index
← prev up next →

#### 3.5`` Pointer Types

_pointer : ctype?

Corresponds to Scheme “C pointer” objects. These pointers can have an arbitrary Scheme object attached as a type tag. The tag is ignored by built-in functionality; it is intended to be used by interfaces. See Tagged C Pointer Types for creating pointer types that use these tags for safety.

_scheme : ctype?

This type can be used with any Scheme object; it corresponds to the Scheme_Object* type of PLT Scheme’s C API (see Inside: PLT Scheme C API). It is useful only for libraries that are aware of PLT Scheme’s C API.

_fpointer : ctype?

Similar to _pointer, except that it should be used with function pointers. Using these pointers avoids one dereferencing, which is the proper way of dealing with function pointers. This type should be used only in rare situations where you need to pass a foreign function pointer to a foreign function; using a _cprocedure type is possible for such situations, but inefficient, as every call will go through Scheme unnecessarily. Otherwise, _cprocedure should be used (it is based on _fpointer).

contents index
← prev up next →