nokogiri 1.16.7-aarch64-linux → 1.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +11 -21
- data/LICENSE-DEPENDENCIES.md +6 -6
- data/README.md +8 -5
- data/dependencies.yml +6 -6
- data/ext/nokogiri/extconf.rb +188 -142
- data/ext/nokogiri/gumbo.c +69 -53
- data/ext/nokogiri/html4_document.c +10 -4
- data/ext/nokogiri/html4_element_description.c +18 -18
- data/ext/nokogiri/html4_sax_parser.c +40 -0
- data/ext/nokogiri/html4_sax_parser_context.c +48 -58
- data/ext/nokogiri/html4_sax_push_parser.c +25 -24
- data/ext/nokogiri/libxml2_polyfill.c +114 -0
- data/ext/nokogiri/nokogiri.c +9 -2
- data/ext/nokogiri/nokogiri.h +18 -33
- data/ext/nokogiri/xml_attr.c +1 -1
- data/ext/nokogiri/xml_cdata.c +2 -10
- data/ext/nokogiri/xml_comment.c +3 -8
- data/ext/nokogiri/xml_document.c +163 -156
- data/ext/nokogiri/xml_document_fragment.c +10 -25
- data/ext/nokogiri/xml_dtd.c +1 -1
- data/ext/nokogiri/xml_element_content.c +9 -9
- data/ext/nokogiri/xml_encoding_handler.c +4 -4
- data/ext/nokogiri/xml_namespace.c +6 -6
- data/ext/nokogiri/xml_node.c +141 -104
- data/ext/nokogiri/xml_node_set.c +46 -44
- data/ext/nokogiri/xml_reader.c +54 -58
- data/ext/nokogiri/xml_relax_ng.c +35 -56
- data/ext/nokogiri/xml_sax_parser.c +156 -88
- data/ext/nokogiri/xml_sax_parser_context.c +219 -131
- data/ext/nokogiri/xml_sax_push_parser.c +68 -49
- data/ext/nokogiri/xml_schema.c +50 -85
- data/ext/nokogiri/xml_syntax_error.c +19 -11
- data/ext/nokogiri/xml_text.c +2 -4
- data/ext/nokogiri/xml_xpath_context.c +103 -100
- data/ext/nokogiri/xslt_stylesheet.c +8 -8
- data/gumbo-parser/src/Makefile +34 -0
- data/gumbo-parser/src/README.md +41 -0
- data/gumbo-parser/src/ascii.c +75 -0
- data/gumbo-parser/src/ascii.h +115 -0
- data/gumbo-parser/src/attribute.c +42 -0
- data/gumbo-parser/src/attribute.h +17 -0
- data/gumbo-parser/src/char_ref.c +22225 -0
- data/gumbo-parser/src/char_ref.h +29 -0
- data/gumbo-parser/src/char_ref.rl +2154 -0
- data/gumbo-parser/src/error.c +658 -0
- data/gumbo-parser/src/error.h +152 -0
- data/gumbo-parser/src/foreign_attrs.c +103 -0
- data/gumbo-parser/src/foreign_attrs.gperf +27 -0
- data/gumbo-parser/src/insertion_mode.h +33 -0
- data/gumbo-parser/src/macros.h +91 -0
- data/gumbo-parser/src/nokogiri_gumbo.h +953 -0
- data/gumbo-parser/src/parser.c +4932 -0
- data/gumbo-parser/src/parser.h +41 -0
- data/gumbo-parser/src/replacement.h +33 -0
- data/gumbo-parser/src/string_buffer.c +103 -0
- data/gumbo-parser/src/string_buffer.h +68 -0
- data/gumbo-parser/src/string_piece.c +48 -0
- data/gumbo-parser/src/svg_attrs.c +174 -0
- data/gumbo-parser/src/svg_attrs.gperf +77 -0
- data/gumbo-parser/src/svg_tags.c +137 -0
- data/gumbo-parser/src/svg_tags.gperf +55 -0
- data/gumbo-parser/src/tag.c +223 -0
- data/gumbo-parser/src/tag_lookup.c +382 -0
- data/gumbo-parser/src/tag_lookup.gperf +170 -0
- data/gumbo-parser/src/tag_lookup.h +13 -0
- data/gumbo-parser/src/token_buffer.c +79 -0
- data/gumbo-parser/src/token_buffer.h +71 -0
- data/gumbo-parser/src/token_type.h +17 -0
- data/gumbo-parser/src/tokenizer.c +3464 -0
- data/gumbo-parser/src/tokenizer.h +112 -0
- data/gumbo-parser/src/tokenizer_states.h +339 -0
- data/gumbo-parser/src/utf8.c +245 -0
- data/gumbo-parser/src/utf8.h +164 -0
- data/gumbo-parser/src/util.c +66 -0
- data/gumbo-parser/src/util.h +34 -0
- data/gumbo-parser/src/vector.c +111 -0
- data/gumbo-parser/src/vector.h +45 -0
- data/lib/nokogiri/class_resolver.rb +1 -1
- data/lib/nokogiri/css/node.rb +6 -2
- data/lib/nokogiri/css/parser.rb +6 -4
- data/lib/nokogiri/css/parser.y +2 -2
- data/lib/nokogiri/css/parser_extras.rb +6 -66
- data/lib/nokogiri/css/selector_cache.rb +38 -0
- data/lib/nokogiri/css/tokenizer.rb +4 -4
- data/lib/nokogiri/css/tokenizer.rex +9 -8
- data/lib/nokogiri/css/xpath_visitor.rb +43 -6
- data/lib/nokogiri/css.rb +86 -20
- data/lib/nokogiri/decorators/slop.rb +3 -5
- data/lib/nokogiri/encoding_handler.rb +2 -2
- data/lib/nokogiri/html4/document.rb +44 -23
- data/lib/nokogiri/html4/document_fragment.rb +124 -12
- data/lib/nokogiri/html4/encoding_reader.rb +1 -1
- data/lib/nokogiri/html4/sax/parser.rb +23 -38
- data/lib/nokogiri/html4/sax/parser_context.rb +4 -9
- data/lib/nokogiri/html4.rb +9 -14
- data/lib/nokogiri/html5/builder.rb +40 -0
- data/lib/nokogiri/html5/document.rb +61 -30
- data/lib/nokogiri/html5/document_fragment.rb +130 -20
- data/lib/nokogiri/html5/node.rb +4 -4
- data/lib/nokogiri/html5.rb +114 -72
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/xml/builder.rb +8 -1
- data/lib/nokogiri/xml/document.rb +70 -26
- data/lib/nokogiri/xml/document_fragment.rb +84 -13
- data/lib/nokogiri/xml/node.rb +82 -11
- data/lib/nokogiri/xml/node_set.rb +9 -7
- data/lib/nokogiri/xml/parse_options.rb +1 -1
- data/lib/nokogiri/xml/pp/node.rb +6 -1
- data/lib/nokogiri/xml/reader.rb +46 -13
- data/lib/nokogiri/xml/relax_ng.rb +57 -20
- data/lib/nokogiri/xml/sax/document.rb +174 -83
- data/lib/nokogiri/xml/sax/parser.rb +115 -41
- data/lib/nokogiri/xml/sax/parser_context.rb +116 -8
- data/lib/nokogiri/xml/sax/push_parser.rb +3 -0
- data/lib/nokogiri/xml/sax.rb +48 -0
- data/lib/nokogiri/xml/schema.rb +112 -45
- data/lib/nokogiri/xml/searchable.rb +38 -42
- data/lib/nokogiri/xml/syntax_error.rb +22 -0
- data/lib/nokogiri/xml/xpath_context.rb +14 -3
- data/lib/nokogiri/xml.rb +13 -24
- data/lib/nokogiri/xslt.rb +3 -9
- data/lib/xsd/xmlparser/nokogiri.rb +3 -4
- data/patches/libxml2/0001-Remove-script-macro-support.patch +40 -0
- data/patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch +44 -0
- data/patches/libxml2/0009-allow-wildcard-namespaces.patch +77 -0
- data/patches/libxml2/0010-update-config.guess-and-config.sub-for-libxml2.patch +224 -0
- data/patches/libxml2/0011-rip-out-libxml2-s-libc_single_threaded-support.patch +30 -0
- data/patches/libxml2/0019-xpath-Use-separate-static-hash-table-for-standard-fu.patch +244 -0
- data/patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch +224 -0
- data/ports/archives/libxml2-2.13.6.tar.xz +0 -0
- data/ports/archives/libxslt-1.1.42.tar.xz +0 -0
- metadata +78 -89
- data/ext/nokogiri/include/libexslt/exslt.h +0 -108
- data/ext/nokogiri/include/libexslt/exsltconfig.h +0 -70
- data/ext/nokogiri/include/libexslt/exsltexports.h +0 -63
- data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +0 -343
- data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +0 -147
- data/ext/nokogiri/include/libxml2/libxml/SAX.h +0 -202
- data/ext/nokogiri/include/libxml2/libxml/SAX2.h +0 -171
- data/ext/nokogiri/include/libxml2/libxml/c14n.h +0 -126
- data/ext/nokogiri/include/libxml2/libxml/catalog.h +0 -182
- data/ext/nokogiri/include/libxml2/libxml/chvalid.h +0 -230
- data/ext/nokogiri/include/libxml2/libxml/debugXML.h +0 -217
- data/ext/nokogiri/include/libxml2/libxml/dict.h +0 -82
- data/ext/nokogiri/include/libxml2/libxml/encoding.h +0 -235
- data/ext/nokogiri/include/libxml2/libxml/entities.h +0 -155
- data/ext/nokogiri/include/libxml2/libxml/globals.h +0 -41
- data/ext/nokogiri/include/libxml2/libxml/hash.h +0 -232
- data/ext/nokogiri/include/libxml2/libxml/list.h +0 -137
- data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +0 -186
- data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +0 -81
- data/ext/nokogiri/include/libxml2/libxml/parser.h +0 -1384
- data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +0 -663
- data/ext/nokogiri/include/libxml2/libxml/pattern.h +0 -100
- data/ext/nokogiri/include/libxml2/libxml/relaxng.h +0 -219
- data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +0 -959
- data/ext/nokogiri/include/libxml2/libxml/schematron.h +0 -143
- data/ext/nokogiri/include/libxml2/libxml/threads.h +0 -87
- data/ext/nokogiri/include/libxml2/libxml/tree.h +0 -1362
- data/ext/nokogiri/include/libxml2/libxml/uri.h +0 -95
- data/ext/nokogiri/include/libxml2/libxml/valid.h +0 -450
- data/ext/nokogiri/include/libxml2/libxml/xinclude.h +0 -129
- data/ext/nokogiri/include/libxml2/libxml/xlink.h +0 -189
- data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +0 -421
- data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +0 -146
- data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +0 -948
- data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +0 -50
- data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +0 -225
- data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +0 -57
- data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +0 -434
- data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +0 -215
- data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +0 -97
- data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +0 -249
- data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +0 -152
- data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +0 -140
- data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +0 -202
- data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +0 -511
- data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +0 -488
- data/ext/nokogiri/include/libxml2/libxml/xpath.h +0 -575
- data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +0 -633
- data/ext/nokogiri/include/libxml2/libxml/xpointer.h +0 -138
- data/ext/nokogiri/include/libxslt/attributes.h +0 -39
- data/ext/nokogiri/include/libxslt/documents.h +0 -93
- data/ext/nokogiri/include/libxslt/extensions.h +0 -262
- data/ext/nokogiri/include/libxslt/extra.h +0 -72
- data/ext/nokogiri/include/libxslt/functions.h +0 -78
- data/ext/nokogiri/include/libxslt/imports.h +0 -75
- data/ext/nokogiri/include/libxslt/keys.h +0 -53
- data/ext/nokogiri/include/libxslt/namespaces.h +0 -68
- data/ext/nokogiri/include/libxslt/numbersInternals.h +0 -73
- data/ext/nokogiri/include/libxslt/pattern.h +0 -84
- data/ext/nokogiri/include/libxslt/preproc.h +0 -43
- data/ext/nokogiri/include/libxslt/security.h +0 -104
- data/ext/nokogiri/include/libxslt/templates.h +0 -77
- data/ext/nokogiri/include/libxslt/transform.h +0 -207
- data/ext/nokogiri/include/libxslt/variables.h +0 -118
- data/ext/nokogiri/include/libxslt/xslt.h +0 -110
- data/ext/nokogiri/include/libxslt/xsltInternals.h +0 -1992
- data/ext/nokogiri/include/libxslt/xsltconfig.h +0 -179
- data/ext/nokogiri/include/libxslt/xsltexports.h +0 -64
- data/ext/nokogiri/include/libxslt/xsltlocale.h +0 -44
- data/ext/nokogiri/include/libxslt/xsltutils.h +0 -343
- data/ext/nokogiri/libxml2_backwards_compat.c +0 -121
- data/lib/nokogiri/3.0/nokogiri.so +0 -0
- data/lib/nokogiri/3.1/nokogiri.so +0 -0
- data/lib/nokogiri/3.2/nokogiri.so +0 -0
- data/lib/nokogiri/3.3/nokogiri.so +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
From 27e4aa8d885e47a296ea78d114dbbe8fc7aa3508 Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Kevin Solorio <soloriok@gmail.com>
|
|
3
|
+
Date: Fri, 1 Feb 2019 14:32:42 -0800
|
|
4
|
+
Subject: [PATCH] Revert-support-html-h-b-7-1
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
entities.c | 17 -----------------
|
|
8
|
+
1 file changed, 17 deletions(-)
|
|
9
|
+
|
|
10
|
+
diff --git a/entities.c b/entities.c
|
|
11
|
+
index 43549bc5..82652f6d 100644
|
|
12
|
+
--- a/entities.c
|
|
13
|
+
+++ b/entities.c
|
|
14
|
+
@@ -623,23 +623,6 @@ xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) {
|
|
15
|
+
*out++ = 't';
|
|
16
|
+
*out++ = ';';
|
|
17
|
+
} else if (*cur == '&') {
|
|
18
|
+
- /*
|
|
19
|
+
- * Special handling of &{...} construct from HTML 4, see
|
|
20
|
+
- * http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1
|
|
21
|
+
- */
|
|
22
|
+
- if (html && attr && (cur[1] == '{') &&
|
|
23
|
+
- (strchr((const char *) cur, '}'))) {
|
|
24
|
+
- while (*cur != '}') {
|
|
25
|
+
- *out++ = *cur++;
|
|
26
|
+
- indx = out - buffer;
|
|
27
|
+
- if (indx + 100 > buffer_size) {
|
|
28
|
+
- growBufferReentrant();
|
|
29
|
+
- out = &buffer[indx];
|
|
30
|
+
- }
|
|
31
|
+
- }
|
|
32
|
+
- *out++ = *cur++;
|
|
33
|
+
- continue;
|
|
34
|
+
- }
|
|
35
|
+
*out++ = '&';
|
|
36
|
+
*out++ = 'a';
|
|
37
|
+
*out++ = 'm';
|
|
38
|
+
--
|
|
39
|
+
2.16.2
|
|
40
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
From ffc08467744bd2305d41ca882c37fa30adf3a067 Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Kevin Solorio <soloriok@gmail.com>
|
|
3
|
+
Date: Wed, 27 Feb 2019 14:34:17 -0800
|
|
4
|
+
Subject: [PATCH 2/2] update entities.c to remove handling of ssi
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
entities.c | 21 ---------------------
|
|
8
|
+
1 file changed, 21 deletions(-)
|
|
9
|
+
|
|
10
|
+
diff --git a/entities.c b/entities.c
|
|
11
|
+
index 43549bc5..5c4a2a60 100644
|
|
12
|
+
--- a/entities.c
|
|
13
|
+
+++ b/entities.c
|
|
14
|
+
@@ -592,27 +592,6 @@ xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) {
|
|
15
|
+
* By default one have to encode at least '<', '>', '"' and '&' !
|
|
16
|
+
*/
|
|
17
|
+
if (*cur == '<') {
|
|
18
|
+
- const xmlChar *end;
|
|
19
|
+
-
|
|
20
|
+
- /*
|
|
21
|
+
- * Special handling of server side include in HTML attributes
|
|
22
|
+
- */
|
|
23
|
+
- if (html && attr &&
|
|
24
|
+
- (cur[1] == '!') && (cur[2] == '-') && (cur[3] == '-') &&
|
|
25
|
+
- ((end = xmlStrstr(cur, BAD_CAST "-->")) != NULL)) {
|
|
26
|
+
- while (cur != end) {
|
|
27
|
+
- *out++ = *cur++;
|
|
28
|
+
- indx = out - buffer;
|
|
29
|
+
- if (indx + 100 > buffer_size) {
|
|
30
|
+
- growBufferReentrant();
|
|
31
|
+
- out = &buffer[indx];
|
|
32
|
+
- }
|
|
33
|
+
- }
|
|
34
|
+
- *out++ = *cur++;
|
|
35
|
+
- *out++ = *cur++;
|
|
36
|
+
- *out++ = *cur++;
|
|
37
|
+
- continue;
|
|
38
|
+
- }
|
|
39
|
+
*out++ = '&';
|
|
40
|
+
*out++ = 'l';
|
|
41
|
+
*out++ = 't';
|
|
42
|
+
--
|
|
43
|
+
2.16.2
|
|
44
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
From 74c95ec5932c737d4fcb06b8646b0017364ada14 Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Mike Dalessio <mike.dalessio@gmail.com>
|
|
3
|
+
Date: Fri, 24 Dec 2021 19:08:01 -0500
|
|
4
|
+
Subject: [PATCH] attempt to hack in wildcard namespaces to xpath
|
|
5
|
+
|
|
6
|
+
I'm not confident this is a bulletproof patch.
|
|
7
|
+
---
|
|
8
|
+
xpath.c | 24 ++++++++++++++++++------
|
|
9
|
+
1 file changed, 18 insertions(+), 6 deletions(-)
|
|
10
|
+
|
|
11
|
+
diff --git a/xpath.c b/xpath.c
|
|
12
|
+
index 1aa2f1a..c7f0885 100644
|
|
13
|
+
--- a/xpath.c
|
|
14
|
+
+++ b/xpath.c
|
|
15
|
+
@@ -146,6 +146,9 @@
|
|
16
|
+
#define XPATH_MAX_RECURSION_DEPTH 5000
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
+#define WILDCARD_PREFIX "*"
|
|
20
|
+
+#define IS_WILDCARD_PREFIX(p) xmlStrEqual((xmlChar*)WILDCARD_PREFIX, p)
|
|
21
|
+
+
|
|
22
|
+
/*
|
|
23
|
+
* TODO:
|
|
24
|
+
* There are a few spots where some tests are done which depend upon ascii
|
|
25
|
+
@@ -11073,12 +11076,15 @@ xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test,
|
|
26
|
+
SKIP_BLANKS;
|
|
27
|
+
|
|
28
|
+
if ((name == NULL) && (CUR == '*')) {
|
|
29
|
+
- /*
|
|
30
|
+
- * All elements
|
|
31
|
+
- */
|
|
32
|
+
NEXT;
|
|
33
|
+
- *test = NODE_TEST_ALL;
|
|
34
|
+
- return(NULL);
|
|
35
|
+
+ if (CUR != ':') {
|
|
36
|
+
+ /*
|
|
37
|
+
+ * All elements
|
|
38
|
+
+ */
|
|
39
|
+
+ *test = NODE_TEST_ALL;
|
|
40
|
+
+ return(NULL);
|
|
41
|
+
+ }
|
|
42
|
+
+ name = xmlCharStrdup(WILDCARD_PREFIX);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (name == NULL)
|
|
46
|
+
@@ -11327,6 +11333,10 @@ xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
|
|
47
|
+
}
|
|
48
|
+
#endif
|
|
49
|
+
if (CUR == '*') {
|
|
50
|
+
+ if (NXT(1) == ':') {
|
|
51
|
+
+ NEXT;
|
|
52
|
+
+ name = xmlCharStrdup(WILDCARD_PREFIX);
|
|
53
|
+
+ }
|
|
54
|
+
axis = AXIS_CHILD;
|
|
55
|
+
} else {
|
|
56
|
+
if (name == NULL)
|
|
57
|
+
@@ -12030,7 +12040,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
|
|
58
|
+
/*
|
|
59
|
+
* Setup namespaces.
|
|
60
|
+
*/
|
|
61
|
+
- if (prefix != NULL) {
|
|
62
|
+
+ if (prefix != NULL && !IS_WILDCARD_PREFIX(prefix)) {
|
|
63
|
+
URI = xmlXPathNsLookup(xpctxt, prefix);
|
|
64
|
+
if (URI == NULL) {
|
|
65
|
+
xmlXPathReleaseObject(xpctxt, obj);
|
|
66
|
+
@@ -12369,6 +12379,8 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
|
|
67
|
+
{
|
|
68
|
+
XP_TEST_HIT
|
|
69
|
+
}
|
|
70
|
+
+ } else if (IS_WILDCARD_PREFIX(prefix)) {
|
|
71
|
+
+ XP_TEST_HIT
|
|
72
|
+
} else {
|
|
73
|
+
if ((cur->ns != NULL) &&
|
|
74
|
+
(xmlStrEqual(URI, cur->ns->href)))
|
|
75
|
+
--
|
|
76
|
+
2.31.0
|
|
77
|
+
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
From 27578ad4e4960beb30bfef38bfc23ec2ab9d7ee1 Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Wenlong Zhang <zhangwenlong@loongson.cn>
|
|
3
|
+
Date: Tue, 14 Mar 2023 01:38:58 +0000
|
|
4
|
+
Subject: [PATCH] update config.guess and config.sub for libxml2
|
|
5
|
+
|
|
6
|
+
curl -sL -o config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
|
|
7
|
+
curl -sL -o config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
|
|
8
|
+
---
|
|
9
|
+
config.guess | 46 +++++++++++++++++++++++++++++++++-------------
|
|
10
|
+
config.sub | 35 ++++++++++++++++++++++++++---------
|
|
11
|
+
2 files changed, 59 insertions(+), 22 deletions(-)
|
|
12
|
+
|
|
13
|
+
diff --git a/config.guess b/config.guess
|
|
14
|
+
index 7f76b62..69188da 100755
|
|
15
|
+
--- a/config.guess
|
|
16
|
+
+++ b/config.guess
|
|
17
|
+
@@ -1,10 +1,10 @@
|
|
18
|
+
#! /bin/sh
|
|
19
|
+
# Attempt to guess a canonical system name.
|
|
20
|
+
-# Copyright 1992-2022 Free Software Foundation, Inc.
|
|
21
|
+
+# Copyright 1992-2023 Free Software Foundation, Inc.
|
|
22
|
+
|
|
23
|
+
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
|
24
|
+
|
|
25
|
+
-timestamp='2022-01-09'
|
|
26
|
+
+timestamp='2023-01-01'
|
|
27
|
+
|
|
28
|
+
# This file is free software; you can redistribute it and/or modify it
|
|
29
|
+
# under the terms of the GNU General Public License as published by
|
|
30
|
+
@@ -60,7 +60,7 @@ version="\
|
|
31
|
+
GNU config.guess ($timestamp)
|
|
32
|
+
|
|
33
|
+
Originally written by Per Bothner.
|
|
34
|
+
-Copyright 1992-2022 Free Software Foundation, Inc.
|
|
35
|
+
+Copyright 1992-2023 Free Software Foundation, Inc.
|
|
36
|
+
|
|
37
|
+
This is free software; see the source for copying conditions. There is NO
|
|
38
|
+
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
|
39
|
+
@@ -966,6 +966,12 @@ EOF
|
|
40
|
+
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
|
|
41
|
+
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
|
|
42
|
+
;;
|
|
43
|
+
+ x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
|
|
44
|
+
+ GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
|
|
45
|
+
+ ;;
|
|
46
|
+
+ *:[Mm]anagarm:*:*)
|
|
47
|
+
+ GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
|
|
48
|
+
+ ;;
|
|
49
|
+
*:Minix:*:*)
|
|
50
|
+
GUESS=$UNAME_MACHINE-unknown-minix
|
|
51
|
+
;;
|
|
52
|
+
@@ -1036,7 +1042,7 @@ EOF
|
|
53
|
+
k1om:Linux:*:*)
|
|
54
|
+
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
|
55
|
+
;;
|
|
56
|
+
- loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
|
|
57
|
+
+ loongarch32:Linux:*:* | loongarch64:Linux:*:*)
|
|
58
|
+
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
|
59
|
+
;;
|
|
60
|
+
m32r*:Linux:*:*)
|
|
61
|
+
@@ -1151,16 +1157,27 @@ EOF
|
|
62
|
+
;;
|
|
63
|
+
x86_64:Linux:*:*)
|
|
64
|
+
set_cc_for_build
|
|
65
|
+
+ CPU=$UNAME_MACHINE
|
|
66
|
+
LIBCABI=$LIBC
|
|
67
|
+
if test "$CC_FOR_BUILD" != no_compiler_found; then
|
|
68
|
+
- if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
|
|
69
|
+
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
|
|
70
|
+
- grep IS_X32 >/dev/null
|
|
71
|
+
- then
|
|
72
|
+
- LIBCABI=${LIBC}x32
|
|
73
|
+
- fi
|
|
74
|
+
+ ABI=64
|
|
75
|
+
+ sed 's/^ //' << EOF > "$dummy.c"
|
|
76
|
+
+ #ifdef __i386__
|
|
77
|
+
+ ABI=x86
|
|
78
|
+
+ #else
|
|
79
|
+
+ #ifdef __ILP32__
|
|
80
|
+
+ ABI=x32
|
|
81
|
+
+ #endif
|
|
82
|
+
+ #endif
|
|
83
|
+
+EOF
|
|
84
|
+
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
|
|
85
|
+
+ eval "$cc_set_abi"
|
|
86
|
+
+ case $ABI in
|
|
87
|
+
+ x86) CPU=i686 ;;
|
|
88
|
+
+ x32) LIBCABI=${LIBC}x32 ;;
|
|
89
|
+
+ esac
|
|
90
|
+
fi
|
|
91
|
+
- GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
|
|
92
|
+
+ GUESS=$CPU-pc-linux-$LIBCABI
|
|
93
|
+
;;
|
|
94
|
+
xtensa*:Linux:*:*)
|
|
95
|
+
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
|
96
|
+
@@ -1367,8 +1384,11 @@ EOF
|
|
97
|
+
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
|
|
98
|
+
GUESS=i586-pc-haiku
|
|
99
|
+
;;
|
|
100
|
+
- x86_64:Haiku:*:*)
|
|
101
|
+
- GUESS=x86_64-unknown-haiku
|
|
102
|
+
+ ppc:Haiku:*:*) # Haiku running on Apple PowerPC
|
|
103
|
+
+ GUESS=powerpc-apple-haiku
|
|
104
|
+
+ ;;
|
|
105
|
+
+ *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
|
|
106
|
+
+ GUESS=$UNAME_MACHINE-unknown-haiku
|
|
107
|
+
;;
|
|
108
|
+
SX-4:SUPER-UX:*:*)
|
|
109
|
+
GUESS=sx4-nec-superux$UNAME_RELEASE
|
|
110
|
+
diff --git a/config.sub b/config.sub
|
|
111
|
+
index dba16e8..de4259e 100755
|
|
112
|
+
--- a/config.sub
|
|
113
|
+
+++ b/config.sub
|
|
114
|
+
@@ -1,10 +1,10 @@
|
|
115
|
+
#! /bin/sh
|
|
116
|
+
# Configuration validation subroutine script.
|
|
117
|
+
-# Copyright 1992-2022 Free Software Foundation, Inc.
|
|
118
|
+
+# Copyright 1992-2023 Free Software Foundation, Inc.
|
|
119
|
+
|
|
120
|
+
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
|
121
|
+
|
|
122
|
+
-timestamp='2022-01-03'
|
|
123
|
+
+timestamp='2023-01-21'
|
|
124
|
+
|
|
125
|
+
# This file is free software; you can redistribute it and/or modify it
|
|
126
|
+
# under the terms of the GNU General Public License as published by
|
|
127
|
+
@@ -76,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|
128
|
+
version="\
|
|
129
|
+
GNU config.sub ($timestamp)
|
|
130
|
+
|
|
131
|
+
-Copyright 1992-2022 Free Software Foundation, Inc.
|
|
132
|
+
+Copyright 1992-2023 Free Software Foundation, Inc.
|
|
133
|
+
|
|
134
|
+
This is free software; see the source for copying conditions. There is NO
|
|
135
|
+
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
|
136
|
+
@@ -145,7 +145,7 @@ case $1 in
|
|
137
|
+
nto-qnx* | linux-* | uclinux-uclibc* \
|
|
138
|
+
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
|
|
139
|
+
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
|
|
140
|
+
- | storm-chaos* | os2-emx* | rtmk-nova*)
|
|
141
|
+
+ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
|
|
142
|
+
basic_machine=$field1
|
|
143
|
+
basic_os=$maybe_os
|
|
144
|
+
;;
|
|
145
|
+
@@ -1075,7 +1075,7 @@ case $cpu-$vendor in
|
|
146
|
+
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
|
147
|
+
cpu=i586
|
|
148
|
+
;;
|
|
149
|
+
- pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
|
|
150
|
+
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
|
|
151
|
+
cpu=i686
|
|
152
|
+
;;
|
|
153
|
+
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
|
154
|
+
@@ -1207,7 +1207,7 @@ case $cpu-$vendor in
|
|
155
|
+
| k1om \
|
|
156
|
+
| le32 | le64 \
|
|
157
|
+
| lm32 \
|
|
158
|
+
- | loongarch32 | loongarch64 | loongarchx32 \
|
|
159
|
+
+ | loongarch32 | loongarch64 \
|
|
160
|
+
| m32c | m32r | m32rle \
|
|
161
|
+
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
|
|
162
|
+
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
|
|
163
|
+
@@ -1341,6 +1341,10 @@ EOF
|
|
164
|
+
kernel=linux
|
|
165
|
+
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
|
|
166
|
+
;;
|
|
167
|
+
+ managarm*)
|
|
168
|
+
+ kernel=managarm
|
|
169
|
+
+ os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
|
|
170
|
+
+ ;;
|
|
171
|
+
*)
|
|
172
|
+
kernel=
|
|
173
|
+
os=$basic_os
|
|
174
|
+
@@ -1754,7 +1758,7 @@ case $os in
|
|
175
|
+
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
|
176
|
+
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
|
177
|
+
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
|
178
|
+
- | fiwix* )
|
|
179
|
+
+ | fiwix* | mlibc* )
|
|
180
|
+
;;
|
|
181
|
+
# This one is extra strict with allowed versions
|
|
182
|
+
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
|
183
|
+
@@ -1762,6 +1766,9 @@ case $os in
|
|
184
|
+
;;
|
|
185
|
+
none)
|
|
186
|
+
;;
|
|
187
|
+
+ kernel* )
|
|
188
|
+
+ # Restricted further below
|
|
189
|
+
+ ;;
|
|
190
|
+
*)
|
|
191
|
+
echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
|
|
192
|
+
exit 1
|
|
193
|
+
@@ -1772,16 +1779,26 @@ esac
|
|
194
|
+
# (given a valid OS), if there is a kernel.
|
|
195
|
+
case $kernel-$os in
|
|
196
|
+
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
|
|
197
|
+
- | linux-musl* | linux-relibc* | linux-uclibc* )
|
|
198
|
+
+ | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* )
|
|
199
|
+
;;
|
|
200
|
+
uclinux-uclibc* )
|
|
201
|
+
;;
|
|
202
|
+
- -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
|
|
203
|
+
+ managarm-mlibc* | managarm-kernel* )
|
|
204
|
+
+ ;;
|
|
205
|
+
+ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
|
|
206
|
+
# These are just libc implementations, not actual OSes, and thus
|
|
207
|
+
# require a kernel.
|
|
208
|
+
echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
|
|
209
|
+
exit 1
|
|
210
|
+
;;
|
|
211
|
+
+ -kernel* )
|
|
212
|
+
+ echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2
|
|
213
|
+
+ exit 1
|
|
214
|
+
+ ;;
|
|
215
|
+
+ *-kernel* )
|
|
216
|
+
+ echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2
|
|
217
|
+
+ exit 1
|
|
218
|
+
+ ;;
|
|
219
|
+
kfreebsd*-gnu* | kopensolaris*-gnu*)
|
|
220
|
+
;;
|
|
221
|
+
vxworks-simlinux | vxworks-simwindows | vxworks-spe)
|
|
222
|
+
--
|
|
223
|
+
2.33.0
|
|
224
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
From fb618bd27ac7a9fd32973320016c7ff28dd2f60e Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Mike Dalessio <mike.dalessio@gmail.com>
|
|
3
|
+
Date: Fri, 5 May 2023 10:10:43 -0400
|
|
4
|
+
Subject: [PATCH] rip out libxml2's libc_single_threaded support
|
|
5
|
+
|
|
6
|
+
This is a preventative measure because this feature relies on a glibc
|
|
7
|
+
version we can't realistically require of users today. We're not yet
|
|
8
|
+
precompiling on a system with a modern-enough glibc to make this an
|
|
9
|
+
actual problem, but I'm doing it while all of this context is fresh.
|
|
10
|
+
---
|
|
11
|
+
threads.c | 3 ++-
|
|
12
|
+
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
13
|
+
|
|
14
|
+
diff --git a/threads.c b/threads.c
|
|
15
|
+
index 60dbce4c..eb1c12e5 100644
|
|
16
|
+
--- a/threads.c
|
|
17
|
+
+++ b/threads.c
|
|
18
|
+
@@ -27,7 +27,8 @@
|
|
19
|
+
|
|
20
|
+
#if defined(HAVE_POSIX_THREADS) && \
|
|
21
|
+
defined(__GLIBC__) && \
|
|
22
|
+
- __GLIBC__ * 100 + __GLIBC_MINOR__ >= 234
|
|
23
|
+
+ __GLIBC__ * 100 + __GLIBC_MINOR__ >= 234 && \
|
|
24
|
+
+ !defined(NOKOGIRI_PRECOMPILED_LIBRARIES)
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* The modern way available since glibc 2.32.
|
|
28
|
+
--
|
|
29
|
+
2.40.1
|
|
30
|
+
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
From d3e3526111097560cf7c002613e2cb1d469b59e0 Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
|
3
|
+
Date: Sat, 21 Dec 2024 16:03:46 +0100
|
|
4
|
+
Subject: [PATCH] xpath: Use separate static hash table for standard functions
|
|
5
|
+
|
|
6
|
+
This avoids registering standard functions when creating an XPath
|
|
7
|
+
context.
|
|
8
|
+
|
|
9
|
+
Lookup of extension functions is a bit slower now, but ultimately, all
|
|
10
|
+
function lookups should be moved to the compilation phase.
|
|
11
|
+
|
|
12
|
+
(cherry picked from commit bf5fcf6e646bb51a0f6a3655a1d64bea97274867)
|
|
13
|
+
---
|
|
14
|
+
xpath.c | 170 ++++++++++++++++++++++++++++++++------------------------
|
|
15
|
+
1 file changed, 98 insertions(+), 72 deletions(-)
|
|
16
|
+
|
|
17
|
+
diff --git a/xpath.c b/xpath.c
|
|
18
|
+
index 485d7747..21711653 100644
|
|
19
|
+
--- a/xpath.c
|
|
20
|
+
+++ b/xpath.c
|
|
21
|
+
@@ -136,11 +136,48 @@
|
|
22
|
+
|
|
23
|
+
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
|
24
|
+
|
|
25
|
+
-/************************************************************************
|
|
26
|
+
- * *
|
|
27
|
+
- * Floating point stuff *
|
|
28
|
+
- * *
|
|
29
|
+
- ************************************************************************/
|
|
30
|
+
+static void
|
|
31
|
+
+xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
|
32
|
+
+
|
|
33
|
+
+static const struct {
|
|
34
|
+
+ const char *name;
|
|
35
|
+
+ xmlXPathFunction func;
|
|
36
|
+
+} xmlXPathStandardFunctions[] = {
|
|
37
|
+
+ { "boolean", xmlXPathBooleanFunction },
|
|
38
|
+
+ { "ceiling", xmlXPathCeilingFunction },
|
|
39
|
+
+ { "count", xmlXPathCountFunction },
|
|
40
|
+
+ { "concat", xmlXPathConcatFunction },
|
|
41
|
+
+ { "contains", xmlXPathContainsFunction },
|
|
42
|
+
+ { "id", xmlXPathIdFunction },
|
|
43
|
+
+ { "false", xmlXPathFalseFunction },
|
|
44
|
+
+ { "floor", xmlXPathFloorFunction },
|
|
45
|
+
+ { "last", xmlXPathLastFunction },
|
|
46
|
+
+ { "lang", xmlXPathLangFunction },
|
|
47
|
+
+ { "local-name", xmlXPathLocalNameFunction },
|
|
48
|
+
+ { "not", xmlXPathNotFunction },
|
|
49
|
+
+ { "name", xmlXPathNameFunction },
|
|
50
|
+
+ { "namespace-uri", xmlXPathNamespaceURIFunction },
|
|
51
|
+
+ { "normalize-space", xmlXPathNormalizeFunction },
|
|
52
|
+
+ { "number", xmlXPathNumberFunction },
|
|
53
|
+
+ { "position", xmlXPathPositionFunction },
|
|
54
|
+
+ { "round", xmlXPathRoundFunction },
|
|
55
|
+
+ { "string", xmlXPathStringFunction },
|
|
56
|
+
+ { "string-length", xmlXPathStringLengthFunction },
|
|
57
|
+
+ { "starts-with", xmlXPathStartsWithFunction },
|
|
58
|
+
+ { "substring", xmlXPathSubstringFunction },
|
|
59
|
+
+ { "substring-before", xmlXPathSubstringBeforeFunction },
|
|
60
|
+
+ { "substring-after", xmlXPathSubstringAfterFunction },
|
|
61
|
+
+ { "sum", xmlXPathSumFunction },
|
|
62
|
+
+ { "true", xmlXPathTrueFunction },
|
|
63
|
+
+ { "translate", xmlXPathTranslateFunction }
|
|
64
|
+
+};
|
|
65
|
+
+
|
|
66
|
+
+#define NUM_STANDARD_FUNCTIONS \
|
|
67
|
+
+ (sizeof(xmlXPathStandardFunctions) / sizeof(xmlXPathStandardFunctions[0]))
|
|
68
|
+
+
|
|
69
|
+
+#define SF_HASH_SIZE 64
|
|
70
|
+
+
|
|
71
|
+
+static unsigned char xmlXPathSFHash[SF_HASH_SIZE];
|
|
72
|
+
|
|
73
|
+
double xmlXPathNAN = 0.0;
|
|
74
|
+
double xmlXPathPINF = 0.0;
|
|
75
|
+
@@ -156,6 +193,18 @@ xmlXPathInit(void) {
|
|
76
|
+
xmlInitParser();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
+ATTRIBUTE_NO_SANITIZE_INTEGER
|
|
80
|
+
+static unsigned
|
|
81
|
+
+xmlXPathSFComputeHash(const xmlChar *name) {
|
|
82
|
+
+ unsigned hashValue = 5381;
|
|
83
|
+
+ const xmlChar *ptr;
|
|
84
|
+
+
|
|
85
|
+
+ for (ptr = name; *ptr; ptr++)
|
|
86
|
+
+ hashValue = hashValue * 33 + *ptr;
|
|
87
|
+
+
|
|
88
|
+
+ return(hashValue);
|
|
89
|
+
+}
|
|
90
|
+
+
|
|
91
|
+
/**
|
|
92
|
+
* xmlInitXPathInternal:
|
|
93
|
+
*
|
|
94
|
+
@@ -164,6 +213,8 @@ xmlXPathInit(void) {
|
|
95
|
+
ATTRIBUTE_NO_SANITIZE("float-divide-by-zero")
|
|
96
|
+
void
|
|
97
|
+
xmlInitXPathInternal(void) {
|
|
98
|
+
+ size_t i;
|
|
99
|
+
+
|
|
100
|
+
#if defined(NAN) && defined(INFINITY)
|
|
101
|
+
xmlXPathNAN = NAN;
|
|
102
|
+
xmlXPathPINF = INFINITY;
|
|
103
|
+
@@ -175,8 +226,34 @@ xmlInitXPathInternal(void) {
|
|
104
|
+
xmlXPathPINF = 1.0 / zero;
|
|
105
|
+
xmlXPathNINF = -xmlXPathPINF;
|
|
106
|
+
#endif
|
|
107
|
+
+
|
|
108
|
+
+ /*
|
|
109
|
+
+ * Initialize hash table for standard functions
|
|
110
|
+
+ */
|
|
111
|
+
+
|
|
112
|
+
+ for (i = 0; i < SF_HASH_SIZE; i++)
|
|
113
|
+
+ xmlXPathSFHash[i] = UCHAR_MAX;
|
|
114
|
+
+
|
|
115
|
+
+ for (i = 0; i < NUM_STANDARD_FUNCTIONS; i++) {
|
|
116
|
+
+ const char *name = xmlXPathStandardFunctions[i].name;
|
|
117
|
+
+ int bucketIndex = xmlXPathSFComputeHash(BAD_CAST name) % SF_HASH_SIZE;
|
|
118
|
+
+
|
|
119
|
+
+ while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
|
|
120
|
+
+ bucketIndex += 1;
|
|
121
|
+
+ if (bucketIndex >= SF_HASH_SIZE)
|
|
122
|
+
+ bucketIndex = 0;
|
|
123
|
+
+ }
|
|
124
|
+
+
|
|
125
|
+
+ xmlXPathSFHash[bucketIndex] = i;
|
|
126
|
+
+ }
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
+/************************************************************************
|
|
130
|
+
+ * *
|
|
131
|
+
+ * Floating point stuff *
|
|
132
|
+
+ * *
|
|
133
|
+
+ ************************************************************************/
|
|
134
|
+
+
|
|
135
|
+
/**
|
|
136
|
+
* xmlXPathIsNaN:
|
|
137
|
+
* @val: a double value
|
|
138
|
+
@@ -3979,18 +4056,6 @@ xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
|
|
139
|
+
*/
|
|
140
|
+
xmlXPathFunction
|
|
141
|
+
xmlXPathFunctionLookup(xmlXPathContextPtr ctxt, const xmlChar *name) {
|
|
142
|
+
- if (ctxt == NULL)
|
|
143
|
+
- return (NULL);
|
|
144
|
+
-
|
|
145
|
+
- if (ctxt->funcLookupFunc != NULL) {
|
|
146
|
+
- xmlXPathFunction ret;
|
|
147
|
+
- xmlXPathFuncLookupFunc f;
|
|
148
|
+
-
|
|
149
|
+
- f = ctxt->funcLookupFunc;
|
|
150
|
+
- ret = f(ctxt->funcLookupData, name, NULL);
|
|
151
|
+
- if (ret != NULL)
|
|
152
|
+
- return(ret);
|
|
153
|
+
- }
|
|
154
|
+
return(xmlXPathFunctionLookupNS(ctxt, name, NULL));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@@ -4015,6 +4080,22 @@ xmlXPathFunctionLookupNS(xmlXPathContextPtr ctxt, const xmlChar *name,
|
|
158
|
+
if (name == NULL)
|
|
159
|
+
return(NULL);
|
|
160
|
+
|
|
161
|
+
+ if (ns_uri == NULL) {
|
|
162
|
+
+ int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE;
|
|
163
|
+
+
|
|
164
|
+
+ while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
|
|
165
|
+
+ int funcIndex = xmlXPathSFHash[bucketIndex];
|
|
166
|
+
+
|
|
167
|
+
+ if (strcmp(xmlXPathStandardFunctions[funcIndex].name,
|
|
168
|
+
+ (char *) name) == 0)
|
|
169
|
+
+ return(xmlXPathStandardFunctions[funcIndex].func);
|
|
170
|
+
+
|
|
171
|
+
+ bucketIndex += 1;
|
|
172
|
+
+ if (bucketIndex >= SF_HASH_SIZE)
|
|
173
|
+
+ bucketIndex = 0;
|
|
174
|
+
+ }
|
|
175
|
+
+ }
|
|
176
|
+
+
|
|
177
|
+
if (ctxt->funcLookupFunc != NULL) {
|
|
178
|
+
xmlXPathFuncLookupFunc f;
|
|
179
|
+
|
|
180
|
+
@@ -13494,61 +13575,6 @@ xmlXPathEscapeUriFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
|
181
|
+
void
|
|
182
|
+
xmlXPathRegisterAllFunctions(xmlXPathContextPtr ctxt)
|
|
183
|
+
{
|
|
184
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"boolean",
|
|
185
|
+
- xmlXPathBooleanFunction);
|
|
186
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"ceiling",
|
|
187
|
+
- xmlXPathCeilingFunction);
|
|
188
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"count",
|
|
189
|
+
- xmlXPathCountFunction);
|
|
190
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"concat",
|
|
191
|
+
- xmlXPathConcatFunction);
|
|
192
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"contains",
|
|
193
|
+
- xmlXPathContainsFunction);
|
|
194
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"id",
|
|
195
|
+
- xmlXPathIdFunction);
|
|
196
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"false",
|
|
197
|
+
- xmlXPathFalseFunction);
|
|
198
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"floor",
|
|
199
|
+
- xmlXPathFloorFunction);
|
|
200
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"last",
|
|
201
|
+
- xmlXPathLastFunction);
|
|
202
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"lang",
|
|
203
|
+
- xmlXPathLangFunction);
|
|
204
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"local-name",
|
|
205
|
+
- xmlXPathLocalNameFunction);
|
|
206
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"not",
|
|
207
|
+
- xmlXPathNotFunction);
|
|
208
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"name",
|
|
209
|
+
- xmlXPathNameFunction);
|
|
210
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"namespace-uri",
|
|
211
|
+
- xmlXPathNamespaceURIFunction);
|
|
212
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"normalize-space",
|
|
213
|
+
- xmlXPathNormalizeFunction);
|
|
214
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"number",
|
|
215
|
+
- xmlXPathNumberFunction);
|
|
216
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"position",
|
|
217
|
+
- xmlXPathPositionFunction);
|
|
218
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"round",
|
|
219
|
+
- xmlXPathRoundFunction);
|
|
220
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"string",
|
|
221
|
+
- xmlXPathStringFunction);
|
|
222
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"string-length",
|
|
223
|
+
- xmlXPathStringLengthFunction);
|
|
224
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"starts-with",
|
|
225
|
+
- xmlXPathStartsWithFunction);
|
|
226
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"substring",
|
|
227
|
+
- xmlXPathSubstringFunction);
|
|
228
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"substring-before",
|
|
229
|
+
- xmlXPathSubstringBeforeFunction);
|
|
230
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"substring-after",
|
|
231
|
+
- xmlXPathSubstringAfterFunction);
|
|
232
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"sum",
|
|
233
|
+
- xmlXPathSumFunction);
|
|
234
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"true",
|
|
235
|
+
- xmlXPathTrueFunction);
|
|
236
|
+
- xmlXPathRegisterFunc(ctxt, (const xmlChar *)"translate",
|
|
237
|
+
- xmlXPathTranslateFunction);
|
|
238
|
+
-
|
|
239
|
+
xmlXPathRegisterFuncNS(ctxt, (const xmlChar *)"escape-uri",
|
|
240
|
+
(const xmlChar *)"http://www.w3.org/2002/08/xquery-functions",
|
|
241
|
+
xmlXPathEscapeUriFunction);
|
|
242
|
+
--
|
|
243
|
+
2.47.1
|
|
244
|
+
|