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

Function xmlSaveFileTo

ThirdParty/libxml2/vtklibxml2/xmlsave.c:2836–2856  ·  view source on GitHub ↗

* xmlSaveFileTo: * @buf: an output I/O buffer * @cur: the document * @encoding: the encoding if any assuming the I/O layer handles the transcoding * * Dump an XML document to an I/O buffer. * Warning ! This call xmlOutputBufferClose() on buf which is not available * after this call. * * returns: the number of bytes written or -1 in case of failure. */

Source from the content-addressed store, hash-verified

2834 * returns: the number of bytes written or -1 in case of failure.
2835 */
2836int
2837xmlSaveFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding) {
2838 xmlSaveCtxt ctxt;
2839 int ret;
2840
2841 if (buf == NULL) return(-1);
2842 if (cur == NULL) {
2843 xmlOutputBufferClose(buf);
2844 return(-1);
2845 }
2846 memset(&ctxt, 0, sizeof(ctxt));
2847 ctxt.buf = buf;
2848 ctxt.level = 0;
2849 ctxt.format = 0;
2850 ctxt.encoding = (const xmlChar *) encoding;
2851 xmlSaveCtxtInit(&ctxt);
2852 ctxt.options |= XML_SAVE_AS_XML;
2853 xmlDocContentDumpOutput(&ctxt, cur);
2854 ret = xmlOutputBufferClose(buf);
2855 return(ret);
2856}
2857
2858/**
2859 * xmlSaveFormatFileTo:

Callers

nothing calls this directly

Calls 3

xmlOutputBufferCloseFunction · 0.85
xmlSaveCtxtInitFunction · 0.85
xmlDocContentDumpOutputFunction · 0.85

Tested by

no test coverage detected