econf_errLocation - Man Page

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)

Info

2024-03-12 libeconf Manual