LCOV - code coverage report
Current view: top level - basic - af-from-name.h (source / functions) Hit Total Coverage
Test: systemd test coverage Lines: 0 23 0.0 %
Date: 2015-07-29 18:47:03 Functions: 0 3 0.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_af -H hash_af_name -p -C  */
       3             : /* Computed positions: -k'4-5,7' */
       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 af_name { const char* name; int id; };
      33             : 
      34             : #define TOTAL_KEYWORDS 41
      35             : #define MIN_WORD_LENGTH 6
      36             : #define MAX_WORD_LENGTH 13
      37             : #define MIN_HASH_VALUE 6
      38             : #define MAX_HASH_VALUE 93
      39             : /* maximum key range = 88, 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           0 : gperf_case_strcmp (register const char *s1, register const char *s2)
      70             : {
      71             :   for (;;)
      72             :     {
      73           0 :       unsigned char c1 = gperf_downcase[(unsigned char)*s1++];
      74           0 :       unsigned char c2 = gperf_downcase[(unsigned char)*s2++];
      75           0 :       if (c1 != 0 && c1 == c2)
      76           0 :         continue;
      77           0 :       return (int)c1 - (int)c2;
      78           0 :     }
      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           0 : hash_af_name (register const char *str, register unsigned int len)
      91             : {
      92             :   static const unsigned char asso_values[] =
      93             :     {
      94             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
      95             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
      96             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
      97             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
      98             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
      99             :       35, 94, 94, 50, 94, 94, 94, 94, 94, 94,
     100             :       94, 94, 94, 94, 94,  0,  5, 35,  0,  5,
     101             :       40, 94, 10,  0, 94, 50, 15, 94,  5, 10,
     102             :        0, 94, 25,  5,  0,  5, 45,  0,  5, 94,
     103             :       94, 94, 94, 94, 94, 94, 94,  0,  5, 35,
     104             :        0,  5, 40, 94, 10,  0, 94, 50, 15, 94,
     105             :        5, 10,  0, 94, 25,  5,  0,  5, 45,  0,
     106             :        5, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     107             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     108             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     109             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     110             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     111             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     112             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     113             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     114             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     115             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     116             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     117             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     118             :       94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
     119             :       94, 94, 94, 94, 94, 94
     120             :     };
     121           0 :   register int hval = len;
     122             : 
     123           0 :   switch (hval)
     124             :     {
     125             :       default:
     126           0 :         hval += asso_values[(unsigned char)str[6]];
     127             :       /*FALLTHROUGH*/
     128             :       case 6:
     129             :       case 5:
     130           0 :         hval += asso_values[(unsigned char)str[4]];
     131             :       /*FALLTHROUGH*/
     132             :       case 4:
     133           0 :         hval += asso_values[(unsigned char)str[3]];
     134           0 :         break;
     135             :     }
     136           0 :   return hval;
     137             : }
     138             : 
     139             : #ifdef __GNUC__
     140             : __inline
     141             : #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
     142             : __attribute__ ((__gnu_inline__))
     143             : #endif
     144             : #endif
     145             : const struct af_name *
     146           0 : lookup_af (register const char *str, register unsigned int len)
     147             : {
     148             :   static const struct af_name wordlist[] =
     149             :     {
     150             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     151             :       {(char*)0}, {(char*)0},
     152             :       {"AF_IPX", AF_IPX},
     153             :       {(char*)0}, {(char*)0},
     154             :       {"AF_ATMPVC", AF_ATMPVC},
     155             :       {"AF_WANPIPE", AF_WANPIPE},
     156             :       {"AF_ASH", AF_ASH},
     157             :       {"AF_INET", AF_INET},
     158             :       {"AF_INET6", AF_INET6},
     159             :       {"AF_ATMSVC", AF_ATMSVC},
     160             :       {(char*)0},
     161             :       {"AF_SNA", AF_SNA},
     162             :       {"AF_ISDN", AF_ISDN},
     163             :       {"AF_PPPOX", AF_PPPOX},
     164             :       {"AF_DECnet", AF_DECnet},
     165             :       {(char*)0},
     166             :       {"AF_ALG", AF_ALG},
     167             :       {"AF_UNIX", AF_UNIX},
     168             :       {"AF_IEEE802154", AF_IEEE802154},
     169             :       {"AF_PHONET", AF_PHONET},
     170             :       {"AF_NETBEUI", AF_NETBEUI},
     171             :       {"AF_SECURITY", AF_SECURITY},
     172             :       {"AF_APPLETALK", AF_APPLETALK},
     173             :       {(char*)0}, {(char*)0}, {(char*)0},
     174             :       {"AF_RDS", AF_RDS},
     175             :       {"AF_IRDA", AF_IRDA},
     176             :       {"AF_LOCAL", AF_LOCAL},
     177             :       {(char*)0},
     178             :       {"AF_NETLINK", AF_NETLINK},
     179             :       {"AF_LLC", AF_LLC},
     180             :       {"AF_BLUETOOTH", AF_BLUETOOTH},
     181             :       {"AF_RXRPC", AF_RXRPC},
     182             :       {"AF_BRIDGE", AF_BRIDGE},
     183             :       {(char*)0},
     184             :       {"AF_CAN", AF_CAN},
     185             :       {"AF_TIPC", AF_TIPC},
     186             :       {"AF_ROUTE", AF_ROUTE},
     187             :       {"AF_NETROM", AF_NETROM},
     188             :       {(char*)0},
     189             :       {"AF_X25", AF_X25},
     190             :       {"AF_ROSE", AF_ROSE},
     191             :       {(char*)0}, {(char*)0}, {(char*)0},
     192             :       {"AF_NFC", AF_NFC},
     193             :       {"AF_FILE", AF_FILE},
     194             :       {(char*)0},
     195             :       {"AF_ECONET", AF_ECONET},
     196             :       {(char*)0}, {(char*)0},
     197             :       {"AF_IUCV", AF_IUCV},
     198             :       {(char*)0},
     199             :       {"AF_PACKET", AF_PACKET},
     200             :       {(char*)0},
     201             :       {"AF_KEY", AF_KEY},
     202             :       {"AF_AX25", AF_AX25},
     203             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     204             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     205             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     206             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     207             :       {(char*)0}, {(char*)0}, {(char*)0},
     208             :       {"AF_CAIF", AF_CAIF},
     209             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     210             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     211             :       {(char*)0}, {(char*)0},
     212             :       {"AF_VSOCK", AF_VSOCK}
     213             :     };
     214             : 
     215           0 :   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
     216             :     {
     217           0 :       register int key = hash_af_name (str, len);
     218             : 
     219           0 :       if (key <= MAX_HASH_VALUE && key >= 0)
     220             :         {
     221           0 :           register const char *s = wordlist[key].name;
     222             : 
     223           0 :           if (s && (((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strcmp (str, s))
     224           0 :             return &wordlist[key];
     225             :         }
     226             :     }
     227           0 :   return 0;
     228             : }

Generated by: LCOV version 1.11