diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-26 11:51:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-26 11:51:44 +0000 |
commit | 9058f938b0a651aaa3345755b76395c3385d246d (patch) | |
tree | c21583b85693e152de8af325c014eb52c716919d /src/regex | |
parent | 5f38f9933e6f19fcef0ded8aad3d6db4e6cbb666 (diff) | |
download | gnunet-9058f938b0a651aaa3345755b76395c3385d246d.tar.gz gnunet-9058f938b0a651aaa3345755b76395c3385d246d.zip |
-renaming symbols of the block library to use the REGEX_BLOCK_ prefix and not the REGEX_INTERNAL_ prefix
Diffstat (limited to 'src/regex')
-rw-r--r-- | src/regex/gnunet-regex-simulation-profiler.c | 2 | ||||
-rw-r--r-- | src/regex/perf-regex.c | 2 | ||||
-rw-r--r-- | src/regex/plugin_block_regex.c | 4 | ||||
-rw-r--r-- | src/regex/regex_block_lib.c | 10 | ||||
-rw-r--r-- | src/regex/regex_block_lib.h | 12 | ||||
-rw-r--r-- | src/regex/regex_internal.c | 8 | ||||
-rw-r--r-- | src/regex/regex_internal_dht.c | 6 | ||||
-rw-r--r-- | src/regex/regex_internal_lib.h | 2 | ||||
-rw-r--r-- | src/regex/test_regex_iterate_api.c | 2 |
9 files changed, 24 insertions, 24 deletions
diff --git a/src/regex/gnunet-regex-simulation-profiler.c b/src/regex/gnunet-regex-simulation-profiler.c index dcb6c02f6..fdbc918c2 100644 --- a/src/regex/gnunet-regex-simulation-profiler.c +++ b/src/regex/gnunet-regex-simulation-profiler.c | |||
@@ -335,7 +335,7 @@ return_ok (void *cls, unsigned int num_values, MYSQL_BIND * values) | |||
335 | static void | 335 | static void |
336 | regex_iterator (void *cls, const struct GNUNET_HashCode *key, const char *proof, | 336 | regex_iterator (void *cls, const struct GNUNET_HashCode *key, const char *proof, |
337 | int accepting, unsigned int num_edges, | 337 | int accepting, unsigned int num_edges, |
338 | const struct REGEX_INTERNAL_Edge *edges) | 338 | const struct REGEX_BLOCK_Edge *edges) |
339 | { | 339 | { |
340 | unsigned int i; | 340 | unsigned int i; |
341 | int result; | 341 | int result; |
diff --git a/src/regex/perf-regex.c b/src/regex/perf-regex.c index bc723b6cb..bf19a2bff 100644 --- a/src/regex/perf-regex.c +++ b/src/regex/perf-regex.c | |||
@@ -53,7 +53,7 @@ iter (void *cls, | |||
53 | const char *proof, | 53 | const char *proof, |
54 | int accepting, | 54 | int accepting, |
55 | unsigned int num_edges, | 55 | unsigned int num_edges, |
56 | const struct REGEX_INTERNAL_Edge *edges) | 56 | const struct REGEX_BLOCK_Edge *edges) |
57 | { | 57 | { |
58 | unsigned int i; | 58 | unsigned int i; |
59 | 59 | ||
diff --git a/src/regex/plugin_block_regex.c b/src/regex/plugin_block_regex.c index 565356786..9bbf4afed 100644 --- a/src/regex/plugin_block_regex.c +++ b/src/regex/plugin_block_regex.c | |||
@@ -108,10 +108,10 @@ evaluate_block_regex (void *cls, enum GNUNET_BLOCK_Type type, | |||
108 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Block with no xquery\n"); | 108 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Block with no xquery\n"); |
109 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " key: %s, %u edges\n", | 109 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " key: %s, %u edges\n", |
110 | GNUNET_h2s (&rblock->key), ntohl (rblock->n_edges)); | 110 | GNUNET_h2s (&rblock->key), ntohl (rblock->n_edges)); |
111 | REGEX_INTERNAL_block_iterate (rblock, reply_block_size, &rdebug, NULL); | 111 | REGEX_BLOCK_iterate (rblock, reply_block_size, &rdebug, NULL); |
112 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 112 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
113 | } | 113 | } |
114 | switch (REGEX_INTERNAL_block_check (reply_block, | 114 | switch (REGEX_BLOCK_check (reply_block, |
115 | reply_block_size, | 115 | reply_block_size, |
116 | xquery)) | 116 | xquery)) |
117 | { | 117 | { |
diff --git a/src/regex/regex_block_lib.c b/src/regex/regex_block_lib.c index 052c712c1..851bdba14 100644 --- a/src/regex/regex_block_lib.c +++ b/src/regex/regex_block_lib.c | |||
@@ -82,7 +82,7 @@ check_edge (void *cls, | |||
82 | 82 | ||
83 | 83 | ||
84 | int | 84 | int |
85 | REGEX_INTERNAL_block_check (const struct RegexBlock *block, | 85 | REGEX_BLOCK_check (const struct RegexBlock *block, |
86 | size_t size, | 86 | size_t size, |
87 | const char *xquery) | 87 | const char *xquery) |
88 | { | 88 | { |
@@ -98,7 +98,7 @@ REGEX_INTERNAL_block_check (const struct RegexBlock *block, | |||
98 | ctx.xquery = xquery; | 98 | ctx.xquery = xquery; |
99 | ctx.found = GNUNET_NO; | 99 | ctx.found = GNUNET_NO; |
100 | ctx.key = GNUNET_strdup (GNUNET_h2s (&block->key)); | 100 | ctx.key = GNUNET_strdup (GNUNET_h2s (&block->key)); |
101 | res = REGEX_INTERNAL_block_iterate (block, size, &check_edge, &ctx); | 101 | res = REGEX_BLOCK_iterate (block, size, &check_edge, &ctx); |
102 | GNUNET_free (ctx.key); | 102 | GNUNET_free (ctx.key); |
103 | if (GNUNET_SYSERR == res) | 103 | if (GNUNET_SYSERR == res) |
104 | return GNUNET_SYSERR; | 104 | return GNUNET_SYSERR; |
@@ -109,7 +109,7 @@ REGEX_INTERNAL_block_check (const struct RegexBlock *block, | |||
109 | 109 | ||
110 | 110 | ||
111 | int | 111 | int |
112 | REGEX_INTERNAL_block_iterate (const struct RegexBlock *block, | 112 | REGEX_BLOCK_iterate (const struct RegexBlock *block, |
113 | size_t size, | 113 | size_t size, |
114 | REGEX_INTERNAL_EgdeIterator iterator, | 114 | REGEX_INTERNAL_EgdeIterator iterator, |
115 | void *iter_cls) | 115 | void *iter_cls) |
@@ -191,10 +191,10 @@ REGEX_INTERNAL_block_iterate (const struct RegexBlock *block, | |||
191 | * @return the regex block | 191 | * @return the regex block |
192 | */ | 192 | */ |
193 | struct RegexBlock * | 193 | struct RegexBlock * |
194 | REGEX_INTERNAL_block_create (const struct GNUNET_HashCode *key, | 194 | REGEX_BLOCK_create (const struct GNUNET_HashCode *key, |
195 | const char *proof, | 195 | const char *proof, |
196 | unsigned int num_edges, | 196 | unsigned int num_edges, |
197 | const struct REGEX_INTERNAL_Edge *edges, | 197 | const struct REGEX_BLOCK_Edge *edges, |
198 | int accepting, | 198 | int accepting, |
199 | size_t *rsize) | 199 | size_t *rsize) |
200 | { | 200 | { |
diff --git a/src/regex/regex_block_lib.h b/src/regex/regex_block_lib.h index ad4884f4d..79bd20a1e 100644 --- a/src/regex/regex_block_lib.h +++ b/src/regex/regex_block_lib.h | |||
@@ -43,7 +43,7 @@ extern "C" | |||
43 | /** | 43 | /** |
44 | * Edge representation. | 44 | * Edge representation. |
45 | */ | 45 | */ |
46 | struct REGEX_INTERNAL_Edge | 46 | struct REGEX_BLOCK_Edge |
47 | { | 47 | { |
48 | /** | 48 | /** |
49 | * Label of the edge. FIXME: might want to not consume exactly multiples of 8 bits, need length! | 49 | * Label of the edge. FIXME: might want to not consume exactly multiples of 8 bits, need length! |
@@ -70,12 +70,12 @@ struct REGEX_INTERNAL_Edge | |||
70 | * GNUNET_SYSERR if the block is invalid. | 70 | * GNUNET_SYSERR if the block is invalid. |
71 | */ | 71 | */ |
72 | int | 72 | int |
73 | REGEX_INTERNAL_block_check (const struct RegexBlock *block, | 73 | REGEX_BLOCK_check (const struct RegexBlock *block, |
74 | size_t size, | 74 | size_t size, |
75 | const char *xquery); | 75 | const char *xquery); |
76 | 76 | ||
77 | 77 | ||
78 | /* FIXME: might want to use 'struct REGEX_INTERNAL_Edge' here instead of 3 arguments! */ | 78 | /* FIXME: might want to use 'struct REGEX_BLOCK_Edge' here instead of 3 arguments! */ |
79 | 79 | ||
80 | /** | 80 | /** |
81 | * Iterator over edges in a block. | 81 | * Iterator over edges in a block. |
@@ -110,7 +110,7 @@ typedef int (*REGEX_INTERNAL_EgdeIterator)(void *cls, | |||
110 | * be errors in further edges. | 110 | * be errors in further edges. |
111 | */ | 111 | */ |
112 | int | 112 | int |
113 | REGEX_INTERNAL_block_iterate (const struct RegexBlock *block, | 113 | REGEX_BLOCK_iterate (const struct RegexBlock *block, |
114 | size_t size, | 114 | size_t size, |
115 | REGEX_INTERNAL_EgdeIterator iterator, | 115 | REGEX_INTERNAL_EgdeIterator iterator, |
116 | void *iter_cls); | 116 | void *iter_cls); |
@@ -125,10 +125,10 @@ REGEX_INTERNAL_block_iterate (const struct RegexBlock *block, | |||
125 | * @return the regex block | 125 | * @return the regex block |
126 | */ | 126 | */ |
127 | struct RegexBlock * | 127 | struct RegexBlock * |
128 | REGEX_INTERNAL_block_create (const struct GNUNET_HashCode *key, | 128 | REGEX_BLOCK_create (const struct GNUNET_HashCode *key, |
129 | const char *proof, | 129 | const char *proof, |
130 | unsigned int num_edges, | 130 | unsigned int num_edges, |
131 | const struct REGEX_INTERNAL_Edge *edges, | 131 | const struct REGEX_BLOCK_Edge *edges, |
132 | int accepting, | 132 | int accepting, |
133 | size_t *rsize); | 133 | size_t *rsize); |
134 | 134 | ||
diff --git a/src/regex/regex_internal.c b/src/regex/regex_internal.c index 6fda695a7..059aaaed6 100644 --- a/src/regex/regex_internal.c +++ b/src/regex/regex_internal.c | |||
@@ -205,7 +205,7 @@ state_compare (const void *a, const void *b) | |||
205 | * @return number of edges. | 205 | * @return number of edges. |
206 | */ | 206 | */ |
207 | static unsigned int | 207 | static unsigned int |
208 | state_get_edges (struct REGEX_INTERNAL_State *s, struct REGEX_INTERNAL_Edge *edges) | 208 | state_get_edges (struct REGEX_INTERNAL_State *s, struct REGEX_BLOCK_Edge *edges) |
209 | { | 209 | { |
210 | struct REGEX_INTERNAL_Transition *t; | 210 | struct REGEX_INTERNAL_Transition *t; |
211 | unsigned int count; | 211 | unsigned int count; |
@@ -3372,8 +3372,8 @@ iterate_initial_edge (const unsigned int min_len, const unsigned int max_len, | |||
3372 | char *temp; | 3372 | char *temp; |
3373 | struct REGEX_INTERNAL_Transition *t; | 3373 | struct REGEX_INTERNAL_Transition *t; |
3374 | unsigned int num_edges = state->transition_count; | 3374 | unsigned int num_edges = state->transition_count; |
3375 | struct REGEX_INTERNAL_Edge edges[num_edges]; | 3375 | struct REGEX_BLOCK_Edge edges[num_edges]; |
3376 | struct REGEX_INTERNAL_Edge edge[1]; | 3376 | struct REGEX_BLOCK_Edge edge[1]; |
3377 | struct GNUNET_HashCode hash; | 3377 | struct GNUNET_HashCode hash; |
3378 | struct GNUNET_HashCode hash_new; | 3378 | struct GNUNET_HashCode hash_new; |
3379 | 3379 | ||
@@ -3463,7 +3463,7 @@ REGEX_INTERNAL_iterate_all_edges (struct REGEX_INTERNAL_Automaton *a, | |||
3463 | 3463 | ||
3464 | for (s = a->states_head; NULL != s; s = s->next) | 3464 | for (s = a->states_head; NULL != s; s = s->next) |
3465 | { | 3465 | { |
3466 | struct REGEX_INTERNAL_Edge edges[s->transition_count]; | 3466 | struct REGEX_BLOCK_Edge edges[s->transition_count]; |
3467 | unsigned int num_edges; | 3467 | unsigned int num_edges; |
3468 | 3468 | ||
3469 | num_edges = state_get_edges (s, edges); | 3469 | num_edges = state_get_edges (s, edges); |
diff --git a/src/regex/regex_internal_dht.c b/src/regex/regex_internal_dht.c index 3ddee06ff..5618eb66a 100644 --- a/src/regex/regex_internal_dht.c +++ b/src/regex/regex_internal_dht.c | |||
@@ -87,7 +87,7 @@ regex_iterator (void *cls, | |||
87 | const char *proof, | 87 | const char *proof, |
88 | int accepting, | 88 | int accepting, |
89 | unsigned int num_edges, | 89 | unsigned int num_edges, |
90 | const struct REGEX_INTERNAL_Edge *edges) | 90 | const struct REGEX_BLOCK_Edge *edges) |
91 | { | 91 | { |
92 | struct REGEX_INTERNAL_Announcement *h = cls; | 92 | struct REGEX_INTERNAL_Announcement *h = cls; |
93 | struct RegexBlock *block; | 93 | struct RegexBlock *block; |
@@ -123,7 +123,7 @@ regex_iterator (void *cls, | |||
123 | DHT_TTL, | 123 | DHT_TTL, |
124 | NULL, NULL); | 124 | NULL, NULL); |
125 | } | 125 | } |
126 | block = REGEX_INTERNAL_block_create (key, proof, | 126 | block = REGEX_BLOCK_create (key, proof, |
127 | num_edges, edges, | 127 | num_edges, edges, |
128 | accepting, | 128 | accepting, |
129 | &size); | 129 | &size); |
@@ -573,7 +573,7 @@ regex_next_edge (const struct RegexBlock *block, | |||
573 | /* Find the longest match for the current string position, | 573 | /* Find the longest match for the current string position, |
574 | * among tokens in the given block */ | 574 | * among tokens in the given block */ |
575 | ctx->longest_match = 0; | 575 | ctx->longest_match = 0; |
576 | result = REGEX_INTERNAL_block_iterate (block, size, | 576 | result = REGEX_BLOCK_iterate (block, size, |
577 | ®ex_edge_iterator, ctx); | 577 | ®ex_edge_iterator, ctx); |
578 | GNUNET_break (GNUNET_OK == result); | 578 | GNUNET_break (GNUNET_OK == result); |
579 | 579 | ||
diff --git a/src/regex/regex_internal_lib.h b/src/regex/regex_internal_lib.h index f8bf36344..1c8946449 100644 --- a/src/regex/regex_internal_lib.h +++ b/src/regex/regex_internal_lib.h | |||
@@ -135,7 +135,7 @@ typedef void (*REGEX_INTERNAL_KeyIterator)(void *cls, | |||
135 | const char *proof, | 135 | const char *proof, |
136 | int accepting, | 136 | int accepting, |
137 | unsigned int num_edges, | 137 | unsigned int num_edges, |
138 | const struct REGEX_INTERNAL_Edge *edges); | 138 | const struct REGEX_BLOCK_Edge *edges); |
139 | 139 | ||
140 | 140 | ||
141 | /** | 141 | /** |
diff --git a/src/regex/test_regex_iterate_api.c b/src/regex/test_regex_iterate_api.c index cf7ee2298..fa94c58ab 100644 --- a/src/regex/test_regex_iterate_api.c +++ b/src/regex/test_regex_iterate_api.c | |||
@@ -61,7 +61,7 @@ struct RegexStringPair | |||
61 | static void | 61 | static void |
62 | key_iterator (void *cls, const struct GNUNET_HashCode *key, const char *proof, | 62 | key_iterator (void *cls, const struct GNUNET_HashCode *key, const char *proof, |
63 | int accepting, unsigned int num_edges, | 63 | int accepting, unsigned int num_edges, |
64 | const struct REGEX_INTERNAL_Edge *edges) | 64 | const struct REGEX_BLOCK_Edge *edges) |
65 | { | 65 | { |
66 | unsigned int i; | 66 | unsigned int i; |
67 | struct IteratorContext *ctx = cls; | 67 | struct IteratorContext *ctx = cls; |