Coverage Report

Created: 2025-06-13 06:25

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