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

Function xmlNewTextWriterMemory

ThirdParty/libxml2/vtklibxml2/xmlwriter.c:266–290  ·  view source on GitHub ↗

* xmlNewTextWriterMemory: * @buf: xmlBufferPtr * @compression: compress the output? * * Create a new xmlNewTextWriter structure with @buf as output * TODO: handle compression * * Returns the new xmlTextWriterPtr or NULL in case of error */

Source from the content-addressed store, hash-verified

264 * Returns the new xmlTextWriterPtr or NULL in case of error
265 */
266xmlTextWriterPtr
267xmlNewTextWriterMemory(xmlBufferPtr buf, int compression ATTRIBUTE_UNUSED)
268{
269 xmlTextWriterPtr ret;
270 xmlOutputBufferPtr out;
271
272/*::todo handle compression */
273 out = xmlOutputBufferCreateBuffer(buf, NULL);
274
275 if (out == NULL) {
276 xmlWriterErrMsg(NULL, XML_ERR_NO_MEMORY,
277 "xmlNewTextWriterMemory : out of memory!\n");
278 return NULL;
279 }
280
281 ret = xmlNewTextWriter(out);
282 if (ret == NULL) {
283 xmlWriterErrMsg(NULL, XML_ERR_NO_MEMORY,
284 "xmlNewTextWriterMemory : out of memory!\n");
285 xmlOutputBufferClose(out);
286 return NULL;
287 }
288
289 return ret;
290}
291
292/**
293 * xmlNewTextWriterPushParser:

Callers

nothing calls this directly

Calls 4

xmlWriterErrMsgFunction · 0.85
xmlNewTextWriterFunction · 0.85
xmlOutputBufferCloseFunction · 0.85

Tested by

no test coverage detected