1 Star 0 Fork 0

zwhy/oflops

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
msgbuf.h 874 Bytes
一键复制 编辑 原始数据 按行查看 历史
#ifndef MSGBUF_H
#define MSGBUF_H
struct msgbuf
{
char * buf;
int len, start, end;
};
struct msgbuf * msgbuf_new(int bufsize);
int msgbuf_read(struct msgbuf * mbuf, int sock);
int msgbuf_read_all(struct msgbuf * mbuf, int sock, int len);
int msgbuf_write(struct msgbuf * mbuf, int sock, int len);
int msgbuf_write_all(struct msgbuf * mbuf, int sock, int len);
void msgbuf_grow(struct msgbuf *mbuf);
void msgbuf_clear(struct msgbuf *mbuf);
void * msgbuf_peek(struct msgbuf *mbuf);
int msgbuf_pull(struct msgbuf *mbuf, char * buf, int count);
void msgbuf_push(struct msgbuf *mbuf, char * buf, int count);
//int msgbuf_count_buffered(struct msgbuf * mbuf);
#define msgbuf_count_buffered(mbuf) ((mbuf->end - mbuf->start))
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yinfuxing/oflops.git
git@gitee.com:yinfuxing/oflops.git
yinfuxing
oflops
oflops
master

搜索帮助