LCOV - code coverage report
Current view: top level - journal - journald-gperf.c (source / functions) Hit Total Coverage
Test: systemd test coverage Lines: 0 15 0.0 %
Date: 2015-07-29 18:47:03 Functions: 0 2 0.0 %

          Line data    Source code
       1             : /* ANSI-C code produced by gperf version 3.0.4 */
       2             : /* Command-line: gperf  */
       3             : /* Computed positions: -k'9,18' */
       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             : 
      33             : #include <stddef.h>
      34             : #include <sys/socket.h>
      35             : #include "conf-parser.h"
      36             : #include "journald-server.h"
      37             : #include <string.h>
      38             : 
      39             : #define TOTAL_KEYWORDS 25
      40             : #define MIN_WORD_LENGTH 12
      41             : #define MAX_WORD_LENGTH 26
      42             : #define MIN_HASH_VALUE 12
      43             : #define MAX_HASH_VALUE 45
      44             : /* maximum key range = 34, duplicates = 0 */
      45             : 
      46             : #ifdef __GNUC__
      47             : __inline
      48             : #else
      49             : #ifdef __cplusplus
      50             : inline
      51             : #endif
      52             : #endif
      53             : static unsigned int
      54           0 : journald_gperf_hash (register const char *str, register unsigned int len)
      55             : {
      56             :   static const unsigned char asso_values[] =
      57             :     {
      58             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      59             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      60             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      61             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      62             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      63             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      64             :       46, 46, 46, 46, 46, 46, 10,  0, 46, 46,
      65             :        0, 46, 46, 20, 46, 20, 46,  0, 46, 46,
      66             :       46, 46,  0,  0, 25, 15, 46, 15, 46, 46,
      67             :       46, 46, 46, 46, 46, 46, 46, 10, 46,  0,
      68             :       46, 20, 46, 46, 46, 15, 46, 46, 46, 46,
      69             :       46, 10,  5, 46, 46, 46, 10, 46,  5, 46,
      70             :        0,  0, 46, 46, 46, 46, 46, 46, 46, 46,
      71             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      72             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      73             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      74             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      75             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      76             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      77             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      78             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      79             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      80             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      81             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      82             :       46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
      83             :       46, 46, 46, 46, 46, 46
      84             :     };
      85           0 :   register int hval = len;
      86             : 
      87           0 :   switch (hval)
      88             :     {
      89             :       default:
      90           0 :         hval += asso_values[(unsigned char)str[17]];
      91             :       /*FALLTHROUGH*/
      92             :       case 17:
      93             :       case 16:
      94             :       case 15:
      95             :       case 14:
      96             :       case 13:
      97             :       case 12:
      98             :       case 11:
      99             :       case 10:
     100             :       case 9:
     101           0 :         hval += asso_values[(unsigned char)str[8]];
     102           0 :         break;
     103             :     }
     104           0 :   return hval;
     105             : }
     106             : 
     107             : #ifdef __GNUC__
     108             : __inline
     109             : #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
     110             : __attribute__ ((__gnu_inline__))
     111             : #endif
     112             : #endif
     113             : const struct ConfigPerfItem *
     114           0 : journald_gperf_lookup (register const char *str, register unsigned int len)
     115             : {
     116             :   static const struct ConfigPerfItem wordlist[] =
     117             :     {
     118             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     119             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     120             :       {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
     121             :       {"Journal.Seal",               config_parse_bool,       0, offsetof(Server, seal)},
     122             :       {(char*)0}, {(char*)0},
     123             :       {"Journal.Storage",            config_parse_storage,    0, offsetof(Server, storage)},
     124             :       {"Journal.Compress",           config_parse_bool,       0, offsetof(Server, compress)},
     125             :       {"Journal.SplitMode",          config_parse_split_mode, 0, offsetof(Server, split_mode)},
     126             :       {"Journal.MaxFileSec",         config_parse_sec,        0, offsetof(Server, max_file_usec)},
     127             :       {(char*)0},
     128             :       {"Journal.MaxLevelKMsg",       config_parse_log_level,  0, offsetof(Server, max_level_kmsg)},
     129             :       {"Journal.RuntimeMaxUse",      config_parse_iec_off,    0, offsetof(Server, runtime_metrics.max_use)},
     130             :       {"Journal.MaxLevelSyslog",     config_parse_log_level,  0, offsetof(Server, max_level_syslog)},
     131             :       {"Journal.ForwardToSyslog",    config_parse_bool,       0, offsetof(Server, forward_to_syslog)},
     132             :       {"Journal.ForwardToConsole",   config_parse_bool,       0, offsetof(Server, forward_to_console)},
     133             :       {"Journal.SystemMaxFileSize",  config_parse_iec_off,    0, offsetof(Server, system_metrics.max_size)},
     134             :       {"Journal.RuntimeMaxFileSize", config_parse_iec_off,    0, offsetof(Server, runtime_metrics.max_size)},
     135             :       {"Journal.SystemKeepFree",     config_parse_iec_off,    0, offsetof(Server, system_metrics.keep_free)},
     136             :       {"Journal.SyncIntervalSec",    config_parse_sec,        0, offsetof(Server, sync_interval_usec)},
     137             :       {(char*)0},
     138             :       {"Journal.MaxLevelWall",       config_parse_log_level,  0, offsetof(Server, max_level_wall)},
     139             :       {"Journal.MaxLevelStore",      config_parse_log_level,  0, offsetof(Server, max_level_store)},
     140             :       {"Journal.RateLimitBurst",     config_parse_unsigned,   0, offsetof(Server, rate_limit_burst)},
     141             :       {"Journal.MaxLevelConsole",    config_parse_log_level,  0, offsetof(Server, max_level_console)},
     142             :       {(char*)0},
     143             :       {"Journal.SystemMaxUse",       config_parse_iec_off,    0, offsetof(Server, system_metrics.max_use)},
     144             :       {"Journal.ForwardToWall",      config_parse_bool,       0, offsetof(Server, forward_to_wall)},
     145             :       {(char*)0},
     146             :       {"Journal.MaxRetentionSec",    config_parse_sec,        0, offsetof(Server, max_retention_usec)},
     147             :       {(char*)0},
     148             :       {"Journal.TTYPath",            config_parse_path,       0, offsetof(Server, tty_path)},
     149             :       {"Journal.ForwardToKMsg",      config_parse_bool,       0, offsetof(Server, forward_to_kmsg)},
     150             :       {(char*)0},
     151             :       {"Journal.RuntimeKeepFree",    config_parse_iec_off,    0, offsetof(Server, runtime_metrics.keep_free)},
     152             :       {(char*)0},
     153             :       {"Journal.RateLimitInterval",  config_parse_sec,        0, offsetof(Server, rate_limit_interval)}
     154             :     };
     155             : 
     156           0 :   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
     157             :     {
     158           0 :       register int key = journald_gperf_hash (str, len);
     159             : 
     160           0 :       if (key <= MAX_HASH_VALUE && key >= 0)
     161             :         {
     162           0 :           register const char *s = wordlist[key].section_and_lvalue;
     163             : 
     164           0 :           if (s && *str == *s && !strcmp (str + 1, s + 1))
     165           0 :             return &wordlist[key];
     166             :         }
     167             :     }
     168           0 :   return 0;
     169             : }

Generated by: LCOV version 1.11