|
libschc
|
Go to the source code of this file.
Macros | |
| #define | BYTES_TO_BITS(x) (x * 8) |
| #define | BITS_TO_BYTES(x) (((x) == 0) ? 0 : (((x) - 1) / 8 + 1)) |
Functions | |
| void | set_bits (uint8_t A[], uint32_t pos, uint32_t len) |
| sets bits at a certain position in a bit array big endian More... | |
| uint32_t | get_bits (const uint8_t A[], uint32_t pos, uint8_t len) |
| get bits at a certain position in a bit array More... | |
| void | clear_bits (uint8_t A[], uint32_t pos, uint32_t len) |
| clear bits at a certain position in a bit array big endian More... | |
| void | copy_bits (uint8_t DST[], uint32_t dst_pos, const uint8_t SRC[], uint32_t src_pos, uint32_t len) |
| copy bits to a certain position in a bit array from another array big endian More... | |
| uint8_t | compare_bits (const uint8_t SRC1[], const uint8_t SRC2[], uint32_t len) |
| compare two bit arrays More... | |
| uint8_t | compare_bits_aligned (const uint8_t SRC1[], uint16_t pos1, const uint8_t SRC2[], uint16_t pos2, uint32_t len) |
| compare two bit arrays with starting point More... | |
| uint8_t | compare_bits_BIG_END (uint8_t SRC1[], uint8_t SRC2[], uint32_t len) |
| void | shift_bits_left (uint8_t SRC[], uint16_t len, uint32_t shift) |
| shift a number of bits to the left More... | |
| void | shift_bits_right (uint8_t SRC[], uint16_t len, uint32_t shift) |
| shift a number of bits to the right More... | |
| void | xor_bits (uint8_t DST[], uint8_t SRC1[], uint8_t SRC2[], uint32_t len) |
| logical XOR two bit arrays More... | |
| void | and_bits (uint8_t DST[], uint8_t SRC1[], uint8_t SRC2[], uint32_t len) |
| logical AND two bit arrays More... | |
| void | print_bitmap (const uint8_t bitmap[], uint32_t length) |
| print a bitmap More... | |
| uint8_t | get_number_of_bytes_from_bits (uint16_t number_of_bits) |
| get the number of bytes required to store this amount of bits More... | |
| uint32_t | get_required_number_of_bits (uint32_t value) |
| get the number of bits required to store a value More... | |
| uint8_t | get_position_in_first_byte (uint8_t value) |
| get the starting bit of a value More... | |
| uint8_t | padded (schc_bitarray_t *bit_array) |
| remove padding More... | |
| #define BITS_TO_BYTES | ( | x | ) | (((x) == 0) ? 0 : (((x) - 1) / 8 + 1)) |
| #define BYTES_TO_BITS | ( | x | ) | (x * 8) |
| void and_bits | ( | uint8_t | DST[], |
| uint8_t | SRC1[], | ||
| uint8_t | SRC2[], | ||
| uint32_t | len | ||
| ) |
logical AND two bit arrays
| DST | the array to save the result in |
| SRC1 | the array to compare with |
| SRC2 | the array to compare with |
| len | the number of consecutive bits to compare |
| void clear_bits | ( | uint8_t | A[], |
| uint32_t | pos, | ||
| uint32_t | len | ||
| ) |
clear bits at a certain position in a bit array big endian
| A | the bit array |
| pos | which bit to clear |
| len | the number of consecutive bits to clear |
| uint8_t compare_bits | ( | const uint8_t | SRC1[], |
| const uint8_t | SRC2[], | ||
| uint32_t | len | ||
| ) |
compare two bit arrays
| SRC1 | the array to compare |
| SRC2 | the array to compare with |
| len | the number of consecutive bits to compare |
| uint8_t compare_bits_aligned | ( | const uint8_t | SRC1[], |
| uint16_t | pos1, | ||
| const uint8_t | SRC2[], | ||
| uint16_t | pos2, | ||
| uint32_t | len | ||
| ) |
compare two bit arrays with starting point
| SRC1 | the array to compare |
| pos1 | position to start for src1 |
| SRC2 | the array to compare with |
| pos2 | position to start for src2 |
| len | the number of consecutive bits to compare |
| uint8_t compare_bits_BIG_END | ( | uint8_t | SRC1[], |
| uint8_t | SRC2[], | ||
| uint32_t | len | ||
| ) |
| void copy_bits | ( | uint8_t | DST[], |
| uint32_t | dst_pos, | ||
| const uint8_t | SRC[], | ||
| uint32_t | src_pos, | ||
| uint32_t | len | ||
| ) |
copy bits to a certain position in a bit array from another array big endian
| DST | the array to copy to |
| dst_pos | which bit to start from |
| SRC | the array to copy from |
| src_pos | which bit to start from |
| len | the number of consecutive bits to set |
| uint32_t get_bits | ( | const uint8_t | A[], |
| uint32_t | pos, | ||
| uint8_t | len | ||
| ) |
get bits at a certain position in a bit array
| A | the bit array |
| pos | the position to start from |
| len | the number of consecutive bits to get |
| uint8_t get_number_of_bytes_from_bits | ( | uint16_t | number_of_bits | ) |
get the number of bytes required to store this amount of bits
| number_of_bits | the number of bits to find the number of bytes for |
| uint8_t get_position_in_first_byte | ( | uint8_t | value | ) |
get the starting bit of a value
| value | the value to count the number of bits for |
| uint32_t get_required_number_of_bits | ( | uint32_t | n | ) |
get the number of bits required to store a value
| value | the value to count the number of bits for |
| uint8_t padded | ( | schc_bitarray_t * | bit_array | ) |
remove padding
| bit_arr | the bit array to remove padding for |
| void print_bitmap | ( | const uint8_t | bitmap[], |
| uint32_t | length | ||
| ) |
print a bitmap
| bitmap | the bit array |
| len | the number of consecutive bits to print |
| void set_bits | ( | uint8_t | A[], |
| uint32_t | pos, | ||
| uint32_t | len | ||
| ) |
sets bits at a certain position in a bit array big endian
| A | the bit array |
| pos | which bit to set |
| len | the number of consecutive bits to set |
| void shift_bits_left | ( | uint8_t | SRC[], |
| uint16_t | len, | ||
| uint32_t | shift | ||
| ) |
shift a number of bits to the left
| SRC | the array to shift |
| len | the length of the array |
| shift | the number of consecutive bits to shift |
| void shift_bits_right | ( | uint8_t | SRC[], |
| uint16_t | len, | ||
| uint32_t | shift | ||
| ) |
shift a number of bits to the right
| SRC | the array to shift |
| len | the length of the array |
| shift | the number of consecutive bits to shift |
| void xor_bits | ( | uint8_t | DST[], |
| uint8_t | SRC1[], | ||
| uint8_t | SRC2[], | ||
| uint32_t | len | ||
| ) |
logical XOR two bit arrays
| DST | the array to save the result in |
| SRC1 | the array to compare with |
| SRC2 | the array to compare with |
| len | the number of consecutive bits to compare |
1.8.17