3.1 Type Constructors
(make-ctype type scheme-to-c c-to-scheme) → ctype? type : ctype? scheme-to-c : (or/c #f (any/c . -> . any)) c-to-scheme : (or/c #f (any/c . -> . any))
Creates a new C type value whose representation for foreign
code is the same as type’s. The given conversions functions
convert to and from the Racket representation of type. Either
conversion function can be #f, meaning that the conversion
for the corresponding direction is the identity function. If both
functions are #f, type is returned.
(ctype-sizeof type) → exact-nonnegative-integer? type : ctype? (ctype-alignof type) → exact-nonnegative-integer? type : ctype?
Returns the size or alignment of a given type for the current
platform.
(ctype->layout type) → (flat-rec-contract rep symbol? (listof rep)) type : ctype?
Returns a value to describe the eventual C representation of the
type. It can be any of the following symbols:
'int8 'uint8 'int16 'uint16 'int32 'uint32 'int64 'uint64 'float 'double 'bool 'void 'pointer 'fpointer 'bytes 'string/ucs-4 'string/utf-16
The result can also be a list, which describes a C struct whose element representations are provided in order within the list. Finally, the result can be a vector of size 2 containing an element representation followed by an exact-integer count.
(compiler-sizeof sym) → exact-nonnegative-integer? sym : symbol?
Possible values for symbol are 'int, 'char,
'short, 'long, '*, 'void,
'float, 'double. The result is the size of the
corresponding type according to the C sizeof operator for the
current platform. The compiler-sizeof operation should be
used to gather information about the current platform, such as
defining alias type like _int to a known type like
_int32.