summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stdio/_stdio.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/stdio/_stdio.h b/src/stdio/_stdio.h
index 5ec8b884..ba7dc82f 100644
--- a/src/stdio/_stdio.h
+++ b/src/stdio/_stdio.h
@@ -15,13 +15,21 @@
#include "L_ctermid.c"
#endif
+#define f_is_open(s) (s && (s->bmode != 0))
+
+struct __fpos_t {
+ size_t off;
+};
+
struct __FILE {
fpos_t pos;
- char *buf;
- char ibuf[BUFSIZ];
- enum { INTERNAL, SUPPLIED, ALLOCED, UNSET } buftype;
- int buffering;
- int bsize;
+
+ char *buf; /* pointer to in-use buffer */
+ char ibuf[BUFSIZ]; /* statically allocated buffer */
+ size_t bsize; /* how big is the buffer */
+ size_t bpos; /* current position of next character */
+ int bmode; /* _IONBF, _IOLBF, _IOFBF */
+
int isopen;
int flags;
int lastop;
@@ -37,12 +45,6 @@ struct __FILE {
pid_t pipe_pid;
- struct {
- char *buf;
- size_t size;
- int allocated;
- } mem;
-
struct __FILE *prev;
struct __FILE *next;
};