add new stdio extension functions to make gnulib happy
authorRich Felker <dalias@aerifal.cx>
Tue, 19 Jun 2012 05:35:23 +0000 (01:35 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 19 Jun 2012 05:35:23 +0000 (01:35 -0400)
this is mildly ugly, but less ugly than gnulib trying to poke at the
definition of the FILE structure...

src/stdio/ext2.c [new file with mode: 0644]

diff --git a/src/stdio/ext2.c b/src/stdio/ext2.c
new file mode 100644 (file)
index 0000000..e587d64
--- /dev/null
@@ -0,0 +1,24 @@
+#include "stdio_impl.h"
+
+size_t __freadahead(FILE *f)
+{
+       return f->rend - f->rpos;
+}
+
+const char *__freadptr(FILE *f, size_t *sizep)
+{
+       size_t size = f->rend - f->rpos;
+       if (!size) return 0;
+       *sizep = size;
+       return f->rpos;
+}
+
+void __freadptrinc(FILE *f, size_t inc)
+{
+       f->rpos += inc;
+}
+
+void __fseterr(FILE *f)
+{
+       f->flags |= F_ERR;
+}