ECONF\_ERRLOCATION(3) libeconf Manual ECONF\_ERRLOCATION(3)

# [NAME](#NAME)

econf\_errLocation - retrieve the location of the last error

# [SYNOPSIS](#SYNOPSIS)

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

**void econf\_errLocation(char \*\*filename, uint64\_t \*line\_nr);**

# [DESCRIPTION](#DESCRIPTION)

**econf\_errLocation** retrieves the file path and line number where the last libeconf error occurred. This information is stored in thread-local storage and is updated whenever a libeconf function encounters a parsing or processing error.

The *filename* argument is a pointer to a string pointer. On return, **econf\_errLocation** sets this pointer to a newly allocated string containing the absolute path of the file where the error occurred. The caller is responsible for freeing this memory using [**free**(3)](/man/os/libeconf/free.3).

The *line\_nr* argument is a pointer to a 64-bit unsigned integer. On return, it is set to the line number within the file where the error was detected.

# [RETURN VALUE](#RETURN_VALUE)

This function does not return a value.

# [NOTES](#NOTES)

If no error has occurred, or if the error location is not available, *\*filename* may be set to **NULL** and *\*line\_nr* to 0. Always check if *\*filename* is not **NULL** before attempting to use or free it.

# [SEE ALSO](#SEE_ALSO)

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

2024-03-12 libeconf

---

Document: econf_errLocation(3) from libeconf 0.8.5-r0 (Chainguard OS)
Source: https://github.com/openSUSE/libeconf
