GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
oct-errno.h
Go to the documentation of this file.
1 // oct-errno.h.in
2 /*
3 
4 Copyright (C) 2005-2017 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_oct_errno_h)
25 #define octave_oct_errno_h 1
26 
27 #include "octave-config.h"
28 
29 #include <cerrno>
30 #include <map>
31 #include <string>
32 
33 #include "oct-map.h"
34 
35 class
37 {
38 protected:
39 
40  octave_errno (void);
41 
42 public:
43 
44  ~octave_errno (void) { }
45 
46  static bool instance_ok (void);
47 
48  static void cleanup_instance (void) { delete instance; instance = 0; }
49 
50  static int lookup (const std::string& name);
51 
52  static octave_scalar_map list (void);
53 
54  static int get (void) { return errno; }
55 
56  static int set (int val)
57  {
58  int retval = errno;
59  errno = val;
60  return retval;
61  }
62 
63 private:
64 
65  std::map<std::string, int> errno_tbl;
66 
68 
69  int do_lookup (const std::string& name);
70 
71  octave_scalar_map do_list (void);
72 };
73 
74 #endif
static void cleanup_instance(void)
Definition: oct-errno.h:48
The value of lines which begin with a space character are not saved in the history list A value of all commands are saved on the history list
Definition: oct-hist.cc:728
static octave_errno * instance
Definition: oct-errno.h:67
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
octave_idx_type lookup(const T *x, octave_idx_type n, T y)
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number!nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable name
Definition: input.cc:871
octave_value retval
Definition: data.cc:6294
~octave_errno(void)
Definition: oct-errno.h:44
std::map< std::string, int > errno_tbl
Definition: oct-errno.h:65
static int set(int val)
Definition: oct-errno.h:56
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854