struct node * children
All nodes, whose routes include this node's val in their fsegment.
Definition tree.h:40
struct node * siblings
All nodes, whose routes include this node's, parent's, val in their fsegment.
Definition tree.h:42
callback_t callback
The function that will be ran when a request comes.
Definition tree.h:44
char * val
a URI fsegment
Definition tree.h:38
Definition request_parser.h:11
node * find_node_by_val(node *n, char *val)
gets the node that matches a given val in a DFS manner
Definition tree.c:17
node * trace_tree_exact(char route[], node *root)
returns the node of the last segment in the URI. If a complete trace isn't found, return null.
Definition tree.c:55
void destroy_tree(node *n)
Given a root node, deallocate the entire tree.
Definition tree.c:73
void print_tree(node *n, int level)
Given a root node, print the entire tree in a DFS manner, along with the level of each node.
Definition tree.c:88
node * trace_tree(char route[], node *origin_node)
given a route, return the deepest node that exists in the tree that satisfies the route
Definition tree.c:33