src_error.txt

Error printing system (error.c, error.h)
[NOTE: this file is not a Diff file!]

Task: print meaningful errors to Standard Error stream (stderr).

>>> error.c

--- FILENAME_SIZE
	* maximum length of program filename to be used in `print_error()' function

--- FMT_MESSAGE_SIZE
	* maximum length of message to be used in `print_error()' function

--- UNKNOWN_FILENAME
	* default array to be used when filename supplied to `print_error()' function is invalid

--- UNKNOWN_MESSAGE
	* default array to be used when message supplied to `print_error()' function is invalid

--- void print_error(const char *filename, const int linenum, const int errnum, const char *fmt_message, ...)
	* function which prints a formatted error message to stderr
	* retrieves corresponding `errno' message if `errnum' is different from 0 (zero)
	* if `filename' and/or `fmt_message' are invalid, as in either pointing to NULL or contain only NIL ('\0'), `UNKNOWN_FILENAME' and `UNKNOWN_MESSAGE' defaults will be used
	* this function should not be used directly; you should use the `PRINT_ERROR()' or `PRINT_ERROR_NOERRNO()'

>>> error.h

--- PRINT_ERROR(...)
	* macro which expands to a call to `print_error()' with default parameters
		* `filename' == __FILE__ (preprocessor macro)
		* `linenum' == __LINE__ (preprocessor macro)
		* `errnum' == errno (global variable in `errno.h')

--- PRINT_ERROR_NOERRNO(...)
	* same task as `PRINT_ERROR()' with defaults set as follows:
		* `filename' == __FILE__
		* `linenum' == __LINE__
		* `errnum' == 0
