2 Star 4 Fork 3

iresty / lua-resty-libr3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
r3_resty.h 1.54 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef LUA_RESTY_R3_RESTY_H
#define LUA_RESTY_R3_RESTY_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdio.h>
#include <ctype.h>
#include "r3/include/r3.h"
#ifdef BUILDING_SO
#ifndef __APPLE__
#define LSH_EXPORT __attribute__ ((visibility ("protected")))
#else
/* OSX does not support protect-visibility */
#define LSH_EXPORT __attribute__ ((visibility ("default")))
#endif
#else
#define LSH_EXPORT
#endif
/* **************************************************************************
*
* Export Functions
*
* **************************************************************************
*/
void *r3_create(int cap);
void r3_free(void * tree);
void *r3_insert(void *tree, int method, const char *path,
int path_len, void *data, char **errstr);
int r3_compile(void *tree, char** errstr);
int r3_route_set_attr(void *router, const char *host, const char *remote_addr,
int remote_addr_bits);
int r3_route_attribute_free(void *router);
void *r3_match_entry_create(const char *path, int method, const char *host,
const char *remote_addr);
void *r3_match_route(const void *tree, void *entry);
void *r3_match_route_fetch_idx(void *route);
size_t r3_match_entry_fetch_slugs(void *entry, size_t idx, char *val,
size_t *val_len);
size_t r3_match_entry_fetch_tokens(void *entry, size_t idx, char *val,
size_t *val_len);
void r3_match_entry_free(void *entry);
int is_valid_ipv4(const char *ipv4);
int is_valid_ipv6(const char *ipv6);
#ifdef __cplusplus
}
#endif
#endif
Lua
1
https://gitee.com/iresty/lua-resty-libr3.git
git@gitee.com:iresty/lua-resty-libr3.git
iresty
lua-resty-libr3
lua-resty-libr3
master

搜索帮助