VariantKey  5.4.1
Numerical Encoding for Human Genetic Variants
binsearch.h File Reference

Functions to search values in binary files made of constant-length items. More...

#include <inttypes.h>
#include <fcntl.h>
#include <stdbool.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>

Go to the source code of this file.

Data Structures

struct  mmfile_t
 

Macros

#define order_be_uint8_t(x)   (x)
 < More...
 
#define order_le_uint8_t(x)   (x)
 Return LE uint8_t. More...
 
#define order_be_uint16_t(x)   (bswap_16(x))
 Return BE uint16_t in the correct endianness order. More...
 
#define order_be_uint32_t(x)   (bswap_32(x))
 Return BE uint32_t in the correct endianness order. More...
 
#define order_be_uint64_t(x)   (bswap_64(x))
 Return BE uint64_t in the correct endianness order. More...
 
#define order_le_uint16_t(x)   (x)
 Return LE uint16_t in the correct endianness order. More...
 
#define order_le_uint32_t(x)   (x)
 Return LE uint32_t in the correct endianness order. More...
 
#define order_le_uint64_t(x)   (x)
 Return LE uint64_t in the correct endianness order. More...
 
#define MAXCOLS   256
 Maximum number of columns indexable. More...
 
#define get_address(blklen, blkpos, item)   (((blklen) * (item)) + (blkpos))
 
#define get_middle_point(first, last)   ((first) + (((last) - (first)) >> 1))
 
#define get_src_offset(T, src, offset)   ((const T *)((src) + (offset)))
 
#define define_bytes_to(O, T)
 
#define define_get_src_offset(T)
 
#define GET_MIDDLE_BLOCK(O, T)   order_##O##_##T(*(get_src_offset(T, src, get_address(blklen, blkpos, middle))))
 
#define FIND_START_LOOP_BLOCK(T)
 
#define FIND_END_LOOP_BLOCK
 
#define SUB_ITEM_VARS(T)
 
#define GET_ITEM_TASK(O, T)   x = GET_MIDDLE_BLOCK(O, T);
 
#define COL_GET_ITEM_TASK   x = *(src + middle);
 
#define GET_SUB_ITEM_TASK(O, T)   x = ((GET_MIDDLE_BLOCK(O, T) >> rshift) & bitmask);
 
#define COL_GET_SUB_ITEM_TASK   x = ((*(src + middle) >> rshift) & bitmask);
 
#define FIND_FIRST_INNER_CHECK
 
#define FIND_LAST_INNER_CHECK
 
#define HAS_NEXT_START_BLOCK
 
#define HAS_PREV_START_BLOCK
 
#define GET_POS_BLOCK(O, T)   order_##O##_##T(*(get_src_offset(T, src, get_address(blklen, blkpos, *pos))))
 
#define HAS_END_BLOCK(O, T)   return (GET_POS_BLOCK(O, T) == search);
 
#define COL_HAS_END_BLOCK(T)   return (*(src + *pos) == search);
 
#define HAS_SUB_END_BLOCK(O, T)   return (((GET_POS_BLOCK(O, T) >> rshift) & bitmask) == search);
 
#define COL_HAS_SUB_END_BLOCK(T)   return (((*(src + *pos) >> rshift) & bitmask) == search);
 
#define define_find_first(O, T)
 
#define define_find_first_sub(O, T)
 
#define define_find_last(O, T)
 
#define define_find_last_sub(O, T)
 
#define define_has_next(O, T)
 
#define define_has_next_sub(O, T)
 
#define define_has_prev(O, T)
 
#define define_has_prev_sub(O, T)
 
#define define_col_find_first(T)
 
#define define_col_find_first_sub(T)
 
#define define_col_find_last(T)
 
#define define_col_find_last_sub(T)
 
#define define_col_has_next(T)
 
#define define_col_has_next_sub(T)
 
#define define_col_has_prev(T)
 
#define define_col_has_prev_sub(T)
 

Typedefs

typedef struct mmfile_t mmfile_t
 

Functions

static uint8_t bytes_be_to_uint8_t (const uint8_t *src, uint64_t i)
 
static uint16_t bytes_be_to_uint16_t (const uint8_t *src, uint64_t i)
 
static uint32_t bytes_be_to_uint32_t (const uint8_t *src, uint64_t i)
 
static uint64_t bytes_be_to_uint64_t (const uint8_t *src, uint64_t i)
 
static uint8_t bytes_le_to_uint8_t (const uint8_t *src, uint64_t i)
 
static uint16_t bytes_le_to_uint16_t (const uint8_t *src, uint64_t i)
 
static uint32_t bytes_le_to_uint32_t (const uint8_t *src, uint64_t i)
 
static uint64_t bytes_le_to_uint64_t (const uint8_t *src, uint64_t i)
 
static const uint8_t * get_src_offset_uint8_t (const uint8_t *src, uint64_t offset)
 
static const uint16_t * get_src_offset_uint16_t (const uint8_t *src, uint64_t offset)
 
static const uint32_t * get_src_offset_uint32_t (const uint8_t *src, uint64_t offset)
 
static const uint64_t * get_src_offset_uint64_t (const uint8_t *src, uint64_t offset)
 
static uint64_t find_first_be_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t find_first_be_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t find_first_be_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t find_first_be_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t find_first_le_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t find_first_le_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t find_first_le_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t find_first_le_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t find_first_sub_be_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t find_first_sub_be_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t find_first_sub_be_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t find_first_sub_be_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t find_first_sub_le_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t find_first_sub_le_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t find_first_sub_le_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t find_first_sub_le_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t find_last_be_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t find_last_be_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t find_last_be_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t find_last_be_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t find_last_le_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t find_last_le_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t find_last_le_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t find_last_le_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t find_last_sub_be_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t find_last_sub_be_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t find_last_sub_be_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t find_last_sub_be_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t find_last_sub_le_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t find_last_sub_le_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t find_last_sub_le_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t find_last_sub_le_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint64_t search)
 
static bool has_next_be_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *pos, uint64_t last, uint8_t search)
 
static bool has_next_be_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *pos, uint64_t last, uint16_t search)
 
static bool has_next_be_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *pos, uint64_t last, uint32_t search)
 
static bool has_next_be_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *pos, uint64_t last, uint64_t search)
 
static bool has_next_le_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *pos, uint64_t last, uint8_t search)
 
static bool has_next_le_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *pos, uint64_t last, uint16_t search)
 
static bool has_next_le_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *pos, uint64_t last, uint32_t search)
 
static bool has_next_le_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *pos, uint64_t last, uint64_t search)
 
static bool has_next_sub_be_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint8_t search)
 
static bool has_next_sub_be_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint16_t search)
 
static bool has_next_sub_be_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint32_t search)
 
static bool has_next_sub_be_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint64_t search)
 
static bool has_next_sub_le_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint8_t search)
 
static bool has_next_sub_le_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint16_t search)
 
static bool has_next_sub_le_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint32_t search)
 
static bool has_next_sub_le_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint64_t search)
 
static bool has_prev_be_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t first, uint64_t *pos, uint8_t search)
 
static bool has_prev_be_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t first, uint64_t *pos, uint16_t search)
 
static bool has_prev_be_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t first, uint64_t *pos, uint32_t search)
 
static bool has_prev_be_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t first, uint64_t *pos, uint64_t search)
 
static bool has_prev_le_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t first, uint64_t *pos, uint8_t search)
 
static bool has_prev_le_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t first, uint64_t *pos, uint16_t search)
 
static bool has_prev_le_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t first, uint64_t *pos, uint32_t search)
 
static bool has_prev_le_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t first, uint64_t *pos, uint64_t search)
 
static bool has_prev_sub_be_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint8_t search)
 
static bool has_prev_sub_be_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint16_t search)
 
static bool has_prev_sub_be_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint32_t search)
 
static bool has_prev_sub_be_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint64_t search)
 
static bool has_prev_sub_le_uint8_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint8_t search)
 
static bool has_prev_sub_le_uint16_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint16_t search)
 
static bool has_prev_sub_le_uint32_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint32_t search)
 
static bool has_prev_sub_le_uint64_t (const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint64_t search)
 
static uint64_t col_find_first_uint8_t (const uint8_t *src, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t col_find_first_uint16_t (const uint16_t *src, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t col_find_first_uint32_t (const uint32_t *src, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t col_find_first_uint64_t (const uint64_t *src, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t col_find_first_sub_uint8_t (const uint8_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t col_find_first_sub_uint16_t (const uint16_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t col_find_first_sub_uint32_t (const uint32_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t col_find_first_sub_uint64_t (const uint64_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t col_find_last_uint8_t (const uint8_t *src, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t col_find_last_uint16_t (const uint16_t *src, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t col_find_last_uint32_t (const uint32_t *src, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t col_find_last_uint64_t (const uint64_t *src, uint64_t *first, uint64_t *last, uint64_t search)
 
static uint64_t col_find_last_sub_uint8_t (const uint8_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint8_t search)
 
static uint64_t col_find_last_sub_uint16_t (const uint16_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint16_t search)
 
static uint64_t col_find_last_sub_uint32_t (const uint32_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint32_t search)
 
static uint64_t col_find_last_sub_uint64_t (const uint64_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, uint64_t search)
 
static bool col_has_next_uint8_t (const uint8_t *src, uint64_t *pos, uint64_t last, uint8_t search)
 
static bool col_has_next_uint16_t (const uint16_t *src, uint64_t *pos, uint64_t last, uint16_t search)
 
static bool col_has_next_uint32_t (const uint32_t *src, uint64_t *pos, uint64_t last, uint32_t search)
 
static bool col_has_next_uint64_t (const uint64_t *src, uint64_t *pos, uint64_t last, uint64_t search)
 
static bool col_has_next_sub_uint8_t (const uint8_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint8_t search)
 
static bool col_has_next_sub_uint16_t (const uint16_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint16_t search)
 
static bool col_has_next_sub_uint32_t (const uint32_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint32_t search)
 
static bool col_has_next_sub_uint64_t (const uint64_t *src, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, uint64_t search)
 
static bool col_has_prev_uint8_t (const uint8_t *src, uint64_t first, uint64_t *pos, uint8_t search)
 
static bool col_has_prev_uint16_t (const uint16_t *src, uint64_t first, uint64_t *pos, uint16_t search)
 
static bool col_has_prev_uint32_t (const uint32_t *src, uint64_t first, uint64_t *pos, uint32_t search)
 
static bool col_has_prev_uint64_t (const uint64_t *src, uint64_t first, uint64_t *pos, uint64_t search)
 
static bool col_has_prev_sub_uint8_t (const uint8_t *src, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint8_t search)
 
static bool col_has_prev_sub_uint16_t (const uint16_t *src, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint16_t search)
 
static bool col_has_prev_sub_uint32_t (const uint32_t *src, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint32_t search)
 
static bool col_has_prev_sub_uint64_t (const uint64_t *src, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, uint64_t search)
 
static void parse_col_offset (mmfile_t *mf)
 
static void parse_info_binsrc (mmfile_t *mf)
 
static void parse_info_arrow (mmfile_t *mf)
 
static void parse_info_feather (mmfile_t *mf)
 
static void mmap_binfile (const char *file, mmfile_t *mf)
 
static int munmap_binfile (mmfile_t mf)
 

Detailed Description

The functions provided here allows to search unsigned integers in a binary file made of adjacent constant-length binary blocks sorted in ascending order.

For example, the first 4 bytes of each 8-bytes blocks below represent a uint32 in big-endian. The integers are sorted in ascending order.

  • 2f 81 f5 77 1a cc 7b 43
  • 2f 81 f5 78 76 5f 63 b8
  • 2f 81 f5 79 ca a9 a6 52

This binary representation can be used to encode sortable key-value data, even with nested keys.

The xxd command-line application can be used to convert a binary file to hexdump and reverse. For example:

  • xxd -p binaryfile.bin > hexfile.txt
  • xxd -r -p hexfile.txt > binaryfile.bin

NOTE:

  • The "_be_" or "BE" functions refer to source files sorted in Big-Endian.
  • The "_le_" or "LE" functions refer to source files sorted in Little-Endian.

Macro Definition Documentation

#define COL_GET_ITEM_TASK   x = *(src + middle);
#define COL_GET_SUB_ITEM_TASK   x = ((*(src + middle) >> rshift) & bitmask);
#define COL_HAS_END_BLOCK (   T)    return (*(src + *pos) == search);
#define COL_HAS_SUB_END_BLOCK (   T)    return (((*(src + *pos) >> rshift) & bitmask) == search);
#define define_bytes_to (   O,
 
)
Value:
\
static inline T bytes_##O##_to_##T(const uint8_t *src, uint64_t i) \
{ \
return order_##O##_##T(*((const T *)(src + i))); \
}

Convert bytes to the specified type.

Parameters
OEndiannes: be or le.
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t.
#define define_col_find_first (   T)
Value:
\
static inline uint64_t col_find_first_##T(const T *src, uint64_t *first, uint64_t *last, T search) \
{ \
}
#define FIND_END_LOOP_BLOCK
Definition: binsearch.h:298
#define FIND_START_LOOP_BLOCK(T)
Definition: binsearch.h:291

Generic function to search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t.
#define define_col_find_first_sub (   T)
Value:
\
static inline uint64_t col_find_first_sub_##T(const T *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, T search) \
{ \
}
#define FIND_END_LOOP_BLOCK
Definition: binsearch.h:298
#define FIND_START_LOOP_BLOCK(T)
Definition: binsearch.h:291
#define SUB_ITEM_VARS(T)
Definition: binsearch.h:309

Generic function to search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_col_find_last (   T)
Value:
\
static inline uint64_t col_find_last_##T(const T *src, uint64_t *first, uint64_t *last, T search) \
{ \
}
#define FIND_END_LOOP_BLOCK
Definition: binsearch.h:298
#define FIND_START_LOOP_BLOCK(T)
Definition: binsearch.h:291

Generic function to search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_col_find_last_sub (   T)
Value:
\
static inline uint64_t col_find_last_sub_##T(const T *src, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, T search) \
{ \
}
#define FIND_END_LOOP_BLOCK
Definition: binsearch.h:298
#define FIND_START_LOOP_BLOCK(T)
Definition: binsearch.h:291
#define SUB_ITEM_VARS(T)
Definition: binsearch.h:309

Generic function to search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_col_has_next (   T)
Value:
\
static inline bool col_has_next_##T(const T *src, uint64_t *pos, uint64_t last, T search) \
{ \
}
#define COL_HAS_END_BLOCK(T)
Definition: binsearch.h:369

Generic function to check if the next item still matches the search value.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_col_has_next_sub (   T)
Value:
\
static inline bool col_has_next_sub_##T(const T *src, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, T search) \
{ \
}
#define COL_HAS_SUB_END_BLOCK(T)
Definition: binsearch.h:375
#define SUB_ITEM_VARS(T)
Definition: binsearch.h:309

Generic function to check if the next item still matches the search value.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_col_has_prev (   T)
Value:
\
static inline bool col_has_prev_##T(const T *src, uint64_t first, uint64_t *pos, T search) \
{ \
}
#define COL_HAS_END_BLOCK(T)
Definition: binsearch.h:369

Generic function to check if the previous item still matches the search value.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_col_has_prev_sub (   T)
Value:
\
static inline bool col_has_prev_sub_##T(const T *src, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, T search) \
{ \
}
#define COL_HAS_SUB_END_BLOCK(T)
Definition: binsearch.h:375
#define SUB_ITEM_VARS(T)
Definition: binsearch.h:309

Generic function to check if the previous item still matches the search value.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_find_first (   O,
 
)
Value:
\
static inline uint64_t find_first_##O##_##T(const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, T search) \
{ \
}
#define FIND_END_LOOP_BLOCK
Definition: binsearch.h:298
#define GET_ITEM_TASK(O, T)
Definition: binsearch.h:314
#define FIND_START_LOOP_BLOCK(T)
Definition: binsearch.h:291

Generic function to search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data.

Parameters
OEndiannes: be or le.
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t.
#define define_find_first_sub (   O,
 
)
Value:
\
static inline uint64_t find_first_sub_##O##_##T(const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, T search) \
{ \
}
#define GET_SUB_ITEM_TASK(O, T)
Definition: binsearch.h:320
#define FIND_END_LOOP_BLOCK
Definition: binsearch.h:298
#define FIND_START_LOOP_BLOCK(T)
Definition: binsearch.h:291
#define SUB_ITEM_VARS(T)
Definition: binsearch.h:309

Generic function to search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data.

Parameters
OEndiannes: be or le.
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_find_last (   O,
 
)
Value:
\
static inline uint64_t find_last_##O##_##T(const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *first, uint64_t *last, T search) \
{ \
}
#define FIND_END_LOOP_BLOCK
Definition: binsearch.h:298
#define GET_ITEM_TASK(O, T)
Definition: binsearch.h:314
#define FIND_START_LOOP_BLOCK(T)
Definition: binsearch.h:291

Generic function to search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data.

Parameters
OEndiannes: be or le.
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_find_last_sub (   O,
 
)
Value:
\
static inline uint64_t find_last_sub_##O##_##T(const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *first, uint64_t *last, T search) \
{ \
}
#define GET_SUB_ITEM_TASK(O, T)
Definition: binsearch.h:320
#define FIND_END_LOOP_BLOCK
Definition: binsearch.h:298
#define FIND_START_LOOP_BLOCK(T)
Definition: binsearch.h:291
#define SUB_ITEM_VARS(T)
Definition: binsearch.h:309

Generic function to search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data.

Parameters
OEndiannes: be or le.
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_get_src_offset (   T)
Value:
\
static inline const T *get_src_offset_##T(const uint8_t *src, uint64_t offset) \
{ \
return get_src_offset(T, src, offset); \
}
#define get_src_offset(T, src, offset)
Definition: binsearch.h:224

Define functions to return a pointer to the offset position.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t.
#define define_has_next (   O,
 
)
Value:
\
static inline bool has_next_##O##_##T(const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t *pos, uint64_t last, T search) \
{ \
}
#define HAS_END_BLOCK(O, T)
Definition: binsearch.h:366

Generic function to check if the next item still matches the search value.

Parameters
OEndiannes: be or le.
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_has_next_sub (   O,
 
)
Value:
\
static inline bool has_next_sub_##O##_##T(const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t *pos, uint64_t last, T search) \
{ \
}
#define SUB_ITEM_VARS(T)
Definition: binsearch.h:309
#define HAS_SUB_END_BLOCK(O, T)
Definition: binsearch.h:372

Generic function to check if the next item still matches the search value.

Parameters
OEndiannes: be or le.
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_has_prev (   O,
 
)
Value:
\
static inline bool has_prev_##O##_##T(const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint64_t first, uint64_t *pos, T search) \
{ \
}
#define HAS_END_BLOCK(O, T)
Definition: binsearch.h:366

Generic function to check if the previous item still matches the search value.

Parameters
OEndiannes: be or le.
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define define_has_prev_sub (   O,
 
)
Value:
\
static inline bool has_prev_sub_##O##_##T(const uint8_t *src, uint64_t blklen, uint64_t blkpos, uint8_t bitstart, uint8_t bitend, uint64_t first, uint64_t *pos, T search) \
{ \
}
#define SUB_ITEM_VARS(T)
Definition: binsearch.h:309
#define HAS_SUB_END_BLOCK(O, T)
Definition: binsearch.h:372

Generic function to check if the previous item still matches the search value.

Parameters
OEndiannes: be or le.
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t
#define FIND_END_LOOP_BLOCK
Value:
if (x == search) \
{ \
return middle; \
} \
if (*first > 0) \
{ \
--(*first); \
} \
return notfound;
#define FIND_FIRST_INNER_CHECK
Value:
if (x < search) { \
*first = middle; \
++(*first); \
} \
else \
{ \
*last = middle; \
} \
} \
middle = *first;
#define FIND_LAST_INNER_CHECK
Value:
if (x > search) { \
*last = middle; \
} \
else \
{ \
*first = middle; \
++(*first); \
} \
} \
middle = *first; \
--middle;
#define FIND_START_LOOP_BLOCK (   T)
Value:
uint64_t middle, notfound = *last; \
T x; \
while (*first < *last) \
{ \
middle = get_middle_point(*first, *last); \
#define get_middle_point(first, last)
Definition: binsearch.h:213
#define get_address (   blklen,
  blkpos,
  item 
)    (((blklen) * (item)) + (blkpos))

Returns the absolute file address position of the specified item (binary block).

Parameters
blklenLength of the binary block in bytes.
blkposIndicates the position of the value to search inside a binary block.
itemItem number to search.
Returns
First byte position of the specified item number.
#define GET_ITEM_TASK (   O,
 
)    x = GET_MIDDLE_BLOCK(O, T);
#define GET_MIDDLE_BLOCK (   O,
 
)    order_##O##_##T(*(get_src_offset(T, src, get_address(blklen, blkpos, middle))))
#define get_middle_point (   first,
  last 
)    ((first) + (((last) - (first)) >> 1))

Returns the middle point between two values.

Parameters
firstFirst point (smaller point).
lastLast point (bigger point).
Returns
Middle point.
#define GET_POS_BLOCK (   O,
 
)    order_##O##_##T(*(get_src_offset(T, src, get_address(blklen, blkpos, *pos))))
#define get_src_offset (   T,
  src,
  offset 
)    ((const T *)((src) + (offset)))

Returns the pointer at the specified byte offset.

Parameters
TUnsigned integer type, one of: uint8_t, uint16_t, uint32_t, uint64_t.
srcMemory mapped file address.
offsetByte offset.
Returns
Pointer.
#define GET_SUB_ITEM_TASK (   O,
 
)    x = ((GET_MIDDLE_BLOCK(O, T) >> rshift) & bitmask);
#define HAS_END_BLOCK (   O,
 
)    return (GET_POS_BLOCK(O, T) == search);
#define HAS_NEXT_START_BLOCK
Value:
if (*pos >= (last - 1)) \
{ \
return 0; \
} \
++(*pos);
#define HAS_PREV_START_BLOCK
Value:
if (*pos <= first) { \
return 0; \
} \
--(*pos);
#define HAS_SUB_END_BLOCK (   O,
 
)    return (((GET_POS_BLOCK(O, T) >> rshift) & bitmask) == search);
#define MAXCOLS   256
#define order_be_uint16_t (   x)    (bswap_16(x))
#define order_be_uint32_t (   x)    (bswap_32(x))
#define order_be_uint64_t (   x)    (bswap_64(x))
#define order_be_uint8_t (   x)    (x)

Return BE uint8_t

#define order_le_uint16_t (   x)    (x)
#define order_le_uint32_t (   x)    (x)
#define order_le_uint64_t (   x)    (x)
#define order_le_uint8_t (   x)    (x)
#define SUB_ITEM_VARS (   T)
Value:
T bitmask = ((T)1 << (bitend - bitstart)); \
bitmask ^= (bitmask - 1); \
const uint8_t rshift = (((uint8_t)(sizeof(T) * 8) - 1) - bitend);

Typedef Documentation

typedef struct mmfile_t mmfile_t

Struct containing the memory mapped file info.

Function Documentation

static uint16_t bytes_be_to_uint16_t ( const uint8_t *  src,
uint64_t  i 
)
inlinestatic

Convert bytes in "be" format to uint16_t .

Parameters
srcMemory mapped file address.
iStart position.
Returns
Converted number
static uint32_t bytes_be_to_uint32_t ( const uint8_t *  src,
uint64_t  i 
)
inlinestatic

Convert bytes in "be" format to uint32_t .

Parameters
srcMemory mapped file address.
iStart position.
Returns
Converted number
static uint64_t bytes_be_to_uint64_t ( const uint8_t *  src,
uint64_t  i 
)
inlinestatic

Convert bytes in "be" format to uint64_t .

Parameters
srcMemory mapped file address.
iStart position.
Returns
Converted number
static uint8_t bytes_be_to_uint8_t ( const uint8_t *  src,
uint64_t  i 
)
inlinestatic

Convert bytes in "be" format to uint8_t .

Parameters
srcMemory mapped file address.
iStart position.
Returns
Converted number
static uint16_t bytes_le_to_uint16_t ( const uint8_t *  src,
uint64_t  i 
)
inlinestatic

Convert bytes in "le" format to uint16_t .

Parameters
srcMemory mapped file address.
iStart position.
Returns
Converted number
static uint32_t bytes_le_to_uint32_t ( const uint8_t *  src,
uint64_t  i 
)
inlinestatic

Convert bytes in "le" format to uint32_t .

Parameters
srcMemory mapped file address.
iStart position.
Returns
Converted number
static uint64_t bytes_le_to_uint64_t ( const uint8_t *  src,
uint64_t  i 
)
inlinestatic

Convert bytes in "le" format to uint64_t .

Parameters
srcMemory mapped file address.
iStart position.
Returns
Converted number
static uint8_t bytes_le_to_uint8_t ( const uint8_t *  src,
uint64_t  i 
)
inlinestatic

Convert bytes in "le" format to uint8_t .

Parameters
srcMemory mapped file address.
iStart position.
Returns
Converted number
static uint64_t col_find_first_sub_uint16_t ( const uint16_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_first_sub_uint32_t ( const uint32_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_first_sub_uint64_t ( const uint64_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_first_sub_uint8_t ( const uint8_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_first_uint16_t ( const uint16_t *  src,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_first_uint32_t ( const uint32_t *  src,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_first_uint64_t ( const uint64_t *  src,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_first_uint8_t ( const uint8_t *  src,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_last_sub_uint16_t ( const uint16_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_last_sub_uint32_t ( const uint32_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_last_sub_uint64_t ( const uint64_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_last_sub_uint8_t ( const uint8_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_last_uint16_t ( const uint16_t *  src,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_last_uint32_t ( const uint32_t *  src,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_last_uint64_t ( const uint64_t *  src,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t col_find_last_uint8_t ( const uint8_t *  src,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory buffer containing contiguos blocks of unsigned integers of the same type. The values must be encoded in Little-Endian format and sorted in ascending order.

Parameters
srcMemory mapped file address.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static bool col_has_next_sub_uint16_t ( const uint16_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint16_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_first_sub_uint16_t to get the next elements that still satisfy the search. The item returned by col_find_first_sub_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_next_sub_uint32_t ( const uint32_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint32_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_first_sub_uint32_t to get the next elements that still satisfy the search. The item returned by col_find_first_sub_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_next_sub_uint64_t ( const uint64_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint64_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_first_sub_uint64_t to get the next elements that still satisfy the search. The item returned by col_find_first_sub_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_next_sub_uint8_t ( const uint8_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint8_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_first_sub_uint8_t to get the next elements that still satisfy the search. The item returned by col_find_first_sub_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_next_uint16_t ( const uint16_t *  src,
uint64_t *  pos,
uint64_t  last,
uint16_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_first_uint16_t to get the next elements that still satisfy the search. The item returned by col_find_first_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_next_uint32_t ( const uint32_t *  src,
uint64_t *  pos,
uint64_t  last,
uint32_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_first_uint32_t to get the next elements that still satisfy the search. The item returned by col_find_first_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_next_uint64_t ( const uint64_t *  src,
uint64_t *  pos,
uint64_t  last,
uint64_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_first_uint64_t to get the next elements that still satisfy the search. The item returned by col_find_first_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_next_uint8_t ( const uint8_t *  src,
uint64_t *  pos,
uint64_t  last,
uint8_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_first_uint8_t to get the next elements that still satisfy the search. The item returned by col_find_first_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_prev_sub_uint16_t ( const uint16_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint16_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_last_sub_uint16_t to get the previous elements that still satisfy the search. The item returned by col_find_last_sub_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_prev_sub_uint32_t ( const uint32_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint32_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_last_sub_uint32_t to get the previous elements that still satisfy the search. The item returned by col_find_last_sub_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_prev_sub_uint64_t ( const uint64_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint64_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_last_sub_uint64_t to get the previous elements that still satisfy the search. The item returned by col_find_last_sub_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_prev_sub_uint8_t ( const uint8_t *  src,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint8_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_last_sub_uint8_t to get the previous elements that still satisfy the search. The item returned by col_find_last_sub_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_prev_uint16_t ( const uint16_t *  src,
uint64_t  first,
uint64_t *  pos,
uint16_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_last_uint16_t to get the previous elements that still satisfy the search. The item returned by col_find_last_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_prev_uint32_t ( const uint32_t *  src,
uint64_t  first,
uint64_t *  pos,
uint32_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_last_uint32_t to get the previous elements that still satisfy the search. The item returned by col_find_last_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_prev_uint64_t ( const uint64_t *  src,
uint64_t  first,
uint64_t *  pos,
uint64_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_last_uint64_t to get the previous elements that still satisfy the search. The item returned by col_find_last_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool col_has_prev_uint8_t ( const uint8_t *  src,
uint64_t  first,
uint64_t *  pos,
uint8_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory buffer containing contiguos blocks of sorted binary data of the same type still matches the search value. The values must be encoded in Little-Endian format and sorted in ascending order. This function can be used after find_last_uint8_t to get the previous elements that still satisfy the search. The item returned by col_find_last_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static uint64_t find_first_be_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_be_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_be_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_be_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_le_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_le_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_le_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_le_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_sub_be_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_sub_be_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_sub_be_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_sub_be_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_sub_le_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_sub_le_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_sub_le_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_first_sub_le_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the first occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_be_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_be_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_be_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_be_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_le_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_le_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_le_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_le_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_sub_be_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_sub_be_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_sub_be_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_sub_be_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "be" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_sub_le_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint16_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_sub_le_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint32_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_sub_le_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint64_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static uint64_t find_last_sub_le_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  first,
uint64_t *  last,
uint8_t  search 
)
inlinestatic

Search for the last occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data. The values in the file must be encoded in "le" format and sorted in ascending order.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstPointer to the element from where to start the search (min value = 0).
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
Item number if notfound or (last + 1) if not notfound.
static const uint16_t* get_src_offset_uint16_t ( const uint8_t *  src,
uint64_t  offset 
)
inlinestatic

Return a pointer to the offset position.

Parameters
srcMemory mapped file address.
offsetStart position.
Returns
Pointer
static const uint32_t* get_src_offset_uint32_t ( const uint8_t *  src,
uint64_t  offset 
)
inlinestatic

Return a pointer to the offset position.

Parameters
srcMemory mapped file address.
offsetStart position.
Returns
Pointer
static const uint64_t* get_src_offset_uint64_t ( const uint8_t *  src,
uint64_t  offset 
)
inlinestatic

Return a pointer to the offset position.

Parameters
srcMemory mapped file address.
offsetStart position.
Returns
Pointer
static const uint8_t* get_src_offset_uint8_t ( const uint8_t *  src,
uint64_t  offset 
)
inlinestatic

Return a pointer to the offset position.

Parameters
srcMemory mapped file address.
offsetStart position.
Returns
Pointer
static bool has_next_be_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  pos,
uint64_t  last,
uint16_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_first_uint16_t to get the next elements that still satisfy the search. The item returned by find_first_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_be_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  pos,
uint64_t  last,
uint32_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_first_uint32_t to get the next elements that still satisfy the search. The item returned by find_first_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_be_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  pos,
uint64_t  last,
uint64_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_first_uint64_t to get the next elements that still satisfy the search. The item returned by find_first_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_be_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  pos,
uint64_t  last,
uint8_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_first_uint8_t to get the next elements that still satisfy the search. The item returned by find_first_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_le_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  pos,
uint64_t  last,
uint16_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_first_uint16_t to get the next elements that still satisfy the search. The item returned by find_first_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_le_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  pos,
uint64_t  last,
uint32_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_first_uint32_t to get the next elements that still satisfy the search. The item returned by find_first_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_le_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  pos,
uint64_t  last,
uint64_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_first_uint64_t to get the next elements that still satisfy the search. The item returned by find_first_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_le_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t *  pos,
uint64_t  last,
uint8_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_first_uint8_t to get the next elements that still satisfy the search. The item returned by find_first_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_sub_be_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint16_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_first_sub_uint16_t to get the next elements that still satisfy the search. The item returned by find_first_sub_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_sub_be_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint32_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_first_sub_uint32_t to get the next elements that still satisfy the search. The item returned by find_first_sub_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_sub_be_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint64_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_first_sub_uint64_t to get the next elements that still satisfy the search. The item returned by find_first_sub_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_sub_be_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint8_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_first_sub_uint8_t to get the next elements that still satisfy the search. The item returned by find_first_sub_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_sub_le_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint16_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_first_sub_uint16_t to get the next elements that still satisfy the search. The item returned by find_first_sub_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_sub_le_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint32_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_first_sub_uint32_t to get the next elements that still satisfy the search. The item returned by find_first_sub_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_sub_le_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint64_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_first_sub_uint64_t to get the next elements that still satisfy the search. The item returned by find_first_sub_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_next_sub_le_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t *  pos,
uint64_t  last,
uint8_t  search 
)
inlinestatic

Check if the next occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_first_sub_uint8_t to get the next elements that still satisfy the search. The item returned by find_first_sub_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
posPointer to the current item position. This will be updated to point to the next position.
lastPointer to the element (up to but not including) where to end the search (max value = nrows).
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_be_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t  first,
uint64_t *  pos,
uint16_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_last_uint16_t to get the previous elements that still satisfy the search. The item returned by find_last_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_be_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t  first,
uint64_t *  pos,
uint32_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_last_uint32_t to get the previous elements that still satisfy the search. The item returned by find_last_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_be_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t  first,
uint64_t *  pos,
uint64_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_last_uint64_t to get the previous elements that still satisfy the search. The item returned by find_last_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_be_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t  first,
uint64_t *  pos,
uint8_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_last_uint8_t to get the previous elements that still satisfy the search. The item returned by find_last_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_le_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t  first,
uint64_t *  pos,
uint16_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_last_uint16_t to get the previous elements that still satisfy the search. The item returned by find_last_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_le_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t  first,
uint64_t *  pos,
uint32_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_last_uint32_t to get the previous elements that still satisfy the search. The item returned by find_last_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_le_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t  first,
uint64_t *  pos,
uint64_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_last_uint64_t to get the previous elements that still satisfy the search. The item returned by find_last_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_le_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint64_t  first,
uint64_t *  pos,
uint8_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_last_uint8_t to get the previous elements that still satisfy the search. The item returned by find_last_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_sub_be_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint16_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_last_sub_uint16_t to get the previous elements that still satisfy the search. The item returned by find_last_sub_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_sub_be_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint32_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_last_sub_uint32_t to get the previous elements that still satisfy the search. The item returned by find_last_sub_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_sub_be_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint64_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_last_sub_uint64_t to get the previous elements that still satisfy the search. The item returned by find_last_sub_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_sub_be_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint8_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "be" format and sorted in ascending order. This function can be used after find_last_sub_uint8_t to get the previous elements that still satisfy the search. The item returned by find_last_sub_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_sub_le_uint16_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint16_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_last_sub_uint16_t to get the previous elements that still satisfy the search. The item returned by find_last_sub_uint16_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint16_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_sub_le_uint32_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint32_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_last_sub_uint32_t to get the previous elements that still satisfy the search. The item returned by find_last_sub_uint32_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint32_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_sub_le_uint64_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint64_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_last_sub_uint64_t to get the previous elements that still satisfy the search. The item returned by find_last_sub_uint64_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint64_t ).
Returns
1 if the next item is valid, 0 otherwise.
static bool has_prev_sub_le_uint8_t ( const uint8_t *  src,
uint64_t  blklen,
uint64_t  blkpos,
uint8_t  bitstart,
uint8_t  bitend,
uint64_t  first,
uint64_t *  pos,
uint8_t  search 
)
inlinestatic

Check if the previous occurrence of an unsigned integer on a memory mapped binary file containing adjacent blocks of sorted binary data still matches the search value. The values in the file must be encoded in "le" format and sorted in ascending order. This function can be used after find_last_sub_uint8_t to get the previous elements that still satisfy the search. The item returned by find_last_sub_uint8_t should be set as the "pos" parameter in this function.

Parameters
srcMemory mapped file address.
blklenLength of the binary block in bytes.
blkposIndicates the position of the number to search inside a binary block.
bitstartFirst bit position to consider (usually 0).
bitendLast bit position to consider (usually the last bit, e.g. 7 for uint8_t, 15 for uint16_t, etc).
firstFirst element of the range to search (min value = 0).
posPointer to the current item position. This will be updated to point to the previous position.
searchUnsigned number to search (type uint8_t ).
Returns
1 if the next item is valid, 0 otherwise.
static void mmap_binfile ( const char *  file,
mmfile_t mf 
)
inlinestatic

Memory map the specified file.

Parameters
filePath to the file to map.
mfStructure containing the memory mapped file.
Returns
Returns the memory-mapped file descriptors.
static int munmap_binfile ( mmfile_t  mf)
inlinestatic

Unmap and close the memory-mapped file.

Parameters
mfDescriptor of memory-mapped file.
Returns
On success, munmap() returns 0, on failure -1, and errno is set (probably to EINVAL).
static void parse_col_offset ( mmfile_t mf)
inlinestatic
static void parse_info_arrow ( mmfile_t mf)
inlinestatic
static void parse_info_binsrc ( mmfile_t mf)
inlinestatic
static void parse_info_feather ( mmfile_t mf)
inlinestatic