Parts of the ffi/unsafe library are implemented by the Racket built-in '#%foreign module. The '#%foreign module is not intended for direct use, but it exports the following procedures (among others).
Pulls out a foreign object from a library, returning a value that can be used as a C pointer. If lib is a path or string, then ffi-lib is used to create a library object.
x : any/c (ffi-obj-lib obj) → ffi-lib? obj : ffi-obj? (ffi-obj-name obj) → string? obj : ffi-obj?
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.
type : ctype? (ctype-scheme->c type) → procedure? type : ctype? (ctype-c->scheme type) → procedure? type : ctype?
Accessors for the components of a C type object, made by make-ctype. 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 Racket “callout” values for _cprocedure. The given ptr is wrapped in a Racket-callable primitive function that uses the types to specify how values are marshaled.
The symmetric counterpart of ffi-call. It receives a Racket procedure and creates a callback object, which can also be used as a C pointer.
A predicate for callback values that are created by ffi-callback.