node-ctypes - v2.17.1
    Preparing search index...

    Class CField

    Class-level field descriptor exposed on Structure / Union subclasses (S.field.offset, S.field.size, bitfield info), mirroring CPython's ctypes.CField.

    A class declared with class S extends Structure { static _fields_ = ... } has these descriptors as statics (S.x.offset), but TypeScript cannot derive static members from _fields_: use CFieldsOf ((S as typeof S & CFieldsOf<"x" | "y">).x.offset). Classes returned by defineStruct / defineUnion expose them typed.

    S.x instanceof CField holds. The constructor is internal API, as in CPython: it takes the keyword arguments as one object and requires _internal_use: true; a byte_size other than sizeof(type) or a bit field that overflows its type throws RangeError (Python ValueError).

    Index
    • Parameters

      • kwargs: {
            name: string;
            type: AnyType | StructureClass | PointerTypeDef<any> | ArrayTypeDef<any>;
            byte_size: number;
            byte_offset: number;
            index: number;
            _internal_use: boolean;
            bit_size?: number;
            bit_offset?: number;
        }

      Returns CField

    name: string
    type: any
    offset: number
    size: number
    byte_offset: number
    byte_size: number
    is_bitfield: boolean
    bit_offset: number
    bit_size: number
    is_anonymous: boolean