Go to the source code of this file.
Typedefs | |
typedef enum GAMessageLevel_Impl | GAMessageLevel |
typedef void(*) | GAMessageFunc (const char *, GAMessageLevel) |
Enumerations | |
enum | GAMessageLevel_Impl { GA_MSG_DEBUG = 0, GA_MSG_INFO = 1, GA_MSG_WARNING = 2, GA_MSG_ERROR = 3 } |
Functions | |
void | GA_msg_default (const char *text, GAMessageLevel level) |
GAMessageFunc | GA_set_msg_func (GAMessageFunc msgfunc) |
GAMessageFunc | GA_msg () |
This module provides a simple API for reporting messages. It can be used to provide information to the user as well as error reporting. The message handler can be set at run-time, so the right method of output can be selected easily depending on the project and context in which the module is being used. A message level can be specified along with the message to allow a handler to determine the correct method of output. A default handler is provided for message reporting to the standard output stream. The default handler also provides some special formatting of messages depending on the message level.
typedef void(*) GAMessageFunc(const char *, GAMessageLevel) |
Message reporting function.
This is the specification for message reporting functions which can then be set using GA_set_msg_func().
typedef enum GAMessageLevel_Impl GAMessageLevel |
Message level.
enum GAMessageLevel_Impl |
Message level (implementation).
The message level is used as additional information for message reporting functions to determine how the message should be formatted and which method of output is to be used. Exact behavior of message levels is implementation defined.
GAMessageFunc GA_msg | ( | ) |
Get message function.
Get the message reporting function. The message reporting function may be set with GA_set_msg_func(). This API is a generic, redirectable way of reporting various informational and debug messages as well as errors. A default implementation is provided for simple cases. To send a message, use
GA_msg()(<message>, <message level>)
where message
is the actual message and message level is a value specifying the type of message. Interpretation of this value is implementation defined. See GAMessageLevel for values recognized by the default implementation.
void GA_msg_default | ( | const char * | text, | |
GAMessageLevel | level | |||
) |
Report a message.
Report a message. This is the default implementation for message reporting which will write messages to standard output. Some formatting is done depending on the message level.
text | Text of the message. | |
level | Message level. |
GAMessageFunc GA_set_msg_func | ( | GAMessageFunc | msgfunc | ) |