Elektra: trie.c File Reference

Elektra 0.8.24

Functions
trie.c File Reference

Interna of trie functionality. More...

`#include "kdbinternal.h"`

## Functions
Backend * | trieLookup (Trie *trie, const Key *key)
| The Trie structure. More...
int | trieClose (Trie *trie, Key *errorKey)
| Closes the trie and all opened backends within. More...
Trie * | trieInsert (Trie *trie, const char *name, Backend *value)
| Insert into trie. More...

## Detailed Description

Interna of trie functionality.

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

## Function Documentation

## ◆ trieClose()

int trieClose | ( | Trie * | trie,
|  | Key * | errorKey
| ) |  |

Closes the trie and all opened backends within.

Parameters

  trie | the trie to close
  errorKey | the key used to report warnings

Return values

  0 | on success

## ◆ trieInsert()

Trie* trieInsert | ( | Trie * | trie,
|  | const char * | name,
|  | Backend * | value
| ) |  |

Insert into trie.

Parameters

  trie | the trie to insert to (0 to create a new trie)
  name | the key's name to insert
  value | the value to insert

Return values

  trie | on success

## ◆ trieLookup()

Backend* trieLookup | ( | Trie * | trie,
|  | const Key * | key
| ) |  |

The Trie structure.

Lookups a backend inside the trie.

Returns
  the backend if found
  0 otherwise

Parameters

  trie | the trie object to work with
  key | the name of this key will be looked up