Tor
0.4.7.0-alpha-dev
|
Implements a variable-sized (but non-resizeable) bit-array. More...
Go to the source code of this file.
Macros | |
#define | BITARRAY_MASK ((1u<<BITARRAY_SHIFT)-1) |
#define | bitarray_free(ba) FREE_AND_NULL(bitarray_t, bitarray_free_, (ba)) |
Typedefs | |
typedef unsigned int | bitarray_t |
Functions | |
static bitarray_t * | bitarray_init_zero (unsigned int n_bits) |
static bitarray_t * | bitarray_expand (bitarray_t *ba, unsigned int n_bits_old, unsigned int n_bits_new) |
static void | bitarray_free_ (bitarray_t *ba) |
static void | bitarray_set (bitarray_t *b, int bit) |
static void | bitarray_clear (bitarray_t *b, int bit) |
static unsigned int | bitarray_is_set (bitarray_t *b, int bit) |
Implements a variable-sized (but non-resizeable) bit-array.
Definition in file bitarray.h.
typedef unsigned int bitarray_t |
A random-access array of one-bit-wide elements.
Definition at line 30 of file bitarray.h.
|
inlinestatic |
Set the bitth bit in b to 0.
Definition at line 74 of file bitarray.h.
|
inlinestatic |
Expand ba from holding n_bits_old to n_bits_new, clearing all new bits. Returns a possibly changed pointer to the bitarray.
Definition at line 43 of file bitarray.h.
|
inlinestatic |
Free the bit array ba.
Definition at line 60 of file bitarray.h.
|
inlinestatic |
Create a new bit array that can hold n_bits bits.
Definition at line 33 of file bitarray.h.
Referenced by get_message_bitarray(), and rep_hist_remove_predicted_ports().
|
inlinestatic |
Return true iff bitth bit in b is nonzero. NOTE: does not necessarily return 1 on true.
Definition at line 81 of file bitarray.h.
Referenced by bloomfilt_probably_contains(), lint_message_graph(), rep_hist_remove_predicted_ports(), and routerset_contains2().
|
inlinestatic |
Set the bitth bit in b to 1.
Definition at line 68 of file bitarray.h.
Referenced by bloomfilt_add(), get_message_bitarray(), and rep_hist_remove_predicted_ports().