diff options
author | Max <msuraev@sysmocom.de> | 2016-03-17 11:51:08 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-03-17 14:07:19 +0100 |
commit | d4793212b5026fed01d132fa7397cc0ff2f543fe (patch) | |
tree | 658148bbf3d49be9e5387516188ad175ea79333b /include/osmocom/core | |
parent | bdccc1b1444a8692697bd8a293cc89c90ef2d832 (diff) |
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.
Diffstat (limited to 'include/osmocom/core')
-rw-r--r-- | include/osmocom/core/bitvec.h | 3 |
1 files changed, 3 insertions, 0 deletions
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); /*! @} */ |