-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkdb.h
44 lines (44 loc) · 1.49 KB
/
kdb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
char *str_escape(const char *source);
char *str_unescape(const char *source);
int match_wildcard(const char *pattern, const char *string);
int is_wildcarded(const char* str);
int copyfile(const char *, const char *);
char *get_dbfilename();
char *set_dbfilename(const char* filename);
int db_open();
int db_close();
int kdbinit();
inline int db_add(const char* name, const char* value, int dup);
// Parse str "name=value" and put 'name' to *name and 'value' to *value
int parse_pair(const char* str, char* name, char* value);
int parse_header(char *header);
int db_unserialize(const char *buf);
int db_serialize(int index, char *buf);
int db_read();
int sort_func(const void *pa, const void *pb);
int db_sort();
inline int print_pair(const char* name, const char* value);
int db_set_index(int index, const char *name, const char *value, int dup);
int find_key(const char *key);
int db_set(const char *name, const char* value);
int db_del_index(int index);
/*
md5 = 1 — generate MD5 file
md5 = 0 — do not generate MD5 file
*/
int db_write(int md5);
void print_count(int count);
int import(const char *filename);
int export(const char *filename);
int edit(const char* me);
int rename(const char *oldkey, const char* newkey);
int get(const char *key);
int get1(const char *key);
int isset(const char *key);
int set(const char *str);
// delete with wildcard matching
int del(const char *str);
int sublist(const char *key);
// keylist with wildcard matching
int keylist(const char *key);
int kdbcmd(int argc, char **argv);