diff options
Diffstat (limited to 'HTMLtree.c')
-rw-r--r-- | HTMLtree.c | 22 |
1 files changed, 19 insertions, 3 deletions
@@ -506,16 +506,17 @@ htmlNodeDumpFile(FILE *out, xmlDocPtr doc, xmlNodePtr cur) { } /** - * htmlDocDumpMemory: + * htmlDocDumpMemoryFormat: * @cur: the document * @mem: OUT: the memory pointer * @size: OUT: the memory length + * @format: should formatting spaces been added * * Dump an HTML document in memory and return the xmlChar * and it's size. * It's up to the caller to free the memory. */ void -htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { +htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) { xmlOutputBufferPtr buf; xmlCharEncodingHandlerPtr handler = NULL; const char *encoding; @@ -572,7 +573,8 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { return; } - htmlDocContentDumpOutput(buf, cur, NULL); + htmlDocContentDumpFormatOutput(buf, cur, NULL, format); + xmlOutputBufferFlush(buf); if (buf->conv != NULL) { *size = buf->conv->use; @@ -584,6 +586,20 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { (void)xmlOutputBufferClose(buf); } +/** + * htmlDocDumpMemory: + * @cur: the document + * @mem: OUT: the memory pointer + * @size: OUT: the memory length + * + * Dump an HTML document in memory and return the xmlChar * and it's size. + * It's up to the caller to free the memory. + */ +void +htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { + htmlDocDumpMemoryFormat(cur, mem, size, 1); +} + /************************************************************************ * * |