repo.or.cz
/
agg.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Initial commit.
[agg.git]
/
agg.c
blob
0255074deb6e35d44913cb31beb71837c9716776
1
#include <expat.h>
2
#include <stdio.h>
3
#include
"config.h"
4
#include
"expat.h"
5
#include
"bool.h"
6
#include
"fail.h"
7
8
int
main
()
9
{
10
char
buf
[
READ_BUFFER_SIZE
];
11
bool
done
=
false
;
12
unsigned
len
;
13
14
XML_Parser p
=
XML_ParserCreate
(
NULL
);
15
expat_setup
(&
p
);
16
17
do
{
18
len
=
fread
(
buf
,
1
,
READ_BUFFER_SIZE
,
stdin
);
19
done
=
feof
(
stdin
);
20
21
if
(!
XML_Parse
(
p
,
buf
,
len
,
done
)) {
22
fail
(
ERR_EXPAT
);
23
done
=
true
;
24
}
25
}
while
(!
done
);
26
27
XML_ParserFree
(
p
);
28
29
return
0
;
30
}