summaryrefslogtreecommitdiffstats
path: root/include/osmocore
diff options
context:
space:
mode:
authorAndreas.Eversberg <jolly@eversberg.eu>2010-05-09 09:36:54 +0000
committerHarald Welte <laforge@gnumonks.org>2010-05-19 18:14:01 +0200
commit0ebd688746f2e8e6954b057460f53ae32b4f6e42 (patch)
treeae15067e2bf95114b6b62e3c1f71054707a4ee35 /include/osmocore
parent9a3dec0c01c67fd6ee10e499fc2abb139d077a2c (diff)
Added some "get"-functions to bitvec of libosmocore.
- Getting Low or High value from current postion - Getting unsigned interger from current postion
Diffstat (limited to 'include/osmocore')
-rw-r--r--include/osmocore/bitvec.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/osmocore/bitvec.h b/include/osmocore/bitvec.h
index 7a26bce4..42977fb2 100644
--- a/include/osmocore/bitvec.h
+++ b/include/osmocore/bitvec.h
@@ -42,6 +42,10 @@ struct bitvec {
/* check if the bit is 0 or 1 for a given position inside a bitvec */
enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr);
+/* check if the bit is L or H for a given position inside a bitvec */
+enum bit_value bitvec_get_bit_pos_high(const struct bitvec *bv,
+ unsigned int bitnr);
+
/* get the Nth set bit inside the bit vector */
unsigned int bitvec_get_nth_set_bit(const struct bitvec *bv, unsigned int n);
@@ -52,12 +56,18 @@ int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnum,
/* Set the next bit in the vector */
int bitvec_set_bit(struct bitvec *bv, enum bit_value bit);
+/* get the next bit (low/high) inside a bitvec */
+int bitvec_get_bit_high(struct bitvec *bv);
+
/* Set multiple bits at the current position */
int bitvec_set_bits(struct bitvec *bv, enum bit_value *bits, int count);
/* Add an unsigned integer (of length count bits) to current position */
int bitvec_set_uint(struct bitvec *bv, unsigned int in, int count);
+/* get multiple bits (based on numeric value) from current pos */
+int bitvec_get_uint(struct bitvec *bv, int num_bits);
+
/* Pad the bit vector up to a certain bit position */
int bitvec_spare_padding(struct bitvec *bv, unsigned int up_to_bit);