econf_getKeys - Man Page

evaluate all keys of a specific group

Synopsis

#include <libeconf​.h>

econf_err econf_getKeys(econf_file *kf, const char *group, size_t *length, char ***keys);

Description

The econf_getKeys() function retrieves all keys belonging to a specific group from the configuration file object pointed to by kf​.

The group parameter specifies the name of the section (group) to be evaluated​. If group is NULL, the function retrieves keys that do not belong to any specific group (entries defined at the beginning of the file)​.

The total number of keys found is stored in the integer pointed to by length​.

The names of the keys are stored in a dynamically allocated array of strings, which is returned via the keys pointer​. The memory for this array is allocated by the library and should be freed by the caller using econf_freeArray() or an equivalent method when it is no longer needed​.

Return Value

Upon successful completion, the function returns ECONF_SUCCESS​.

Otherwise, an error value is returned to indicate the error condition​.

Errors

ECONF_ARGUMENT_IS_NULL_VALUE

         The value specified by kf or keys is NULL​.

ECONF_NOKEY

         Keys not found​.

ECONF_NOMEM

         Insufficient memory could be allocated for the return array​.

See Also

libeconf(3), econf_getGroups(3), econf_freeArray(3), econf_readFile(3), econf_errString(3)​.

Info

2023-12-15 libeconf Manual