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

    Function bitfield

    • Define a bit field for use in struct _fields_.

      Parameters

      • baseType: SimpleCDataConstructor

        The underlying integer type (e.g. c_uint32) or c_bool; other types raise TypeError, as in Python

      • bits: number

        Number of bits

      Returns BitFieldDef

      class Flags extends Structure {
      static _fields_ = [
      ["enabled", bitfield(c_uint32, 1)],
      ["mode", bitfield(c_uint32, 3)],
      ];
      }