diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-12-14 22:04:31 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-12-14 22:04:31 +0100 |
commit | d57f163bd4040cddf59cb145affba2c2d2570c42 (patch) | |
tree | 2077e28f687804a223e749b4c4bb5e8f31f65856 /openbsc/include | |
parent | da760d3d19bc6da3ef676a2fbaa65fb841cd5af5 (diff) |
bitvec updates and code simplification
* introduce a new bitvec_get_bit_pos() function to determine the bit value
at a given position inside a bit vector
* make sure bitvec_{get,set}_bit_pos() share code as possible
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/bitvec.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bitvec.h b/openbsc/include/openbsc/bitvec.h index 80ed4ad0a..a365e2a2d 100644 --- a/openbsc/include/openbsc/bitvec.h +++ b/openbsc/include/openbsc/bitvec.h @@ -39,6 +39,9 @@ struct bitvec { u_int8_t *data; /* pointer to data array */ }; +/* check if the bit is 0 or 1 for a given position inside a bitvec */ +enum bit_value bitvec_get_bit_pos(struct bitvec *bv, unsigned int bitnr); + /* Set a bit at given position */ int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnum, enum bit_value bit); |