PointerType
represents C pointer.
Returns a new CType
object describing a new pointer data type.
CType PointerType( type );
type
CType
object to declare the new type as a pointer to that type.A CType
object describing the newly created data type.
TypeError
CType
.Creating a type "pointer to 32-bit integer" looks like this:
var intPtrType = new ctypes.PointerType(ctypes.int32_t);
Property | Type | Description |
targetType |
CType |
The type of object the pointer points to. Read only. |
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. |
CType array([n]) |
String toSource() |
String toString() |
CData pointertype();
A CData
representing the newly allocated pointer.
Property | Type | Description |
contents |
CData | Reading this property returns a CData object referring to the pointed-to contents of the object. Writing to this value writes the C conversion of the data into the pointed-to memory. If converting the data fails, a TypeError exception is thrown. |
Property | Type | Description |
constructor |
CType |
The data type of the Note: This is never
ctypes.void_t or an array type with an unspecified length. |
value |
object | The JavaScript equivalent of the CData object's value. This will throw a TypeError exception if the value can't be converted. |
bool isNull() |
|
String toSource() |
String toString() |
Determines whether or not the pointer's value is null
.
bool isNull();
None.
true
if the pointer's value is null, otherwise false
.