1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibC: Add ungetc() and automatically flush streams on fclose().

This commit is contained in:
Andreas Kling 2019-03-27 01:40:55 +01:00
parent 0c2face7b0
commit d1e55fb4d9
7 changed files with 39 additions and 3 deletions

View file

@ -7,6 +7,8 @@
#include <stdarg.h>
#include <limits.h>
#define BUFSIZ 1024
__BEGIN_DECLS
#ifndef EOF
#define EOF (-1)
@ -28,6 +30,8 @@ struct __STDIO_FILE {
char* buffer;
size_t buffer_size;
size_t buffer_index;
bool have_ungotten;
char ungotten;
char default_buffer[BUFSIZ];
};