Move private functions to private header files

This commit is contained in:
c9s 2015-11-17 21:17:18 +08:00
parent 6275e8724c
commit 973a2cb85c
18 changed files with 25 additions and 24 deletions

View file

@ -24,7 +24,7 @@ r3_include_HEADERS = \
include/r3.h \
include/r3_define.h \
include/r3_list.h \
include/r3_str.h \
include/r3_slug.h \
include/r3_gvc.h \
include/r3_json.h \
include/str_array.h \

View file

@ -10,7 +10,7 @@ puts <<END
#include <stdlib.h>
#include <assert.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "zmalloc.h"
START_TEST (test_routes)

View file

@ -14,7 +14,7 @@
#include <stdbool.h>
#include "r3_define.h"
#include "str_array.h"
#include "r3_str.h"
#include "r3_slug.h"
#ifdef __cplusplus
extern "C" {

View file

@ -4,8 +4,8 @@
*
* Distributed under terms of the MIT license.
*/
#ifndef R3_STR_H
#define R3_STR_H
#ifndef R3_SLUG_H
#define R3_SLUG_H
#ifdef __cplusplus
extern "C" {
@ -27,4 +27,4 @@ char * r3_inside_slug(const char * needle, int needle_len, char *offset, char **
}
#endif
#endif /* !R3_STR_H */
#endif /* !R3_SLUG_H */

View file

@ -5,5 +5,5 @@
"description": "high-performance path dispatching library",
"keywords": ["path", "dispatch", "performance", "r3", "c9s"],
"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"]
}

View file

@ -16,7 +16,7 @@
// PCRE
#include <pcre.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "slug.h"
#include "zmalloc.h"

View file

@ -9,8 +9,9 @@
#include <pcre.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "slug.h"
#include "str.h"
#include "zmalloc.h"
#ifdef __GNUC__

View file

@ -9,7 +9,7 @@
#include <stdlib.h>
#include <string.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "slug.h"
#include "zmalloc.h"

View file

@ -4,8 +4,8 @@
*
* Distributed under terms of the MIT license.
*/
#ifndef R3_SLUG_H
#define R3_SLUG_H
#ifndef SLUG_H
#define SLUG_H
typedef struct {
/**

View file

@ -10,7 +10,7 @@
#include <string.h>
#include <assert.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "str.h"
#include "slug.h"
#include "zmalloc.h"
@ -141,10 +141,10 @@ char * r3_slug_find_pattern(const char *s1, int *len) {
* given a slug string, duplicate the parameter name string of the slug
*/
char * r3_slug_find_name(const char *s1, int *len) {
char *c;
char *s2;
char * c;
char * s2;
int cnt = 0;
c = s1;
c = (char*) s1;
while(1) {
if(*c == '{') cnt++;

View file

@ -10,7 +10,7 @@
#include <string.h>
#include <assert.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "str_array.h"
#include "zmalloc.h"

View file

@ -12,7 +12,7 @@
#include <stdarg.h> /* va_list, va_start, va_arg, va_end */
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "zmalloc.h"
#include "bench.h"

View file

@ -10,7 +10,7 @@
#include <stdlib.h>
#include "r3.h"
#include "r3_gvc.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "bench.h"
START_TEST (test_gvc_render_dot)

View file

@ -10,7 +10,7 @@
#include <stdlib.h>
#include <json-c/json.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "r3_json.h"
#include "zmalloc.h"

View file

@ -7,7 +7,7 @@
#include <stdlib.h>
#include <assert.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "zmalloc.h"
START_TEST (test_routes)

View file

@ -9,7 +9,7 @@
#include <check.h>
#include <stdlib.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "zmalloc.h"
#include "slug.h"

View file

@ -9,7 +9,7 @@
#include <stdlib.h>
#include <check.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "zmalloc.h"
START_TEST (test_str_array)

View file

@ -4,7 +4,7 @@
#include <stdlib.h>
#include <assert.h>
#include "r3.h"
#include "r3_str.h"
#include "r3_slug.h"
#include "zmalloc.h"
#include "bench.h"