ares/rust/ares_pma/c-src/btree.h
2023-11-29 12:52:42 -05:00

31 lines
714 B
C

#ifndef __BTREE_H__
#define __BTREE_H__
#include <sys/types.h>
#include <stdint.h>
struct BT_state;
typedef struct BT_state BT_state;
typedef unsigned long ULONG;
//// ===========================================================================
//// btree external routines
int bt_state_new(BT_state **state);
int bt_state_open(BT_state *state, const char *path, ULONG flags, mode_t mode);
int bt_state_close(BT_state *state);
void * bt_malloc(BT_state *state, size_t pages);
void bt_free(BT_state *state, void *lo, void *hi);
int bt_sync(BT_state *state);
uint64_t bt_meta_get(BT_state *state, size_t idx);
void bt_meta_set(BT_state *state, size_t idx, uint64_t val);
#endif