[libxml2] Fix calls to deprecated init/cleanup functions



commit 92bff8661446b17ae8d02045d94d521d881657a6
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Mar 29 14:18:31 2022 +0200

    Fix calls to deprecated init/cleanup functions
    
    Only use xmlInitParser/xmlCleanupParser.

 parser.c          | 2 --
 parserInternals.c | 2 +-
 testAutomata.c    | 2 +-
 testRegexp.c      | 2 +-
 testRelax.c       | 1 -
 testSchemas.c     | 1 -
 testXPath.c       | 3 ++-
 7 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/parser.c b/parser.c
index 6531c9f8..c00b0cfd 100644
--- a/parser.c
+++ b/parser.c
@@ -10882,8 +10882,6 @@ xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) {
     if ((ctxt == NULL) || (ctxt->input == NULL))
         return(-1);
 
-    xmlDefaultSAXHandlerInit();
-
     xmlDetectSAX2(ctxt);
 
     GROW;
diff --git a/parserInternals.c b/parserInternals.c
index 9845044e..a68a32fa 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -1554,7 +1554,7 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
         return(-1);
     }
 
-    xmlDefaultSAXHandlerInit();
+    xmlInitParser();
 
     if (ctxt->dict == NULL)
        ctxt->dict = xmlDictCreate();
diff --git a/testAutomata.c b/testAutomata.c
index b89611cf..8d3cb27a 100644
--- a/testAutomata.c
+++ b/testAutomata.c
@@ -216,7 +216,7 @@ testRegexpFile(const char *filename) {
 
 int main(int argc, char **argv) {
 
-    xmlInitMemory();
+    xmlInitParser();
 
     if (argc == 1) {
        int ret;
diff --git a/testRegexp.c b/testRegexp.c
index 2511b210..fdecdba0 100644
--- a/testRegexp.c
+++ b/testRegexp.c
@@ -278,7 +278,7 @@ int main(int argc, char **argv) {
     char *filename = NULL;
     int i;
 
-    xmlInitMemory();
+    xmlInitParser();
 
     if (argc <= 1) {
        usage(argv[0]);
diff --git a/testRelax.c b/testRelax.c
index ad801b12..b1701606 100644
--- a/testRelax.c
+++ b/testRelax.c
@@ -169,7 +169,6 @@ int main(int argc, char **argv) {
        printf("\t--memory : test the schemas in memory parsing\n");
 #endif
     }
-    xmlRelaxNGCleanupTypes();
     xmlCleanupParser();
     xmlMemoryDump();
 
diff --git a/testSchemas.c b/testSchemas.c
index f79adf04..a8d2d1d5 100644
--- a/testSchemas.c
+++ b/testSchemas.c
@@ -160,7 +160,6 @@ int main(int argc, char **argv) {
 #endif
     }
 failed_schemas:
-    xmlSchemaCleanupTypes();
     xmlCleanupParser();
     xmlMemoryDump();
 
diff --git a/testXPath.c b/testXPath.c
index 810abfb8..4e2cf2ad 100644
--- a/testXPath.c
+++ b/testXPath.c
@@ -130,6 +130,8 @@ int main(int argc, char **argv) {
     int usefile = 0;
     char *filename = NULL;
 
+    xmlInitParser();
+
     for (i = 1; i < argc ; i++) {
 #if defined(LIBXML_XPTR_ENABLED)
        if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr")))
@@ -158,7 +160,6 @@ int main(int argc, char **argv) {
     xmlSubstituteEntitiesDefaultValue = 1;
 #ifdef LIBXML_SAX1_ENABLED
     if (nocdata != 0) {
-       xmlDefaultSAXHandlerInit();
        xmlDefaultSAXHandler.cdataBlock = NULL;
     }
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]