Lines Matching defs:mode
33 FileMode mode; // Reading or writing.
40 #define DEFAULTS fd(-1), mode(READ), buf(NULL), size(-1), pos(0), own_fd(true)
43 File(int fd, FileMode mode, bool own_fd = true) : DEFAULTS {
44 open(fd, mode, own_fd); }
46 File(cchar* name, cchar* mode) : DEFAULTS {
47 open(name, mode); }
54 void open(int fd, FileMode mode, bool own_fd = true);
55 void open(cchar* name, cchar* mode); // FILE* compatible interface.
63 if (mode == READ)
69 return mode; }
72 if (m == mode) return;
79 mode = m;
82 int getCharQ(void) { // Quick version with minimal overhead : don't call this in wrong mode!
84 assert(mode == READ);
93 int putCharQ(int chr) { // Quick version with minimal overhead : don't call this in wrong mode!
95 assert(mode == WRITE);
103 if (mode == WRITE) setMode(READ);
107 if (mode == READ) setMode(WRITE);
111 assert(mode == READ);
120 assert(mode == WRITE);