File: func-ref-comedi-perror.html

package info (click to toggle)
comedilib 0.11.0-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 8,388 kB
  • sloc: xml: 19,779; ansic: 14,719; sh: 4,583; cpp: 2,195; ruby: 1,658; perl: 700; makefile: 604; yacc: 439; lex: 86; python: 17
file content (26 lines) | stat: -rw-r--r-- 3,722 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>comedi_perror</title><link rel="stylesheet" type="text/css" href="comedilib.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Comedi"><link rel="up" href="functionreference.html#idm4994" title="5.4.5. Error reporting"><link rel="prev" href="func-ref-comedi-loglevel.html" title="comedi_loglevel"><link rel="next" href="func-ref-comedi-strerror.html" title="comedi_strerror"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">comedi_perror</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="func-ref-comedi-loglevel.html">Prev</a> </td><th width="60%" align="center">5.4.5. Error reporting</th><td width="20%" align="right"> <a accesskey="n" href="func-ref-comedi-strerror.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="func-ref-comedi-perror"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>comedi_perror — print a Comedilib error message</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;comedilib.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">comedi_perror</b>(</code></td><td>const char * <var class="pdparam">s</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm5107"></a><h2>
      Description
    </h2><p>
When a Comedilib function fails, it usually returns <code class="literal">-1</code> or
<code class="constant">NULL</code>, depending on the return type.  An internal library
variable stores an error number, which can be retrieved with
<code class="function"><a class="link" href="func-ref-comedi-errno.html" title="comedi_errno">comedi_errno</a></code>.
This error number can be converted to a
human-readable form by the functions
<code class="function">comedi_perror</code> or
<code class="function"><a class="link" href="func-ref-comedi-strerror.html" title="comedi_strerror">comedi_strerror</a></code>.
</p><p>
These functions are intended to mimic the behavior of the
standard C library functions <code class="function">perror</code>,
<code class="function">strerror</code>, and <code class="varname">errno</code>.
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.
</p><p>
The function <code class="function">comedi_perror</code> prints an error message to
the standard error output stream <code class="varname">stderr</code>.
The error message consists of the argument string
<em class="parameter"><code>s</code></em>, a colon, a
space, a description of the error condition, and a new line.
</p><p>
    </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="func-ref-comedi-loglevel.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="functionreference.html#idm4994">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="func-ref-comedi-strerror.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">comedi_loglevel </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> comedi_strerror</td></tr></table></div></body></html>