hashindex.h 834 B

12345678910111213141516171819202122232425262728
  1. #ifndef __HASHINDEX_H__
  2. #define __HASHINDEX_H__
  3. typedef struct {
  4. char *path;
  5. void *map_addr;
  6. off_t map_length;
  7. void *buckets;
  8. int num_entries;
  9. int num_buckets;
  10. int key_size;
  11. int value_size;
  12. int bucket_size;
  13. int limit;
  14. } HashIndex;
  15. HashIndex *hashindex_open(const char *path);
  16. void hashindex_close(HashIndex *index);
  17. void hashindex_clear(HashIndex *index);
  18. void hashindex_flush(HashIndex *index);
  19. HashIndex *hashindex_create(const char *path, int capacity, int key_size, int value_size);
  20. const void *hashindex_get(HashIndex *index, const void *key);
  21. void hashindex_set(HashIndex *index, const void *key, const void *value);
  22. void hashindex_delete(HashIndex *index, const void *key);
  23. void *hashindex_next_key(HashIndex *index, const void *key);
  24. int hashindex_get_size(HashIndex *index);
  25. #endif