/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to xmlgen/xmark.c

  • Committer: Suren A. Chilingaryan
  • Date: 2009-02-16 09:27:17 UTC
  • Revision ID: csa@dside.dyndns.org-20090216092717-wipyvaaw2srxhgns
Initial import

Show diffs side-by-side

added added

removed removed

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