Go to the source code of this file.
|
simpledb_data_t * | simpledb_open (const char *pfname) |
| open the db. if pfname is set, the config(rw) data is restored from the file. More...
|
|
void | simpledb_close (simpledb_data_t *sdbd) |
| close the db. if pfname is set at the open, the config(rw) data is saved. More...
|
|
int | simpledb_savedata (simpledb_data_t *sdbd, key_range_t **keyranges) |
| save data to a file More...
|
|
int | simpledb_put (simpledb_data_t *sdbd, simpledb_keydata_t *kd, void *value, uint32_t vlen, uint8_t flags) |
|
int | simpledb_get (simpledb_data_t *sdbd, simpledb_keydata_t *kd, void **value, uint32_t *vlen) |
| get data from the db More...
|
|
int | simpledb_get_release (simpledb_data_t *sdbd, simpledb_keydata_t *kd) |
|
int | simpledb_del (simpledb_data_t *sdbd, simpledb_keydata_t *kd) |
| delete the key item. need to be unlocked status. More...
|
|
simpledb_range_t * | simpledb_get_range (simpledb_data_t *sdbd, key_range_t *krange) |
| get datarange pointer which the keys are between (key1, key2) More...
|
|
void | simpledb_get_range_release (simpledb_data_t *sdbd, simpledb_range_t *rangedp) |
|
int | simpledb_get_from_range (simpledb_data_t *sdbd, simpledb_range_t *rangedp, void **kdata, uint32_t *ksize, void **vdata, uint32_t *vsize, int direction) |
|
void | simpledb_move_top_range (simpledb_data_t *sdbd, simpledb_range_t *rangedp) |
|
void | simpledb_move_bottom_range (simpledb_data_t *sdbd, simpledb_range_t *rangedp) |
|
int | simpledb_move_in_range (simpledb_data_t *sdbd, simpledb_range_t *rangedp, int direction) |
|
int | simpledb_del_in_range (simpledb_data_t *sdbd, simpledb_range_t *rangedp, int direction) |
|
int | simpledb_wait_release (simpledb_data_t *sdbd, int toutms) |
|
◆ MAX_NUM_DBLIST
#define MAX_NUM_DBLIST 20 |
◆ SIMPLEDB_FLAG_CREATE
#define SIMPLEDB_FLAG_CREATE (1u<<0u) |
put data into the db.
- Note
- if it has CREATE flag, a new item is added. if it has APPEND flag, data is added at the bottom when the key exist
◆ SIMPLEDB_FLAG_APPEND
#define SIMPLEDB_FLAG_APPEND (1u<<1u) |
◆ SIMPLEDB_FORWARD
#define SIMPLEDB_FORWARD 1 |
get key or value in the range
- Note
- directon set pointer move, 1:forward, 0:stay, -1:backward
◆ SIMPLEDB_BACKWARD
#define SIMPLEDB_BACKWARD -1 |
◆ SIMPLEDB_NOMOVE
#define SIMPLEDB_NOMOVE 0 |
◆ simpledb_data_t
◆ simpledb_range_t
◆ simpledb_open()
open the db. if pfname is set, the config(rw) data is restored from the file.
◆ simpledb_close()
close the db. if pfname is set at the open, the config(rw) data is saved.
◆ simpledb_savedata()
save data to a file
- Note
- keyranges must be terminated by NULL
◆ simpledb_put()
◆ simpledb_get()
get data from the db
- Note
- untill simpledb_get_release is called, the item becomes readonly.
◆ simpledb_get_release()
◆ simpledb_del()
delete the key item. need to be unlocked status.
◆ simpledb_get_range()
get datarange pointer which the keys are between (key1, key2)
- Note
- untill 'simpledb_keylist_release' is called, all items in the range are locked and become readonly
◆ simpledb_get_range_release()
◆ simpledb_get_from_range()
int simpledb_get_from_range |
( |
simpledb_data_t * |
sdbd, |
|
|
simpledb_range_t * |
rangedp, |
|
|
void ** |
kdata, |
|
|
uint32_t * |
ksize, |
|
|
void ** |
vdata, |
|
|
uint32_t * |
vsize, |
|
|
int |
direction |
|
) |
| |
◆ simpledb_move_top_range()
◆ simpledb_move_bottom_range()
◆ simpledb_move_in_range()
◆ simpledb_del_in_range()
◆ simpledb_wait_release()