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

Function xmlNewStreamCtxt

ThirdParty/libxml2/vtklibxml2/pattern.c:1685–1709  ·  view source on GitHub ↗

* xmlNewStreamCtxt: * @size: the number of expected states * * build a new stream context * * Returns the new structure or NULL in case of error. */

Source from the content-addressed store, hash-verified

1683 * Returns the new structure or NULL in case of error.
1684 */
1685static xmlStreamCtxtPtr
1686xmlNewStreamCtxt(xmlStreamCompPtr stream) {
1687 xmlStreamCtxtPtr cur;
1688
1689 cur = (xmlStreamCtxtPtr) xmlMalloc(sizeof(xmlStreamCtxt));
1690 if (cur == NULL) {
1691 ERROR(NULL, NULL, NULL,
1692 "xmlNewStreamCtxt: malloc failed\n");
1693 return(NULL);
1694 }
1695 memset(cur, 0, sizeof(xmlStreamCtxt));
1696 cur->states = (int *) xmlMalloc(4 * 2 * sizeof(int));
1697 if (cur->states == NULL) {
1698 xmlFree(cur);
1699 ERROR(NULL, NULL, NULL,
1700 "xmlNewStreamCtxt: malloc failed\n");
1701 return(NULL);
1702 }
1703 cur->nbState = 0;
1704 cur->maxState = 4;
1705 cur->level = 0;
1706 cur->comp = stream;
1707 cur->blockLevel = -1;
1708 return(cur);
1709}
1710
1711/**
1712 * xmlFreeStreamCtxt:

Callers 1

xmlPatternGetStreamCtxtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected