* 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 */
| 264 | * Returns the new xmlTextWriterPtr or NULL in case of error |
| 265 | */ |
| 266 | xmlTextWriterPtr |
| 267 | xmlNewTextWriterMemory(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: |
nothing calls this directly
no test coverage detected