转自:http://bbs.csdn.net/topics/310147128
struct _iobuf {
char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char *_tmpfname;
};
typedef struct _iobuf FILE;
#define _FILE_DEFINED
#endif
struct_iobuf{
char*_ptr;//文件输入的下一个位置
int_cnt;//当前缓冲区的相对位置
char*_base;//指基础位置(应该是文件的其始位置)
int_flag;//文件标志
int_file;//文件的有效性验证
int_charbuf;//检查缓冲区状况,如果无缓冲区则不读取
int_bufsiz;//文件的大小
char*_tmpfname;//临时文件名
};
int _flag; //文件的访问模式
_cnt //剩余的字符数
_cnt是缓冲区中的字符数量