/work/build/src/resolve/resolved-dnssd-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/resolve/resolved-dnssd-gperf.c ../../src/systemd/src/resolve/resolved-dnssd-gperf.gperf */ |
3 | | /* Computed positions: -k'9,12' */ |
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/resolve/resolved-dnssd-gperf.gperf" |
33 | | |
34 | | #if __GNUC__ >= 15 |
35 | | _Pragma("GCC diagnostic ignored \"-Wzero-as-null-pointer-constant\"") |
36 | | #endif |
37 | | #include <stddef.h> |
38 | | #include "conf-parser.h" |
39 | | #include "resolved-dnssd.h" |
40 | | #include <string.h> |
41 | | |
42 | | #define TOTAL_KEYWORDS 8 |
43 | 0 | #define MIN_WORD_LENGTH 12 |
44 | 0 | #define MAX_WORD_LENGTH 16 |
45 | | #define MIN_HASH_VALUE 12 |
46 | 0 | #define MAX_HASH_VALUE 25 |
47 | | /* maximum key range = 14, duplicates = 0 */ |
48 | | |
49 | | #ifdef __GNUC__ |
50 | | __inline |
51 | | #else |
52 | | #ifdef __cplusplus |
53 | | inline |
54 | | #endif |
55 | | #endif |
56 | | static unsigned int |
57 | | resolved_dnssd_gperf_hash (register const char *str, register size_t len) |
58 | 0 | { |
59 | 0 | static const unsigned char asso_values[] = |
60 | 0 | { |
61 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
62 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
63 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
64 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
65 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
66 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
67 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 10, 26, |
68 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 5, 26, |
69 | 0 | 0, 26, 26, 5, 0, 26, 26, 0, 26, 26, |
70 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
71 | 0 | 26, 5, 26, 0, 26, 26, 26, 26, 26, 26, |
72 | 0 | 26, 0, 26, 26, 26, 26, 0, 26, 26, 26, |
73 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
74 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
75 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
76 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
77 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
78 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
79 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
80 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
81 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
82 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
83 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
84 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
85 | 0 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, |
86 | 0 | 26, 26, 26, 26, 26, 26 |
87 | 0 | }; |
88 | 0 | return len + asso_values[(unsigned char)str[11]] + asso_values[(unsigned char)str[8]]; |
89 | 0 | } |
90 | | |
91 | | const struct ConfigPerfItem * |
92 | | resolved_dnssd_gperf_lookup (register const char *str, register size_t len) |
93 | 0 | { |
94 | 0 | static const struct ConfigPerfItem wordlist[] = |
95 | 0 | { |
96 | 0 | {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0}, |
97 | 0 | {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0}, |
98 | 0 | {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0}, |
99 | 0 | #line 24 "../../src/systemd/src/resolve/resolved-dnssd-gperf.gperf" |
100 | 0 | {"Service.Port", config_parse_ip_port, 0, offsetof(DnssdService, port)}, |
101 | 0 | {(char*)0}, |
102 | 0 | #line 26 "../../src/systemd/src/resolve/resolved-dnssd-gperf.gperf" |
103 | 0 | {"Service.Weight", config_parse_uint16, 0, offsetof(DnssdService, weight)}, |
104 | 0 | #line 27 "../../src/systemd/src/resolve/resolved-dnssd-gperf.gperf" |
105 | 0 | {"Service.TxtText", config_parse_dnssd_txt, DNS_TXT_ITEM_TEXT, 0}, |
106 | 0 | #line 25 "../../src/systemd/src/resolve/resolved-dnssd-gperf.gperf" |
107 | 0 | {"Service.Priority", config_parse_uint16, 0, offsetof(DnssdService, priority)}, |
108 | 0 | #line 22 "../../src/systemd/src/resolve/resolved-dnssd-gperf.gperf" |
109 | 0 | {"Service.Type", config_parse_dnssd_service_type, 0, 0}, |
110 | 0 | {(char*)0}, {(char*)0}, |
111 | 0 | #line 23 "../../src/systemd/src/resolve/resolved-dnssd-gperf.gperf" |
112 | 0 | {"Service.SubType", config_parse_dnssd_service_subtype, 0, 0}, |
113 | 0 | {(char*)0}, |
114 | 0 | #line 21 "../../src/systemd/src/resolve/resolved-dnssd-gperf.gperf" |
115 | 0 | {"Service.Name", config_parse_dnssd_service_name, 0, 0}, |
116 | 0 | {(char*)0}, {(char*)0}, |
117 | 0 | #line 28 "../../src/systemd/src/resolve/resolved-dnssd-gperf.gperf" |
118 | 0 | {"Service.TxtData", config_parse_dnssd_txt, DNS_TXT_ITEM_DATA, 0} |
119 | 0 | }; |
120 | |
|
121 | 0 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
122 | 0 | { |
123 | 0 | register unsigned int key = resolved_dnssd_gperf_hash (str, len); |
124 | |
|
125 | 0 | if (key <= MAX_HASH_VALUE) |
126 | 0 | { |
127 | 0 | register const char *s = wordlist[key].section_and_lvalue; |
128 | |
|
129 | 0 | if (s && *str == *s && !strcmp (str + 1, s + 1)) |
130 | 0 | return &wordlist[key]; |
131 | 0 | } |
132 | 0 | } |
133 | 0 | return 0; |
134 | 0 | } |