Usermode/libc - Fix strchr and strrchr behavior
[tpg/acess2.git] / Usermode / Libraries / libc.so_src / stdio_int.h
1 /*
2  * AcessOS Standard C Library
3  * SDTIO_INT.H
4  * Configuration Options
5  */
6 #ifndef _STDIO_INT_H
7 #define _STDIO_INT_H
8
9 #include <sys/types.h>
10 #include <stddef.h>
11
12 // === CONSTANTS ===
13 #define FILE_FLAG_MODE_READ     0x0001
14 #define FILE_FLAG_MODE_WRITE    0x0002
15 #define FILE_FLAG_MODE_EXEC     0x0003
16 #define FILE_FLAG_MODE_APPEND   0x0004
17 #define FILE_FLAG_MODE_MASK     0x0007
18
19 #define FILE_FLAG_M_EXT         0x0010
20 #define FILE_FLAG_M_BINARY      0x0020
21
22 #define FILE_FLAG_EOF           0x0100
23 #define FILE_FLAG_LINEBUFFERED  0x1000  // Flush when '\n' encountered
24 #define FILE_FLAG_OURBUFFER     0x2000  // Buffer is owned by stdio
25
26 #define FILE_FLAG_ALLOC         0x8000  // Internal 'is used' flag
27
28 #define _GetFileMode(fp)        ((fp)->Flags & FILE_FLAG_MODE_MASK)
29
30 // === TYPES ===
31 struct sFILE {
32          int    Flags;
33          int    FD;
34         off_t   Pos;    
35
36         #if DEBUG_BUILD
37         char    *FileName;      // heap
38         #endif
39         off_t   BufferOfs;      // File offset of first byte in buffer
40         char    *Buffer;
41         size_t  BufferPos;      // First unused byte in the buffer (read/write pos essentially)
42         size_t  BufferSpace;    // Number of bytes allocated in \a Buffer
43         
44         // open_memstream
45         char    **BufPtr;
46         size_t  *LenPtr;
47 };
48
49 #endif

UCC git Repository :: git.ucc.asn.au