* xmlReaderNewDoc: * @reader: an XML reader * @cur: a pointer to a zero terminated string * @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. * This reuses the existing @read
| 5355 | * Returns 0 in case of success and -1 in case of error |
| 5356 | */ |
| 5357 | int |
| 5358 | xmlReaderNewDoc(xmlTextReaderPtr reader, const xmlChar * cur, |
| 5359 | const char *URL, const char *encoding, int options) |
| 5360 | { |
| 5361 | |
| 5362 | int len; |
| 5363 | |
| 5364 | if (cur == NULL) |
| 5365 | return (-1); |
| 5366 | if (reader == NULL) |
| 5367 | return (-1); |
| 5368 | |
| 5369 | len = xmlStrlen(cur); |
| 5370 | return (xmlReaderNewMemory(reader, (const char *)cur, len, |
| 5371 | URL, encoding, options)); |
| 5372 | } |
| 5373 | |
| 5374 | /** |
| 5375 | * xmlReaderNewFile: |
nothing calls this directly
no test coverage detected