Error Tracer

Instructions manual





OKit: Object Tree, RPL Virtual Machine and compiler shared library

Copyright (C) 2000 Yann LANDRIN-SCHWEITZER


This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA


Author: Yann LANDRIN-SCHWEITZER
Contact: varkhan@free.fr
Homepage: http://varkhan.free.fr/





Error loging functions






Function OKit_SETERRLOGFILE

void OKit_SETERRLOGFILE(int fd) ;
Sets the file where error traces will be printed.


Args
_fd:file descriptor representing an open stream to use to print traces



Function OKit_ERRTRACEON

void OKit_ERRTRACEON() ;
Toggles error tracing on.



Function OKit_ERRTRACEOFF

void OKit_ERRTRACEOFF() ;
Toggles error tracing off.



Function OKit_ERRTRACEDBG

void OKit_ERRTRACEDBG(unsigned long dbglevel) ;
Sets the debugging level mask.


Args
_dbglevel:new debugging mask



Function OKit_FATALERR

void OKit_FATALERR(int err) ;
Adds an error number to the list of fatal errors.


Args
_err:makes err to be a fatal error



Function OKit_ERRMARK

void OKit_ERRMARK() ;
Marks the error log.



Function OKit_DEBUG

void OKit_DEBUG(char * funcname, unsigned char dbglevel, char * message, ...) ;
Produces an error from function 'funcname', and message 'message', at debugging level 'dbglevel'.


Args
_funcname:name of the function from which this call was issued
_dbglevel:debugging level at which this error is raised
_message:optional message to add to transcript


Note
Variable arguments are formatted following escapes in the message string,
taking the form '%d*?' where d* is any number of digits and ? is either:
_ % : a litteral '%' character is printed
_ c : the argument is a character
_ s : the argument is a string, and will be printed as-is
_ u : the argument is an unsigned number, printed in decimal form
_ x : the argument is an unsigned number, printed in hexadecimal form
For s,u,x, the digits before the conversion character denotes the maximum
number of characters to be printed


Note
The error levels used in this library are:
_ 0 : memory failures
_ 1 : argument passing (objects)
_ 2 : argument passing (system)
_ 3 : synchronization locks
_ 4 : syntax errors



Function OKit_ERROR

void OKit_ERROR(char * funcname, char * message, ...) ;
Produces an error from function 'funcname', and message 'message'.


Args
_funcname:name of the function from which this call was issued
_message:optional message to add to transcript


Note
Variable arguments are formatted following escapes in the message string,
taking the form '%d*?' where d* is any number of digits and ? is either:
_ % : a litteral '%' character is printed
_ c : the argument is a character
_ s : the argument is a string, and will be printed as-is
_ u : the argument is an unsigned number, printed in decimal form
_ x : the argument is an unsigned number, printed in hexadecimal form
For s,u,x, the digits before the conversion character denotes the maximum
number of characters to be printed



Function OKit_MESSAGE

void OKit_MESSAGE(char * funcname, char * message, ...) ;
Produces an information message from function 'funcname', and message 'message'.


Args
_funcname:name of the function from which this call was issued
_message:optional message to add to transcript


Note
Variable arguments are formatted following escapes in the message string,
taking the form '%d*?' where d* is any number of digits and ? is either:
_ % : a litteral '%' character is printed
_ c : the argument is a character
_ s : the argument is a string, and will be printed as-is
_ u : the argument is an unsigned number, printed in decimal form
_ x : the argument is an unsigned number, printed in hexadecimal form
For s,u,x, the digits before the conversion character denotes the maximum
number of characters to be printed



Function OKit_ERRPRINT

void OKit_ERRPRINT() ;
Prints the last error in log to the file specified by SETERRLOGFILE (default 2: stderr).



Function OKit_ERRFLUSH

void OKit_ERRFLUSH() ;