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

Comparing ray/src/hd/holofile.c (file contents):
Revision 3.7 by gregl, Thu Nov 6 09:50:12 1997 UTC vs.
Revision 3.8 by gregl, Tue Nov 11 11:31:54 1997 UTC

# Line 73 | Line 73 | register int   fd;
73   hdrelease(fd)           /* stop tracking file fragments for some section */
74   register int    fd;
75   {
76 <        if (fd >= nhdfrags || !hdfrag[fd].nlinks)
76 >        if (fd < 0 | fd >= nhdfrags || !hdfrag[fd].nlinks)
77                  return;
78          if (!--hdfrag[fd].nlinks && hdfrag[fd].nfrags) {
79                  free((char *)hdfrag[fd].fi);
# Line 207 | Line 207 | int    all;                    /* include overhead (painful) */
207                                          ((hdfrag[j].nfrags-1)/FRAGBLK + 1) ;
208                  }
209          return(total);
210 + }
211 +
212 +
213 + long
214 + hdfilen(fd)             /* return file length for fd */
215 + int     fd;
216 + {
217 +        long    fpos, flen;
218 +
219 +        if (fd < 0)
220 +                return(-1);
221 +        if (fd >= nhdfrags || !hdfrag[fd].nlinks) {
222 +                if ((fpos = lseek(fd, 0L, 1)) < 0)
223 +                        return(-1);
224 +                flen = lseek(fd, 0L, 2);
225 +                lseek(fd, fpos, 0);
226 +                return(flen);
227 +        }
228 +        return(hdfrag[fd].flen);
229   }
230  
231  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines