URI:
       tbbuffered.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tbbuffered.c (291B)
       ---
            1 #include        "lib9.h"
            2 #include        <bio.h>
            3 
            4 int
            5 Bbuffered(Biobuf *bp)
            6 {
            7         switch(bp->state) {
            8         case Bracteof:
            9         case Bractive:
           10                 return -bp->icount;
           11 
           12         case Bwactive:
           13                 return bp->bsize + bp->ocount;
           14 
           15         case Binactive:
           16                 return 0;
           17         }
           18         fprint(2, "Bbuffered: unknown state %d\n", bp->state);
           19         return 0;
           20 }