| 403 |
|
|
| 404 |
|
extern off_t |
| 405 |
|
hdfiluse( /* compute file usage (in bytes) */ |
| 406 |
< |
int fd, /* open file descriptor to check */ |
| 407 |
< |
int all /* include overhead and unflushed data */ |
| 406 |
> |
int fd /* open file descriptor to check */ |
| 407 |
|
) |
| 408 |
|
{ |
| 409 |
|
off_t total = 0; |
| 410 |
< |
register int i, j; |
| 410 |
> |
register int j; |
| 411 |
|
|
| 412 |
|
for (j = 0; hdlist[j] != NULL; j++) { |
| 413 |
|
if (hdlist[j]->fd != fd) |
| 414 |
|
continue; |
| 415 |
|
total += biglob(hdlist[j])->nrd * sizeof(RAYVAL); |
| 416 |
< |
if (all) { |
| 417 |
< |
for (i = nbeams(hdlist[j]); i > 0; i--) |
| 418 |
< |
if (hdlist[j]->bl[i] != NULL) |
| 419 |
< |
total += sizeof(RAYVAL) * |
| 416 |
> |
total += nbeams(hdlist[j])*sizeof(BEAMI) + sizeof(HDGRID); |
| 417 |
> |
#if 0 |
| 418 |
> |
for (i = nbeams(hdlist[j]); i > 0; i--) |
| 419 |
> |
if (hdlist[j]->bl[i] != NULL) |
| 420 |
> |
total += sizeof(RAYVAL) * |
| 421 |
|
(hdlist[j]->bl[i]->nrm - |
| 422 |
|
hdlist[j]->bi[i].nrd); |
| 423 |
< |
total += sizeof(HDGRID) + |
| 424 |
< |
nbeams(hdlist[j])*sizeof(BEAMI); |
| 425 |
< |
} |
| 423 |
> |
#endif |
| 424 |
|
} |
| 425 |
< |
return(total); /* does not include fragments */ |
| 425 |
> |
return(total); /* doesn't include fragments, unflushed rays */ |
| 426 |
|
} |
| 427 |
|
|
| 428 |
|
|