[
Index ] [ Bottom ]

Error v1 (Part 1)


[
Top | Index | Bottom | Source ]

void ErrorClean (void)
----------------------
resets (cleans) the error message and number

[
Top | Index | Bottom | Source ]

void ErrorInit (int mode)
-------------------------
resets the error message and the print mode, see also 
ErrorSetPrintMode(). Normally not needed. 

[
Top | Index | Bottom | Source ]

void ErrorSet (int number, char* header, char* message)
-------------------------------------------------------
sets an error number, header and unformatted error message.
The header is usually the function name in which the
error occured.

Example: ErrorSet(0,"MyFunc","something went wrong");  

[
Top | Index | Bottom | Source ]

void ErrorSetF (int number, char* header, char* format, ...)
------------------------------------------------------------
sets an error number, header and formatted error message. 
The header is usually the function name in which the error occured.
The formatted message can be constructed like with printf().

Example: ErrorSetF(0,"MyFunc","name %s unknown",name);  

[
Top | Index | Bottom | Source ]

void ErrorSetSystem (int number, char* header, char* message)
-------------------------------------------------------------
sets an error number, header and unformatted error message including
the system error message (like with perror).
The header is usually the function name in which the error occured. 

Example: ErrorSetSystem(0, "MyFunc", "open failed");  

[
Top | Index | Bottom | Source ]

void ErrorSetSystemF (int number, char* header, char* format, ...)
------------------------------------------------------------------
sets an error number, header and formatted error message including
the system error message (like with perror).
The header is usually the function name in which the error occured. 
The formatted message can be constructed like with printf().

Example: ErrorSetSystem(0, "MyFunc", "can not open %s", name);  

[
Top | Index | Bottom | Source ]

void ErrorSetPrintMode (int mode)
---------------------------------
allows to modifiy the print mode. By default all messages are
print to standard output. Possible modes for the moment are:

mode = Error_PRINT_OFF     : no print out of the error message.
       Error_PRINT_AT_SET  : print when ErrorSetXxx() is called.
       Error_PRINT_AT_GET  : print when ErrorGetXxx() is called.
       Error_PRINT_DEFAULT : = Error_PRINT_AT_SET; 

[
Top | Index | Bottom | Source ]

int ErrorGetPrintMode (void)
----------------------------
returns current print mode, see also ErrorSetPrintMode().

[
Top | Index | Bottom | Source ]

int ErrorGetNumber (void)
-------------------------
returns the error number of the most previous error.

[
Top | Index | Bottom | Source ]

int ErrorGetCount (void)
------------------------
returns the current error count.

[
Top | Index | Bottom | Source ]

char* ErrorGetMessage (void)
----------------------------
returns the error message of the most previous error.

[
Top | Index | Bottom | Source ]

int ErrorCopyMessage (char* destination)
----------------------------------------
returns the error number and copies the error message of the 
most previous error into <destination>.

[
Index ] [ Top ]
Created 25/02/97 11:55 by source2html v0.9