error_temp.c (1079B)
1 #include <errno.h> 2 #include "error.h" 3 4 #define X(n) case n: return 1; break; 5 #define XI(n,s) if (n == e) return 1; 6 7 int error_temp(int e) 8 { 9 switch (e) { 10 X(error_intr) 11 X(error_nomem) 12 X(error_txtbsy) 13 X(error_io) 14 X(error_timeout) 15 X(error_again) 16 #ifdef EDEADLK 17 X(EDEADLK) 18 #endif 19 #ifdef EBUSY 20 X(EBUSY) 21 #endif 22 #ifdef ENFILE 23 X(ENFILE) 24 #endif 25 #ifdef EMFILE 26 X(EMFILE) 27 #endif 28 #ifdef EFBIG 29 X(EFBIG) 30 #endif 31 #ifdef ENOSPC 32 X(ENOSPC) 33 #endif 34 #ifdef ENETDOWN 35 X(ENETDOWN) 36 #endif 37 #ifdef ENETUNREACH 38 X(ENETUNREACH) 39 #endif 40 #ifdef ENETRESET 41 X(ENETRESET) 42 #endif 43 #ifdef ECONNABORTED 44 X(ECONNABORTED) 45 #endif 46 #ifdef ECONNRESET 47 X(ECONNRESET) 48 #endif 49 #ifdef ENOBUFS 50 X(ENOBUFS) 51 #endif 52 #ifdef ETOOMANYREFS 53 X(ETOOMANYREFS) 54 #endif 55 #ifdef ECONNREFUSED 56 X(ECONNREFUSED) 57 #endif 58 #ifdef EHOSTDOWN 59 X(EHOSTDOWN) 60 #endif 61 #ifdef EHOSTUNREACH 62 X(EHOSTUNREACH) 63 #endif 64 #ifdef EPROCLIM 65 X(EPROCLIM) 66 #endif 67 #ifdef EUSERS 68 X(EUSERS) 69 #endif 70 #ifdef EDQUOT 71 X(EDQUOT) 72 #endif 73 #ifdef ESTALE 74 X(ESTALE) 75 #endif 76 #ifdef ENOLCK 77 X(ENOLCK) 78 #endif 79 } 80 XI(error_wouldblock, e) 81 return 0; 82 }