Scroll to navigation

ECONF_SETEXTVALUE(3) libeconf Manual ECONF_SETEXTVALUE(3)

NAME

econf_setExtValue - set extended value for a key in a configuration file structure

SYNOPSIS

#include <libeconf.h>
#include <libeconf_ext.h>

int econf_setExtValue(econf_file *key_file, const char *group, const char *key, const econf_ext_value *value);

DESCRIPTION

The econf_setExtValue() function adds or modifies a key's value in the configuration file structure referenced by key_file. This function allows setting the value using the full econf_ext_value structure, which includes additional metadata such as the file source, comments and line number.

The function cannot be used for setting the value. Values have to be set via econf_set<Type>Value.

The key will be set within the specified group. If group is NULL or an empty string, the key is set in the global section.

The parameters are defined as:

key_file


A pointer to the econf_file structure where the key/value pair should be modified.

group


The name of the configuration group (section) to which the key belongs.

key


The name of the key to set.

value


A pointer to the econf_ext_value structure containing additional information.

RETURN VALUE

On success, econf_setExtValue() returns ECONF_SUCCESS.

On error, a non-zero error number is returned. The function returns a value from the econf_err enumeration.

ERRORS

ECONF_NOMEM


Memory allocation failed.

SEE ALSO

libeconf(3), econf_readConfig(3), econf_errString(3).

2025-01-01 libeconf