mirror of
https://github.com/0intro/wmii
synced 2024-11-22 05:42:05 +03:00
26 lines
343 B
C
26 lines
343 B
C
#include "plan9.h"
|
|
#include <bio.h>
|
|
|
|
off_t
|
|
Boffset(Biobuf *bp)
|
|
{
|
|
off_t n;
|
|
|
|
switch(bp->state) {
|
|
default:
|
|
fprint(2, "Boffset: unknown state %d\n", bp->state);
|
|
n = Beof;
|
|
break;
|
|
|
|
case Bracteof:
|
|
case Bractive:
|
|
n = bp->offset + bp->icount;
|
|
break;
|
|
|
|
case Bwactive:
|
|
n = bp->offset + (bp->bsize + bp->ocount);
|
|
break;
|
|
}
|
|
return n;
|
|
}
|