- 授权协议: MIT
- 开发语言: C/C++
- 操作系统: Linux
- 软件首页: https://github.com/c9s/r3
- 软件文档: https://github.com/c9s/r3
软件介绍
R3 是一个高性能的 URL 路由开发包,使用 C 语言开发。可将你的路由规则编译成前缀单词查找树。
依赖的软件:
autoconf
automake
check
pcre
jemalloc
graphviz version 2.38.0 (20140413.2041)
规则写法:
/blog/post/{id} use [^/]+ regular expression by default.
/blog/post/{id:\d+} use `\d+` regular expression instead of default.
编程示例:
#include <r3.h>
// create a router tree with 10 children capacity (this capacity can grow dynamically)
n = r3_tree_create(10);
int route_data = 3;
// insert the route path into the router tree
r3_tree_insert_pathl(n , "/zoo" , strlen("/zoo") , NULL, &route_data );
r3_tree_insert_pathl(n , "/foo/bar" , strlen("/foo/bar") , NULL, &route_data );
r3_tree_insert_pathl(n , "/bar" , strlen("/bar") , NULL, &route_data );
r3_tree_insert_pathl(n , "/post/{id}" , strlen("/post/{id}") , NULL, &route_data );
r3_tree_insert_pathl(n , "/user/{id:\\d+}" , strlen("/user/{id:\\d+}") , NULL, &route_data );
// let's compile the tree!
r3_tree_compile(n);
// dump the compiled tree
r3_tree_dump(n, 0);
// match a route
node *matched_node = r3_tree_match(n, "/foo/bar", strlen("/foo/bar"), NULL);
matched_node->endpoint; // make sure there is a route end at here.
int ret = *( (*int) matched_node->route_ptr );
GitHub入门与实践
[日] 大塚弘记 / 支鹏浩、刘斌 / 人民邮电出版社 / 2015-7 / 39.00元
本书从Git的基本知识和操作方法入手,详细介绍了GitHub的各种功能,GitHub与其他工具或服务的协作,使用GitHub的开发流程以及如何将GitHub引入到企业中。在讲解GitHub的代表功能Pull Request时,本书专门搭建了供各位读者实践的仓库,邀请各位读者进行Pull Request并共同维护。一起来看看 《GitHub入门与实践》 这本书的介绍吧!
Base64 编码/解码
Base64 编码/解码
UNIX 时间戳转换
UNIX 时间戳转换

