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

Function xmlReaderNewMemory

ThirdParty/libxml2/vtklibxml2/xmlreader.c:5421–5438  ·  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

5419 * Returns 0 in case of success and -1 in case of error
5420 */
5421int
5422xmlReaderNewMemory(xmlTextReaderPtr reader, const char *buffer, int size,
5423 const char *URL, const char *encoding, int options)
5424{
5425 xmlParserInputBufferPtr input;
5426
5427 if (reader == NULL)
5428 return (-1);
5429 if (buffer == NULL)
5430 return (-1);
5431
5432 input = xmlParserInputBufferCreateMem(buffer, size,
5433 XML_CHAR_ENCODING_NONE);
5434 if (input == NULL) {
5435 return (-1);
5436 }
5437 return (xmlTextReaderSetup(reader, input, URL, encoding, options));
5438}
5439
5440/**
5441 * xmlReaderNewFd:

Callers 1

xmlReaderNewDocFunction · 0.85

Calls 2

xmlTextReaderSetupFunction · 0.85

Tested by

no test coverage detected