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

Function xmlSaveToFilename

ThirdParty/libxml2/vtklibxml2/xmlsave.c:2034–2050  ·  view source on GitHub ↗

* xmlSaveToFilename: * @filename: a file name or an URL * @encoding: the encoding name to use or NULL * @options: a set of xmlSaveOptions * * Create a document saving context serializing to a filename or possibly * to an URL (but this is less reliable) 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

2032 * Returns a new serialization context or NULL in case of error.
2033 */
2034xmlSaveCtxtPtr
2035xmlSaveToFilename(const char *filename, const char *encoding, int options)
2036{
2037 xmlSaveCtxtPtr ret;
2038 int compression = 0; /* TODO handle compression option */
2039
2040 ret = xmlNewSaveCtxt(encoding, options);
2041 if (ret == NULL) return(NULL);
2042 ret->buf = xmlOutputBufferCreateFilename(filename, ret->handler,
2043 compression);
2044 if (ret->buf == NULL) {
2045 xmlCharEncCloseFunc(ret->handler);
2046 xmlFreeSaveCtxt(ret);
2047 return(NULL);
2048 }
2049 return(ret);
2050}
2051
2052/**
2053 * xmlSaveToBuffer:

Callers 1

parseAndPrintFileFunction · 0.85

Calls 4

xmlNewSaveCtxtFunction · 0.85
xmlCharEncCloseFuncFunction · 0.85
xmlFreeSaveCtxtFunction · 0.85

Tested by

no test coverage detected