aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/bitvec.h
AgeCommit message (Collapse)AuthorFilesLines
2016-02-05Expand bitvec interfaceMax1-0/+9
Add bit filling, shifting and other functions necessary for bit compression implementation. Add corresponding tests.
2016-01-30bitvec: Test and fix regression for C++->C conversionHolger Hans Peter Freyther1-2/+2
bitvec_read_field/bitvec_write_field in the PCU used a C++ reference and when porting to C it was decided to pass the parameter by value and this lost the "back propagation" of the new index. Change the parameter to be an in/out parameter and this way do not have a silent semantic break in the osmo-pcu (where we copy the reference in csn.1 by value) and have a true compile failure. Add Max's simple test for bitvec_unhex function leaving the checking of bitvec_read_field and the side effect in the datastructure about the number of bits still open.
2016-01-26Add bitvec-related functions from Osmo-PCUMax1-0/+9
Allocation, pack/unpack, field access and helper routines used extensively by Osmo-PCU. Whenever memory allocation happens, alocator context is passed explicitly by caller.
2016-01-22bitvec: Fix interface to consistently use unsigned intMax1-5/+5
Use unsigned int for the length throughout the interface. We will never have a a negative length. Sponsored-by: On-Waves ehf
2016-01-15bitvec: Add get/set byte sequencesJacob Erlbeck1-0/+10
The new functions bitvec_get_bytes and bitvec_set_bytes copy byte sequences from bitvecs to uint8_t arrays and vice versa. While the bytes in the bitvecs do not need to be aligned, the uint8_t arrays always are. In case the bytes in the bitvec are aligned, the implementation uses memcpy. Note that the implementation like the other existing functions assume MSB first encoding. [hfreyther: Squash the comment fix into this commit as well] Sponsored-by: On-Waves ehf
2014-12-28bitvec: Fix typo in the csn1 encoding codeHolger Hans Peter Freyther1-1/+1
We can curse about CSN.1 and 3GPP but I think we want to call it cursor here.
2014-06-16include: Switch to #pragma once patternSylvain Munaut1-4/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-04-18doc: Fix the Doxygen section endingsSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-08-17some more doxygen work (include the notion of modules)Harald Welte1-29/+21
2011-05-29bitvec: add missing stdint.hHarald Welte1-0/+1
2011-03-28bitvec: add bitvec_find_first_bit_pos() from gsm/rxlev_stat.cPablo Neira Ayuso1-0/+2
This patch adds bitvec_find_bit_pos() to bitvec.c where it really belongs to. Before this patch used to be part of gsm/rxlev_stat.c
2011-03-23include: reorganize headers file to include/osmocom/[gsm|core]0.2.0Pablo Neira Ayuso1-0/+75
This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>