ECONF\_GETVALUE(3) libeconf Manual ECONF\_GETVALUE(3)

# [NAME](#NAME)

econf\_get&lt;type&gt;Value - retrieve a value from an econf configuration file

# [SYNOPSIS](#SYNOPSIS)

```
#include <libeconf.h>
```

**econf\_err econf\_getIntValue(econf\_file \*kf, const char \*group, const char \*key, int \*result);**

**econf\_err econf\_getInt64Value(econf\_file \*kf, const char \*group, const char \*key, int64\_t \*result);**

**econf\_err econf\_getUIntValue(econf\_file \*kf, const char \*group, const char \*key, unsigned int \*result);**

**econf\_err econf\_getUInt64Value(econf\_file \*kf, const char \*group, const char \*key, uint64\_t \*result);**

**econf\_err econf\_getFloatValue(econf\_file \*kf, const char \*group, const char \*key, float \*result);**

**econf\_err econf\_getDoubleValue(econf\_file \*kf, const char \*group, const char \*key, double \*result);**

**econf\_err econf\_getStringValue(econf\_file \*kf, const char \*group, const char \*key, char \*\*result);**

**econf\_err econf\_getBoolValue(econf\_file \*kf, const char \*group, const char \*key, bool \*result);**

# [DESCRIPTION](#DESCRIPTION)

These functions retrieve a value associated with a specific *group* and *key* from the parsed configuration file object pointed to by *kf*.

The *group* parameter specifies the section name in the configuration file. If *group* is **NULL**, the key is looked up in the upper part of the file without any group declaration. The *key* parameter specifies the name of the entry to retrieve.

Upon success, the retrieved value is converted to the appropriate data type and stored in the memory location pointed to by *result*.  
*result* is undefined if an error has occurred.

For **econf\_getStringValue**(), memory is dynamically allocated for the stored string. It is the responsibility of the caller to free this memory using [**free**(3)](/man/os/libeconf/free.3) when it is no longer needed.  
*result* is NULL if an error has occurred.

For **econf\_getBoolValue**(), the function parses common boolean strings (such as "true", "yes", "1", "false", "no", "0") irrespective of case.

# [RETURN VALUE](#RETURN_VALUE)

If the function succeeds, it returns **ECONF\_SUCCESS**.

On failure, a non-zero error code of type **econf\_err** is returned.

# [ERRORS](#ERRORS)

**ECONF\_KEY\_HAS\_NULL\_VALUE**

Given key has NULL value.

**ECONF\_NOMEM**

Memory allocation failed (specifically applicable to **econf\_getStringValue**).

**ECONF\_VALUE\_CONVERSION\_ERROR**

Value cannot be converted.

**ECONF\_NOKEY**

The specified *key* could not be found within the group.

**ECONF\_ARGUMENT\_IS\_NULL\_VALUE**

Given argument is NULL.

**ECONF\_PARSE\_ERROR**

Parse error. (specifically applicable to **econf\_getBooleanValue**).

**ECONF\_ERROR**

General error.

# [SEE ALSO](#SEE_ALSO)

[**libeconf**(3)](/man/os/libeconf/libeconf.3), [**econf\_free**(3)](/man/os/libeconf/econf_free.3), [**econf\_errString**(3)](/man/os/libeconf/econf_errString.3).

2023-12-01 libeconf

---

Document: econf_getUIntValue(3) from libeconf 0.8.6-r2 (Chainguard OS)
Source: https://github.com/openSUSE/libeconf
