diff --git a/include/r3.h b/include/r3.h index 76fe534..9e5a618 100644 --- a/include/r3.h +++ b/include/r3.h @@ -133,11 +133,11 @@ void r3_tree_free(node * tree); void r3_edge_free(edge * edge); -edge * r3_node_connectl(node * n, char * pat, int len, int strdup, node *child); +edge * r3_node_connectl(node * n, const char * pat, int len, int strdup, node *child); #define r3_node_connect(n, pat, child) r3_node_connectl(n, pat, strlen(pat), 0, child) -edge * r3_node_find_edge(const node * n, char * pat); +edge * r3_node_find_edge(const node * n, const char * pat); void r3_node_append_edge(node *n, edge *child); diff --git a/src/node.c b/src/node.c index a44277b..e6e48ec 100644 --- a/src/node.c +++ b/src/node.c @@ -77,7 +77,7 @@ void r3_tree_free(node * tree) { tree = NULL; } -edge * r3_node_connectl(node * n, char * pat, int len, int dupl, node *child) { +edge * r3_node_connectl(node * n, const char * pat, int len, int dupl, node *child) { // find the same sub-pattern, if it does not exist, create one edge * e; @@ -109,7 +109,7 @@ void r3_node_append_edge(node *n, edge *e) { n->edges[ n->edge_len++ ] = e; } -edge * r3_node_find_edge(const node * n, char * pat) { +edge * r3_node_find_edge(const node * n, const char * pat) { edge * e; for (int i = 0 ; i < n->edge_len ; i++ ) { e = n->edges[i];