ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhinfo.c
(Generate patch)

Comparing ray/src/hd/rhinfo.c (file contents):
Revision 3.4 by gwlarson, Wed Feb 3 10:48:06 1999 UTC vs.
Revision 3.10 by schorsch, Thu Jan 1 11:21:55 2004 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Get general information on holodeck file
6   */
7  
8 + #include <stdio.h>
9 +
10 + #include "platform.h"
11 + #include "resolu.h"
12   #include "holo.h"
13  
14   #ifndef NHBINS
# Line 18 | Line 19 | char   *progname;              /* global argv[0] */
19  
20   long    beamtot, samptot;       /* total beams and samples */
21  
22 + static void gethdinfo(char      *fname, FILE    *fout);
23 + static void psectstats(HOLO     *hp, FILE       *fp);
24  
22 main(argc, argv)
23 int     argc;
24 char    *argv[];
25 {
26        int     sect;
25  
26 + int
27 + main(
28 +        int     argc,
29 +        char    *argv[]
30 + )
31 + {
32          progname = argv[0];
33          if (argc != 2)
34                  goto userr;
# Line 36 | Line 40 | userr:
40   }
41  
42  
43 < gethdinfo(fname, fout)          /* get information on holodeck */
44 < char    *fname;
45 < FILE    *fout;
43 > static void
44 > gethdinfo(              /* get information on holodeck */
45 >        char    *fname,
46 >        FILE    *fout
47 > )
48   {
43        extern long     ftell();
49          FILE    *fp;
50          HOLO    *hdsect;
51          int     fd;
52 <        int4    nextloc;
52 >        int32   nextloc;
53          int     n;
54                                          /* open holodeck file */
55          if ((fp = fopen(fname, "r")) == NULL) {
# Line 60 | Line 65 | FILE   *fout;
65          nextloc = ftell(fp);                    /* get stdio position */
66          fclose(fp);                             /* done with stdio */
67          for (n = 0; nextloc > 0L; n++) {        /* get the section(s) */
68 <                lseek(fd, (long)nextloc, 0);
68 >                lseek(fd, (off_t)nextloc, SEEK_SET);
69                  read(fd, (char *)&nextloc, sizeof(nextloc));
70                  fprintf(fout, "Section %d:\n", n);
71                  hdsect = hdinit(fd, NULL);      /* load section directory */
# Line 81 | Line 86 | FILE   *fout;
86   }
87  
88  
89 < psectstats(hp, fp)              /* print statistical information for section */
90 < register HOLO   *hp;
91 < FILE    *fp;
89 > static void
90 > psectstats(             /* print statistical information for section */
91 >        register HOLO   *hp,
92 >        FILE    *fp
93 > )
94   {
95          int     scount[NHBINS];
96          int     minsamp = 10000, maxsamp = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines