Enumerations | |
enum | KDBErr { KDB_RET_OK = 0, KDB_RET_NULLKEY = EINVAL, KDB_RET_UNINITIALIZED = EINVAL, KDB_RET_NOKEY = ENOMSG, KDB_RET_NODATA = ENOMSG, KDB_RET_NOGROUP = ENOMSG, KDB_RET_NODESC = ENOMSG, KDB_RET_NODOMAIN = ENOMSG, KDB_RET_NOCRED = EACCES, KDB_RET_NOTIME = ENOMSG, KDB_RET_TRUNC = ENOBUFS, KDB_RET_TYPEMISMATCH = EILSEQ, KDB_RET_INVALIDKEY = EAFNOSUPPORT, KDB_RET_NOTFOUND = ENOENT } |
enum | KDBOptions { KDB_O_RECURSIVE = 1, KDB_O_DIR = 1<<1, KDB_O_NOVALUE = 1<<2 , KDB_O_STATONLY = 1<<4, KDB_O_INACTIVE = 1<<5, KDB_O_SORT = 1<<6, KDB_O_NFOLLOWLINK = 1<<7, KDB_O_CONDENSED = 1<<8, KDB_O_NUMBERS = 1<<9, KDB_O_XMLHEADERS = 1<<10 } |
Functions | |
int | kdbOpen () |
int | kdbClose () |
int | kdbGetValue (const char *keyname, char *returned, size_t maxSize) |
int | kdbSetValue (const char *keyname, const char *value) |
int | kdbGetValueByParent (const char *parentName, const char *baseName, char *returned, size_t maxSize) |
int | kdbSetValueByParent (const char *parentName, const char *baseName, const char *value) |
int | kdbGetKeyByParent (const char *parentName, const char *baseName, Key *returned) |
int | kdbGetKeyByParentKey (const Key *parent, const char *baseName, Key *returned) |
int | kdbGetChildKeys (const char *parentName, KeySet *returned, unsigned long options) |
int | kdbGetRootKeys (KeySet *returned) |
int | kdbStatKey (Key *key) |
int | kdbGetKey (Key *key) |
int | kdbSetKeys (KeySet *ks) |
int | kdbSetKey (Key *key) |
int | kdbRemove (const char *keyName) |
int | kdbLink (const char *oldPath, const char *newKeyName) |
u_int32_t | kdbMonitorKeys (KeySet *interests, u_int32_t diffMask, unsigned long iterations, unsigned sleep) |
u_int32_t | kdbMonitorKey (Key *interest, u_int32_t diffMask, unsigned long iterations, unsigned sleep) |
Variables | |
enum KDBOptions | kdbOption |
To use them:
#include <kdb.h>
|
|
Options to change the default behavior of some methods. These options should be ORed.
|
|
Closes a session with the Key database. This is the counterpart of kdbOpen().
Definition at line 106 of file localkdb.c. |
|
Retrieve a number of inter-related keys in one shot. This is one of the most practicall methods of the library. Returns a KeySet with all retrieved keys. So if your application keys live bellow Option can be any of the following, ORed:
Definition at line 1040 of file localkdb.c. References KDB_O_DIR, KDB_O_INACTIVE, KDB_O_NFOLLOWLINK, KDB_O_NOVALUE, KDB_O_RECURSIVE, KDB_O_SORT, KDB_O_STATONLY, KDB_RET_NOCRED, kdbGetKey(), kdbStatKey(), keyClose(), keyGetFullName(), keyGetFullNameSize(), keyInit(), keyIsLink(), keySetName(), ksAppend(), ksAppendKeys(), and ksInit(). Referenced by commandEdit(), and commandList(). |
|
Fully retrieves the passed
Definition at line 1258 of file localkdb.c. References KEY_FLAG_NEEDSYNC, and keyIsDir(). Referenced by commandEdit(), commandGet(), commandList(), commandMonitor(), commandSet(), kdbGetChildKeys(), kdbGetKeyByParent(), kdbGetKeyByParentKey(), kdbGetRootKeys(), kdbGetValue(), kdbMonitorKey(), and kdbSetValue(). |
|
Given a parent key name plus a basename, returns the key. So here you'll provide something like
Definition at line 932 of file localkdb.c. References kdbGetKey(), and keySetName(). |
|
Similar to previous, provided for convenience.
Definition at line 951 of file localkdb.c. References kdbGetKey(), keyGetFullName(), keyGetFullNameSize(), and keySetName(). |
|
Returns a KeySet with all root keys currently recognized. Currently, the
Definition at line 1180 of file localkdb.c. References kdbGetKey(), keyInit(), keySetName(), ksAppend(), and ksInsert(). Referenced by commandList(). |
|
A high-level method to get a key value, by key name. This method is valid only for string keys. You should use other methods to get non-string keys.
Definition at line 817 of file localkdb.c. References kdbGetKey(), keyClose(), keyGetString(), keyInit(), and keySetName(). Referenced by kdbGetValueByParent(). |
|
Fills the
Definition at line 889 of file localkdb.c. References kdbGetValue(). |
|
Create a link key that points to other key.
Definition at line 1491 of file localkdb.c. References kdbSetKey(), keyClose(), keyInit(), and keySetName(). Referenced by commandLink(). |
|
Monitor a key change. This method will block your program until one of the folowing happens:
If
If
If you don't have access rights to
If something from
Definition at line 1639 of file localkdb.c. References KDB_RET_NOCRED, KDB_RET_NOTFOUND, kdbGetKey(), KEY_FLAG_FLAG, KEY_FLAG_NEEDSYNC, keyClose(), keyCompare(), keyDup(), keyGetNameSize(), and keyInit(). Referenced by commandMonitor(), and kdbMonitorKeys(). |
|
Monitor a KeySet for some key change.
This method will scan the You may check the return code to see if some key changed, and get the updated key using ksCurrent().
Definition at line 1569 of file localkdb.c. References kdbMonitorKey(), ksCurrent(), and ksNext(). |
|
Opens a session with the Key database By now it does nothing. This might change in the future, so it's good practice to always call kdbOpen() before using the Elektra database.
Definition at line 95 of file localkdb.c. |
|
Remove a key from the backend storage. This method is not recursive.
Definition at line 1461 of file localkdb.c. References keyClose(), keyInit(), and keySetName(). Referenced by commandEdit(), and commandRemove(). |
|
Commits a key to the backend storage. If failed (see return), the
Definition at line 1330 of file localkdb.c. References KDB_RET_INVALIDKEY, KEY_FLAG_NEEDSYNC, keyClose(), keyGetAccess(), keyGetGID(), keyGetUID(), keyInit(), keyIsDir(), keyIsLink(), and keySetName(). Referenced by commandSet(), kdbLink(), kdbSetKeys(), and kdbSetValue(). |
|
Commits an entire KeySet to the backend storage. Each key is checked with keyNeedsSync() before being actually commited. So only changed keys are updated.
Definition at line 1306 of file localkdb.c. References kdbSetKey(), and keyNeedsSync(). Referenced by commandEdit(), and commandImport(). |
|
A high-level method to set a value to a key, by key name. It will obviously check if key exists first, and keep its metadata. So you'll not loose the precious key comment. This will set a text key. So if the key was previously a binary, etc key, it will be retyped as text.
Definition at line 848 of file localkdb.c. References kdbGetKey(), kdbSetKey(), keyClose(), keySetName(), and keySetString(). Referenced by kdbSetValueByParent(). |
|
Sets the provided
Definition at line 907 of file localkdb.c. References kdbSetValue(). |
|
Retrieves only the meta-info of a key from backend storage. The bahavior may change from backend to backend. In the filesystem backend, it will make only a stat to the key. Info like comments and key data type are not retrieved.
Definition at line 1218 of file localkdb.c. References KEY_FLAG_NEEDSYNC, and keyIsLink(). Referenced by commandList(), and kdbGetChildKeys(). |
|
Options to change the default behavior of some methods. These options should be ORed.
|