| Elektra 0.11.0

Functions
elektra/keyname.c File Reference

Methods for Key name manipulation. More...

`#include "kdbprivate.h"`
`#include <kdbassert.h>`
`#include <ctype.h>`
`#include "kdb.h"`
`#include "kdbhelper.h"`
`#include "kdbinternal.h"`

## Functions
const char * | keyName (const Key *key)
| Returns a pointer to the abbreviated real internal `key` name.
ssize_t | keyGetNameSize (const Key *key)
| Bytes needed to store the Key's name (excluding owner).
const void * | keyUnescapedName (const Key *key)
| Returns a Key's name, separated by NULL bytes and without backslashes for escaping.
ssize_t | keyGetUnescapedNameSize (const Key *key)
| Returns the size of the Key's unescaped name including embedded and terminating NULL characters.
ssize_t | keyGetName (const Key *key, char *returnedName, size_t maxSize)
| Get abbreviated Key name (excluding owner).
ssize_t | keyGetUnescapedName (const Key *key, char *returnedName, size_t maxSize)
| Copies the unescaped name of a Key into `returnedName`.
ssize_t | keySetName (Key *key, const char *newName)
| Set a new name to a Key.
ssize_t | keyAddName (Key *key, const char *newName)
| Add an already escaped name part to the Key's name.
int | keyReplacePrefix (Key *key, const Key *oldPrefix, const Key *newPrefix)
| Replaces a prefix of the key name of `key`.
bool | elektraKeyNameValidate (const char *name, bool isComplete)
| Takes an escaped key name and validates it.
void | elektraKeyNameCanonicalize (const char *name, char **canonicalName, size_t *canonicalSizePtr, size_t offset, size_t *usizePtr)
| Takes a valid (non-)canonical key name and produces its canonical form.
void | elektraKeyNameUnescape (const char *canonicalName, char *unescapedName)
| Takes a canonical key name and unescapes it.
const char * | keyBaseName (const Key *key)
| Returns a pointer to the unescaped Key's name where the basename starts.
ssize_t | keyGetBaseNameSize (const Key *key)
| Calculates number of bytes needed to store basename of `key` (including NULL terminator).
ssize_t | keyGetBaseName (const Key *key, char *returned, size_t maxSize)
| Copy the Key's basename to `returned`.
size_t | elektraKeyNameEscapePart (const char *part, char **escapedPart)
| Takes a single key name part and produces its escaped form.
ssize_t | keyAddBaseName (Key *key, const char *baseName)
| Adds `baseName` to the name of `key`.
ssize_t | keySetBaseName (Key *key, const char *baseName)
| Sets `baseName` as the new basename for `key`.
elektraNamespace | keyGetNamespace (const Key *key)
| Returns the elektraNamespace for a Key.
ssize_t | keySetNamespace (Key *key, elektraNamespace ns)
| Changes the namespace of a Key.
int | elektraIsArrayPart (const char *namePart)
| Checks if the given key name part is an array part.

## Detailed Description

Methods for Key name manipulation.

Copyright
  BSD License (see LICENSE.md or https://www.libelektra.org)