MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / xmlReaderNewMemory

Function xmlReaderNewMemory

Externals/LibXML/xmlreader.c:5400–5417  ·  view source on GitHub ↗

* xmlReaderNewMemory: * @reader: an XML reader * @buffer: a pointer to a char array * @size: the size of the array * @URL: the base URL to use for the document * @encoding: the document encoding, or NULL * @options: a combination of xmlParserOption * * Setup an xmltextReader to parse an XML in-memory document. * The parsing flags @options are a combination of xmlParserOption. * Thi

Source from the content-addressed store, hash-verified

5398 * Returns 0 in case of success and -1 in case of error
5399 */
5400int
5401xmlReaderNewMemory(xmlTextReaderPtr reader, const char *buffer, int size,
5402 const char *URL, const char *encoding, int options)
5403{
5404 xmlParserInputBufferPtr input;
5405
5406 if (reader == NULL)
5407 return (-1);
5408 if (buffer == NULL)
5409 return (-1);
5410
5411 input = xmlParserInputBufferCreateStatic(buffer, size,
5412 XML_CHAR_ENCODING_NONE);
5413 if (input == NULL) {
5414 return (-1);
5415 }
5416 return (xmlTextReaderSetup(reader, input, URL, encoding, options));
5417}
5418
5419/**
5420 * xmlReaderNewFd:

Callers 2

test_xmlReaderNewMemoryFunction · 0.85
xmlReaderNewDocFunction · 0.85

Calls 2

xmlTextReaderSetupFunction · 0.85

Tested by 1

test_xmlReaderNewMemoryFunction · 0.68