nokolexbor 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ext/nokolexbor/config.h +186 -0
- data/ext/nokolexbor/extconf.rb +131 -0
- data/ext/nokolexbor/libxml/HTMLparser.h +320 -0
- data/ext/nokolexbor/libxml/SAX2.h +173 -0
- data/ext/nokolexbor/libxml/chvalid.h +230 -0
- data/ext/nokolexbor/libxml/debugXML.h +217 -0
- data/ext/nokolexbor/libxml/dict.h +81 -0
- data/ext/nokolexbor/libxml/encoding.h +232 -0
- data/ext/nokolexbor/libxml/entities.h +153 -0
- data/ext/nokolexbor/libxml/globals.h +529 -0
- data/ext/nokolexbor/libxml/hash.h +236 -0
- data/ext/nokolexbor/libxml/list.h +137 -0
- data/ext/nokolexbor/libxml/parser.h +1264 -0
- data/ext/nokolexbor/libxml/parserInternals.h +641 -0
- data/ext/nokolexbor/libxml/pattern.h +100 -0
- data/ext/nokolexbor/libxml/threads.h +94 -0
- data/ext/nokolexbor/libxml/tree.h +1315 -0
- data/ext/nokolexbor/libxml/uri.h +94 -0
- data/ext/nokolexbor/libxml/valid.h +448 -0
- data/ext/nokolexbor/libxml/xmlIO.h +369 -0
- data/ext/nokolexbor/libxml/xmlautomata.h +146 -0
- data/ext/nokolexbor/libxml/xmlerror.h +919 -0
- data/ext/nokolexbor/libxml/xmlexports.h +79 -0
- data/ext/nokolexbor/libxml/xmlmemory.h +226 -0
- data/ext/nokolexbor/libxml/xmlregexp.h +222 -0
- data/ext/nokolexbor/libxml/xmlstring.h +140 -0
- data/ext/nokolexbor/libxml/xmlversion.h +526 -0
- data/ext/nokolexbor/libxml/xpath.h +575 -0
- data/ext/nokolexbor/libxml/xpathInternals.h +632 -0
- data/ext/nokolexbor/libxml/xpointer.h +137 -0
- data/ext/nokolexbor/libxml.h +76 -0
- data/ext/nokolexbor/memory.c +39 -0
- data/ext/nokolexbor/nl_document.c +51 -0
- data/ext/nokolexbor/nl_node.c +790 -0
- data/ext/nokolexbor/nl_node_set.c +368 -0
- data/ext/nokolexbor/nl_xpath_context.c +200 -0
- data/ext/nokolexbor/nokolexbor.c +63 -0
- data/ext/nokolexbor/nokolexbor.h +37 -0
- data/ext/nokolexbor/private/buf.h +70 -0
- data/ext/nokolexbor/private/dict.h +11 -0
- data/ext/nokolexbor/private/enc.h +17 -0
- data/ext/nokolexbor/private/error.h +21 -0
- data/ext/nokolexbor/private/globals.h +9 -0
- data/ext/nokolexbor/private/memory.h +9 -0
- data/ext/nokolexbor/private/parser.h +27 -0
- data/ext/nokolexbor/private/string.h +9 -0
- data/ext/nokolexbor/private/threads.h +50 -0
- data/ext/nokolexbor/private/tree.h +18 -0
- data/ext/nokolexbor/private/xpath.h +7 -0
- data/ext/nokolexbor/timsort.h +601 -0
- data/ext/nokolexbor/xml_SAX2.c +80 -0
- data/ext/nokolexbor/xml_buf.c +363 -0
- data/ext/nokolexbor/xml_chvalid.c +334 -0
- data/ext/nokolexbor/xml_dict.c +1264 -0
- data/ext/nokolexbor/xml_encoding.c +124 -0
- data/ext/nokolexbor/xml_error.c +134 -0
- data/ext/nokolexbor/xml_globals.c +1085 -0
- data/ext/nokolexbor/xml_hash.c +1141 -0
- data/ext/nokolexbor/xml_memory.c +203 -0
- data/ext/nokolexbor/xml_parser.c +127 -0
- data/ext/nokolexbor/xml_parserInternals.c +338 -0
- data/ext/nokolexbor/xml_pattern.c +2375 -0
- data/ext/nokolexbor/xml_string.c +1051 -0
- data/ext/nokolexbor/xml_threads.c +881 -0
- data/ext/nokolexbor/xml_tree.c +148 -0
- data/ext/nokolexbor/xml_xpath.c +14743 -0
- data/lib/nokolexbor/attribute.rb +18 -0
- data/lib/nokolexbor/document.rb +6 -0
- data/lib/nokolexbor/node.rb +264 -0
- data/lib/nokolexbor/node_set.rb +124 -0
- data/lib/nokolexbor/version.rb +5 -0
- data/lib/nokolexbor/xpath_context.rb +14 -0
- data/lib/nokolexbor.rb +17 -0
- data/patches/0001-lexbor-support-text-pseudo-element.patch +137 -0
- data/patches/0002-lexbor-match-id-class-case-sensitive.patch +22 -0
- data/patches/0003-lexbor-attach-template-content-to-self.patch +13 -0
- data/vendor/lexbor/CMakeLists.txt +331 -0
- data/vendor/lexbor/config.cmake +890 -0
- data/vendor/lexbor/feature.cmake +134 -0
- data/vendor/lexbor/source/lexbor/core/array.c +208 -0
- data/vendor/lexbor/source/lexbor/core/array.h +100 -0
- data/vendor/lexbor/source/lexbor/core/array_obj.c +216 -0
- data/vendor/lexbor/source/lexbor/core/array_obj.h +134 -0
- data/vendor/lexbor/source/lexbor/core/avl.c +442 -0
- data/vendor/lexbor/source/lexbor/core/avl.h +82 -0
- data/vendor/lexbor/source/lexbor/core/base.h +86 -0
- data/vendor/lexbor/source/lexbor/core/bst.c +468 -0
- data/vendor/lexbor/source/lexbor/core/bst.h +108 -0
- data/vendor/lexbor/source/lexbor/core/bst_map.c +238 -0
- data/vendor/lexbor/source/lexbor/core/bst_map.h +87 -0
- data/vendor/lexbor/source/lexbor/core/config.cmake +12 -0
- data/vendor/lexbor/source/lexbor/core/conv.c +203 -0
- data/vendor/lexbor/source/lexbor/core/conv.h +53 -0
- data/vendor/lexbor/source/lexbor/core/core.h +35 -0
- data/vendor/lexbor/source/lexbor/core/def.h +57 -0
- data/vendor/lexbor/source/lexbor/core/diyfp.c +153 -0
- data/vendor/lexbor/source/lexbor/core/diyfp.h +258 -0
- data/vendor/lexbor/source/lexbor/core/dobject.c +187 -0
- data/vendor/lexbor/source/lexbor/core/dobject.h +92 -0
- data/vendor/lexbor/source/lexbor/core/dtoa.c +404 -0
- data/vendor/lexbor/source/lexbor/core/dtoa.h +28 -0
- data/vendor/lexbor/source/lexbor/core/fs.h +60 -0
- data/vendor/lexbor/source/lexbor/core/hash.c +476 -0
- data/vendor/lexbor/source/lexbor/core/hash.h +218 -0
- data/vendor/lexbor/source/lexbor/core/in.c +267 -0
- data/vendor/lexbor/source/lexbor/core/in.h +172 -0
- data/vendor/lexbor/source/lexbor/core/lexbor.h +35 -0
- data/vendor/lexbor/source/lexbor/core/mem.c +228 -0
- data/vendor/lexbor/source/lexbor/core/mem.h +141 -0
- data/vendor/lexbor/source/lexbor/core/mraw.c +428 -0
- data/vendor/lexbor/source/lexbor/core/mraw.h +114 -0
- data/vendor/lexbor/source/lexbor/core/perf.h +45 -0
- data/vendor/lexbor/source/lexbor/core/plog.c +73 -0
- data/vendor/lexbor/source/lexbor/core/plog.h +102 -0
- data/vendor/lexbor/source/lexbor/core/print.c +168 -0
- data/vendor/lexbor/source/lexbor/core/print.h +39 -0
- data/vendor/lexbor/source/lexbor/core/sbst.h +59 -0
- data/vendor/lexbor/source/lexbor/core/serialize.c +27 -0
- data/vendor/lexbor/source/lexbor/core/serialize.h +32 -0
- data/vendor/lexbor/source/lexbor/core/shs.c +118 -0
- data/vendor/lexbor/source/lexbor/core/shs.h +82 -0
- data/vendor/lexbor/source/lexbor/core/str.c +617 -0
- data/vendor/lexbor/source/lexbor/core/str.h +247 -0
- data/vendor/lexbor/source/lexbor/core/str_res.h +369 -0
- data/vendor/lexbor/source/lexbor/core/strtod.c +326 -0
- data/vendor/lexbor/source/lexbor/core/strtod.h +28 -0
- data/vendor/lexbor/source/lexbor/core/types.h +39 -0
- data/vendor/lexbor/source/lexbor/core/utils.c +43 -0
- data/vendor/lexbor/source/lexbor/core/utils.h +36 -0
- data/vendor/lexbor/source/lexbor/css/base.h +44 -0
- data/vendor/lexbor/source/lexbor/css/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/css/css.h +25 -0
- data/vendor/lexbor/source/lexbor/css/log.c +336 -0
- data/vendor/lexbor/source/lexbor/css/log.h +103 -0
- data/vendor/lexbor/source/lexbor/css/node.h +29 -0
- data/vendor/lexbor/source/lexbor/css/parser.c +473 -0
- data/vendor/lexbor/source/lexbor/css/parser.h +368 -0
- data/vendor/lexbor/source/lexbor/css/selectors/base.h +48 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo.c +91 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo.h +66 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo_const.h +109 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo_res.h +302 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo_state.c +279 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo_state.h +85 -0
- data/vendor/lexbor/source/lexbor/css/selectors/selector.c +927 -0
- data/vendor/lexbor/source/lexbor/css/selectors/selector.h +200 -0
- data/vendor/lexbor/source/lexbor/css/selectors/selectors.c +340 -0
- data/vendor/lexbor/source/lexbor/css/selectors/selectors.h +137 -0
- data/vendor/lexbor/source/lexbor/css/selectors/state.c +1718 -0
- data/vendor/lexbor/source/lexbor/css/selectors/state.h +79 -0
- data/vendor/lexbor/source/lexbor/css/stylesheet.h +37 -0
- data/vendor/lexbor/source/lexbor/css/syntax/anb.c +443 -0
- data/vendor/lexbor/source/lexbor/css/syntax/anb.h +45 -0
- data/vendor/lexbor/source/lexbor/css/syntax/base.h +33 -0
- data/vendor/lexbor/source/lexbor/css/syntax/parser.c +9 -0
- data/vendor/lexbor/source/lexbor/css/syntax/parser.h +25 -0
- data/vendor/lexbor/source/lexbor/css/syntax/res.h +48 -0
- data/vendor/lexbor/source/lexbor/css/syntax/state.c +2603 -0
- data/vendor/lexbor/source/lexbor/css/syntax/state.h +140 -0
- data/vendor/lexbor/source/lexbor/css/syntax/state_res.h +273 -0
- data/vendor/lexbor/source/lexbor/css/syntax/syntax.c +67 -0
- data/vendor/lexbor/source/lexbor/css/syntax/token.c +618 -0
- data/vendor/lexbor/source/lexbor/css/syntax/token.h +298 -0
- data/vendor/lexbor/source/lexbor/css/syntax/token_res.h +68 -0
- data/vendor/lexbor/source/lexbor/css/syntax/tokenizer/error.c +30 -0
- data/vendor/lexbor/source/lexbor/css/syntax/tokenizer/error.h +58 -0
- data/vendor/lexbor/source/lexbor/css/syntax/tokenizer.c +278 -0
- data/vendor/lexbor/source/lexbor/css/syntax/tokenizer.h +121 -0
- data/vendor/lexbor/source/lexbor/dom/base.h +32 -0
- data/vendor/lexbor/source/lexbor/dom/collection.c +97 -0
- data/vendor/lexbor/source/lexbor/dom/collection.h +112 -0
- data/vendor/lexbor/source/lexbor/dom/config.cmake +3 -0
- data/vendor/lexbor/source/lexbor/dom/dom.h +29 -0
- data/vendor/lexbor/source/lexbor/dom/exception.c +18 -0
- data/vendor/lexbor/source/lexbor/dom/exception.h +73 -0
- data/vendor/lexbor/source/lexbor/dom/interface.c +110 -0
- data/vendor/lexbor/source/lexbor/dom/interface.h +88 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/attr.c +445 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/attr.h +152 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/attr_const.h +62 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/attr_res.h +143 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/cdata_section.c +55 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/cdata_section.h +38 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/character_data.c +110 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/character_data.h +51 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/comment.c +64 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/comment.h +42 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document.c +536 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document.h +243 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document_fragment.c +36 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document_fragment.h +36 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document_type.c +125 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document_type.h +108 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/element.c +1411 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/element.h +319 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/event_target.c +32 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/event_target.h +34 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/node.c +661 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/node.h +192 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/processing_instruction.c +87 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/processing_instruction.h +66 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/shadow_root.c +36 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/shadow_root.h +44 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/text.c +63 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/text.h +42 -0
- data/vendor/lexbor/source/lexbor/encoding/base.h +218 -0
- data/vendor/lexbor/source/lexbor/encoding/big5.c +42839 -0
- data/vendor/lexbor/source/lexbor/encoding/config.cmake +12 -0
- data/vendor/lexbor/source/lexbor/encoding/const.h +65 -0
- data/vendor/lexbor/source/lexbor/encoding/decode.c +3193 -0
- data/vendor/lexbor/source/lexbor/encoding/decode.h +370 -0
- data/vendor/lexbor/source/lexbor/encoding/encode.c +1931 -0
- data/vendor/lexbor/source/lexbor/encoding/encode.h +377 -0
- data/vendor/lexbor/source/lexbor/encoding/encoding.c +252 -0
- data/vendor/lexbor/source/lexbor/encoding/encoding.h +475 -0
- data/vendor/lexbor/source/lexbor/encoding/euc_kr.c +53883 -0
- data/vendor/lexbor/source/lexbor/encoding/gb18030.c +47905 -0
- data/vendor/lexbor/source/lexbor/encoding/iso_2022_jp_katakana.c +159 -0
- data/vendor/lexbor/source/lexbor/encoding/jis0208.c +22477 -0
- data/vendor/lexbor/source/lexbor/encoding/jis0212.c +15787 -0
- data/vendor/lexbor/source/lexbor/encoding/multi.h +53 -0
- data/vendor/lexbor/source/lexbor/encoding/range.c +71 -0
- data/vendor/lexbor/source/lexbor/encoding/range.h +34 -0
- data/vendor/lexbor/source/lexbor/encoding/res.c +222 -0
- data/vendor/lexbor/source/lexbor/encoding/res.h +34 -0
- data/vendor/lexbor/source/lexbor/encoding/single.c +13748 -0
- data/vendor/lexbor/source/lexbor/encoding/single.h +116 -0
- data/vendor/lexbor/source/lexbor/html/base.h +44 -0
- data/vendor/lexbor/source/lexbor/html/config.cmake +3 -0
- data/vendor/lexbor/source/lexbor/html/encoding.c +574 -0
- data/vendor/lexbor/source/lexbor/html/encoding.h +106 -0
- data/vendor/lexbor/source/lexbor/html/html.h +107 -0
- data/vendor/lexbor/source/lexbor/html/interface.c +165 -0
- data/vendor/lexbor/source/lexbor/html/interface.h +186 -0
- data/vendor/lexbor/source/lexbor/html/interface_res.h +4449 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/anchor_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/anchor_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/area_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/area_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/audio_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/audio_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/base_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/base_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/body_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/body_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/br_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/br_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/button_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/button_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/canvas_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/canvas_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/d_list_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/d_list_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/data_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/data_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/data_list_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/data_list_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/details_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/details_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/dialog_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/dialog_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/directory_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/directory_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/div_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/div_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/document.c +444 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/document.h +256 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/element.c +64 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/element.h +54 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/embed_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/embed_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/field_set_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/field_set_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/font_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/font_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/form_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/form_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/frame_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/frame_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/frame_set_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/frame_set_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/head_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/head_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/heading_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/heading_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/hr_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/hr_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/html_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/html_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/iframe_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/iframe_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/image_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/image_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/input_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/input_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/label_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/label_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/legend_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/legend_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/li_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/li_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/link_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/link_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/map_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/map_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/marquee_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/marquee_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/media_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/media_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/menu_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/menu_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/meta_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/meta_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/meter_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/meter_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/mod_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/mod_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/o_list_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/o_list_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/object_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/object_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/opt_group_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/opt_group_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/option_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/option_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/output_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/output_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/paragraph_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/paragraph_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/param_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/param_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/picture_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/picture_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/pre_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/pre_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/progress_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/progress_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/quote_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/quote_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/script_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/script_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/select_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/select_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/slot_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/slot_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/source_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/source_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/span_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/span_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/style_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/style_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_caption_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_caption_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_cell_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_cell_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_col_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_col_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_row_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_row_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_section_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_section_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/template_element.c +46 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/template_element.h +38 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/text_area_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/text_area_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/time_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/time_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/title_element.c +133 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/title_element.h +42 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/track_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/track_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/u_list_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/u_list_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/unknown_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/unknown_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/video_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/video_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/window.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/window.h +34 -0
- data/vendor/lexbor/source/lexbor/html/node.c +14 -0
- data/vendor/lexbor/source/lexbor/html/node.h +67 -0
- data/vendor/lexbor/source/lexbor/html/parser.c +469 -0
- data/vendor/lexbor/source/lexbor/html/parser.h +170 -0
- data/vendor/lexbor/source/lexbor/html/serialize.c +1510 -0
- data/vendor/lexbor/source/lexbor/html/serialize.h +93 -0
- data/vendor/lexbor/source/lexbor/html/tag.h +103 -0
- data/vendor/lexbor/source/lexbor/html/tag_res.h +2262 -0
- data/vendor/lexbor/source/lexbor/html/token.c +386 -0
- data/vendor/lexbor/source/lexbor/html/token.h +130 -0
- data/vendor/lexbor/source/lexbor/html/token_attr.c +44 -0
- data/vendor/lexbor/source/lexbor/html/token_attr.h +67 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/error.c +28 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/error.h +141 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/res.h +4956 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state.c +2171 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state.h +225 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_comment.c +489 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_comment.h +27 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_doctype.c +1654 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_doctype.h +27 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_rawtext.c +303 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_rawtext.h +32 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_rcdata.c +311 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_rcdata.h +32 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_script.c +1209 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_script.h +32 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer.c +499 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer.h +343 -0
- data/vendor/lexbor/source/lexbor/html/tree/active_formatting.c +241 -0
- data/vendor/lexbor/source/lexbor/html/tree/active_formatting.h +117 -0
- data/vendor/lexbor/source/lexbor/html/tree/error.c +26 -0
- data/vendor/lexbor/source/lexbor/html/tree/error.h +114 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_body.c +62 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_frameset.c +63 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_body.c +82 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_frameset.c +88 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_head.c +222 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_head.c +144 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_html.c +166 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/foreign_content.c +358 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_body.c +1974 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_caption.c +158 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_cell.c +187 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_column_group.c +194 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_frameset.c +149 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head.c +374 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head_noscript.c +121 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_row.c +211 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_select.c +341 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_select_in_table.c +115 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table.c +451 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table_body.c +208 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table_text.c +127 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_template.c +189 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/initial.c +411 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/text.c +61 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode.h +135 -0
- data/vendor/lexbor/source/lexbor/html/tree/open_elements.c +251 -0
- data/vendor/lexbor/source/lexbor/html/tree/open_elements.h +105 -0
- data/vendor/lexbor/source/lexbor/html/tree/template_insertion.c +10 -0
- data/vendor/lexbor/source/lexbor/html/tree/template_insertion.h +100 -0
- data/vendor/lexbor/source/lexbor/html/tree.c +1726 -0
- data/vendor/lexbor/source/lexbor/html/tree.h +431 -0
- data/vendor/lexbor/source/lexbor/html/tree_res.h +111 -0
- data/vendor/lexbor/source/lexbor/ns/base.h +32 -0
- data/vendor/lexbor/source/lexbor/ns/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/ns/const.h +37 -0
- data/vendor/lexbor/source/lexbor/ns/ns.c +154 -0
- data/vendor/lexbor/source/lexbor/ns/ns.h +66 -0
- data/vendor/lexbor/source/lexbor/ns/res.h +97 -0
- data/vendor/lexbor/source/lexbor/ports/posix/config.cmake +11 -0
- data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/fs.c +236 -0
- data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/memory.c +33 -0
- data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/perf.c +158 -0
- data/vendor/lexbor/source/lexbor/ports/windows_nt/config.cmake +18 -0
- data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/fs.c +239 -0
- data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/memory.c +33 -0
- data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/perf.c +81 -0
- data/vendor/lexbor/source/lexbor/selectors/base.h +30 -0
- data/vendor/lexbor/source/lexbor/selectors/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/selectors/selectors.c +1591 -0
- data/vendor/lexbor/source/lexbor/selectors/selectors.h +71 -0
- data/vendor/lexbor/source/lexbor/tag/base.h +32 -0
- data/vendor/lexbor/source/lexbor/tag/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/tag/const.h +225 -0
- data/vendor/lexbor/source/lexbor/tag/res.h +562 -0
- data/vendor/lexbor/source/lexbor/tag/tag.c +144 -0
- data/vendor/lexbor/source/lexbor/tag/tag.h +123 -0
- data/vendor/lexbor/source/lexbor/utils/base.h +32 -0
- data/vendor/lexbor/source/lexbor/utils/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/utils/http.c +534 -0
- data/vendor/lexbor/source/lexbor/utils/http.h +90 -0
- data/vendor/lexbor/source/lexbor/utils/utils.h +15 -0
- data/vendor/lexbor/source/lexbor/utils/warc.c +817 -0
- data/vendor/lexbor/source/lexbor/utils/warc.h +126 -0
- data/vendor/lexbor/utils/lexbor/css/selectors/pseudo.py +231 -0
- data/vendor/lexbor/utils/lexbor/css/selectors/tmp/const.h +21 -0
- data/vendor/lexbor/utils/lexbor/css/selectors/tmp/res.h +26 -0
- data/vendor/lexbor/utils/lexbor/css/syntax/definitions.py +49 -0
- data/vendor/lexbor/utils/lexbor/css/syntax/token_res.py +54 -0
- data/vendor/lexbor/utils/lexbor/css/syntax/tokenizer_code_map.py +36 -0
- data/vendor/lexbor/version +1 -0
- metadata +542 -0
@@ -0,0 +1,363 @@
|
|
1
|
+
/*
|
2
|
+
* buf.c: memory buffers for libxml2
|
3
|
+
*
|
4
|
+
* new buffer structures and entry points to simplify the maintenance
|
5
|
+
* of libxml2 and ensure we keep good control over memory allocations
|
6
|
+
* and stay 64 bits clean.
|
7
|
+
* The new entry point use the xmlBufPtr opaque structure and
|
8
|
+
* xmlBuf...() counterparts to the old xmlBuf...() functions
|
9
|
+
*
|
10
|
+
* See Copyright for the status of this software.
|
11
|
+
*
|
12
|
+
* daniel@veillard.com
|
13
|
+
*/
|
14
|
+
|
15
|
+
#define IN_LIBXML
|
16
|
+
#include "libxml.h"
|
17
|
+
|
18
|
+
#include <string.h> /* for memset() only ! */
|
19
|
+
#include <limits.h>
|
20
|
+
#include <ctype.h>
|
21
|
+
#include <stdlib.h>
|
22
|
+
|
23
|
+
#include "libxml/tree.h"
|
24
|
+
#include "libxml/globals.h"
|
25
|
+
#include "libxml/parserInternals.h" /* for XML_MAX_TEXT_LENGTH */
|
26
|
+
|
27
|
+
#include "private/buf.h"
|
28
|
+
#include "private/error.h"
|
29
|
+
|
30
|
+
#ifndef SIZE_MAX
|
31
|
+
#define SIZE_MAX ((size_t) -1)
|
32
|
+
#endif
|
33
|
+
|
34
|
+
#define WITH_BUFFER_COMPAT
|
35
|
+
|
36
|
+
/**
|
37
|
+
* xmlBuf:
|
38
|
+
*
|
39
|
+
* A buffer structure. The base of the structure is somehow compatible
|
40
|
+
* with struct _xmlBuffer to limit risks on application which accessed
|
41
|
+
* directly the input->buf->buffer structures.
|
42
|
+
*/
|
43
|
+
|
44
|
+
struct _xmlBuf {
|
45
|
+
xmlChar *content; /* The buffer content UTF8 */
|
46
|
+
unsigned int compat_use; /* for binary compatibility */
|
47
|
+
unsigned int compat_size; /* for binary compatibility */
|
48
|
+
xmlBufferAllocationScheme alloc; /* The realloc method */
|
49
|
+
xmlChar *contentIO; /* in IO mode we may have a different base */
|
50
|
+
size_t use; /* The buffer size used */
|
51
|
+
size_t size; /* The buffer size */
|
52
|
+
xmlBufferPtr buffer; /* wrapper for an old buffer */
|
53
|
+
int error; /* an error code if a failure occurred */
|
54
|
+
};
|
55
|
+
|
56
|
+
#ifdef WITH_BUFFER_COMPAT
|
57
|
+
/*
|
58
|
+
* Macro for compatibility with xmlBuffer to be used after an xmlBuf
|
59
|
+
* is updated. This makes sure the compat fields are updated too.
|
60
|
+
*/
|
61
|
+
#define UPDATE_COMPAT(buf) \
|
62
|
+
if (buf->size < INT_MAX) buf->compat_size = buf->size; \
|
63
|
+
else buf->compat_size = INT_MAX; \
|
64
|
+
if (buf->use < INT_MAX) buf->compat_use = buf->use; \
|
65
|
+
else buf->compat_use = INT_MAX;
|
66
|
+
|
67
|
+
/*
|
68
|
+
* Macro for compatibility with xmlBuffer to be used in all the xmlBuf
|
69
|
+
* entry points, it checks that the compat fields have not been modified
|
70
|
+
* by direct call to xmlBuffer function from code compiled before 2.9.0 .
|
71
|
+
*/
|
72
|
+
#define CHECK_COMPAT(buf) \
|
73
|
+
if (buf->size != (size_t) buf->compat_size) \
|
74
|
+
if (buf->compat_size < INT_MAX) \
|
75
|
+
buf->size = buf->compat_size; \
|
76
|
+
if (buf->use != (size_t) buf->compat_use) \
|
77
|
+
if (buf->compat_use < INT_MAX) \
|
78
|
+
buf->use = buf->compat_use;
|
79
|
+
|
80
|
+
#else /* ! WITH_BUFFER_COMPAT */
|
81
|
+
#define UPDATE_COMPAT(buf)
|
82
|
+
#define CHECK_COMPAT(buf)
|
83
|
+
#endif /* WITH_BUFFER_COMPAT */
|
84
|
+
|
85
|
+
/**
|
86
|
+
* xmlBufMemoryError:
|
87
|
+
* @extra: extra information
|
88
|
+
*
|
89
|
+
* Handle an out of memory condition
|
90
|
+
* To be improved...
|
91
|
+
*/
|
92
|
+
static void
|
93
|
+
xmlBufMemoryError(xmlBufPtr buf, const char *extra)
|
94
|
+
{
|
95
|
+
__xmlSimpleError(XML_FROM_BUFFER, XML_ERR_NO_MEMORY, NULL, NULL, extra);
|
96
|
+
if ((buf) && (buf->error == 0))
|
97
|
+
buf->error = XML_ERR_NO_MEMORY;
|
98
|
+
}
|
99
|
+
|
100
|
+
/**
|
101
|
+
* xmlBufCreate:
|
102
|
+
*
|
103
|
+
* routine to create an XML buffer.
|
104
|
+
* returns the new structure.
|
105
|
+
*/
|
106
|
+
xmlBufPtr
|
107
|
+
xmlBufCreate(void) {
|
108
|
+
xmlBufPtr ret;
|
109
|
+
|
110
|
+
ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf));
|
111
|
+
if (ret == NULL) {
|
112
|
+
xmlBufMemoryError(NULL, "creating buffer");
|
113
|
+
return(NULL);
|
114
|
+
}
|
115
|
+
ret->use = 0;
|
116
|
+
ret->error = 0;
|
117
|
+
ret->buffer = NULL;
|
118
|
+
ret->size = xmlDefaultBufferSize;
|
119
|
+
UPDATE_COMPAT(ret);
|
120
|
+
ret->alloc = xmlBufferAllocScheme;
|
121
|
+
ret->content = (xmlChar *) xmlMallocAtomic(ret->size);
|
122
|
+
if (ret->content == NULL) {
|
123
|
+
xmlBufMemoryError(ret, "creating buffer");
|
124
|
+
xmlFree(ret);
|
125
|
+
return(NULL);
|
126
|
+
}
|
127
|
+
ret->content[0] = 0;
|
128
|
+
ret->contentIO = NULL;
|
129
|
+
return(ret);
|
130
|
+
}
|
131
|
+
|
132
|
+
/**
|
133
|
+
* xmlBufFree:
|
134
|
+
* @buf: the buffer to free
|
135
|
+
*
|
136
|
+
* Frees an XML buffer. It frees both the content and the structure which
|
137
|
+
* encapsulate it.
|
138
|
+
*/
|
139
|
+
void
|
140
|
+
xmlBufFree(xmlBufPtr buf) {
|
141
|
+
if (buf == NULL) {
|
142
|
+
#ifdef DEBUG_BUFFER
|
143
|
+
xmlGenericError(xmlGenericErrorContext,
|
144
|
+
"xmlBufFree: buf == NULL\n");
|
145
|
+
#endif
|
146
|
+
return;
|
147
|
+
}
|
148
|
+
|
149
|
+
if ((buf->alloc == XML_BUFFER_ALLOC_IO) &&
|
150
|
+
(buf->contentIO != NULL)) {
|
151
|
+
xmlFree(buf->contentIO);
|
152
|
+
} else if (buf->content != NULL) {
|
153
|
+
xmlFree(buf->content);
|
154
|
+
}
|
155
|
+
xmlFree(buf);
|
156
|
+
}
|
157
|
+
|
158
|
+
/**
|
159
|
+
* xmlBufContent:
|
160
|
+
* @buf: the buffer
|
161
|
+
*
|
162
|
+
* Function to extract the content of a buffer
|
163
|
+
*
|
164
|
+
* Returns the internal content
|
165
|
+
*/
|
166
|
+
|
167
|
+
xmlChar *
|
168
|
+
xmlBufContent(const xmlBuf *buf)
|
169
|
+
{
|
170
|
+
if ((!buf) || (buf->error))
|
171
|
+
return NULL;
|
172
|
+
|
173
|
+
return(buf->content);
|
174
|
+
}
|
175
|
+
|
176
|
+
/**
|
177
|
+
* xmlBufResize:
|
178
|
+
* @buf: the buffer to resize
|
179
|
+
* @size: the desired size
|
180
|
+
*
|
181
|
+
* Resize a buffer to accommodate minimum size of @size.
|
182
|
+
*
|
183
|
+
* Returns 0 in case of problems, 1 otherwise
|
184
|
+
*/
|
185
|
+
int
|
186
|
+
xmlBufResize(xmlBufPtr buf, size_t size)
|
187
|
+
{
|
188
|
+
size_t newSize;
|
189
|
+
xmlChar* rebuf = NULL;
|
190
|
+
size_t start_buf;
|
191
|
+
|
192
|
+
if ((buf == NULL) || (buf->error))
|
193
|
+
return(0);
|
194
|
+
CHECK_COMPAT(buf)
|
195
|
+
|
196
|
+
if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
|
197
|
+
/*
|
198
|
+
* Used to provide parsing limits
|
199
|
+
*/
|
200
|
+
if (size >= XML_MAX_TEXT_LENGTH) {
|
201
|
+
xmlBufMemoryError(buf, "buffer error: text too long\n");
|
202
|
+
return(0);
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
/* Don't resize if we don't have to */
|
207
|
+
if (size < buf->size)
|
208
|
+
return 1;
|
209
|
+
|
210
|
+
/* figure out new size */
|
211
|
+
switch (buf->alloc){
|
212
|
+
case XML_BUFFER_ALLOC_IO:
|
213
|
+
case XML_BUFFER_ALLOC_DOUBLEIT:
|
214
|
+
/*take care of empty case*/
|
215
|
+
if (buf->size == 0) {
|
216
|
+
newSize = (size > SIZE_MAX - 10 ? SIZE_MAX : size + 10);
|
217
|
+
} else {
|
218
|
+
newSize = buf->size;
|
219
|
+
}
|
220
|
+
while (size > newSize) {
|
221
|
+
if (newSize > SIZE_MAX / 2) {
|
222
|
+
xmlBufMemoryError(buf, "growing buffer");
|
223
|
+
return 0;
|
224
|
+
}
|
225
|
+
newSize *= 2;
|
226
|
+
}
|
227
|
+
break;
|
228
|
+
case XML_BUFFER_ALLOC_EXACT:
|
229
|
+
newSize = (size > SIZE_MAX - 10 ? SIZE_MAX : size + 10);
|
230
|
+
break;
|
231
|
+
case XML_BUFFER_ALLOC_HYBRID:
|
232
|
+
if (buf->use < BASE_BUFFER_SIZE)
|
233
|
+
newSize = size;
|
234
|
+
else {
|
235
|
+
newSize = buf->size;
|
236
|
+
while (size > newSize) {
|
237
|
+
if (newSize > SIZE_MAX / 2) {
|
238
|
+
xmlBufMemoryError(buf, "growing buffer");
|
239
|
+
return 0;
|
240
|
+
}
|
241
|
+
newSize *= 2;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
break;
|
245
|
+
|
246
|
+
default:
|
247
|
+
newSize = (size > SIZE_MAX - 10 ? SIZE_MAX : size + 10);
|
248
|
+
break;
|
249
|
+
}
|
250
|
+
|
251
|
+
if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
|
252
|
+
start_buf = buf->content - buf->contentIO;
|
253
|
+
|
254
|
+
if (start_buf > newSize) {
|
255
|
+
/* move data back to start */
|
256
|
+
memmove(buf->contentIO, buf->content, buf->use);
|
257
|
+
buf->content = buf->contentIO;
|
258
|
+
buf->content[buf->use] = 0;
|
259
|
+
buf->size += start_buf;
|
260
|
+
} else {
|
261
|
+
rebuf = (xmlChar *) xmlRealloc(buf->contentIO, start_buf + newSize);
|
262
|
+
if (rebuf == NULL) {
|
263
|
+
xmlBufMemoryError(buf, "growing buffer");
|
264
|
+
return 0;
|
265
|
+
}
|
266
|
+
buf->contentIO = rebuf;
|
267
|
+
buf->content = rebuf + start_buf;
|
268
|
+
}
|
269
|
+
} else {
|
270
|
+
if (buf->content == NULL) {
|
271
|
+
rebuf = (xmlChar *) xmlMallocAtomic(newSize);
|
272
|
+
buf->use = 0;
|
273
|
+
rebuf[buf->use] = 0;
|
274
|
+
} else if (buf->size - buf->use < 100) {
|
275
|
+
rebuf = (xmlChar *) xmlRealloc(buf->content, newSize);
|
276
|
+
} else {
|
277
|
+
/*
|
278
|
+
* if we are reallocating a buffer far from being full, it's
|
279
|
+
* better to make a new allocation and copy only the used range
|
280
|
+
* and free the old one.
|
281
|
+
*/
|
282
|
+
rebuf = (xmlChar *) xmlMallocAtomic(newSize);
|
283
|
+
if (rebuf != NULL) {
|
284
|
+
memcpy(rebuf, buf->content, buf->use);
|
285
|
+
xmlFree(buf->content);
|
286
|
+
rebuf[buf->use] = 0;
|
287
|
+
}
|
288
|
+
}
|
289
|
+
if (rebuf == NULL) {
|
290
|
+
xmlBufMemoryError(buf, "growing buffer");
|
291
|
+
return 0;
|
292
|
+
}
|
293
|
+
buf->content = rebuf;
|
294
|
+
}
|
295
|
+
buf->size = newSize;
|
296
|
+
UPDATE_COMPAT(buf)
|
297
|
+
|
298
|
+
return 1;
|
299
|
+
}
|
300
|
+
|
301
|
+
/**
|
302
|
+
* xmlBufAdd:
|
303
|
+
* @buf: the buffer to dump
|
304
|
+
* @str: the #xmlChar string
|
305
|
+
* @len: the number of #xmlChar to add
|
306
|
+
*
|
307
|
+
* Add a string range to an XML buffer. if len == -1, the length of
|
308
|
+
* str is recomputed.
|
309
|
+
*
|
310
|
+
* Returns 0 successful, a positive error code number otherwise
|
311
|
+
* and -1 in case of internal or API error.
|
312
|
+
*/
|
313
|
+
int
|
314
|
+
xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len) {
|
315
|
+
size_t needSize;
|
316
|
+
|
317
|
+
if ((str == NULL) || (buf == NULL) || (buf->error))
|
318
|
+
return -1;
|
319
|
+
CHECK_COMPAT(buf)
|
320
|
+
|
321
|
+
if (len < -1) {
|
322
|
+
#ifdef DEBUG_BUFFER
|
323
|
+
xmlGenericError(xmlGenericErrorContext,
|
324
|
+
"xmlBufAdd: len < 0\n");
|
325
|
+
#endif
|
326
|
+
return -1;
|
327
|
+
}
|
328
|
+
if (len == 0) return 0;
|
329
|
+
|
330
|
+
if (len < 0)
|
331
|
+
len = xmlStrlen(str);
|
332
|
+
|
333
|
+
if (len < 0) return -1;
|
334
|
+
if (len == 0) return 0;
|
335
|
+
|
336
|
+
/* Note that both buf->size and buf->use can be zero here. */
|
337
|
+
if ((size_t) len >= buf->size - buf->use) {
|
338
|
+
if ((size_t) len >= SIZE_MAX - buf->use) {
|
339
|
+
xmlBufMemoryError(buf, "growing buffer past SIZE_MAX");
|
340
|
+
return(-1);
|
341
|
+
}
|
342
|
+
needSize = buf->use + len + 1;
|
343
|
+
if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
|
344
|
+
/*
|
345
|
+
* Used to provide parsing limits
|
346
|
+
*/
|
347
|
+
if (needSize >= XML_MAX_TEXT_LENGTH) {
|
348
|
+
xmlBufMemoryError(buf, "buffer error: text too long\n");
|
349
|
+
return(-1);
|
350
|
+
}
|
351
|
+
}
|
352
|
+
if (!xmlBufResize(buf, needSize)){
|
353
|
+
xmlBufMemoryError(buf, "growing buffer");
|
354
|
+
return XML_ERR_NO_MEMORY;
|
355
|
+
}
|
356
|
+
}
|
357
|
+
|
358
|
+
memmove(&buf->content[buf->use], str, len);
|
359
|
+
buf->use += len;
|
360
|
+
buf->content[buf->use] = 0;
|
361
|
+
UPDATE_COMPAT(buf)
|
362
|
+
return 0;
|
363
|
+
}
|
@@ -0,0 +1,334 @@
|
|
1
|
+
/*
|
2
|
+
* chvalid.c: this module implements the character range
|
3
|
+
* validation APIs
|
4
|
+
*
|
5
|
+
* This file is automatically generated from the cvs source
|
6
|
+
* definition files using the genChRanges.py Python script
|
7
|
+
*
|
8
|
+
* Generation date: Mon Mar 27 11:09:48 2006
|
9
|
+
* Sources: chvalid.def
|
10
|
+
* William Brack <wbrack@mmm.com.hk>
|
11
|
+
*/
|
12
|
+
|
13
|
+
#define IN_LIBXML
|
14
|
+
#include "libxml.h"
|
15
|
+
#include "libxml/chvalid.h"
|
16
|
+
|
17
|
+
/*
|
18
|
+
* The initial tables ({func_name}_tab) are used to validate whether a
|
19
|
+
* single-byte character is within the specified group. Each table
|
20
|
+
* contains 256 bytes, with each byte representing one of the 256
|
21
|
+
* possible characters. If the table byte is set, the character is
|
22
|
+
* allowed.
|
23
|
+
*
|
24
|
+
*/
|
25
|
+
const unsigned char xmlIsPubidChar_tab[256] = {
|
26
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
|
27
|
+
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
28
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
|
29
|
+
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
30
|
+
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
31
|
+
0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
32
|
+
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
33
|
+
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
34
|
+
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
35
|
+
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
36
|
+
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
37
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
38
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
39
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
40
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
41
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
42
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
43
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
44
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
45
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
46
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
47
|
+
0x00, 0x00, 0x00, 0x00 };
|
48
|
+
|
49
|
+
static const xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131},
|
50
|
+
{0x134, 0x13e}, {0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3},
|
51
|
+
{0x1cd, 0x1f0}, {0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8},
|
52
|
+
{0x2bb, 0x2c1}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c},
|
53
|
+
{0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da},
|
54
|
+
{0x3dc, 0x3dc}, {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3},
|
55
|
+
{0x401, 0x40c}, {0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481},
|
56
|
+
{0x490, 0x4c4}, {0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb},
|
57
|
+
{0x4ee, 0x4f5}, {0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559},
|
58
|
+
{0x561, 0x586}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a},
|
59
|
+
{0x641, 0x64a}, {0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce},
|
60
|
+
{0x6d0, 0x6d3}, {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939},
|
61
|
+
{0x93d, 0x93d}, {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990},
|
62
|
+
{0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9},
|
63
|
+
{0x9dc, 0x9dd}, {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a},
|
64
|
+
{0xa0f, 0xa10}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33},
|
65
|
+
{0xa35, 0xa36}, {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e},
|
66
|
+
{0xa72, 0xa74}, {0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91},
|
67
|
+
{0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9},
|
68
|
+
{0xabd, 0xabd}, {0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10},
|
69
|
+
{0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39},
|
70
|
+
{0xb3d, 0xb3d}, {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a},
|
71
|
+
{0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c},
|
72
|
+
{0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5},
|
73
|
+
{0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28},
|
74
|
+
{0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c},
|
75
|
+
{0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9},
|
76
|
+
{0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10},
|
77
|
+
{0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e},
|
78
|
+
{0xe30, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82},
|
79
|
+
{0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d},
|
80
|
+
{0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5},
|
81
|
+
{0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0},
|
82
|
+
{0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47},
|
83
|
+
{0xf49, 0xf69}, {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100},
|
84
|
+
{0x1102, 0x1103}, {0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c},
|
85
|
+
{0x110e, 0x1112}, {0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140},
|
86
|
+
{0x114c, 0x114c}, {0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155},
|
87
|
+
{0x1159, 0x1159}, {0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165},
|
88
|
+
{0x1167, 0x1167}, {0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173},
|
89
|
+
{0x1175, 0x1175}, {0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab},
|
90
|
+
{0x11ae, 0x11af}, {0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2},
|
91
|
+
{0x11eb, 0x11eb}, {0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b},
|
92
|
+
{0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45},
|
93
|
+
{0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b},
|
94
|
+
{0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc},
|
95
|
+
{0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3},
|
96
|
+
{0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc},
|
97
|
+
{0x2126, 0x2126}, {0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182},
|
98
|
+
{0x3041, 0x3094}, {0x30a1, 0x30fa}, {0x3105, 0x312c}, {0xac00, 0xd7a3}};
|
99
|
+
const xmlChRangeGroup xmlIsBaseCharGroup =
|
100
|
+
{197, 0, xmlIsBaseChar_srng, (xmlChLRangePtr)0};
|
101
|
+
|
102
|
+
static const xmlChSRange xmlIsChar_srng[] = { {0x100, 0xd7ff},
|
103
|
+
{0xe000, 0xfffd}};
|
104
|
+
static const xmlChLRange xmlIsChar_lrng[] = { {0x10000, 0x10ffff}};
|
105
|
+
const xmlChRangeGroup xmlIsCharGroup =
|
106
|
+
{2, 1, xmlIsChar_srng, xmlIsChar_lrng};
|
107
|
+
|
108
|
+
static const xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345},
|
109
|
+
{0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9},
|
110
|
+
{0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4},
|
111
|
+
{0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df},
|
112
|
+
{0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903},
|
113
|
+
{0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954},
|
114
|
+
{0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be},
|
115
|
+
{0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd},
|
116
|
+
{0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c},
|
117
|
+
{0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48},
|
118
|
+
{0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc},
|
119
|
+
{0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03},
|
120
|
+
{0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d},
|
121
|
+
{0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8},
|
122
|
+
{0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44},
|
123
|
+
{0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83},
|
124
|
+
{0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6},
|
125
|
+
{0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d},
|
126
|
+
{0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e},
|
127
|
+
{0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd},
|
128
|
+
{0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39},
|
129
|
+
{0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b},
|
130
|
+
{0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7},
|
131
|
+
{0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f},
|
132
|
+
{0x3099, 0x3099}, {0x309a, 0x309a}};
|
133
|
+
const xmlChRangeGroup xmlIsCombiningGroup =
|
134
|
+
{95, 0, xmlIsCombining_srng, (xmlChLRangePtr)0};
|
135
|
+
|
136
|
+
static const xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669},
|
137
|
+
{0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f},
|
138
|
+
{0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f},
|
139
|
+
{0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9},
|
140
|
+
{0xf20, 0xf29}};
|
141
|
+
const xmlChRangeGroup xmlIsDigitGroup =
|
142
|
+
{14, 0, xmlIsDigit_srng, (xmlChLRangePtr)0};
|
143
|
+
|
144
|
+
static const xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0},
|
145
|
+
{0x2d1, 0x2d1}, {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46},
|
146
|
+
{0xec6, 0xec6}, {0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e},
|
147
|
+
{0x30fc, 0x30fe}};
|
148
|
+
const xmlChRangeGroup xmlIsExtenderGroup =
|
149
|
+
{10, 0, xmlIsExtender_srng, (xmlChLRangePtr)0};
|
150
|
+
|
151
|
+
static const xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007},
|
152
|
+
{0x3021, 0x3029}, {0x4e00, 0x9fa5}};
|
153
|
+
const xmlChRangeGroup xmlIsIdeographicGroup =
|
154
|
+
{3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0};
|
155
|
+
|
156
|
+
|
157
|
+
/**
|
158
|
+
* xmlCharInRange:
|
159
|
+
* @val: character to be validated
|
160
|
+
* @rptr: pointer to range to be used to validate
|
161
|
+
*
|
162
|
+
* Does a binary search of the range table to determine if char
|
163
|
+
* is valid
|
164
|
+
*
|
165
|
+
* Returns: true if character valid, false otherwise
|
166
|
+
*/
|
167
|
+
int
|
168
|
+
xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
|
169
|
+
int low, high, mid;
|
170
|
+
const xmlChSRange *sptr;
|
171
|
+
const xmlChLRange *lptr;
|
172
|
+
|
173
|
+
if (rptr == NULL) return(0);
|
174
|
+
if (val < 0x10000) { /* is val in 'short' or 'long' array? */
|
175
|
+
if (rptr->nbShortRange == 0)
|
176
|
+
return 0;
|
177
|
+
low = 0;
|
178
|
+
high = rptr->nbShortRange - 1;
|
179
|
+
sptr = rptr->shortRange;
|
180
|
+
while (low <= high) {
|
181
|
+
mid = (low + high) / 2;
|
182
|
+
if ((unsigned short) val < sptr[mid].low) {
|
183
|
+
high = mid - 1;
|
184
|
+
} else {
|
185
|
+
if ((unsigned short) val > sptr[mid].high) {
|
186
|
+
low = mid + 1;
|
187
|
+
} else {
|
188
|
+
return 1;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
} else {
|
193
|
+
if (rptr->nbLongRange == 0) {
|
194
|
+
return 0;
|
195
|
+
}
|
196
|
+
low = 0;
|
197
|
+
high = rptr->nbLongRange - 1;
|
198
|
+
lptr = rptr->longRange;
|
199
|
+
while (low <= high) {
|
200
|
+
mid = (low + high) / 2;
|
201
|
+
if (val < lptr[mid].low) {
|
202
|
+
high = mid - 1;
|
203
|
+
} else {
|
204
|
+
if (val > lptr[mid].high) {
|
205
|
+
low = mid + 1;
|
206
|
+
} else {
|
207
|
+
return 1;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
212
|
+
return 0;
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
/**
|
217
|
+
* xmlIsBaseChar:
|
218
|
+
* @ch: character to validate
|
219
|
+
*
|
220
|
+
* This function is DEPRECATED.
|
221
|
+
* Use xmlIsBaseChar_ch or xmlIsBaseCharQ instead
|
222
|
+
*
|
223
|
+
* Returns true if argument valid, false otherwise
|
224
|
+
*/
|
225
|
+
int
|
226
|
+
xmlIsBaseChar(unsigned int ch) {
|
227
|
+
return(xmlIsBaseCharQ(ch));
|
228
|
+
}
|
229
|
+
|
230
|
+
|
231
|
+
/**
|
232
|
+
* xmlIsBlank:
|
233
|
+
* @ch: character to validate
|
234
|
+
*
|
235
|
+
* This function is DEPRECATED.
|
236
|
+
* Use xmlIsBlank_ch or xmlIsBlankQ instead
|
237
|
+
*
|
238
|
+
* Returns true if argument valid, false otherwise
|
239
|
+
*/
|
240
|
+
int
|
241
|
+
xmlIsBlank(unsigned int ch) {
|
242
|
+
return(xmlIsBlankQ(ch));
|
243
|
+
}
|
244
|
+
|
245
|
+
|
246
|
+
/**
|
247
|
+
* xmlIsChar:
|
248
|
+
* @ch: character to validate
|
249
|
+
*
|
250
|
+
* This function is DEPRECATED.
|
251
|
+
* Use xmlIsChar_ch or xmlIsCharQ instead
|
252
|
+
*
|
253
|
+
* Returns true if argument valid, false otherwise
|
254
|
+
*/
|
255
|
+
int
|
256
|
+
xmlIsChar(unsigned int ch) {
|
257
|
+
return(xmlIsCharQ(ch));
|
258
|
+
}
|
259
|
+
|
260
|
+
|
261
|
+
/**
|
262
|
+
* xmlIsCombining:
|
263
|
+
* @ch: character to validate
|
264
|
+
*
|
265
|
+
* This function is DEPRECATED.
|
266
|
+
* Use xmlIsCombiningQ instead
|
267
|
+
*
|
268
|
+
* Returns true if argument valid, false otherwise
|
269
|
+
*/
|
270
|
+
int
|
271
|
+
xmlIsCombining(unsigned int ch) {
|
272
|
+
return(xmlIsCombiningQ(ch));
|
273
|
+
}
|
274
|
+
|
275
|
+
|
276
|
+
/**
|
277
|
+
* xmlIsDigit:
|
278
|
+
* @ch: character to validate
|
279
|
+
*
|
280
|
+
* This function is DEPRECATED.
|
281
|
+
* Use xmlIsDigit_ch or xmlIsDigitQ instead
|
282
|
+
*
|
283
|
+
* Returns true if argument valid, false otherwise
|
284
|
+
*/
|
285
|
+
int
|
286
|
+
xmlIsDigit(unsigned int ch) {
|
287
|
+
return(xmlIsDigitQ(ch));
|
288
|
+
}
|
289
|
+
|
290
|
+
|
291
|
+
/**
|
292
|
+
* xmlIsExtender:
|
293
|
+
* @ch: character to validate
|
294
|
+
*
|
295
|
+
* This function is DEPRECATED.
|
296
|
+
* Use xmlIsExtender_ch or xmlIsExtenderQ instead
|
297
|
+
*
|
298
|
+
* Returns true if argument valid, false otherwise
|
299
|
+
*/
|
300
|
+
int
|
301
|
+
xmlIsExtender(unsigned int ch) {
|
302
|
+
return(xmlIsExtenderQ(ch));
|
303
|
+
}
|
304
|
+
|
305
|
+
|
306
|
+
/**
|
307
|
+
* xmlIsIdeographic:
|
308
|
+
* @ch: character to validate
|
309
|
+
*
|
310
|
+
* This function is DEPRECATED.
|
311
|
+
* Use xmlIsIdeographicQ instead
|
312
|
+
*
|
313
|
+
* Returns true if argument valid, false otherwise
|
314
|
+
*/
|
315
|
+
int
|
316
|
+
xmlIsIdeographic(unsigned int ch) {
|
317
|
+
return(xmlIsIdeographicQ(ch));
|
318
|
+
}
|
319
|
+
|
320
|
+
|
321
|
+
/**
|
322
|
+
* xmlIsPubidChar:
|
323
|
+
* @ch: character to validate
|
324
|
+
*
|
325
|
+
* This function is DEPRECATED.
|
326
|
+
* Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead
|
327
|
+
*
|
328
|
+
* Returns true if argument valid, false otherwise
|
329
|
+
*/
|
330
|
+
int
|
331
|
+
xmlIsPubidChar(unsigned int ch) {
|
332
|
+
return(xmlIsPubidCharQ(ch));
|
333
|
+
}
|
334
|
+
|