aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-02-05 13:55:37 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-02-05 14:05:15 +0100
commit36a0bcf43902b68fca5c8367c5ed0bec10f6a8cc (patch)
treeaba7dcb83e4eb6324a247a210552a4856815f986 /include/osmocom
parent5710804a42b72504c012b75222b663cdf46de4f5 (diff)
Expand bitvec interface
Add bit filling, shifting and other functions necessary for bit compression implementation. Add corresponding tests.
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/core/bitvec.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h
index a7e6fc4d..5314cf2a 100644
--- a/include/osmocom/core/bitvec.h
+++ b/include/osmocom/core/bitvec.h
@@ -4,6 +4,7 @@
/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
* (C) 2012 Ivan Klyuchnikov
+ * (C) 2015 Sysmocom s.f.m.c. GmbH
*
* All Rights Reserved
*
@@ -41,6 +42,7 @@
#include <stdint.h>
#include <talloc.h>
+#include <stdbool.h>
/*! \brief A single GSM bit
*
@@ -82,5 +84,12 @@ unsigned int bitvec_pack(const struct bitvec *bv, uint8_t *buffer);
unsigned int bitvec_unpack(struct bitvec *bv, const uint8_t *buffer);
uint64_t bitvec_read_field(struct bitvec *bv, unsigned int *read_index, unsigned int len);
int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len);
+int bitvec_fill(struct bitvec *bv, unsigned int num_bits, enum bit_value fill);
+char bit_value_to_char(enum bit_value v);
+void bitvec_to_string_r(const struct bitvec *bv, char *str);
+void bitvec_zero(struct bitvec *bv);
+unsigned bitvec_rl(const struct bitvec *bv, bool b);
+void bitvec_shiftl(struct bitvec *bv, unsigned int n);
+int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits);
/*! @} */