MathEngine
Home Page       Structures       File List       Functions and Macros      

MeMessage.c File Reference

MathEngine message handling API implementation. More...

#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include "MeMessage.h"

Functions

void MeShowStdout (const int level,const char *const string)
 Print a string to stdout if the level is right. More...

void MeShowStderr (const int level,const char *const string)
 Print a string to stderr if the level is right. More...

void MeHandlerInfo (const int level, const char *const format,va_list ap)
 Default handler for information messages. More...

void MeHandlerWarning (const int level, const char *const format,va_list ap)
 Default handler for warning messages. More...

void MeHandlerFatalError (const int level,const char *const format,va_list ap)
 Default handler for fatal error messages. More...

void MeHandlerDebug (const int level,const char *const format,va_list ap)
 Default handler for fatal error messages. More...

MeShow MeSetInfoShow (MeShow n)
 Set the default informational message handler print function, returning the previous value. More...

MeShow MeSetWarningShow (MeShow n)
 Set the default warning message handler print function, returning the previous value. More...

MeShow MeSetFatalErrorShow (MeShow n)
 Set the default fatal error message handler print function, returning the previous value. More...

MeShow MeSetDebugShow (MeShow n)
 Set the default debug message handler print function, returning the previous value. More...

MeHandler MeSetInfoHandler (MeHandler n)
 Set the default informational message handler function, returning the previous value. More...

MeHandler MeSetWarningHandler (MeHandler n)
 Set the default warning message handler function, returning the previous value. More...

MeHandler MeSetFatalErrorHandler (MeHandler n)
 Set the default fatal error message handler function, returning the previous value. More...

MeHandler MeSetDebugHandler (MeHandler n)
 Set the default debug message handler function, returning the previous value. More...

void MeInfo (const int level, const char *const format,...)
 The informational message function. More...

void MeWarning (const int level, const char *const format,...)
 The warning message function. More...

void MeFatalError (const int level,const char *const format,...)
 The fatal error message function. More...

void MeDebug (const int level,const char *const format,...)
 The debug message function. More...


Variables

int MeInfoLevel = levelDEFAULT
 Informational messages of higher levels are not printed.

int MeWarningLevel = levelDEFAULT
 Warning messages of higher levels are not printed.

int MeFatalErrorLevel = levelDEFAULT
 Fatal error messages of higher levels are not printed.

int MeDebugLevel = levelDEFAULT
 Debug messages of higher level are not printed.

MeShow MeInfoShow = MeShowStderr
 Default information message handler output function.

MeShow MeWarningShow = MeShowStderr
 Default warning message handler output function.

MeShow MeFatalErrorShow = MeShowStderr
 Default fatal error message handler output function.

MeShow MeDebugShow = MeShowStderr
 Default debug message handler output function.

MeHandler MeInfoHandler = MeHandlerInfo
 Information message handler pointer.

MeHandler MeWarningHandler = MeHandlerWarning
 Warning message handler pointer.

MeHandler MeFatalErrorHandler = MeHandlerFatalError
 Fatal error message handler pointer.

MeHandler MeDebugHandler = MeHandlerDebug
 Debug message handler pointer.


Detailed Description

MathEngine message handling API implementation.


Function Documentation

void MeDebug ( int level,
const char * const format,
... )

The debug message function.

Calls a message handler, and the default ones will then call a message print function.

Parameters:
level   The level of the message.
format   A printf style format string.
...   The list of parameters for the format string.

void MeFatalError ( int level,
const char * const format,
... )

The fatal error message function.

Calls a message handler, and the default ones will then call a message print function. It will then by default abort the program.

Parameters:
level   The level of the message.
format   A printf style format string.
...   The list of parameters for the format string.

void MeHandlerDebug ( int level,
const char * const format,
va_list ap )

Default handler for fatal error messages.

Does nothing if the level of the message is greater than the current information message level. Otherwise formats it and prints it using *MeDebugShow.

void MeHandlerFatalError ( int level,
const char * const format,
va_list ap )

Default handler for fatal error messages.

Does nothing if the level of the message is greater than the current information message level. Otherwise formats it and prints it using *MeFatalErrorShow, and then aborts the program.

void MeHandlerInfo ( int level,
const char * const format,
va_list ap )

Default handler for information messages.

Does nothing if the level of the message is greater than the current information message level. Otherwise formats it and prints it using *MeInfoShow.

void MeHandlerWarning ( int level,
const char * const format,
va_list ap )

Default handler for warning messages.

Does nothing if the level of the message is greater than the current information message level. Otherwise formats it and prints it using *MeWarningShow.

void MeInfo ( int level,
const char * const format,
... )

The informational message function.

Calls a message handler, and the default ones will then call a message print function.

Parameters:
level   The level of the message.
format   A printf style format string.
...   The list of parameters for the format string.

MeHandler MeSetDebugHandler ( MeHandler n )

Set the default debug message handler function, returning the previous value.

Parameters:
n   handler function.
Returns:
the previous handler function.

MeShow MeSetDebugShow ( MeShow n )

Set the default debug message handler print function, returning the previous value.

Parameters:
n   a print function of type MeShow.

MeHandler MeSetFatalErrorHandler ( MeHandler n )

Set the default fatal error message handler function, returning the previous value.

Parameters:
n   handler function.
Returns:
the previous handler function.

MeShow MeSetFatalErrorShow ( MeShow n )

Set the default fatal error message handler print function, returning the previous value.

Parameters:
n   a print function of type MeShow.

MeHandler MeSetInfoHandler ( MeHandler n )

Set the default informational message handler function, returning the previous value.

Parameters:
n   handler function.
Returns:
the previous handler function.

MeShow MeSetInfoShow ( MeShow n )

Set the default informational message handler print function, returning the previous value.

Parameters:
n   a print function of type MeShow.

MeHandler MeSetWarningHandler ( MeHandler n )

Set the default warning message handler function, returning the previous value.

Parameters:
n   handler function.
Returns:
the previous handler function.

MeShow MeSetWarningShow ( MeShow n )

Set the default warning message handler print function, returning the previous value.

Parameters:
n   a print function of type MeShow.

void MeShowStderr ( int level,
const char * const string )

Print a string to stderr if the level is right.

This is the default messaging output function.

void MeShowStdout ( int level,
const char * const string )

Print a string to stdout if the level is right.

This could be a default messaging output function.

void MeWarning ( int level,
const char * const format,
... )

The warning message function.

Calls a message handler, and the default ones will then call a message print function.

Parameters:
level   The level of the message.
format   A printf style format string.
...   The list of parameters for the format string.

MathEngine Utilities: Message Manager API - Version 0.0.5 Alpha - Reference Manual generated using doxygen at Wed Oct 11 00:34:58 2000

Copyright MathEngine PLC 2000, all rights reserved.