fennec
Loading...
Searching...
No Matches
Bit Manipulation
#include <fennec/lang/bits.h>
Bit Manipulation

This header contains definitions for manipulating the bits of a provided object or pointer.

Syntax Description

ToT bit_cast(const FromT& x)

Perform a bitcast of FromT to ToT

Template Parameters
ToTType to cast to
FromTType of the value
Parameters
fromValue to bit cast
Returns
A value containing a bitwise copy of the input

void* bit_and(void* arr, const void* mask, size_t n)

Perform a bitcast of FromT to ToT

Parameters
arrthe array of bytes to modify
maskthe mask to and against arr
nthe number of bytes
Returns
the pointer \(arr\)

void* bit_and_s(void* arr, size_t n0, const void* mask, size_t n1)

Safe version of fennec::bit_and

Parameters
arrthe array of bytes to modify
n0the size of arr in bytes
maskthe mask to and against arr
n1the size of mask in bytes
Returns
the pointer arr

void* bit_or(void* arr, const void* mask, size_t n)

Perform a bit-wise or over an array of bytes

Parameters
arrthe array of bytes to modify
maskthe mask to or against arr
nthe number of bytes
Returns
the pointer arr

void* bit_or_s(void* arr, size_t n0, const void* mask, size_t n1)

Safe version of fennec::bit_or

Parameters
arrthe array of bytes to modify
n0the size of arr in bytes
maskthe mask to or against arr
n1the size of mask in bytes
Returns
the pointer arr

void* bit_xor(void* arr, const void* mask, size_t n)

Perform a bit-wise or over an array of bytes

Parameters
arrthe array of bytes to modify
maskthe mask to or against arr
nthe number of bytes
Returns
the pointer arr

void* bit_xor_s(void* arr, size_t n0, const void* mask, size_t n1)

Safe version of fennec::bit_xor

Parameters
arrthe array of bytes to modify
n0the size of arr in bytes
maskthe mask to or against arr
n1the size of mask in bytes
Returns
the pointer arr