Move private functions to private header files
This commit is contained in:
parent
6275e8724c
commit
973a2cb85c
18 changed files with 25 additions and 24 deletions
|
@ -24,7 +24,7 @@ r3_include_HEADERS = \
|
||||||
include/r3.h \
|
include/r3.h \
|
||||||
include/r3_define.h \
|
include/r3_define.h \
|
||||||
include/r3_list.h \
|
include/r3_list.h \
|
||||||
include/r3_str.h \
|
include/r3_slug.h \
|
||||||
include/r3_gvc.h \
|
include/r3_gvc.h \
|
||||||
include/r3_json.h \
|
include/r3_json.h \
|
||||||
include/str_array.h \
|
include/str_array.h \
|
||||||
|
|
|
@ -10,7 +10,7 @@ puts <<END
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
|
|
||||||
START_TEST (test_routes)
|
START_TEST (test_routes)
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "r3_define.h"
|
#include "r3_define.h"
|
||||||
#include "str_array.h"
|
#include "str_array.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
*
|
*
|
||||||
* Distributed under terms of the MIT license.
|
* Distributed under terms of the MIT license.
|
||||||
*/
|
*/
|
||||||
#ifndef R3_STR_H
|
#ifndef R3_SLUG_H
|
||||||
#define R3_STR_H
|
#define R3_SLUG_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -27,4 +27,4 @@ char * r3_inside_slug(const char * needle, int needle_len, char *offset, char **
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* !R3_STR_H */
|
#endif /* !R3_SLUG_H */
|
|
@ -5,5 +5,5 @@
|
||||||
"description": "high-performance path dispatching library",
|
"description": "high-performance path dispatching library",
|
||||||
"keywords": ["path", "dispatch", "performance", "r3", "c9s"],
|
"keywords": ["path", "dispatch", "performance", "r3", "c9s"],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"src": ["3rdparty/zmalloc.c", "3rdparty/zmalloc.h", "include/r3.h", "include/r3.hpp", "include/r3_define.h", "include/r3_gvc.h", "include/r3_json.h", "include/r3_list.h", "include/r3_str.h", "include/str_array.h", "src/edge.c", "src/gvc.c", "src/json.c", "src/list.c", "src/match_entry.c", "src/node.c", "src/slug.c", "src/slug.h", "src/str.c", "src/token.c"]
|
"src": ["3rdparty/zmalloc.c", "3rdparty/zmalloc.h", "include/r3.h", "include/r3.hpp", "include/r3_define.h", "include/r3_gvc.h", "include/r3_json.h", "include/r3_list.h", "include/r3_slug.h", "include/str_array.h", "src/edge.c", "src/gvc.c", "src/json.c", "src/list.c", "src/match_entry.c", "src/node.c", "src/slug.c", "src/slug.h", "src/str.c", "src/token.c"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
// PCRE
|
// PCRE
|
||||||
#include <pcre.h>
|
#include <pcre.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "slug.h"
|
#include "slug.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,9 @@
|
||||||
#include <pcre.h>
|
#include <pcre.h>
|
||||||
|
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "slug.h"
|
#include "slug.h"
|
||||||
|
#include "str.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "slug.h"
|
#include "slug.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
*
|
*
|
||||||
* Distributed under terms of the MIT license.
|
* Distributed under terms of the MIT license.
|
||||||
*/
|
*/
|
||||||
#ifndef R3_SLUG_H
|
#ifndef SLUG_H
|
||||||
#define R3_SLUG_H
|
#define SLUG_H
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "str.h"
|
#include "str.h"
|
||||||
#include "slug.h"
|
#include "slug.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
|
@ -144,7 +144,7 @@ char * r3_slug_find_name(const char *s1, int *len) {
|
||||||
char * c;
|
char * c;
|
||||||
char * s2;
|
char * s2;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
c = s1;
|
c = (char*) s1;
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
if(*c == '{') cnt++;
|
if(*c == '{') cnt++;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "str_array.h"
|
#include "str_array.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <stdarg.h> /* va_list, va_start, va_arg, va_end */
|
#include <stdarg.h> /* va_list, va_start, va_arg, va_end */
|
||||||
|
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_gvc.h"
|
#include "r3_gvc.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
|
|
||||||
START_TEST (test_gvc_render_dot)
|
START_TEST (test_gvc_render_dot)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <json-c/json.h>
|
#include <json-c/json.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "r3_json.h"
|
#include "r3_json.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
|
|
||||||
START_TEST (test_routes)
|
START_TEST (test_routes)
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <check.h>
|
#include <check.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
#include "slug.h"
|
#include "slug.h"
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <check.h>
|
#include <check.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
|
|
||||||
START_TEST (test_str_array)
|
START_TEST (test_str_array)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "r3.h"
|
#include "r3.h"
|
||||||
#include "r3_str.h"
|
#include "r3_slug.h"
|
||||||
#include "zmalloc.h"
|
#include "zmalloc.h"
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue