| 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; |
| 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 |
> |
i = nbeams(hdlist[j]); |
| 417 |
> |
total += i*sizeof(BEAMI) + sizeof(HDGRID); |
| 418 |
> |
for ( ; 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 |
|
} |
| 424 |
|
return(total); /* does not include fragments */ |
| 425 |
|
} |