Initial commit (squashed)

This commit is contained in:
2019-09-27 22:56:07 -04:00
commit 564a17a8fa
75 changed files with 7518 additions and 0 deletions

24
src/io/store.h Normal file
View File

@@ -0,0 +1,24 @@
#ifndef SIST2_STORE_H
#define SIST2_STORE_H
#include <pthread.h>
#include <lmdb.h>
typedef struct store_t {
MDB_dbi dbi;
MDB_env *env;
size_t size;
pthread_rwlock_t lock;
} store_t;
#include "src/sist.h"
store_t *store_create(char *path);
void store_destroy(store_t *store);
void store_write(store_t *store, char *key, size_t key_len, char *buf, size_t buf_len);
char *store_read(store_t *store, char *key, size_t key_len, size_t *ret_vallen);
#endif