MCPcopy Create free account
hub / github.com/Kitware/CMake / XML_ParserReset

Function XML_ParserReset

Utilities/cmexpat/lib/xmlparse.c:1637–1694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1635}
1636
1637XML_Bool XMLCALL
1638XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) {
1639 TAG *tStk;
1640 OPEN_INTERNAL_ENTITY *openEntityList;
1641
1642 if (parser == NULL)
1643 return XML_FALSE;
1644
1645 if (parser->m_parentParser)
1646 return XML_FALSE;
1647 /* move m_tagStack to m_freeTagList */
1648 tStk = parser->m_tagStack;
1649 while (tStk) {
1650 TAG *tag = tStk;
1651 tStk = tStk->parent;
1652 tag->parent = parser->m_freeTagList;
1653 moveToFreeBindingList(parser, tag->bindings);
1654 tag->bindings = NULL;
1655 parser->m_freeTagList = tag;
1656 }
1657 /* move m_openInternalEntities to m_freeInternalEntities */
1658 openEntityList = parser->m_openInternalEntities;
1659 while (openEntityList) {
1660 OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
1661 openEntityList = openEntity->next;
1662 openEntity->next = parser->m_freeInternalEntities;
1663 parser->m_freeInternalEntities = openEntity;
1664 }
1665 /* move m_openAttributeEntities to m_freeAttributeEntities (i.e. same task but
1666 * for attributes) */
1667 openEntityList = parser->m_openAttributeEntities;
1668 while (openEntityList) {
1669 OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
1670 openEntityList = openEntity->next;
1671 openEntity->next = parser->m_freeAttributeEntities;
1672 parser->m_freeAttributeEntities = openEntity;
1673 }
1674 /* move m_openValueEntities to m_freeValueEntities (i.e. same task but
1675 * for value entities) */
1676 openEntityList = parser->m_openValueEntities;
1677 while (openEntityList) {
1678 OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
1679 openEntityList = openEntity->next;
1680 openEntity->next = parser->m_freeValueEntities;
1681 parser->m_freeValueEntities = openEntity;
1682 }
1683 moveToFreeBindingList(parser, parser->m_inheritedBindings);
1684 FREE(parser, parser->m_unknownEncodingMem);
1685 if (parser->m_unknownEncodingRelease)
1686 parser->m_unknownEncodingRelease(parser->m_unknownEncodingData);
1687 poolClear(&parser->m_tempPool);
1688 poolClear(&parser->m_temp2Pool);
1689 FREE(parser, (void *)parser->m_protocolEncodingName);
1690 parser->m_protocolEncodingName = NULL;
1691 parserInit(parser, encodingName);
1692 dtdReset(parser->m_dtd, parser);
1693 return XML_TRUE;
1694}

Callers

nothing calls this directly

Calls 4

moveToFreeBindingListFunction · 0.85
poolClearFunction · 0.85
parserInitFunction · 0.85
dtdResetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…