From: Christian Grothoff Date: Mon, 16 Apr 2012 10:51:59 +0000 (+0000) Subject: -joint hdr hacking X-Git-Tag: initial-import-from-subversion-38251~13920 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=807bed4b1337805a14da1364597d9ef59dd5de55;p=oweals%2Fgnunet.git -joint hdr hacking --- diff --git a/src/include/gnunet_regex_lib.h b/src/include/gnunet_regex_lib.h index c54f3b88b..100b73f50 100644 --- a/src/include/gnunet_regex_lib.h +++ b/src/include/gnunet_regex_lib.h @@ -101,6 +101,7 @@ GNUNET_REGEX_eval (struct GNUNET_REGEX_Automaton *a, const char *string); + /** * Get the starting state of the given automaton 'a'. * @@ -111,6 +112,45 @@ GNUNET_REGEX_eval (struct GNUNET_REGEX_Automaton *a, struct GNUNET_REGEX_State * GNUNET_REGEX_automaton_get_start (struct GNUNET_REGEX_Automaton *a); + +/** + * @return number of bits of 'input_string' that have been consumed + * to construct the key + */ +unsigned int +GNUNET_REGEX_get_first_key (const char *input_string, + GNUNET_HashCode *key); + + + +/** + * @return GNUNET_OK if the proof is valid for the given key + */ +int +GNUNET_REGEX_check_proof (const char *proof, + const GNUNET_HashCode *key); + + +struct GNUNET_REGEX_Edge +{ + const char *label; + GNUNET_HashCode destination; +}; + + +typedef void (*GNUNET_REGEX_KeyIterator)(void *cls, + const GNUNET_HashCode *key, + const char *proof, + unsigned int num_edges, + const struct GNUNET_REGEX_Edge *edges); + + +int +GNUNET_REGEX_iterate_all_edges (struct GNUNET_REGEX_Automaton *a, + GNUNET_REGEX_KeyIterator iterator, + void *iterator_cls); + + /** * Get the next states, starting from states 's'. * @@ -140,6 +180,9 @@ GNUNET_REGEX_automaton_states_hash (struct GNUNET_REGEX_Automaton *a, struct GNUNET_REGEX_State **s, unsigned int count); + + + #if 0 /* keep Emacsens' auto-indent happy */ { #endif