7.10 The C structure
datatype c_type =
VOID_TYPE | CHAR_TYPE | ...
c_type
provides a representation of C type information accessable as an ML value. These values are used to provide information on how to interpret the value parts of c_object
objects used to represent foreign data.
VOID_TYPE
void
. Its size is zero bytes.
CHAR_TYPE
char
. Its size is 1 byte. It may be associated with either signed or unsigned chars by the particular C compiler used.
UNSIGNED_CHAR_TYPE
unsigned char
.
SIGNED_CHAR_TYPE
signed char
.
SHORT_TYPE
short int
.
INT_TYPE
int
.
LONG_TYPE
long int
.
UNSIGNED_SHORT_TYPE
unsigned short int
.
UNSIGNED_INT_TYPE
unsigned int
.
UNSIGNED_LONG_TYPE
unsigned long int
.
FLOAT_TYPE
float
.
DOUBLE_TYPE
double
.
LONG_DOUBLE_TYPE
long double
.
STRING_TYPE of { length : int }
char*
where each string has an explicit amount of storage allocated for it. This length should include room for the null byte sentinel.
TYPENAME of { name : name, defn : c_type, size : int }
typedef
) within a C type.
POINTER_TYPE of { ctype : c_type, mode : pointer_kind ref }
STRUCT_TYPE of { tag : tag option, fields : c_field list, size : int }
UNION_TYPE of { tag : tag option, variants : c_variant list ref, size : int, current : c_variant }
ARRAY_TYPE of { length : int, ctype : c_type }
ENUM_TYPE of { tag : tag option, elems : enum_value list, card : int }
Generated with Harlequin WebMaker