~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to src/keys/genarray.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Glassey
  • Date: 2004-01-15 15:50:07 UTC
  • Revision ID: james.westby@ubuntu.com-20040115155007-n9mz4x0zxrs1isd3
Tags: upstream-1.5.7
ImportĀ upstreamĀ versionĀ 1.5.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <fcntl.h>
 
3
#include <stdlib.h>
 
4
 
 
5
main()
 
6
{
 
7
        int fd, l1, l2, l3;
 
8
        char *fnames[] = {"ot.bks", "ot.cps", "nt.bks", "nt.cps"};
 
9
        long val;
 
10
        char buf[64];
 
11
 
 
12
#ifndef O_BINARY                // O_BINARY is needed in Borland C++ 4.53
 
13
#define O_BINARY 0              // If it hasn't been defined than we probably
 
14
#endif                          // don't need it.
 
15
 
 
16
 
 
17
        for (l1 = 0; l1 < 2; l1++) {
 
18
                for (l2 = 0; l2 < 2; l2++) {
 
19
                        l3 = 1;
 
20
                        sprintf(buf, "%s", fnames[(l1*2)+l2]);
 
21
                        printf("                // %s\n", fnames[(l1*2)+l2]);
 
22
                        fd = open(buf, O_RDONLY|O_BINARY);
 
23
                        while (read(fd, &val, 4) == 4) {
 
24
                                l3++;
 
25
                                printf("%ld, ", val/(4 + (l2*2)));
 
26
                                if (!(l3%7))
 
27
                                        printf("\n");
 
28
                        }
 
29
                        close(fd);
 
30
                        printf("}, \n");
 
31
                }
 
32
        }
 
33
}