LAR Library: bits.h File Reference

LAR Library

bits.h File Reference

Bit manipulation. More...

#include <larlib/base.h>

Go to the source code of this file.

Typedefs

typedef uint8_t bitsBuffer_t
 A bit-buffer is a sequence of 8-bits unsigned integers. More...
 

Enumerations

enum  bitsBltOp_t {
  BITS_BLT_COPY, BITS_BLT_NOT, BITS_BLT_AND, BITS_BLT_OR,
  BITS_BLT_XOR, BITS_BLT_NOT_AND
}
 Possible bit operations for bitsBlt(). More...
 

Functions

int bitsSet (bitsBuffer_t *b, int index, int value)
 Set or clear a bit in b. More...
 
int bitsSetRange (bitsBuffer_t *b, int offset, int count, int value)
 Set a range of bits on a buffer. More...
 
int bitsGet (const bitsBuffer_t *b, int index)
 Return the value of a bit in b. More...
 
int64_t bitsExtractInt (const bitsBuffer_t *b, int offset, int count)
 Extract a sub-sequence of a bit buffer as an integer. More...
 
int bitsAppend (const bitsBuffer_t *src, int srcOffset, int srcCount, bitsBuffer_t *dst, int dstCount)
 Append one bit buffer to another. More...
 
int bitsAppendInt (uint64_t bits, int nbits, bitsBuffer_t *dst, int dstCount)
 Append the bits extracted from an integer to a bit buffer. More...
 
int bitsRotateLeft (bitsBuffer_t *b, int index, int nbits, int nrotate)
 Rotate b left by nrotate bits. More...
 
int bitsRotateRight (bitsBuffer_t *b, int index, int nbits, int nrotate)
 Rotate b right by nrotate bits. More...
 
int bitsShiftLeft (bitsBuffer_t *b, int index, int nbits, int nshift)
 Shift b left by nshift bits. More...
 
int bitsShiftRight (bitsBuffer_t *b, int index, int nbits, int nshift)
 Shift b right by nshift bits. More...
 
int bitsCopy (const bitsBuffer_t *src, int srcOffset, int srcCount, bitsBuffer_t *dst, int dstOffset)
 Copy a sequence of bits from one buffer to another. More...
 
int bitsBlt (const bitsBuffer_t *src, int srcOffset, int srcCount, enum bitsBltOp_t op, bitsBuffer_t *dst, int dstOffset)
 Combine two bit buffers using a bit operation. More...
 

Detailed Description

Bit manipulation.

Generated on Mon Mar 27 2017 15:42:52 for LAR Library by   doxygen 1.8.9.1