From d4793212b5026fed01d132fa7397cc0ff2f543fe Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Mar 2016 11:51:08 +0100 Subject: Add function to add bits from array to bitvec Add function which adds specified number of bits from each element of array to the bit vector prefixing each addition with one and finishing entire sequence with adding 0. This is very common patter for various repetitive data structures described with CSN.1 in 3GPP standards. Corresponding test vectors and doxygen headers are added too. --- include/osmocom/core/bitvec.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 5314cf2a..c3c11531 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -91,5 +91,8 @@ 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); +unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, + unsigned int array_len, bool dry_run, + unsigned int num_bits); /*! @} */ -- cgit v1.2.3