/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk
1 by Suren A. Chilingaryan
Initial import
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
#include "opcgen.h"
5
6
/* Usage:
7
    opcgen [<number of repeatable elements>]
8
*/
9
10
main(int argc, char *argv[]) {
11
    unsigned long rpt=0;
3 by Suren A. Chilingaryan
Parsing tests for mono, vtd-xml, lisp, scripting languages
12
    long i,iters=-1;
1 by Suren A. Chilingaryan
Initial import
13
    FILE *f;
14
    char fn[32];
15
16
    if (argc>=2) rpt=atol(argv[1]);
17
    if (argc==3) iters=atol(argv[2]);
18
    if (rpt<=0) rpt=1;
19
20
    rnd_init();
21
    opcgen_init(rpt);
22
    opcgen();
23
3 by Suren A. Chilingaryan
Parsing tests for mono, vtd-xml, lisp, scripting languages
24
    if (iters<0) puts(opcgen_msg);
1 by Suren A. Chilingaryan
Initial import
25
    else {
26
	for (i=0;i<=iters;i++) {
27
	    sprintf(fn,"../xml.tmp/%u.xml",i);
28
	    f=fopen(fn,"w");
29
	    fputs(opcgen_msg,f);
30
	    fclose(f);
31
	    opcgen();
32
	}
33
    }
34
    opcgen_deinit();
35
}