libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
int r3_parse_slugs( char * path, char ** slugs )
this function parses the slug names from the path.
this function returns the length of the slugs. each slug is a null-terminated strings.
int list_len = r3_parse_slugs("/user/{id}", token_list);
r3_apply_slugs( char * path, ...)
this function applies the variables into the slugs by the ordering. so an URL generator could be implemented.
int r3_parse_slugs( char * path, char ** slugs )
this function parses the slug names from the path. this function returns the length of the slugs. each slug is a null-terminated strings.r3_apply_slugs( char * path, ...)
this function applies the variables into the slugs by the ordering. so an URL generator could be implemented.