Bit vector utilities using GArray.
More...
#include <gfsmIO.h>
#include <gfsmBitVector.hi>
Go to the source code of this file.
Typedefs |
typedef GArray | gfsmBitVector |
| bit vector type: really just a wrapper for GArray
|
Detailed Description
Typedef Documentation
Function Documentation
static guint gfsm_bitvector_bits2bytes_ |
( |
guint |
nbits | ) |
|
|
inlinestatic |
Low-level utility to convert bit-indices to byte-indices (starting from 0)
static guint gfsm_bitvector_bytes2bits_ |
( |
guint |
nbytes | ) |
|
|
inlinestatic |
Low-level utility to convert byte-sizes to bit-sizes
Create a new bit vector of length 0
Create a new bit vector of length 0 with reserved space for at least nbits bits
static void gfsm_bitvector_resize |
( |
gfsmBitVector * |
bv, |
|
|
guint |
nbits |
|
) |
| |
|
inlinestatic |
Resize a bit vector bv to at least nbits bits (rounded to next byte boundary)
Get current size (in bits) of a bit vector bv
Set all bits to zero.
- Returns
- altered bv
Set all bits to one.
- Returns
- altered bv
static gboolean gfsm_bitvector_get |
( |
gfsmBitVector * |
bv, |
|
|
guint |
i |
|
) |
| |
|
inlinestatic |
Get the value (0 or 1) of the bit at index i in vector bv.
static void gfsm_bitvector_set |
( |
gfsmBitVector * |
bv, |
|
|
guint |
i, |
|
|
gboolean |
v |
|
) |
| |
|
inlinestatic |
Set the value (0 or 1) of the bit at index i to boolean value v in vector bv. Formerly implemented as a macro which evaluates its arguments multiple times.
Write the contents of a gfsmBitVector to a (binary) gfsmIOHandle.
- Parameters
-
bv | bit-vector to write |
ioh | handle to which data is to be written |
errp | if an error occurs, *errp will hold an error message |
- Returns
- true on success
Read the contents of a gfsmBitVector from a (binary) gfsmIOHandle.
- Parameters
-
bv | bit-vector into which data is to be read |
ioh | handle from which data is to be read |
errp | if an error occurs, *errp will hold an error message |
- Returns
- true on success