Elektra: keyname.c File Reference

Elektra 0.8.24

Functions
ease/keyname.c File Reference

Methods for accessing key names. More...

`#include <kdb.h>`
`#include <string.h>`

## 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.

Copyright
  BSD License (see LICENSE.md or https://www.libelektra.org)

## 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

  cur | the key below parentKey we want to get the relative basename of
  parentKey | the key that defines the root/base

Returns
  a pointer to the relative part name of the key cur