bitable
0.1
Ordered immutable key value storage system.
|
Common definitions for the bitable interface, shared between reading and writing. More...
#include <stdint.h>
#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
struct | BitableValue |
struct | BitablePaths |
struct | BitableStats |
Macros | |
#define | BITABLE_API |
#define | BITABLE_MAX_KEY_SIZE 768 |
#define | BITABLE_MIN_PAGE_SIZE 2048 |
#define | BITABLE_MAX_PAGE_SIZE 65536 |
#define | BITABLE_MAX_ALIGNMENT 512 |
#define | BITABLE_MAX_BRANCH_LEVELS 32 |
Typedefs | |
typedef enum BitableResult | BitableResult |
typedef enum BitableReadOpenFlags | BitableReadOpenFlags |
typedef struct BitableValue | BitableValue |
typedef struct BitablePaths | BitablePaths |
typedef struct BitableStats | BitableStats |
typedef int( | BitableComparisonFunction )(const BitableValue *left, const BitableValue *right) |
Enumerations | |
enum | BitableResult { BR_SUCCESS = 0, BR_END_OF_SEQUENCE = 1, BR_FILE_OPEN_FAILED = 2, BR_FILE_OPERATION_FAILED = 3, BR_FILE_TOO_LARGE = 4, BR_BAD_PATH = 5, BR_ALREADY_OPEN = 6, BR_FILE_TOO_SMALL = 7, BR_HEADER_CORRUPT = 8, BR_KEY_NOT_FOUND = 9, BR_INVALID_CURSOR_LOCATION = 10, BR_MAXIMUM_TABLE_TREE_DEPTH = 11, BR_KEY_INVALID = 12, BR_PAGESIZE_INVALID = 13, BR_ALIGNMENT_INVALID = 14 } |
enum | BitableReadOpenFlags { BRO_NONE = 0, BRO_RANDOM = 1, BRO_SEQUENTIAL = 2 } |
Functions | |
BITABLE_API void | bitable_build_paths (BitablePaths *paths, const char *basePath) |
BITABLE_API void | bitable_free_paths (BitablePaths *paths) |
Common definitions for the bitable interface, shared between reading and writing.
#define BITABLE_API |
The API prefix macro for the bitable exported functions
#define BITABLE_MAX_ALIGNMENT 512 |
The maximum alignment that can be used for keys and values.
#define BITABLE_MAX_BRANCH_LEVELS 32 |
The maximum number of branch levels used before indexing the bitable.
#define BITABLE_MAX_KEY_SIZE 768 |
The maximum allowed keysize in bytes. You may not have keys larger than this.
#define BITABLE_MAX_PAGE_SIZE 65536 |
The maximum page size allowed in bytes. Note, the limit is 64k because internal offsets are 16bit unsigned.
#define BITABLE_MIN_PAGE_SIZE 2048 |
The minimum allowed page size in bytes. You may not specify pages smaller than this.
typedef int( BitableComparisonFunction)(const BitableValue *left, const BitableValue *right) |
The type for a comparison function used for comparing two keys when searching a bitable.
typedef struct BitablePaths BitablePaths |
The file paths for different files used by a bitable
typedef enum BitableReadOpenFlags BitableReadOpenFlags |
Flags used for opening bitable files indicating the intended access patterns.
typedef enum BitableResult BitableResult |
Return code used by bitable functions to indicate success, error conditions etc.
typedef struct BitableStats BitableStats |
Statistics and information from the readable bitable header.
typedef struct BitableValue BitableValue |
Represents a value used for keys/value data by bitable. Basically a pointer to a data buffer and a size.
enum BitableReadOpenFlags |
enum BitableResult |
Return code used by bitable functions to indicate success, error conditions etc.
BITABLE_API void bitable_build_paths | ( | BitablePaths * | paths, |
const char * | basePath | ||
) |
Take a paths object and populate it with the potential sub-paths of a bitable. Will allocate memory to populate the paths. Does not read from the file system at all, builds the maximum number of paths deterministically. Note, uses malloc to allocate paths.
[out] | paths | The paths to be populated. Should not be null. |
basePath | The main path for the bitable. Should not be null. Null terminated UTF8 is expected. |
BITABLE_API void bitable_free_paths | ( | BitablePaths * | paths | ) |
Free the memory for the file paths allocated by bitable_build_paths
paths | The paths to be freed. Should not be null. |