Elektra  0.8.26
Macros | Functions
High-level API

Macros

#define ELEKTRA_TAG_DECLARATIONS(cType, typeName)
 Inserts the necessary declarations for a new Elektra Tag that can be used in combination with the generic getter and setter macros. More...
 
#define ELEKTRA_TAG_DEFINITIONS(cType, typeName, KDB_TYPE, VALUE_TO_STRING, KEY_TO_VALUE)
 Inserts the necessary definitions for an Elektra Tag declared with ELEKTRA_TAG_DECLARATIONS. More...
 
#define ELEKTRA_TAG_VALUE(tagName, keyname, typeName)
 Inserts a new static instance of an Elektra Tag. More...
 
#define elektraGet(elektra, tag)   ((tag).get (elektra, &(tag)))
 
#define elektraGetArrayElement(elektra, tag, index)   ((tag).getArrayElement (elektra, &(tag), index))
 
#define elektraSet(elektra, tag, value, error)   ((tag).set (elektra, &(tag), value, error))
 
#define elektraSetArrayElement(elektra, tag, index, value, error)   ((tag).setArrayElement (elektra, &(tag), index, value, error))
 

Functions

void elektraFatalError (Elektra *elektra, ElektraError *fatalError)
 Promote an ElektraError to fatal and call the fatal error handler. More...
 
void elektraFatalErrorHandler (Elektra *elektra, ElektraErrorHandler fatalErrorHandler)
 Sets the fatal error handler that will be called, whenever a fatal error occurs. More...
 
void elektraClose (Elektra *elektra)
 Releases all resources used by the given elektra instance. More...
 
kdb_long_long_t elektraArraySize (Elektra *elektra, const char *name)
 Gets the size of an array. More...
 
Key * elektraFindArrayElementKey (Elektra *elektra, const char *name, kdb_long_long_t index, KDBType type)
 Helper function for code generation. More...
 
KDBType elektraGetArrayElementType (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Reads the type metadata of a given array element. More...
 
const char * elektraGetRawStringArrayElement (Elektra *elektra, const char *name, kdb_long_long_t index)
 Get the raw string value of an array element key. More...
 
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. More...
 
const char * elektraGetStringArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a string value array element. More...
 
kdb_boolean_t elektraGetBooleanArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a boolean value array element. More...
 
kdb_char_t elektraGetCharArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a char value array element. More...
 
kdb_octet_t elektraGetOctetArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a octet value array element. More...
 
kdb_short_t elektraGetShortArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a short value array element. More...
 
kdb_unsigned_short_t elektraGetUnsignedShortArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a unsigned short value array element. More...
 
kdb_long_t elektraGetLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a long value array element. More...
 
kdb_unsigned_long_t elektraGetUnsignedLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a unsigned long value array element. More...
 
kdb_long_long_t elektraGetLongLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a long long value array element. More...
 
kdb_unsigned_long_long_t elektraGetUnsignedLongLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a unsigned long long value array element. More...
 
kdb_float_t elektraGetFloatArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a float value array element. More...
 
kdb_double_t elektraGetDoubleArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index)
 Gets a double value array element. More...
 
void elektraSetStringArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, const char *value, ElektraError **error)
 Sets a string value array element. More...
 
void elektraSetBooleanArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_boolean_t value, ElektraError **error)
 Sets a boolean value array element. More...
 
void elektraSetCharArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_char_t value, ElektraError **error)
 Sets a char value array element. More...
 
void elektraSetOctetArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_octet_t value, ElektraError **error)
 Sets a octet value array element. More...
 
void elektraSetShortArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_short_t value, ElektraError **error)
 Sets a short value array element. More...
 
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. More...
 
void elektraSetLongArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_long_t value, ElektraError **error)
 Sets a long value array element. More...
 
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. More...
 
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. More...
 
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. More...
 
void elektraSetFloatArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_float_t value, ElektraError **error)
 Sets a float value array element. More...
 
void elektraSetDoubleArrayElement (Elektra *elektra, const char *keyname, kdb_long_long_t index, kdb_double_t value, ElektraError **error)
 Sets a double value array element. More...
 
ElektraErrorCode elektraErrorCode (const ElektraError *error)
 
const char * elektraErrorDescription (const ElektraError *error)
 
ElektraErrorSeverity elektraErrorSeverity (const ElektraError *error)
 
int elektraKDBErrorCode (const ElektraError *error)
 
const char * elektraKDBErrorDescription (const ElektraError *error)
 
ElektraErrorSeverity elektraKDBErrorSeverity (const ElektraError *error)
 
ElektraKDBErrorGroup elektraKDBErrorGroup (const ElektraError *error)
 
ElektraKDBErrorModule elektraKDBErrorModule (const ElektraError *error)
 
const char * elektraKDBErrorReason (const ElektraError *error)
 
int elektraKDBErrorWarningCount (const ElektraError *error)
 
ElektraError * elektraKDBErrorGetWarning (const ElektraError *error, int index)
 
Key * elektraKDBErrorKey (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. More...
 
KDBType elektraGetType (Elektra *elektra, const char *keyname)
 Reads the type metadata of a given key. More...
 
const char * elektraGetRawString (Elektra *elektra, const char *name)
 Get the raw string value of a key. More...
 
void elektraSetRawString (Elektra *elektra, const char *name, const char *value, KDBType type, ElektraError **error)
 Set the raw string value of a key. More...
 
const char * elektraGetString (Elektra *elektra, const char *keyname)
 Gets a string value. More...
 
kdb_boolean_t elektraGetBoolean (Elektra *elektra, const char *keyname)
 Gets a boolean value. More...
 
kdb_char_t elektraGetChar (Elektra *elektra, const char *keyname)
 Gets a char value. More...
 
kdb_octet_t elektraGetOctet (Elektra *elektra, const char *keyname)
 Gets a octet value. More...
 
kdb_short_t elektraGetShort (Elektra *elektra, const char *keyname)
 Gets a short value. More...
 
kdb_unsigned_short_t elektraGetUnsignedShort (Elektra *elektra, const char *keyname)
 Gets a unsigned short value. More...
 
kdb_long_t elektraGetLong (Elektra *elektra, const char *keyname)
 Gets a long value. More...
 
kdb_unsigned_long_t elektraGetUnsignedLong (Elektra *elektra, const char *keyname)
 Gets a unsigned long value. More...
 
kdb_long_long_t elektraGetLongLong (Elektra *elektra, const char *keyname)
 Gets a long long value. More...
 
kdb_unsigned_long_long_t elektraGetUnsignedLongLong (Elektra *elektra, const char *keyname)
 Gets a long long value. More...
 
kdb_float_t elektraGetFloat (Elektra *elektra, const char *keyname)
 Gets a float value. More...
 
kdb_double_t elektraGetDouble (Elektra *elektra, const char *keyname)
 Gets a double value. More...
 
void elektraSetString (Elektra *elektra, const char *keyname, const char *value, ElektraError **error)
 Sets a string value. More...
 
void elektraSetBoolean (Elektra *elektra, const char *keyname, kdb_boolean_t value, ElektraError **error)
 Sets a boolean value. More...
 
void elektraSetChar (Elektra *elektra, const char *keyname, kdb_char_t value, ElektraError **error)
 Sets a char value. More...
 
void elektraSetOctet (Elektra *elektra, const char *keyname, kdb_octet_t value, ElektraError **error)
 Sets a octet value. More...
 
void elektraSetShort (Elektra *elektra, const char *keyname, kdb_short_t value, ElektraError **error)
 Sets a short value. More...
 
void elektraSetUnsignedShort (Elektra *elektra, const char *keyname, kdb_unsigned_short_t value, ElektraError **error)
 Sets a unsigned short value. More...
 
void elektraSetLong (Elektra *elektra, const char *keyname, kdb_long_t value, ElektraError **error)
 Sets a long value. More...
 
void elektraSetUnsignedLong (Elektra *elektra, const char *keyname, kdb_unsigned_long_t value, ElektraError **error)
 Sets a unsigned long value. More...
 
void elektraSetLongLong (Elektra *elektra, const char *keyname, kdb_long_long_t value, ElektraError **error)
 Sets a long long value. More...
 
void elektraSetUnsignedLongLong (Elektra *elektra, const char *keyname, kdb_unsigned_long_long_t value, ElektraError **error)
 Sets a unsigned long long value. More...
 
void elektraSetFloat (Elektra *elektra, const char *keyname, kdb_float_t value, ElektraError **error)
 Sets a float value. More...
 
void elektraSetDouble (Elektra *elektra, const char *keyname, kdb_double_t value, ElektraError **error)
 Sets a double value. More...
 

Detailed Description

Macro Definition Documentation

◆ ELEKTRA_TAG_DECLARATIONS

#define ELEKTRA_TAG_DECLARATIONS (   cType,
  typeName 
)
Value:
ELEKTRA_TAG (typeName) \
{ \
const char * keyName; \
cType (*get) ELEKTRA_GET_BY_TAG_PARAMS (typeName); \
cType (*getArrayElement) ELEKTRA_GET_ARRAY_ELEMENT_BY_TAG_PARAMS (typeName); \
void(*set) ELEKTRA_SET_BY_TAG_PARAMS (cType, typeName); \
void(*setArrayElement) ELEKTRA_SET_ARRAY_ELEMENT_BY_TAG_PARAMS (cType, typeName); \
}; \
\
ELEKTRA_GET_BY_TAG_SIGNATURE (cType, typeName); \
ELEKTRA_GET_ARRAY_ELEMENT_BY_TAG_SIGNATURE (cType, typeName); \
\
ELEKTRA_SET_BY_TAG_SIGNATURE (cType, typeName); \
ELEKTRA_SET_ARRAY_ELEMENT_BY_TAG_SIGNATURE (cType, typeName);
const char * keyName(const Key *key)
Returns a pointer to the abbreviated real internal key name.
Definition: elektra/keyname.c:213

Inserts the necessary declarations for a new Elektra Tag that can be used in combination with the generic getter and setter macros.

Parameters
cTypeThe C-Type of the value described by the tag.
typeNameThe unique identifier of this type that can be used as part of a C identifier.

◆ ELEKTRA_TAG_DEFINITIONS

#define ELEKTRA_TAG_DEFINITIONS (   cType,
  typeName,
  KDB_TYPE,
  VALUE_TO_STRING,
  KEY_TO_VALUE 
)

Inserts the necessary definitions for an Elektra Tag declared with ELEKTRA_TAG_DECLARATIONS.

Parameters
cTypeExact same value as in ELEKTRA_TAG_DECLARATIONS
typeNameExact same value as in ELEKTRA_TAG_DECLARATIONS
KDB_TYPEThe KDBType used in the type metadata of a Key.
VALUE_TO_STRINGA function which converts a value of type cType into a string. The string must be allocated with elektraMalloc(), so that it can be freed with elektraFree().
KEY_TO_VALUEA function which takes a Key an pointer to a variable of type cType and tries to convert the Key into cType. The function must return 1 on success and 0 otherwise. The supermacro "macros/type_create_to_value.h" may be used to create such a function.

◆ ELEKTRA_TAG_VALUE

#define ELEKTRA_TAG_VALUE (   tagName,
  keyname,
  typeName 
)
Value:
static const ELEKTRA_TAG (typeName) ELEKTRA_TAG_NAME (tagName) = { \
(keyname), \
ELEKTRA_GET_BY_TAG (typeName), \
ELEKTRA_GET_ARRAY_ELEMENT_BY_TAG (typeName), \
ELEKTRA_SET_BY_TAG (typeName), \
ELEKTRA_SET_ARRAY_ELEMENT_BY_TAG (typeName), \
};

Inserts a new static instance of an Elektra Tag.

Parameters
tagNameThe name of the new Tag instance. Will be prefixed with ELEKTRA_TAG_.
keynameThe name of the key this Tag instance corresponds to.
typeNameExact same value as in ELEKTRA_TAG_DECLARATIONS. This value is used to identify which kind of tag should be created.

◆ elektraGet

#define elektraGet (   elektra,
  tag 
)    ((tag).get (elektra, &(tag)))
Parameters
elektraThe elektra instance initialized with the parent key.
nameThe keyname to look up. The keyname is appended to the parent key.
indexThe array index of the desired element, starting with 0.
Returns
The value stored at the given key and index.

◆ elektraGetArrayElement

#define elektraGetArrayElement (   elektra,
  tag,
  index 
)    ((tag).getArrayElement (elektra, &(tag), index))
Parameters
elektraThe elektra instance initialized with the parent key.
keyNameThe keyname (or a codegenerated Tag) to look up. The keyname is appended to the parent key.
valueThe new value.
indexThe array index of the desired element, starting with 0. \
Returns
The value stored at the given key and index.

◆ elektraSet

#define elektraSet (   elektra,
  tag,
  value,
  error 
)    ((tag).set (elektra, &(tag), value, error))
Parameters
elektraThe elektra instance initialized with the parent key.
tagThe codegenerated Tag to write to.
valueThe new value.
errorPass a reference to an ElektraError pointer.

◆ elektraSetArrayElement

#define elektraSetArrayElement (   elektra,
  tag,
  index,
  value,
  error 
)    ((tag).setArrayElement (elektra, &(tag), index, value, error))
Parameters
elektraThe elektra instance initialized with the parent key.
tagThe code-generated tag to write to.
valueThe new value.
errorPass a reference to an ElektraError pointer.

Function Documentation

◆ elektraArraySize()

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

Gets the size of an array.

Parameters
elektraThe Elektra instance to use.
nameThe (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
elektraAn Elektra instance.

◆ elektraErrorCode()

ElektraErrorCode 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

◆ elektraErrorSeverity()

ElektraErrorSeverity elektraErrorSeverity ( const ElektraError *  error)
Returns
the severity of the given error

◆ elektraFatalError()

void elektraFatalError ( Elektra *  elektra,
ElektraError *  fatalError 
)

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

Parameters
elektraElektra instance whose fatal error handler shall be used.
fatalErrorThe 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
elektraAn Elektra instance.
fatalErrorHandlerThe 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
elektraThe Elektra instance to use.
nameThe relative name of the array.
indexThe index of the array element.
typeThe 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

◆ 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
elektraThe Elektra instance to use.
nameThe relative name of the key.
typeThe 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

◆ elektraGetArrayElementType()

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

Reads the type metadata of a given array element.

Parameters
elektraAn Elektra instance.
nameThe name of the array.
indexThe 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
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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 a octet value.

Parameters
elektraThe elektra instance to use.
keynameThe (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 a octet value array element.

Parameters
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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
elektraThe Elektra instance to use.
nameThe (relative) name of the key.
Returns
the raw value of the specified key or NULL, if the key was not found

◆ 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
elektraThe Elektra instance to use.
nameThe (relative) name of the array.
indexThe index of the array element.
Returns
the raw value of the specified key, or NULL if the key was not found

◆ elektraGetShort()

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

Gets a short value.

Parameters
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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
elektraThe elektra instance to use.
keynameThe (relative) name of the key to look up.
Returns
the string stored at the given key

◆ elektraGetStringArrayElement()

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

Gets a string value array element.

Parameters
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe index of the array element to look up.
Returns
the string stored at the given array element

◆ elektraGetType()

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

Reads the type metadata of a given key.

Parameters
elektraAn Elektra instance.
keynameThe 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
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe 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
elektraThe elektra instance to use.
keynameThe (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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to look up.
indexThe index of the array element to look up.
Returns
the unsigned short stored at the given array element

◆ elektraKDBErrorCode()

int elektraKDBErrorCode ( const ElektraError *  error)
Returns
the error code of the attached low-level error, or -1 if no low-level error is attached

◆ elektraKDBErrorDescription()

const char* elektraKDBErrorDescription ( const ElektraError *  error)
Returns
the description for the attached low-level error, or -1 if no low-level error is attached

◆ elektraKDBErrorGetWarning()

ElektraError* elektraKDBErrorGetWarning ( const ElektraError *  error,
int  index 
)
Returns
a newly allocated ElektraError representing the warning at the given index, or NULL if the index is out of range

the returned error will always have the following properties:

  • error code is #ELEKTRA_ERROR_CODE_LOW_LEVEL
  • description is ""
  • severity is #ELEKTRA_ERROR_SEVERITY_WARNING
  • the attached low-level error represents the warning in question

NOTE: you have to free the memory allocated by this function using elektraFree()

◆ elektraKDBErrorGroup()

ElektraKDBErrorGroup elektraKDBErrorGroup ( const ElektraError *  error)
Returns
the group from which the attached low-level error originated, or NULL if no low-level error is attached

◆ elektraKDBErrorKey()

Key* elektraKDBErrorKey ( const ElektraError *  error)
Returns
the Key from which the given kdb error was extracted, or NULL if no low-level error is attached

◆ elektraKDBErrorModule()

ElektraKDBErrorModule elektraKDBErrorModule ( const ElektraError *  error)
Returns
the module from which the attached low-level error originated, or NULL if no low-level error is attached

◆ elektraKDBErrorReason()

const char* elektraKDBErrorReason ( const ElektraError *  error)
Returns
the reason for the attached low-level error, or NULL if no low-level error is attached

◆ elektraKDBErrorSeverity()

ElektraErrorSeverity elektraKDBErrorSeverity ( const ElektraError *  error)
Returns
the severity of the attached low-level error, or ELEKTRA_ERROR_SEVERITY_FATAL if no low-level error is attached

◆ elektraKDBErrorWarningCount()

int elektraKDBErrorWarningCount ( const ElektraError *  error)
Returns
the number of warnings associated with the attached low-level error, or -1 if no low-level error is attached

◆ elektraSetBoolean()

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

Sets a boolean value.

Parameters
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new boolean value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new boolean value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new char value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new char value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new double value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new double value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new float value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new float value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new long value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new long value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new long long value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new long long value.
errorPass 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 a octet value.

Parameters
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new octet value.
errorPass 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 a octet value array element.

Parameters
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new octet value.
errorPass 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
elektraThe Elektra instance to use.
nameThe (relative) name of the key.
valueThe raw value to set.
typeThe type to set in the metadata of the key.
errorPointer 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
elektraThe Elektra instance to use.
nameThe (relative) name of the array.
indexThe index of the array element.
valueThe raw value to set.
typeThe type to set in the metadata of the (array element) key.
errorPointer 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new short value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new short value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new string value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new string value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new unsigned long value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new unsigned long value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new unsigned long long value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new unsigned long long value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name to write to.
valueThe new unsigned short value.
errorPass 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
elektraThe elektra instance to use.
keynameThe (relative) name of the array to write to.
indexThe index of the array element to write to.
valueThe new unsigned short value.
errorPass a reference to an ElektraError pointer. Will only be set in case of an error.