$darkmode
Elektra 0.11.0
|
Reference methods. More...
Functions | |
int | elektraIsReferenceRedundant (const char *reference) |
Check whether a reference is redundant (i.e. More... | |
char * | elektraResolveReference (const char *reference, const Key *baseKey, const Key *parentKey) |
Resolve reference into a full keyname. More... | |
Reference methods.
int elektraIsReferenceRedundant | ( | const char * | reference | ) |
Check whether a reference is redundant (i.e.
it can be expressed in less characters) or not.
This can be used to give a warning to users, because redundant references are often mistakes. Using "../some/key/../path" instead of "../some/path" may indicate, that either a mistake was made while editing, or the concept of references was misunderstood.
reference | the reference to check |
1 | if the reference is redundant |
0 | otherwise |
char* elektraResolveReference | ( | const char * | reference, |
const Key * | baseKey, | ||
const Key * | parentKey | ||
) |
Resolve reference into a full keyname.
References operate like UNIX paths, with some additions:
reference | The reference to resolve |
baseKey | The key identified by the reference "./" |
parentKey | The key identified by the reference "@/" |