From d127a631550ec65feef8be69fd59d7d0552481ea Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 13 Feb 2008 20:13:39 +0000 Subject: [PATCH] Updated references for error reporting functions. --- doc/error_funcref.txt | 85 ++++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 29 deletions(-) diff --git a/doc/error_funcref.txt b/doc/error_funcref.txt index 1a3fa4d..133b4fc 100644 --- a/doc/error_funcref.txt +++ b/doc/error_funcref.txt @@ -6,8 +6,11 @@ Description: NULL, depending on the return type. An internal library variable stores an error number, which can be retrieved with comedi_errno(). This error number can be converted to a - human-readable form by the functions comedi_perror() - and comedi_strerror(). + human-readable form by the functions + comedi_perror + and + comedi_strerror + . These functions are intended to mimic the behavior of the standard C library functions perror(), strerror(), and errno. @@ -19,10 +22,6 @@ Description: the most recent comedilib error. This integer may be used as the errnum parameter for comedi_strerror(). - Note that comedi_errno() is deliberately different than the - variable errno. This is to overcome difficulties in making - errno thread-safe. - Function: comedi_loglevel -- change Comedilib logging properties Retval: int Param: int loglevel @@ -39,20 +38,42 @@ Description: disabled by default when Comedilib is compiled. The meaning of the loglevels is as follows: - - COMEDI_LOGLEVEL=0 Comedilib prints nothing. - - COMEDI_LOGLEVEL=1 (default) Comedilib prints error messages when - there is a self-consistency error (i.e., an internal bug.) - - COMEDI_LOGLEVEL=2 Comedilib prints an error message when an invalid - parameter is passed. - - COMEDI_LOGLEVEL=3 Comedilib prints an error message whenever an - error is generated in the Comedilib library or in the C library, - when called by Comedilib. - - COMEDI_LOGLEVEL=4 Comedilib prints a lot of junk. + + + + + + + + + + + + + + + + + + + + + + + + + +
LoglevelBehavior
0Comedilib prints nothing.
1 + (default) Comedilib prints error messages when + there is a self-consistency error (i.e., an internal bug.) +
2 + Comedilib prints an error message when an invalid + parameter is passed. +
3 + Comedilib prints an error message whenever an + error is generated in the Comedilib library or in the C library, + when called by Comedilib. +
4Comedilib prints a lot of junk.
Returns: This function returns the previous loglevel. @@ -63,9 +84,12 @@ Description: When a Comedilib function fails, it usually returns -1 or NULL, depending on the return type. An internal library variable stores an error number, which can be retrieved with - comedi_errno(). This error number can be converted to a - human-readable form by the functions comedi_perror() - and comedi_strerror(). + comedi_errno + . This error number can be converted to a + human-readable form by the functions + comedi_perror() or + comedi_strerror + . These functions are intended to mimic the behavior of the standard C library functions perror(), strerror(), and errno. @@ -78,15 +102,16 @@ Description: space, a description of the error condition, and a new line. Function: comedi_strerror -- return string describing Comedilib error code -Retval: char * +Retval: const char * Param: int errnum Description: When a Comedilib function fails, it usually returns -1 or NULL, depending on the return type. An internal library variable stores an error number, which can be retrieved with comedi_errno(). This error number can be converted to a - human-readable form by the functions comedi_perror() - and comedi_strerror(). + human-readable form by the functions + comedi_perror + or comedi_strerror(). These functions are intended to mimic the behavior of the standard C library functions perror(), strerror(), and errno. @@ -96,7 +121,9 @@ Description: The function comedi_strerror() returns a pointer to a character string - describing the Comedilib error errnum. The persistence - of the returned pointer is undefined, and should not be trusted - after the next Comedilib call. An unrecognized error number will + describing the Comedilib error errnum. + The returned string may be + modified by a subsequent call to a strerr or perror function + (either the libc or Comedilib versions). + An unrecognized error number will return a pointer to the string "undefined error", or similar. -- 2.26.2