7 Unexported Primitive Functions
Parts of the scheme/foreign library are implemented by
the MzScheme built-in '#%foreign module. The
'#%foreign module is not intended for direct use, but
it exports the following procedures. If you find any of these useful,
please let us know.
Pulls out a foreign object from a library, returning a Scheme value
that can be used as a pointer. If a name is provided instead of a
foreign-library value, ffi-lib
is used to create a library
A predicate for objects returned by ffi-obj
, and accessor
functions that return its corresponding library object and name.
These values can also be used as C pointer objects.
Accessors for the components of a C type object, made by
. The ctype-basetype
selector returns a
symbol for primitive types that names the type, a list of ctypes for
cstructs, and another ctype for user-defined ctypes.
The primitive mechanism that creates Scheme “callout” values. The
(any pointer value, including ffi-obj
values) is wrapped in a Scheme-callable primitive function that uses
the types to specify how values are marshaled.
The optional abi argument determines the foreign ABI that is
used. #f or 'default will use a platform-dependent
default; other possible values are 'stdcall and
'sysv (the latter corresponds to “cdecl”). This is
especially important on Windows, where most system functions are
'stdcall, which is not the default.
The symmetric counterpart of ffi-call
. It receives a Scheme
procedure and creates a callback object, which can also be used as a
pointer. This object can be used as a C-callable function, which
using the types to specify how values are
A predicate for callback values that are created by ffi-callback