All data types declared using the js-ctypes API are represented by CType
objects. These objects have assorted methods and properties that let you create objects of these types, find out information about them, and so forth. The specific properties and methods on each object vary depending on the data type represented.
There are several kinds of types:
Int64
and UInt64
types provide access to 64-bit integer values, which JavaScript doesn't currently support.CType array([n]) |
String toSource() |
String toString() |
These properties are available on all CType
objects.
Property | Type | Description |
name |
String |
The type's name. Read only. For primitive types, this is just the name of the corresponding C type. For structure and opaque pointer types, this is simply the string that was passed to the constructor. For other function, pointer, and array types, this should be a valid C type expression. |
ptr |
CType | Returns a CType representing the data type "pointer to this type". This is the result of calling ctypes.PointerType(the_type) . Read only. |
size |
Number |
The size of the type, in bytes. This is the same value as the C Note:
ctypes.void_t.size is undefined. |
Returns a new CType representing an array of elements of the type on which it was called.
CType array( [n] };
A CType
representing the data type "array of this type". This is the same as calling ctypes.ArrayType(the_type[, n])
.
Returns a JavaScript expression that evaluates to a CType
describing the same C type as this object.
String toSource();
None.
A JavaScript expression that evaluates to a CType
describing the same C type as this object.
ctypes.uint32_t.toSource()
returns "ctypes.uint32_t".
Returns a string identifying the type. The format of this string is "type " + name
.
String toString();
None.
A string identifying the data type.