$darkmode
Elektra 0.11.0
Functions
ease/keyname.c File Reference

Methods for accessing key names. More...

#include <kdb.h>
#include <string.h>
Include dependency graph for ease/keyname.c:

Functions

const char * elektraKeyGetRelativeName (Key const *cur, Key const *parentKey)
 get relative position of key based on parentKey More...
 

Detailed Description

Methods for accessing key names.

Function Documentation

◆ elektraKeyGetRelativeName()

const char* elektraKeyGetRelativeName ( Key const *  cur,
Key const *  parentKey 
)

get relative position of key based on parentKey

Precondition
parentKey is either the same key as cur, or one of its parents
Postcondition
a pointer to the relevant part of the parent key's name, the full name if there is no relation to the parentKey

If the parentKey does not fulfill the precondition, the result won't be the correct relative key of cur.

Parameters
curthe key below parentKey we want to get the relative basename of
parentKeythe key that defines the root/base
Returns
a pointer to the relative part name of the key cur