MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / xmlSaveFormatFileTo

Function xmlSaveFormatFileTo

Externals/LibXML/xmlsave.c:2281–2305  ·  view source on GitHub ↗

* xmlSaveFormatFileTo: * @buf: an output I/O buffer * @cur: the document * @encoding: the encoding if any assuming the I/O layer handles the trancoding * @format: should formatting spaces been added * * 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 c

Source from the content-addressed store, hash-verified

2279 * returns: the number of bytes written or -1 in case of failure.
2280 */
2281int
2282xmlSaveFormatFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur,
2283 const char *encoding, int format)
2284{
2285 xmlSaveCtxt ctxt;
2286 int ret;
2287
2288 if (buf == NULL) return(-1);
2289 if ((cur == NULL) ||
2290 ((cur->type != XML_DOCUMENT_NODE) &&
2291 (cur->type != XML_HTML_DOCUMENT_NODE))) {
2292 xmlOutputBufferClose(buf);
2293 return(-1);
2294 }
2295 memset(&ctxt, 0, sizeof(ctxt));
2296 ctxt.doc = cur;
2297 ctxt.buf = buf;
2298 ctxt.level = 0;
2299 ctxt.format = format;
2300 ctxt.encoding = (const xmlChar *) encoding;
2301 xmlSaveCtxtInit(&ctxt);
2302 xmlDocContentDumpOutput(&ctxt, cur);
2303 ret = xmlOutputBufferClose(buf);
2304 return (ret);
2305}
2306
2307/**
2308 * xmlSaveFormatFileEnc:

Callers 4

xmlDumpXMLCatalogFunction · 0.85
test_xmlSaveFormatFileToFunction · 0.85
libxml_saveNodeToFunction · 0.85

Calls 4

xmlOutputBufferCloseFunction · 0.85
memsetFunction · 0.85
xmlSaveCtxtInitFunction · 0.85
xmlDocContentDumpOutputFunction · 0.85

Tested by 1

test_xmlSaveFormatFileToFunction · 0.68