bzr branch
http://darksoft.org/webbzr/xmlbench/trunk
1
by Suren A. Chilingaryan
Initial import |
1 |
#include <stdio.h> |
2 |
#include <sys/time.h> |
|
3 |
#include <oratypes.h> |
|
4 |
#include <oraxml.h> |
|
5 |
||
6 |
#define DTD_VALIDATION_SUPPORTED
|
|
7 |
#include "tools.h" |
|
8 |
||
9 |
xmlctx *ctx; |
|
10 |
||
11 |
void initXML(struct TestData *td) { |
|
12 |
unsigned int ecode; |
|
13 |
ctx = xmlinit(&ecode, 0, 0, 0, 0, 0, 0, 0, 0); |
|
14 |
if (!ctx) |
|
15 |
{
|
|
16 |
fprintf(stderr,"Failed to initialze XML parser, error %u\n", (unsigned) ecode); |
|
17 |
exit(1); |
|
18 |
}
|
|
19 |
}
|
|
20 |
||
21 |
void releaseXML(struct TestData *td) { |
|
22 |
xmlterm(ctx); |
|
23 |
}
|
|
24 |
||
25 |
void parseXML(struct TestData *td, unsigned long iter) { |
|
26 |
unsigned int ecode; |
|
27 |
||
28 |
#ifdef DTD_VALIDATION
|
|
29 |
ecode=xmlparsebuf(ctx,td->xml,td->xmllen,0,XML_FLAG_DISCARD_WHITESPACE|XML_FLAG_VALIDATE); |
|
30 |
#else
|
|
31 |
ecode=xmlparsebuf(ctx,td->xml,td->xmllen,0,XML_FLAG_DISCARD_WHITESPACE); |
|
32 |
#endif
|
|
33 |
if (ecode) { |
|
34 |
fprintf(stderr,"Failed to parse XML file, error %u\n", (unsigned) ecode); |
|
35 |
exit(1); |
|
36 |
}
|
|
37 |
// xmlclean(ctx);
|
|
38 |
xmlterm(ctx); |
|
39 |
ctx = xmlinit(&ecode, 0, 0, 0, 0, 0, 0, 0, 0); |
|
40 |
}
|
|
41 |
||
42 |
||
43 |
int main(int argc, char *argv[]) { |
|
44 |
return Test(argc,argv); |
|
45 |
}
|