File: error.h.html

package info (click to toggle)
rudiments 0.31-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,516 kB
  • ctags: 3,248
  • sloc: asm: 23,776; cpp: 22,792; sh: 7,769; ansic: 1,769; makefile: 1,054; xml: 169; perl: 19
file content (58 lines) | stat: -rw-r--r-- 3,385 bytes parent folder | download | duplicates (2)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<html>
<head>
<title>~/src/firstworks/rudiments-0.31/include/rudiments/error.h.html</title>
<meta name="Generator" content="Vim/7.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#0000ff">// Copyright (c) 2005 David Muse</font>
<font color="#0000ff">// See the COPYING file for more information.</font>

<font color="#a020f0">#ifndef ERROR_H</font>
<font color="#a020f0">#define ERROR_H</font>

<font color="#a020f0">#include </font><font color="#ff00ff">&lt;errno.h&gt;</font>

<font color="#0000ff">// The error class provides an interface to the errors that system calls</font>
<font color="#0000ff">// can generate.</font>

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
<font color="#2e8b57"><b>namespace</b></font> rudiments {
<font color="#a020f0">#endif</font>

<font color="#2e8b57"><b>class</b></font> error {
        <font color="#a52a2a"><b>public</b></font>:
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>           clearError();
                                        <font color="#0000ff">// Set the current system call error to</font>
                                        <font color="#0000ff">// 0, &quot;Success&quot;.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>           setErrorNumber(<font color="#2e8b57"><b>int</b></font> err);
                                        <font color="#0000ff">// Set the current system call error to</font>
                                        <font color="#0000ff">// &quot;err&quot;.  &quot;err&quot; should be one of the</font>
                                        <font color="#0000ff">// errors defined in error.h such as</font>
                                        <font color="#0000ff">// EINTR, ENOMEM, etc.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>int</b></font>            getErrorNumber();
                                        <font color="#0000ff">// Returns the current system call</font>
                                        <font color="#0000ff">// error.  Will match one of the errors</font>
                                        <font color="#0000ff">// defined in error.h such as EINTR,</font>
                                        <font color="#0000ff">// ENOMEM, etc.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font>     *getErrorString();
                                        <font color="#0000ff">// Returns a string representation</font>
                                        <font color="#0000ff">// of the current system call error.</font>
                                        <font color="#0000ff">//</font>
                                        <font color="#0000ff">// Note: this method returns a pointer</font>
                                        <font color="#0000ff">// to an internal buffer which may be</font>
                                        <font color="#0000ff">// overwritten at any time.</font>
};

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
}
<font color="#a020f0">#endif</font>

<font color="#a020f0">#endif</font>
</pre>
</body>
</html>