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

Function xmlCreateMemoryParserCtxt

ThirdParty/libxml2/vtklibxml2/parser.c:13042–13062  ·  view source on GitHub ↗

* xmlCreateMemoryParserCtxt: * @buffer: a pointer to a char array * @size: the size of the array * * Create a parser context for an XML in-memory document. The input buffer * must not contain a terminating null byte. * * Returns the new parser context or NULL */

Source from the content-addressed store, hash-verified

13040 * Returns the new parser context or NULL
13041 */
13042xmlParserCtxtPtr
13043xmlCreateMemoryParserCtxt(const char *buffer, int size) {
13044 xmlParserCtxtPtr ctxt;
13045 xmlParserInputPtr input;
13046
13047 if (size < 0)
13048 return(NULL);
13049
13050 ctxt = xmlNewParserCtxt();
13051 if (ctxt == NULL)
13052 return(NULL);
13053
13054 input = xmlNewInputMemory(ctxt, NULL, buffer, size, NULL, 0);
13055 if (input == NULL) {
13056 xmlFreeParserCtxt(ctxt);
13057 return(NULL);
13058 }
13059 inputPush(ctxt, input);
13060
13061 return(ctxt);
13062}
13063
13064#ifdef LIBXML_SAX1_ENABLED
13065/**

Callers 2

xmlParseInNodeContextFunction · 0.85
xmlSAXUserParseMemoryFunction · 0.85

Calls 4

xmlNewParserCtxtFunction · 0.85
xmlNewInputMemoryFunction · 0.85
xmlFreeParserCtxtFunction · 0.85
inputPushFunction · 0.85

Tested by

no test coverage detected