20 Star 93 Fork 37

linuxmail / lib-zc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

简介

LIB-ZC 是一个Linux平台通用C扩展库

开源, 仓库地址 https://gitee.com/linuxmail/lib-zc

模块列表

背景

在Linux平台, 仅基于GNU C标准库, 开发一个全新的完整的邮件系统, 包括

  • 高并发smtp/imap4/pop3服务器
  • 高并发http服务器(webmail, 管理)
  • 反垃圾邮件网关, 基于贝叶斯的垃圾邮件识别系统
  • 邮件解析, json, redis
  • 服务进程管理器
  • 希望全部程序静态编译
  • 等等

为此开发了 LIB-ZC 作为基础库

命名约定

  • 函数, 结构体, 变量, 宏等 以字母 zZ 开始
  • 结构体以 _t 结尾

连接或监听地址

  • "local:domain_socket_somepath", 等价于, "domain_socket_somepath"
  • "fifo:somepath"
  • "domain_socket_somepath"
  • "somedomain:port"

时间/超时

  • 如无特别说明, 所有的时间单位都是秒
  • 如果是毫秒, 函数名或形参会明确提示
  • 实参取值-1则表示无限长

返回值

  • 和(网络)io相关的函数, 如果返回值类型是int, 如果返回 < 0, 表示出错

编译

make 即可

得到: libzc.a(基础库) 和 libzc_coroutine.a(协程库)

使用

源码 sample/下有大量例子(make sample),可供参考

zc.h 和 libzc.a 在源码目录下

$ cat a.c 
#include "zc.h"
int main(int argc, char **argv)
{
  /* foo(); */
  return 0;
}
$ gcc a.c ./libzc.a
MIT License Copyright (c) 张岩. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

简介

C 扩展库,异步io,协程,服务进程管理,mime库,http服务器库,json,redis,memcache库等 展开 收起
C 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/linuxmail/lib-zc.git
git@gitee.com:linuxmail/lib-zc.git
linuxmail
lib-zc
lib-zc
master

搜索帮助