mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
parser: Remove remaining calls to xml{Push|Pop}Input
This commit is contained in:
@ -4085,11 +4085,12 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
htmlParseContent(htmlParserCtxtPtr ctxt) {
|
htmlParseContent(htmlParserCtxtPtr ctxt) {
|
||||||
|
GROW;
|
||||||
|
|
||||||
while ((PARSER_STOPPED(ctxt) == 0) &&
|
while ((PARSER_STOPPED(ctxt) == 0) &&
|
||||||
(ctxt->input->cur < ctxt->input->end)) {
|
(ctxt->input->cur < ctxt->input->end)) {
|
||||||
int mode;
|
int mode;
|
||||||
|
|
||||||
GROW;
|
|
||||||
mode = ctxt->endCheckState;
|
mode = ctxt->endCheckState;
|
||||||
|
|
||||||
if ((mode == 0) && (CUR == '<')) {
|
if ((mode == 0) && (CUR == '<')) {
|
||||||
@ -4265,7 +4266,7 @@ htmlCtxtParseContentInternal(htmlParserCtxtPtr ctxt, xmlParserInputPtr input) {
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xmlPushInput(ctxt, input) < 0) {
|
if (xmlCtxtPushInput(ctxt, input) < 0) {
|
||||||
xmlFreeNode(root);
|
xmlFreeNode(root);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
@ -4292,7 +4293,6 @@ htmlCtxtParseContentInternal(htmlParserCtxtPtr ctxt, xmlParserInputPtr input) {
|
|||||||
nodePop(ctxt);
|
nodePop(ctxt);
|
||||||
htmlnamePop(ctxt);
|
htmlnamePop(ctxt);
|
||||||
|
|
||||||
/* xmlPopInput would free the stream */
|
|
||||||
xmlCtxtPopInput(ctxt);
|
xmlCtxtPopInput(ctxt);
|
||||||
|
|
||||||
xmlFreeNode(root);
|
xmlFreeNode(root);
|
||||||
|
4
SAX2.c
4
SAX2.c
@ -325,7 +325,7 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name,
|
|||||||
ctxt->inputNr = 0;
|
ctxt->inputNr = 0;
|
||||||
ctxt->inputMax = 5;
|
ctxt->inputMax = 5;
|
||||||
ctxt->input = NULL;
|
ctxt->input = NULL;
|
||||||
if (xmlPushInput(ctxt, input) < 0)
|
if (xmlCtxtPushInput(ctxt, input) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (input->filename == NULL)
|
if (input->filename == NULL)
|
||||||
@ -346,7 +346,7 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
while (ctxt->inputNr > 1)
|
while (ctxt->inputNr > 1)
|
||||||
xmlPopInput(ctxt);
|
xmlFreeInputStream(xmlCtxtPopInput(ctxt));
|
||||||
|
|
||||||
consumed = ctxt->input->consumed;
|
consumed = ctxt->input->consumed;
|
||||||
buffered = ctxt->input->cur - ctxt->input->base;
|
buffered = ctxt->input->cur - ctxt->input->base;
|
||||||
|
18
parser.c
18
parser.c
@ -2507,9 +2507,11 @@ xmlPopPE(xmlParserCtxtPtr ctxt) {
|
|||||||
ent->flags |= XML_ENT_CHECKED;
|
ent->flags |= XML_ENT_CHECKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlPopInput(ctxt);
|
xmlFreeInputStream(xmlCtxtPopInput(ctxt));
|
||||||
|
|
||||||
xmlParserEntityCheck(ctxt, ent->expandedSize);
|
xmlParserEntityCheck(ctxt, ent->expandedSize);
|
||||||
|
|
||||||
|
GROW;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2589,9 +2591,6 @@ xmlSkipBlankCharsPE(xmlParserCtxtPtr ctxt) {
|
|||||||
*
|
*
|
||||||
* DEPRECATED: Internal function, don't use.
|
* DEPRECATED: Internal function, don't use.
|
||||||
*
|
*
|
||||||
* xmlPopInput: the current input pointed by ctxt->input came to an end
|
|
||||||
* pop it and return the next char.
|
|
||||||
*
|
|
||||||
* Returns the current xmlChar in the parser context
|
* Returns the current xmlChar in the parser context
|
||||||
*/
|
*/
|
||||||
xmlChar
|
xmlChar
|
||||||
@ -7936,13 +7935,15 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
input = xmlNewEntityInputStream(ctxt, entity);
|
input = xmlNewEntityInputStream(ctxt, entity);
|
||||||
if (xmlPushInput(ctxt, input) < 0) {
|
if (xmlCtxtPushInput(ctxt, input) < 0) {
|
||||||
xmlFreeInputStream(input);
|
xmlFreeInputStream(input);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
entity->flags |= XML_ENT_EXPANDING;
|
entity->flags |= XML_ENT_EXPANDING;
|
||||||
|
|
||||||
|
GROW;
|
||||||
|
|
||||||
if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
|
if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
|
||||||
xmlDetectEncoding(ctxt);
|
xmlDetectEncoding(ctxt);
|
||||||
|
|
||||||
@ -11777,7 +11778,7 @@ xmlCtxtParseDtd(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
|
|||||||
const xmlChar *publicId, const xmlChar *systemId) {
|
const xmlChar *publicId, const xmlChar *systemId) {
|
||||||
xmlDtdPtr ret;
|
xmlDtdPtr ret;
|
||||||
|
|
||||||
if (xmlPushInput(ctxt, input) < 0) {
|
if (xmlCtxtPushInput(ctxt, input) < 0) {
|
||||||
xmlFreeInputStream(input);
|
xmlFreeInputStream(input);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
@ -11981,7 +11982,7 @@ xmlCtxtParseContentInternal(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xmlPushInput(ctxt, input) < 0)
|
if (xmlCtxtPushInput(ctxt, input) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
nameNsPush(ctxt, rootName, NULL, NULL, 0, 0);
|
nameNsPush(ctxt, rootName, NULL, NULL, 0, 0);
|
||||||
@ -12048,7 +12049,6 @@ xmlCtxtParseContentInternal(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
|
|||||||
namePop(ctxt);
|
namePop(ctxt);
|
||||||
spacePop(ctxt);
|
spacePop(ctxt);
|
||||||
|
|
||||||
/* xmlPopInput would free the stream */
|
|
||||||
xmlCtxtPopInput(ctxt);
|
xmlCtxtPopInput(ctxt);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@ -12111,7 +12111,7 @@ xmlCtxtParseEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr ent) {
|
|||||||
* - xmlCtxtParseEntity
|
* - xmlCtxtParseEntity
|
||||||
*
|
*
|
||||||
* The nesting depth is limited by the maximum number of inputs,
|
* The nesting depth is limited by the maximum number of inputs,
|
||||||
* see xmlPushInput.
|
* see xmlCtxtPushInput.
|
||||||
*
|
*
|
||||||
* It's possible to make this non-recursive (minNsIndex must be
|
* It's possible to make this non-recursive (minNsIndex must be
|
||||||
* stored in the input struct) at the expense of code readability.
|
* stored in the input struct) at the expense of code readability.
|
||||||
|
Reference in New Issue
Block a user