libc.a中FILE结构的分析

stdio.h中有FILE结构的定义
typedef char __stdiobuf_t; /* stdio buffer type */
typedef STDIO_USIZE_T __stdiosize_t; /* unsigned size_t */

typedef struct __iobuf {
__stdiobuf_t __rptr; / pointer into read buffer */
__stdiobuf_t __rend; / point at end of read buffer */
__stdiobuf_t __wptr; / pointer into write buffer */
__stdiobuf_t __wend; / point at end of write buffer */
__stdiobuf_t __base; / base of buffer */
__stdiosize_t __bufsiz; /* size of buffer */
short __flag; /* flags */
char __file; /* channel number */
__stdiobuf_t __buf; /* small buffer */
int (__filbuf) _STDIO_P_((struct __iobuf )); /* fill input buffer */
int (__flsbuf) _STDIO_P_((int, struct __iobuf )); /* flush output buffer */
int (__flush) _STDIO_P_((struct __iobuf )); /* flush buffer */
struct __iobuf __next; / next in chain */
} FILE;

stdiolib.h中有宏定义

define SETFILBUF(f,p) ( (f)->__filbuf = (p) )

define TESTFLAG(f,x) (((f)->__flag & (x)) != 0)

fseek.c中有对filbuf函数指针的赋值
SETFILBUF(fp, __brdupdate);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值