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

Function xmlNewTextWriterFilename

ThirdParty/libxml2/vtklibxml2/xmlwriter.c:230–254  ·  view source on GitHub ↗

* xmlNewTextWriterFilename: * @uri: the URI of the resource for the output * @compression: compress the output? * * Create a new xmlNewTextWriter structure with @uri as output * * Returns the new xmlTextWriterPtr or NULL in case of error */

Source from the content-addressed store, hash-verified

228 * Returns the new xmlTextWriterPtr or NULL in case of error
229 */
230xmlTextWriterPtr
231xmlNewTextWriterFilename(const char *uri, int compression)
232{
233 xmlTextWriterPtr ret;
234 xmlOutputBufferPtr out;
235
236 out = xmlOutputBufferCreateFilename(uri, NULL, compression);
237 if (out == NULL) {
238 xmlWriterErrMsg(NULL, XML_IO_EIO,
239 "xmlNewTextWriterFilename : cannot open uri\n");
240 return NULL;
241 }
242
243 ret = xmlNewTextWriter(out);
244 if (ret == NULL) {
245 xmlWriterErrMsg(NULL, XML_ERR_NO_MEMORY,
246 "xmlNewTextWriterFilename : out of memory!\n");
247 xmlOutputBufferClose(out);
248 return NULL;
249 }
250
251 ret->indent = 0;
252 ret->doindent = 0;
253 return ret;
254}
255
256/**
257 * xmlNewTextWriterMemory:

Callers

nothing calls this directly

Calls 4

xmlWriterErrMsgFunction · 0.85
xmlNewTextWriterFunction · 0.85
xmlOutputBufferCloseFunction · 0.85

Tested by

no test coverage detected