1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-27 14:03:36 +03:00

Bugfix - parser.c xmlIO.c xmlIO.h: fixed bug 26650, and improved the

Bugfix
- parser.c xmlIO.c xmlIO.h: fixed bug 26650, and improved the global
  init function.
Daniel
This commit is contained in:
Daniel Veillard 2000-10-04 12:40:27 +00:00
parent 970112a914
commit 7cfce324d8
5 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Wed Oct 4 14:39:01 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.c xmlIO.c xmlIO.h: fixed bug 26650, and improved
the global init function.
Tue Oct 3 11:28:52 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* HTMLparser.c: Doohhh, attribute name parsing was still case

View File

@ -71,6 +71,7 @@ struct _xmlOutputBuffer {
* Interfaces for input
*/
void xmlRegisterDefaultInputCallbacks (void);
xmlParserInputBufferPtr
xmlAllocParserInputBuffer (xmlCharEncoding enc);
@ -108,6 +109,7 @@ int xmlRegisterInputCallbacks (xmlInputMatchCallback match,
/*
* Interfaces for output
*/
void xmlRegisterDefaultOutputCallbacks(void);
xmlOutputBufferPtr
xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);

View File

@ -9499,6 +9499,10 @@ xmlParseDoc(xmlChar *cur) {
* *
************************************************************************/
#ifdef LIBXML_XPATH_ENABLED
#include <libxml/xpath.h>
#endif
static int xmlParserInitialized = 0;
/**
@ -9516,9 +9520,14 @@ xmlInitParser(void) {
xmlInitCharEncodingHandlers();
xmlInitializePredefinedEntities();
xmlDefaultSAXHandlerInit();
xmlRegisterDefaultInputCallbacks();
xmlRegisterDefaultOutputCallbacks();
#ifdef LIBXML_HTML_ENABLED
htmlInitAutoClose();
htmlDefaultSAXHandlerInit();
#endif
#ifdef LIBXML_XPATH_ENABLED
xmlXPathInit();
#endif
xmlParserInitialized = 1;
}

View File

@ -644,6 +644,9 @@ xmlRegisterOutputCallbacks(xmlOutputMatchCallback match,
*/
void
xmlRegisterDefaultInputCallbacks(void) {
if (xmlInputCallbackInitialized)
return;
xmlRegisterInputCallbacks(xmlFileMatch, xmlFileOpen,
xmlFileRead, xmlFileClose);
#ifdef HAVE_ZLIB_H
@ -660,6 +663,7 @@ xmlRegisterDefaultInputCallbacks(void) {
xmlRegisterInputCallbacks(xmlIOFTPMatch, xmlIOFTPOpen,
xmlIOFTPRead, xmlIOFTPClose);
#endif /* LIBXML_FTP_ENABLED */
xmlInputCallbackInitialized = 1;
}
/**
@ -669,6 +673,9 @@ xmlRegisterDefaultInputCallbacks(void) {
*/
void
xmlRegisterDefaultOutputCallbacks(void) {
if (xmlOutputCallbackInitialized)
return;
xmlRegisterOutputCallbacks(xmlFileMatch, xmlFileOpenW,
xmlFileWrite, xmlFileClose);
/*********************************
@ -693,6 +700,7 @@ xmlRegisterDefaultOutputCallbacks(void) {
xmlIOFTPWrite, xmlIOFTPClose);
#endif
**********************************/
xmlOutputCallbackInitialized = 1;
}
/**

View File

@ -71,6 +71,7 @@ struct _xmlOutputBuffer {
* Interfaces for input
*/
void xmlRegisterDefaultInputCallbacks (void);
xmlParserInputBufferPtr
xmlAllocParserInputBuffer (xmlCharEncoding enc);
@ -108,6 +109,7 @@ int xmlRegisterInputCallbacks (xmlInputMatchCallback match,
/*
* Interfaces for output
*/
void xmlRegisterDefaultOutputCallbacks(void);
xmlOutputBufferPtr
xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);