comparison libinterp/interp-core/oct-errno.h @ 15195:2fc554ffbc28

split libinterp from src * libinterp: New directory. Move all files from src directory here except Makefile.am, main.cc, main-cli.cc, mkoctfile.in.cc, mkoctfilr.in.sh, octave-config.in.cc, octave-config.in.sh. * libinterp/Makefile.am: New file, extracted from src/Makefile.am. * src/Makefile.am: Delete everything except targets and definitions needed to build and link main and utility programs. * Makefile.am (SUBDIRS): Include libinterp in the list. * autogen.sh: Run config-module.sh in libinterp/dldfcn directory, not src/dldfcn directory. * configure.ac (AC_CONFIG_SRCDIR): Use libinterp/octave.cc, not src/octave.cc. (DL_LDFLAGS, LIBOCTINTERP): Use libinterp, not src. (AC_CONFIG_FILES): Include libinterp/Makefile in the list. * find-docstring-files.sh: Look in libinterp, not src. * gui/src/Makefile.am (liboctgui_la_CPPFLAGS): Find header files in libinterp, not src.
author John W. Eaton <jwe@octave.org>
date Sat, 18 Aug 2012 16:23:39 -0400
parents src/interp-core/oct-errno.h@909a2797935b
children
comparison
equal deleted inserted replaced
15194:0f0b795044c3 15195:2fc554ffbc28
1 // oct-errno.h.in
2 /*
3
4 Copyright (C) 2005-2012 John W. Eaton
5
6 This file is part of Octave.
7
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21
22 */
23
24 #if !defined (octave_errno_h)
25 #define octave_errno_h 1
26
27 #include <cerrno>
28 #include <map>
29 #include <string>
30
31 #include "oct-map.h"
32
33 class
34 octave_errno
35 {
36 protected:
37
38 octave_errno (void);
39
40 public:
41
42 ~octave_errno (void) { }
43
44 static bool instance_ok (void);
45
46 static void cleanup_instance (void) { delete instance; instance = 0; }
47
48 static int lookup (const std::string& name);
49
50 static octave_scalar_map list (void);
51
52 static int get (void) { return errno; }
53
54 static int set (int val)
55 {
56 int retval = errno;
57 errno = val;
58 return retval;
59 }
60
61 private:
62
63 std::map<std::string, int> errno_tbl;
64
65 static octave_errno *instance;
66
67 int do_lookup (const std::string& name);
68
69 octave_scalar_map do_list (void);
70 };
71
72 #endif