From e5219da6fe3797201c40e4d05b472f1c0540087f Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 5 Jan 2017 21:27:07 -0800 Subject: [PATCH] Add function prototypes for four basic libregex functions. --- include/libregex.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/libregex.h b/include/libregex.h index ef16101..e776d92 100644 --- a/include/libregex.h +++ b/include/libregex.h @@ -292,4 +292,30 @@ typedef struct regex_match_s regex_match; typedef struct regex_result_s regex_result; typedef struct regex_sim_s regex_sim; +/** + * Clears a node completely, resetting all the values to default. + * @param node the node to clear. + */ +void regex_node_clear(regex_node* node); +/** + * Frees an entire NFA, starting from the given root node. + * @param root the root, or starting node, of the NFA. + */ +void regex_free(regex_node* root); +/** + * Builds a regular expression from the given regular expression strings. + * @param root the root node to build into. + * @param expression the expression to construct the NFA from. + * @return the result of the operation: LIBREGEX_SUCCESS if all goes well, or an error code. + */ +libregex_result regex_build(regex_node** root, char* expression); +/** + * Matches the regular expression against a given string. + * @param root the root of a regular expression NFA + * @param string the string to be matched + * @param result the result to be populated with the data from matching the string. + * @return the result of the operation: LIBREGEX_SUCCESS if all goes well, or an error code. + */ +libregex_result regex_match_string(regex_node* root, char* string, regex_result* result); + #endif \ No newline at end of file