abz_set_error3abz
Error functions
Usage
#include <abz/error.h> void abz_set_error(const char *fmt, ...); void abz_cat_error(const char *fmt, ...); void abz_clear_error(); const char *abz_get_error();
Libraries
Abz Library (-labz), Debug Library (-ldebug)
Overview
The functions in the error family can be used to store error messages. Error messages are set using abz_set_error(). Once set, an error message can not be overwritten. Call abz_clear_error() to clear the error message and abz_get_error() to retrieve the last set error message. If no error message is set, abz_get_error() returns an empty string.
It is possible to append error messages to the last set error message by calling abz_cat_error(). If an error already exist, a newline will be inserted between the two error messages. The usual rule of set-once-clear does not apply here (i.e. if you call this consecutive times, the error message will span multiple lines).
Notes
None of the libabz routines are thread-safe. I'm not planning to change this either! For more information, please see http://threading.2038bug.com/