PageRenderTime 80ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/IronPython_2_6/Src/IronPython.Modules/errno.cs

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