]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Modules/errnomodule.c
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Modules / errnomodule.c
CommitLineData
4710c53d 1\r
2/* Errno module\r
3\r
4 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials are licensed and made available under\r
6 the terms and conditions of the BSD License that accompanies this distribution.\r
7 The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12*/\r
13\r
14#include "Python.h"\r
15\r
16/* Windows socket errors (WSA*) */\r
17#ifdef MS_WINDOWS\r
18#include <windows.h>\r
19#endif\r
20\r
21/*\r
22 * Pull in the system error definitions\r
23 */\r
24\r
25static PyMethodDef errno_methods[] = {\r
26 {NULL, NULL}\r
27};\r
28\r
29/* Helper function doing the dictionary inserting */\r
30\r
31static void\r
32_inscode(PyObject *d, PyObject *de, char *name, int code)\r
33{\r
34 PyObject *u = PyString_FromString(name);\r
35 PyObject *v = PyInt_FromLong((long) code);\r
36\r
37 /* Don't bother checking for errors; they'll be caught at the end\r
38 * of the module initialization function by the caller of\r
39 * initerrno().\r
40 */\r
41 if (u && v) {\r
42 /* insert in modules dict */\r
43 PyDict_SetItem(d, u, v);\r
44 /* insert in errorcode dict */\r
45 PyDict_SetItem(de, v, u);\r
46 }\r
47 Py_XDECREF(u);\r
48 Py_XDECREF(v);\r
49}\r
50\r
51PyDoc_STRVAR(errno__doc__,\r
52"This module makes available standard errno system symbols.\n\\r
53\n\\r
54The value of each symbol is the corresponding integer value,\n\\r
55e.g., on most systems, errno.ENOENT equals the integer 2.\n\\r
56\n\\r
57The dictionary errno.errorcode maps numeric codes to symbol names,\n\\r
58e.g., errno.errorcode[2] could be the string 'ENOENT'.\n\\r
59\n\\r
60Symbols that are not relevant to the underlying system are not defined.\n\\r
61\n\\r
62To map error codes to error messages, use the function os.strerror(),\n\\r
63e.g. os.strerror(2) could return 'No such file or directory'.");\r
64\r
65PyMODINIT_FUNC\r
66initerrno(void)\r
67{\r
68 PyObject *m, *d, *de;\r
69 m = Py_InitModule3("errno", errno_methods, errno__doc__);\r
70 if (m == NULL)\r
71 return;\r
72 d = PyModule_GetDict(m);\r
73 de = PyDict_New();\r
74 if (!d || !de || PyDict_SetItemString(d, "errorcode", de) < 0)\r
75 return;\r
76\r
77/* Macro so I don't have to edit each and every line below... */\r
78#define inscode(d, ds, de, name, code, comment) _inscode(d, de, name, code)\r
79\r
80 /*\r
81 * The names and comments are borrowed from linux/include/errno.h,\r
82 * which should be pretty all-inclusive\r
83 */\r
84\r
85#ifdef ENODEV\r
86 inscode(d, ds, de, "ENODEV", ENODEV, "No such device");\r
87#endif\r
88#ifdef ENOCSI\r
89 inscode(d, ds, de, "ENOCSI", ENOCSI, "No CSI structure available");\r
90#endif\r
91#ifdef EHOSTUNREACH\r
92 inscode(d, ds, de, "EHOSTUNREACH", EHOSTUNREACH, "No route to host");\r
93#else\r
94#ifdef WSAEHOSTUNREACH\r
95 inscode(d, ds, de, "EHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");\r
96#endif\r
97#endif\r
98#ifdef ENOMSG\r
99 inscode(d, ds, de, "ENOMSG", ENOMSG, "No message of desired type");\r
100#endif\r
101#ifdef EUCLEAN\r
102 inscode(d, ds, de, "EUCLEAN", EUCLEAN, "Structure needs cleaning");\r
103#endif\r
104#ifdef EL2NSYNC\r
105 inscode(d, ds, de, "EL2NSYNC", EL2NSYNC, "Level 2 not synchronized");\r
106#endif\r
107#ifdef EL2HLT\r
108 inscode(d, ds, de, "EL2HLT", EL2HLT, "Level 2 halted");\r
109#endif\r
110#ifdef ENODATA\r
111 inscode(d, ds, de, "ENODATA", ENODATA, "No data available");\r
112#endif\r
113#ifdef ENOTBLK\r
114 inscode(d, ds, de, "ENOTBLK", ENOTBLK, "Block device required");\r
115#endif\r
116#ifdef ENOSYS\r
117 inscode(d, ds, de, "ENOSYS", ENOSYS, "Function not implemented");\r
118#endif\r
119#ifdef EPIPE\r
120 inscode(d, ds, de, "EPIPE", EPIPE, "Broken pipe");\r
121#endif\r
122#ifdef EINVAL\r
123 inscode(d, ds, de, "EINVAL", EINVAL, "Invalid argument");\r
124#else\r
125#ifdef WSAEINVAL\r
126 inscode(d, ds, de, "EINVAL", WSAEINVAL, "Invalid argument");\r
127#endif\r
128#endif\r
129#ifdef EOVERFLOW\r
130 inscode(d, ds, de, "EOVERFLOW", EOVERFLOW, "Value too large for defined data type");\r
131#endif\r
132#ifdef EADV\r
133 inscode(d, ds, de, "EADV", EADV, "Advertise error");\r
134#endif\r
135#ifdef EINTR\r
136 inscode(d, ds, de, "EINTR", EINTR, "Interrupted system call");\r
137#else\r
138#ifdef WSAEINTR\r
139 inscode(d, ds, de, "EINTR", WSAEINTR, "Interrupted system call");\r
140#endif\r
141#endif\r
142#ifdef EUSERS\r
143 inscode(d, ds, de, "EUSERS", EUSERS, "Too many users");\r
144#else\r
145#ifdef WSAEUSERS\r
146 inscode(d, ds, de, "EUSERS", WSAEUSERS, "Too many users");\r
147#endif\r
148#endif\r
149#ifdef ENOTEMPTY\r
150 inscode(d, ds, de, "ENOTEMPTY", ENOTEMPTY, "Directory not empty");\r
151#else\r
152#ifdef WSAENOTEMPTY\r
153 inscode(d, ds, de, "ENOTEMPTY", WSAENOTEMPTY, "Directory not empty");\r
154#endif\r
155#endif\r
156#ifdef ENOBUFS\r
157 inscode(d, ds, de, "ENOBUFS", ENOBUFS, "No buffer space available");\r
158#else\r
159#ifdef WSAENOBUFS\r
160 inscode(d, ds, de, "ENOBUFS", WSAENOBUFS, "No buffer space available");\r
161#endif\r
162#endif\r
163#ifdef EPROTO\r
164 inscode(d, ds, de, "EPROTO", EPROTO, "Protocol error");\r
165#endif\r
166#ifdef EREMOTE\r
167 inscode(d, ds, de, "EREMOTE", EREMOTE, "Object is remote");\r
168#else\r
169#ifdef WSAEREMOTE\r
170 inscode(d, ds, de, "EREMOTE", WSAEREMOTE, "Object is remote");\r
171#endif\r
172#endif\r
173#ifdef ENAVAIL\r
174 inscode(d, ds, de, "ENAVAIL", ENAVAIL, "No XENIX semaphores available");\r
175#endif\r
176#ifdef ECHILD\r
177 inscode(d, ds, de, "ECHILD", ECHILD, "No child processes");\r
178#endif\r
179#ifdef ELOOP\r
180 inscode(d, ds, de, "ELOOP", ELOOP, "Too many symbolic links encountered");\r
181#else\r
182#ifdef WSAELOOP\r
183 inscode(d, ds, de, "ELOOP", WSAELOOP, "Too many symbolic links encountered");\r
184#endif\r
185#endif\r
186#ifdef EXDEV\r
187 inscode(d, ds, de, "EXDEV", EXDEV, "Cross-device link");\r
188#endif\r
189#ifdef E2BIG\r
190 inscode(d, ds, de, "E2BIG", E2BIG, "Arg list too long");\r
191#endif\r
192#ifdef ESRCH\r
193 inscode(d, ds, de, "ESRCH", ESRCH, "No such process");\r
194#endif\r
195#ifdef EMSGSIZE\r
196 inscode(d, ds, de, "EMSGSIZE", EMSGSIZE, "Message too long");\r
197#else\r
198#ifdef WSAEMSGSIZE\r
199 inscode(d, ds, de, "EMSGSIZE", WSAEMSGSIZE, "Message too long");\r
200#endif\r
201#endif\r
202#ifdef EAFNOSUPPORT\r
203 inscode(d, ds, de, "EAFNOSUPPORT", EAFNOSUPPORT, "Address family not supported by protocol");\r
204#else\r
205#ifdef WSAEAFNOSUPPORT\r
206 inscode(d, ds, de, "EAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");\r
207#endif\r
208#endif\r
209#ifdef EBADR\r
210 inscode(d, ds, de, "EBADR", EBADR, "Invalid request descriptor");\r
211#endif\r
212#ifdef EHOSTDOWN\r
213 inscode(d, ds, de, "EHOSTDOWN", EHOSTDOWN, "Host is down");\r
214#else\r
215#ifdef WSAEHOSTDOWN\r
216 inscode(d, ds, de, "EHOSTDOWN", WSAEHOSTDOWN, "Host is down");\r
217#endif\r
218#endif\r
219#ifdef EPFNOSUPPORT\r
220 inscode(d, ds, de, "EPFNOSUPPORT", EPFNOSUPPORT, "Protocol family not supported");\r
221#else\r
222#ifdef WSAEPFNOSUPPORT\r
223 inscode(d, ds, de, "EPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");\r
224#endif\r
225#endif\r
226#ifdef ENOPROTOOPT\r
227 inscode(d, ds, de, "ENOPROTOOPT", ENOPROTOOPT, "Protocol not available");\r
228#else\r
229#ifdef WSAENOPROTOOPT\r
230 inscode(d, ds, de, "ENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");\r
231#endif\r
232#endif\r
233#ifdef EBUSY\r
234 inscode(d, ds, de, "EBUSY", EBUSY, "Device or resource busy");\r
235#endif\r
236#ifdef EWOULDBLOCK\r
237 inscode(d, ds, de, "EWOULDBLOCK", EWOULDBLOCK, "Operation would block");\r
238#else\r
239#ifdef WSAEWOULDBLOCK\r
240 inscode(d, ds, de, "EWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");\r
241#endif\r
242#endif\r
243#ifdef EBADFD\r
244 inscode(d, ds, de, "EBADFD", EBADFD, "File descriptor in bad state");\r
245#endif\r
246#ifdef EDOTDOT\r
247 inscode(d, ds, de, "EDOTDOT", EDOTDOT, "RFS specific error");\r
248#endif\r
249#ifdef EISCONN\r
250 inscode(d, ds, de, "EISCONN", EISCONN, "Transport endpoint is already connected");\r
251#else\r
252#ifdef WSAEISCONN\r
253 inscode(d, ds, de, "EISCONN", WSAEISCONN, "Transport endpoint is already connected");\r
254#endif\r
255#endif\r
256#ifdef ENOANO\r
257 inscode(d, ds, de, "ENOANO", ENOANO, "No anode");\r
258#endif\r
259#ifdef ESHUTDOWN\r
260 inscode(d, ds, de, "ESHUTDOWN", ESHUTDOWN, "Cannot send after transport endpoint shutdown");\r
261#else\r
262#ifdef WSAESHUTDOWN\r
263 inscode(d, ds, de, "ESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");\r
264#endif\r
265#endif\r
266#ifdef ECHRNG\r
267 inscode(d, ds, de, "ECHRNG", ECHRNG, "Channel number out of range");\r
268#endif\r
269#ifdef ELIBBAD\r
270 inscode(d, ds, de, "ELIBBAD", ELIBBAD, "Accessing a corrupted shared library");\r
271#endif\r
272#ifdef ENONET\r
273 inscode(d, ds, de, "ENONET", ENONET, "Machine is not on the network");\r
274#endif\r
275#ifdef EBADE\r
276 inscode(d, ds, de, "EBADE", EBADE, "Invalid exchange");\r
277#endif\r
278#ifdef EBADF\r
279 inscode(d, ds, de, "EBADF", EBADF, "Bad file number");\r
280#else\r
281#ifdef WSAEBADF\r
282 inscode(d, ds, de, "EBADF", WSAEBADF, "Bad file number");\r
283#endif\r
284#endif\r
285#ifdef EMULTIHOP\r
286 inscode(d, ds, de, "EMULTIHOP", EMULTIHOP, "Multihop attempted");\r
287#endif\r
288#ifdef EIO\r
289 inscode(d, ds, de, "EIO", EIO, "I/O error");\r
290#endif\r
291#ifdef EUNATCH\r
292 inscode(d, ds, de, "EUNATCH", EUNATCH, "Protocol driver not attached");\r
293#endif\r
294#ifdef EPROTOTYPE\r
295 inscode(d, ds, de, "EPROTOTYPE", EPROTOTYPE, "Protocol wrong type for socket");\r
296#else\r
297#ifdef WSAEPROTOTYPE\r
298 inscode(d, ds, de, "EPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");\r
299#endif\r
300#endif\r
301#ifdef ENOSPC\r
302 inscode(d, ds, de, "ENOSPC", ENOSPC, "No space left on device");\r
303#endif\r
304#ifdef ENOEXEC\r
305 inscode(d, ds, de, "ENOEXEC", ENOEXEC, "Exec format error");\r
306#endif\r
307#ifdef EALREADY\r
308 inscode(d, ds, de, "EALREADY", EALREADY, "Operation already in progress");\r
309#else\r
310#ifdef WSAEALREADY\r
311 inscode(d, ds, de, "EALREADY", WSAEALREADY, "Operation already in progress");\r
312#endif\r
313#endif\r
314#ifdef ENETDOWN\r
315 inscode(d, ds, de, "ENETDOWN", ENETDOWN, "Network is down");\r
316#else\r
317#ifdef WSAENETDOWN\r
318 inscode(d, ds, de, "ENETDOWN", WSAENETDOWN, "Network is down");\r
319#endif\r
320#endif\r
321#ifdef ENOTNAM\r
322 inscode(d, ds, de, "ENOTNAM", ENOTNAM, "Not a XENIX named type file");\r
323#endif\r
324#ifdef EACCES\r
325 inscode(d, ds, de, "EACCES", EACCES, "Permission denied");\r
326#else\r
327#ifdef WSAEACCES\r
328 inscode(d, ds, de, "EACCES", WSAEACCES, "Permission denied");\r
329#endif\r
330#endif\r
331#ifdef ELNRNG\r
332 inscode(d, ds, de, "ELNRNG", ELNRNG, "Link number out of range");\r
333#endif\r
334#ifdef EILSEQ\r
335 inscode(d, ds, de, "EILSEQ", EILSEQ, "Illegal byte sequence");\r
336#endif\r
337#ifdef ENOTDIR\r
338 inscode(d, ds, de, "ENOTDIR", ENOTDIR, "Not a directory");\r
339#endif\r
340#ifdef ENOTUNIQ\r
341 inscode(d, ds, de, "ENOTUNIQ", ENOTUNIQ, "Name not unique on network");\r
342#endif\r
343#ifdef EPERM\r
344 inscode(d, ds, de, "EPERM", EPERM, "Operation not permitted");\r
345#endif\r
346#ifdef EDOM\r
347 inscode(d, ds, de, "EDOM", EDOM, "Math argument out of domain of func");\r
348#endif\r
349#ifdef EXFULL\r
350 inscode(d, ds, de, "EXFULL", EXFULL, "Exchange full");\r
351#endif\r
352#ifdef ECONNREFUSED\r
353 inscode(d, ds, de, "ECONNREFUSED", ECONNREFUSED, "Connection refused");\r
354#else\r
355#ifdef WSAECONNREFUSED\r
356 inscode(d, ds, de, "ECONNREFUSED", WSAECONNREFUSED, "Connection refused");\r
357#endif\r
358#endif\r
359#ifdef EISDIR\r
360 inscode(d, ds, de, "EISDIR", EISDIR, "Is a directory");\r
361#endif\r
362#ifdef EPROTONOSUPPORT\r
363 inscode(d, ds, de, "EPROTONOSUPPORT", EPROTONOSUPPORT, "Protocol not supported");\r
364#else\r
365#ifdef WSAEPROTONOSUPPORT\r
366 inscode(d, ds, de, "EPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");\r
367#endif\r
368#endif\r
369#ifdef EROFS\r
370 inscode(d, ds, de, "EROFS", EROFS, "Read-only file system");\r
371#endif\r
372#ifdef EADDRNOTAVAIL\r
373 inscode(d, ds, de, "EADDRNOTAVAIL", EADDRNOTAVAIL, "Cannot assign requested address");\r
374#else\r
375#ifdef WSAEADDRNOTAVAIL\r
376 inscode(d, ds, de, "EADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");\r
377#endif\r
378#endif\r
379#ifdef EIDRM\r
380 inscode(d, ds, de, "EIDRM", EIDRM, "Identifier removed");\r
381#endif\r
382#ifdef ECOMM\r
383 inscode(d, ds, de, "ECOMM", ECOMM, "Communication error on send");\r
384#endif\r
385#ifdef ESRMNT\r
386 inscode(d, ds, de, "ESRMNT", ESRMNT, "Srmount error");\r
387#endif\r
388#ifdef EREMOTEIO\r
389 inscode(d, ds, de, "EREMOTEIO", EREMOTEIO, "Remote I/O error");\r
390#endif\r
391#ifdef EL3RST\r
392 inscode(d, ds, de, "EL3RST", EL3RST, "Level 3 reset");\r
393#endif\r
394#ifdef EBADMSG\r
395 inscode(d, ds, de, "EBADMSG", EBADMSG, "Not a data message");\r
396#endif\r
397#ifdef ENFILE\r
398 inscode(d, ds, de, "ENFILE", ENFILE, "File table overflow");\r
399#endif\r
400#ifdef ELIBMAX\r
401 inscode(d, ds, de, "ELIBMAX", ELIBMAX, "Attempting to link in too many shared libraries");\r
402#endif\r
403#ifdef ESPIPE\r
404 inscode(d, ds, de, "ESPIPE", ESPIPE, "Illegal seek");\r
405#endif\r
406#ifdef ENOLINK\r
407 inscode(d, ds, de, "ENOLINK", ENOLINK, "Link has been severed");\r
408#endif\r
409#ifdef ENETRESET\r
410 inscode(d, ds, de, "ENETRESET", ENETRESET, "Network dropped connection because of reset");\r
411#else\r
412#ifdef WSAENETRESET\r
413 inscode(d, ds, de, "ENETRESET", WSAENETRESET, "Network dropped connection because of reset");\r
414#endif\r
415#endif\r
416#ifdef ETIMEDOUT\r
417 inscode(d, ds, de, "ETIMEDOUT", ETIMEDOUT, "Connection timed out");\r
418#else\r
419#ifdef WSAETIMEDOUT\r
420 inscode(d, ds, de, "ETIMEDOUT", WSAETIMEDOUT, "Connection timed out");\r
421#endif\r
422#endif\r
423#ifdef ENOENT\r
424 inscode(d, ds, de, "ENOENT", ENOENT, "No such file or directory");\r
425#endif\r
426#ifdef EEXIST\r
427 inscode(d, ds, de, "EEXIST", EEXIST, "File exists");\r
428#endif\r
429#ifdef EDQUOT\r
430 inscode(d, ds, de, "EDQUOT", EDQUOT, "Quota exceeded");\r
431#else\r
432#ifdef WSAEDQUOT\r
433 inscode(d, ds, de, "EDQUOT", WSAEDQUOT, "Quota exceeded");\r
434#endif\r
435#endif\r
436#ifdef ENOSTR\r
437 inscode(d, ds, de, "ENOSTR", ENOSTR, "Device not a stream");\r
438#endif\r
439#ifdef EBADSLT\r
440 inscode(d, ds, de, "EBADSLT", EBADSLT, "Invalid slot");\r
441#endif\r
442#ifdef EBADRQC\r
443 inscode(d, ds, de, "EBADRQC", EBADRQC, "Invalid request code");\r
444#endif\r
445#ifdef ELIBACC\r
446 inscode(d, ds, de, "ELIBACC", ELIBACC, "Can not access a needed shared library");\r
447#endif\r
448#ifdef EFAULT\r
449 inscode(d, ds, de, "EFAULT", EFAULT, "Bad address");\r
450#else\r
451#ifdef WSAEFAULT\r
452 inscode(d, ds, de, "EFAULT", WSAEFAULT, "Bad address");\r
453#endif\r
454#endif\r
455#ifdef EFBIG\r
456 inscode(d, ds, de, "EFBIG", EFBIG, "File too large");\r
457#endif\r
458#ifdef EDEADLK\r
459 inscode(d, ds, de, "EDEADLK", EDEADLK, "Resource deadlock would occur");\r
460#endif\r
461#ifdef ENOTCONN\r
462 inscode(d, ds, de, "ENOTCONN", ENOTCONN, "Transport endpoint is not connected");\r
463#else\r
464#ifdef WSAENOTCONN\r
465 inscode(d, ds, de, "ENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");\r
466#endif\r
467#endif\r
468#ifdef EDESTADDRREQ\r
469 inscode(d, ds, de, "EDESTADDRREQ", EDESTADDRREQ, "Destination address required");\r
470#else\r
471#ifdef WSAEDESTADDRREQ\r
472 inscode(d, ds, de, "EDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");\r
473#endif\r
474#endif\r
475#ifdef ELIBSCN\r
476 inscode(d, ds, de, "ELIBSCN", ELIBSCN, ".lib section in a.out corrupted");\r
477#endif\r
478#ifdef ENOLCK\r
479 inscode(d, ds, de, "ENOLCK", ENOLCK, "No record locks available");\r
480#endif\r
481#ifdef EISNAM\r
482 inscode(d, ds, de, "EISNAM", EISNAM, "Is a named type file");\r
483#endif\r
484#ifdef ECONNABORTED\r
485 inscode(d, ds, de, "ECONNABORTED", ECONNABORTED, "Software caused connection abort");\r
486#else\r
487#ifdef WSAECONNABORTED\r
488 inscode(d, ds, de, "ECONNABORTED", WSAECONNABORTED, "Software caused connection abort");\r
489#endif\r
490#endif\r
491#ifdef ENETUNREACH\r
492 inscode(d, ds, de, "ENETUNREACH", ENETUNREACH, "Network is unreachable");\r
493#else\r
494#ifdef WSAENETUNREACH\r
495 inscode(d, ds, de, "ENETUNREACH", WSAENETUNREACH, "Network is unreachable");\r
496#endif\r
497#endif\r
498#ifdef ESTALE\r
499 inscode(d, ds, de, "ESTALE", ESTALE, "Stale NFS file handle");\r
500#else\r
501#ifdef WSAESTALE\r
502 inscode(d, ds, de, "ESTALE", WSAESTALE, "Stale NFS file handle");\r
503#endif\r
504#endif\r
505#ifdef ENOSR\r
506 inscode(d, ds, de, "ENOSR", ENOSR, "Out of streams resources");\r
507#endif\r
508#ifdef ENOMEM\r
509 inscode(d, ds, de, "ENOMEM", ENOMEM, "Out of memory");\r
510#endif\r
511#ifdef ENOTSOCK\r
512 inscode(d, ds, de, "ENOTSOCK", ENOTSOCK, "Socket operation on non-socket");\r
513#else\r
514#ifdef WSAENOTSOCK\r
515 inscode(d, ds, de, "ENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");\r
516#endif\r
517#endif\r
518#ifdef ESTRPIPE\r
519 inscode(d, ds, de, "ESTRPIPE", ESTRPIPE, "Streams pipe error");\r
520#endif\r
521#ifdef EMLINK\r
522 inscode(d, ds, de, "EMLINK", EMLINK, "Too many links");\r
523#endif\r
524#ifdef ERANGE\r
525 inscode(d, ds, de, "ERANGE", ERANGE, "Math result not representable");\r
526#endif\r
527#ifdef ELIBEXEC\r
528 inscode(d, ds, de, "ELIBEXEC", ELIBEXEC, "Cannot exec a shared library directly");\r
529#endif\r
530#ifdef EL3HLT\r
531 inscode(d, ds, de, "EL3HLT", EL3HLT, "Level 3 halted");\r
532#endif\r
533#ifdef ECONNRESET\r
534 inscode(d, ds, de, "ECONNRESET", ECONNRESET, "Connection reset by peer");\r
535#else\r
536#ifdef WSAECONNRESET\r
537 inscode(d, ds, de, "ECONNRESET", WSAECONNRESET, "Connection reset by peer");\r
538#endif\r
539#endif\r
540#ifdef EADDRINUSE\r
541 inscode(d, ds, de, "EADDRINUSE", EADDRINUSE, "Address already in use");\r
542#else\r
543#ifdef WSAEADDRINUSE\r
544 inscode(d, ds, de, "EADDRINUSE", WSAEADDRINUSE, "Address already in use");\r
545#endif\r
546#endif\r
547#ifdef EOPNOTSUPP\r
548 inscode(d, ds, de, "EOPNOTSUPP", EOPNOTSUPP, "Operation not supported on transport endpoint");\r
549#else\r
550#ifdef WSAEOPNOTSUPP\r
551 inscode(d, ds, de, "EOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");\r
552#endif\r
553#endif\r
554#ifdef EREMCHG\r
555 inscode(d, ds, de, "EREMCHG", EREMCHG, "Remote address changed");\r
556#endif\r
557#ifdef EAGAIN\r
558 inscode(d, ds, de, "EAGAIN", EAGAIN, "Try again");\r
559#endif\r
560#ifdef ENAMETOOLONG\r
561 inscode(d, ds, de, "ENAMETOOLONG", ENAMETOOLONG, "File name too long");\r
562#else\r
563#ifdef WSAENAMETOOLONG\r
564 inscode(d, ds, de, "ENAMETOOLONG", WSAENAMETOOLONG, "File name too long");\r
565#endif\r
566#endif\r
567#ifdef ENOTTY\r
568 inscode(d, ds, de, "ENOTTY", ENOTTY, "Not a typewriter");\r
569#endif\r
570#ifdef ERESTART\r
571 inscode(d, ds, de, "ERESTART", ERESTART, "Interrupted system call should be restarted");\r
572#endif\r
573#ifdef ESOCKTNOSUPPORT\r
574 inscode(d, ds, de, "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, "Socket type not supported");\r
575#else\r
576#ifdef WSAESOCKTNOSUPPORT\r
577 inscode(d, ds, de, "ESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");\r
578#endif\r
579#endif\r
580#ifdef ETIME\r
581 inscode(d, ds, de, "ETIME", ETIME, "Timer expired");\r
582#endif\r
583#ifdef EBFONT\r
584 inscode(d, ds, de, "EBFONT", EBFONT, "Bad font file format");\r
585#endif\r
586#ifdef EDEADLOCK\r
587 inscode(d, ds, de, "EDEADLOCK", EDEADLOCK, "Error EDEADLOCK");\r
588#endif\r
589#ifdef ETOOMANYREFS\r
590 inscode(d, ds, de, "ETOOMANYREFS", ETOOMANYREFS, "Too many references: cannot splice");\r
591#else\r
592#ifdef WSAETOOMANYREFS\r
593 inscode(d, ds, de, "ETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");\r
594#endif\r
595#endif\r
596#ifdef EMFILE\r
597 inscode(d, ds, de, "EMFILE", EMFILE, "Too many open files");\r
598#else\r
599#ifdef WSAEMFILE\r
600 inscode(d, ds, de, "EMFILE", WSAEMFILE, "Too many open files");\r
601#endif\r
602#endif\r
603#ifdef ETXTBSY\r
604 inscode(d, ds, de, "ETXTBSY", ETXTBSY, "Text file busy");\r
605#endif\r
606#ifdef EINPROGRESS\r
607 inscode(d, ds, de, "EINPROGRESS", EINPROGRESS, "Operation now in progress");\r
608#else\r
609#ifdef WSAEINPROGRESS\r
610 inscode(d, ds, de, "EINPROGRESS", WSAEINPROGRESS, "Operation now in progress");\r
611#endif\r
612#endif\r
613#ifdef ENXIO\r
614 inscode(d, ds, de, "ENXIO", ENXIO, "No such device or address");\r
615#endif\r
616#ifdef ENOPKG\r
617 inscode(d, ds, de, "ENOPKG", ENOPKG, "Package not installed");\r
618#endif\r
619#ifdef WSASY\r
620 inscode(d, ds, de, "WSASY", WSASY, "Error WSASY");\r
621#endif\r
622#ifdef WSAEHOSTDOWN\r
623 inscode(d, ds, de, "WSAEHOSTDOWN", WSAEHOSTDOWN, "Host is down");\r
624#endif\r
625#ifdef WSAENETDOWN\r
626 inscode(d, ds, de, "WSAENETDOWN", WSAENETDOWN, "Network is down");\r
627#endif\r
628#ifdef WSAENOTSOCK\r
629 inscode(d, ds, de, "WSAENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");\r
630#endif\r
631#ifdef WSAEHOSTUNREACH\r
632 inscode(d, ds, de, "WSAEHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");\r
633#endif\r
634#ifdef WSAELOOP\r
635 inscode(d, ds, de, "WSAELOOP", WSAELOOP, "Too many symbolic links encountered");\r
636#endif\r
637#ifdef WSAEMFILE\r
638 inscode(d, ds, de, "WSAEMFILE", WSAEMFILE, "Too many open files");\r
639#endif\r
640#ifdef WSAESTALE\r
641 inscode(d, ds, de, "WSAESTALE", WSAESTALE, "Stale NFS file handle");\r
642#endif\r
643#ifdef WSAVERNOTSUPPORTED\r
644 inscode(d, ds, de, "WSAVERNOTSUPPORTED", WSAVERNOTSUPPORTED, "Error WSAVERNOTSUPPORTED");\r
645#endif\r
646#ifdef WSAENETUNREACH\r
647 inscode(d, ds, de, "WSAENETUNREACH", WSAENETUNREACH, "Network is unreachable");\r
648#endif\r
649#ifdef WSAEPROCLIM\r
650 inscode(d, ds, de, "WSAEPROCLIM", WSAEPROCLIM, "Error WSAEPROCLIM");\r
651#endif\r
652#ifdef WSAEFAULT\r
653 inscode(d, ds, de, "WSAEFAULT", WSAEFAULT, "Bad address");\r
654#endif\r
655#ifdef WSANOTINITIALISED\r
656 inscode(d, ds, de, "WSANOTINITIALISED", WSANOTINITIALISED, "Error WSANOTINITIALISED");\r
657#endif\r
658#ifdef WSAEUSERS\r
659 inscode(d, ds, de, "WSAEUSERS", WSAEUSERS, "Too many users");\r
660#endif\r
661#ifdef WSAMAKEASYNCREPL\r
662 inscode(d, ds, de, "WSAMAKEASYNCREPL", WSAMAKEASYNCREPL, "Error WSAMAKEASYNCREPL");\r
663#endif\r
664#ifdef WSAENOPROTOOPT\r
665 inscode(d, ds, de, "WSAENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");\r
666#endif\r
667#ifdef WSAECONNABORTED\r
668 inscode(d, ds, de, "WSAECONNABORTED", WSAECONNABORTED, "Software caused connection abort");\r
669#endif\r
670#ifdef WSAENAMETOOLONG\r
671 inscode(d, ds, de, "WSAENAMETOOLONG", WSAENAMETOOLONG, "File name too long");\r
672#endif\r
673#ifdef WSAENOTEMPTY\r
674 inscode(d, ds, de, "WSAENOTEMPTY", WSAENOTEMPTY, "Directory not empty");\r
675#endif\r
676#ifdef WSAESHUTDOWN\r
677 inscode(d, ds, de, "WSAESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");\r
678#endif\r
679#ifdef WSAEAFNOSUPPORT\r
680 inscode(d, ds, de, "WSAEAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");\r
681#endif\r
682#ifdef WSAETOOMANYREFS\r
683 inscode(d, ds, de, "WSAETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");\r
684#endif\r
685#ifdef WSAEACCES\r
686 inscode(d, ds, de, "WSAEACCES", WSAEACCES, "Permission denied");\r
687#endif\r
688#ifdef WSATR\r
689 inscode(d, ds, de, "WSATR", WSATR, "Error WSATR");\r
690#endif\r
691#ifdef WSABASEERR\r
692 inscode(d, ds, de, "WSABASEERR", WSABASEERR, "Error WSABASEERR");\r
693#endif\r
694#ifdef WSADESCRIPTIO\r
695 inscode(d, ds, de, "WSADESCRIPTIO", WSADESCRIPTIO, "Error WSADESCRIPTIO");\r
696#endif\r
697#ifdef WSAEMSGSIZE\r
698 inscode(d, ds, de, "WSAEMSGSIZE", WSAEMSGSIZE, "Message too long");\r
699#endif\r
700#ifdef WSAEBADF\r
701 inscode(d, ds, de, "WSAEBADF", WSAEBADF, "Bad file number");\r
702#endif\r
703#ifdef WSAECONNRESET\r
704 inscode(d, ds, de, "WSAECONNRESET", WSAECONNRESET, "Connection reset by peer");\r
705#endif\r
706#ifdef WSAGETSELECTERRO\r
707 inscode(d, ds, de, "WSAGETSELECTERRO", WSAGETSELECTERRO, "Error WSAGETSELECTERRO");\r
708#endif\r
709#ifdef WSAETIMEDOUT\r
710 inscode(d, ds, de, "WSAETIMEDOUT", WSAETIMEDOUT, "Connection timed out");\r
711#endif\r
712#ifdef WSAENOBUFS\r
713 inscode(d, ds, de, "WSAENOBUFS", WSAENOBUFS, "No buffer space available");\r
714#endif\r
715#ifdef WSAEDISCON\r
716 inscode(d, ds, de, "WSAEDISCON", WSAEDISCON, "Error WSAEDISCON");\r
717#endif\r
718#ifdef WSAEINTR\r
719 inscode(d, ds, de, "WSAEINTR", WSAEINTR, "Interrupted system call");\r
720#endif\r
721#ifdef WSAEPROTOTYPE\r
722 inscode(d, ds, de, "WSAEPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");\r
723#endif\r
724#ifdef WSAHOS\r
725 inscode(d, ds, de, "WSAHOS", WSAHOS, "Error WSAHOS");\r
726#endif\r
727#ifdef WSAEADDRINUSE\r
728 inscode(d, ds, de, "WSAEADDRINUSE", WSAEADDRINUSE, "Address already in use");\r
729#endif\r
730#ifdef WSAEADDRNOTAVAIL\r
731 inscode(d, ds, de, "WSAEADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");\r
732#endif\r
733#ifdef WSAEALREADY\r
734 inscode(d, ds, de, "WSAEALREADY", WSAEALREADY, "Operation already in progress");\r
735#endif\r
736#ifdef WSAEPROTONOSUPPORT\r
737 inscode(d, ds, de, "WSAEPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");\r
738#endif\r
739#ifdef WSASYSNOTREADY\r
740 inscode(d, ds, de, "WSASYSNOTREADY", WSASYSNOTREADY, "Error WSASYSNOTREADY");\r
741#endif\r
742#ifdef WSAEWOULDBLOCK\r
743 inscode(d, ds, de, "WSAEWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");\r
744#endif\r
745#ifdef WSAEPFNOSUPPORT\r
746 inscode(d, ds, de, "WSAEPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");\r
747#endif\r
748#ifdef WSAEOPNOTSUPP\r
749 inscode(d, ds, de, "WSAEOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");\r
750#endif\r
751#ifdef WSAEISCONN\r
752 inscode(d, ds, de, "WSAEISCONN", WSAEISCONN, "Transport endpoint is already connected");\r
753#endif\r
754#ifdef WSAEDQUOT\r
755 inscode(d, ds, de, "WSAEDQUOT", WSAEDQUOT, "Quota exceeded");\r
756#endif\r
757#ifdef WSAENOTCONN\r
758 inscode(d, ds, de, "WSAENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");\r
759#endif\r
760#ifdef WSAEREMOTE\r
761 inscode(d, ds, de, "WSAEREMOTE", WSAEREMOTE, "Object is remote");\r
762#endif\r
763#ifdef WSAEINVAL\r
764 inscode(d, ds, de, "WSAEINVAL", WSAEINVAL, "Invalid argument");\r
765#endif\r
766#ifdef WSAEINPROGRESS\r
767 inscode(d, ds, de, "WSAEINPROGRESS", WSAEINPROGRESS, "Operation now in progress");\r
768#endif\r
769#ifdef WSAGETSELECTEVEN\r
770 inscode(d, ds, de, "WSAGETSELECTEVEN", WSAGETSELECTEVEN, "Error WSAGETSELECTEVEN");\r
771#endif\r
772#ifdef WSAESOCKTNOSUPPORT\r
773 inscode(d, ds, de, "WSAESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");\r
774#endif\r
775#ifdef WSAGETASYNCERRO\r
776 inscode(d, ds, de, "WSAGETASYNCERRO", WSAGETASYNCERRO, "Error WSAGETASYNCERRO");\r
777#endif\r
778#ifdef WSAMAKESELECTREPL\r
779 inscode(d, ds, de, "WSAMAKESELECTREPL", WSAMAKESELECTREPL, "Error WSAMAKESELECTREPL");\r
780#endif\r
781#ifdef WSAGETASYNCBUFLE\r
782 inscode(d, ds, de, "WSAGETASYNCBUFLE", WSAGETASYNCBUFLE, "Error WSAGETASYNCBUFLE");\r
783#endif\r
784#ifdef WSAEDESTADDRREQ\r
785 inscode(d, ds, de, "WSAEDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");\r
786#endif\r
787#ifdef WSAECONNREFUSED\r
788 inscode(d, ds, de, "WSAECONNREFUSED", WSAECONNREFUSED, "Connection refused");\r
789#endif\r
790#ifdef WSAENETRESET\r
791 inscode(d, ds, de, "WSAENETRESET", WSAENETRESET, "Network dropped connection because of reset");\r
792#endif\r
793#ifdef WSAN\r
794 inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");\r
795#endif\r
796\r
797/* These symbols are added for EDK II support. */\r
798#ifdef EMINERRORVAL\r
799 inscode(d, ds, de, "EMINERRORVAL", EMINERRORVAL, "Lowest valid error value");\r
800#endif\r
801#ifdef ENOTSUP\r
802 inscode(d, ds, de, "ENOTSUP", ENOTSUP, "Operation not supported");\r
803#endif\r
804#ifdef EBADRPC\r
805 inscode(d, ds, de, "EBADRPC", EBADRPC, "RPC struct is bad");\r
806#endif\r
807#ifdef ERPCMISMATCH\r
808 inscode(d, ds, de, "ERPCMISMATCH", ERPCMISMATCH, "RPC version wrong");\r
809#endif\r
810#ifdef EPROGUNAVAIL\r
811 inscode(d, ds, de, "EPROGUNAVAIL", EPROGUNAVAIL, "RPC prog. not avail");\r
812#endif\r
813#ifdef EPROGMISMATCH\r
814 inscode(d, ds, de, "EPROGMISMATCH", EPROGMISMATCH, "Program version wrong");\r
815#endif\r
816#ifdef EPROCUNAVAIL\r
817 inscode(d, ds, de, "EPROCUNAVAIL", EPROCUNAVAIL, "Bad procedure for program");\r
818#endif\r
819#ifdef EFTYPE\r
820 inscode(d, ds, de, "EFTYPE", EFTYPE, "Inappropriate file type or format");\r
821#endif\r
822#ifdef EAUTH\r
823 inscode(d, ds, de, "EAUTH", EAUTH, "Authentication error");\r
824#endif\r
825#ifdef ENEEDAUTH\r
826 inscode(d, ds, de, "ENEEDAUTH", ENEEDAUTH, "Need authenticator");\r
827#endif\r
828#ifdef ECANCELED\r
829 inscode(d, ds, de, "ECANCELED", ECANCELED, "Operation canceled");\r
830#endif\r
831#ifdef ENOATTR\r
832 inscode(d, ds, de, "ENOATTR", ENOATTR, "Attribute not found");\r
833#endif\r
834#ifdef EDOOFUS\r
835 inscode(d, ds, de, "EDOOFUS", EDOOFUS, "Programming Error");\r
836#endif\r
837#ifdef EBUFSIZE\r
838 inscode(d, ds, de, "EBUFSIZE", EBUFSIZE, "Buffer too small to hold result");\r
839#endif\r
840#ifdef EMAXERRORVAL\r
841 inscode(d, ds, de, "EMAXERRORVAL", EMAXERRORVAL, "One more than the highest defined error value");\r
842#endif\r
843\r
844 Py_DECREF(de);\r
845}\r