MCPcopy Create free account
hub / github.com/Kitware/VTK / htmlCtxtReset

Function htmlCtxtReset

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:6146–6234  ·  view source on GitHub ↗

* htmlCtxtReset: * @ctxt: an HTML parser context * * Reset a parser context */

Source from the content-addressed store, hash-verified

6144 * Reset a parser context
6145 */
6146void
6147htmlCtxtReset(htmlParserCtxtPtr ctxt)
6148{
6149 xmlParserInputPtr input;
6150 xmlDictPtr dict;
6151
6152 if (ctxt == NULL)
6153 return;
6154
6155 dict = ctxt->dict;
6156
6157 while ((input = inputPop(ctxt)) != NULL) { /* Non consuming */
6158 xmlFreeInputStream(input);
6159 }
6160 ctxt->inputNr = 0;
6161 ctxt->input = NULL;
6162
6163 ctxt->spaceNr = 0;
6164 if (ctxt->spaceTab != NULL) {
6165 ctxt->spaceTab[0] = -1;
6166 ctxt->space = &ctxt->spaceTab[0];
6167 } else {
6168 ctxt->space = NULL;
6169 }
6170
6171
6172 ctxt->nodeNr = 0;
6173 ctxt->node = NULL;
6174
6175 ctxt->nameNr = 0;
6176 ctxt->name = NULL;
6177
6178 ctxt->nsNr = 0;
6179
6180 DICT_FREE(ctxt->version);
6181 ctxt->version = NULL;
6182 DICT_FREE(ctxt->encoding);
6183 ctxt->encoding = NULL;
6184 DICT_FREE(ctxt->extSubURI);
6185 ctxt->extSubURI = NULL;
6186 DICT_FREE(ctxt->extSubSystem);
6187 ctxt->extSubSystem = NULL;
6188
6189 if (ctxt->directory != NULL) {
6190 xmlFree(ctxt->directory);
6191 ctxt->directory = NULL;
6192 }
6193
6194 if (ctxt->myDoc != NULL)
6195 xmlFreeDoc(ctxt->myDoc);
6196 ctxt->myDoc = NULL;
6197
6198 ctxt->standalone = -1;
6199 ctxt->hasExternalSubset = 0;
6200 ctxt->hasPErefs = 0;
6201 ctxt->html = 1;
6202 ctxt->instate = XML_PARSER_START;
6203

Callers 5

htmlCtxtReadDocFunction · 0.85
htmlCtxtReadFileFunction · 0.85
htmlCtxtReadMemoryFunction · 0.85
htmlCtxtReadFdFunction · 0.85
htmlCtxtReadIOFunction · 0.85

Calls 6

inputPopFunction · 0.85
xmlFreeInputStreamFunction · 0.85
xmlFreeDocFunction · 0.85
xmlInitNodeInfoSeqFunction · 0.85
xmlHashFreeFunction · 0.85
xmlResetErrorFunction · 0.85

Tested by

no test coverage detected