hamlit 1.7.2 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (283) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -3
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +25 -37
  5. data/CHANGELOG.md +18 -0
  6. data/Gemfile +16 -0
  7. data/LICENSE.txt +23 -2
  8. data/README.md +106 -48
  9. data/REFERENCE.md +222 -0
  10. data/Rakefile +77 -19
  11. data/benchmark/boolean_attribute.haml +6 -0
  12. data/benchmark/class_attribute.haml +5 -0
  13. data/benchmark/common_attribute.haml +3 -0
  14. data/benchmark/data_attribute.haml +4 -0
  15. data/benchmark/dynamic_attributes/boolean_attribute.haml +4 -0
  16. data/benchmark/dynamic_attributes/class_attribute.haml +4 -0
  17. data/benchmark/dynamic_attributes/common_attribute.haml +2 -0
  18. data/benchmark/dynamic_attributes/data_attribute.haml +2 -0
  19. data/benchmark/dynamic_attributes/id_attribute.haml +2 -0
  20. data/benchmark/etc/attribute_builder.haml +5 -0
  21. data/benchmark/etc/real_sample.haml +888 -0
  22. data/benchmark/etc/real_sample.rb +11 -0
  23. data/benchmark/etc/static_analyzer.haml +1 -0
  24. data/benchmark/etc/tags.haml +3 -0
  25. data/benchmark/ext/build_data.rb +15 -0
  26. data/benchmark/ext/build_id.rb +13 -0
  27. data/benchmark/id_attribute.haml +3 -0
  28. data/benchmark/plain.haml +4 -0
  29. data/benchmark/script.haml +4 -0
  30. data/benchmark/slim/LICENSE +21 -0
  31. data/{benchmarks → benchmark/slim}/context.rb +2 -4
  32. data/benchmark/slim/run-benchmarks.rb +94 -0
  33. data/{benchmarks → benchmark/slim}/view.erb +3 -3
  34. data/{benchmarks → benchmark/slim}/view.haml +0 -0
  35. data/{benchmarks/view.escaped.slim → benchmark/slim/view.slim} +1 -1
  36. data/benchmark/string_interpolation.haml +2 -0
  37. data/benchmark/utils/benchmark_ips_extension.rb +43 -0
  38. data/bin/bench +85 -0
  39. data/bin/clone +14 -0
  40. data/bin/console +11 -0
  41. data/bin/lineprof +48 -0
  42. data/bin/ruby +3 -0
  43. data/bin/setup +7 -0
  44. data/bin/stackprof +27 -0
  45. data/{test → bin/test} +6 -10
  46. data/{bin → exe}/hamlit +0 -0
  47. data/ext/hamlit/extconf.rb +14 -0
  48. data/ext/hamlit/hamlit.c +512 -0
  49. data/ext/hamlit/houdini/.gitignore +3 -0
  50. data/ext/hamlit/houdini/COPYING +7 -0
  51. data/ext/hamlit/houdini/Makefile +79 -0
  52. data/ext/hamlit/houdini/README.md +59 -0
  53. data/ext/hamlit/houdini/buffer.c +249 -0
  54. data/ext/hamlit/houdini/buffer.h +113 -0
  55. data/ext/hamlit/houdini/houdini.h +46 -0
  56. data/ext/hamlit/houdini/houdini_href_e.c +115 -0
  57. data/ext/hamlit/houdini/houdini_html_e.c +90 -0
  58. data/ext/hamlit/houdini/houdini_html_u.c +122 -0
  59. data/ext/hamlit/houdini/houdini_js_e.c +90 -0
  60. data/ext/hamlit/houdini/houdini_js_u.c +60 -0
  61. data/ext/hamlit/houdini/houdini_uri_e.c +107 -0
  62. data/ext/hamlit/houdini/houdini_uri_u.c +68 -0
  63. data/ext/hamlit/houdini/houdini_xml_e.c +136 -0
  64. data/ext/hamlit/houdini/html_unescape.gperf +258 -0
  65. data/ext/hamlit/houdini/html_unescape.h +754 -0
  66. data/ext/hamlit/houdini/tools/build_table.py +13 -0
  67. data/ext/hamlit/houdini/tools/build_tables.c +51 -0
  68. data/ext/hamlit/houdini/tools/wikipedia_table.txt +2025 -0
  69. data/hamlit.gemspec +30 -31
  70. data/lib/hamlit.rb +3 -1
  71. data/lib/hamlit/attribute_builder.rb +12 -0
  72. data/lib/hamlit/cli.rb +44 -43
  73. data/lib/hamlit/compiler.rb +92 -16
  74. data/lib/hamlit/compiler/attribute_compiler.rb +148 -0
  75. data/lib/hamlit/compiler/children_compiler.rb +111 -0
  76. data/lib/hamlit/compiler/comment_compiler.rb +36 -0
  77. data/lib/hamlit/compiler/doctype_compiler.rb +45 -0
  78. data/lib/hamlit/compiler/script_compiler.rb +97 -0
  79. data/lib/hamlit/compiler/silent_script_compiler.rb +24 -0
  80. data/lib/hamlit/compiler/tag_compiler.rb +69 -0
  81. data/lib/hamlit/engine.rb +12 -7
  82. data/lib/hamlit/error.rb +14 -0
  83. data/lib/hamlit/escapable.rb +12 -0
  84. data/lib/hamlit/filters.rb +65 -0
  85. data/lib/hamlit/filters/base.rb +4 -62
  86. data/lib/hamlit/filters/coffee.rb +9 -7
  87. data/lib/hamlit/filters/css.rb +25 -8
  88. data/lib/hamlit/filters/erb.rb +4 -6
  89. data/lib/hamlit/filters/escaped.rb +11 -9
  90. data/lib/hamlit/filters/javascript.rb +25 -8
  91. data/lib/hamlit/filters/less.rb +9 -7
  92. data/lib/hamlit/filters/markdown.rb +5 -6
  93. data/lib/hamlit/filters/plain.rb +11 -15
  94. data/lib/hamlit/filters/preserve.rb +15 -5
  95. data/lib/hamlit/filters/ruby.rb +3 -5
  96. data/lib/hamlit/filters/sass.rb +9 -7
  97. data/lib/hamlit/filters/scss.rb +9 -7
  98. data/lib/hamlit/filters/text_base.rb +24 -0
  99. data/lib/hamlit/filters/tilt_base.rb +47 -0
  100. data/lib/hamlit/hash_parser.rb +107 -0
  101. data/lib/hamlit/html.rb +9 -6
  102. data/lib/hamlit/identity.rb +12 -0
  103. data/lib/hamlit/object_ref.rb +29 -0
  104. data/lib/hamlit/parser.rb +25 -142
  105. data/lib/hamlit/parser/MIT-LICENSE +20 -0
  106. data/lib/hamlit/parser/README.md +28 -0
  107. data/lib/hamlit/parser/haml_buffer.rb +348 -0
  108. data/lib/hamlit/parser/haml_compiler.rb +553 -0
  109. data/lib/hamlit/parser/haml_error.rb +61 -0
  110. data/lib/hamlit/parser/haml_helpers.rb +727 -0
  111. data/lib/hamlit/parser/haml_options.rb +286 -0
  112. data/lib/hamlit/parser/haml_parser.rb +801 -0
  113. data/lib/hamlit/parser/haml_util.rb +283 -0
  114. data/lib/hamlit/parser/haml_xss_mods.rb +109 -0
  115. data/lib/hamlit/{helpers.rb → rails_helpers.rb} +2 -7
  116. data/lib/hamlit/rails_template.rb +30 -0
  117. data/lib/hamlit/railtie.rb +1 -12
  118. data/lib/hamlit/ruby_expression.rb +31 -0
  119. data/lib/hamlit/static_analyzer.rb +49 -0
  120. data/lib/hamlit/string_interpolation.rb +69 -0
  121. data/lib/hamlit/template.rb +8 -0
  122. data/lib/hamlit/utils.rb +9 -0
  123. data/lib/hamlit/version.rb +1 -1
  124. metadata +116 -324
  125. data/.rspec +0 -2
  126. data/benchmarks/benchmark.rb +0 -110
  127. data/benchmarks/view.slim +0 -17
  128. data/doc/README.md +0 -19
  129. data/doc/engine/indent.md +0 -48
  130. data/doc/engine/new_attribute.md +0 -77
  131. data/doc/engine/old_attributes.md +0 -198
  132. data/doc/engine/silent_script.md +0 -97
  133. data/doc/engine/tag.md +0 -48
  134. data/doc/engine/text.md +0 -64
  135. data/doc/faml/README.md +0 -16
  136. data/doc/faml/engine/indent.md +0 -48
  137. data/doc/faml/engine/old_attributes.md +0 -111
  138. data/doc/faml/engine/silent_script.md +0 -97
  139. data/doc/faml/engine/text.md +0 -59
  140. data/doc/faml/filters/erb.md +0 -24
  141. data/doc/faml/filters/javascript.md +0 -27
  142. data/doc/faml/filters/less.md +0 -57
  143. data/doc/faml/filters/plain.md +0 -25
  144. data/doc/filters/erb.md +0 -31
  145. data/doc/filters/javascript.md +0 -83
  146. data/doc/filters/less.md +0 -57
  147. data/doc/filters/markdown.md +0 -31
  148. data/doc/filters/plain.md +0 -25
  149. data/doc/haml/README.md +0 -15
  150. data/doc/haml/engine/new_attribute.md +0 -77
  151. data/doc/haml/engine/old_attributes.md +0 -142
  152. data/doc/haml/engine/tag.md +0 -48
  153. data/doc/haml/engine/text.md +0 -29
  154. data/doc/haml/filters/erb.md +0 -26
  155. data/doc/haml/filters/javascript.md +0 -76
  156. data/doc/haml/filters/markdown.md +0 -31
  157. data/lib/hamlit/attribute.rb +0 -78
  158. data/lib/hamlit/compilers/attributes.rb +0 -108
  159. data/lib/hamlit/compilers/comment.rb +0 -13
  160. data/lib/hamlit/compilers/doctype.rb +0 -39
  161. data/lib/hamlit/compilers/filter.rb +0 -53
  162. data/lib/hamlit/compilers/new_attribute.rb +0 -115
  163. data/lib/hamlit/compilers/old_attribute.rb +0 -241
  164. data/lib/hamlit/compilers/runtime_attribute.rb +0 -58
  165. data/lib/hamlit/compilers/script.rb +0 -31
  166. data/lib/hamlit/compilers/strip.rb +0 -19
  167. data/lib/hamlit/compilers/text.rb +0 -111
  168. data/lib/hamlit/concerns/attribute_builder.rb +0 -22
  169. data/lib/hamlit/concerns/balanceable.rb +0 -68
  170. data/lib/hamlit/concerns/deprecation.rb +0 -20
  171. data/lib/hamlit/concerns/error.rb +0 -31
  172. data/lib/hamlit/concerns/escapable.rb +0 -17
  173. data/lib/hamlit/concerns/included.rb +0 -28
  174. data/lib/hamlit/concerns/indentable.rb +0 -117
  175. data/lib/hamlit/concerns/lexable.rb +0 -32
  176. data/lib/hamlit/concerns/line_reader.rb +0 -62
  177. data/lib/hamlit/concerns/registerable.rb +0 -24
  178. data/lib/hamlit/concerns/string_interpolation.rb +0 -48
  179. data/lib/hamlit/concerns/whitespace.rb +0 -91
  180. data/lib/hamlit/filters/tilt.rb +0 -41
  181. data/lib/hamlit/parsers/attribute.rb +0 -71
  182. data/lib/hamlit/parsers/comment.rb +0 -30
  183. data/lib/hamlit/parsers/doctype.rb +0 -18
  184. data/lib/hamlit/parsers/filter.rb +0 -18
  185. data/lib/hamlit/parsers/multiline.rb +0 -58
  186. data/lib/hamlit/parsers/script.rb +0 -126
  187. data/lib/hamlit/parsers/tag.rb +0 -83
  188. data/lib/hamlit/parsers/text.rb +0 -28
  189. data/lib/hamlit/temple.rb +0 -9
  190. data/release +0 -6
  191. data/spec/Rakefile +0 -72
  192. data/spec/hamlit/engine/comment_spec.rb +0 -56
  193. data/spec/hamlit/engine/doctype_spec.rb +0 -19
  194. data/spec/hamlit/engine/error_spec.rb +0 -135
  195. data/spec/hamlit/engine/indent_spec.rb +0 -42
  196. data/spec/hamlit/engine/multiline_spec.rb +0 -44
  197. data/spec/hamlit/engine/new_attribute_spec.rb +0 -110
  198. data/spec/hamlit/engine/old_attributes_spec.rb +0 -404
  199. data/spec/hamlit/engine/script_spec.rb +0 -116
  200. data/spec/hamlit/engine/silent_script_spec.rb +0 -213
  201. data/spec/hamlit/engine/tag_spec.rb +0 -295
  202. data/spec/hamlit/engine/text_spec.rb +0 -239
  203. data/spec/hamlit/engine_spec.rb +0 -58
  204. data/spec/hamlit/filters/coffee_spec.rb +0 -60
  205. data/spec/hamlit/filters/css_spec.rb +0 -33
  206. data/spec/hamlit/filters/erb_spec.rb +0 -16
  207. data/spec/hamlit/filters/javascript_spec.rb +0 -82
  208. data/spec/hamlit/filters/less_spec.rb +0 -37
  209. data/spec/hamlit/filters/markdown_spec.rb +0 -30
  210. data/spec/hamlit/filters/plain_spec.rb +0 -15
  211. data/spec/hamlit/filters/ruby_spec.rb +0 -24
  212. data/spec/hamlit/filters/sass_spec.rb +0 -33
  213. data/spec/hamlit/filters/scss_spec.rb +0 -37
  214. data/spec/hamlit/haml_spec.rb +0 -910
  215. data/spec/rails/.gitignore +0 -18
  216. data/spec/rails/.rspec +0 -2
  217. data/spec/rails/Gemfile +0 -19
  218. data/spec/rails/README.rdoc +0 -28
  219. data/spec/rails/Rakefile +0 -6
  220. data/spec/rails/app/assets/images/.keep +0 -0
  221. data/spec/rails/app/assets/javascripts/application.js +0 -15
  222. data/spec/rails/app/assets/stylesheets/application.css +0 -15
  223. data/spec/rails/app/controllers/application_controller.rb +0 -8
  224. data/spec/rails/app/controllers/concerns/.keep +0 -0
  225. data/spec/rails/app/controllers/users_controller.rb +0 -23
  226. data/spec/rails/app/helpers/application_helper.rb +0 -2
  227. data/spec/rails/app/mailers/.keep +0 -0
  228. data/spec/rails/app/models/.keep +0 -0
  229. data/spec/rails/app/models/concerns/.keep +0 -0
  230. data/spec/rails/app/views/application/index.html.haml +0 -18
  231. data/spec/rails/app/views/layouts/application.html.haml +0 -12
  232. data/spec/rails/app/views/users/capture.html.haml +0 -5
  233. data/spec/rails/app/views/users/capture_haml.html.haml +0 -5
  234. data/spec/rails/app/views/users/form.html.haml +0 -2
  235. data/spec/rails/app/views/users/helpers.html.haml +0 -10
  236. data/spec/rails/app/views/users/index.html.haml +0 -9
  237. data/spec/rails/app/views/users/inline.html.haml +0 -6
  238. data/spec/rails/app/views/users/old_attributes.html.haml +0 -5
  239. data/spec/rails/app/views/users/safe_buffer.html.haml +0 -4
  240. data/spec/rails/app/views/users/whitespace.html.haml +0 -4
  241. data/spec/rails/bin/bundle +0 -3
  242. data/spec/rails/bin/rails +0 -8
  243. data/spec/rails/bin/rake +0 -8
  244. data/spec/rails/bin/setup +0 -29
  245. data/spec/rails/bin/spring +0 -15
  246. data/spec/rails/config.ru +0 -4
  247. data/spec/rails/config/application.rb +0 -34
  248. data/spec/rails/config/boot.rb +0 -3
  249. data/spec/rails/config/database.yml +0 -25
  250. data/spec/rails/config/environment.rb +0 -5
  251. data/spec/rails/config/environments/development.rb +0 -41
  252. data/spec/rails/config/environments/production.rb +0 -79
  253. data/spec/rails/config/environments/test.rb +0 -42
  254. data/spec/rails/config/initializers/assets.rb +0 -11
  255. data/spec/rails/config/initializers/backtrace_silencers.rb +0 -7
  256. data/spec/rails/config/initializers/cookies_serializer.rb +0 -3
  257. data/spec/rails/config/initializers/filter_parameter_logging.rb +0 -4
  258. data/spec/rails/config/initializers/inflections.rb +0 -16
  259. data/spec/rails/config/initializers/mime_types.rb +0 -4
  260. data/spec/rails/config/initializers/session_store.rb +0 -3
  261. data/spec/rails/config/initializers/wrap_parameters.rb +0 -14
  262. data/spec/rails/config/locales/en.yml +0 -24
  263. data/spec/rails/config/routes.rb +0 -16
  264. data/spec/rails/config/secrets.yml +0 -22
  265. data/spec/rails/db/schema.rb +0 -16
  266. data/spec/rails/db/seeds.rb +0 -7
  267. data/spec/rails/lib/assets/.keep +0 -0
  268. data/spec/rails/lib/tasks/.keep +0 -0
  269. data/spec/rails/log/.keep +0 -0
  270. data/spec/rails/public/404.html +0 -67
  271. data/spec/rails/public/422.html +0 -67
  272. data/spec/rails/public/500.html +0 -66
  273. data/spec/rails/public/favicon.ico +0 -0
  274. data/spec/rails/public/robots.txt +0 -5
  275. data/spec/rails/spec/hamlit_spec.rb +0 -123
  276. data/spec/rails/spec/rails_helper.rb +0 -56
  277. data/spec/rails/spec/spec_helper.rb +0 -91
  278. data/spec/rails/vendor/assets/javascripts/.keep +0 -0
  279. data/spec/rails/vendor/assets/stylesheets/.keep +0 -0
  280. data/spec/spec_helper.rb +0 -36
  281. data/spec/spec_helper/document_generator.rb +0 -93
  282. data/spec/spec_helper/render_helper.rb +0 -120
  283. data/spec/spec_helper/test_case.rb +0 -55
@@ -0,0 +1,754 @@
1
+ /* C code produced by gperf version 3.0.3 */
2
+ /* Command-line: gperf -t -N find_entity -H hash_entity -K entity -C -l --null-strings -m100 html_unescape.gperf */
3
+ /* Computed positions: -k'1-3,5,$' */
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 "html_unescape.gperf"
33
+ struct html_ent {
34
+ const char *entity;
35
+ unsigned char utf8_len;
36
+ unsigned char utf8[3];
37
+ };
38
+
39
+ #define TOTAL_KEYWORDS 252
40
+ #define MIN_WORD_LENGTH 2
41
+ #define MAX_WORD_LENGTH 8
42
+ #define MIN_HASH_VALUE 10
43
+ #define MAX_HASH_VALUE 418
44
+ /* maximum key range = 409, duplicates = 0 */
45
+
46
+ #ifdef __GNUC__
47
+ __inline
48
+ #else
49
+ #ifdef __cplusplus
50
+ inline
51
+ #endif
52
+ #endif
53
+ static unsigned int
54
+ hash_entity (str, len)
55
+ register const char *str;
56
+ register unsigned int len;
57
+ {
58
+ static const unsigned short asso_values[] =
59
+ {
60
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
61
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
62
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
63
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
64
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 12,
65
+ 29, 24, 1, 419, 419, 419, 419, 419, 419, 419,
66
+ 419, 419, 419, 419, 419, 45, 137, 28, 17, 87,
67
+ 3, 16, 8, 103, 419, 7, 11, 1, 5, 76,
68
+ 116, 419, 1, 9, 16, 86, 419, 419, 9, 5,
69
+ 2, 419, 419, 419, 419, 419, 419, 2, 28, 26,
70
+ 4, 3, 109, 87, 141, 4, 197, 1, 36, 85,
71
+ 12, 1, 1, 189, 55, 17, 6, 34, 61, 10,
72
+ 5, 110, 11, 1, 419, 419, 419, 419, 419, 419,
73
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
74
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
75
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
76
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
77
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
78
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
79
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
80
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
81
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
82
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
83
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
84
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
85
+ 419, 419, 419, 419, 419, 419, 419
86
+ };
87
+ register int hval = len;
88
+
89
+ switch (hval)
90
+ {
91
+ default:
92
+ hval += asso_values[(unsigned char)str[4]];
93
+ /*FALLTHROUGH*/
94
+ case 4:
95
+ case 3:
96
+ hval += asso_values[(unsigned char)str[2]];
97
+ /*FALLTHROUGH*/
98
+ case 2:
99
+ hval += asso_values[(unsigned char)str[1]+1];
100
+ /*FALLTHROUGH*/
101
+ case 1:
102
+ hval += asso_values[(unsigned char)str[0]];
103
+ break;
104
+ }
105
+ return hval + asso_values[(unsigned char)str[len - 1]];
106
+ }
107
+
108
+ #ifdef __GNUC__
109
+ __inline
110
+ #ifdef __GNUC_STDC_INLINE__
111
+ __attribute__ ((__gnu_inline__))
112
+ #endif
113
+ #endif
114
+ const struct html_ent *
115
+ find_entity (str, len)
116
+ register const char *str;
117
+ register unsigned int len;
118
+ {
119
+ static const unsigned char lengthtable[] =
120
+ {
121
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,
122
+ 3, 0, 3, 4, 3, 3, 3, 0, 5, 6, 4, 5, 4, 4,
123
+ 3, 5, 4, 4, 5, 5, 6, 0, 5, 4, 6, 5, 5, 3,
124
+ 6, 3, 3, 5, 0, 0, 5, 5, 0, 5, 6, 6, 0, 0,
125
+ 6, 0, 0, 3, 4, 0, 3, 6, 3, 6, 5, 5, 5, 5,
126
+ 6, 6, 6, 6, 6, 2, 6, 5, 2, 6, 0, 6, 0, 3,
127
+ 4, 6, 4, 0, 0, 0, 4, 7, 3, 0, 4, 4, 6, 5,
128
+ 2, 5, 5, 5, 2, 6, 6, 3, 0, 4, 8, 2, 5, 4,
129
+ 4, 4, 6, 3, 4, 0, 0, 0, 5, 3, 6, 4, 4, 5,
130
+ 2, 6, 3, 2, 4, 3, 4, 3, 5, 4, 6, 3, 5, 5,
131
+ 5, 5, 4, 5, 5, 6, 4, 6, 5, 4, 2, 5, 5, 0,
132
+ 0, 6, 6, 4, 5, 6, 5, 6, 4, 6, 0, 4, 7, 4,
133
+ 5, 6, 4, 5, 6, 0, 0, 6, 4, 0, 4, 6, 3, 0,
134
+ 2, 6, 5, 6, 4, 4, 4, 4, 4, 4, 3, 0, 0, 5,
135
+ 6, 4, 4, 7, 0, 2, 5, 0, 2, 5, 4, 6, 2, 5,
136
+ 5, 6, 2, 4, 0, 2, 5, 0, 0, 5, 4, 6, 0, 6,
137
+ 4, 0, 3, 5, 0, 4, 0, 4, 0, 5, 6, 5, 0, 0,
138
+ 5, 5, 6, 5, 5, 6, 3, 5, 3, 0, 0, 0, 5, 3,
139
+ 0, 0, 5, 4, 0, 5, 4, 0, 5, 4, 4, 5, 7, 5,
140
+ 0, 6, 6, 6, 6, 0, 4, 4, 0, 6, 0, 0, 0, 5,
141
+ 0, 6, 6, 4, 0, 4, 0, 4, 0, 4, 3, 0, 0, 0,
142
+ 5, 7, 4, 6, 0, 6, 6, 0, 5, 0, 5, 0, 4, 0,
143
+ 4, 0, 5, 6, 0, 3, 0, 5, 0, 0, 0, 2, 0, 0,
144
+ 3, 3, 0, 5, 5, 5, 0, 0, 0, 0, 0, 5, 0, 0,
145
+ 0, 0, 0, 0, 0, 3, 6, 0, 0, 0, 0, 7, 7, 0,
146
+ 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
147
+ 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 5,
148
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
149
+ 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
150
+ 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 6
151
+ };
152
+ static const struct html_ent wordlist[] =
153
+ {
154
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
155
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
156
+ {(char*)0}, {(char*)0},
157
+ #line 132 "html_unescape.gperf"
158
+ {"Rho", 2, { 0xCE, 0xA1 }},
159
+ {(char*)0}, {(char*)0}, {(char*)0},
160
+ #line 226 "html_unescape.gperf"
161
+ {"and", 3, { 0xE2, 0x88, 0xA7 }},
162
+ {(char*)0},
163
+ #line 161 "html_unescape.gperf"
164
+ {"phi", 2, { 0xCF, 0x86 }},
165
+ #line 148 "html_unescape.gperf"
166
+ {"iota", 2, { 0xCE, 0xB9 }},
167
+ #line 163 "html_unescape.gperf"
168
+ {"psi", 2, { 0xCF, 0x88 }},
169
+ #line 8 "html_unescape.gperf"
170
+ {"amp", 1, { 0x26 }},
171
+ #line 230 "html_unescape.gperf"
172
+ {"int", 3, { 0xE2, 0x88, 0xAB }},
173
+ {(char*)0},
174
+ #line 147 "html_unescape.gperf"
175
+ {"theta", 2, { 0xCE, 0xB8 }},
176
+ #line 231 "html_unescape.gperf"
177
+ {"there4", 3, { 0xE2, 0x88, 0xB4 }},
178
+ #line 223 "html_unescape.gperf"
179
+ {"prop", 3, { 0xE2, 0x88, 0x9D }},
180
+ #line 164 "html_unescape.gperf"
181
+ {"omega", 2, { 0xCF, 0x89 }},
182
+ #line 167 "html_unescape.gperf"
183
+ {"ensp", 3, { 0xE2, 0x80, 0x82 }},
184
+ #line 218 "html_unescape.gperf"
185
+ {"prod", 3, { 0xE2, 0x88, 0x8F }},
186
+ #line 24 "html_unescape.gperf"
187
+ {"not", 2, { 0xC2, 0xAC }},
188
+ #line 194 "html_unescape.gperf"
189
+ {"image", 3, { 0xE2, 0x84, 0x91 }},
190
+ #line 215 "html_unescape.gperf"
191
+ {"isin", 3, { 0xE2, 0x88, 0x88 }},
192
+ #line 247 "html_unescape.gperf"
193
+ {"sdot", 3, { 0xE2, 0x8B, 0x85 }},
194
+ #line 123 "html_unescape.gperf"
195
+ {"Theta", 2, { 0xCE, 0x98 }},
196
+ #line 187 "html_unescape.gperf"
197
+ {"prime", 3, { 0xE2, 0x80, 0xB2 }},
198
+ #line 110 "html_unescape.gperf"
199
+ {"Scaron", 2, { 0xC5, 0xA0 }},
200
+ {(char*)0},
201
+ #line 197 "html_unescape.gperf"
202
+ {"trade", 3, { 0xE2, 0x84, 0xA2 }},
203
+ #line 168 "html_unescape.gperf"
204
+ {"emsp", 3, { 0xE2, 0x80, 0x83 }},
205
+ #line 169 "html_unescape.gperf"
206
+ {"thinsp", 3, { 0xE2, 0x80, 0x89 }},
207
+ #line 149 "html_unescape.gperf"
208
+ {"kappa", 2, { 0xCE, 0xBA }},
209
+ #line 106 "html_unescape.gperf"
210
+ {"thorn", 2, { 0xC3, 0xBE }},
211
+ #line 162 "html_unescape.gperf"
212
+ {"chi", 2, { 0xCF, 0x87 }},
213
+ #line 111 "html_unescape.gperf"
214
+ {"scaron", 2, { 0xC5, 0xA1 }},
215
+ #line 137 "html_unescape.gperf"
216
+ {"Chi", 2, { 0xCE, 0xA7 }},
217
+ #line 146 "html_unescape.gperf"
218
+ {"eta", 2, { 0xCE, 0xB7 }},
219
+ #line 125 "html_unescape.gperf"
220
+ {"Kappa", 2, { 0xCE, 0x9A }},
221
+ {(char*)0}, {(char*)0},
222
+ #line 216 "html_unescape.gperf"
223
+ {"notin", 3, { 0xE2, 0x88, 0x89 }},
224
+ #line 15 "html_unescape.gperf"
225
+ {"pound", 2, { 0xC2, 0xA3 }},
226
+ {(char*)0},
227
+ #line 32 "html_unescape.gperf"
228
+ {"acute", 2, { 0xC2, 0xB4 }},
229
+ #line 97 "html_unescape.gperf"
230
+ {"otilde", 2, { 0xC3, 0xB5 }},
231
+ #line 79 "html_unescape.gperf"
232
+ {"atilde", 2, { 0xC3, 0xA3 }},
233
+ {(char*)0}, {(char*)0},
234
+ #line 61 "html_unescape.gperf"
235
+ {"Ntilde", 2, { 0xC3, 0x91 }},
236
+ {(char*)0}, {(char*)0},
237
+ #line 228 "html_unescape.gperf"
238
+ {"cap", 3, { 0xE2, 0x88, 0xA9 }},
239
+ #line 12 "html_unescape.gperf"
240
+ {"nbsp", 2, { 0xC2, 0xA0 }},
241
+ {(char*)0},
242
+ #line 254 "html_unescape.gperf"
243
+ {"loz", 3, { 0xE2, 0x97, 0x8A }},
244
+ #line 93 "html_unescape.gperf"
245
+ {"ntilde", 2, { 0xC3, 0xB1 }},
246
+ #line 156 "html_unescape.gperf"
247
+ {"rho", 2, { 0xCF, 0x81 }},
248
+ #line 245 "html_unescape.gperf"
249
+ {"otimes", 3, { 0xE2, 0x8A, 0x97 }},
250
+ #line 96 "html_unescape.gperf"
251
+ {"ocirc", 2, { 0xC3, 0xB4 }},
252
+ #line 78 "html_unescape.gperf"
253
+ {"acirc", 2, { 0xC3, 0xA2 }},
254
+ #line 86 "html_unescape.gperf"
255
+ {"ecirc", 2, { 0xC3, 0xAA }},
256
+ #line 90 "html_unescape.gperf"
257
+ {"icirc", 2, { 0xC3, 0xAE }},
258
+ #line 95 "html_unescape.gperf"
259
+ {"oacute", 2, { 0xC3, 0xB3 }},
260
+ #line 77 "html_unescape.gperf"
261
+ {"aacute", 2, { 0xC3, 0xA1 }},
262
+ #line 85 "html_unescape.gperf"
263
+ {"eacute", 2, { 0xC3, 0xA9 }},
264
+ #line 89 "html_unescape.gperf"
265
+ {"iacute", 2, { 0xC3, 0xAD }},
266
+ #line 73 "html_unescape.gperf"
267
+ {"Yacute", 2, { 0xC3, 0x9D }},
268
+ #line 227 "html_unescape.gperf"
269
+ {"or", 3, { 0xE2, 0x88, 0xA8 }},
270
+ #line 221 "html_unescape.gperf"
271
+ {"lowast", 3, { 0xE2, 0x88, 0x97 }},
272
+ #line 214 "html_unescape.gperf"
273
+ {"nabla", 3, { 0xE2, 0x88, 0x87 }},
274
+ #line 10 "html_unescape.gperf"
275
+ {"lt", 1, { 0x3C }},
276
+ #line 83 "html_unescape.gperf"
277
+ {"ccedil", 2, { 0xC3, 0xA7 }},
278
+ {(char*)0},
279
+ #line 51 "html_unescape.gperf"
280
+ {"Ccedil", 2, { 0xC3, 0x87 }},
281
+ {(char*)0},
282
+ #line 240 "html_unescape.gperf"
283
+ {"sup", 3, { 0xE2, 0x8A, 0x83 }},
284
+ #line 241 "html_unescape.gperf"
285
+ {"nsub", 3, { 0xE2, 0x8A, 0x84 }},
286
+ #line 189 "html_unescape.gperf"
287
+ {"lsaquo", 3, { 0xE2, 0x80, 0xB9 }},
288
+ #line 243 "html_unescape.gperf"
289
+ {"supe", 3, { 0xE2, 0x8A, 0x87 }},
290
+ {(char*)0}, {(char*)0}, {(char*)0},
291
+ #line 34 "html_unescape.gperf"
292
+ {"para", 2, { 0xC2, 0xB6 }},
293
+ #line 154 "html_unescape.gperf"
294
+ {"omicron", 2, { 0xCE, 0xBF }},
295
+ #line 229 "html_unescape.gperf"
296
+ {"cup", 3, { 0xE2, 0x88, 0xAA }},
297
+ {(char*)0},
298
+ #line 211 "html_unescape.gperf"
299
+ {"part", 3, { 0xE2, 0x88, 0x82 }},
300
+ #line 37 "html_unescape.gperf"
301
+ {"sup1", 2, { 0xC2, 0xB9 }},
302
+ #line 47 "html_unescape.gperf"
303
+ {"Atilde", 2, { 0xC3, 0x83 }},
304
+ #line 140 "html_unescape.gperf"
305
+ {"alpha", 2, { 0xCE, 0xB1 }},
306
+ #line 127 "html_unescape.gperf"
307
+ {"Mu", 2, { 0xCE, 0x9C }},
308
+ #line 103 "html_unescape.gperf"
309
+ {"ucirc", 2, { 0xC3, 0xBB }},
310
+ #line 139 "html_unescape.gperf"
311
+ {"Omega", 2, { 0xCE, 0xA9 }},
312
+ #line 191 "html_unescape.gperf"
313
+ {"oline", 3, { 0xE2, 0x80, 0xBE }},
314
+ #line 128 "html_unescape.gperf"
315
+ {"Nu", 2, { 0xCE, 0x9D }},
316
+ #line 102 "html_unescape.gperf"
317
+ {"uacute", 2, { 0xC3, 0xBA }},
318
+ #line 190 "html_unescape.gperf"
319
+ {"rsaquo", 3, { 0xE2, 0x80, 0xBA }},
320
+ #line 159 "html_unescape.gperf"
321
+ {"tau", 2, { 0xCF, 0x84 }},
322
+ {(char*)0},
323
+ #line 31 "html_unescape.gperf"
324
+ {"sup3", 2, { 0xC2, 0xB3 }},
325
+ #line 165 "html_unescape.gperf"
326
+ {"thetasym", 2, { 0xCF, 0x91 }},
327
+ #line 152 "html_unescape.gperf"
328
+ {"nu", 2, { 0xCE, 0xBD }},
329
+ #line 46 "html_unescape.gperf"
330
+ {"Acirc", 2, { 0xC3, 0x82 }},
331
+ #line 38 "html_unescape.gperf"
332
+ {"ordm", 2, { 0xC2, 0xBA }},
333
+ #line 30 "html_unescape.gperf"
334
+ {"sup2", 2, { 0xC2, 0xB2 }},
335
+ #line 242 "html_unescape.gperf"
336
+ {"sube", 3, { 0xE2, 0x8A, 0x86 }},
337
+ #line 45 "html_unescape.gperf"
338
+ {"Aacute", 2, { 0xC3, 0x81 }},
339
+ #line 134 "html_unescape.gperf"
340
+ {"Tau", 2, { 0xCE, 0xA4 }},
341
+ #line 124 "html_unescape.gperf"
342
+ {"Iota", 2, { 0xCE, 0x99 }},
343
+ {(char*)0}, {(char*)0}, {(char*)0},
344
+ #line 248 "html_unescape.gperf"
345
+ {"lceil", 3, { 0xE2, 0x8C, 0x88 }},
346
+ #line 20 "html_unescape.gperf"
347
+ {"uml", 2, { 0xC2, 0xA8 }},
348
+ #line 43 "html_unescape.gperf"
349
+ {"iquest", 2, { 0xC2, 0xBF }},
350
+ #line 121 "html_unescape.gperf"
351
+ {"Zeta", 2, { 0xCE, 0x96 }},
352
+ #line 193 "html_unescape.gperf"
353
+ {"euro", 3, { 0xE2, 0x82, 0xAC }},
354
+ #line 234 "html_unescape.gperf"
355
+ {"asymp", 3, { 0xE2, 0x89, 0x88 }},
356
+ #line 235 "html_unescape.gperf"
357
+ {"ne", 3, { 0xE2, 0x89, 0xA0 }},
358
+ #line 65 "html_unescape.gperf"
359
+ {"Otilde", 2, { 0xC3, 0x95 }},
360
+ #line 122 "html_unescape.gperf"
361
+ {"Eta", 2, { 0xCE, 0x97 }},
362
+ #line 11 "html_unescape.gperf"
363
+ {"gt", 1, { 0x3E }},
364
+ #line 233 "html_unescape.gperf"
365
+ {"cong", 3, { 0xE2, 0x89, 0x85 }},
366
+ #line 136 "html_unescape.gperf"
367
+ {"Phi", 2, { 0xCE, 0xA6 }},
368
+ #line 145 "html_unescape.gperf"
369
+ {"zeta", 2, { 0xCE, 0xB6 }},
370
+ #line 138 "html_unescape.gperf"
371
+ {"Psi", 2, { 0xCE, 0xA8 }},
372
+ #line 212 "html_unescape.gperf"
373
+ {"exist", 3, { 0xE2, 0x88, 0x83 }},
374
+ #line 22 "html_unescape.gperf"
375
+ {"ordf", 2, { 0xC2, 0xAA }},
376
+ #line 126 "html_unescape.gperf"
377
+ {"Lambda", 2, { 0xCE, 0x9B }},
378
+ #line 239 "html_unescape.gperf"
379
+ {"sub", 3, { 0xE2, 0x8A, 0x82 }},
380
+ #line 118 "html_unescape.gperf"
381
+ {"Gamma", 2, { 0xCE, 0x93 }},
382
+ #line 249 "html_unescape.gperf"
383
+ {"rceil", 3, { 0xE2, 0x8C, 0x89 }},
384
+ #line 116 "html_unescape.gperf"
385
+ {"Alpha", 2, { 0xCE, 0x91 }},
386
+ #line 64 "html_unescape.gperf"
387
+ {"Ocirc", 2, { 0xC3, 0x94 }},
388
+ #line 21 "html_unescape.gperf"
389
+ {"copy", 2, { 0xC2, 0xA9 }},
390
+ #line 224 "html_unescape.gperf"
391
+ {"infin", 3, { 0xE2, 0x88, 0x9E }},
392
+ #line 222 "html_unescape.gperf"
393
+ {"radic", 3, { 0xE2, 0x88, 0x9A }},
394
+ #line 63 "html_unescape.gperf"
395
+ {"Oacute", 2, { 0xC3, 0x93 }},
396
+ #line 202 "html_unescape.gperf"
397
+ {"darr", 3, { 0xE2, 0x86, 0x93 }},
398
+ #line 40 "html_unescape.gperf"
399
+ {"frac14", 2, { 0xC2, 0xBC }},
400
+ #line 188 "html_unescape.gperf"
401
+ {"Prime", 3, { 0xE2, 0x80, 0xB3 }},
402
+ #line 141 "html_unescape.gperf"
403
+ {"beta", 2, { 0xCE, 0xB2 }},
404
+ #line 237 "html_unescape.gperf"
405
+ {"le", 3, { 0xE2, 0x89, 0xA4 }},
406
+ #line 71 "html_unescape.gperf"
407
+ {"Ucirc", 2, { 0xC3, 0x9B }},
408
+ #line 54 "html_unescape.gperf"
409
+ {"Ecirc", 2, { 0xC3, 0x8A }},
410
+ {(char*)0}, {(char*)0},
411
+ #line 70 "html_unescape.gperf"
412
+ {"Uacute", 2, { 0xC3, 0x9A }},
413
+ #line 53 "html_unescape.gperf"
414
+ {"Eacute", 2, { 0xC3, 0x89 }},
415
+ #line 14 "html_unescape.gperf"
416
+ {"cent", 2, { 0xC2, 0xA2 }},
417
+ #line 143 "html_unescape.gperf"
418
+ {"delta", 2, { 0xCE, 0xB4 }},
419
+ #line 42 "html_unescape.gperf"
420
+ {"frac34", 2, { 0xC2, 0xBE }},
421
+ #line 204 "html_unescape.gperf"
422
+ {"crarr", 3, { 0xE2, 0x86, 0xB5 }},
423
+ #line 150 "html_unescape.gperf"
424
+ {"lambda", 2, { 0xCE, 0xBB }},
425
+ #line 19 "html_unescape.gperf"
426
+ {"sect", 2, { 0xC2, 0xA7 }},
427
+ #line 16 "html_unescape.gperf"
428
+ {"curren", 2, { 0xC2, 0xA4 }},
429
+ {(char*)0},
430
+ #line 184 "html_unescape.gperf"
431
+ {"bull", 3, { 0xE2, 0x80, 0xA2 }},
432
+ #line 130 "html_unescape.gperf"
433
+ {"Omicron", 2, { 0xCE, 0x9F }},
434
+ #line 252 "html_unescape.gperf"
435
+ {"lang", 3, { 0xE2, 0x9F, 0xA8 }},
436
+ #line 58 "html_unescape.gperf"
437
+ {"Icirc", 2, { 0xC3, 0x8E }},
438
+ #line 18 "html_unescape.gperf"
439
+ {"brvbar", 2, { 0xC2, 0xA6 }},
440
+ #line 246 "html_unescape.gperf"
441
+ {"perp", 3, { 0xE2, 0x8A, 0xA5 }},
442
+ #line 119 "html_unescape.gperf"
443
+ {"Delta", 2, { 0xCE, 0x94 }},
444
+ #line 57 "html_unescape.gperf"
445
+ {"Iacute", 2, { 0xC3, 0x8D }},
446
+ {(char*)0}, {(char*)0},
447
+ #line 41 "html_unescape.gperf"
448
+ {"frac12", 2, { 0xC2, 0xBD }},
449
+ #line 200 "html_unescape.gperf"
450
+ {"uarr", 3, { 0xE2, 0x86, 0x91 }},
451
+ {(char*)0},
452
+ #line 199 "html_unescape.gperf"
453
+ {"larr", 3, { 0xE2, 0x86, 0x90 }},
454
+ #line 105 "html_unescape.gperf"
455
+ {"yacute", 2, { 0xC3, 0xBD }},
456
+ #line 225 "html_unescape.gperf"
457
+ {"ang", 3, { 0xE2, 0x88, 0xA0 }},
458
+ {(char*)0},
459
+ #line 151 "html_unescape.gperf"
460
+ {"mu", 2, { 0xCE, 0xBC }},
461
+ #line 182 "html_unescape.gperf"
462
+ {"dagger", 3, { 0xE2, 0x80, 0xA0 }},
463
+ #line 256 "html_unescape.gperf"
464
+ {"clubs", 3, { 0xE2, 0x99, 0xA3 }},
465
+ #line 195 "html_unescape.gperf"
466
+ {"weierp", 3, { 0xE2, 0x84, 0x98 }},
467
+ #line 253 "html_unescape.gperf"
468
+ {"rang", 3, { 0xE2, 0x9F, 0xA9 }},
469
+ #line 98 "html_unescape.gperf"
470
+ {"ouml", 2, { 0xC3, 0xB6 }},
471
+ #line 80 "html_unescape.gperf"
472
+ {"auml", 2, { 0xC3, 0xA4 }},
473
+ #line 87 "html_unescape.gperf"
474
+ {"euml", 2, { 0xC3, 0xAB }},
475
+ #line 91 "html_unescape.gperf"
476
+ {"iuml", 2, { 0xC3, 0xAF }},
477
+ #line 112 "html_unescape.gperf"
478
+ {"Yuml", 2, { 0xC5, 0xB8 }},
479
+ #line 60 "html_unescape.gperf"
480
+ {"ETH", 2, { 0xC3, 0x90 }},
481
+ {(char*)0}, {(char*)0},
482
+ #line 13 "html_unescape.gperf"
483
+ {"iexcl", 2, { 0xC2, 0xA1 }},
484
+ #line 183 "html_unescape.gperf"
485
+ {"Dagger", 3, { 0xE2, 0x80, 0xA1 }},
486
+ #line 201 "html_unescape.gperf"
487
+ {"rarr", 3, { 0xE2, 0x86, 0x92 }},
488
+ #line 27 "html_unescape.gperf"
489
+ {"macr", 2, { 0xC2, 0xAF }},
490
+ #line 198 "html_unescape.gperf"
491
+ {"alefsym", 3, { 0xE2, 0x84, 0xB5 }},
492
+ {(char*)0},
493
+ #line 238 "html_unescape.gperf"
494
+ {"ge", 3, { 0xE2, 0x89, 0xA5 }},
495
+ #line 81 "html_unescape.gperf"
496
+ {"aring", 2, { 0xC3, 0xA5 }},
497
+ {(char*)0},
498
+ #line 155 "html_unescape.gperf"
499
+ {"pi", 2, { 0xCF, 0x80 }},
500
+ #line 192 "html_unescape.gperf"
501
+ {"frasl", 3, { 0xE2, 0x81, 0x84 }},
502
+ #line 196 "html_unescape.gperf"
503
+ {"real", 3, { 0xE2, 0x84, 0x9C }},
504
+ #line 100 "html_unescape.gperf"
505
+ {"oslash", 2, { 0xC3, 0xB8 }},
506
+ #line 153 "html_unescape.gperf"
507
+ {"xi", 2, { 0xCE, 0xBE }},
508
+ #line 142 "html_unescape.gperf"
509
+ {"gamma", 2, { 0xCE, 0xB3 }},
510
+ #line 74 "html_unescape.gperf"
511
+ {"THORN", 2, { 0xC3, 0x9E }},
512
+ #line 186 "html_unescape.gperf"
513
+ {"permil", 3, { 0xE2, 0x80, 0xB0 }},
514
+ #line 129 "html_unescape.gperf"
515
+ {"Xi", 2, { 0xCE, 0x9E }},
516
+ #line 9 "html_unescape.gperf"
517
+ {"apos", 1, { 0x27 }},
518
+ {(char*)0},
519
+ #line 217 "html_unescape.gperf"
520
+ {"ni", 3, { 0xE2, 0x88, 0x8B }},
521
+ #line 36 "html_unescape.gperf"
522
+ {"cedil", 2, { 0xC2, 0xB8 }},
523
+ {(char*)0}, {(char*)0},
524
+ #line 236 "html_unescape.gperf"
525
+ {"equiv", 3, { 0xE2, 0x89, 0xA1 }},
526
+ #line 104 "html_unescape.gperf"
527
+ {"uuml", 2, { 0xC3, 0xBC }},
528
+ #line 250 "html_unescape.gperf"
529
+ {"lfloor", 3, { 0xE2, 0x8C, 0x8A }},
530
+ {(char*)0},
531
+ #line 29 "html_unescape.gperf"
532
+ {"plusmn", 2, { 0xC2, 0xB1 }},
533
+ #line 113 "html_unescape.gperf"
534
+ {"fnof", 2, { 0xC6, 0x92 }},
535
+ {(char*)0},
536
+ #line 172 "html_unescape.gperf"
537
+ {"lrm", 3, { 0xE2, 0x80, 0x8E }},
538
+ #line 181 "html_unescape.gperf"
539
+ {"bdquo", 3, { 0xE2, 0x80, 0x9E }},
540
+ {(char*)0},
541
+ #line 170 "html_unescape.gperf"
542
+ {"zwnj", 3, { 0xE2, 0x80, 0x8C }},
543
+ {(char*)0},
544
+ #line 48 "html_unescape.gperf"
545
+ {"Auml", 2, { 0xC3, 0x84 }},
546
+ {(char*)0},
547
+ #line 75 "html_unescape.gperf"
548
+ {"szlig", 2, { 0xC3, 0x9F }},
549
+ #line 255 "html_unescape.gperf"
550
+ {"spades", 3, { 0xE2, 0x99, 0xA0 }},
551
+ #line 179 "html_unescape.gperf"
552
+ {"ldquo", 3, { 0xE2, 0x80, 0x9C }},
553
+ {(char*)0}, {(char*)0},
554
+ #line 176 "html_unescape.gperf"
555
+ {"lsquo", 3, { 0xE2, 0x80, 0x98 }},
556
+ #line 178 "html_unescape.gperf"
557
+ {"sbquo", 3, { 0xE2, 0x80, 0x9A }},
558
+ #line 251 "html_unescape.gperf"
559
+ {"rfloor", 3, { 0xE2, 0x8C, 0x8B }},
560
+ #line 213 "html_unescape.gperf"
561
+ {"empty", 3, { 0xE2, 0x88, 0x85 }},
562
+ #line 258 "html_unescape.gperf"
563
+ {"diams", 3, { 0xE2, 0x99, 0xA6 }},
564
+ #line 210 "html_unescape.gperf"
565
+ {"forall", 3, { 0xE2, 0x88, 0x80 }},
566
+ #line 25 "html_unescape.gperf"
567
+ {"shy", 2, { 0xC2, 0xAD }},
568
+ #line 49 "html_unescape.gperf"
569
+ {"Aring", 2, { 0xC3, 0x85 }},
570
+ #line 17 "html_unescape.gperf"
571
+ {"yen", 2, { 0xC2, 0xA5 }},
572
+ {(char*)0}, {(char*)0}, {(char*)0},
573
+ #line 115 "html_unescape.gperf"
574
+ {"tilde", 2, { 0xCB, 0x9C }},
575
+ #line 219 "html_unescape.gperf"
576
+ {"sum", 3, { 0xE2, 0x88, 0x91 }},
577
+ {(char*)0}, {(char*)0},
578
+ #line 180 "html_unescape.gperf"
579
+ {"rdquo", 3, { 0xE2, 0x80, 0x9D }},
580
+ #line 208 "html_unescape.gperf"
581
+ {"dArr", 3, { 0xE2, 0x87, 0x93 }},
582
+ {(char*)0},
583
+ #line 177 "html_unescape.gperf"
584
+ {"rsquo", 3, { 0xE2, 0x80, 0x99 }},
585
+ #line 117 "html_unescape.gperf"
586
+ {"Beta", 2, { 0xCE, 0x92 }},
587
+ {(char*)0},
588
+ #line 23 "html_unescape.gperf"
589
+ {"laquo", 2, { 0xC2, 0xAB }},
590
+ #line 7 "html_unescape.gperf"
591
+ {"quot", 1, { 0x22 }},
592
+ #line 66 "html_unescape.gperf"
593
+ {"Ouml", 2, { 0xC3, 0x96 }},
594
+ #line 50 "html_unescape.gperf"
595
+ {"AElig", 2, { 0xC3, 0x86 }},
596
+ #line 144 "html_unescape.gperf"
597
+ {"epsilon", 2, { 0xCE, 0xB5 }},
598
+ #line 244 "html_unescape.gperf"
599
+ {"oplus", 3, { 0xE2, 0x8A, 0x95 }},
600
+ {(char*)0},
601
+ #line 94 "html_unescape.gperf"
602
+ {"ograve", 2, { 0xC3, 0xB2 }},
603
+ #line 76 "html_unescape.gperf"
604
+ {"agrave", 2, { 0xC3, 0xA0 }},
605
+ #line 84 "html_unescape.gperf"
606
+ {"egrave", 2, { 0xC3, 0xA8 }},
607
+ #line 88 "html_unescape.gperf"
608
+ {"igrave", 2, { 0xC3, 0xAC }},
609
+ {(char*)0},
610
+ #line 72 "html_unescape.gperf"
611
+ {"Uuml", 2, { 0xC3, 0x9C }},
612
+ #line 55 "html_unescape.gperf"
613
+ {"Euml", 2, { 0xC3, 0x8B }},
614
+ {(char*)0},
615
+ #line 99 "html_unescape.gperf"
616
+ {"divide", 2, { 0xC3, 0xB7 }},
617
+ {(char*)0}, {(char*)0}, {(char*)0},
618
+ #line 39 "html_unescape.gperf"
619
+ {"raquo", 2, { 0xC2, 0xBB }},
620
+ {(char*)0},
621
+ #line 257 "html_unescape.gperf"
622
+ {"hearts", 3, { 0xE2, 0x99, 0xA5 }},
623
+ #line 68 "html_unescape.gperf"
624
+ {"Oslash", 2, { 0xC3, 0x98 }},
625
+ #line 203 "html_unescape.gperf"
626
+ {"harr", 3, { 0xE2, 0x86, 0x94 }},
627
+ {(char*)0},
628
+ #line 206 "html_unescape.gperf"
629
+ {"uArr", 3, { 0xE2, 0x87, 0x91 }},
630
+ {(char*)0},
631
+ #line 205 "html_unescape.gperf"
632
+ {"lArr", 3, { 0xE2, 0x87, 0x90 }},
633
+ {(char*)0},
634
+ #line 59 "html_unescape.gperf"
635
+ {"Iuml", 2, { 0xC3, 0x8F }},
636
+ #line 28 "html_unescape.gperf"
637
+ {"deg", 2, { 0xC2, 0xB0 }},
638
+ {(char*)0}, {(char*)0}, {(char*)0},
639
+ #line 108 "html_unescape.gperf"
640
+ {"OElig", 2, { 0xC5, 0x92 }},
641
+ #line 160 "html_unescape.gperf"
642
+ {"upsilon", 2, { 0xCF, 0x85 }},
643
+ #line 107 "html_unescape.gperf"
644
+ {"yuml", 2, { 0xC3, 0xBF }},
645
+ #line 185 "html_unescape.gperf"
646
+ {"hellip", 3, { 0xE2, 0x80, 0xA6 }},
647
+ {(char*)0},
648
+ #line 35 "html_unescape.gperf"
649
+ {"middot", 2, { 0xC2, 0xB7 }},
650
+ #line 101 "html_unescape.gperf"
651
+ {"ugrave", 2, { 0xC3, 0xB9 }},
652
+ {(char*)0},
653
+ #line 133 "html_unescape.gperf"
654
+ {"Sigma", 2, { 0xCE, 0xA3 }},
655
+ {(char*)0},
656
+ #line 174 "html_unescape.gperf"
657
+ {"ndash", 3, { 0xE2, 0x80, 0x93 }},
658
+ {(char*)0},
659
+ #line 207 "html_unescape.gperf"
660
+ {"rArr", 3, { 0xE2, 0x87, 0x92 }},
661
+ {(char*)0},
662
+ #line 114 "html_unescape.gperf"
663
+ {"circ", 2, { 0xCB, 0x86 }},
664
+ {(char*)0},
665
+ #line 158 "html_unescape.gperf"
666
+ {"sigma", 2, { 0xCF, 0x83 }},
667
+ #line 44 "html_unescape.gperf"
668
+ {"Agrave", 2, { 0xC3, 0x80 }},
669
+ {(char*)0},
670
+ #line 173 "html_unescape.gperf"
671
+ {"rlm", 3, { 0xE2, 0x80, 0x8F }},
672
+ {(char*)0},
673
+ #line 33 "html_unescape.gperf"
674
+ {"micro", 2, { 0xC2, 0xB5 }},
675
+ {(char*)0}, {(char*)0}, {(char*)0},
676
+ #line 131 "html_unescape.gperf"
677
+ {"Pi", 2, { 0xCE, 0xA0 }},
678
+ {(char*)0}, {(char*)0},
679
+ #line 92 "html_unescape.gperf"
680
+ {"eth", 2, { 0xC3, 0xB0 }},
681
+ #line 166 "html_unescape.gperf"
682
+ {"piv", 2, { 0xCF, 0x96 }},
683
+ {(char*)0},
684
+ #line 109 "html_unescape.gperf"
685
+ {"oelig", 2, { 0xC5, 0x93 }},
686
+ #line 82 "html_unescape.gperf"
687
+ {"aelig", 2, { 0xC3, 0xA6 }},
688
+ #line 67 "html_unescape.gperf"
689
+ {"times", 2, { 0xC3, 0x97 }},
690
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
691
+ {(char*)0},
692
+ #line 220 "html_unescape.gperf"
693
+ {"minus", 3, { 0xE2, 0x88, 0x92 }},
694
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
695
+ {(char*)0}, {(char*)0}, {(char*)0},
696
+ #line 26 "html_unescape.gperf"
697
+ {"reg", 2, { 0xC2, 0xAE }},
698
+ #line 62 "html_unescape.gperf"
699
+ {"Ograve", 2, { 0xC3, 0x92 }},
700
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
701
+ #line 135 "html_unescape.gperf"
702
+ {"Upsilon", 2, { 0xCE, 0xA5 }},
703
+ #line 120 "html_unescape.gperf"
704
+ {"Epsilon", 2, { 0xCE, 0x95 }},
705
+ {(char*)0}, {(char*)0}, {(char*)0},
706
+ #line 69 "html_unescape.gperf"
707
+ {"Ugrave", 2, { 0xC3, 0x99 }},
708
+ #line 52 "html_unescape.gperf"
709
+ {"Egrave", 2, { 0xC3, 0x88 }},
710
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
711
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
712
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
713
+ {(char*)0}, {(char*)0}, {(char*)0},
714
+ #line 56 "html_unescape.gperf"
715
+ {"Igrave", 2, { 0xC3, 0x8C }},
716
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
717
+ {(char*)0}, {(char*)0}, {(char*)0},
718
+ #line 175 "html_unescape.gperf"
719
+ {"mdash", 3, { 0xE2, 0x80, 0x94 }},
720
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
721
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
722
+ {(char*)0},
723
+ #line 232 "html_unescape.gperf"
724
+ {"sim", 3, { 0xE2, 0x88, 0xBC }},
725
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
726
+ #line 209 "html_unescape.gperf"
727
+ {"hArr", 3, { 0xE2, 0x87, 0x94 }},
728
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
729
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
730
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
731
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
732
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
733
+ #line 171 "html_unescape.gperf"
734
+ {"zwj", 3, { 0xE2, 0x80, 0x8D }},
735
+ {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
736
+ #line 157 "html_unescape.gperf"
737
+ {"sigmaf", 2, { 0xCF, 0x82 }}
738
+ };
739
+
740
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
741
+ {
742
+ register int key = hash_entity (str, len);
743
+
744
+ if (key <= MAX_HASH_VALUE && key >= 0)
745
+ if (len == lengthtable[key])
746
+ {
747
+ register const char *s = wordlist[key].entity;
748
+
749
+ if (s && *str == *s && !memcmp (str + 1, s + 1, len - 1))
750
+ return &wordlist[key];
751
+ }
752
+ }
753
+ return 0;
754
+ }