$darkmode
Elektra 0.11.0
Iterating Keyname Parts

Problem

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.

Constraints

No changes to the underlying APIs, while maintaining reasonable performance.

Assumptions

Considered Alternatives

  • Put the new function into libelektra-core.

Decision

Add this new function to a separate library (name TBD):

    • Returns
      the "next" (see above) key name part after currentPart. */ const char * keyGetNextPart (Key * key, const char * currentPart);

Rationale

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.

Implications

Related Decisions

Notes