ECONF\_NEWKEYFILE(3) libeconf Manual ECONF\_NEWKEYFILE(3)

# [NAME](#NAME)

econf\_newKeyFile - create a new econf\_file object

# [SYNOPSIS](#SYNOPSIS)

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

**econf\_err econf\_newKeyFile(econf\_file \*\*result, char delimiter, char comment);**

# [DESCRIPTION](#DESCRIPTION)

The **econf\_newKeyFile** function creates a new, empty **econf\_file** object. It allocates the necessary memory and initializes the structure.

The *result* parameter is a pointer to a pointer where the newly created **econf\_file** object will be stored upon success.

The *delimiter* parameter specifies the character used to separate keys from values in the configuration file (e.g., '=' or ' ').

The *comment* parameter specifies the character used to mark the beginning of a comment line (e.g., '#' or ';').

# [RETURN VALUE](#RETURN_VALUE)

On success, **econf\_newKeyFile** returns **ECONF\_SUCCESS**.

On failure, a non-zero error code of type **econf\_err** is returned, and *\*result* may be set to NULL.

# [ERRORS](#ERRORS)

**ECONF\_NOMEM**

Insufficient memory to allocate the new **econf\_file** object.

# [SEE ALSO](#SEE_ALSO)

[**libeconf**(3)](/man/os/libeconf/libeconf.3), [**econf\_newIniFile**(3)](/man/os/libeconf/econf_newIniFile.3), [**econf\_newKeyFile\_with\_options**(3)](/man/os/libeconf/econf_newKeyFile_with_options.3), [**econf\_freeFile**(3)](/man/os/libeconf/econf_freeFile.3), [**econf\_errString**(3)](/man/os/libeconf/econf_errString.3).

2024-12-03 libeconf

---

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