/usr/share/doc/libelektra-dev/examples/keyName.c is in libelektra-dev 0.8.14-5.1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <assert.h>
#include <string.h>
#include <kdb.h>
int main()
{
//! [add name]
Key *k = keyNew("user/x/r", KEY_END);
keyAddName(k, "../y/a//././z");
assert(!strcmp(keyName(k), "user/x/y/a/z"));
keyDel(k);
//! [add name]
//! [namespace]
Key *n = keyNew("user/away", KEY_END);
keyAddName(n, "../../../new/name");
assert(!strcmp(keyName(n), "user/new/name"));
keyDel(n);
//! [namespace]
}
|