On this page
system/ctypes
Source EditSome type definitions for compatibility between different backends and platforms.
Types
-
BiggestFloat = float64 -
is an alias for the biggest floating point type the Nim compiler supports. Currently this is
float64, but it is platform-dependent in general. Source Edit -
BiggestInt = int64 -
is an alias for the biggest signed integer type the Nim compiler supports. Currently this is
int64, but it is platform-dependent in general. Source Edit -
BiggestUInt = uint64 -
is an alias for the biggest unsigned integer type the Nim compiler supports. Currently this is
uint64, but it is platform-dependent in general. Source Edit -
ByteAddress {....deprecated: "use `uint`".} = int - is the signed integer type that should be used for converting pointers to integer addresses for readability. Source Edit
-
cdouble {.importc: "double", nodecl.} = float64 -
This is the same as the type
doublein C. Source Edit -
clongdouble {.importc: "long double", nodecl.} = BiggestFloat -
This is the same as the type
long doublein C. This C type is not supported by Nim's code generator. Source Edit -
clonglong {.importc: "long long", nodecl.} = int64 -
This is the same as the type
long longin C. Source Edit -
cschar {.importc: "signed char", nodecl.} = int8 -
This is the same as the type
signed charin C. Source Edit -
cstringArray {.importc: "char**", nodecl.} = ptr UncheckedArray[cstring] -
This is binary compatible to the type
char**in C. The array's high value is large enough to disable bounds checking in practice. Use cstringArrayToSeq proc to convert it into aseq[string]. Source Edit -
cuchar {.importc: "unsigned char", nodecl, ...deprecated: "use `char` or `uint8` instead".} = char -
Deprecated: Use
uint8instead. Source Edit -
cuint {.importc: "unsigned int", nodecl.} = uint32 -
This is the same as the type
unsigned intin C. Source Edit -
culong {.importc: "unsigned long", nodecl.} = uint32 -
This is the same as the type
unsigned longin C. Source Edit -
culonglong {.importc: "unsigned long long", nodecl.} = uint64 -
This is the same as the type
unsigned long longin C. Source Edit
© 2006–2024 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/ctypes.html