shithub: pc

ref: 5ff4a10c5438b8a994dcc79a89b42c765cf4a4b8
dir: /include/bio.h/

View raw version
#include <stdio.h>

typedef FILE Biobufhdr;
typedef Biobufhdr Biobuf;

static int lastc;

static int
Bgetc(Biobufhdr *bp)
{
	lastc = fgetc(bp);
	return feof(bp) ? -1 : lastc;
}

static int
Bungetc(Biobufhdr *bp)
{
	ungetc(lastc, bp);
	lastc = 0;
	return 0;
}

static Biobufhdr *
Bfdopen(int f, int mode)
{
	return stdin;
}