aboutsummaryrefslogtreecommitdiff
path: root/src/regex/regex_internal_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-06-20 09:02:43 +0000
committerChristian Grothoff <christian@grothoff.org>2013-06-20 09:02:43 +0000
commit566b7539fcaf9c455da665cb641016d2cfbb1b47 (patch)
treeeb12baa08d99313d6da7eb8c1be17c5e447f1586 /src/regex/regex_internal_lib.h
parentde9409f80dbfc5cc61a28316b271600e9da95cdc (diff)
downloadgnunet-566b7539fcaf9c455da665cb641016d2cfbb1b47.tar.gz
gnunet-566b7539fcaf9c455da665cb641016d2cfbb1b47.zip
renaming symbols from libgnunetregextest to have the prefix REGEX_TEST
Diffstat (limited to 'src/regex/regex_internal_lib.h')
-rw-r--r--src/regex/regex_internal_lib.h68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/regex/regex_internal_lib.h b/src/regex/regex_internal_lib.h
index e138535d4..7da08154d 100644
--- a/src/regex/regex_internal_lib.h
+++ b/src/regex/regex_internal_lib.h
@@ -42,13 +42,13 @@ extern "C"
42/** 42/**
43 * Automaton (NFA/DFA) representation. 43 * Automaton (NFA/DFA) representation.
44 */ 44 */
45struct REGEX_ITERNAL_Automaton; 45struct REGEX_INTERNAL_Automaton;
46 46
47 47
48/** 48/**
49 * Edge representation. 49 * Edge representation.
50 */ 50 */
51struct REGEX_ITERNAL_Edge 51struct REGEX_INTERNAL_Edge
52{ 52{
53 /** 53 /**
54 * Label of the edge. FIXME: might want to not consume exactly multiples of 8 bits, need length? 54 * Label of the edge. FIXME: might want to not consume exactly multiples of 8 bits, need length?
@@ -77,21 +77,21 @@ struct REGEX_ITERNAL_Edge
77 * @param max_path_len limit the path compression length to the 77 * @param max_path_len limit the path compression length to the
78 * given value. If set to 1, no path compression is applied. Set to 0 for 78 * given value. If set to 1, no path compression is applied. Set to 0 for
79 * maximal possible path compression (generally not desireable). 79 * maximal possible path compression (generally not desireable).
80 * @return DFA, needs to be freed using REGEX_ITERNAL_automaton_destroy. 80 * @return DFA, needs to be freed using REGEX_INTERNAL_automaton_destroy.
81 */ 81 */
82struct REGEX_ITERNAL_Automaton * 82struct REGEX_INTERNAL_Automaton *
83REGEX_ITERNAL_construct_dfa (const char *regex, const size_t len, 83REGEX_INTERNAL_construct_dfa (const char *regex, const size_t len,
84 unsigned int max_path_len); 84 unsigned int max_path_len);
85 85
86 86
87/** 87/**
88 * Free the memory allocated by constructing the REGEX_ITERNAL_Automaton. 88 * Free the memory allocated by constructing the REGEX_INTERNAL_Automaton.
89 * data structure. 89 * data structure.
90 * 90 *
91 * @param a automaton to be destroyed. 91 * @param a automaton to be destroyed.
92 */ 92 */
93void 93void
94REGEX_ITERNAL_automaton_destroy (struct REGEX_ITERNAL_Automaton *a); 94REGEX_INTERNAL_automaton_destroy (struct REGEX_INTERNAL_Automaton *a);
95 95
96 96
97/** 97/**
@@ -103,7 +103,7 @@ REGEX_ITERNAL_automaton_destroy (struct REGEX_ITERNAL_Automaton *a);
103 * @return 0 if string matches, non 0 otherwise. 103 * @return 0 if string matches, non 0 otherwise.
104 */ 104 */
105int 105int
106REGEX_ITERNAL_eval (struct REGEX_ITERNAL_Automaton *a, 106REGEX_INTERNAL_eval (struct REGEX_INTERNAL_Automaton *a,
107 const char *string); 107 const char *string);
108 108
109 109
@@ -119,7 +119,7 @@ REGEX_ITERNAL_eval (struct REGEX_ITERNAL_Automaton *a,
119 * to construct the key 119 * to construct the key
120 */ 120 */
121size_t 121size_t
122REGEX_ITERNAL_get_first_key (const char *input_string, size_t string_len, 122REGEX_INTERNAL_get_first_key (const char *input_string, size_t string_len,
123 struct GNUNET_HashCode * key); 123 struct GNUNET_HashCode * key);
124 124
125 125
@@ -132,7 +132,7 @@ REGEX_ITERNAL_get_first_key (const char *input_string, size_t string_len,
132 * @return GNUNET_OK if the proof is valid for the given key. 132 * @return GNUNET_OK if the proof is valid for the given key.
133 */ 133 */
134int 134int
135REGEX_ITERNAL_check_proof (const char *proof, 135REGEX_INTERNAL_check_proof (const char *proof,
136 const struct GNUNET_HashCode *key); 136 const struct GNUNET_HashCode *key);
137 137
138 138
@@ -146,12 +146,12 @@ REGEX_ITERNAL_check_proof (const char *proof,
146 * @param num_edges number of edges leaving current state. 146 * @param num_edges number of edges leaving current state.
147 * @param edges edges leaving current state. 147 * @param edges edges leaving current state.
148 */ 148 */
149typedef void (*REGEX_ITERNAL_KeyIterator)(void *cls, 149typedef void (*REGEX_INTERNAL_KeyIterator)(void *cls,
150 const struct GNUNET_HashCode *key, 150 const struct GNUNET_HashCode *key,
151 const char *proof, 151 const char *proof,
152 int accepting, 152 int accepting,
153 unsigned int num_edges, 153 unsigned int num_edges,
154 const struct REGEX_ITERNAL_Edge *edges); 154 const struct REGEX_INTERNAL_Edge *edges);
155 155
156 156
157/** 157/**
@@ -163,8 +163,8 @@ typedef void (*REGEX_ITERNAL_KeyIterator)(void *cls,
163 * @param iterator_cls closure. 163 * @param iterator_cls closure.
164 */ 164 */
165void 165void
166REGEX_ITERNAL_iterate_all_edges (struct REGEX_ITERNAL_Automaton *a, 166REGEX_INTERNAL_iterate_all_edges (struct REGEX_INTERNAL_Automaton *a,
167 REGEX_ITERNAL_KeyIterator iterator, 167 REGEX_INTERNAL_KeyIterator iterator,
168 void *iterator_cls); 168 void *iterator_cls);
169 169
170 170
@@ -172,16 +172,16 @@ REGEX_ITERNAL_iterate_all_edges (struct REGEX_ITERNAL_Automaton *a,
172/** 172/**
173 * Handle to store cached data about a regex announce. 173 * Handle to store cached data about a regex announce.
174 */ 174 */
175struct REGEX_ITERNAL_Announcement; 175struct REGEX_INTERNAL_Announcement;
176 176
177/** 177/**
178 * Handle to store data about a regex search. 178 * Handle to store data about a regex search.
179 */ 179 */
180struct REGEX_ITERNAL_Search; 180struct REGEX_INTERNAL_Search;
181 181
182/** 182/**
183 * Announce a regular expression: put all states of the automaton in the DHT. 183 * Announce a regular expression: put all states of the automaton in the DHT.
184 * Does not free resources, must call REGEX_ITERNAL_announce_cancel for that. 184 * Does not free resources, must call REGEX_INTERNAL_announce_cancel for that.
185 * 185 *
186 * @param dht An existing and valid DHT service handle. CANNOT be NULL. 186 * @param dht An existing and valid DHT service handle. CANNOT be NULL.
187 * @param id ID to announce as provider of regex. Own ID in most cases. 187 * @param id ID to announce as provider of regex. Own ID in most cases.
@@ -190,10 +190,10 @@ struct REGEX_ITERNAL_Search;
190 * @param stats Optional statistics handle to report usage. Can be NULL. 190 * @param stats Optional statistics handle to report usage. Can be NULL.
191 * 191 *
192 * @return Handle to reuse o free cached resources. 192 * @return Handle to reuse o free cached resources.
193 * Must be freed by calling REGEX_ITERNAL_announce_cancel. 193 * Must be freed by calling REGEX_INTERNAL_announce_cancel.
194 */ 194 */
195struct REGEX_ITERNAL_Announcement * 195struct REGEX_INTERNAL_Announcement *
196REGEX_ITERNAL_announce (struct GNUNET_DHT_Handle *dht, 196REGEX_INTERNAL_announce (struct GNUNET_DHT_Handle *dht,
197 const struct GNUNET_PeerIdentity *id, 197 const struct GNUNET_PeerIdentity *id,
198 const char *regex, 198 const char *regex,
199 uint16_t compression, 199 uint16_t compression,
@@ -203,33 +203,33 @@ REGEX_ITERNAL_announce (struct GNUNET_DHT_Handle *dht,
203 * Announce again a regular expression previously announced. 203 * Announce again a regular expression previously announced.
204 * Does use caching to speed up process. 204 * Does use caching to speed up process.
205 * 205 *
206 * @param h Handle returned by a previous REGEX_ITERNAL_announce call. 206 * @param h Handle returned by a previous REGEX_INTERNAL_announce call.
207 */ 207 */
208void 208void
209REGEX_ITERNAL_reannounce (struct REGEX_ITERNAL_Announcement *h); 209REGEX_INTERNAL_reannounce (struct REGEX_INTERNAL_Announcement *h);
210 210
211 211
212/** 212/**
213 * Clear all cached data used by a regex announce. 213 * Clear all cached data used by a regex announce.
214 * Does not close DHT connection. 214 * Does not close DHT connection.
215 * 215 *
216 * @param h Handle returned by a previous REGEX_ITERNAL_announce call. 216 * @param h Handle returned by a previous REGEX_INTERNAL_announce call.
217 */ 217 */
218void 218void
219REGEX_ITERNAL_announce_cancel (struct REGEX_ITERNAL_Announcement *h); 219REGEX_INTERNAL_announce_cancel (struct REGEX_INTERNAL_Announcement *h);
220 220
221 221
222/** 222/**
223 * Search callback function. 223 * Search callback function.
224 * 224 *
225 * @param cls Closure provided in REGEX_ITERNAL_search. 225 * @param cls Closure provided in REGEX_INTERNAL_search.
226 * @param id Peer providing a regex that matches the string. 226 * @param id Peer providing a regex that matches the string.
227 * @param get_path Path of the get request. 227 * @param get_path Path of the get request.
228 * @param get_path_length Lenght of get_path. 228 * @param get_path_length Lenght of get_path.
229 * @param put_path Path of the put request. 229 * @param put_path Path of the put request.
230 * @param put_path_length Length of the put_path. 230 * @param put_path_length Length of the put_path.
231 */ 231 */
232typedef void (*REGEX_ITERNAL_Found)(void *cls, 232typedef void (*REGEX_INTERNAL_Found)(void *cls,
233 const struct GNUNET_PeerIdentity *id, 233 const struct GNUNET_PeerIdentity *id,
234 const struct GNUNET_PeerIdentity *get_path, 234 const struct GNUNET_PeerIdentity *get_path,
235 unsigned int get_path_length, 235 unsigned int get_path_length,
@@ -239,7 +239,7 @@ typedef void (*REGEX_ITERNAL_Found)(void *cls,
239 239
240/** 240/**
241 * Search for a peer offering a regex matching certain string in the DHT. 241 * Search for a peer offering a regex matching certain string in the DHT.
242 * The search runs until REGEX_ITERNAL_search_cancel is called, even if results 242 * The search runs until REGEX_INTERNAL_search_cancel is called, even if results
243 * are returned. 243 * are returned.
244 * 244 *
245 * @param dht An existing and valid DHT service handle. 245 * @param dht An existing and valid DHT service handle.
@@ -249,23 +249,23 @@ typedef void (*REGEX_ITERNAL_Found)(void *cls,
249 * @param stats Optional statistics handle to report usage. Can be NULL. 249 * @param stats Optional statistics handle to report usage. Can be NULL.
250 * 250 *
251 * @return Handle to stop search and free resources. 251 * @return Handle to stop search and free resources.
252 * Must be freed by calling REGEX_ITERNAL_search_cancel. 252 * Must be freed by calling REGEX_INTERNAL_search_cancel.
253 */ 253 */
254struct REGEX_ITERNAL_Search * 254struct REGEX_INTERNAL_Search *
255REGEX_ITERNAL_search (struct GNUNET_DHT_Handle *dht, 255REGEX_INTERNAL_search (struct GNUNET_DHT_Handle *dht,
256 const char *string, 256 const char *string,
257 REGEX_ITERNAL_Found callback, 257 REGEX_INTERNAL_Found callback,
258 void *callback_cls, 258 void *callback_cls,
259 struct GNUNET_STATISTICS_Handle *stats); 259 struct GNUNET_STATISTICS_Handle *stats);
260 260
261/** 261/**
262 * Stop search and free all data used by a REGEX_ITERNAL_search call. 262 * Stop search and free all data used by a REGEX_INTERNAL_search call.
263 * Does not close DHT connection. 263 * Does not close DHT connection.
264 * 264 *
265 * @param h Handle returned by a previous REGEX_ITERNAL_search call. 265 * @param h Handle returned by a previous REGEX_INTERNAL_search call.
266 */ 266 */
267void 267void
268REGEX_ITERNAL_search_cancel (struct REGEX_ITERNAL_Search *h); 268REGEX_INTERNAL_search_cancel (struct REGEX_INTERNAL_Search *h);
269 269
270 270
271#if 0 /* keep Emacsens' auto-indent happy */ 271#if 0 /* keep Emacsens' auto-indent happy */