PageRenderTime 3ms CodeModel.GetById 0ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/DLR_Main/Languages/IronPython/IronPython.Modules/errno.cs

https://bitbucket.org/mdavid/dlr
C# | 277 lines | 256 code | 7 blank | 14 comment | 0 complexity | 1a3bdb222a8d0091f30026773375a2c2 MD5 | raw file
  1/* ****************************************************************************
  2 *
  3 * Copyright (c) Microsoft Corporation. 
  4 *
  5 * This source code is subject to terms and conditions of the Apache License, Version 2.0. A 
  6 * copy of the license can be found in the License.html file at the root of this distribution. If 
  7 * you cannot locate the  Apache License, Version 2.0, please send an email to 
  8 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
  9 * by the terms of the Apache License, Version 2.0.
 10 *
 11 * You must not remove this notice, or any other, from this software.
 12 *
 13 *
 14 * ***************************************************************************/
 15
 16using System.Runtime.CompilerServices;
 17using IronPython.Runtime;
 18using Microsoft.Scripting;
 19
 20[assembly: PythonModule("errno", typeof(IronPython.Modules.PythonErrorNumber))]
 21namespace IronPython.Modules {
 22    public static class PythonErrorNumber {
 23        public const string __doc__ = "Provides a list of common error numbers.  These numbers are frequently reported in various exceptions.";
 24
 25        [SpecialName]
 26        public static void PerformModuleReload(PythonContext/*!*/ context, PythonDictionary/*!*/ dict) {
 27            PythonDictionary errorcode = new PythonDictionary();
 28
 29            errorcode[E2BIG] = "E2BIG";
 30            errorcode[EACCES] = "EACCES";
 31            errorcode[EADDRINUSE] = "EADDRINUSE";
 32            errorcode[EADDRNOTAVAIL] = "EADDRNOTAVAIL";
 33            errorcode[EAFNOSUPPORT] = "EAFNOSUPPORT";
 34            errorcode[EAGAIN] = "EAGAIN";
 35            errorcode[EALREADY] = "EALREADY";
 36            errorcode[EBADF] = "EBADF";
 37            errorcode[EBUSY] = "EBUSY";
 38            errorcode[ECHILD] = "ECHILD";
 39            errorcode[ECONNABORTED] = "ECONNABORTED";
 40            errorcode[ECONNREFUSED] = "ECONNREFUSED";
 41            errorcode[ECONNRESET] = "ECONNRESET";
 42            errorcode[EDEADLK] = "EDEADLK";
 43            errorcode[EDEADLOCK] = "EDEADLOCK";
 44            errorcode[EDESTADDRREQ] = "EDESTADDRREQ";
 45            errorcode[EDOM] = "EDOM";
 46            errorcode[EDQUOT] = "EDQUOT";
 47            errorcode[EEXIST] = "EEXIST";
 48            errorcode[EFAULT] = "EFAULT";
 49            errorcode[EFBIG] = "EFBIG";
 50            errorcode[EHOSTDOWN] = "EHOSTDOWN";
 51            errorcode[EHOSTUNREACH] = "EHOSTUNREACH";
 52            errorcode[EILSEQ] = "EILSEQ";
 53            errorcode[EINPROGRESS] = "EINPROGRESS";
 54            errorcode[EINTR] = "EINTR";
 55            errorcode[EINVAL] = "EINVAL";
 56            errorcode[EIO] = "EIO";
 57            errorcode[EISCONN] = "EISCONN";
 58            errorcode[EISDIR] = "EISDIR";
 59            errorcode[ELOOP] = "ELOOP";
 60            errorcode[EMFILE] = "EMFILE";
 61            errorcode[EMLINK] = "EMLINK";
 62            errorcode[EMSGSIZE] = "EMSGSIZE";
 63            errorcode[ENAMETOOLONG] = "ENAMETOOLONG";
 64            errorcode[ENETDOWN] = "ENETDOWN";
 65            errorcode[ENETRESET] = "ENETRESET";
 66            errorcode[ENETUNREACH] = "ENETUNREACH";
 67            errorcode[ENFILE] = "ENFILE";
 68            errorcode[ENOBUFS] = "ENOBUFS";
 69            errorcode[ENODEV] = "ENODEV";
 70            errorcode[ENOENT] = "ENOENT";
 71            errorcode[ENOEXEC] = "ENOEXEC";
 72            errorcode[ENOLCK] = "ENOLCK";
 73            errorcode[ENOMEM] = "ENOMEM";
 74            errorcode[ENOPROTOOPT] = "ENOPROTOOPT";
 75            errorcode[ENOSPC] = "ENOSPC";
 76            errorcode[ENOSYS] = "ENOSYS";
 77            errorcode[ENOTCONN] = "ENOTCONN";
 78            errorcode[ENOTDIR] = "ENOTDIR";
 79            errorcode[ENOTEMPTY] = "ENOTEMPTY";
 80            errorcode[ENOTSOCK] = "ENOTSOCK";
 81            errorcode[ENOTTY] = "ENOTTY";
 82            errorcode[ENXIO] = "ENXIO";
 83            errorcode[EOPNOTSUPP] = "EOPNOTSUPP";
 84            errorcode[EPERM] = "EPERM";
 85            errorcode[EPFNOSUPPORT] = "EPFNOSUPPORT";
 86            errorcode[EPIPE] = "EPIPE";
 87            errorcode[EPROTONOSUPPORT] = "EPROTONOSUPPORT";
 88            errorcode[EPROTOTYPE] = "EPROTOTYPE";
 89            errorcode[ERANGE] = "ERANGE";
 90            errorcode[EREMOTE] = "EREMOTE";
 91            errorcode[EROFS] = "EROFS";
 92            errorcode[ESHUTDOWN] = "ESHUTDOWN";
 93            errorcode[ESOCKTNOSUPPORT] = "ESOCKTNOSUPPORT";
 94            errorcode[ESPIPE] = "ESPIPE";
 95            errorcode[ESRCH] = "ESRCH";
 96            errorcode[ESTALE] = "ESTALE";
 97            errorcode[ETIMEDOUT] = "ETIMEDOUT";
 98            errorcode[ETOOMANYREFS] = "ETOOMANYREFS";
 99            errorcode[EUSERS] = "EUSERS";
100            errorcode[EWOULDBLOCK] = "EWOULDBLOCK";
101            errorcode[EXDEV] = "EXDEV";
102            errorcode[WSABASEERR] = "WSABASEERR";
103            errorcode[WSAEACCES] = "WSAEACCES";
104            errorcode[WSAEADDRINUSE] = "WSAEADDRINUSE";
105            errorcode[WSAEADDRNOTAVAIL] = "WSAEADDRNOTAVAIL";
106            errorcode[WSAEAFNOSUPPORT] = "WSAEAFNOSUPPORT";
107            errorcode[WSAEALREADY] = "WSAEALREADY";
108            errorcode[WSAEBADF] = "WSAEBADF";
109            errorcode[WSAECONNABORTED] = "WSAECONNABORTED";
110            errorcode[WSAECONNREFUSED] = "WSAECONNREFUSED";
111            errorcode[WSAECONNRESET] = "WSAECONNRESET";
112            errorcode[WSAEDESTADDRREQ] = "WSAEDESTADDRREQ";
113            errorcode[WSAEDISCON] = "WSAEDISCON";
114            errorcode[WSAEDQUOT] = "WSAEDQUOT";
115            errorcode[WSAEFAULT] = "WSAEFAULT";
116            errorcode[WSAEHOSTDOWN] = "WSAEHOSTDOWN";
117            errorcode[WSAEHOSTUNREACH] = "WSAEHOSTUNREACH";
118            errorcode[WSAEINPROGRESS] = "WSAEINPROGRESS";
119            errorcode[WSAEINTR] = "WSAEINTR";
120            errorcode[WSAEINVAL] = "WSAEINVAL";
121            errorcode[WSAEISCONN] = "WSAEISCONN";
122            errorcode[WSAELOOP] = "WSAELOOP";
123            errorcode[WSAEMFILE] = "WSAEMFILE";
124            errorcode[WSAEMSGSIZE] = "WSAEMSGSIZE";
125            errorcode[WSAENAMETOOLONG] = "WSAENAMETOOLONG";
126            errorcode[WSAENETDOWN] = "WSAENETDOWN";
127            errorcode[WSAENETRESET] = "WSAENETRESET";
128            errorcode[WSAENETUNREACH] = "WSAENETUNREACH";
129            errorcode[WSAENOBUFS] = "WSAENOBUFS";
130            errorcode[WSAENOPROTOOPT] = "WSAENOPROTOOPT";
131            errorcode[WSAENOTCONN] = "WSAENOTCONN";
132            errorcode[WSAENOTEMPTY] = "WSAENOTEMPTY";
133            errorcode[WSAENOTSOCK] = "WSAENOTSOCK";
134            errorcode[WSAEOPNOTSUPP] = "WSAEOPNOTSUPP";
135            errorcode[WSAEPFNOSUPPORT] = "WSAEPFNOSUPPORT";
136            errorcode[WSAEPROCLIM] = "WSAEPROCLIM";
137            errorcode[WSAEPROTONOSUPPORT] = "WSAEPROTONOSUPPORT";
138            errorcode[WSAEPROTOTYPE] = "WSAEPROTOTYPE";
139            errorcode[WSAEREMOTE] = "WSAEREMOTE";
140            errorcode[WSAESHUTDOWN] = "WSAESHUTDOWN";
141            errorcode[WSAESOCKTNOSUPPORT] = "WSAESOCKTNOSUPPORT";
142            errorcode[WSAESTALE] = "WSAESTALE";
143            errorcode[WSAETIMEDOUT] = "WSAETIMEDOUT";
144            errorcode[WSAETOOMANYREFS] = "WSAETOOMANYREFS";
145            errorcode[WSAEUSERS] = "WSAEUSERS";
146            errorcode[WSAEWOULDBLOCK] = "WSAEWOULDBLOCK";
147            errorcode[WSANOTINITIALISED] = "WSANOTINITIALISED";
148            errorcode[WSASYSNOTREADY] = "WSASYSNOTREADY";
149            errorcode[WSAVERNOTSUPPORTED] = "WSAVERNOTSUPPORTED";
150
151            dict["errorcode"] = errorcode;
152        }
153
154        public const int E2BIG = 7;
155        public const int EACCES = 13;
156        public const int EADDRINUSE = 10048;
157        public const int EADDRNOTAVAIL = 10049;
158        public const int EAFNOSUPPORT = 10047;
159        public const int EAGAIN = 11;
160        public const int EALREADY = 10037;
161        public const int EBADF = 9;
162        public const int EBUSY = 16;
163        public const int ECHILD = 10;
164        public const int ECONNABORTED = 10053;
165        public const int ECONNREFUSED = 10061;
166        public const int ECONNRESET = 10054;
167        public const int EDEADLK = 36;
168        public const int EDEADLOCK = 36;
169        public const int EDESTADDRREQ = 10039;
170        public const int EDOM = 33;
171        public const int EDQUOT = 10069;
172        public const int EEXIST = 17;
173        public const int EFAULT = 14;
174        public const int EFBIG = 27;
175        public const int EHOSTDOWN = 10064;
176        public const int EHOSTUNREACH = 10065;
177        public const int EILSEQ = 42;
178        public const int EINPROGRESS = 10036;
179        public const int EINTR = 4;
180        public const int EINVAL = 22;
181        public const int EIO = 5;
182        public const int EISCONN = 10056;
183        public const int EISDIR = 21;
184        public const int ELOOP = 10062;
185        public const int EMFILE = 24;
186        public const int EMLINK = 31;
187        public const int EMSGSIZE = 10040;
188        public const int ENAMETOOLONG = 38;
189        public const int ENETDOWN = 10050;
190        public const int ENETRESET = 10052;
191        public const int ENETUNREACH = 10051;
192        public const int ENFILE = 23;
193        public const int ENOBUFS = 10055;
194        public const int ENODEV = 19;
195        public const int ENOENT = 2;
196        public const int ENOEXEC = 8;
197        public const int ENOLCK = 39;
198        public const int ENOMEM = 12;
199        public const int ENOPROTOOPT = 10042;
200        public const int ENOSPC = 28;
201        public const int ENOSYS = 40;
202        public const int ENOTCONN = 10057;
203        public const int ENOTDIR = 20;
204        public const int ENOTEMPTY = 41;
205        public const int ENOTSOCK = 10038;
206        public const int ENOTTY = 25;
207        public const int ENXIO = 6;
208        public const int EOPNOTSUPP = 10045;
209        public const int EPERM = 1;
210        public const int EPFNOSUPPORT = 10046;
211        public const int EPIPE = 32;
212        public const int EPROTONOSUPPORT = 10043;
213        public const int EPROTOTYPE = 10041;
214        public const int ERANGE = 34;
215        public const int EREMOTE = 10071;
216        public const int EROFS = 30;
217        public const int ESHUTDOWN = 10058;
218        public const int ESOCKTNOSUPPORT = 10044;
219        public const int ESPIPE = 29;
220        public const int ESRCH = 3;
221        public const int ESTALE = 10070;
222        public const int ETIMEDOUT = 10060;
223        public const int ETOOMANYREFS = 10059;
224        public const int EUSERS = 10068;
225        public const int EWOULDBLOCK = 10035;
226        public const int EXDEV = 18;
227        public const int WSABASEERR = 10000;
228        public const int WSAEACCES = 10013;
229        public const int WSAEADDRINUSE = 10048;
230        public const int WSAEADDRNOTAVAIL = 10049;
231        public const int WSAEAFNOSUPPORT = 10047;
232        public const int WSAEALREADY = 10037;
233        public const int WSAEBADF = 10009;
234        public const int WSAECONNABORTED = 10053;
235        public const int WSAECONNREFUSED = 10061;
236        public const int WSAECONNRESET = 10054;
237        public const int WSAEDESTADDRREQ = 10039;
238        public const int WSAEDISCON = 10101;
239        public const int WSAEDQUOT = 10069;
240        public const int WSAEFAULT = 10014;
241        public const int WSAEHOSTDOWN = 10064;
242        public const int WSAEHOSTUNREACH = 10065;
243        public const int WSAEINPROGRESS = 10036;
244        public const int WSAEINTR = 10004;
245        public const int WSAEINVAL = 10022;
246        public const int WSAEISCONN = 10056;
247        public const int WSAELOOP = 10062;
248        public const int WSAEMFILE = 10024;
249        public const int WSAEMSGSIZE = 10040;
250        public const int WSAENAMETOOLONG = 10063;
251        public const int WSAENETDOWN = 10050;
252        public const int WSAENETRESET = 10052;
253        public const int WSAENETUNREACH = 10051;
254        public const int WSAENOBUFS = 10055;
255        public const int WSAENOPROTOOPT = 10042;
256        public const int WSAENOTCONN = 10057;
257        public const int WSAENOTEMPTY = 10066;
258        public const int WSAENOTSOCK = 10038;
259        public const int WSAEOPNOTSUPP = 10045;
260        public const int WSAEPFNOSUPPORT = 10046;
261        public const int WSAEPROCLIM = 10067;
262        public const int WSAEPROTONOSUPPORT = 10043;
263        public const int WSAEPROTOTYPE = 10041;
264        public const int WSAEREMOTE = 10071;
265        public const int WSAESHUTDOWN = 10058;
266        public const int WSAESOCKTNOSUPPORT = 10044;
267        public const int WSAESTALE = 10070;
268        public const int WSAETIMEDOUT = 10060;
269        public const int WSAETOOMANYREFS = 10059;
270        public const int WSAEUSERS = 10068;
271        public const int WSAEWOULDBLOCK = 10035;
272        public const int WSANOTINITIALISED = 10093;
273        public const int WSASYSNOTREADY = 10091;
274        public const int WSAVERNOTSUPPORTED = 10092;
275
276    }
277}