Data Structures | |
struct | _Key |
The private Key struct. More... | |
struct | _KeySet |
The private KeySet structure. More... | |
Defines | |
#define | KEY_METAINFO_SIZE(k) ((unsigned int)&(k->recordSize) - (unsigned int)k) |
Macro to calculates the real size in bytes of the metainfo of the Key struct. | |
Enumerations | |
enum | KDBBackendMethod { KDB_BE_OPEN = 1, KDB_BE_CLOSE = 1<<1, KDB_BE_STATKEY = 1<<2, KDB_BE_GETKEY = 1<<3, KDB_BE_SETKEY = 1<<4, KDB_BE_SETKEYS = 1<<5, KDB_BE_RENAME = 1<<6, KDB_BE_REMOVEKEY = 1<<7, KDB_BE_GETCHILD = 1<<8, KDB_BE_MONITORKEY = 1<<9, KDB_BE_MONITORKEYS = 1<<10, KDB_BE_END = 0 } |
Switches to denote the backend methods. More... | |
Functions | |
uint32_t | kdbMonitorKeys_default (KDBHandle handle, KeySet *interests, uint32_t diffMask, unsigned long iterations, unsigned sleeptime) |
A high level, probably inefficient, implementation for the kdbMonitorKeys() method. | |
void * | kdbhSetBackendData (KDBHandle handle, void *data) |
Set some backend-specific data in the handle . | |
void * | kdbhGetBackendData (const KDBHandle handle) |
Get the previously set backend-specific data from the handle . | |
pid_t | kdbhGetPID (const KDBHandle handle) |
pid_t | kdbhSetPID (KDBHandle handle, pid_t pid) |
Set handle's internal pid to pid . | |
pthread_t | kdbhGetTID (const KDBHandle handle) |
pthread_t | kdbhSetTID (KDBHandle handle, pthread_t tid) |
Set handle's internal tid to tid . | |
uid_t | kdbhGetUID (const KDBHandle handle) |
uid_t | kdbhSetUID (KDBHandle handle, uid_t uid) |
Set handle's internal uid to uid . | |
gid_t | kdbhGetGID (const KDBHandle handle) |
gid_t | kdbhSetGID (KDBHandle handle, gid_t gid) |
Set handle's internal gid to gid . | |
mode_t | kdbhGetUMask (const KDBHandle handle) |
mode_t | kdbhSetUMask (KDBHandle handle, mode_t umask) |
Set handle's internal umask to umask . | |
char * | kdbhGetUserName (const KDBHandle handle) |
char * | kdbhSetUserName (KDBHandle handle, char *userName) |
Set handle's internal user name to userName . | |
char * | kdbhSetBackendName (KDBHandle handle, char *backendName) |
Set handle's internal backend name to backendName . | |
char * | kdbhGetBackendName (KDBHandle handle) |
KDBBackend * | kdbBackendExport (const char *backendName,...) |
This function must be called by a backend's kdbBackendFactory() to define the backend's methods that will be exported. | |
ssize_t | unencode (char *encoded, void *returned) |
Unencodes a buffer of ASCII hexadecimal values into a byte stream. | |
int | kdbNeedsUTF8Conversion () |
Checks if UTF-8 conversion is needed in current context. | |
int | UTF8Engine (int direction, char **string, size_t *inputOutputByteSize) |
Converts string to (direction = UTF8_TO ) and from (direction = UTF8_FROM ) UTF-8. | |
ssize_t | encode (void *unencoded, size_t size, char *returned) |
Encodes a buffer of data onto hexadecimal ASCII. | |
int | kdbRename_default (KDBHandle handle, Key *key, const char *newName) |
An inefficient implementation for the kdbRename() method. | |
int | kdbSetKeys_default (KDBHandle handle, KeySet *ks) |
A probably inefficient implementation for the kdbSetKeys() method. | |
uint32_t | kdbMonitorKey_default (KDBHandle handle, Key *interest, uint32_t diffMask, unsigned long iterations, unsigned sleeptime) |
A high level, probably inefficient, implementation for the kdbMonitorKey() method. | |
size_t | strblen (const char *s) |
Calculates the lenght in bytes of a string. | |
int | kdbOpen_backend (KDBHandle *handle) |
Initialize the backend. | |
int | kdbClose_backend (KDBHandle *handle) |
All finalization logic of the backend should go here. | |
int | kdbStatKey_backend (KDBHandle handle, Key *key) |
Implementation for kdbStatKey() method. | |
int | kdbGetKey_backend (KDBHandle handle, Key *key) |
Implementation for kdbGetKey() method. | |
int | kdbSetKey_backend (KDBHandle handle, Key *key) |
Implementation for kdbSetKey() method. | |
int | kdbRename_backend (KDBHandle handle, Key *key, const char *newName) |
Implementation for kdbRename() method. | |
int | kdbRemoveKey_backend (KDBHandle handle, const Key *key) |
Implementation for kdbRemoveKey() method. | |
ssize_t | kdbGetKeyChildKeys_backend (KDBHandle handle, const Key *parentKey, KeySet *returned, unsigned long options) |
Implementation for kdbGetKeyChildKeys() method. | |
int | kdbSetKeys_backend (KDBHandle handle, KeySet *ks) |
Implementation for kdbSetKeys() method. | |
uint32_t | kdbMonitorKeys_backend (KDBHandle handle, KeySet *interests, uint32_t diffMask, unsigned long iterations, unsigned sleep) |
The implementation of this method is optional. | |
uint32_t | kdbMonitorKey_backend (KDBHandle handle, Key *interest, uint32_t diffMask, unsigned long iterations, unsigned sleep) |
The implementation of this method is optional. | |
KDBBackend * | kdbBackendFactory (void) |
All KeyDB methods implemented by the backend can have random names, except kdbBackendFactory(). |
Since version 0.4.9, Elektra can dynamically load different key storage backends. Fast jump to kdbBackendExport() to see an example of a backend implementation.
The methods of class KeyDB that are backend dependent are kdbOpen(), kdbClose(), kdbGetKey(), kdbSetKey(), kdbStatKey(), kdbGetKeyChildKeys(), kdbRemove(), kdbRename(). So a backend must reimplement these methods.
And methods that have a builtin default high-level inefficient implementation are kdbSetKeys(), kdbMonitorKey(), kdbMonitorKeys(). So it is suggested to reimplement them too, to make them more efficient.
The other KeyDB methods are higher level. They use the above methods to do their job, and generally don't have to be reimplemented for a different backend.
The backend must implement a method with name kdbBackendFactory() and no parameters, that is responsible of exporting the implementations of libelektra.so backend dependent methods.
The backend implementation must:
#include <kdbbackend.h>
Better than that, a skeleton of a backend implementation is provided inside Elektra development package or source code tree, and should be used as a base for the implementation.
An elektrified program will use the backend defined by environment variable $KDB_BACKEND, The backend library is dynamically loaded when the program calls kdbOpen(), unless if the program is security/authentication/setuid related, in which it probably uses the more secure kdbOpenDefault() which completely ignores the $KDB_BACKEND environment and will use the "default"
named backend defined by the sysadmin. Look at /lib/libelektra-default
.so link to see the default backend for your system.
Elektra source code or development package provides a skeleton and Makefile to implement a backend, and we'll document this skeleton here.
A backend is defined by a single name, for example BACKENDNAME
, that causes libelektra.so look for its library as libelektra-BACKENDNAME.so
.
Elektra source code tree includes several backend implementations (http://germane-software.com/repositories/elektra/trunk/src/backends) that can also be used as a reference.
#define KEY_METAINFO_SIZE | ( | k | ) | ((unsigned int)&(k->recordSize) - (unsigned int)k) |
Macro to calculates the real size in bytes of the metainfo of the Key struct.
The metainfo part of the struct is composed by _Key::type, _Key::uid, _Key::gid, _Key::access, _Key::atime, _Key::mtime, _Key::ctime, _Key::commentSize, _Key::dataSize.
This macro is usefull in Key serialization and de-serialization methods of your backend.
Definition at line 186 of file kdbprivate.h.
Referenced by keySerialize(), and keyUnserialize().
enum KDBBackendMethod |
Switches to denote the backend methods.
Used in calls to kdbBackendExport().
KDB_BE_OPEN | Next arg is backend for kdbOpen() |
KDB_BE_CLOSE | Next arg is backend for kdbClose() |
KDB_BE_STATKEY | Next arg is backend for kdbStatKey() |
KDB_BE_GETKEY | Next arg is backend for kdbGetKey() |
KDB_BE_SETKEY | Next arg is backend for kdbSetKey() |
KDB_BE_SETKEYS | Next arg is backend for kdbSetKeys() |
KDB_BE_RENAME | Next arg is backend for kdbRename() |
KDB_BE_REMOVEKEY | Next arg is backend for kdbRemoveKey() |
KDB_BE_GETCHILD | Next arg is backend for kdbGetKeyChildKeys() |
KDB_BE_MONITORKEY | Next arg is backend for kdbMonitorKey() |
KDB_BE_MONITORKEYS | Next arg is backend for kdbMonitorKeys() |
KDB_BE_END | End of arguments |
Definition at line 49 of file kdbbackend.h.
uint32_t kdbMonitorKeys_default | ( | KDBHandle | handle, | |
KeySet * | interests, | |||
uint32_t | diffMask, | |||
unsigned long | iterations, | |||
unsigned | sleeptime | |||
) |
A high level, probably inefficient, implementation for the kdbMonitorKeys() method.
If a backend doesn't want to reimplement this method, this implementation can be used.
-1 on failure and errno
is propagated
Definition at line 846 of file libelektra/kdb.c.
References kdbMonitorKey(), ksCurrent(), ksNext(), and _KeySet::size.
Referenced by kdbMonitorKeys().
void* kdbhSetBackendData | ( | KDBHandle | handle, | |
void * | data | |||
) |
Set some backend-specific data
in the handle
.
This is useful when your backend have a backend-global context or environment.
data | a pointer to general data specific to a backend implementation. |
Definition at line 1022 of file libelektra/kdb.c.
void* kdbhGetBackendData | ( | const KDBHandle | handle | ) |
Get the previously set backend-specific data
from the handle
.
This is useful when your backend have a backend-global context or environment.
This method will probably be called everytime one of your kdb*() implementations is called. And if you change something inside the data, you don't have to kdbhSetBackendData() again, bacause you are manipulating your data, and not a copy of it.
struct MyBackendData { int context1; int context2; }; int kdbOpen_mybackend(KDBHandle *handle) { struct MyBackendData *context; context=malloc(sizeof(struct MyBackendData)); // a random initialization... context->context1=1; context->context2=2; kdbhSetBackendData(*handle,context); return 0; } int kdbGetKey_maybackend(KDBHandle handle) { struct MyBackendData *context; context=kdbhGetBackendData(handle); // No do something with the context . . . return 0; }
int kdbClose_mybackend(KDBHandle &handle) { struct MyBackendData *context; context=kdbhGetBackendData(handle); free(context); return 0; }
Definition at line 1088 of file libelektra/kdb.c.
pid_t kdbhGetPID | ( | const KDBHandle | handle | ) |
handle
Definition at line 1096 of file libelektra/kdb.c.
pid_t kdbhSetPID | ( | KDBHandle | handle, | |
pid_t | pid | |||
) |
Set handle's
internal pid to pid
.
handle
Definition at line 1105 of file libelektra/kdb.c.
pthread_t kdbhGetTID | ( | const KDBHandle | handle | ) |
handle
Definition at line 1113 of file libelektra/kdb.c.
pthread_t kdbhSetTID | ( | KDBHandle | handle, | |
pthread_t | tid | |||
) |
Set handle's
internal tid to tid
.
handle
Definition at line 1122 of file libelektra/kdb.c.
uid_t kdbhGetUID | ( | const KDBHandle | handle | ) |
handle
Definition at line 1131 of file libelektra/kdb.c.
uid_t kdbhSetUID | ( | KDBHandle | handle, | |
uid_t | uid | |||
) |
Set handle's
internal uid to uid
.
handle
Definition at line 1140 of file libelektra/kdb.c.
gid_t kdbhGetGID | ( | const KDBHandle | handle | ) |
handle
Definition at line 1148 of file libelektra/kdb.c.
gid_t kdbhSetGID | ( | KDBHandle | handle, | |
gid_t | gid | |||
) |
Set handle's
internal gid to gid
.
handle
Definition at line 1157 of file libelektra/kdb.c.
mode_t kdbhGetUMask | ( | const KDBHandle | handle | ) |
handle
Definition at line 1165 of file libelektra/kdb.c.
mode_t kdbhSetUMask | ( | KDBHandle | handle, | |
mode_t | umask | |||
) |
Set handle's
internal umask to umask
.
handle
Definition at line 1174 of file libelektra/kdb.c.
char* kdbhGetUserName | ( | const KDBHandle | handle | ) |
handle
. Remember that on some systems many different user names can have same UID. Definition at line 1183 of file libelektra/kdb.c.
char* kdbhSetUserName | ( | KDBHandle | handle, | |
char * | userName | |||
) |
Set handle's
internal user name to userName
.
handle
. Remember that on some systems many different user names can have same UID. Definition at line 1193 of file libelektra/kdb.c.
References strblen().
Referenced by kdbOpenBackend().
char* kdbhSetBackendName | ( | KDBHandle | handle, | |
char * | backendName | |||
) |
Set handle's
internal backend name to backendName
.
This method should not be used by regular applications.
backendName
after being set in handle
. Definition at line 1218 of file libelektra/kdb.c.
References strblen().
char* kdbhGetBackendName | ( | KDBHandle | handle | ) |
KDBBackend* kdbBackendExport | ( | const char * | backendName, | |
... | ||||
) |
This function must be called by a backend's kdbBackendFactory() to define the backend's methods that will be exported.
Its job is to organize a libelektra.so's table of virtual methods with pointers to backend dependent methods.
The order and number of arguments are flexible (as keyNew()) to let libelektra.so evolve without breaking its ABI compatibility with backends. So for each method a backend must export, there is a flag defined by KDBBackendMethod. Each flag tells kdbBackendExport() which method comes next. A backend can have no implementation for a few methods that have default inefficient high-level implementations -- kdbSetKeys(), kdbMonitorKey(), kdbMonitorKeys() -- and to use these defaults, simply don't pass anything to kdbBackendExport() about them.
The last parameter must be KDB_BE_END
.
// // This is my implementation for an Elektra backend storage. // // To compile it: // $ cc -fpic -o myback.o -c myback.c // $ cc -shared -fpic -o libelektra-myback.so myback.o // // To use it: // $ export KDB_BACKEND=myback // $ kdb ls -Rv // #include <kdbbackend.h> #define BACKENDNAME "my_elektra_backend_implementation" int kdbOpen_backend(KDBHandle *handle) {...} int kdbClose_backend(KDBHandle *handle) {...} int kdbGetKey_backend(KDBHandle handle, Key *key) {...} int kdbSetKey_backend(KDBHandle handle, Key *key) {...} ... etc implementations of other methods ... KDBBackend *kdbBackendFactory(void) { return kdbBackendExport(BACKENDNAME, KDB_BE_OPEN, &kdbOpen_backend, KDB_BE_CLOSE, &kdbClose_backend, KDB_BE_GETKEY, &kdbGetKey_backend, KDB_BE_SETKEY, &kdbSetKey_backend, KDB_BE_STATKEY, &kdbStatKey_backend, KDB_BE_RENAME, &kdbRename_backend, KDB_BE_REMOVEKEY, &kdbRemoveKey_backend, KDB_BE_GETCHILD, &kdbGetKeyChildKeys_backend, KDB_BE_SETKEYS, &kdbSetKeys_backend, KDB_BE_MONITORKEY, &kdbMonitorKey_backend, KDB_BE_MONITORKEYS, &kdbMonitorKeys_backend, KDB_BE_END); }
backendName | a simple name for this backend |
Definition at line 1361 of file libelektra/kdb.c.
References KDB_BE_CLOSE, KDB_BE_GETCHILD, KDB_BE_GETKEY, KDB_BE_MONITORKEY, KDB_BE_MONITORKEYS, KDB_BE_OPEN, KDB_BE_REMOVEKEY, KDB_BE_RENAME, KDB_BE_SETKEY, KDB_BE_SETKEYS, KDB_BE_STATKEY, and strblen().
Referenced by kdbBackendFactory().
ssize_t unencode | ( | char * | encoded, | |
void * | returned | |||
) |
Unencodes a buffer of ASCII hexadecimal values into a byte stream.
The allowed format for the hexadecimal values is just a stream of pairs of plain hex-digits, all together or space-separated.
The returned
data won't be bigger than half the size of the source encoded
data.
encoded | the source of ASCII hexadecimal digits. | |
returned | preallocated destination for the unencoded data. |
-1 on failure and errno
is set to KDB_RET_TYPEMISMATCH
Definition at line 147 of file backendhelpers.c.
References KDB_RET_TYPEMISMATCH.
int kdbNeedsUTF8Conversion | ( | ) |
Checks if UTF-8 conversion is needed in current context.
if nl_langinfo() is not available, no conversion is ever needed. If iconv usage is disabled there is no need to check if we need to convert. Furthermore, some systems have nl_langinfo(), but lacks ability to get CODESET through it. Look at the comments by the UTF8Engine() function for more information.
anything else if needed
Definition at line 194 of file backendhelpers.c.
Referenced by UTF8Engine().
int UTF8Engine | ( | int | direction, | |
char ** | string, | |||
size_t * | inputOutputByteSize | |||
) |
Converts string to (direction
= UTF8_TO
) and from (direction
= UTF8_FROM
) UTF-8.
Since Elektra provides portability for key names and string values between different codesets, you should use this helper in your backend to convert to and from universal UTF-8 strings, when storing key names, values and comments.
If iconv() or nl_langinfo() is not available on your system, or if iconv() usage is disabled (--disable-iconv on build time) simply return 0 immediately.
direction | must be UTF8_TO (convert from current non-UTF-8 to UTF-8) or UTF8_FROM (convert from UTF-8 to current non-UTF-8) | |
string | before the call: the string to be converted; after the call: reallocated to carry the converted string | |
inputOutputByteSize | before the call: the size of the string including leading NULL; after the call: the size of the converted string including leading NULL |
-1 on failure and errno
is propagated
Definition at line 228 of file backendhelpers.c.
References kdbNeedsUTF8Conversion().
ssize_t encode | ( | void * | unencoded, | |
size_t | size, | |||
char * | returned | |||
) |
Encodes a buffer of data onto hexadecimal ASCII.
The resulting data is made up of pairs of ASCII hex-digits, space- and newline-separated. This is the counterpart of unencode().
The returned
must allocated prior you call this function and won't be bigger than 3 times the size of the source unencoded
+ 1 byte.
unencoded | the source buffer. | |
size | the size of the source buffer in bytes. | |
returned | the preallocated destination for the ASCII-encoded data. |
Definition at line 304 of file backendhelpers.c.
Referenced by keyToStreamBasename().
int kdbRename_default | ( | KDBHandle | handle, | |
Key * | key, | |||
const char * | newName | |||
) |
An inefficient implementation for the kdbRename() method.
If backend doesn't want to reimplement this method, this implementation can be used, in which kdbSetKey()/kdbRemoveKey() will be called for the key.
-1 on failure and errno
is propagated
Definition at line 348 of file backendhelpers.c.
References kdbRemoveKey(), kdbSetKey(), KEY_SWITCH_END, keyDel(), keyDup(), keyNew(), and keySetName().
Referenced by kdbRename().
int kdbSetKeys_default | ( | KDBHandle | handle, | |
KeySet * | ks | |||
) |
A probably inefficient implementation for the kdbSetKeys() method.
If a backend doesn't want to reimplement this method, this implementation can be used, in which kdbSetKey() will be called for each Key object contained in ks
.
If some error occurs, kdbSetKeys_default() will stop. In this situation the KeySet internal cursor is left on the key that generated the error.
-1 on failure and errno
is propagated
Definition at line 395 of file backendhelpers.c.
References kdbSetKey(), keyNeedsSync(), ksCurrent(), and ksNext().
Referenced by kdbSetKeys().
uint32_t kdbMonitorKey_default | ( | KDBHandle | handle, | |
Key * | interest, | |||
uint32_t | diffMask, | |||
unsigned long | iterations, | |||
unsigned | sleeptime | |||
) |
A high level, probably inefficient, implementation for the kdbMonitorKey() method.
If a backend doesn't want to reimplement this method, this implementation can be used.
Definition at line 422 of file backendhelpers.c.
References KDB_RET_NOCRED, KDB_RET_NOTFOUND, kdbGetKey(), KEY_SWITCH_FLAG, KEY_SWITCH_NEEDSYNC, keyCompare(), keyDel(), keyDup(), keyGetNameSize(), and keyNew().
Referenced by kdbMonitorKey().
size_t strblen | ( | const char * | s | ) |
Calculates the lenght in bytes of a string.
This function differs from strlen() because it is Unicode and multibyte chars safe. While strlen() counts characters and ignores the final NULL, strblen() count bytes including the ending NULL.
Definition at line 77 of file key.c.
Referenced by commandSet(), kdbBackendExport(), kdbGetKeyByParent(), kdbGetKeyByParentKey(), kdbGetValueByParent(), kdbhSetBackendName(), kdbhSetUserName(), kdbSetValueByParent(), keyAddBaseName(), keyGetComment(), keyGetCommentSize(), keyGetFullName(), keyGetFullNameSize(), keyGetFullRootNameSize(), keyGetName(), keyGetNameSize(), keyGetOwner(), keyGetOwnerSize(), keySetBaseName(), keySetComment(), keySetLink(), keySetName(), keySetOwner(), keySetString(), keyToStreamBasename(), ksGetCommonParentName(), ksLookupByName(), ksLookupByValue(), and parseCommandLine().
int kdbOpen_backend | ( | KDBHandle * | handle | ) |
Initialize the backend.
This is the first method kdbOpenBackend() calls after dynamically loading the backend library.
This method is responsible of:
Definition at line 130 of file template.c.
Referenced by kdbBackendFactory().
int kdbClose_backend | ( | KDBHandle * | handle | ) |
All finalization logic of the backend should go here.
Called prior to unloading the backend dynamic module. Should ensure that no functions or static/global variables from the module will ever be accessed again. Should free any memory that the backend no longer needs. After this call, libelektra.so will unload the backend library, so this is the point to shutdown any affairs with the storage.
Definition at line 151 of file template.c.
Referenced by kdbBackendFactory().
int kdbStatKey_backend | ( | KDBHandle | handle, | |
Key * | key | |||
) |
Implementation for kdbStatKey() method.
This method is responsible of:
key->name's
metadatakey
struct with its metadata
Definition at line 168 of file template.c.
Referenced by kdbBackendFactory().
int kdbGetKey_backend | ( | KDBHandle | handle, | |
Key * | key | |||
) |
Implementation for kdbGetKey() method.
This method is responsible of:
key->name's
value and metadatakey
struct with its value and metadata
Definition at line 184 of file template.c.
Referenced by kdbBackendFactory().
int kdbSetKey_backend | ( | KDBHandle | handle, | |
Key * | key | |||
) |
Implementation for kdbSetKey() method.
This method is responsible of:
key->name
on persistent storagekey
to store them in the backend storagekey
struct with its value and metadata
Definition at line 203 of file template.c.
Referenced by kdbBackendFactory().
int kdbRename_backend | ( | KDBHandle | handle, | |
Key * | key, | |||
const char * | newName | |||
) |
Implementation for kdbRename() method.
Definition at line 216 of file template.c.
Referenced by kdbBackendFactory().
int kdbRemoveKey_backend | ( | KDBHandle | handle, | |
const Key * | key | |||
) |
Implementation for kdbRemoveKey() method.
Definition at line 230 of file template.c.
Referenced by kdbBackendFactory().
ssize_t kdbGetKeyChildKeys_backend | ( | KDBHandle | handle, | |
const Key * | parentKey, | |||
KeySet * | returned, | |||
unsigned long | options | |||
) |
Implementation for kdbGetKeyChildKeys() method.
Definition at line 244 of file template.c.
References _KeySet::size.
Referenced by kdbBackendFactory().
int kdbSetKeys_backend | ( | KDBHandle | handle, | |
KeySet * | ks | |||
) |
Implementation for kdbSetKeys() method.
The implementation of this method is optional, and a builtin, probablly inefficient implementation can be explicitly used when exporting the backend with kdbBackendExport(), using kdbSetKeys_default().
Definition at line 260 of file template.c.
uint32_t kdbMonitorKeys_backend | ( | KDBHandle | handle, | |
KeySet * | interests, | |||
uint32_t | diffMask, | |||
unsigned long | iterations, | |||
unsigned | sleep | |||
) |
The implementation of this method is optional.
The builtin inefficient implementation will use kdbGetKey() for each key inside interests
.
Definition at line 274 of file template.c.
Referenced by kdbBackendFactory().
uint32_t kdbMonitorKey_backend | ( | KDBHandle | handle, | |
Key * | interest, | |||
uint32_t | diffMask, | |||
unsigned long | iterations, | |||
unsigned | sleep | |||
) |
The implementation of this method is optional.
The builtin inefficient implementation will use kdbGetKey() for interest
.
Definition at line 290 of file template.c.
Referenced by kdbBackendFactory().
KDBBackend* kdbBackendFactory | ( | void | ) |
All KeyDB methods implemented by the backend can have random names, except kdbBackendFactory().
This is the single symbol that will be looked up when loading the backend, and the first method of the backend implementation that will be called.
Its purpose is to "publish" the exported methods for libelektra.so. The implementation inside the provided skeleton is usually enough: simply call kdbBackendExport() with all methods that must be exported.
Definition at line 311 of file template.c.
References KDB_BE_CLOSE, KDB_BE_END, KDB_BE_GETCHILD, KDB_BE_GETKEY, KDB_BE_MONITORKEY, KDB_BE_MONITORKEYS, KDB_BE_OPEN, KDB_BE_REMOVEKEY, KDB_BE_RENAME, KDB_BE_SETKEY, KDB_BE_STATKEY, kdbBackendExport(), kdbClose_backend(), kdbGetKey_backend(), kdbGetKeyChildKeys_backend(), kdbMonitorKey_backend(), kdbMonitorKeys_backend(), kdbOpen_backend(), kdbRemoveKey_backend(), kdbRename_backend(), kdbSetKey_backend(), and kdbStatKey_backend().
Referenced by kdbOpenBackend().