LCOV - code coverage report
Current view: top level - basic - errno-from-name.h (source / functions) Hit Total Coverage
Test: systemd test coverage Lines: 24 24 100.0 %
Date: 2015-07-29 18:47:03 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /* ANSI-C code produced by gperf version 3.0.4 */
       2             : /* Command-line: gperf -L ANSI-C -t --ignore-case -N lookup_errno -H hash_errno_name -p -C  */
       3             : /* Computed positions: -k'2-3,5-6' */
       4             : 
       5             : #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
       6             :       && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
       7             :       && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
       8             :       && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
       9             :       && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
      10             :       && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
      11             :       && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
      12             :       && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
      13             :       && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
      14             :       && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
      15             :       && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
      16             :       && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
      17             :       && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
      18             :       && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
      19             :       && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
      20             :       && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
      21             :       && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
      22             :       && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
      23             :       && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
      24             :       && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
      25             :       && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
      26             :       && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
      27             :       && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
      28             : /* The character set is not based on ISO-646.  */
      29             : #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
      30             : #endif
      31             : 
      32             : struct errno_name { const char* name; int id; };
      33             : 
      34             : #define TOTAL_KEYWORDS 134
      35             : #define MIN_WORD_LENGTH 3
      36             : #define MAX_WORD_LENGTH 15
      37             : #define MIN_HASH_VALUE 6
      38             : #define MAX_HASH_VALUE 326
      39             : /* maximum key range = 321, duplicates = 0 */
      40             : 
      41             : #ifndef GPERF_DOWNCASE
      42             : #define GPERF_DOWNCASE 1
      43             : static unsigned char gperf_downcase[256] =
      44             :   {
      45             :       0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,
      46             :      15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,
      47             :      30,  31,  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,
      48             :      45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,
      49             :      60,  61,  62,  63,  64,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106,
      50             :     107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
      51             :     122,  91,  92,  93,  94,  95,  96,  97,  98,  99, 100, 101, 102, 103, 104,
      52             :     105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
      53             :     120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
      54             :     135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
      55             :     150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
      56             :     165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
      57             :     180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
      58             :     195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
      59             :     210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
      60             :     225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
      61             :     240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
      62             :     255
      63             :   };
      64             : #endif
      65             : 
      66             : #ifndef GPERF_CASE_STRCMP
      67             : #define GPERF_CASE_STRCMP 1
      68             : static int
      69          43 : gperf_case_strcmp (register const char *s1, register const char *s2)
      70             : {
      71             :   for (;;)
      72             :     {
      73          43 :       unsigned char c1 = gperf_downcase[(unsigned char)*s1++];
      74          43 :       unsigned char c2 = gperf_downcase[(unsigned char)*s2++];
      75          43 :       if (c1 != 0 && c1 == c2)
      76          37 :         continue;
      77           6 :       return (int)c1 - (int)c2;
      78          37 :     }
      79             : }
      80             : #endif
      81             : 
      82             : #ifdef __GNUC__
      83             : __inline
      84             : #else
      85             : #ifdef __cplusplus
      86             : inline
      87             : #endif
      88             : #endif
      89             : static unsigned int
      90           7 : hash_errno_name (register const char *str, register unsigned int len)
      91             : {
      92             :   static const unsigned short asso_values[] =
      93             :     {
      94             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
      95             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
      96             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
      97             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
      98             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
      99             :        30, 110, 327, 327, 327, 327, 327, 327, 327, 327,
     100             :       327, 327, 327, 327, 327,  25,  70,  65,  10,  10,
     101             :       105,  35,  30,   5, 327, 155,  50,  80,   0,   0,
     102             :        30, 175,   5,  35,  20, 160,  25, 105, 115,  90,
     103             :       327, 327, 327, 327, 327, 327, 327,  25,  70,  65,
     104             :        10,  10, 105,  35,  30,   5, 327, 155,  50,  80,
     105             :         0,   0,  30, 175,   5,  35,  20, 160,  25, 105,
     106             :       115,  90, 327, 327, 327, 327, 327, 327, 327, 327,
     107             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     108             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     109             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     110             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     111             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     112             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     113             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     114             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     115             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     116             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     117             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     118             :       327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
     119             :       327, 327, 327, 327, 327, 327
     120             :     };
     121           7 :   register int hval = len;
     122             : 
     123           7 :   switch (hval)
     124             :     {
     125             :       default:
     126           5 :         hval += asso_values[(unsigned char)str[5]];
     127             :       /*FALLTHROUGH*/
     128             :       case 5:
     129           7 :         hval += asso_values[(unsigned char)str[4]];
     130             :       /*FALLTHROUGH*/
     131             :       case 4:
     132             :       case 3:
     133           7 :         hval += asso_values[(unsigned char)str[2]];
     134             :       /*FALLTHROUGH*/
     135             :       case 2:
     136           7 :         hval += asso_values[(unsigned char)str[1]];
     137           7 :         break;
     138             :     }
     139           7 :   return hval;
     140             : }
     141             : 
     142             : #ifdef __GNUC__
     143             : __inline
     144             : #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
     145             : __attribute__ ((__gnu_inline__))
     146             : #endif
     147             : #endif
     148             : const struct errno_name *
     149           7 : lookup_errno (register const char *str, register unsigned int len)
     150             : {
     151             :   static const struct errno_name wordlist[] =
     152             :     {
     153             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     154             :       {(char*)0}, {(char*)0},
     155             :       {"ENOANO", ENOANO},
     156             :       {(char*)0},
     157             :       {"EIO", EIO},
     158             :       {(char*)0},
     159             :       {"ENOSR", ENOSR},
     160             :       {(char*)0},
     161             :       {"ENOLINK", ENOLINK},
     162             :       {(char*)0},
     163             :       {"EDOM", EDOM},
     164             :       {"EINTR", EINTR},
     165             :       {"ENOPROTOOPT", ENOPROTOOPT},
     166             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     167             :       {"EINPROGRESS", EINPROGRESS},
     168             :       {"ENOTDIR", ENOTDIR},
     169             :       {(char*)0}, {(char*)0}, {(char*)0},
     170             :       {"ENOENT", ENOENT},
     171             :       {"EDOTDOT", EDOTDOT},
     172             :       {"ENETDOWN", ENETDOWN},
     173             :       {"ENOMEDIUM", ENOMEDIUM},
     174             :       {"ENOTRECOVERABLE", ENOTRECOVERABLE},
     175             :       {"ENOSTR", ENOSTR},
     176             :       {"ENOTNAM", ENOTNAM},
     177             :       {(char*)0},
     178             :       {"ENETRESET", ENETRESET},
     179             :       {(char*)0},
     180             :       {"ENONET", ENONET},
     181             :       {(char*)0}, {(char*)0},
     182             :       {"EADV", EADV},
     183             :       {"ETIME", ETIME},
     184             :       {"ENODEV", ENODEV},
     185             :       {"EREMOTE", EREMOTE},
     186             :       {"ENOTSOCK", ENOTSOCK},
     187             :       {"EREMOTEIO", EREMOTEIO},
     188             :       {"EROFS", EROFS},
     189             :       {"ENOCSI", ENOCSI},
     190             :       {"EISCONN", EISCONN},
     191             :       {(char*)0}, {(char*)0},
     192             :       {"EPIPE", EPIPE},
     193             :       {(char*)0},
     194             :       {"ENODATA", ENODATA},
     195             :       {"EADDRNOTAVAIL", EADDRNOTAVAIL},
     196             :       {"ETIMEDOUT", ETIMEDOUT},
     197             :       {"EADDRINUSE", EADDRINUSE},
     198             :       {"EISDIR", EISDIR},
     199             :       {(char*)0}, {(char*)0}, {(char*)0},
     200             :       {"EOPNOTSUPP", EOPNOTSUPP},
     201             :       {"EPROTO", EPROTO},
     202             :       {"ENAVAIL", ENAVAIL},
     203             :       {(char*)0}, {(char*)0},
     204             :       {"EPROTOTYPE", EPROTOTYPE},
     205             :       {"ESRMNT", ESRMNT},
     206             :       {"ENAMETOOLONG", ENAMETOOLONG},
     207             :       {"ERESTART", ERESTART},
     208             :       {"EHOSTDOWN", EHOSTDOWN},
     209             :       {"EPROTONOSUPPORT", EPROTONOSUPPORT},
     210             :       {"EAGAIN", EAGAIN},
     211             :       {(char*)0},
     212             :       {"ENOTCONN", ENOTCONN},
     213             :       {(char*)0},
     214             :       {"ESRCH", ESRCH},
     215             :       {"ENOMSG", ENOMSG},
     216             :       {"EDESTADDRREQ", EDESTADDRREQ},
     217             :       {(char*)0}, {(char*)0},
     218             :       {"ECONNRESET", ECONNRESET},
     219             :       {"ERANGE", ERANGE},
     220             :       {"ECONNREFUSED", ECONNREFUSED},
     221             :       {(char*)0}, {(char*)0},
     222             :       {"ELOOP", ELOOP},
     223             :       {"EINVAL", EINVAL},
     224             :       {"EDEADLK", EDEADLK},
     225             :       {(char*)0},
     226             :       {"EDEADLOCK", EDEADLOCK},
     227             :       {(char*)0},
     228             :       {"ELNRNG", ELNRNG},
     229             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     230             :       {"ENOMEM", ENOMEM},
     231             :       {(char*)0},
     232             :       {"ESTRPIPE", ESTRPIPE},
     233             :       {"ENOTEMPTY", ENOTEMPTY},
     234             :       {"EIDRM", EIDRM},
     235             :       {"ENOSPC", ENOSPC},
     236             :       {"ECONNABORTED", ECONNABORTED},
     237             :       {(char*)0},
     238             :       {"ESHUTDOWN", ESHUTDOWN},
     239             :       {"EBADR", EBADR},
     240             :       {"ENOKEY", ENOKEY},
     241             :       {(char*)0}, {(char*)0}, {(char*)0},
     242             :       {"EBADE", EBADE},
     243             :       {"ESPIPE", ESPIPE},
     244             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     245             :       {"ENOTTY", ENOTTY},
     246             :       {"EREMCHG", EREMCHG},
     247             :       {"EALREADY", EALREADY},
     248             :       {(char*)0},
     249             :       {"ENXIO", ENXIO},
     250             :       {"ESTALE", ESTALE},
     251             :       {(char*)0}, {(char*)0}, {(char*)0},
     252             :       {"EPERM", EPERM},
     253             :       {(char*)0},
     254             :       {"ENOTBLK", ENOTBLK},
     255             :       {(char*)0}, {(char*)0},
     256             :       {"EOWNERDEAD", EOWNERDEAD},
     257             :       {"ENOSYS", ENOSYS},
     258             :       {"ENOEXEC", ENOEXEC},
     259             :       {(char*)0}, {(char*)0}, {(char*)0},
     260             :       {"ECHRNG", ECHRNG},
     261             :       {"ETOOMANYREFS", ETOOMANYREFS},
     262             :       {(char*)0}, {(char*)0},
     263             :       {"E2BIG", E2BIG},
     264             :       {"EACCES", EACCES},
     265             :       {(char*)0}, {(char*)0},
     266             :       {"EOVERFLOW", EOVERFLOW},
     267             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     268             :       {"EHWPOISON", EHWPOISON},
     269             :       {"ECOMM", ECOMM},
     270             :       {"EISNAM", EISNAM},
     271             :       {"ELIBACC", ELIBACC},
     272             :       {(char*)0}, {(char*)0},
     273             :       {"EXDEV", EXDEV},
     274             :       {"EL2HLT", EL2HLT},
     275             :       {"ELIBBAD", ELIBBAD},
     276             :       {(char*)0}, {(char*)0}, {(char*)0},
     277             :       {"ECHILD", ECHILD},
     278             :       {"ELIBSCN", ELIBSCN},
     279             :       {"EMSGSIZE", EMSGSIZE},
     280             :       {(char*)0}, {(char*)0}, {(char*)0},
     281             :       {"ELIBMAX", ELIBMAX},
     282             :       {"ENOTUNIQ", ENOTUNIQ},
     283             :       {(char*)0}, {(char*)0},
     284             :       {"ENFILE", ENFILE},
     285             :       {"ERFKILL", ERFKILL},
     286             :       {(char*)0},
     287             :       {"ECANCELED", ECANCELED},
     288             :       {(char*)0},
     289             :       {"EWOULDBLOCK", EWOULDBLOCK},
     290             :       {"EAFNOSUPPORT", EAFNOSUPPORT},
     291             :       {(char*)0}, {(char*)0}, {(char*)0},
     292             :       {"ENETUNREACH", ENETUNREACH},
     293             :       {"EPFNOSUPPORT", EPFNOSUPPORT},
     294             :       {(char*)0}, {(char*)0}, {(char*)0},
     295             :       {"EEXIST", EEXIST},
     296             :       {"EBADSLT", EBADSLT},
     297             :       {"ELIBEXEC", ELIBEXEC},
     298             :       {(char*)0}, {(char*)0},
     299             :       {"EKEYREVOKED", EKEYREVOKED},
     300             :       {"EKEYREJECTED", EKEYREJECTED},
     301             :       {(char*)0}, {(char*)0}, {(char*)0},
     302             :       {"ENOPKG", ENOPKG},
     303             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     304             :       {"EBFONT", EBFONT},
     305             :       {"ENOTSUP", ENOTSUP},
     306             :       {(char*)0}, {(char*)0},
     307             :       {"EBADF", EBADF},
     308             :       {"EFAULT", EFAULT},
     309             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     310             :       {"EDQUOT", EDQUOT},
     311             :       {(char*)0},
     312             :       {"EL2NSYNC", EL2NSYNC},
     313             :       {(char*)0},
     314             :       {"EFBIG", EFBIG},
     315             :       {"EBADFD", EBADFD},
     316             :       {"EBADMSG", EBADMSG},
     317             :       {(char*)0}, {(char*)0}, {(char*)0},
     318             :       {"EL3RST", EL3RST},
     319             :       {"EHOSTUNREACH", EHOSTUNREACH},
     320             :       {(char*)0}, {(char*)0},
     321             :       {"ESOCKTNOSUPPORT", ESOCKTNOSUPPORT},
     322             :       {"ENOLCK", ENOLCK},
     323             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     324             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     325             :       {(char*)0},
     326             :       {"EL3HLT", EL3HLT},
     327             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     328             :       {"EUSERS", EUSERS},
     329             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     330             :       {"EILSEQ", EILSEQ},
     331             :       {"ETXTBSY", ETXTBSY},
     332             :       {(char*)0}, {(char*)0}, {(char*)0},
     333             :       {"EMFILE", EMFILE},
     334             :       {"EUNATCH", EUNATCH},
     335             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     336             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     337             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     338             :       {(char*)0},
     339             :       {"EMEDIUMTYPE", EMEDIUMTYPE},
     340             :       {"EUCLEAN", EUCLEAN},
     341             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     342             :       {"ENOBUFS", ENOBUFS},
     343             :       {(char*)0},
     344             :       {"EMULTIHOP", EMULTIHOP},
     345             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     346             :       {(char*)0}, {(char*)0}, {(char*)0},
     347             :       {"EBADRQC", EBADRQC},
     348             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     349             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     350             :       {"EMLINK", EMLINK},
     351             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     352             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     353             :       {(char*)0},
     354             :       {"EKEYEXPIRED", EKEYEXPIRED},
     355             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     356             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     357             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     358             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     359             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     360             :       {(char*)0}, {(char*)0}, {(char*)0},
     361             :       {"EBUSY", EBUSY},
     362             :       {"EXFULL", EXFULL}
     363             :     };
     364             : 
     365           7 :   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
     366             :     {
     367           7 :       register int key = hash_errno_name (str, len);
     368             : 
     369           7 :       if (key <= MAX_HASH_VALUE && key >= 0)
     370             :         {
     371           7 :           register const char *s = wordlist[key].name;
     372             : 
     373           7 :           if (s && (((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strcmp (str, s))
     374           6 :             return &wordlist[key];
     375             :         }
     376             :     }
     377           1 :   return 0;
     378             : }

Generated by: LCOV version 1.11