| Elektra 0.11.0

Functions
High-level API

## Functions
kdb_boolean_t | checkSpec (Key *const parentKey, KeySet *contract, ElektraError **error)
| Verify that specification is properly mounted and is equal to specification at compile time.
Elektra * | elektraOpen (const char *application, KeySet *defaults, KeySet *contract, ElektraError **error)
| Initializes a new Elektra instance.
void | elektraFatalError (Elektra *elektra, ElektraError *fatalError)
| Promote an ElektraError to fatal and call the fatal error handler.
Key * | elektraHelpKey (Elektra *elektra)
| This function is only intended for use with code-generation.
void | elektraFatalErrorHandler (Elektra *elektra, ElektraErrorHandler fatalErrorHandler)
| Sets the fatal error handler that will be called, whenever a fatal error occurs.
void | elektraClose (Elektra *elektra)
| Releases all resources used by the given elektra instance.
kdb_long_long_t | elektraArraySize (Elektra *elektra, const char *name)
| Gets the size of an array.
Key * | elektraFindArrayElementKey (Elektra *elektra, const char *name, kdb_long_long_t index, KDBType type)
| Helper function for code generation.
const char * | elektraFindReferenceArrayElement (Elektra *elektra, const char *name, kdb_long_long_t index)
| Resolves the reference stored in a key.
KDBType | elektraGetArrayElementType (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Reads the type metadata of a given array element.
const char * | elektraGetRawStringArrayElement (Elektra *elektra, const char *name, kdb_long_long_t index)
| Get the raw string value of an array element key.
void | elektraSetRawStringArrayElement (Elektra *elektra, const char *name, kdb_long_long_t index, const char *value, KDBType type, ElektraError **error)
| Set the raw string value of an array element key.
const char * | elektraGetStringArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a string value array element.
kdb_boolean_t | elektraGetBooleanArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a boolean value array element.
kdb_char_t | elektraGetCharArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a char value array element.
kdb_octet_t | elektraGetOctetArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets an octet value array element.
kdb_short_t | elektraGetShortArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a short value array element.
kdb_unsigned_short_t | elektraGetUnsignedShortArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a unsigned short value array element.
kdb_long_t | elektraGetLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a long value array element.
kdb_unsigned_long_t | elektraGetUnsignedLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a unsigned long value array element.
kdb_long_long_t | elektraGetLongLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a long long value array element.
kdb_unsigned_long_long_t | elektraGetUnsignedLongLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a unsigned long long value array element.
kdb_float_t | elektraGetFloatArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a float value array element.
kdb_double_t | elektraGetDoubleArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
| Gets a double value array element.
void | elektraSetStringArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, const char *value, ElektraError **error)
| Sets a string value array element.
void | elektraSetBooleanArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_boolean_t value, ElektraError **error)
| Sets a boolean value array element.
void | elektraSetCharArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_char_t value, ElektraError **error)
| Sets a char value array element.
void | elektraSetOctetArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_octet_t value, ElektraError **error)
| Sets an octet value array element.
void | elektraSetShortArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_short_t value, ElektraError **error)
| Sets a short value array element.
void | elektraSetUnsignedShortArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_unsigned_short_t value, ElektraError **error)
| Sets a unsigned short value array element.
void | elektraSetLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_long_t value, ElektraError **error)
| Sets a long value array element.
void | elektraSetUnsignedLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_unsigned_long_t value, ElektraError **error)
| Sets a unsigned long value array element.
void | elektraSetLongLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_long_long_t value, ElektraError **error)
| Sets a long long value array element.
void | elektraSetUnsignedLongLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_unsigned_long_long_t value, ElektraError **error)
| Sets a unsigned long long value array element.
void | elektraSetFloatArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_float_t value, ElektraError **error)
| Sets a float value array element.
void | elektraSetDoubleArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_double_t value, ElektraError **error)
| Sets a double value array element.
ElektraError * | elektraErrorPureWarning (void)
| Creates a dummy ElektraError struct to store warnings in.
const char * | elektraErrorCode (const ElektraError *error)
const char * | elektraErrorDescription (const ElektraError *error)
void | elektraErrorReset (ElektraError **error)
| Frees the memory used by the error and sets the referenced error variable to NULL.
Key * | elektraFindKey (Elektra *elektra, const char *name, KDBType type)
| Helper function for code generation.
const char * | elektraFindReference (Elektra *elektra, const char *name)
| Resolves the reference stored in a key.
KDBType | elektraGetType (Elektra *elektra, const char *keyname)
| Reads the type metadata of a given key.
const char * | elektraGetRawString (Elektra *elektra, const char *name)
| Get the raw string value of a key.
void | elektraSetRawString (Elektra *elektra, const char *name, const char *value, KDBType type, ElektraError **error)
| Set the raw string value of a key.
const char * | elektraGetString (Elektra *elektra, const char *keyname)
| Gets a string value.
kdb_boolean_t | elektraGetBoolean (Elektra *elektra, const char *keyname)
| Gets a boolean value.
kdb_char_t | elektraGetChar (Elektra *elektra, const char *keyname)
| Gets a char value.
kdb_octet_t | elektraGetOctet (Elektra *elektra, const char *keyname)
| Gets an octet value.
kdb_short_t | elektraGetShort (Elektra *elektra, const char *keyname)
| Gets a short value.
kdb_unsigned_short_t | elektraGetUnsignedShort (Elektra *elektra, const char *keyname)
| Gets a unsigned short value.
kdb_long_t | elektraGetLong (Elektra *elektra, const char *keyname)
| Gets a long value.
kdb_unsigned_long_t | elektraGetUnsignedLong (Elektra *elektra, const char *keyname)
| Gets a unsigned long value.
kdb_long_long_t | elektraGetLongLong (Elektra *elektra, const char *keyname)
| Gets a long long value.
kdb_unsigned_long_long_t | elektraGetUnsignedLongLong (Elektra *elektra, const char *keyname)
| Gets a long long value.
kdb_float_t | elektraGetFloat (Elektra *elektra, const char *keyname)
| Gets a float value.
kdb_double_t | elektraGetDouble (Elektra *elektra, const char *keyname)
| Gets a double value.
void | elektraSetString (Elektra *elektra, const char *keyname, const char *value, ElektraError **error)
| Sets a string value.
void | elektraSetBoolean (Elektra *elektra, const char *keyname, kdb_boolean_t value, ElektraError **error)
| Sets a boolean value.
void | elektraSetChar (Elektra *elektra, const char *keyname, kdb_char_t value, ElektraError **error)
| Sets a char value.
void | elektraSetOctet (Elektra *elektra, const char *keyname, kdb_octet_t value, ElektraError **error)
| Sets an octet value.
void | elektraSetShort (Elektra *elektra, const char *keyname, kdb_short_t value, ElektraError **error)
| Sets a short value.
void | elektraSetUnsignedShort (Elektra *elektra, const char *keyname, kdb_unsigned_short_t value, ElektraError **error)
| Sets a unsigned short value.
void | elektraSetLong (Elektra *elektra, const char *keyname, kdb_long_t value, ElektraError **error)
| Sets a long value.
void | elektraSetUnsignedLong (Elektra *elektra, const char *keyname, kdb_unsigned_long_t value, ElektraError **error)
| Sets a unsigned long value.
void | elektraSetLongLong (Elektra *elektra, const char *keyname, kdb_long_long_t value, ElektraError **error)
| Sets a long long value.
void | elektraSetUnsignedLongLong (Elektra *elektra, const char *keyname, kdb_unsigned_long_long_t value, ElektraError **error)
| Sets a unsigned long long value.
void | elektraSetFloat (Elektra *elektra, const char *keyname, kdb_float_t value, ElektraError **error)
| Sets a float value.
void | elektraSetDouble (Elektra *elektra, const char *keyname, kdb_double_t value, ElektraError **error)
| Sets a double value.

## Detailed Description

## Function Documentation

## ◆ checkSpec()

kdb_boolean_t checkSpec | ( | Key *const | parentKey,
|  | KeySet * | contract,
|  | ElektraError ** | error
| ) |  |

Verify that specification is properly mounted and is equal to specification at compile time.

Note: These checks are only executed, if the contract requires them.

Parameters

  parentKey | The parentKey of the application
  contract | The contract passed to HL API by the application.
  error | Pointer used to report errors

Return values

  True | if the checks were successful (or not required).
  False | if the checks were required but unsuccessful.

## ◆ elektraArraySize()

kdb_long_long_t elektraArraySize | ( | Elektra * | elektra,
|  | const char * | name
| ) |  |

Gets the size of an array.

Parameters

  elektra | The Elektra instance to use.
  name | The (relative) name of the array.

Returns
  the size of the array, 0 is returned if the array is empty or doesn't exist

## ◆ elektraClose()

void elektraClose | ( | Elektra * | elektra | ) |

Releases all resources used by the given elektra instance.

The elektra instance must not be used anymore after calling this.

Parameters

  elektra | An Elektra instance.

## ◆ elektraErrorCode()

const char * elektraErrorCode | ( | const ElektraError * | error | ) |

Returns
  the error code of the given error

## ◆ elektraErrorDescription()

const char * elektraErrorDescription | ( | const ElektraError * | error | ) |

Returns
  the description for the given error

## ◆ elektraErrorPureWarning()

ElektraError * elektraErrorPureWarning | ( | void |  | ) |

Creates a dummy ElektraError struct to store warnings in.

If elektraErrorCode() is called on the resulting struct, it will return NULL.

Returns
  A newly allocated ElektraError (free with elektraFree()).

## ◆ elektraFatalError()

void elektraFatalError | ( | Elektra * | elektra,
|  | ElektraError * | fatalError
| ) |  |

Promote an ElektraError to fatal and call the fatal error handler.

Parameters

  elektra | Elektra instance whose fatal error handler shall be used.
  fatalError | The error that will be raised.

## ◆ elektraFatalErrorHandler()

void elektraFatalErrorHandler | ( | Elektra * | elektra,
|  | ElektraErrorHandler | fatalErrorHandler
| ) |  |

Sets the fatal error handler that will be called, whenever a fatal error occurs.

Errors occurring in a function, which does not take a pointer to ElektraError, are always considered fatal.

If this function returns, i.e. it does not call exit() or interrupt the thread of execution in some other way, the behaviour of the function from which the error originated is generally undefined.

Parameters

  elektra | An Elektra instance.
  fatalErrorHandler | The error handler that will be used henceforth.

## ◆ elektraFindArrayElementKey()

Key * elektraFindArrayElementKey | ( | Elektra * | elektra,
|  | const char * | name,
|  | kdb_long_long_t | index,
|  | KDBType | type
| ) |  |

Helper function for code generation.

Finds an array element Key from its relative name and index. Also checks type metadata, if `type` is not NULL.

Parameters

  elektra | The Elektra instance to use.
  name | The relative name of the array.
  index | The index of the array element.
  type | The expected type metadata value.

Returns
  the Key referenced by `name` or NULL, if a fatal error occurs and the fatal error handler returns to this function The returned pointer remains valid until the KeySet inside `elektra` is modified. Calls to elektraSet*() functions may cause such modifications. In any case, it becomes invalid when elektraClose() is called on `elektra`.

## ◆ elektraFindKey()

Key * elektraFindKey | ( | Elektra * | elektra,
|  | const char * | name,
|  | KDBType | type
| ) |  |

Helper function for code generation.

Finds a Key from its relative name. Also checks type metadata, if `type` is not NULL.

Parameters

  elektra | The Elektra instance to use.
  name | The relative name of the key.
  type | The expected type metadata value.

Returns
  the Key referenced by `name` or NULL, if a fatal error occurs and the fatal error handler returns to this function The returned pointer remains valid until the KeySet inside `elektra` is modified. Calls to elektraSet*() functions may cause such modifications. In any case, it becomes invalid when elektraClose() is called on `elektra`.

## ◆ elektraFindReference()

const char * elektraFindReference | ( | Elektra * | elektra,
|  | const char * | name
| ) |  |

Resolves the reference stored in a key.

1. Get the raw string value.
2. Resolve that reference.
3. Return resulting keyname relative to the parent key of the given Elektra instance.

IMPORTANT: this method DOES NOT check the type metadata of the key, it is only intended to be used by the code-generation API.

Parameters

  elektra | The Elektra instance to use.
  name | The (relative) name of the key.

Returns
  the resolved version of the reference stored in the specified key (relative to the parent key of `elektra`) or NULL, if the key was not found, or the reference resolves two a key not below the parent key. The empty string is returned, if the value was the empty string (no resolution is attempted). The returned pointer becomes invalid when this function is called again (even with the same arguments). It is also invalidated when elektraFindReferenceArrayElement() or elektraClose() are called on `elektra`.

## ◆ elektraFindReferenceArrayElement()

const char * elektraFindReferenceArrayElement | ( | Elektra * | elektra,
|  | const char * | name,
|  | kdb_long_long_t | index
| ) |  |

Resolves the reference stored in a key.

1. Get the raw string value.
2. Resolve that reference.
3. Return resulting keyname relative to the parent key of the given Elektra instance.

IMPORTANT: this method DOES NOT check the type metadata of the key, it is only intended to be used by the code-generation API.

Parameters

  elektra | The Elektra instance to use.
  name | The (relative) name of the array.
  index | The index of the array element.

Returns
  the resolved version of the reference stored in the specified key (relative to the parent key of `elektra`) or NULL, if the key was not found, or the reference resolves two a key not below the parent key. The empty string is returned, if the value was the empty string (no resolution is attempted). The returned pointer becomes invalid when this function is called again (even with the same arguments). It is also invalidated when elektraFindReference() or elektraClose() are called on `elektra`.

## ◆ elektraGetArrayElementType()

KDBType elektraGetArrayElementType | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Reads the type metadata of a given array element.

Parameters

  elektra | An Elektra instance.
  name | The name of the array.
  index | The index of the array element whose type information shall be read.

Returns
  the KDBType of the key

## ◆ elektraGetBoolean()

kdb_boolean_t elektraGetBoolean | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a boolean value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the boolean stored at the given key

## ◆ elektraGetBooleanArrayElement()

kdb_boolean_t elektraGetBooleanArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a boolean value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the boolean stored at the given array element

## ◆ elektraGetChar()

kdb_char_t elektraGetChar | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a char value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the char stored at the given key

## ◆ elektraGetCharArrayElement()

kdb_char_t elektraGetCharArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a char value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the char stored at the given array element

## ◆ elektraGetDouble()

kdb_double_t elektraGetDouble | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a double value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the double stored at the given key

## ◆ elektraGetDoubleArrayElement()

kdb_double_t elektraGetDoubleArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a double value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the double stored at the given array element

## ◆ elektraGetFloat()

kdb_float_t elektraGetFloat | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a float value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the float stored at the given key

## ◆ elektraGetFloatArrayElement()

kdb_float_t elektraGetFloatArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a float value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the float stored at the given array element

## ◆ elektraGetLong()

kdb_long_t elektraGetLong | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a long value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the long stored at the given key

## ◆ elektraGetLongArrayElement()

kdb_long_t elektraGetLongArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a long value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the long stored at the given array element

## ◆ elektraGetLongLong()

kdb_long_long_t elektraGetLongLong | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a long long value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the long long stored at the given key

## ◆ elektraGetLongLongArrayElement()

kdb_long_long_t elektraGetLongLongArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a long long value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the long long stored at the given array element

## ◆ elektraGetOctet()

kdb_octet_t elektraGetOctet | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets an octet value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the octet stored at the given key

## ◆ elektraGetOctetArrayElement()

kdb_octet_t elektraGetOctetArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets an octet value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the octet stored at the given array element

## ◆ elektraGetRawString()

const char * elektraGetRawString | ( | Elektra * | elektra,
|  | const char * | name
| ) |  |

Get the raw string value of a key.

Parameters

  elektra | The Elektra instance to use.
  name | The (relative) name of the key.

Returns
  the raw value of the specified key or NULL, if the key was not found The returned pointer remains valid until the internal state of `elektra` is modified. Calls to elektraSet*() functions may cause such modifications. In any case, it becomes invalid when elektraClose() is called on `elektra`.

## ◆ elektraGetRawStringArrayElement()

const char * elektraGetRawStringArrayElement | ( | Elektra * | elektra,
|  | const char * | name,
|  | kdb_long_long_t | index
| ) |  |

Get the raw string value of an array element key.

Parameters

  elektra | The Elektra instance to use.
  name | The (relative) name of the array.
  index | The index of the array element.

Returns
  the raw value of the specified key, or NULL if the key was not found The returned pointer remains valid until the internal state of `elektra` is modified. Calls to elektraSet*() functions may cause such modifications. In any case, it becomes invalid when elektraClose() is called on `elektra`.

## ◆ elektraGetShort()

kdb_short_t elektraGetShort | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a short value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the short stored at the given key

## ◆ elektraGetShortArrayElement()

kdb_short_t elektraGetShortArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a short value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the short stored at the given array element

## ◆ elektraGetString()

const char * elektraGetString | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a string value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the string stored at the given key The returned pointer remains valid until the internal state of `elektra` is modified. Calls to elektraSet*() functions may cause such modifications. In any case, it becomes invalid when elektraClose() is called on `elektra`.

## ◆ elektraGetStringArrayElement()

const char * elektraGetStringArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a string value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the string stored at the given array element The returned pointer remains valid until the internal state of `elektra` is modified. Calls to elektraSet*() functions may cause such modifications. In any case, it becomes invalid when elektraClose() is called on `elektra`.

## ◆ elektraGetType()

KDBType elektraGetType | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Reads the type metadata of a given key.

Parameters

  elektra | An Elektra instance.
  keyname | The name of the key whose type information shall be read.

Returns
  the KDBType of the key

## ◆ elektraGetUnsignedLong()

kdb_unsigned_long_t elektraGetUnsignedLong | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a unsigned long value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the unsigned long stored at the given key

## ◆ elektraGetUnsignedLongArrayElement()

kdb_unsigned_long_t elektraGetUnsignedLongArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a unsigned long value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the unsigned long stored at the given array element

## ◆ elektraGetUnsignedLongLong()

kdb_unsigned_long_long_t elektraGetUnsignedLongLong | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a long long value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the unsigned long long stored at the given key

## ◆ elektraGetUnsignedLongLongArrayElement()

kdb_unsigned_long_long_t elektraGetUnsignedLongLongArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a unsigned long long value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the unsigned long long stored at the given array element

## ◆ elektraGetUnsignedShort()

kdb_unsigned_short_t elektraGetUnsignedShort | ( | Elektra * | elektra,
|  | const char * | keyname
| ) |  |

Gets a unsigned short value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the key to look up.

Returns
  the unsigned short stored at the given key

## ◆ elektraGetUnsignedShortArrayElement()

kdb_unsigned_short_t elektraGetUnsignedShortArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index
| ) |  |

Gets a unsigned short value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to look up.
  index | The index of the array element to look up.

Returns
  the unsigned short stored at the given array element

## ◆ elektraHelpKey()

Key * elektraHelpKey | ( | Elektra * | elektra | ) |

This function is only intended for use with code-generation.

It looks for the key proc:/elektra/gopts/help (absolute name) created by gopts, and returns it if found.

Parameters

  elektra | The Elektra instance to check

Returns
  the help key if found, NULL otherwise The pointer returned may become invalid, when any `elektraSet*()` function or any other function that modifies the state of `elektra` is called. It will always become invalid, when elektraClose() is called on `elektra`.

## ◆ elektraOpen()

Elektra * elektraOpen | ( | const char * | application,
|  | KeySet * | defaults,
|  | KeySet * | contract,
|  | ElektraError ** | error
| ) |  |

Initializes a new Elektra instance.

To free the memory allocated by this function call elektraClose(), once you are done using this instance.

Parameters

  application | Your application's base name. The simplest version for this string is "/sw/org/<appname>/#0/current", where '<appname>' is a unique name for your application. For more information see the man-page elektra-key-names(7).
  defaults | A KeySet containing default values. If you pass NULL, trying to read a non-existent value will cause a fatal error. It is recommended, to only pass NULL, if you are using a specification, which provides default values inside of the KDB. If a key in this KeySet doesn't have a value, we will use the value of the "default" metakey of this key.
  contract | Will be passed to kdbOpen() as the contract.
  error | If an error occurs during initialization of the Elektra instance, this pointer will be used to report the error.

Returns
  An Elektra instance initialized for the application (free with elektraClose()).

See also
  elektraClose
  kdbOpen

## ◆ elektraSetBoolean()

void elektraSetBoolean | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_boolean_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a boolean value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new boolean value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetBooleanArrayElement()

void elektraSetBooleanArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_boolean_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a boolean value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new boolean value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetChar()

void elektraSetChar | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_char_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a char value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new char value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetCharArrayElement()

void elektraSetCharArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_char_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a char value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new char value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetDouble()

void elektraSetDouble | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_double_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a double value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new double value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetDoubleArrayElement()

void elektraSetDoubleArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_double_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a double value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new double value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetFloat()

void elektraSetFloat | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_float_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a float value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new float value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetFloatArrayElement()

void elektraSetFloatArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_float_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a float value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new float value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetLong()

void elektraSetLong | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a long value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new long value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetLongArrayElement()

void elektraSetLongArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_long_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a long value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new long value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetLongLong()

void elektraSetLongLong | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a long long value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new long long value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetLongLongArrayElement()

void elektraSetLongLongArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_long_long_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a long long value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new long long value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetOctet()

void elektraSetOctet | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_octet_t | value,
|  | ElektraError ** | error
| ) |  |

Sets an octet value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new octet value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetOctetArrayElement()

void elektraSetOctetArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_octet_t | value,
|  | ElektraError ** | error
| ) |  |

Sets an octet value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new octet value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetRawString()

void elektraSetRawString | ( | Elektra * | elektra,
|  | const char * | name,
|  | const char * | value,
|  | KDBType | type,
|  | ElektraError ** | error
| ) |  |

Set the raw string value of a key.

Parameters

  elektra | The Elektra instance to use.
  name | The (relative) name of the key.
  value | The raw value to set.
  type | The type to set in the metadata of the key.
  error | Pointer to an ElektraError. Will be set in case saving fails.

## ◆ elektraSetRawStringArrayElement()

void elektraSetRawStringArrayElement | ( | Elektra * | elektra,
|  | const char * | name,
|  | kdb_long_long_t | index,
|  | const char * | value,
|  | KDBType | type,
|  | ElektraError ** | error
| ) |  |

Set the raw string value of an array element key.

Parameters

  elektra | The Elektra instance to use.
  name | The (relative) name of the array.
  index | The index of the array element.
  value | The raw value to set.
  type | The type to set in the metadata of the (array element) key.
  error | Pointer to an ElektraError. Will be set in case saving fails.

## ◆ elektraSetShort()

void elektraSetShort | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_short_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a short value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new short value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetShortArrayElement()

void elektraSetShortArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_short_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a short value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new short value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetString()

void elektraSetString | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | const char * | value,
|  | ElektraError ** | error
| ) |  |

Sets a string value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new string value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetStringArrayElement()

void elektraSetStringArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | const char * | value,
|  | ElektraError ** | error
| ) |  |

Sets a string value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new string value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetUnsignedLong()

void elektraSetUnsignedLong | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_unsigned_long_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a unsigned long value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new unsigned long value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetUnsignedLongArrayElement()

void elektraSetUnsignedLongArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_unsigned_long_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a unsigned long value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new unsigned long value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetUnsignedLongLong()

void elektraSetUnsignedLongLong | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_unsigned_long_long_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a unsigned long long value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new unsigned long long value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetUnsignedLongLongArrayElement()

void elektraSetUnsignedLongLongArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_unsigned_long_long_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a unsigned long long value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new unsigned long long value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetUnsignedShort()

void elektraSetUnsignedShort | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_unsigned_short_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a unsigned short value.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name to write to.
  value | The new unsigned short value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.

## ◆ elektraSetUnsignedShortArrayElement()

void elektraSetUnsignedShortArrayElement | ( | Elektra * | elektra,
|  | const char * | keyname,
|  | kdb_long_long_t | index,
|  | kdb_unsigned_short_t | value,
|  | ElektraError ** | error
| ) |  |

Sets a unsigned short value array element.

Parameters

  elektra | The elektra instance to use.
  keyname | The (relative) name of the array to write to.
  index | The index of the array element to write to.
  value | The new unsigned short value.
  error | Pass a reference to an ElektraError pointer. Will only be set in case of an error.