fiss

Friedel's Initialization and Service Supervision
Log | Files | Refs | LICENSE

bputc.c (234B)


      1 #include "lib9.h"
      2 
      3 #include <bio.h>
      4 
      5 int Bputc(Biobuf* bp, int c) {
      6 	int i;
      7 
      8 	for (;;) {
      9 		i = bp->ocount;
     10 		if (i) {
     11 			bp->ebuf[i++] = c;
     12 			bp->ocount    = i;
     13 			return 0;
     14 		}
     15 		if (Bflush(bp) == Beof)
     16 			break;
     17 	}
     18 	return Beof;
     19 }