mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
Fix calls to deprecated init/cleanup functions
Only use xmlInitParser/xmlCleanupParser.
This commit is contained in:
2
parser.c
2
parser.c
@@ -10882,8 +10882,6 @@ xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) {
|
|||||||
if ((ctxt == NULL) || (ctxt->input == NULL))
|
if ((ctxt == NULL) || (ctxt->input == NULL))
|
||||||
return(-1);
|
return(-1);
|
||||||
|
|
||||||
xmlDefaultSAXHandlerInit();
|
|
||||||
|
|
||||||
xmlDetectSAX2(ctxt);
|
xmlDetectSAX2(ctxt);
|
||||||
|
|
||||||
GROW;
|
GROW;
|
||||||
|
|||||||
@@ -1554,7 +1554,7 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlDefaultSAXHandlerInit();
|
xmlInitParser();
|
||||||
|
|
||||||
if (ctxt->dict == NULL)
|
if (ctxt->dict == NULL)
|
||||||
ctxt->dict = xmlDictCreate();
|
ctxt->dict = xmlDictCreate();
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ testRegexpFile(const char *filename) {
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
xmlInitMemory();
|
xmlInitParser();
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
int ret;
|
int ret;
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ int main(int argc, char **argv) {
|
|||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
xmlInitMemory();
|
xmlInitParser();
|
||||||
|
|
||||||
if (argc <= 1) {
|
if (argc <= 1) {
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ int main(int argc, char **argv) {
|
|||||||
printf("\t--memory : test the schemas in memory parsing\n");
|
printf("\t--memory : test the schemas in memory parsing\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
xmlRelaxNGCleanupTypes();
|
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
xmlMemoryDump();
|
xmlMemoryDump();
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ int main(int argc, char **argv) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
failed_schemas:
|
failed_schemas:
|
||||||
xmlSchemaCleanupTypes();
|
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
xmlMemoryDump();
|
xmlMemoryDump();
|
||||||
|
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ int main(int argc, char **argv) {
|
|||||||
int usefile = 0;
|
int usefile = 0;
|
||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
|
|
||||||
|
xmlInitParser();
|
||||||
|
|
||||||
for (i = 1; i < argc ; i++) {
|
for (i = 1; i < argc ; i++) {
|
||||||
#if defined(LIBXML_XPTR_ENABLED)
|
#if defined(LIBXML_XPTR_ENABLED)
|
||||||
if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr")))
|
if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr")))
|
||||||
@@ -158,7 +160,6 @@ int main(int argc, char **argv) {
|
|||||||
xmlSubstituteEntitiesDefaultValue = 1;
|
xmlSubstituteEntitiesDefaultValue = 1;
|
||||||
#ifdef LIBXML_SAX1_ENABLED
|
#ifdef LIBXML_SAX1_ENABLED
|
||||||
if (nocdata != 0) {
|
if (nocdata != 0) {
|
||||||
xmlDefaultSAXHandlerInit();
|
|
||||||
xmlDefaultSAXHandler.cdataBlock = NULL;
|
xmlDefaultSAXHandler.cdataBlock = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user