This package contains various "bit juggling" helpers and functionality:
isBitSet
- Check if a bit is setgetBit
- Get the value of a bitgetBits
- Get a range of bitssetBit
- Set a specific bitsetBits
- Set a range of bitsBitfield
- Used along withextern union
to represent arbitrary bit fieldsBit
- Used along withextern union
to represent bit fieldsBoolean
- Used along withextern union
to represent boolean bit fields
Add the dependency to build.zig.zon
:
zig fetch --save git+https://github.com/leecannon/zig-bitjuggle
Then add the following to build.zig
:
const bitjuggle = b.dependency("bitjuggle", .{});
exe.root_module.addImport("bitjuggle", bitjuggle.module("bitjuggle"));