1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include "internal.h" #include "refill.h" int bufio·getbyte(io·Buffer *buf) { getbyte: if(buf->pos < buf->end) return *buf->pos++; memmove(buf->buf, buf->end - bufio·ungets, bufio·ungets); if(refill(buf) <= 0) return bufio·eof; goto getbyte; }