1 Star 1 Fork 0

hotmocha / spider

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
simplebuf.h 820 Bytes
一键复制 编辑 原始数据 按行查看 历史
hotmocha 提交于 2015-04-02 22:29 . spider init
/*
* MODULE NAME :
* PROGRAM NAME : simplebuf.h
* AUTHOR : HOTMOCHA
* CREATE DATE : 2015-01-13 18:48:18
* PROGRAM DESC :
*
* HISTORY :
*
*/
#ifndef _H_SIMPLEBUF_H_
#define _H_SIMPLEBUF_H_
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#define DEFAULTINITBUFLEN 1024
typedef struct {
unsigned long totallen;
unsigned long usedlen;
char *base;
}Buf ;
void FreeBuf();
void FreeData();
Buf* InitBuf(unsigned long len);
int Realloc(Buf *buf, unsigned long addlen);
int Appendmsg(Buf *buf, char *msg, unsigned long msglen);
int Setmsg(Buf *buf, char *msg, unsigned long msglen);
Buf* InitBufWithMsg(char *msg, unsigned long msglen);
void ReinitBuf(Buf *buf);
//错误编号100开始
#define BUF_ARGNULL_ERR -100001
#define BUF_MEMMALLOC_ERR -100002
#endif
1
https://gitee.com/hotmocha/spider.git
git@gitee.com:hotmocha/spider.git
hotmocha
spider
spider
master

搜索帮助