home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / errno.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-18  |  7.1 KB  |  309 lines

  1. /* Copyright (C) 1986-2001 by Digital Mars. $Revision: 1.1.1.1 $ */
  2. #if __DMC__ || __RCC__
  3. #pragma once
  4. #endif
  5.  
  6.  
  7. #ifndef __ERRNO_H
  8. #define __ERRNO_H 1
  9.  
  10. #if __cplusplus
  11. extern "C" {
  12. #endif
  13.  
  14. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  15. #ifndef _CRTAPI1
  16. #define _CRTAPI1 __cdecl
  17. #endif
  18.  
  19. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  20. #ifndef _CRTAPI2
  21. #define _CRTAPI2 __cdecl
  22. #endif
  23.  
  24. /* Define CRTIMP */
  25. #ifndef _CRTIMP
  26. #if defined(_WIN32) && defined(_DLL)
  27. #define _CRTIMP  __declspec(dllimport)
  28. #else
  29. #define _CRTIMP
  30. #endif
  31. #endif
  32.  
  33. #if __OS2__ && __INTSIZE == 4
  34. #define __CLIB    __stdcall
  35. #else
  36. #define __CLIB    __cdecl
  37. #endif
  38.  
  39. #if defined(_MT) || defined(_DLL)
  40. extern int * __CLIB _errno(void);
  41. #define errno (*_errno())
  42. #else
  43. extern int __cdecl errno;
  44. #endif
  45.  
  46. #if M_UNIX || M_XENIX
  47.  
  48. #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
  49. #define EPERM           1
  50. #define ENOENT        2
  51. #define ESRCH        3
  52. #define EINTR        4
  53. #define EIO        5
  54. #define ENXIO        6
  55. #define E2BIG        7
  56. #define ENOEXEC        8
  57. #define EBADF        9
  58. #define ECHILD        10
  59. #define EAGAIN        11
  60. #define ENOMEM        12
  61. #define EACCES        13
  62. #define EFAULT        14
  63.  
  64. #if !defined(_POSIX_SOURCE)
  65. #define ENOTBLK         15
  66. #endif
  67.  
  68. #define EBUSY           16
  69. #define EEXIST        17
  70. #define EXDEV        18
  71. #define ENODEV        19
  72. #define ENOTDIR        20
  73. #define EISDIR        21
  74. #define EINVAL        22
  75. #define ENFILE        23
  76. #define EMFILE        24
  77. #define ENOTTY        25
  78.  
  79. #if !defined(_POSIX_SOURCE)
  80. #define ETXTBSY         26
  81. #endif
  82.  
  83. #define EFBIG           27
  84. #define ENOSPC        28
  85. #define ESPIPE        29
  86. #define EROFS        30
  87. #define EMLINK        31
  88. #define EPIPE        32
  89. #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
  90.  
  91. #define EDOM            33
  92.  
  93. #ifndef ERANGE
  94. #define ERANGE        34
  95. #endif
  96.  
  97. #if defined(_XOPEN_SOURCE) || !__STDC__
  98. #define ENOMSG          35
  99. #define EIDRM        36
  100. #endif
  101.  
  102. #if !__STDC__
  103. #define ECHRNG          37
  104. #define EL2NSYNC    38
  105. #define EL3HLT        39
  106. #define EL3RST        40
  107. #define ELNRNG        41
  108. #define EUNATCH        42
  109. #define ENOCSI        43
  110. #define EL2HLT        44
  111. #endif
  112.  
  113. #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
  114. #define EDEADLK         45
  115. #define ENOLCK        46
  116. #endif
  117.  
  118. #define EBADE           50
  119. #define EBADR           51
  120. #define EXFULL          52
  121. #define ENOANO          53
  122. #define EBADRQC         54
  123. #define EBADSLT         55
  124. #define EDEADLOCK       56
  125. #define EBFONT          57
  126. #define ENOSTR          60
  127. #define ENODATA         61
  128. #define ETIME           62
  129. #define ENOSR           63
  130. #define ENONET          64
  131. #define ENOPKG          65
  132. #define EREMOTE         66
  133. #define ENOLINK         67
  134. #define EADV            68
  135. #define ESRMNT          69
  136. #define ECOMM           70
  137. #define EPROTO          71
  138. #define EMULTIHOP       74
  139. #define ELBIN           75
  140. #define EDOTDOT         76
  141. #define EBADMSG         77
  142.  
  143. #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
  144. #define ENAMETOOLONG    78
  145. #endif 
  146.  
  147. #define EOVERFLOW       79   
  148. #define ENOTUNIQ        80
  149. #define EBADFD          81
  150. #define EREMCHG         82
  151. #define ELIBACC         83
  152. #define ELIBBAD         84
  153. #define ELIBSCN         85
  154. #define ELIBMAX         86
  155. #define ELIBEXEC        87
  156. #define EILSEQ          88
  157.  
  158. #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__
  159. #define ENOSYS        89
  160. #endif /* defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || !__STDC__ */
  161.  
  162. #if !__STDC__
  163.  
  164. #ifdef SCOUNIX
  165. #define TCPERR          90
  166. #define EWOULDBLOCK     (TCPERR+0)
  167. #define EINPROGRESS     (TCPERR+1)
  168. #define EALREADY        (TCPERR+2)
  169. #define ENOTSOCK        (TCPERR+3)
  170. #define EDESTADDRREQ    (TCPERR+4)
  171. #define EMSGSIZE        (TCPERR+5)
  172. #define EPROTOTYPE      (TCPERR+6)
  173. #define EPROTONOSUPPORT (TCPERR+7)
  174. #define ESOCKTNOSUPPORT (TCPERR+8)
  175. #define EOPNOTSUPP      (TCPERR+9)
  176. #define EPFNOSUPPORT    (TCPERR+10)
  177. #define EAFNOSUPPORT    (TCPERR+11)
  178. #define EADDRINUSE      (TCPERR+12)
  179. #define EADDRNOTAVAIL   (TCPERR+13)
  180. #define ENETDOWN        (TCPERR+14)
  181. #define ENETUNREACH     (TCPERR+15)
  182. #define ENETRESET       (TCPERR+16)
  183. #define ECONNABORTED    (TCPERR+17)
  184. #define ECONNRESET      (TCPERR+18)
  185. #define ENOBUFS         ENOSR
  186. #define EISCONN         (TCPERR+20)
  187. #define ENOTCONN        (TCPERR+21)
  188. #define ESHUTDOWN       (TCPERR+22)
  189. #define ETOOMANYREFS    (TCPERR+23)
  190. #define ETIMEDOUT       (TCPERR+24)
  191. #define ECONNREFUSED    (TCPERR+25)
  192. #define EHOSTDOWN       (TCPERR+26)
  193. #define EHOSTUNREACH    (TCPERR+27)
  194. #define ENOPROTOOPT     (TCPERR+28)
  195.  
  196. #else   /* SCOUNIX */
  197.  
  198. #define ELOOP           90
  199. #define ERESTART        91
  200. #define ESTRPIPE        92
  201. #define ENOTEMPTY       93
  202. #define EUSERS          94
  203.  
  204. #define ENOTSOCK        95
  205. #define EDESTADDRREQ    96
  206. #define EMSGSIZE        97
  207. #define EPROTOTYPE      98
  208. #define ENOPROTOOPT     99
  209.  
  210. #define EPROTONOSUPPORT 120
  211. #define ESOCKTNOSUPPORT 121
  212. #define EOPNOTSUPP      122
  213. #define EPFNOSUPPORT    123
  214. #define EAFNOSUPPORT    124
  215.  
  216. #define EADDRINUSE      125
  217. #define EADDRNOTAVAIL   126
  218. #define ENETDOWN        127
  219. #define ENETUNREACH     128
  220. #define ENETRESET       129
  221.  
  222. #define ECONNABORTED    130
  223. #define ECONNRESET      131
  224. #define ENOBUFS         132
  225. #define EISCONN         133
  226. #define ENOTCONN        134
  227. #endif /* SCOUNIX */
  228.  
  229. /* XENIX error numbers */
  230. #define EUCLEAN         135
  231. #define ENOTNAM         137
  232. #define ENAVAIL         138
  233. #define EISNAM          139
  234. #define EREMOTEIO       140
  235. #define EINIT           141
  236. #define EREMDEV         142
  237.  
  238. #define ESHUTDOWN       143
  239. #define ETOOMANYREFS    144
  240. #define ETIMEDOUT       145
  241. #define ECONNREFUSED    146
  242. #define EHOSTDOWN       147
  243. #define EHOSTUNREACH    148
  244. #define EWOULDBLOCK    EAGAIN
  245. #define EALREADY        149
  246. #define EINPROGRESS     150
  247.  
  248. #define ESTALE          151
  249.  
  250. #define ENOLOAD         152
  251. #define ERELOC          153
  252. #define ENOMATCH        154
  253. #define EBADVER         156
  254. #define ECONFIG         157
  255. #endif /* !__STDC__ */
  256. #else  /* M_UNIX || M_XENIX */
  257.  
  258. #define EZERO        0
  259. #define EPERM        1
  260. #define ENOENT       2
  261. #define ESRCH        3
  262. #define EINTR        4
  263. #define EIO          5
  264. #define ENXIO        6
  265. #define E2BIG        7
  266. #define ENOEXEC      8
  267. #define EBADF        9
  268. #define ECHILD       10
  269. #define EAGAIN       11
  270. #define ENOMEM       12
  271. #define EACCES       13
  272. #define EFAULT       14
  273. #define ENOTBLK      15
  274. #define EBUSY        16
  275. #define EEXIST       17
  276. #define EXDEV        18
  277. #define ENODEV       19
  278. #define ENOTDIR      20
  279. #define EISDIR       21
  280. #define EINVAL       22
  281. #define ENFILE       23
  282. #define EMFILE       24
  283. #define ENOTTY       25
  284. #define ETXTBSY      26
  285. #define EFBIG        27
  286. #define ENOSPC       28
  287. #define ESPIPE       29
  288. #define EROFS        30
  289. #define EMLINK       31
  290. #define EPIPE        32
  291. #define EDOM         33
  292. #define ERANGE       34
  293. #define EUCLEAN      35
  294. #define EDEADLOCK    36
  295. #define EDEADLK      36
  296. #define ENAMETOOLONG 38
  297. #define ENOLCK       39
  298. #define ENOSYS       40
  299. #define ENOTEMPTY    41
  300. #define EILSEQ       42
  301.  
  302. #endif /* M_UNIX || M_XENIX */
  303.  
  304. #if __cplusplus
  305. }
  306. #endif
  307.  
  308. #endif
  309.