Mercurial > hg > octave-lyh
annotate libinterp/corefcn/oct-errno.in.cc @ 17328:ea23eb07f8ed
Add missing TeX symbols and fix few others (bug #39828).
* libinterp/corefcn/oct-tex-lexer.ll (ID): Allow digit characters.
* libinterp/corefcn/txt-eng.cc (symbol_names): Add "angle", "ast",
"sim", "Leftarrow" and "Rightarrow".
(symbol_codes): Likewise. Fix unicode values for symbols "langle" and
"rangle".
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Fri, 23 Aug 2013 11:47:04 -0400 |
parents | 68fc671a9339 |
children |
rev | line source |
---|---|
15096
909a2797935b
maint: Move interp source code without DEFUNs to interp-core/ dir.
Rik <rik@octave.org>
parents:
14547
diff
changeset
|
1 // DO NOT EDIT! Generated automatically from oct-errno.in.cc by configure |
5465 | 2 /* |
3 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13992
diff
changeset
|
4 Copyright (C) 2005-2012 John W. Eaton |
5465 | 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 | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
5465 | 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 | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
5465 | 21 |
22 */ | |
23 | |
24 #ifdef HAVE_CONFIG_H | |
25 #include <config.h> | |
26 #endif | |
27 | |
28 #include <cerrno> | |
29 | |
13992
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
30 #include "singleton-cleanup.h" |
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
31 |
5465 | 32 #include "oct-errno.h" |
33 #include "oct-map.h" | |
34 #include "error.h" | |
35 | |
36 octave_errno *octave_errno::instance = 0; | |
37 | |
38 octave_errno::octave_errno (void) | |
39 { | |
40 struct errno_struct | |
41 { | |
42 const char *name; | |
5890 | 43 int value; |
5465 | 44 }; |
45 | |
46 static errno_struct errno_codes[] = | |
47 { | |
48 // POSIX. | |
49 | |
50 #if defined (E2BIG) | |
51 { "E2BIG", E2BIG, }, | |
52 #endif | |
53 #if defined (EACCES) | |
54 { "EACCES", EACCES, }, | |
55 #endif | |
56 #if defined (EADDRINUSE) | |
57 { "EADDRINUSE", EADDRINUSE, }, | |
58 #endif | |
59 #if defined (EADDRNOTAVAIL) | |
60 { "EADDRNOTAVAIL", EADDRNOTAVAIL, }, | |
61 #endif | |
62 #if defined (EAFNOSUPPORT) | |
63 { "EAFNOSUPPORT", EAFNOSUPPORT, }, | |
64 #endif | |
65 #if defined (EAGAIN) | |
66 { "EAGAIN", EAGAIN, }, | |
67 #endif | |
68 #if defined (EALREADY) | |
69 { "EALREADY", EALREADY, }, | |
70 #endif | |
71 #if defined (EBADF) | |
72 { "EBADF", EBADF, }, | |
73 #endif | |
74 #if defined (EBUSY) | |
75 { "EBUSY", EBUSY, }, | |
76 #endif | |
77 #if defined (ECHILD) | |
78 { "ECHILD", ECHILD, }, | |
79 #endif | |
80 #if defined (ECONNABORTED) | |
81 { "ECONNABORTED", ECONNABORTED, }, | |
82 #endif | |
83 #if defined (ECONNREFUSED) | |
84 { "ECONNREFUSED", ECONNREFUSED, }, | |
85 #endif | |
86 #if defined (ECONNRESET) | |
87 { "ECONNRESET", ECONNRESET, }, | |
88 #endif | |
89 #if defined (EDEADLK) | |
90 { "EDEADLK", EDEADLK, }, | |
91 #endif | |
92 #if defined (EDESTADDRREQ) | |
93 { "EDESTADDRREQ", EDESTADDRREQ, }, | |
94 #endif | |
95 #if defined (EDOM) | |
96 { "EDOM", EDOM, }, | |
97 #endif | |
98 #if defined (EDQUOT) | |
99 { "EDQUOT", EDQUOT, }, | |
100 #endif | |
101 #if defined (EEXIST) | |
102 { "EEXIST", EEXIST, }, | |
103 #endif | |
104 #if defined (EFAULT) | |
105 { "EFAULT", EFAULT, }, | |
106 #endif | |
107 #if defined (EFBIG) | |
108 { "EFBIG", EFBIG, }, | |
109 #endif | |
110 #if defined (EHOSTDOWN) | |
111 { "EHOSTDOWN", EHOSTDOWN, }, | |
112 #endif | |
113 #if defined (EHOSTUNREACH) | |
114 { "EHOSTUNREACH", EHOSTUNREACH, }, | |
115 #endif | |
116 #if defined (EINPROGRESS) | |
117 { "EINPROGRESS", EINPROGRESS, }, | |
118 #endif | |
119 #if defined (EINTR) | |
120 { "EINTR", EINTR, }, | |
121 #endif | |
122 #if defined (EINVAL) | |
123 { "EINVAL", EINVAL, }, | |
124 #endif | |
125 #if defined (EIO) | |
126 { "EIO", EIO, }, | |
127 #endif | |
128 #if defined (EISCONN) | |
129 { "EISCONN", EISCONN, }, | |
130 #endif | |
131 #if defined (EISDIR) | |
132 { "EISDIR", EISDIR, }, | |
133 #endif | |
134 #if defined (ELOOP) | |
135 { "ELOOP", ELOOP, }, | |
136 #endif | |
137 #if defined (EMFILE) | |
138 { "EMFILE", EMFILE, }, | |
139 #endif | |
140 #if defined (EMLINK) | |
141 { "EMLINK", EMLINK, }, | |
142 #endif | |
143 #if defined (EMSGSIZE) | |
144 { "EMSGSIZE", EMSGSIZE, }, | |
145 #endif | |
146 #if defined (ENAMETOOLONG) | |
147 { "ENAMETOOLONG", ENAMETOOLONG, }, | |
148 #endif | |
149 #if defined (ENETDOWN) | |
150 { "ENETDOWN", ENETDOWN, }, | |
151 #endif | |
152 #if defined (ENETRESET) | |
153 { "ENETRESET", ENETRESET, }, | |
154 #endif | |
155 #if defined (ENETUNREACH) | |
156 { "ENETUNREACH", ENETUNREACH, }, | |
157 #endif | |
158 #if defined (ENFILE) | |
159 { "ENFILE", ENFILE, }, | |
160 #endif | |
161 #if defined (ENOBUFS) | |
162 { "ENOBUFS", ENOBUFS, }, | |
163 #endif | |
164 #if defined (ENODEV) | |
165 { "ENODEV", ENODEV, }, | |
166 #endif | |
167 #if defined (ENOENT) | |
168 { "ENOENT", ENOENT, }, | |
169 #endif | |
170 #if defined (ENOEXEC) | |
171 { "ENOEXEC", ENOEXEC, }, | |
172 #endif | |
173 #if defined (ENOLCK) | |
174 { "ENOLCK", ENOLCK, }, | |
175 #endif | |
176 #if defined (ENOMEM) | |
177 { "ENOMEM", ENOMEM, }, | |
178 #endif | |
179 #if defined (ENOPROTOOPT) | |
180 { "ENOPROTOOPT", ENOPROTOOPT, }, | |
181 #endif | |
182 #if defined (ENOSPC) | |
183 { "ENOSPC", ENOSPC, }, | |
184 #endif | |
185 #if defined (ENOSYS) | |
186 { "ENOSYS", ENOSYS, }, | |
187 #endif | |
188 #if defined (ENOTBLK) | |
189 { "ENOTBLK", ENOTBLK, }, | |
190 #endif | |
191 #if defined (ENOTCONN) | |
192 { "ENOTCONN", ENOTCONN, }, | |
193 #endif | |
194 #if defined (ENOTDIR) | |
195 { "ENOTDIR", ENOTDIR, }, | |
196 #endif | |
197 #if defined (ENOTEMPTY) | |
198 { "ENOTEMPTY", ENOTEMPTY, }, | |
199 #endif | |
200 #if defined (ENOTSOCK) | |
201 { "ENOTSOCK", ENOTSOCK, }, | |
202 #endif | |
203 #if defined (ENOTTY) | |
204 { "ENOTTY", ENOTTY, }, | |
205 #endif | |
206 #if defined (ENXIO) | |
207 { "ENXIO", ENXIO, }, | |
208 #endif | |
209 #if defined (EOPNOTSUPP) | |
210 { "EOPNOTSUPP", EOPNOTSUPP, }, | |
211 #endif | |
212 #if defined (EPERM) | |
213 { "EPERM", EPERM, }, | |
214 #endif | |
215 #if defined (EPFNOSUPPORT) | |
216 { "EPFNOSUPPORT", EPFNOSUPPORT, }, | |
217 #endif | |
218 #if defined (EPIPE) | |
219 { "EPIPE", EPIPE, }, | |
220 #endif | |
221 #if defined (EPROTONOSUPPORT) | |
222 { "EPROTONOSUPPORT", EPROTONOSUPPORT, }, | |
223 #endif | |
224 #if defined (EPROTOTYPE) | |
225 { "EPROTOTYPE", EPROTOTYPE, }, | |
226 #endif | |
227 #if defined (ERANGE) | |
228 { "ERANGE", ERANGE, }, | |
229 #endif | |
230 #if defined (EREMOTE) | |
231 { "EREMOTE", EREMOTE, }, | |
232 #endif | |
233 #if defined (ERESTART) | |
234 { "ERESTART", ERESTART, }, | |
235 #endif | |
236 #if defined (EROFS) | |
237 { "EROFS", EROFS, }, | |
238 #endif | |
239 #if defined (ESHUTDOWN) | |
240 { "ESHUTDOWN", ESHUTDOWN, }, | |
241 #endif | |
242 #if defined (ESOCKTNOSUPPORT) | |
243 { "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, }, | |
244 #endif | |
245 #if defined (ESPIPE) | |
246 { "ESPIPE", ESPIPE, }, | |
247 #endif | |
248 #if defined (ESRCH) | |
249 { "ESRCH", ESRCH, }, | |
250 #endif | |
251 #if defined (ESTALE) | |
252 { "ESTALE", ESTALE, }, | |
253 #endif | |
254 #if defined (ETIMEDOUT) | |
255 { "ETIMEDOUT", ETIMEDOUT, }, | |
256 #endif | |
257 #if defined (ETOOMANYREFS) | |
258 { "ETOOMANYREFS", ETOOMANYREFS, }, | |
259 #endif | |
260 #if defined (ETXTBSY) | |
261 { "ETXTBSY", ETXTBSY, }, | |
262 #endif | |
263 #if defined (EUSERS) | |
264 { "EUSERS", EUSERS, }, | |
265 #endif | |
266 #if defined (EWOULDBLOCK) | |
267 { "EWOULDBLOCK", EWOULDBLOCK, }, | |
268 #endif | |
269 #if defined (EXDEV) | |
270 { "EXDEV", EXDEV, }, | |
271 #endif | |
272 | |
273 // Others (duplicates are OK). | |
274 | |
5494 | 275 @SYSDEP_ERRNO_LIST@ |
5465 | 276 |
277 { 0, 0, }, | |
278 }; | |
279 | |
280 // Stuff them all in a map for fast access. | |
281 | |
282 errno_struct *ptr = errno_codes; | |
283 | |
284 while (ptr->name) | |
285 { | |
286 errno_tbl[ptr->name] = ptr->value; | |
287 ptr++; | |
288 } | |
289 } | |
290 | |
291 bool | |
292 octave_errno::instance_ok (void) | |
293 { | |
294 bool retval = true; | |
295 | |
296 if (! instance) | |
13992
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
297 { |
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
298 instance = new octave_errno (); |
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
299 |
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
300 if (instance) |
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
301 singleton_cleanup_list::add (cleanup_instance); |
e1f76bfe0452
apply singleton_cleanup to a few more classes
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
302 } |
5465 | 303 |
304 if (! instance) | |
305 { | |
306 ::error ("unable to create errno object!"); | |
307 | |
308 retval = false; | |
309 } | |
310 | |
311 return retval; | |
312 } | |
313 | |
314 int | |
315 octave_errno::lookup (const std::string& name) | |
316 { | |
317 return (instance_ok ()) ? instance->do_lookup (name) : -1; | |
318 } | |
319 | |
11063
e378c0176a38
oct-errno.cc.in: use octve_scalar_map instead of Octave_map
John W. Eaton <jwe@octave.org>
parents:
10161
diff
changeset
|
320 octave_scalar_map |
5465 | 321 octave_errno::list (void) |
322 { | |
11063
e378c0176a38
oct-errno.cc.in: use octve_scalar_map instead of Octave_map
John W. Eaton <jwe@octave.org>
parents:
10161
diff
changeset
|
323 return (instance_ok ()) ? instance->do_list () : octave_scalar_map (); |
5465 | 324 } |
325 | |
326 int | |
327 octave_errno::do_lookup (const std::string& name) | |
328 { | |
329 return (errno_tbl.find (name) != errno_tbl.end ()) ? errno_tbl[name] : -1; | |
330 } | |
331 | |
11063
e378c0176a38
oct-errno.cc.in: use octve_scalar_map instead of Octave_map
John W. Eaton <jwe@octave.org>
parents:
10161
diff
changeset
|
332 octave_scalar_map |
5465 | 333 octave_errno::do_list (void) |
334 { | |
11063
e378c0176a38
oct-errno.cc.in: use octve_scalar_map instead of Octave_map
John W. Eaton <jwe@octave.org>
parents:
10161
diff
changeset
|
335 octave_scalar_map retval; |
5465 | 336 |
337 for (std::map<std::string, int>::const_iterator p = errno_tbl.begin (); | |
338 p != errno_tbl.end (); | |
339 p++) | |
340 { | |
341 retval.assign (p->first, p->second); | |
342 } | |
343 | |
344 return retval; | |
345 } |