GraphAlignment/src/GA_message.h File Reference

Message reporting. More...

Go to the source code of this file.


typedef enum GAMessageLevel_Impl GAMessageLevel
typedef void(*) GAMessageFunc (const char *, GAMessageLevel)


enum  GAMessageLevel_Impl { GA_MSG_DEBUG = 0, GA_MSG_INFO = 1, GA_MSG_WARNING = 2, GA_MSG_ERROR = 3 }


void GA_msg_default (const char *text, GAMessageLevel level)
GAMessageFunc GA_set_msg_func (GAMessageFunc msgfunc)
GAMessageFunc GA_msg ()

Detailed Description

Message reporting.

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 Documentation

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.

Enumeration Type Documentation

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.

GA_MSG_DEBUG  Message level: debug.
GA_MSG_INFO  Message level: info.
GA_MSG_WARNING  Message level: warning.
GA_MSG_ERROR  Message level: error.

Function Documentation

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.

Message reporting function.
See also:

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  ) 

Set message function.

Set the message reporting function. This function will then be used for all subsequent calls to GA_msg().

Message reporting function.
See also:

Generated on Thu Aug 16 15:28:41 2007 for Graphalignment(Rpackage) by  doxygen 1.5.1