econf_getGroups - Man Page

retrieve all groups from a configuration file

Synopsis

#include <libeconf​.h>

econf_err econf_getGroups(econf_file *kf, size_t *length, char ***groups);

Description

The econf_getGroups() function retrieves a list of all groups (sections) defined in the configuration file object specified by kf​.

Upon successful return, length will contain the number of groups found, and groups will point to a newly allocated array of strings (group names)​. The memory for this array and the strings within it is allocated by the function and must be freed by the caller using econf_freeArray()​.

Return Value

If successful, ECONF_SUCCESS is returned​. Otherwise, an error code is returned to indicate the error​.

Errors

ECONF_ARGUMENT_IS_NULL_VALUE

         The value specified by kf, length, or groups is NULL​.

ECONF_NOGROUP

         Group not found​.

ECONF_NOMEM

         Insufficient memory was available to allocate the groups array​.

See Also

libeconf(3), econf_getKeys(3), econf_freeArray(3), econf_errString(3)​

Info

2023-12-15 libeconf Manual