ECONF\_GETGROUPS(3) libeconf Manual ECONF\_GETGROUPS(3)

# [NAME](#NAME)

econf\_getGroups - retrieve all groups from a configuration file

# [SYNOPSIS](#SYNOPSIS)

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

**econf\_err econf\_getGroups(econf\_file \*kf, size\_t \*length, char \*\*\*groups);**

# [DESCRIPTION](#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](#RETURN_VALUE)

If successful, **ECONF\_SUCCESS** is returned. Otherwise, an error code is returned to indicate the error.

# [ERRORS](#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](#SEE_ALSO)

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

2023-12-15 libeconf

---

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