From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/stdio/__uflow.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/stdio/__uflow.c (limited to 'src/stdio/__uflow.c') diff --git a/src/stdio/__uflow.c b/src/stdio/__uflow.c new file mode 100644 index 0000000..2a88bca --- /dev/null +++ b/src/stdio/__uflow.c @@ -0,0 +1,11 @@ +#include "stdio_impl.h" + +/* This function assumes it will never be called if there is already + * data buffered for reading. */ + +int __uflow(FILE *f) +{ + unsigned char c; + if (!__toread(f) && f->read(f, &c, 1)==1) return c; + return EOF; +} -- cgit v1.2.3