Added README.
[agg.git] / agg.c
bloba311ba4943c3e23ab042b06e53de38ca8121d21e
1 /* agg - the news aggregator
2 * Copyright (C) 2011 Andreas Waidler <arandes@programmers.at>
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #include <expat.h>
17 #include <stdio.h>
18 #include "config.h"
19 #include "expat.h"
20 #include "bool.h"
21 #include "fail.h"
23 int main()
25 char buf[READ_BUFFER_SIZE];
26 bool done = false;
27 unsigned len;
29 XML_Parser p = XML_ParserCreate(NULL);
30 expat_setup(&p);
32 do {
33 len = fread(buf, 1, READ_BUFFER_SIZE, stdin);
34 done = feof(stdin);
36 if (!XML_Parse(p, buf, len, done)) {
37 fail(ERR_EXPAT);
38 done = true;
40 } while (!done);
42 XML_ParserFree(p);
44 return 0;