[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r21004 - in gnunet/src: include regex
From: |
gnunet |
Subject: |
[GNUnet-SVN] r21004 - in gnunet/src: include regex |
Date: |
Wed, 18 Apr 2012 11:30:06 +0200 |
Author: szengel
Date: 2012-04-18 11:30:06 +0200 (Wed, 18 Apr 2012)
New Revision: 21004
Modified:
gnunet/src/include/gnunet_regex_lib.h
gnunet/src/regex/regex.c
Log:
added accepting state info to api
Modified: gnunet/src/include/gnunet_regex_lib.h
===================================================================
--- gnunet/src/include/gnunet_regex_lib.h 2012-04-18 06:55:58 UTC (rev
21003)
+++ gnunet/src/include/gnunet_regex_lib.h 2012-04-18 09:30:06 UTC (rev
21004)
@@ -140,12 +140,14 @@
* @param cls closure.
* @param key hash for current state.
* @param proof proof for current state.
+ * @param accepting GNUNET_YES if this is an accepting state, GNUNET_NO if not.
* @param num_edges number of edges leaving current state.
* @param edges edges leaving current state.
*/
typedef void (*GNUNET_REGEX_KeyIterator)(void *cls,
const GNUNET_HashCode *key,
const char *proof,
+ int accepting,
unsigned int num_edges,
const struct GNUNET_REGEX_Edge
*edges);
Modified: gnunet/src/regex/regex.c
===================================================================
--- gnunet/src/regex/regex.c 2012-04-18 06:55:58 UTC (rev 21003)
+++ gnunet/src/regex/regex.c 2012-04-18 09:30:06 UTC (rev 21004)
@@ -663,14 +663,15 @@
a->state_count++;
}
-typedef void (*GNUNET_REGEX_traverse_action)(void *cls, struct
- GNUNET_REGEX_State *s);
+typedef void (*GNUNET_REGEX_traverse_action) (void *cls,
+ struct GNUNET_REGEX_State * s);
/**
* Traverses all states that are reachable from state 's'. Expects
* the states to be unmarked (s->marked == GNUNET_NO). Performs
* 'action' on each visited state.
*
+ * @param cls closure.
* @param s start state.
* @param action action to be performed on each state.
*/
@@ -696,6 +697,7 @@
* Traverses the given automaton from it's start state, visiting all
* reachable states and calling 'action' on each one of them.
*
+ * @param cls closure.
* @param a automaton.
* @param action action to be performed on each state.
*/
@@ -1188,8 +1190,7 @@
*/
static struct GNUNET_REGEX_StateSet *
nfa_closure_set_create (struct GNUNET_REGEX_Automaton *nfa,
- struct GNUNET_REGEX_StateSet *states,
- const char label)
+ struct GNUNET_REGEX_StateSet *states, const char label)
{
struct GNUNET_REGEX_State *s;
struct GNUNET_REGEX_StateSet *sset;
@@ -1953,9 +1954,8 @@
* to construct the key
*/
unsigned int
-GNUNET_REGEX_get_first_key (const char *input_string,
- unsigned int string_len,
- GNUNET_HashCode *key)
+GNUNET_REGEX_get_first_key (const char *input_string, unsigned int string_len,
+ GNUNET_HashCode * key)
{
unsigned int size;
@@ -1981,8 +1981,7 @@
* @return GNUNET_OK if the proof is valid for the given key
*/
int
-GNUNET_REGEX_check_proof (const char *proof,
- const GNUNET_HashCode *key)
+GNUNET_REGEX_check_proof (const char *proof, const GNUNET_HashCode * key)
{
return GNUNET_OK;
}
@@ -2027,8 +2026,7 @@
* @param iterator_cls closure.
*/
static void
-iterate_edge (struct GNUNET_REGEX_State *s,
- GNUNET_REGEX_KeyIterator iterator,
+iterate_edge (struct GNUNET_REGEX_State *s, GNUNET_REGEX_KeyIterator iterator,
void *iterator_cls)
{
struct Transition *t;
@@ -2041,14 +2039,9 @@
num_edges = state_get_edges (s, edges);
- iterator (iterator_cls,
- &s->hash,
- NULL,
+ iterator (iterator_cls, &s->hash, NULL, s->accepting, num_edges, edges);
- num_edges,
- edges);
-
for (t = s->transitions_head; NULL != t; t = t->next)
iterate_edge (t->to_state, iterator, iterator_cls);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r21004 - in gnunet/src: include regex,
gnunet <=