ECONF_ERRLOCATION(3)

NAME
econf_errLocation - retrieve the location of the last error

SYNOPSIS

#include <libeconf.h>

void econf_errLocation(char **filename, uint64_t *line_nr);

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).

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

This function does not return a value.

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

econf_errString(3), libeconf(3)