27 lines
529 B
C
27 lines
529 B
C
#include <stdlib.h>
|
|
#include <expat.h>
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <string.h>
|
|
|
|
static void default_handler(void *userData, const XML_Char *s, int len)
|
|
{
|
|
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_SetCommentHandler(p, default_handler);
|
|
|
|
if (XML_Parse(p, pythontest1, 3, 1) == 0)
|
|
puts("parse fail");
|
|
|
|
XML_ParserFree(p);
|
|
|
|
return 0;
|
|
}
|