On this page:
make-ctype
ctype?
ctype-sizeof
ctype-alignof
compiler-sizeof
Version: 4.1

3.1 Type Constructors

(make-ctype type scheme-to-c c-to-scheme)  ctype?

  type : ctype?

  scheme-to-c : (or/c false/c (any/c . -> . any))

  c-to-scheme : (or/c false/c (any/c . -> . any))

Creates a new C type value, with the given conversions functions. The conversion functions can be #f meaning that there is no conversion for the corresponding direction. If both functions are #f, type is returned.

(ctype? v)  boolean?

  v : any/c

Returns #t if v is a C type, #f otherwise.

(ctype-sizeof type)  exact-nonnegative-integer?

  type : ctype?

(ctype-alignof ctype)  exact-nonnegative-integer?

  ctype : ctype?

Returns the size or alignment of a given type for the current platform.

(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 correspond 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.