* xmlSaveToIO: * @iowrite: an I/O write function * @ioclose: an I/O close function * @ioctx: an I/O handler * @encoding: the encoding name to use or NULL * @options: a set of xmlSaveOptions * * Create a document saving context serializing to a file descriptor * with the encoding and the options given * * Returns a new serialization context or NULL in case of error. */
| 2091 | * Returns a new serialization context or NULL in case of error. |
| 2092 | */ |
| 2093 | xmlSaveCtxtPtr |
| 2094 | xmlSaveToIO(xmlOutputWriteCallback iowrite, |
| 2095 | xmlOutputCloseCallback ioclose, |
| 2096 | void *ioctx, const char *encoding, int options) |
| 2097 | { |
| 2098 | xmlSaveCtxtPtr ret; |
| 2099 | |
| 2100 | ret = xmlNewSaveCtxt(encoding, options); |
| 2101 | if (ret == NULL) return(NULL); |
| 2102 | ret->buf = xmlOutputBufferCreateIO(iowrite, ioclose, ioctx, ret->handler); |
| 2103 | if (ret->buf == NULL) { |
| 2104 | xmlCharEncCloseFunc(ret->handler); |
| 2105 | xmlFreeSaveCtxt(ret); |
| 2106 | return(NULL); |
| 2107 | } |
| 2108 | return(ret); |
| 2109 | } |
| 2110 | |
| 2111 | /** |
| 2112 | * xmlSaveDoc: |
nothing calls this directly
no test coverage detected