Hey guys,
I am trying to understand the file struct in C.
How does this extend into a fully fledged file with
formats and the rest.
All there seems to be is an int that, unless this was a
flippantly used variable name, remains unused.
Barring that rather unfounded assumption. I cannot make
heads or tails of this:
Code:structHow does this work??Code:__sFile 00047 { 00048 int unused; 00049 }; 00050 00051 typedef struct __sFILE FILE; 00052 00053 #define __SLBF 0x0001 /* line buffered */ 00054 #define __SNBF 0x0002 /* unbuffered */ 00055 #define __SRD 0x0004 /* OK to read */ 00056 #define __SWR 0x0008 /* OK to write */ 00057 /* RD and WR are never simultaneously asserted */ 00058 #define __SRW 0x0010 /* open for reading & writing */ 00059 #define __SEOF 0x0020 /* found EOF */ 00060 #define __SERR 0x0040 /* found error */ 00061 #define __SMBF 0x0080 /* _buf is from malloc */ 00062 #define __SAPP 0x0100 /* fdopen()ed in append mode - so must write to end */ 00063 #define __SSTR 0x0200 /* this is an sprintf/snprintf string */ 00064 #define __SOPT 0x0400 /* do fseek() optimisation */ 00065 #define __SNPT 0x0800 /* do not do fseek() optimisation */ 00066 #define __SOFF 0x1000 /* set iff _offset is in fact correct */ 00067 #define __SMOD 0x2000 /* true => fgetline modified _p text */ 00068 #if defined(__CYGWIN__) || defined(__CYGWIN__) 00069 #define __SCLE 0x4000 /* convert line endings CR/LF <-> NL */ 00070 #endif 00071