The type to point to
A pointer type with create(), fromBuffer(), etc.
const IntPtr = POINTER(c_int32);
const buf = Buffer.alloc(4);
buf.writeInt32LE(42, 0);
const p = IntPtr.fromBuffer(buf);
console.log(p.contents.value); // 42
console.log(p[0]); // 42
class Column extends Structure {
static _fields_ = [["pValues", POINTER(ValueStruct)], ["count", c_uint32]];
}
const pValues = col.pValues; // a POINTER(ValueStruct) over the field
for (let i = 0; i < col.count; i++) {
console.log(pValues[i].field); // struct view at offset i
}
// A c_void_p field holds an address: POINTER(ValueStruct).fromAddress(col.pRaw)
Lazy base type, for self-referential structs: POINTER(() => Node).
Python 3.14 incomplete pointer type POINTER('Name') (deprecated, as in
CPython: a DeprecationWarning, code NODE_CTYPES_POINTER_STRING, is
emitted once per process): the same type per name, usable as a field or
parameter type and with from_buffer() / from_address(); creating an
instance throws TypeError Cannot create instance: has no _type_ until
set_type(T) completes it.
Python ctypes: POINTER(None) returns c_void_p.
Create a pointer type for a given base type.
Python equivalent:
ctypes.POINTER