GithubHelp home page GithubHelp logo

mailhonor / lib-zc Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 3.13 MB

C 扩展库,异步io,协程,服务进程管理,mime库,http服务器库,json,redis,memcache库等

Home Page: https://gitee.com/linuxmail/lib-zc

License: MIT License

Makefile 0.02% C 57.34% C++ 42.20% CMake 0.29% Shell 0.14%

lib-zc's Introduction

简介

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

lib-zc's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

meyejack

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.