36 #ifndef SWITCH_BITPACK_H 37 #define SWITCH_BITPACK_H 41 static char bb[80] =
"";
47 for (i = 7; i >= 0; i--) {
48 x[j++] = (byte & (1 << i)) ?
'1' :
'0';
83 memset(pack, 0,
sizeof(*pack));
88 pack->cur = pack->buf;
104 this_byte <<= pack->
under;
178 mask = SWITCH_BITS_PER_BYTE - unpack->
under;
182 *unpack->
cur |= under_in;
184 mask = unpack->
under;
186 *unpack->
cur <<= mask;
187 *unpack->
cur |= under_in;
#define SWITCH_END_EXTERN_C
static const uint8_t SWITCH_REVERSE_BITPACKED_MASKS[]
switch_bitpack_mode_t mode
static const uint8_t SWITCH_BITPACKED_MASKS[]
#define SWITCH_BITS_PER_BYTE
switch_byte_t switch_byte_t * buf
DoxyDefine(void switch_bitpack_init(switch_bitpack_t *pack, int32_t bitlen, switch_byte_t *buf, uint32_t buflen, switch_bitpack_mode_t mode)) static inline int8_t switch_bitpack_init(switch_bitpack_t *pack
Initialize a bitpack object.
switch_byte_t switch_byte_t uint32_t switch_bitpack_mode_t mode
static void pack_check_over(switch_bitpack_t *pack)
switch_byte_t switch_byte_t uint32_t buflen
#define SWITCH_BEGIN_EXTERN_C