nokogiri 1.11.3-x86-mingw32 → 1.12.0.rc1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE-DEPENDENCIES.md +243 -22
  3. data/LICENSE.md +1 -1
  4. data/README.md +6 -5
  5. data/dependencies.yml +12 -12
  6. data/ext/nokogiri/depend +35 -34
  7. data/ext/nokogiri/extconf.rb +181 -103
  8. data/ext/nokogiri/gumbo.c +611 -0
  9. data/ext/nokogiri/{html_document.c → html4_document.c} +8 -8
  10. data/ext/nokogiri/{html_element_description.c → html4_element_description.c} +20 -18
  11. data/ext/nokogiri/{html_entity_lookup.c → html4_entity_lookup.c} +7 -7
  12. data/ext/nokogiri/{html_sax_parser_context.c → html4_sax_parser_context.c} +5 -5
  13. data/ext/nokogiri/{html_sax_push_parser.c → html4_sax_push_parser.c} +4 -4
  14. data/ext/nokogiri/include/libxml2/libxml/c14n.h +6 -4
  15. data/ext/nokogiri/include/libxml2/libxml/parser.h +9 -7
  16. data/ext/nokogiri/include/libxml2/libxml/tree.h +3 -3
  17. data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +2 -0
  18. data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +39 -115
  19. data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +1 -1
  20. data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +6 -6
  21. data/ext/nokogiri/include/libxml2/libxml/xpath.h +1 -3
  22. data/ext/nokogiri/libxml2_backwards_compat.c +30 -30
  23. data/ext/nokogiri/nokogiri.c +70 -38
  24. data/ext/nokogiri/nokogiri.h +16 -9
  25. data/ext/nokogiri/xml_document.c +13 -13
  26. data/ext/nokogiri/xml_element_content.c +2 -0
  27. data/ext/nokogiri/xml_encoding_handler.c +11 -6
  28. data/ext/nokogiri/xml_namespace.c +2 -0
  29. data/ext/nokogiri/xml_node.c +118 -110
  30. data/ext/nokogiri/xml_node_set.c +20 -20
  31. data/ext/nokogiri/xml_reader.c +2 -0
  32. data/ext/nokogiri/xml_sax_parser.c +6 -6
  33. data/ext/nokogiri/xml_sax_parser_context.c +2 -0
  34. data/ext/nokogiri/xml_schema.c +2 -0
  35. data/ext/nokogiri/xml_xpath_context.c +67 -65
  36. data/ext/nokogiri/xslt_stylesheet.c +2 -1
  37. data/gumbo-parser/CHANGES.md +63 -0
  38. data/gumbo-parser/Makefile +101 -0
  39. data/gumbo-parser/THANKS +27 -0
  40. data/lib/nokogiri.rb +31 -29
  41. data/lib/nokogiri/2.5/nokogiri.so +0 -0
  42. data/lib/nokogiri/2.6/nokogiri.so +0 -0
  43. data/lib/nokogiri/2.7/nokogiri.so +0 -0
  44. data/lib/nokogiri/3.0/nokogiri.so +0 -0
  45. data/lib/nokogiri/css.rb +14 -14
  46. data/lib/nokogiri/css/parser.rb +1 -1
  47. data/lib/nokogiri/css/parser.y +1 -1
  48. data/lib/nokogiri/css/syntax_error.rb +1 -1
  49. data/lib/nokogiri/extension.rb +2 -2
  50. data/lib/nokogiri/gumbo.rb +14 -0
  51. data/lib/nokogiri/html.rb +31 -27
  52. data/lib/nokogiri/html4.rb +40 -0
  53. data/lib/nokogiri/{html → html4}/builder.rb +2 -2
  54. data/lib/nokogiri/{html → html4}/document.rb +4 -4
  55. data/lib/nokogiri/{html → html4}/document_fragment.rb +3 -3
  56. data/lib/nokogiri/{html → html4}/element_description.rb +1 -1
  57. data/lib/nokogiri/{html → html4}/element_description_defaults.rb +1 -1
  58. data/lib/nokogiri/{html → html4}/entity_lookup.rb +1 -1
  59. data/lib/nokogiri/{html → html4}/sax/parser.rb +11 -14
  60. data/lib/nokogiri/html4/sax/parser_context.rb +19 -0
  61. data/lib/nokogiri/{html → html4}/sax/push_parser.rb +5 -5
  62. data/lib/nokogiri/html5.rb +473 -0
  63. data/lib/nokogiri/html5/document.rb +74 -0
  64. data/lib/nokogiri/html5/document_fragment.rb +80 -0
  65. data/lib/nokogiri/html5/node.rb +93 -0
  66. data/lib/nokogiri/version/constant.rb +1 -1
  67. data/lib/nokogiri/version/info.rb +12 -2
  68. data/lib/nokogiri/xml.rb +35 -36
  69. data/lib/nokogiri/xml/node.rb +6 -5
  70. data/lib/nokogiri/xml/parse_options.rb +2 -0
  71. data/lib/nokogiri/xml/pp.rb +2 -2
  72. data/lib/nokogiri/xml/sax.rb +4 -4
  73. data/lib/nokogiri/xml/sax/document.rb +24 -30
  74. data/lib/nokogiri/xml/xpath.rb +2 -2
  75. data/lib/nokogiri/xslt.rb +16 -16
  76. data/lib/nokogiri/xslt/stylesheet.rb +1 -1
  77. metadata +37 -37
  78. data/lib/nokogiri/html/sax/parser_context.rb +0 -17
@@ -1,6 +1,6 @@
1
1
  #include <nokogiri.h>
2
2
 
3
- VALUE cNokogiriHtmlDocument ;
3
+ VALUE cNokogiriHtml4Document ;
4
4
 
5
5
  static ID id_encoding_found;
6
6
  static ID id_to_s;
@@ -34,7 +34,7 @@ rb_html_document_s_new(int argc, VALUE *argv, VALUE klass)
34
34
  * read_io(io, url, encoding, options)
35
35
  *
36
36
  * Read the HTML document from +io+ with given +url+, +encoding+,
37
- * and +options+. See Nokogiri::HTML.parse
37
+ * and +options+. See Nokogiri::HTML4.parse
38
38
  */
39
39
  static VALUE
40
40
  rb_html_document_s_read_io(VALUE klass, VALUE rb_io, VALUE rb_url, VALUE rb_encoding, VALUE rb_options)
@@ -92,7 +92,7 @@ rb_html_document_s_read_io(VALUE klass, VALUE rb_io, VALUE rb_url, VALUE rb_enco
92
92
  * read_memory(string, url, encoding, options)
93
93
  *
94
94
  * Read the HTML document contained in +string+ with given +url+, +encoding+,
95
- * and +options+. See Nokogiri::HTML.parse
95
+ * and +options+. See Nokogiri::HTML4.parse
96
96
  */
97
97
  static VALUE
98
98
  rb_html_document_s_read_memory(VALUE klass, VALUE rb_html, VALUE rb_url, VALUE rb_encoding, VALUE rb_options)
@@ -153,13 +153,13 @@ void
153
153
  noko_init_html_document()
154
154
  {
155
155
  assert(cNokogiriXmlDocument);
156
- cNokogiriHtmlDocument = rb_define_class_under(mNokogiriHtml, "Document", cNokogiriXmlDocument);
156
+ cNokogiriHtml4Document = rb_define_class_under(mNokogiriHtml4, "Document", cNokogiriXmlDocument);
157
157
 
158
- rb_define_singleton_method(cNokogiriHtmlDocument, "read_memory", rb_html_document_s_read_memory, 4);
159
- rb_define_singleton_method(cNokogiriHtmlDocument, "read_io", rb_html_document_s_read_io, 4);
160
- rb_define_singleton_method(cNokogiriHtmlDocument, "new", rb_html_document_s_new, -1);
158
+ rb_define_singleton_method(cNokogiriHtml4Document, "read_memory", rb_html_document_s_read_memory, 4);
159
+ rb_define_singleton_method(cNokogiriHtml4Document, "read_io", rb_html_document_s_read_io, 4);
160
+ rb_define_singleton_method(cNokogiriHtml4Document, "new", rb_html_document_s_new, -1);
161
161
 
162
- rb_define_method(cNokogiriHtmlDocument, "type", rb_html_document_type, 0);
162
+ rb_define_method(cNokogiriHtml4Document, "type", rb_html_document_type, 0);
163
163
 
164
164
  id_encoding_found = rb_intern("encoding_found");
165
165
  id_to_s = rb_intern("to_s");
@@ -1,6 +1,6 @@
1
1
  #include <nokogiri.h>
2
2
 
3
- VALUE cNokogiriHtmlElementDescription ;
3
+ VALUE cNokogiriHtml4ElementDescription ;
4
4
 
5
5
  /*
6
6
  * call-seq:
@@ -272,21 +272,23 @@ get_description(VALUE klass, VALUE tag_name)
272
272
  void
273
273
  noko_init_html_element_description()
274
274
  {
275
- cNokogiriHtmlElementDescription = rb_define_class_under(mNokogiriHtml, "ElementDescription", rb_cObject);
276
-
277
- rb_define_singleton_method(cNokogiriHtmlElementDescription, "[]", get_description, 1);
278
-
279
- rb_define_method(cNokogiriHtmlElementDescription, "name", name, 0);
280
- rb_define_method(cNokogiriHtmlElementDescription, "implied_start_tag?", implied_start_tag_eh, 0);
281
- rb_define_method(cNokogiriHtmlElementDescription, "implied_end_tag?", implied_end_tag_eh, 0);
282
- rb_define_method(cNokogiriHtmlElementDescription, "save_end_tag?", save_end_tag_eh, 0);
283
- rb_define_method(cNokogiriHtmlElementDescription, "empty?", empty_eh, 0);
284
- rb_define_method(cNokogiriHtmlElementDescription, "deprecated?", deprecated_eh, 0);
285
- rb_define_method(cNokogiriHtmlElementDescription, "inline?", inline_eh, 0);
286
- rb_define_method(cNokogiriHtmlElementDescription, "description", description, 0);
287
- rb_define_method(cNokogiriHtmlElementDescription, "sub_elements", sub_elements, 0);
288
- rb_define_method(cNokogiriHtmlElementDescription, "default_sub_element", default_sub_element, 0);
289
- rb_define_method(cNokogiriHtmlElementDescription, "optional_attributes", optional_attributes, 0);
290
- rb_define_method(cNokogiriHtmlElementDescription, "deprecated_attributes", deprecated_attributes, 0);
291
- rb_define_method(cNokogiriHtmlElementDescription, "required_attributes", required_attributes, 0);
275
+ cNokogiriHtml4ElementDescription = rb_define_class_under(mNokogiriHtml4, "ElementDescription", rb_cObject);
276
+
277
+ rb_undef_alloc_func(cNokogiriHtml4ElementDescription);
278
+
279
+ rb_define_singleton_method(cNokogiriHtml4ElementDescription, "[]", get_description, 1);
280
+
281
+ rb_define_method(cNokogiriHtml4ElementDescription, "name", name, 0);
282
+ rb_define_method(cNokogiriHtml4ElementDescription, "implied_start_tag?", implied_start_tag_eh, 0);
283
+ rb_define_method(cNokogiriHtml4ElementDescription, "implied_end_tag?", implied_end_tag_eh, 0);
284
+ rb_define_method(cNokogiriHtml4ElementDescription, "save_end_tag?", save_end_tag_eh, 0);
285
+ rb_define_method(cNokogiriHtml4ElementDescription, "empty?", empty_eh, 0);
286
+ rb_define_method(cNokogiriHtml4ElementDescription, "deprecated?", deprecated_eh, 0);
287
+ rb_define_method(cNokogiriHtml4ElementDescription, "inline?", inline_eh, 0);
288
+ rb_define_method(cNokogiriHtml4ElementDescription, "description", description, 0);
289
+ rb_define_method(cNokogiriHtml4ElementDescription, "sub_elements", sub_elements, 0);
290
+ rb_define_method(cNokogiriHtml4ElementDescription, "default_sub_element", default_sub_element, 0);
291
+ rb_define_method(cNokogiriHtml4ElementDescription, "optional_attributes", optional_attributes, 0);
292
+ rb_define_method(cNokogiriHtml4ElementDescription, "deprecated_attributes", deprecated_attributes, 0);
293
+ rb_define_method(cNokogiriHtml4ElementDescription, "required_attributes", required_attributes, 0);
292
294
  }
@@ -1,17 +1,17 @@
1
1
  #include <nokogiri.h>
2
2
 
3
- static VALUE cNokogiriHtmlEntityLookup;
3
+ static VALUE cNokogiriHtml4EntityLookup;
4
4
 
5
5
  /*
6
6
  * call-seq:
7
7
  * get(key)
8
8
  *
9
- * Get the HTML::EntityDescription for +key+
9
+ * Get the HTML4::EntityDescription for +key+
10
10
  */
11
11
  static VALUE
12
12
  get(VALUE _, VALUE rb_entity_name)
13
13
  {
14
- VALUE cNokogiriHtmlEntityDescription;
14
+ VALUE cNokogiriHtml4EntityDescription;
15
15
  const htmlEntityDesc *c_entity_desc;
16
16
  VALUE rb_constructor_args[3];
17
17
 
@@ -24,14 +24,14 @@ get(VALUE _, VALUE rb_entity_name)
24
24
  rb_constructor_args[1] = NOKOGIRI_STR_NEW2(c_entity_desc->name);
25
25
  rb_constructor_args[2] = NOKOGIRI_STR_NEW2(c_entity_desc->desc);
26
26
 
27
- cNokogiriHtmlEntityDescription = rb_const_get_at(mNokogiriHtml, rb_intern("EntityDescription"));
28
- return rb_class_new_instance(3, rb_constructor_args, cNokogiriHtmlEntityDescription);
27
+ cNokogiriHtml4EntityDescription = rb_const_get_at(mNokogiriHtml4, rb_intern("EntityDescription"));
28
+ return rb_class_new_instance(3, rb_constructor_args, cNokogiriHtml4EntityDescription);
29
29
  }
30
30
 
31
31
  void
32
32
  noko_init_html_entity_lookup()
33
33
  {
34
- cNokogiriHtmlEntityLookup = rb_define_class_under(mNokogiriHtml, "EntityLookup", rb_cObject);
34
+ cNokogiriHtml4EntityLookup = rb_define_class_under(mNokogiriHtml4, "EntityLookup", rb_cObject);
35
35
 
36
- rb_define_method(cNokogiriHtmlEntityLookup, "get", get, 1);
36
+ rb_define_method(cNokogiriHtml4EntityLookup, "get", get, 1);
37
37
  }
@@ -1,6 +1,6 @@
1
1
  #include <nokogiri.h>
2
2
 
3
- VALUE cNokogiriHtmlSaxParserContext ;
3
+ VALUE cNokogiriHtml4SaxParserContext ;
4
4
 
5
5
  static void
6
6
  deallocate(xmlParserCtxtPtr ctxt)
@@ -110,10 +110,10 @@ void
110
110
  noko_init_html_sax_parser_context()
111
111
  {
112
112
  assert(cNokogiriXmlSaxParserContext);
113
- cNokogiriHtmlSaxParserContext = rb_define_class_under(mNokogiriHtmlSax, "ParserContext", cNokogiriXmlSaxParserContext);
113
+ cNokogiriHtml4SaxParserContext = rb_define_class_under(mNokogiriHtml4Sax, "ParserContext", cNokogiriXmlSaxParserContext);
114
114
 
115
- rb_define_singleton_method(cNokogiriHtmlSaxParserContext, "memory", parse_memory, 2);
116
- rb_define_singleton_method(cNokogiriHtmlSaxParserContext, "file", parse_file, 2);
115
+ rb_define_singleton_method(cNokogiriHtml4SaxParserContext, "memory", parse_memory, 2);
116
+ rb_define_singleton_method(cNokogiriHtml4SaxParserContext, "file", parse_file, 2);
117
117
 
118
- rb_define_method(cNokogiriHtmlSaxParserContext, "parse_with", parse_with, 1);
118
+ rb_define_method(cNokogiriHtml4SaxParserContext, "parse_with", parse_with, 1);
119
119
  }
@@ -1,6 +1,6 @@
1
1
  #include <nokogiri.h>
2
2
 
3
- VALUE cNokogiriHtmlSaxPushParser;
3
+ VALUE cNokogiriHtml4SaxPushParser;
4
4
 
5
5
  /*
6
6
  * call-seq:
@@ -88,8 +88,8 @@ void
88
88
  noko_init_html_sax_push_parser()
89
89
  {
90
90
  assert(cNokogiriXmlSaxPushParser);
91
- cNokogiriHtmlSaxPushParser = rb_define_class_under(mNokogiriHtmlSax, "PushParser", cNokogiriXmlSaxPushParser);
91
+ cNokogiriHtml4SaxPushParser = rb_define_class_under(mNokogiriHtml4Sax, "PushParser", cNokogiriXmlSaxPushParser);
92
92
 
93
- rb_define_private_method(cNokogiriHtmlSaxPushParser, "initialize_native", initialize_native, 3);
94
- rb_define_private_method(cNokogiriHtmlSaxPushParser, "native_write", native_write, 2);
93
+ rb_define_private_method(cNokogiriHtml4SaxPushParser, "initialize_native", initialize_native, 3);
94
+ rb_define_private_method(cNokogiriHtml4SaxPushParser, "native_write", native_write, 2);
95
95
  }
@@ -16,17 +16,19 @@
16
16
  */
17
17
  #ifndef __XML_C14N_H__
18
18
  #define __XML_C14N_H__
19
+
20
+ #include <libxml/xmlversion.h>
21
+
19
22
  #ifdef LIBXML_C14N_ENABLED
20
23
  #ifdef LIBXML_OUTPUT_ENABLED
21
24
 
25
+ #include <libxml/tree.h>
26
+ #include <libxml/xpath.h>
27
+
22
28
  #ifdef __cplusplus
23
29
  extern "C" {
24
30
  #endif /* __cplusplus */
25
31
 
26
- #include <libxml/xmlversion.h>
27
- #include <libxml/tree.h>
28
- #include <libxml/xpath.h>
29
-
30
32
  /*
31
33
  * XML Canonicalization
32
34
  * http://www.w3.org/TR/xml-c14n
@@ -79,7 +79,7 @@ struct _xmlParserInput {
79
79
  /**
80
80
  * xmlParserNodeInfo:
81
81
  *
82
- * The parser can be asked to collect Node informations, i.e. at what
82
+ * The parser can be asked to collect Node information, i.e. at what
83
83
  * place in the file they were detected.
84
84
  * NOTE: This is off by default and not very well tested.
85
85
  */
@@ -169,6 +169,8 @@ typedef enum {
169
169
  XML_PARSE_READER = 5
170
170
  } xmlParserMode;
171
171
 
172
+ typedef struct _xmlStartTag xmlStartTag;
173
+
172
174
  /**
173
175
  * xmlParserCtxt:
174
176
  *
@@ -231,7 +233,7 @@ struct _xmlParserCtxt {
231
233
  int nameMax; /* Max depth of the parsing stack */
232
234
  const xmlChar * *nameTab; /* array of nodes */
233
235
 
234
- long nbChars; /* number of xmlChar processed */
236
+ long nbChars; /* unused */
235
237
  long checkIndex; /* used by progressive parsing lookup */
236
238
  int keepBlanks; /* ugly but ... */
237
239
  int disableSAX; /* SAX callbacks are disabled */
@@ -280,7 +282,7 @@ struct _xmlParserCtxt {
280
282
  int nsMax; /* the size of the arrays */
281
283
  const xmlChar * *nsTab; /* the array of prefix/namespace name */
282
284
  int *attallocs; /* which attribute were allocated */
283
- void * *pushTab; /* array of data for push */
285
+ xmlStartTag *pushTab; /* array of data for push */
284
286
  xmlHashTablePtr attsDefault; /* defaulted attributes if any */
285
287
  xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
286
288
  int nsWellFormed; /* is the document XML Namespace okay */
@@ -296,7 +298,7 @@ struct _xmlParserCtxt {
296
298
  xmlAttrPtr freeAttrs; /* List of freed attributes nodes */
297
299
 
298
300
  /*
299
- * the complete error informations for the last error.
301
+ * the complete error information for the last error.
300
302
  */
301
303
  xmlError lastError;
302
304
  xmlParserMode parseMode; /* the parser mode */
@@ -329,7 +331,7 @@ struct _xmlSAXLocator {
329
331
  * xmlSAXHandler:
330
332
  *
331
333
  * A SAX handler is bunch of callbacks called by the parser when processing
332
- * of the input generate data or structure informations.
334
+ * of the input generate data or structure information.
333
335
  */
334
336
 
335
337
  /**
@@ -685,7 +687,7 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
685
687
  * attribute values.
686
688
  *
687
689
  * SAX2 callback when an element start has been detected by the parser.
688
- * It provides the namespace informations for the element, as well as
690
+ * It provides the namespace information for the element, as well as
689
691
  * the new namespace declarations on the element.
690
692
  */
691
693
 
@@ -707,7 +709,7 @@ typedef void (*startElementNsSAX2Func) (void *ctx,
707
709
  * @URI: the element namespace name if available
708
710
  *
709
711
  * SAX2 callback when an element end has been detected by the parser.
710
- * It provides the namespace informations for the element.
712
+ * It provides the namespace information for the element.
711
713
  */
712
714
 
713
715
  typedef void (*endElementNsSAX2Func) (void *ctx,
@@ -443,7 +443,7 @@ struct _xmlAttr {
443
443
  struct _xmlDoc *doc; /* the containing document */
444
444
  xmlNs *ns; /* pointer to the associated namespace */
445
445
  xmlAttributeType atype; /* the attribute type if validating */
446
- void *psvi; /* for type/PSVI informations */
446
+ void *psvi; /* for type/PSVI information */
447
447
  };
448
448
 
449
449
  /**
@@ -502,7 +502,7 @@ struct _xmlNode {
502
502
  xmlChar *content; /* the content */
503
503
  struct _xmlAttr *properties;/* properties list */
504
504
  xmlNs *nsDef; /* namespace definitions on this node */
505
- void *psvi; /* for type/PSVI informations */
505
+ void *psvi; /* for type/PSVI information */
506
506
  unsigned short line; /* line number */
507
507
  unsigned short extra; /* extra data for XPath/XSLT */
508
508
  };
@@ -578,7 +578,7 @@ struct _xmlDoc {
578
578
  int charset; /* Internal flag for charset handling,
579
579
  actually an xmlCharEncoding */
580
580
  struct _xmlDict *dict; /* dict used to allocate names or NULL */
581
- void *psvi; /* for type/PSVI informations */
581
+ void *psvi; /* for type/PSVI information */
582
582
  int parseFlags; /* set of xmlParserOption used to parse the
583
583
  document */
584
584
  int properties; /* set of xmlDocProperties for this document
@@ -217,6 +217,8 @@ xmlParserInputBufferPtr
217
217
  */
218
218
  XMLPUBFUN void XMLCALL
219
219
  xmlCleanupOutputCallbacks (void);
220
+ XMLPUBFUN int XMLCALL
221
+ xmlPopOutputCallbacks (void);
220
222
  XMLPUBFUN void XMLCALL
221
223
  xmlRegisterDefaultOutputCallbacks(void);
222
224
  XMLPUBFUN xmlOutputBufferPtr XMLCALL
@@ -3,43 +3,46 @@
3
3
  * Description: macros for marking symbols as exportable/importable.
4
4
  *
5
5
  * Copy: See Copyright for the status of this software.
6
- *
7
- * Author: Igor Zlatovic <igor@zlatkovic.com>
8
6
  */
9
7
 
10
8
  #ifndef __XML_EXPORTS_H__
11
9
  #define __XML_EXPORTS_H__
12
10
 
13
- /**
14
- * XMLPUBFUN, XMLPUBVAR, XMLCALL
15
- *
16
- * Macros which declare an exportable function, an exportable variable and
17
- * the calling convention used for functions.
18
- *
19
- * Please use an extra block for every platform/compiler combination when
20
- * modifying this, rather than overlong #ifdef lines. This helps
21
- * readability as well as the fact that different compilers on the same
22
- * platform might need different definitions.
23
- */
11
+ #if defined(_WIN32) || defined(__CYGWIN__)
12
+ /** DOC_DISABLE */
13
+
14
+ #ifdef LIBXML_STATIC
15
+ #define XMLPUBLIC
16
+ #elif defined(IN_LIBXML)
17
+ #define XMLPUBLIC __declspec(dllexport)
18
+ #else
19
+ #define XMLPUBLIC __declspec(dllimport)
20
+ #endif
21
+
22
+ #if defined(LIBXML_FASTCALL)
23
+ #define XMLCALL __fastcall
24
+ #else
25
+ #define XMLCALL __cdecl
26
+ #endif
27
+ #define XMLCDECL __cdecl
28
+
29
+ /** DOC_ENABLE */
30
+ #else /* not Windows */
24
31
 
25
32
  /**
26
- * XMLPUBFUN:
27
- *
28
- * Macros which declare an exportable function
29
- */
30
- #define XMLPUBFUN
31
- /**
32
- * XMLPUBVAR:
33
+ * XMLPUBLIC:
33
34
  *
34
- * Macros which declare an exportable variable
35
+ * Macro which declares a public symbol
35
36
  */
36
- #define XMLPUBVAR extern
37
+ #define XMLPUBLIC
38
+
37
39
  /**
38
40
  * XMLCALL:
39
41
  *
40
- * Macros which declare the called convention for exported functions
42
+ * Macro which declares the calling convention for exported functions
41
43
  */
42
44
  #define XMLCALL
45
+
43
46
  /**
44
47
  * XMLCDECL:
45
48
  *
@@ -48,100 +51,21 @@
48
51
  */
49
52
  #define XMLCDECL
50
53
 
51
- /** DOC_DISABLE */
52
-
53
- /* Windows platform with MS compiler */
54
- #if defined(_WIN32) && defined(_MSC_VER)
55
- #undef XMLPUBFUN
56
- #undef XMLPUBVAR
57
- #undef XMLCALL
58
- #undef XMLCDECL
59
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
60
- #define XMLPUBFUN __declspec(dllexport)
61
- #define XMLPUBVAR __declspec(dllexport)
62
- #else
63
- #define XMLPUBFUN
64
- #if !defined(LIBXML_STATIC)
65
- #define XMLPUBVAR __declspec(dllimport) extern
66
- #else
67
- #define XMLPUBVAR extern
68
- #endif
69
- #endif
70
- #if defined(LIBXML_FASTCALL)
71
- #define XMLCALL __fastcall
72
- #else
73
- #define XMLCALL __cdecl
74
- #endif
75
- #define XMLCDECL __cdecl
76
- #endif
54
+ #endif /* platform switch */
77
55
 
78
- /* Windows platform with Borland compiler */
79
- #if defined(_WIN32) && defined(__BORLANDC__)
80
- #undef XMLPUBFUN
81
- #undef XMLPUBVAR
82
- #undef XMLCALL
83
- #undef XMLCDECL
84
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
85
- #define XMLPUBFUN __declspec(dllexport)
86
- #define XMLPUBVAR __declspec(dllexport) extern
87
- #else
88
- #define XMLPUBFUN
89
- #if !defined(LIBXML_STATIC)
90
- #define XMLPUBVAR __declspec(dllimport) extern
91
- #else
92
- #define XMLPUBVAR extern
93
- #endif
94
- #endif
95
- #define XMLCALL __cdecl
96
- #define XMLCDECL __cdecl
97
- #endif
98
-
99
- /* Windows platform with GNU compiler (Mingw) */
100
- #if defined(_WIN32) && defined(__MINGW32__)
101
- #undef XMLPUBFUN
102
- #undef XMLPUBVAR
103
- #undef XMLCALL
104
- #undef XMLCDECL
105
- /*
106
- * if defined(IN_LIBXML) this raises problems on mingw with msys
107
- * _imp__xmlFree listed as missing. Try to workaround the problem
108
- * by also making that declaration when compiling client code.
109
- */
110
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
111
- #define XMLPUBFUN __declspec(dllexport)
112
- #define XMLPUBVAR __declspec(dllexport) extern
113
- #else
114
- #define XMLPUBFUN
115
- #if !defined(LIBXML_STATIC)
116
- #define XMLPUBVAR __declspec(dllimport) extern
117
- #else
118
- #define XMLPUBVAR extern
119
- #endif
120
- #endif
121
- #define XMLCALL __cdecl
122
- #define XMLCDECL __cdecl
123
- #endif
56
+ /*
57
+ * XMLPUBFUN:
58
+ *
59
+ * Macro which declares an exportable function
60
+ */
61
+ #define XMLPUBFUN XMLPUBLIC
124
62
 
125
- /* Cygwin platform (does not define _WIN32), GNU compiler */
126
- #if defined(__CYGWIN__)
127
- #undef XMLPUBFUN
128
- #undef XMLPUBVAR
129
- #undef XMLCALL
130
- #undef XMLCDECL
131
- #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
132
- #define XMLPUBFUN __declspec(dllexport)
133
- #define XMLPUBVAR __declspec(dllexport)
134
- #else
135
- #define XMLPUBFUN
136
- #if !defined(LIBXML_STATIC)
137
- #define XMLPUBVAR __declspec(dllimport) extern
138
- #else
139
- #define XMLPUBVAR extern
140
- #endif
141
- #endif
142
- #define XMLCALL __cdecl
143
- #define XMLCDECL __cdecl
144
- #endif
63
+ /**
64
+ * XMLPUBVAR:
65
+ *
66
+ * Macro which declares an exportable variable
67
+ */
68
+ #define XMLPUBVAR XMLPUBLIC extern
145
69
 
146
70
  /* Compatibility */
147
71
  #if !defined(LIBXML_DLL_IMPORT)