Functions | |
ssize_t | keySetName (Key *key, const char *newName) |
Set a new name to a key. | |
ssize_t | keyAddBaseName (Key *key, const char *baseName) |
Adds baseName to the current key name. | |
ssize_t | keySetBaseName (Key *key, const char *baseName) |
Sets baseName as the new basename for key . | |
ssize_t | keyGetNameSize (const Key *key) |
Bytes needed to store the key name without user domain. | |
ssize_t | keyGetName (const Key *key, char *returnedName, size_t maxSize) |
Get abreviated key name (without user domain name). | |
char * | keyStealName (const Key *key) |
Returns a pointer to the real internal key abreviated name (without user domain name). | |
ssize_t | keyGetFullNameSize (const Key *key) |
Bytes needed to store the key name including user domain. | |
ssize_t | keyGetFullName (const Key *key, char *returnedName, size_t maxSize) |
Get key full name, including the user domain name. | |
int | keyNameIsSystem (const char *keyName) |
Check whether a key name is under the system namespace or not. | |
int | keyNameIsUser (const char *keyName) |
Check whether a key name is under the user namespace or not. | |
ssize_t | keyNameGetRootNameSize (const char *keyName) |
Gets number of bytes needed to store root name of a key name. | |
ssize_t | keyGetRootNameSize (const Key *key) |
Gets number of bytes needed to store root name of a key. | |
ssize_t | keyGetRootName (const Key *key, char *returned, size_t maxSize) |
Copy to returned the root name of key . | |
ssize_t | keyGetFullRootNameSize (const Key *key) |
Calculates number of bytes needed to store full root name of a key. | |
ssize_t | keyGetFullRootName (const Key *key, char *returned, size_t maxSize) |
Copy to returned the full root name of the key. | |
ssize_t | keyGetParentNameSize (const Key *key) |
Get the number of bytes needed to store this key's parent name without the ending NULL. | |
ssize_t | keyGetParentName (const Key *key, char *returnedParent, size_t maxSize) |
Copy this key's parent name into a pre-allocated buffer. | |
ssize_t | keyNameGetBaseNameSize (const char *keyName) |
Calculates number of bytes needed to store a basename of a key name. | |
ssize_t | keyGetBaseNameSize (const Key *key) |
Calculates number of bytes needed to store basename of key . | |
ssize_t | keyGetBaseName (const Key *key, char *returned, size_t maxSize) |
Calculate the basename of a key name and put it in returned . | |
char * | keyStealBaseName (const Key *key) |
Returns a pointer to the real internal key name where the basename starts. |
To use them:
#include <kdb.h>
system
or user
.system
or user
. They are reserved for very essential OS subsystems.system/sw/MyApp
and/or user/sw/MyApp
.system/sw/MyApp/current
and/or user/sw/MyApp/current
. This way, from a sysadmin perspective, it will be possible to copy the system/sw/MyApp/current
tree to something like system/sw/MyApp/old
, and keep system clean and organized.
|
Set a new name to a key. A valid name is of the forms:
The last form has explicitly set the user domain, to let the library know in which user folder to save the key. A user domain is a user name. If not defined (the second form) current user is calculated and used as default. You should always follow the guidelines for key tree structure creation at Rules for Key Names.
A private copy of the key name will be stored, and the
Definition at line 505 of file key.c. References _Key::flags, _Key::key, KEY_SWITCH_ISSYSTEM, KEY_SWITCH_NAME, KEY_SWITCH_NEEDSYNC, keyNameGetRootNameSize(), strblen(), and _Key::userDomain. Referenced by kdbGetKeyByParent(), kdbGetKeyByParentKey(), kdbRemove(), keyAddBaseName(), keyDup(), keyNew(), and keySetBaseName(). |
|
Adds
Assumes that
So if
Definition at line 646 of file key.c. References _Key::key, keySetName(), and strblen(). |
|
Sets
All text after the last
So if
Definition at line 710 of file key.c. References _Key::key, keySetName(), and strblen(). |
|
Bytes needed to store the key name without user domain.
Definition at line 741 of file key.c. References _Key::key, and strblen(). Referenced by commandGet(), commandMove(), kdbMonitorKey_default(), and ksLookupRE(). |
|
Get abreviated key name (without user domain name).
Definition at line 764 of file key.c. References _Key::key, and strblen(). Referenced by commandGet(). |
|
Returns a pointer to the real internal This is a much more efficient version of keyGetName() and you should use it if you are responsible enough to not mess up things.
Definition at line 799 of file key.c. References _Key::key. Referenced by ksLookupByName(). |
|
Bytes needed to store the key name including user domain.
Definition at line 815 of file key.c. References _Key::key, strblen(), and _Key::userDomain. Referenced by commandGet(), kdbGetKeyByParentKey(), and keyGetFullName(). |
|
Get key full name, including the user domain name.
Definition at line 845 of file key.c. References _Key::key, keyGetFullNameSize(), strblen(), and _Key::userDomain. Referenced by commandEdit(), commandGet(), commandImport(), kdbGetKeyByParentKey(), keyToStreamBasename(), and ksToStream(). |
|
Check whether a key name is under the
Definition at line 932 of file key.c. Referenced by keyNameGetNamespace(). |
|
Check whether a key name is under the
Definition at line 968 of file key.c. Referenced by keyNameGetNamespace(). |
|
Gets number of bytes needed to store root name of a key name.
Possible root key names are
Definition at line 1005 of file key.c. Referenced by keyGetFullRootNameSize(), keyGetRootNameSize(), and keySetName(). |
|
Gets number of bytes needed to store root name of a key.
Possible root key names are
Definition at line 1040 of file key.c. References _Key::key, and keyNameGetRootNameSize(). Referenced by keyGetFullRootName(), and keyGetRootName(). |
|
Copy to Some examples:
Use keyGetFullRootName() to get also the user domain.
Definition at line 1067 of file key.c. References _Key::key, and keyGetRootNameSize(). |
|
Calculates number of bytes needed to store full root name of a key.
Possible root key names are
Definition at line 1105 of file key.c. References _Key::key, keyIsUser(), keyNameGetRootNameSize(), strblen(), and _Key::userDomain. Referenced by keyGetFullRootName(). |
|
Copy to Some examples:
This method is more robust then keyGetRootName()
Definition at line 1134 of file key.c. References _Key::key, keyGetFullRootNameSize(), keyGetRootNameSize(), keyIsUser(), and _Key::userDomain. |
|
Get the number of bytes needed to store this key's parent name without the ending NULL.
Definition at line 1185 of file key.c. References _Key::key, and strblen(). Referenced by keyGetParentName(), and ksLookupRE(). |
|
Copy this key's parent name into a pre-allocated buffer.
Definition at line 1240 of file key.c. References _Key::key, and keyGetParentNameSize(). Referenced by ksLookupRE(). |
|
Calculates number of bytes needed to store a basename of a key name.
Key names that have only root names (e.g. Basenames are denoted as:
Definition at line 1274 of file key.c. References strblen(). Referenced by keyGetBaseNameSize(). |
|
Calculates number of bytes needed to store basename of
Key names that have only root names (e.g. Basenames are denoted as:
Definition at line 1298 of file key.c. References _Key::key, and keyNameGetBaseNameSize(). Referenced by commandGet(), and keyGetBaseName(). |
|
Calculate the basename of a key name and put it in Some examples:
Definition at line 1322 of file key.c. References _Key::key, keyGetBaseNameSize(), and strblen(). Referenced by commandGet(). |
|
Returns a pointer to the real internal key name where the basename starts. This is a much more efficient version of keyGetBaseName() and you should use it if you are responsible enough to not mess up things.
Definition at line 1362 of file key.c. References _Key::key. |