ECONF\_SETVALUE(3) libeconf Manual ECONF\_SETVALUE(3)

# [NAME](#NAME)

econf\_set&lt;type&gt;Value - set a value for a key in a configuration file object

# [SYNOPSIS](#SYNOPSIS)

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

**econf\_err econf\_setBoolValue(econf\_file \*kf, const char \*group, const char \*key, bool value);**

**econf\_err econf\_setDoubleValue(econf\_file \*kf, const char \*group, const char \*key, double value);**

**econf\_err econf\_setFloatValue(econf\_file \*kf, const char \*group, const char \*key, float value);**

**econf\_err econf\_setIntValue(econf\_file \*kf, const char \*group, const char \*key, int value);**

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

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

**econf\_err econf\_setStringValue(econf\_file \*kf, const char \*group, const char \*key, const char \*value);**

**econf\_err econf\_setValue(econf\_file \*kf, const char \*group, const char \*key, const char \*value);**

# [DESCRIPTION](#DESCRIPTION)

These functions set the value of a key in the given configuration file object *kf*. The key is specified by *group* and *key*. If *group* is **NULL**, the key is considered to belong to none group.

If the key already exists, its value is updated. If the key or the group does not exist, it is created.

The typed function **econf\_setBoolValue** converts the given *value* into a string representation before storing it.

# [RETURN VALUE](#RETURN_VALUE)

Upon successful completion, these functions return **ECONF\_SUCCESS**.

On error, a non-zero error code is returned (see the section called “ERRORS”).

# [ERRORS](#ERRORS)

ECONF\_NOMEM

Insufficient memory to allocate the new entry or group.

ECONF\_FILE\_LIST\_IS\_NULL

Conf file list is NULL.

ECONF\_EMPTYKEY

Key is NULL or has empty value.

ECONF\_NOKEY

Key not found.

ECONF\_WRONG\_BOOLEAN\_VALUE

Wrong boolean value (1/0 true/false yes/no).

# [SEE ALSO](#SEE_ALSO)

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

2024-12-13 libeconf

---

Document: econf_setStringValue(3) from libeconf 0.8.5-r0 (Chainguard OS)
Source: https://github.com/openSUSE/libeconf
