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

Function htmlSaveFile

ThirdParty/libxml2/vtklibxml2/HTMLtree.c:1051–1075  ·  view source on GitHub ↗

* htmlSaveFile: * @filename: the filename (or URL) * @cur: the document * * Dump an HTML document to a file. If @filename is "-" the stdout file is * used. * returns: the number of byte written or -1 in case of failure. */

Source from the content-addressed store, hash-verified

1049 * returns: the number of byte written or -1 in case of failure.
1050 */
1051int
1052htmlSaveFile(const char *filename, xmlDocPtr cur) {
1053 xmlOutputBufferPtr buf;
1054 xmlCharEncodingHandlerPtr handler = NULL;
1055 const char *encoding;
1056 int ret;
1057
1058 if ((cur == NULL) || (filename == NULL))
1059 return(-1);
1060
1061 xmlInitParser();
1062
1063 encoding = (const char *) htmlGetMetaEncoding(cur);
1064 handler = htmlFindOutputEncoder(encoding);
1065 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression);
1066 if (buf == NULL) {
1067 xmlCharEncCloseFunc(handler);
1068 return(0);
1069 }
1070
1071 htmlDocContentDumpOutput(buf, cur, NULL);
1072
1073 ret = xmlOutputBufferClose(buf);
1074 return(ret);
1075}
1076
1077/**
1078 * htmlSaveFileFormat:

Callers 3

parseAndPrintFileFunction · 0.85
xmlShellWriteFunction · 0.85
xmlShellSaveFunction · 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