Blob Blame History Raw
#include <stdlib.h>
#include <expat.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>

static int default_handler(XML_Parser parser,
                            const XML_Char *context,
                            const XML_Char *base,
                            const XML_Char *systemId,
                            const XML_Char *publicId)
{
    fprintf(stderr, "default_handler.\n");
}

int main(int argc, char **argv)
{
    static const char pythontest1[] = { '\0', '\r', '\n' };
    XML_Parser p;

    p = XML_ParserCreate(NULL);
 
    XML_SetExternalEntityRefHandler(p, default_handler);

    if (XML_Parse(p, pythontest1, 3, 1) == 0)
        puts("parse fail");

    XML_ParserFree(p);

    return 0;
}