Retval: int
Param: void
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
+ When a Comedilib function fails, it usually returns <literal>-1</literal> or
+ <constant>NULL</constant>, depending on the return type. An internal library
+ variable stores an error number, which can be retrieved by calling
+ <function>comedi_errno</function> This error number can be converted to a
human-readable form by the functions
- <link linkend="func-ref-comedi-perror"><function>comedi_perror</function></link>
+ <function><link linkend="func-ref-comedi-perror">comedi_perror</link></function>
and
- <link linkend="func-ref-comedi-strerror"><function>comedi_strerror</function></link>
- .
+ <function><link linkend="func-ref-comedi-strerror">comedi_strerror</link></function>.
These functions are intended to mimic the behavior of the
- standard C library functions perror(), strerror(), and errno.
+ standard C library functions <function>perror</function>,
+ <function>strerror</function>, and <varname>errno</varname>.
In particular, Comedilib functions sometimes return an error
that is generated inside the C library; the comedi error
message in this case is the same as the C library.
- The function comedi_errno() returns an integer describing
- the most recent comedilib error. This integer may be used
- as the errnum parameter for comedi_strerror().
+ The function <function>comedi_errno</function> returns an integer describing
+ the most recent Comedilib error. This integer may be used
+ as the <parameter class="function">errnum</parameter> parameter for
+ <function>comedi_strerror</function>.
Function: comedi_loglevel -- change Comedilib logging properties
Retval: int
Param: int loglevel
Description:
This function affects the output of debugging and error messages
- from Comedilib. By increasing the loglevel, additional debugging
+ from Comedilib. By increasing the log level <parameter
+ class="function">loglevel</parameter>, additional debugging
information will be printed. Error and debugging messages are
- printed to the stream stderr.
+ printed to the standard error output stream <varname>stderr</varname>.
The default loglevel can be set by using the environment variable
- COMEDI_LOGLEVEL. The default loglevel is 1.
+ <envar>COMEDI_LOGLEVEL</envar>. The default log level is 1.
In order to conserve resources, some debugging information is
disabled by default when Comedilib is compiled.
- The meaning of the loglevels is as follows:
- <table frame="box" rules="all">
- <tr>
- <th>Loglevel</th>
- <th>Behavior</th>
- </tr>
- <tr>
- <td>0</td>
- <td>Comedilib prints nothing.</td>
- </tr>
- <tr>
- <td>1</td>
- <td>
- (default) Comedilib prints error messages when
- there is a self-consistency error (i.e., an internal bug.)
- </td>
- </tr>
- <tr>
- <td>2</td>
- <td>
- Comedilib prints an error message when an invalid
- parameter is passed.
- </td>
- </tr>
- <tr>
- <td>3</td>
- <td>
- Comedilib prints an error message whenever an
- error is generated in the Comedilib library or in the C library,
- when called by Comedilib.
- </td>
- </tr>
- <tr>
- <td>4</td>
- <td>Comedilib prints a lot of junk.</td>
- </tr>
- </table>
+ The meaning of the log levels is as follows:
+ <informaltable colsep="1" rowsep="1">
+ <tgroup cols="2" align="left">
+ <colspec colwidth="*"/>
+ <colspec colwidth="5*"/>
+ <thead>
+ <row>
+ <entry>Loglevel</entry>
+ <entry>Behavior</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry>Comedilib prints nothing.</entry>
+ </row>
+ <row>
+ <entry>1</entry>
+ <entry>
+ (default) Comedilib prints error messages when
+ there is a self-consistency error (i.e., an internal bug.)
+ </entry>
+ </row>
+ <row>
+ <entry>2</entry>
+ <entry>
+ Comedilib prints an error message when an invalid
+ parameter is passed.
+ </entry>
+ </row>
+ <row>
+ <entry>3</entry>
+ <entry>
+ Comedilib prints an error message whenever an
+ error is generated in the Comedilib library or in the C library,
+ when called by Comedilib.
+ </entry>
+ </row>
+ <row>
+ <entry>4</entry>
+ <entry>Comedilib prints a lot of junk.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
Returns:
- This function returns the previous loglevel.
+ This function returns the previous log level.
Function: comedi_perror -- print a Comedilib error message
Retval: void
Param: const char * s
Description:
- When a Comedilib function fails, it usually returns -1 or
- NULL, depending on the return type. An internal library
+ When a Comedilib function fails, it usually returns <literal>-1</literal> or
+ <constant>NULL</constant>, depending on the return type. An internal library
variable stores an error number, which can be retrieved with
- <link linkend="func-ref-comedi-errno"><function>comedi_errno</function></link>
- . This error number can be converted to a
+ <function><link linkend="func-ref-comedi-errno">comedi_errno</link></function>.
+ This error number can be converted to a
human-readable form by the functions
- comedi_perror() or
- <link linkend="func-ref-comedi-strerror"><function>comedi_strerror</function></link>
- .
+ <function>comedi_perror</function> or
+ <function><link linkend="func-ref-comedi-strerror">comedi_strerror</link></function>.
These functions are intended to mimic the behavior of the
- standard C library functions perror(), strerror(), and errno.
+ standard C library functions <function>perror</function>,
+ <function>strerror</function>, and <varname>errno</varname>.
In particular, Comedilib functions sometimes return an error
that is generated inside the C library; the comedi error
message in this case is the same as the C library.
- The function comedi_perror() prints an error message to stderr.
- The error message consists of the argument string, a colon, a
+ The function <function>comedi_perror</function> prints an error message to
+ the standard error output stream <varname>stderr</varname>.
+ The error message consists of the argument string
+ <parameter class="function">s</parameter>, a colon, a
space, a description of the error condition, and a new line.
Function: comedi_strerror -- return string describing Comedilib error code
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
+ When a Comedilib function fails, it usually returns <literal>-1</literal> or
+ <constant>NULL</constant>, 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
+ <function><link linkend="func-ref-comedi-errno">comedi_errno</link></function>.
+ This error number can be converted to a
human-readable form by the functions
- <link linkend="func-ref-comedi-perror"><function>comedi_perror</function></link>
- or comedi_strerror().
+ <function><link linkend="func-ref-comedi-perror">comedi_perror</link></function>
+ or <function>comedi_strerror</function>.
These functions are intended to mimic the behavior of the
- standard C library functions perror(), strerror(), and errno.
+ standard C library functions <function>perror</function>,
+ <function>strerror</function>, and <varname>errno</varname>.
In particular, Comedilib functions sometimes return an error
that is generated inside the C library; the comedi error
message in this case is the same as the C library.
- The function comedi_strerror() returns a pointer to a
+ The function <function>comedi_strerror</function> returns a pointer to a
character string
- describing the Comedilib error <parameter>errnum</parameter>.
+ describing the Comedilib error <parameter class="function">errnum</parameter>.
The returned string may be
- modified by a subsequent call to a strerr or perror function
- (either the libc or Comedilib versions).
+ modified by a subsequent call to a <function>strerr</function> or
+ <function>perror</function> function
+ (either the <systemitem class="library">libc</systemitem> or Comedilib versions).
An unrecognized error number will
- return a pointer to the string "undefined error", or similar.
+ return a pointer to the string <quote>undefined error</quote>, or similar.