00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_errno_h)
00025 #define octave_errno_h 1
00026
00027 #include <cerrno>
00028 #include <map>
00029 #include <string>
00030
00031 #include "oct-map.h"
00032
00033 class
00034 octave_errno
00035 {
00036 protected:
00037
00038 octave_errno (void);
00039
00040 public:
00041
00042 ~octave_errno (void) { }
00043
00044 static bool instance_ok (void);
00045
00046 static int lookup (const std::string& name);
00047
00048 static Octave_map list (void);
00049
00050 static int get (void) { return errno; }
00051
00052 static int set (int val)
00053 {
00054 int retval = errno;
00055 errno = val;
00056 return retval;
00057 }
00058
00059 private:
00060
00061 std::map<std::string, int> errno_tbl;
00062
00063 static octave_errno *instance;
00064
00065 int do_lookup (const std::string& name);
00066
00067 Octave_map do_list (void);
00068 };
00069
00070 #endif
00071
00072
00073
00074
00075
00076
00077