The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
genarray.c File Reference
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
+ Include dependency graph for genarray.c:

Go to the source code of this file.

Macros

#define O_BINARY   0
 

Functions

 main ()
 

Macro Definition Documentation

#define O_BINARY   0

Function Documentation

main ( )

Definition at line 27 of file genarray.c.

28 {
29  int fd, l1, l2, l3;
30  char *fnames[] = {"ot.bks", "ot.cps", "nt.bks", "nt.cps"};
31  long val;
32  char buf[64];
33 
34 #ifndef O_BINARY // O_BINARY is needed in Borland C++ 4.53
35 #define O_BINARY 0 // If it hasn't been defined than we probably
36 #endif // don't need it.
37 
38 
39  for (l1 = 0; l1 < 2; l1++) {
40  for (l2 = 0; l2 < 2; l2++) {
41  l3 = 1;
42  sprintf(buf, "%s", fnames[(l1*2)+l2]);
43  printf(" // %s\n", fnames[(l1*2)+l2]);
44  fd = open(buf, O_RDONLY|O_BINARY, S_IREAD|S_IWRITE|S_IRGRP|S_IROTH);
45  while (read(fd, &val, 4) == 4) {
46  l3++;
47  printf("%ld, ", val/(4 + (l2*2)));
48  if (!(l3%7))
49  printf("\n");
50  }
51  close(fd);
52  printf("}, \n");
53  }
54  }
55 }
#define S_IRGRP
Definition: filemgr.cpp:52
#define S_IREAD
Definition: filemgr.cpp:70
#define S_IROTH
Definition: filemgr.cpp:56
#define S_IWRITE
Definition: filemgr.cpp:73
#define O_BINARY