Error management is performed through callbacks provided by the user of the library. They are provided through a parameter with the following type:
Its pointer is defined as po_xerror_handler_t
. Contains
two fields, xerror
and xerror2
, with the following function
signatures.
This function is called to signal a problem of the given severity.
It must not return if severity is
PO_SEVERITY_FATAL_ERROR
.
message_text is the problem description. When multiline_p is true, it can contain multiple lines of text, each terminated with a newline, otherwise a single line.
message and/or filename and lineno indicate where the problem occurred:
NULL
, filename and lineno and
column should be ignored.
(size_t)(-1)
, lineno and column
should be ignored.
(size_t)(-1)
, it should be ignored.
This function is called to signal a problem of the given severity
that refers to two messages. It must not return if
severity is PO_SEVERITY_FATAL_ERROR
.
It is similar to two calls to xerror. If possible, an ellipsis can be appended to message_text1 and prepended to message_text2.