Coverage Report

Created: 2026-09-06 07:18

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libe-book/src/lib/EPubToken.inc
Line
Count
Source
1
/* C++ code produced by gperf version 3.1 */
2
/* Command-line: /usr/bin/gperf --compare-strncmp --enum --null-strings --readonly-tables --language C++ EPubToken.gperf  */
3
/* Computed positions: -k'1' */
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 "EPubToken.gperf"
33
34
#include "EPubToken.h"
35
36
#if defined __GNUC__
37
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
38
#endif
39
40
using namespace EPubToken;
41
#line 12 "EPubToken.gperf"
42
struct Token
43
{
44
  const char *name;
45
  int id;
46
};
47
#include <string.h>
48
/* maximum key range = 45, duplicates = 0 */
49
50
class Perfect_Hash
51
{
52
private:
53
  static inline unsigned int hash (const char *str, size_t len);
54
public:
55
  static const struct Token *in_word_set (const char *str, size_t len);
56
};
57
58
inline unsigned int
59
Perfect_Hash::hash (const char *str, size_t len)
60
0
{
61
0
  static const unsigned char asso_values[] =
62
0
    {
63
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
64
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
65
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
66
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
67
0
      48, 48, 48, 48, 48, 48, 48, 48, 48,  0,
68
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
69
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
70
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
71
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
72
0
      48, 48, 48, 48, 48, 48, 48,  0, 48, 10,
73
0
      48, 15,  5, 48, 48, 48, 48, 48, 48,  5,
74
0
      48, 48, 48, 48,  0,  0, 48,  0,  0, 48,
75
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
76
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
77
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
78
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
79
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
80
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
81
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
82
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
83
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
84
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
85
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
86
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
87
0
      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
88
0
      48, 48, 48, 48, 48, 48
89
0
    };
90
0
  return len + asso_values[static_cast<unsigned char>(str[0])];
91
0
}
92
93
const struct Token *
94
Perfect_Hash::in_word_set (const char *str, size_t len)
95
0
{
96
0
  enum
97
0
    {
98
0
      TOTAL_KEYWORDS = 12,
99
0
      MIN_WORD_LENGTH = 3,
100
0
      MAX_WORD_LENGTH = 47,
101
0
      MIN_HASH_VALUE = 3,
102
0
      MAX_HASH_VALUE = 47
103
0
    };
104
105
0
  static const struct Token wordlist[] =
106
0
    {
107
0
      {(char*)0}, {(char*)0}, {(char*)0},
108
0
#line 18 "EPubToken.gperf"
109
0
      {"1.0",_1_0},
110
0
      {(char*)0}, {(char*)0}, {(char*)0},
111
0
#line 29 "EPubToken.gperf"
112
0
      {"version",version},
113
0
#line 25 "EPubToken.gperf"
114
0
      {"rootfile",rootfile},
115
0
#line 26 "EPubToken.gperf"
116
0
      {"rootfiles",rootfiles},
117
0
#line 27 "EPubToken.gperf"
118
0
      {"signatures",signatures},
119
0
      {(char*)0}, {(char*)0}, {(char*)0},
120
0
#line 23 "EPubToken.gperf"
121
0
      {"full-path",full_path},
122
0
#line 24 "EPubToken.gperf"
123
0
      {"media-type",media_type},
124
0
      {(char*)0}, {(char*)0}, {(char*)0},
125
0
#line 21 "EPubToken.gperf"
126
0
      {"container",container},
127
0
#line 19 "EPubToken.gperf"
128
0
      {"application/epub+zip",MIME_epub},
129
0
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
130
0
#line 22 "EPubToken.gperf"
131
0
      {"encryption",encryption},
132
0
      {(char*)0}, {(char*)0}, {(char*)0},
133
0
#line 20 "EPubToken.gperf"
134
0
      {"application/oebps-package+xml",MIME_opf},
135
0
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
136
0
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
137
0
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
138
0
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
139
0
      {(char*)0},
140
0
#line 28 "EPubToken.gperf"
141
0
      {"urn:oasis:names:tc:opendocument:xmlns:container",NS_container}
142
0
    };
143
144
0
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
145
0
    {
146
0
      unsigned int key = hash (str, len);
147
148
0
      if (key <= MAX_HASH_VALUE)
149
0
        {
150
0
          const char *s = wordlist[key].name;
151
152
0
          if (s && *str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
153
0
            return &wordlist[key];
154
0
        }
155
0
    }
156
0
  return 0;
157
0
}
158
#line 30 "EPubToken.gperf"
159