$darkmode
Elektra 0.11.0
|
While iterating over the parts of a keyname is easy for an experienced developer (just jump from \0
to \0
until you hit the name size), there is no good API that newcomers can use.
No changes to the underlying APIs, while maintaining reasonable performance.
libelektra-core
.Add this new function to a separate library (name TBD):
```c /**
key
.currentPart
, must be NULL
or point anywhere into the unescaped name of key
currentPart
as:key
(after namespace), if currentPart == NULL
NULL
, if currentPart
is the last part of key
, i.e. currentPart == keyBaseName (key)
key
after the location currentPart
points tocurrentPart
. */ const char * keyGetNextPart (Key * key, const char * currentPart); ```The function is not required for a minimal API, but it is useful for people who don't know everything about the internals of Elektra.