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

Function xmlSaveToIO

ThirdParty/libxml2/vtklibxml2/xmlsave.c:2093–2109  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

2091 * Returns a new serialization context or NULL in case of error.
2092 */
2093xmlSaveCtxtPtr
2094xmlSaveToIO(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:

Callers

nothing calls this directly

Calls 4

xmlNewSaveCtxtFunction · 0.85
xmlOutputBufferCreateIOFunction · 0.85
xmlCharEncCloseFuncFunction · 0.85
xmlFreeSaveCtxtFunction · 0.85

Tested by

no test coverage detected