Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
teodb.h
Go to the documentation of this file.
1 
10 #ifndef TEODB_H
11 #define TEODB_H
12 
13 #include "utils/string_arr.h"
14 
18 typedef struct ksnTDBClass {
19 
20  void *ke;
21  char* defNameSpace;
22  pblKeyFile_t* k;
23 
24 } ksnTDBClass;
25 
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 ksnTDBClass *ksnTDBinit(void *ke);
32 void ksnTDBdestroy(ksnTDBClass *kf);
33 
34 void ksnTDBnamespaceSet(ksnTDBClass *kf, const char* ns);
36 void ksnTDBnamespaceRemove(ksnTDBClass *kf, const char* ns);
37 
38 void *ksnTDBgetStr(ksnTDBClass *kf, const char *key, size_t *data_len);
39 void *ksnTDBget(ksnTDBClass *kf, const void *key, size_t key_len,
40  size_t *data_len);
41 int ksnTDBsetStr(ksnTDBClass *kf, const char *key, void *data, size_t data_len);
42 int ksnTDBset(ksnTDBClass *kf, const void *key, size_t key_len, void *data,
43  size_t data_len);
44 int ksnTDBdeleteStr(ksnTDBClass *kf, const char *key);
45 int ksnTDBdelete(ksnTDBClass *kf, const void *key, size_t key_len);
46 
47 void *ksnTDBgetNsStr(ksnTDBClass *kf, const char *ns, const char *key,
48  size_t *data_len);
49 void *ksnTDBgetNs(ksnTDBClass *kf, const char *ns, const void *key,
50  size_t key_len, size_t *data_len);
51 int ksnTDBsetNsStr(ksnTDBClass *kf, const char *ns, const char *key,
52  void *data, size_t data_len);
53 int ksnTDBsetNs(ksnTDBClass *kf, const char *ns, const void *key,
54  size_t key_len, void *data, size_t data_len);
55 int ksnTDBdeleteNsStr(ksnTDBClass *kf, const char *ns, const char *key);
56 int ksnTDBdeleteNs(ksnTDBClass *kf, const char *ns, const void *key,
57  size_t key_len);
58 int ksnTDBkeyList(ksnTDBClass *kf, const char *key, ksnet_stringArr *argv);
59 
60 int ksnTDBflush(ksnTDBClass *kf);
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif /* TEODB_H */
const char data[]
Make it with: gcc -o post-callback post-callback.c -lcurl.
Definition: post-callback.c:23
char * ksnTDBnamespaceGet(ksnTDBClass *kf)
Get current namespace.
Definition: src/modules/teodb.c:115
int ksnTDBsetNsStr(ksnTDBClass *kf, const char *ns, const char *key, void *data, size_t data_len)
Add (insert or update) data by string key to namespace.
Definition: src/modules/teodb.c:340
int ksnTDBdelete(ksnTDBClass *kf, const void *key, size_t key_len)
Delete all records with key.
Definition: src/modules/teodb.c:272
int ksnTDBdeleteNsStr(ksnTDBClass *kf, const char *ns, const char *key)
Delete all records with key.
Definition: src/modules/teodb.c:379
void ksnTDBnamespaceRemove(ksnTDBClass *kf, const char *ns)
Remove namespace and all it contains.
Definition: src/modules/teodb.c:126
int ksnTDBdeleteStr(ksnTDBClass *kf, const char *key)
Delete all records with string key.
Definition: src/modules/teodb.c:258
int ksnTDBset(ksnTDBClass *kf, const void *key, size_t key_len, void *data, size_t data_len)
Add (insert or update) data by key to default namespace.
Definition: src/modules/teodb.c:224
File: teodb.h Author: Kirill Scherba kirill@scherba.ru
Definition: teodb.h:18
int ksnTDBflush(ksnTDBClass *kf)
Flush a key file.
Definition: src/modules/teodb.c:139
int ksnTDBdeleteNs(ksnTDBClass *kf, const char *ns, const void *key, size_t key_len)
Delete all records with key.
Definition: src/modules/teodb.c:394
void ksnTDBnamespaceSet(ksnTDBClass *kf, const char *ns)
Set current namespace.
Definition: src/modules/teodb.c:74
void * ksnTDBgetNsStr(ksnTDBClass *kf, const char *ns, const char *key, size_t *data_len)
Get data by string key from namespace.
Definition: src/modules/teodb.c:300
#define ke
char ** ksnet_stringArr
Definition: string_arr.h:11
int ksnTDBsetNs(ksnTDBClass *kf, const char *ns, const void *key, size_t key_len, void *data, size_t data_len)
Add (insert or update) data by key to namespace.
Definition: src/modules/teodb.c:358
int ksnTDBkeyList(ksnTDBClass *kf, const char *key, ksnet_stringArr *argv)
Get list of keys //.
Definition: src/modules/teodb.c:415
struct ksnTDBClass ksnTDBClass
File: teodb.h Author: Kirill Scherba kirill@scherba.ru
ksnTDBClass * ksnTDBinit(void *ke)
Initialize PBL KeyFile module.
Definition: src/modules/teodb.c:35
void ksnTDBdestroy(ksnTDBClass *kf)
Destroy PBL KeyFile module.
Definition: src/modules/teodb.c:50
pblKeyFile_t * k
Opened key file or NULL;.
Definition: teodb.h:22
int ksnTDBsetStr(ksnTDBClass *kf, const char *key, void *data, size_t data_len)
Add (insert or update) data by string key to default namespace.
Definition: src/modules/teodb.c:207
void * ksnTDBgetStr(ksnTDBClass *kf, const char *key, size_t *data_len)
Get data by string key from default namespace.
Definition: src/modules/teodb.c:153
void * ksnTDBget(ksnTDBClass *kf, const void *key, size_t key_len, size_t *data_len)
Get data by string key from default namespace.
Definition: src/modules/teodb.c:169
char * defNameSpace
Default namespace.
Definition: teodb.h:21
void * ksnTDBgetNs(ksnTDBClass *kf, const char *ns, const void *key, size_t key_len, size_t *data_len)
Get data by key from namespace.
Definition: src/modules/teodb.c:317
void * ke
Pointer to the ksnEvMgrClass.
Definition: teodb.h:20