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

Function xmlOutputBufferClose

ThirdParty/libxml2/vtklibxml2/xmlIO.c:1522–1564  ·  view source on GitHub ↗

* xmlOutputBufferClose: * @out: a buffered output * * flushes and close the output I/O channel * and free up all the associated resources * * Returns the number of byte written or a negative xmlParserErrors * code in case of error. */

Source from the content-addressed store, hash-verified

1520 * code in case of error.
1521 */
1522int
1523xmlOutputBufferClose(xmlOutputBufferPtr out)
1524{
1525 int ret;
1526
1527 if (out == NULL)
1528 return (-1);
1529
1530 if (out->writecallback != NULL)
1531 xmlOutputBufferFlush(out);
1532
1533 if (out->closecallback != NULL) {
1534 int code = out->closecallback(out->context);
1535
1536 if ((code != XML_ERR_OK) && (out->error == XML_ERR_OK)) {
1537 if (code < 0)
1538 out->error = XML_IO_UNKNOWN;
1539 else
1540 out->error = code;
1541 }
1542 }
1543
1544 if (out->error != XML_ERR_OK)
1545 ret = -out->error;
1546 else
1547 ret = out->written;
1548
1549 if (out->conv) {
1550 xmlBufFree(out->conv);
1551 out->conv = NULL;
1552 }
1553 if (out->encoder != NULL) {
1554 xmlCharEncCloseFunc(out->encoder);
1555 }
1556 if (out->buffer != NULL) {
1557 xmlBufFree(out->buffer);
1558 out->buffer = NULL;
1559 }
1560
1561 xmlFree(out);
1562
1563 return(ret);
1564}
1565#endif /* LIBXML_OUTPUT_ENABLED */
1566
1567/**

Callers 15

xmlC14NDocDumpMemoryFunction · 0.85
xmlC14NDocSaveFunction · 0.85
doXPathDumpFunction · 0.85
htmlNodeDumpFileFormatFunction · 0.85
htmlDocDumpMemoryFormatFunction · 0.85
htmlDocDumpFunction · 0.85
htmlSaveFileFunction · 0.85
htmlSaveFileFormatFunction · 0.85
xmlFreeSaveCtxtFunction · 0.85

Calls 3

xmlOutputBufferFlushFunction · 0.85
xmlBufFreeFunction · 0.85
xmlCharEncCloseFuncFunction · 0.85

Tested by

no test coverage detected