added read buffering, ungetc

git-svn-id: svn://kolibrios.org@7184 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl
2018-03-12 20:41:06 +00:00
parent 751583e53e
commit 524cab3cd8
19 changed files with 1029 additions and 100 deletions

View File

@@ -23,9 +23,12 @@ typedef struct {
char* buffer;
dword buffersize;
dword filesize; // too small
dword filepos; // too small
int filepos; // too small, may be -1
char* filename;
int mode;
int ungetc_buf;
dword buffer_start; // 1st byte position
dword buffer_end; // points after last buffered data
} FILE;
#define stderr ((FILE*)3) /* works only for fprintf!!! */
@@ -37,7 +40,7 @@ typedef struct {
#define FILE_OPEN_TEXT 4
#define FILE_OPEN_PLUS 8
#define EOF (-1)
#define BUFSIZ (256)
#define BUFSIZ (4096)
#define FILENAME_MAX (0x400)
extern FILE* fopen(const char* filename, const char *mode);