Initial commit.
[agg.git] / agg.c
blob0255074deb6e35d44913cb31beb71837c9716776
1 #include <expat.h>
2 #include <stdio.h>
3 #include "config.h"
4 #include "expat.h"
5 #include "bool.h"
6 #include "fail.h"
8 int main()
10 char buf[READ_BUFFER_SIZE];
11 bool done = false;
12 unsigned len;
14 XML_Parser p = XML_ParserCreate(NULL);
15 expat_setup(&p);
17 do {
18 len = fread(buf, 1, READ_BUFFER_SIZE, stdin);
19 done = feof(stdin);
21 if (!XML_Parse(p, buf, len, done)) {
22 fail(ERR_EXPAT);
23 done = true;
25 } while (!done);
27 XML_ParserFree(p);
29 return 0;