C definitions library

September 8, 2024 ยท View on GitHub

Source: include/stdlib/c/cdef.ml

Provides ML-equivalents of commonly used c types, type sizes and macros.

Aliases

AliasAlias of
c_voidvoid
c_charint8
c_shortint16
c_intint32
c_longint32
c_long_longint64
c_strint8*
c_streamFILE*

Macros

MacroDescription
nullNull pointer constant
stdinStandard input stream, used for reading conventional input
stdoutStandard output stream, used for writing conventional output
stderrStandard error stream, used for writing diagnostic output
c_ptr_sizeSize of the void* c primitive
c_char_sizeSize of the char c primitive
c_short_sizeSize of the short c primitive
c_int_sizeSize of the int c primitive
c_long_sizeSize of the long c primitive
c_long_long_sizeSize of the long long c primitive

Warnings

Warning

The aliased ML-eqivalents of the c types behave like their fixed-length counterparts. Traditional c types sizes are implementation-defined. ML attempts to fix this problem once and for all.