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

Function xmlParserNsPop

ThirdParty/libxml2/vtklibxml2/parser.c:1872–1899  ·  view source on GitHub ↗

* xmlParserNsPop: * @ctxt: an XML parser context * @nr: the number to pop * * Pops the top @nr namespaces and restores the hash table. * * Returns the number of namespaces popped. */

Source from the content-addressed store, hash-verified

1870 * Returns the number of namespaces popped.
1871 */
1872static int
1873xmlParserNsPop(xmlParserCtxtPtr ctxt, int nr)
1874{
1875 int i;
1876
1877 /* assert(nr <= ctxt->nsNr); */
1878
1879 for (i = ctxt->nsNr - 1; i >= ctxt->nsNr - nr; i--) {
1880 const xmlChar *prefix = ctxt->nsTab[i * 2];
1881 xmlParserNsExtra *extra = &ctxt->nsdb->extra[i];
1882
1883 if (prefix == NULL) {
1884 ctxt->nsdb->defaultNsIndex = extra->oldIndex;
1885 } else {
1886 xmlHashedString hprefix;
1887 xmlParserNsBucket *bucket = NULL;
1888
1889 hprefix.name = prefix;
1890 hprefix.hashValue = extra->prefixHashValue;
1891 xmlParserNsLookup(ctxt, &hprefix, &bucket);
1892 /* assert(bucket && bucket->hashValue); */
1893 bucket->index = extra->oldIndex;
1894 }
1895 }
1896
1897 ctxt->nsNr -= nr;
1898 return(nr);
1899}
1900
1901static int
1902xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt, int nr) {

Callers 5

xmlParseEndTag2Function · 0.85
xmlParseContentInternalFunction · 0.85
xmlParseElementStartFunction · 0.85
parser.cFile · 0.85
xmlParseInNodeContextFunction · 0.85

Calls 1

xmlParserNsLookupFunction · 0.85

Tested by

no test coverage detected