45 #ifndef REGIFY_UTIL_KVSTORE_H
46 #define REGIFY_UTIL_KVSTORE_H
65 const char* val,
rusize len);
RUAPI KvStore * ruNewStore(void)
Returns a generic KvStore interface. This function is mainly used by those implementing the KvStore i...
void * ruNullStore
Opaque pointer to a Null KvStore interface.
Definition: kvstore.h:181
void * ruFileStore
Opaque pointer to a File based KvStore interface.
Definition: kvstore.h:135
int32_t(* kvget)(struct KvStore_ *kvs, const char *key, char **val, rusize *len)
KvStore getter function interface.
Definition: kvstore.h:77
RUAPI int32_t ruFileStoreList(KvStore *kvs, const char *key, ruList *result)
Returns a list of keys under the given key.
int32_t(* kvlist)(struct KvStore_ *kvs, const char *key, ruList *list)
KvStore list function interface.
Definition: kvstore.h:88
RUAPI KvStore * ruNewFileStore(const char *folderPath, int32_t *code)
Returns a newly created file system based KvStore object. If there is already store data in the given...
RUAPI int32_t ruNullStoreList(KvStore *kvs, const char *key, ruList *list)
Returns a list of items under given key.
RUAPI void ruFreeStore(void *obj)
Public function to free the given KvStore object.
int32_t(* kvset)(struct KvStore_ *kvs, const char *key, const char *val, rusize len)
KvStore setter function interface.
Definition: kvstore.h:64
struct KvStore_ KvStore
The key/value store interface type. This object holds the kvget, kvlist and kvset methods of an imple...
RUAPI int32_t ruFileStoreGet(KvStore *kvs, const char *key, char **val, rusize *len)
Get the value of key from the given FileStore.
RUAPI int32_t ruValidStore(void *obj)
Checks given object to be a valid KvStore object.
RUAPI KvStore * ruNewNullStore(void)
Returns a newly created NULL based KvStore interface. This keystore silently ignores setters and neve...
RUAPI int32_t ruFileStoreSet(KvStore *kvs, const char *key, const char *val, rusize len)
Set the value of key in the given FileStore.
RUAPI int32_t ruNullStoreGet(KvStore *kvs, const char *key, char **val, rusize *len)
Get the value of key from the given KvStore.
RUAPI int32_t ruNullStoreSet(KvStore *kvs, const char *key, const char *val, rusize len)
Set the value of key in the given FileStore.
void * ruList
Opaque pointer to list object. See List Collection.
Definition: list.h:103
void(* ruFreeFunc)(ptr o)
Signature of a generic free function.
Definition: regify-util.h:363
uintptr_t ru_uint
A pointer sized unsigned integer type for collections like ruMap or ruList.
Definition: regify-util.h:333
size_t rusize
Abstracted version of size_t.
Definition: regify-util.h:338
The key/value store interface type. This object holds the kvget, kvlist and kvset methods of an imple...
Definition: kvstore.h:96
void * ctx
A user defined context that will be passed to all given methods.
Definition: kvstore.h:109
kvlist list
The method that will be called to list data keys.
Definition: kvstore.h:107
kvget get
The method that will be called to retrieve data.
Definition: kvstore.h:105
kvset set
The method that will be called to set data.
Definition: kvstore.h:103