1 #ifndef STRING_INDEX_H 2 #define STRING_INDEX_H 3 4 #include "config.h" 5 6 #include <stddef.h> 7 8 #define INVALID_INDEX 0xFFFFFFFF 9 10 typedef struct string_index_t string_index_t; 11 12 string_index_t *string_index_create(const char *Prefix, size_t KeySize, size_t ChunkSize RADB_MEM_PARAMS); 13 string_index_t *string_index_open(const char *Prefix RADB_MEM_PARAMS); 14 size_t string_index_count(string_index_t *Store); 15 void string_index_close(string_index_t *Store); 16 17 size_t string_index_insert(string_index_t *Store, const char *Key, size_t Length); 18 size_t string_index_search(string_index_t *Store, const char *Key, size_t Length); 19 20 typedef struct { 21 size_t Index; 22 int Created; 23 } string_index_result_t; 24 25 string_index_result_t string_index_insert2(string_index_t *Store, const char *Key, size_t Length); 26 27 size_t string_index_size(string_index_t *Store, size_t Index); 28 size_t string_index_get(string_index_t *Store, size_t Index, void *Buffer, size_t Space); 29 size_t string_index_delete(string_index_t *Store, const char *Key, size_t Length); 30 31 #endif 32