Changeset View
Changeset View
Standalone View
Standalone View
swh/perfecthash/hash.h
- This file was added.
#include <cmph.h> | |||||
#include "swh/perfecthash/hash.h" | |||||
#define SHARD_OFFSET_HEADER 512 | |||||
#define SHARD_KEY_LEN 32 | |||||
typedef struct { | |||||
size_t objects_count; | |||||
size_t objects_position; | |||||
size_t objects_size; | |||||
size_t index_position; | |||||
size_t index_size; | |||||
size_t hash_position; | |||||
size_t hash_size; | |||||
} shard_header_t; | |||||
typedef struct { | |||||
char key[SHARD_KEY_LEN]; | |||||
size_t object_offset; | |||||
} shard_index_t; | |||||
typedef struct { | |||||
char* addr; | |||||
shard_index_t* index; | |||||
size_t index_offset; | |||||
size_t file_size; | |||||
shard_header_t header; | |||||
size_t object_offset; | |||||
} shard_t; |