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