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

Function htmlDocDump

ThirdParty/libxml2/vtklibxml2/HTMLtree.c:1016–1040  ·  view source on GitHub ↗

* htmlDocDump: * @f: the FILE* * @cur: the document * * Dump an HTML document to an open FILE. * * returns: the number of byte written or -1 in case of failure. */

Source from the content-addressed store, hash-verified

1014 * returns: the number of byte written or -1 in case of failure.
1015 */
1016int
1017htmlDocDump(FILE *f, xmlDocPtr cur) {
1018 xmlOutputBufferPtr buf;
1019 xmlCharEncodingHandlerPtr handler = NULL;
1020 const char *encoding;
1021 int ret;
1022
1023 xmlInitParser();
1024
1025 if ((cur == NULL) || (f == NULL)) {
1026 return(-1);
1027 }
1028
1029 encoding = (const char *) htmlGetMetaEncoding(cur);
1030 handler = htmlFindOutputEncoder(encoding);
1031 buf = xmlOutputBufferCreateFile(f, handler);
1032 if (buf == NULL) {
1033 xmlCharEncCloseFunc(handler);
1034 return(-1);
1035 }
1036 htmlDocContentDumpOutput(buf, cur, NULL);
1037
1038 ret = xmlOutputBufferClose(buf);
1039 return(ret);
1040}
1041
1042/**
1043 * htmlSaveFile:

Callers 2

parseAndPrintFileFunction · 0.85
xmlShellCatFunction · 0.85

Calls 7

xmlInitParserFunction · 0.85
htmlGetMetaEncodingFunction · 0.85
htmlFindOutputEncoderFunction · 0.85
xmlCharEncCloseFuncFunction · 0.85
htmlDocContentDumpOutputFunction · 0.85
xmlOutputBufferCloseFunction · 0.85

Tested by

no test coverage detected