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

Function xmlNewTextWriterPushParser

ThirdParty/libxml2/vtklibxml2/xmlwriter.c:304–337  ·  view source on GitHub ↗

* xmlNewTextWriterPushParser: * @ctxt: xmlParserCtxtPtr to hold the new XML document tree * @compression: compress the output? * * Create a new xmlNewTextWriter structure with @ctxt as output * NOTE: the @ctxt context will be freed with the resulting writer * (if the call succeeds). * TODO: handle compression * * Returns the new xmlTextWriterPtr or NULL in case of error */

Source from the content-addressed store, hash-verified

302 * Returns the new xmlTextWriterPtr or NULL in case of error
303 */
304xmlTextWriterPtr
305xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt,
306 int compression ATTRIBUTE_UNUSED)
307{
308 xmlTextWriterPtr ret;
309 xmlOutputBufferPtr out;
310
311 if (ctxt == NULL) {
312 xmlWriterErrMsg(NULL, XML_ERR_INTERNAL_ERROR,
313 "xmlNewTextWriterPushParser : invalid context!\n");
314 return NULL;
315 }
316
317 out = xmlOutputBufferCreateIO(xmlTextWriterWriteDocCallback,
318 xmlTextWriterCloseDocCallback,
319 (void *) ctxt, NULL);
320 if (out == NULL) {
321 xmlWriterErrMsg(NULL, XML_ERR_INTERNAL_ERROR,
322 "xmlNewTextWriterPushParser : error at xmlOutputBufferCreateIO!\n");
323 return NULL;
324 }
325
326 ret = xmlNewTextWriter(out);
327 if (ret == NULL) {
328 xmlWriterErrMsg(NULL, XML_ERR_INTERNAL_ERROR,
329 "xmlNewTextWriterPushParser : error at xmlNewTextWriter!\n");
330 xmlOutputBufferClose(out);
331 return NULL;
332 }
333
334 ret->ctxt = ctxt;
335
336 return ret;
337}
338
339/**
340 * xmlNewTextWriterDoc:

Callers 2

xmlNewTextWriterDocFunction · 0.85
xmlNewTextWriterTreeFunction · 0.85

Calls 4

xmlWriterErrMsgFunction · 0.85
xmlOutputBufferCreateIOFunction · 0.85
xmlNewTextWriterFunction · 0.85
xmlOutputBufferCloseFunction · 0.85

Tested by

no test coverage detected