annotate src/oct-errno.h @ 5540:cda6a105ae9a before-ov-branch

[project @ 2005-11-17 05:47:13 by jwe]
author jwe
date Thu, 17 Nov 2005 05:47:13 +0000
parents d6163c0effd5
children 93c65f2a5668
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5465
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
1 // oct-errno.h.in
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
2 /*
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
3
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
4 Copyright (C) 2005 John W. Eaton
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
5
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
7
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
11 later version.
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
12
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
16 for more details.
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
17
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
19 along with Octave; see the file COPYING. If not, write to the Free
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
20 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
21 02110-1301, USA.
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
22
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
23 */
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
24
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
25 #if !defined (octave_errno_h)
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
26 #define octave_errno_h 1
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
27
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
28 #include <map>
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
29 #include <string>
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
30
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
31 #include "oct-map.h"
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
32
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
33 class
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
34 octave_errno
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
35 {
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
36 protected:
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
37
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
38 octave_errno (void);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
39
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
40 public:
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
41
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
42 ~octave_errno (void) { }
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
43
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
44 static bool instance_ok (void);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
45
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
46 static int lookup (const std::string& name);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
47
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
48 static Octave_map list (void);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
49
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
50 static int get (void) { return errno; }
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
51
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
52 static int set (int val)
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
53 {
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
54 int retval = errno;
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
55 errno = val;
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
56 return retval;
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
57 }
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
58
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
59 private:
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
60
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
61 std::map<std::string, int> errno_tbl;
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
62
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
63 static octave_errno *instance;
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
64
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
65 int do_lookup (const std::string& name);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
66
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
67 Octave_map do_list (void);
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
68 };
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
69
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
70 #endif
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
71
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
72 /*
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
73 ;;; Local Variables: ***
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
74 ;;; mode: C++ ***
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
75 ;;; page-delimiter: "^/\\*" ***
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
76 ;;; End: ***
d6163c0effd5 [project @ 2005-09-23 15:42:48 by jwe]
jwe
parents:
diff changeset
77 */