1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include <stdio.h>
#include <stdlib.h>
#include "opcgen.h"
/* Usage:
opcgen [<number of repeatable elements>]
*/
main(int argc, char *argv[]) {
unsigned long rpt=0;
long i,iters=-1;
FILE *f;
char fn[32];
if (argc>=2) rpt=atol(argv[1]);
if (argc==3) iters=atol(argv[2]);
if (rpt<=0) rpt=1;
rnd_init();
opcgen_init(rpt);
opcgen();
if (iters<0) puts(opcgen_msg);
else {
for (i=0;i<=iters;i++) {
sprintf(fn,"../xml.tmp/%u.xml",i);
f=fopen(fn,"w");
fputs(opcgen_msg,f);
fclose(f);
opcgen();
}
}
opcgen_deinit();
}
|