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

Comparing ray/src/hd/rhcopy.c (file contents):
Revision 3.22 by schorsch, Thu Jan 1 11:21:55 2004 UTC vs.
Revision 3.25 by greg, Sun Sep 26 15:39:10 2010 UTC

# Line 31 | Line 31 | struct phead {
31   };
32   static int openholo(char *fname, int append);
33   static void addray(FVECT ro, FVECT rd, double d, COLR cv);
34 < static int holheadline(char *s, int *hf);
34 > static gethfunc holheadline;
35   static int bpcmp(const void *b1p, const void *b2p);
36   static int addclump(HOLO *hp, int *bq, int nb);
37   static void addholo(char *hdf);
38 < static int picheadline(char *s, struct phead *ph);
38 > static gethfunc picheadline;
39   static void addpicz(char *pcf, char *zbf);
40  
41  
# Line 85 | Line 85 | main(
85   userr:
86          fprintf(stderr, "Usage: %s output.hdk [-u][-d] -h inp1.hdk ..\n",
87                          progname);
88 <        fprintf(stderr, "   Or: %s output.hdk [-u][-d] -p inp1.pic inp1.zbf ..\n",
88 >        fprintf(stderr, "   Or: %s output.hdk [-u][-d] -p inp1.hdr inp1.zbf ..\n",
89                          progname);
90          exit(1);
91   }
# Line 95 | Line 95 | userr:
95   #define H_OBST  02
96   #define H_OBSF  04
97  
98 < int
98 > static int
99   holheadline(            /* check holodeck header line */
100          register char   *s,
101 <        int     *hf
101 >        void    *vhf
102   )
103   {
104          char    fmt[32];
105 +        int     *hf = vhf;
106  
107          if (formatval(fmt, s)) {
108                  if (strcmp(fmt, HOLOFMT))
# Line 133 | Line 134 | openholo(              /* open existing holodeck file for i/o */
134          FILE    *fp;
135          int     fd;
136          int     hflags = 0;
137 <        long    nextloc;
137 >        int32   nextloc;
138          int     n;
139                                          /* open holodeck file */
140          if ((fp = fopen(fname, append ? "r+" : "r")) == NULL) {
# Line 142 | Line 143 | openholo(              /* open existing holodeck file for i/o */
143                  error(SYSTEM, errmsg);
144          }
145                                          /* check header and magic number */
146 <        if (getheader(fp, holheadline, (char *)&hflags) < 0 ||
146 >        if (getheader(fp, holheadline, &hflags) < 0 ||
147                          hflags&H_BADF || getw(fp) != HOLOMAGIC) {
148                  sprintf(errmsg, "file \"%s\" not in holodeck format", fname);
149                  error(USER, errmsg);
# Line 285 | Line 286 | addholo(                       /* add a holodeck file */
286  
287  
288  
289 < int
289 > static int
290   picheadline(            /* process picture header line */
291          char    *s,
292 <        struct phead    *ph
292 >        void    *vph
293   )
294   {
295          char    fmt[32];
296 +        struct phead *ph = vph;
297  
298          if (formatval(fmt, s)) {
299                  ph->badfmt = strcmp(fmt, COLRFMT);
# Line 346 | Line 348 | addpicz(               /* add a picture + depth-buffer */
348          phd.vw = stdview;
349          phd.expos = 1.0;
350          phd.badfmt = phd.gotview = phd.altprims = 0;
351 <        if (getheader(pfp, picheadline, (char *)&phd) < 0 ||
351 >        if (getheader(pfp, picheadline, &phd) < 0 ||
352                          phd.badfmt || !fgetsresolu(&prs, pfp)) {
353                  sprintf(errmsg, "bad format for picture file \"%s\"", pcf);
354                  error(USER, errmsg);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines