diff --git a/Makefile.am b/Makefile.am index 0d9861b..6e1b0e6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,7 +25,6 @@ r3_include_HEADERS = \ include/r3_define.h \ include/r3_list.h \ include/r3_str.h \ - include/r3_gvc.h \ include/str_array.h \ $(NULL) diff --git a/README.md b/README.md index 51ca996..0d67182 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,13 @@ Pattern Syntax /blog/post/{id:\d+} use `\d+` regular expression instead of default. -C API +API ------------------------ ```c #include +#include + // create a router tree with 10 children capacity (this capacity can grow dynamically) n = r3_tree_create(10); diff --git a/include/r3.h b/include/r3.h index b75450b..58d1160 100644 --- a/include/r3.h +++ b/include/r3.h @@ -191,8 +191,29 @@ const char * r3_node_to_json_pretty_string(const node * n); const char * r3_node_to_json_string(const node * n); #endif + +#ifdef ENABLE_GRAPHVIZ +#include +#include + +void r3_tree_build_ag_nodes(Agraph_t * g, Agnode_t * ag_parent_node, const node * n, int node_cnt); + +int r3_tree_render(const node * tree, const char *layout, const char * format, FILE *fp); + +int r3_tree_render_dot(const node * tree, const char *layout, FILE *fp); + +int r3_tree_render_file(const node * tree, const char * format, const char * filename); +#endif + + + + + #ifdef __cplusplus } #endif + + + #endif /* !R3_NODE_H */ diff --git a/include/r3_gvc.h b/include/r3_gvc.h deleted file mode 100644 index 4d2b56f..0000000 --- a/include/r3_gvc.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * r3_gvc.h - * Copyright (C) 2014 c9s - * - * Distributed under terms of the MIT license. - */ -#ifndef R3_GVC_H -#define R3_GVC_H - -#include -#include - -void r3_tree_build_ag_nodes(Agraph_t * g, Agnode_t * ag_parent_node, const node * n, int node_cnt); - -int r3_tree_render(const node * tree, const char *layout, const char * format, FILE *fp); - -int r3_tree_render_dot(const node * tree, const char *layout, FILE *fp); - -int r3_tree_render_file(const node * tree, const char * format, const char * filename); - -#endif /* !R3_GVC_H */ diff --git a/src/gvc.c b/src/gvc.c index e24a555..963df28 100644 --- a/src/gvc.c +++ b/src/gvc.c @@ -9,7 +9,6 @@ #include #include #include "r3.h" -#include "r3_gvc.h" #include "zmalloc.h" void r3_tree_build_ag_nodes(Agraph_t * g, Agnode_t * ag_parent_node, const node * n, int node_cnt) { diff --git a/tests/check_gvc.c b/tests/check_gvc.c index ae43a60..6442d0a 100644 --- a/tests/check_gvc.c +++ b/tests/check_gvc.c @@ -10,7 +10,6 @@ #include #include "r3.h" #include "r3_str.h" -#include "r3_gvc.h" #include "bench.h" START_TEST (test_gvc_render_dot)