Coverage Report

Created: 2019-06-19 13:33

/work/build/src/journal/journald-gperf.c
Line
Count
Source (jump to first uncovered line)
1
/* ANSI-C code produced by gperf version 3.0.4 */
2
/* Command-line: /usr/bin/gperf --output-file src/journal/journald-gperf.c ../../src/systemd/src/journal/journald-gperf.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
#line 1 "../../src/systemd/src/journal/journald-gperf.gperf"
33
34
#if __GNUC__ >= 7
35
_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
36
#endif
37
#include <stddef.h>
38
#include <sys/socket.h>
39
#include "conf-parser.h"
40
#include "journald-server.h"
41
#include <string.h>
42
43
#define TOTAL_KEYWORDS 30
44
0
#define MIN_WORD_LENGTH 12
45
0
#define MAX_WORD_LENGTH 28
46
#define MIN_HASH_VALUE 12
47
0
#define MAX_HASH_VALUE 53
48
/* maximum key range = 42, duplicates = 0 */
49
50
#ifdef __GNUC__
51
__inline
52
#else
53
#ifdef __cplusplus
54
inline
55
#endif
56
#endif
57
static unsigned int
58
journald_gperf_hash (register const char *str, register unsigned int len)
59
0
{
60
0
  static const unsigned char asso_values[] =
61
0
    {
62
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
63
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
64
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
65
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
66
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
67
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
68
0
      54, 54, 54, 54, 54, 54, 15,  5, 54, 54,
69
0
       0, 54, 54,  5, 54, 30, 31,  0, 54, 54,
70
0
      54, 54,  0,  0, 30, 20, 54, 20, 54, 54,
71
0
      54, 54, 54, 54, 54, 54, 54, 15, 54,  0,
72
0
      54, 30, 54, 54, 54, 25, 54, 54, 54, 54,
73
0
      54, 20, 10, 54, 54, 54, 15, 54, 15, 54,
74
0
       5,  5, 54, 54, 54, 54, 54, 54, 54, 54,
75
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
76
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
77
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
78
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
79
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
80
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
81
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
82
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
83
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
84
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
85
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
86
0
      54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
87
0
      54, 54, 54, 54, 54, 54
88
0
    };
89
0
  register int hval = len;
90
0
91
0
  switch (hval)
92
0
    {
93
0
      default:
94
0
        hval += asso_values[(unsigned char)str[17]];
95
0
      /*FALLTHROUGH*/
96
0
      case 17:
97
0
      case 16:
98
0
      case 15:
99
0
      case 14:
100
0
      case 13:
101
0
      case 12:
102
0
      case 11:
103
0
      case 10:
104
0
      case 9:
105
0
        hval += asso_values[(unsigned char)str[8]];
106
0
        break;
107
0
    }
108
0
  return hval;
109
0
}
110
111
#ifdef __GNUC__
112
__inline
113
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
114
__attribute__ ((__gnu_inline__))
115
#endif
116
#endif
117
const struct ConfigPerfItem *
118
journald_gperf_lookup (register const char *str, register unsigned int len)
119
0
{
120
0
  static const struct ConfigPerfItem wordlist[] =
121
0
    {
122
0
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
123
0
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
124
0
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
125
0
#line 23 "../../src/systemd/src/journal/journald-gperf.gperf"
126
0
      {"Journal.Seal",               config_parse_bool,       0, offsetof(Server, seal)},
127
0
      {(char*)0}, {(char*)0},
128
0
#line 21 "../../src/systemd/src/journal/journald-gperf.gperf"
129
0
      {"Journal.Storage",            config_parse_storage,    0, offsetof(Server, storage)},
130
0
#line 24 "../../src/systemd/src/journal/journald-gperf.gperf"
131
0
      {"Journal.ReadKMsg",           config_parse_bool,       0, offsetof(Server, read_kmsg)},
132
0
#line 50 "../../src/systemd/src/journal/journald-gperf.gperf"
133
0
      {"Journal.SplitMode",          config_parse_split_mode, 0, offsetof(Server, split_mode)},
134
0
#line 39 "../../src/systemd/src/journal/journald-gperf.gperf"
135
0
      {"Journal.MaxFileSec",         config_parse_sec,        0, offsetof(Server, max_file_usec)},
136
0
      {(char*)0},
137
0
#line 47 "../../src/systemd/src/journal/journald-gperf.gperf"
138
0
      {"Journal.MaxLevelKMsg",       config_parse_log_level,  0, offsetof(Server, max_level_kmsg)},
139
0
#line 22 "../../src/systemd/src/journal/journald-gperf.gperf"
140
0
      {"Journal.Compress",           config_parse_compress,   0, offsetof(Server, compress)},
141
0
#line 33 "../../src/systemd/src/journal/journald-gperf.gperf"
142
0
      {"Journal.SystemMaxFiles",     config_parse_uint64,     0, offsetof(Server, system_storage.metrics.n_max_files)},
143
0
#line 40 "../../src/systemd/src/journal/journald-gperf.gperf"
144
0
      {"Journal.ForwardToSyslog",    config_parse_bool,       0, offsetof(Server, forward_to_syslog)},
145
0
      {(char*)0},
146
0
#line 31 "../../src/systemd/src/journal/journald-gperf.gperf"
147
0
      {"Journal.SystemMaxFileSize",  config_parse_iec_uint64, 0, offsetof(Server, system_storage.metrics.max_size)},
148
0
#line 34 "../../src/systemd/src/journal/journald-gperf.gperf"
149
0
      {"Journal.RuntimeMaxUse",      config_parse_iec_uint64, 0, offsetof(Server, runtime_storage.metrics.max_use)},
150
0
#line 46 "../../src/systemd/src/journal/journald-gperf.gperf"
151
0
      {"Journal.MaxLevelSyslog",     config_parse_log_level,  0, offsetof(Server, max_level_syslog)},
152
0
#line 37 "../../src/systemd/src/journal/journald-gperf.gperf"
153
0
      {"Journal.RuntimeMaxFiles",    config_parse_uint64,     0, offsetof(Server, runtime_storage.metrics.n_max_files)},
154
0
#line 42 "../../src/systemd/src/journal/journald-gperf.gperf"
155
0
      {"Journal.ForwardToConsole",   config_parse_bool,       0, offsetof(Server, forward_to_console)},
156
0
#line 27 "../../src/systemd/src/journal/journald-gperf.gperf"
157
0
      {"Journal.RateLimitInterval",  config_parse_sec,        0, offsetof(Server, rate_limit_interval)},
158
0
#line 35 "../../src/systemd/src/journal/journald-gperf.gperf"
159
0
      {"Journal.RuntimeMaxFileSize", config_parse_iec_uint64, 0, offsetof(Server, runtime_storage.metrics.max_size)},
160
0
#line 32 "../../src/systemd/src/journal/journald-gperf.gperf"
161
0
      {"Journal.SystemKeepFree",     config_parse_iec_uint64, 0, offsetof(Server, system_storage.metrics.keep_free)},
162
0
#line 28 "../../src/systemd/src/journal/journald-gperf.gperf"
163
0
      {"Journal.RateLimitIntervalSec",config_parse_sec,       0, offsetof(Server, rate_limit_interval)},
164
0
      {(char*)0},
165
0
#line 49 "../../src/systemd/src/journal/journald-gperf.gperf"
166
0
      {"Journal.MaxLevelWall",       config_parse_log_level,  0, offsetof(Server, max_level_wall)},
167
0
#line 45 "../../src/systemd/src/journal/journald-gperf.gperf"
168
0
      {"Journal.MaxLevelStore",      config_parse_log_level,  0, offsetof(Server, max_level_store)},
169
0
#line 29 "../../src/systemd/src/journal/journald-gperf.gperf"
170
0
      {"Journal.RateLimitBurst",     config_parse_unsigned,   0, offsetof(Server, rate_limit_burst)},
171
0
#line 25 "../../src/systemd/src/journal/journald-gperf.gperf"
172
0
      {"Journal.SyncIntervalSec",    config_parse_sec,        0, offsetof(Server, sync_interval_usec)},
173
0
      {(char*)0},
174
0
#line 30 "../../src/systemd/src/journal/journald-gperf.gperf"
175
0
      {"Journal.SystemMaxUse",       config_parse_iec_uint64, 0, offsetof(Server, system_storage.metrics.max_use)},
176
0
#line 43 "../../src/systemd/src/journal/journald-gperf.gperf"
177
0
      {"Journal.ForwardToWall",      config_parse_bool,       0, offsetof(Server, forward_to_wall)},
178
0
      {(char*)0},
179
0
#line 48 "../../src/systemd/src/journal/journald-gperf.gperf"
180
0
      {"Journal.MaxLevelConsole",    config_parse_log_level,  0, offsetof(Server, max_level_console)},
181
0
      {(char*)0},
182
0
#line 44 "../../src/systemd/src/journal/journald-gperf.gperf"
183
0
      {"Journal.TTYPath",            config_parse_path,       0, offsetof(Server, tty_path)},
184
0
#line 51 "../../src/systemd/src/journal/journald-gperf.gperf"
185
0
      {"Journal.LineMax",            config_parse_line_max,   0, offsetof(Server, line_max)},
186
0
      {(char*)0},
187
0
#line 38 "../../src/systemd/src/journal/journald-gperf.gperf"
188
0
      {"Journal.MaxRetentionSec",    config_parse_sec,        0, offsetof(Server, max_retention_usec)},
189
0
      {(char*)0}, {(char*)0},
190
0
#line 41 "../../src/systemd/src/journal/journald-gperf.gperf"
191
0
      {"Journal.ForwardToKMsg",      config_parse_bool,       0, offsetof(Server, forward_to_kmsg)},
192
0
      {(char*)0},
193
0
#line 36 "../../src/systemd/src/journal/journald-gperf.gperf"
194
0
      {"Journal.RuntimeKeepFree",    config_parse_iec_uint64, 0, offsetof(Server, runtime_storage.metrics.keep_free)}
195
0
    };
196
0
197
0
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
198
0
    {
199
0
      register int key = journald_gperf_hash (str, len);
200
0
201
0
      if (key <= MAX_HASH_VALUE && key >= 0)
202
0
        {
203
0
          register const char *s = wordlist[key].section_and_lvalue;
204
0
205
0
          if (s && *str == *s && !strcmp (str + 1, s + 1))
206
0
            return &wordlist[key];
207
0
        }
208
0
    }
209
0
  return 0;
210
0
}