* 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 */
| 228 | * Returns the new xmlTextWriterPtr or NULL in case of error |
| 229 | */ |
| 230 | xmlTextWriterPtr |
| 231 | xmlNewTextWriterFilename(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: |
nothing calls this directly
no test coverage detected