X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibc.so_src%2Fstdio_int.h;h=ab5b144d4acf09de883c342080b296e3083acbdb;hb=edddd69f17803d29b7f435da85ef23b7a5430c1f;hp=f87da812564767f289efd21695beff8f1bd721e2;hpb=f194730e75d6d3681e5f99a4efed1616fd1ea738;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libc.so_src/stdio_int.h b/Usermode/Libraries/libc.so_src/stdio_int.h index f87da812..ab5b144d 100644 --- a/Usermode/Libraries/libc.so_src/stdio_int.h +++ b/Usermode/Libraries/libc.so_src/stdio_int.h @@ -10,16 +10,21 @@ #include // === CONSTANTS === -#define FILE_FLAG_MODE_MASK 0x0007 #define FILE_FLAG_MODE_READ 0x0001 #define FILE_FLAG_MODE_WRITE 0x0002 #define FILE_FLAG_MODE_EXEC 0x0003 #define FILE_FLAG_MODE_APPEND 0x0004 +#define FILE_FLAG_MODE_MASK 0x0007 + #define FILE_FLAG_M_EXT 0x0010 #define FILE_FLAG_M_BINARY 0x0020 + #define FILE_FLAG_EOF 0x0100 -#define FILE_FLAG_DIRTY 0x0200 -#define FILE_FLAG_ALLOC 0x1000 +#define FILE_FLAG_LINEBUFFERED 0x1000 // Flush when '\n' encountered + +#define FILE_FLAG_ALLOC 0x8000 // Internal 'is used' flag + +#define _GetFileMode(fp) ((fp)->Flags & FILE_FLAG_MODE_MASK) // === TYPES === struct sFILE { @@ -30,9 +35,10 @@ struct sFILE { #if DEBUG_BUILD char *FileName; // heap #endif - void *Buffer; - off_t BufferStart; - size_t BufferSize; + off_t BufferOfs; // File offset of first byte in buffer + char *Buffer; + size_t BufferPos; // First unused byte in the buffer (read/write pos essentially) + size_t BufferSpace; // Number of bytes allocated in \a Buffer }; #endif