aboutsummaryrefslogtreecommitdiff
path: root/src/regex/regex_internal.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.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.h')
-rw-r--r--src/regex/regex_internal.h96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/regex/regex_internal.h b/src/regex/regex_internal.h
index cd76c1c73..69a8971d5 100644
--- a/src/regex/regex_internal.h
+++ b/src/regex/regex_internal.h
@@ -47,17 +47,17 @@ extern "C"
47 * which they origin ('from_state'). Each state can have 0-n transitions. 47 * which they origin ('from_state'). Each state can have 0-n transitions.
48 * If label is NULL, this is considered to be an epsilon transition. 48 * If label is NULL, this is considered to be an epsilon transition.
49 */ 49 */
50struct REGEX_ITERNAL_Transition 50struct REGEX_INTERNAL_Transition
51{ 51{
52 /** 52 /**
53 * This is a linked list. 53 * This is a linked list.
54 */ 54 */
55 struct REGEX_ITERNAL_Transition *prev; 55 struct REGEX_INTERNAL_Transition *prev;
56 56
57 /** 57 /**
58 * This is a linked list. 58 * This is a linked list.
59 */ 59 */
60 struct REGEX_ITERNAL_Transition *next; 60 struct REGEX_INTERNAL_Transition *next;
61 61
62 /** 62 /**
63 * Unique id of this transition. 63 * Unique id of this transition.
@@ -72,30 +72,30 @@ struct REGEX_ITERNAL_Transition
72 /** 72 /**
73 * State to which this transition leads. 73 * State to which this transition leads.
74 */ 74 */
75 struct REGEX_ITERNAL_State *to_state; 75 struct REGEX_INTERNAL_State *to_state;
76 76
77 /** 77 /**
78 * State from which this transition origins. 78 * State from which this transition origins.
79 */ 79 */
80 struct REGEX_ITERNAL_State *from_state; 80 struct REGEX_INTERNAL_State *from_state;
81}; 81};
82 82
83 83
84/** 84/**
85 * A state. Can be used in DFA and NFA automatons. 85 * A state. Can be used in DFA and NFA automatons.
86 */ 86 */
87struct REGEX_ITERNAL_State; 87struct REGEX_INTERNAL_State;
88 88
89 89
90/** 90/**
91 * Set of states. 91 * Set of states.
92 */ 92 */
93struct REGEX_ITERNAL_StateSet 93struct REGEX_INTERNAL_StateSet
94{ 94{
95 /** 95 /**
96 * Array of states. 96 * Array of states.
97 */ 97 */
98 struct REGEX_ITERNAL_State **states; 98 struct REGEX_INTERNAL_State **states;
99 99
100 /** 100 /**
101 * Number of entries in *use* in the 'states' array. 101 * Number of entries in *use* in the 'states' array.
@@ -112,37 +112,37 @@ struct REGEX_ITERNAL_StateSet
112/** 112/**
113 * A state. Can be used in DFA and NFA automatons. 113 * A state. Can be used in DFA and NFA automatons.
114 */ 114 */
115struct REGEX_ITERNAL_State 115struct REGEX_INTERNAL_State
116{ 116{
117 /** 117 /**
118 * This is a linked list to keep states in an automaton. 118 * This is a linked list to keep states in an automaton.
119 */ 119 */
120 struct REGEX_ITERNAL_State *prev; 120 struct REGEX_INTERNAL_State *prev;
121 121
122 /** 122 /**
123 * This is a linked list to keep states in an automaton. 123 * This is a linked list to keep states in an automaton.
124 */ 124 */
125 struct REGEX_ITERNAL_State *next; 125 struct REGEX_INTERNAL_State *next;
126 126
127 /** 127 /**
128 * This is a multi DLL for StateSet_MDLL. 128 * This is a multi DLL for StateSet_MDLL.
129 */ 129 */
130 struct REGEX_ITERNAL_State *prev_SS; 130 struct REGEX_INTERNAL_State *prev_SS;
131 131
132 /** 132 /**
133 * This is a multi DLL for StateSet_MDLL. 133 * This is a multi DLL for StateSet_MDLL.
134 */ 134 */
135 struct REGEX_ITERNAL_State *next_SS; 135 struct REGEX_INTERNAL_State *next_SS;
136 136
137 /** 137 /**
138 * This is a multi DLL for StateSet_MDLL Stack. 138 * This is a multi DLL for StateSet_MDLL Stack.
139 */ 139 */
140 struct REGEX_ITERNAL_State *prev_ST; 140 struct REGEX_INTERNAL_State *prev_ST;
141 141
142 /** 142 /**
143 * This is a multi DLL for StateSet_MDLL Stack. 143 * This is a multi DLL for StateSet_MDLL Stack.
144 */ 144 */
145 struct REGEX_ITERNAL_State *next_ST; 145 struct REGEX_INTERNAL_State *next_ST;
146 146
147 /** 147 /**
148 * Unique state id. 148 * Unique state id.
@@ -222,12 +222,12 @@ struct REGEX_ITERNAL_State
222 /** 222 /**
223 * DLL of transitions. 223 * DLL of transitions.
224 */ 224 */
225 struct REGEX_ITERNAL_Transition *transitions_head; 225 struct REGEX_INTERNAL_Transition *transitions_head;
226 226
227 /** 227 /**
228 * DLL of transitions. 228 * DLL of transitions.
229 */ 229 */
230 struct REGEX_ITERNAL_Transition *transitions_tail; 230 struct REGEX_INTERNAL_Transition *transitions_tail;
231 231
232 /** 232 /**
233 * Number of incoming transitions. Used for compressing DFA paths. 233 * Number of incoming transitions. Used for compressing DFA paths.
@@ -238,14 +238,14 @@ struct REGEX_ITERNAL_State
238 * Set of states on which this state is based on. Used when creating a DFA out 238 * Set of states on which this state is based on. Used when creating a DFA out
239 * of several NFA states. 239 * of several NFA states.
240 */ 240 */
241 struct REGEX_ITERNAL_StateSet nfa_set; 241 struct REGEX_INTERNAL_StateSet nfa_set;
242}; 242};
243 243
244 244
245/** 245/**
246 * Type of an automaton. 246 * Type of an automaton.
247 */ 247 */
248enum REGEX_ITERNAL_AutomatonType 248enum REGEX_INTERNAL_AutomatonType
249{ 249{
250 NFA, 250 NFA,
251 DFA 251 DFA
@@ -255,28 +255,28 @@ enum REGEX_ITERNAL_AutomatonType
255/** 255/**
256 * Automaton representation. 256 * Automaton representation.
257 */ 257 */
258struct REGEX_ITERNAL_Automaton 258struct REGEX_INTERNAL_Automaton
259{ 259{
260 /** 260 /**
261 * Linked list of NFAs used for partial NFA creation. 261 * Linked list of NFAs used for partial NFA creation.
262 */ 262 */
263 struct REGEX_ITERNAL_Automaton *prev; 263 struct REGEX_INTERNAL_Automaton *prev;
264 264
265 /** 265 /**
266 * Linked list of NFAs used for partial NFA creation. 266 * Linked list of NFAs used for partial NFA creation.
267 */ 267 */
268 struct REGEX_ITERNAL_Automaton *next; 268 struct REGEX_INTERNAL_Automaton *next;
269 269
270 /** 270 /**
271 * First state of the automaton. This is mainly used for constructing an NFA, 271 * First state of the automaton. This is mainly used for constructing an NFA,
272 * where each NFA itself consists of one or more NFAs linked together. 272 * where each NFA itself consists of one or more NFAs linked together.
273 */ 273 */
274 struct REGEX_ITERNAL_State *start; 274 struct REGEX_INTERNAL_State *start;
275 275
276 /** 276 /**
277 * End state of the partial NFA. This is undefined for DFAs 277 * End state of the partial NFA. This is undefined for DFAs
278 */ 278 */
279 struct REGEX_ITERNAL_State *end; 279 struct REGEX_INTERNAL_State *end;
280 280
281 /** 281 /**
282 * Number of states in the automaton. 282 * Number of states in the automaton.
@@ -286,17 +286,17 @@ struct REGEX_ITERNAL_Automaton
286 /** 286 /**
287 * DLL of states. 287 * DLL of states.
288 */ 288 */
289 struct REGEX_ITERNAL_State *states_head; 289 struct REGEX_INTERNAL_State *states_head;
290 290
291 /** 291 /**
292 * DLL of states 292 * DLL of states
293 */ 293 */
294 struct REGEX_ITERNAL_State *states_tail; 294 struct REGEX_INTERNAL_State *states_tail;
295 295
296 /** 296 /**
297 * Type of the automaton. 297 * Type of the automaton.
298 */ 298 */
299 enum REGEX_ITERNAL_AutomatonType type; 299 enum REGEX_INTERNAL_AutomatonType type;
300 300
301 /** 301 /**
302 * Regex 302 * Regex
@@ -321,10 +321,10 @@ struct REGEX_ITERNAL_Automaton
321 * @param regex regular expression string. 321 * @param regex regular expression string.
322 * @param len length of the string. 322 * @param len length of the string.
323 * 323 *
324 * @return NFA, needs to be freed using REGEX_ITERNAL_automaton_destroy. 324 * @return NFA, needs to be freed using REGEX_INTERNAL_automaton_destroy.
325 */ 325 */
326struct REGEX_ITERNAL_Automaton * 326struct REGEX_INTERNAL_Automaton *
327REGEX_ITERNAL_construct_nfa (const char *regex, const size_t len); 327REGEX_INTERNAL_construct_nfa (const char *regex, const size_t len);
328 328
329 329
330/** 330/**
@@ -339,9 +339,9 @@ REGEX_ITERNAL_construct_nfa (const char *regex, const size_t len);
339 * 339 *
340 * @return GNUNET_YES to proceed traversal, GNUNET_NO to stop. 340 * @return GNUNET_YES to proceed traversal, GNUNET_NO to stop.
341 */ 341 */
342typedef int (*REGEX_ITERNAL_traverse_check) (void *cls, 342typedef int (*REGEX_INTERNAL_traverse_check) (void *cls,
343 struct REGEX_ITERNAL_State * s, 343 struct REGEX_INTERNAL_State * s,
344 struct REGEX_ITERNAL_Transition * t); 344 struct REGEX_INTERNAL_Transition * t);
345 345
346 346
347/** 347/**
@@ -351,9 +351,9 @@ typedef int (*REGEX_ITERNAL_traverse_check) (void *cls,
351 * @param count current count of the state, from 0 to a->state_count -1. 351 * @param count current count of the state, from 0 to a->state_count -1.
352 * @param s state. 352 * @param s state.
353 */ 353 */
354typedef void (*REGEX_ITERNAL_traverse_action) (void *cls, 354typedef void (*REGEX_INTERNAL_traverse_action) (void *cls,
355 const unsigned int count, 355 const unsigned int count,
356 struct REGEX_ITERNAL_State * s); 356 struct REGEX_INTERNAL_State * s);
357 357
358 358
359/** 359/**
@@ -370,11 +370,11 @@ typedef void (*REGEX_ITERNAL_traverse_action) (void *cls,
370 * @param action_cls closure for action 370 * @param action_cls closure for action
371 */ 371 */
372void 372void
373REGEX_ITERNAL_automaton_traverse (const struct REGEX_ITERNAL_Automaton *a, 373REGEX_INTERNAL_automaton_traverse (const struct REGEX_INTERNAL_Automaton *a,
374 struct REGEX_ITERNAL_State *start, 374 struct REGEX_INTERNAL_State *start,
375 REGEX_ITERNAL_traverse_check check, 375 REGEX_INTERNAL_traverse_check check,
376 void *check_cls, 376 void *check_cls,
377 REGEX_ITERNAL_traverse_action action, 377 REGEX_INTERNAL_traverse_action action,
378 void *action_cls); 378 void *action_cls);
379 379
380/** 380/**
@@ -389,7 +389,7 @@ REGEX_ITERNAL_automaton_traverse (const struct REGEX_ITERNAL_Automaton *a,
389 * @return canonical regex string. 389 * @return canonical regex string.
390 */ 390 */
391const char * 391const char *
392REGEX_ITERNAL_get_canonical_regex (struct REGEX_ITERNAL_Automaton *a); 392REGEX_INTERNAL_get_canonical_regex (struct REGEX_INTERNAL_Automaton *a);
393 393
394 394
395/** 395/**
@@ -400,14 +400,14 @@ REGEX_ITERNAL_get_canonical_regex (struct REGEX_ITERNAL_Automaton *a);
400 * @return number of transitions in the given automaton. 400 * @return number of transitions in the given automaton.
401 */ 401 */
402unsigned int 402unsigned int
403REGEX_ITERNAL_get_transition_count (struct REGEX_ITERNAL_Automaton *a); 403REGEX_INTERNAL_get_transition_count (struct REGEX_INTERNAL_Automaton *a);
404 404
405 405
406/** 406/**
407 * Context that contains an id counter for states and transitions as well as a 407 * Context that contains an id counter for states and transitions as well as a
408 * DLL of automatons used as a stack for NFA construction. 408 * DLL of automatons used as a stack for NFA construction.
409 */ 409 */
410struct REGEX_ITERNAL_Context 410struct REGEX_INTERNAL_Context
411{ 411{
412 /** 412 /**
413 * Unique state id. 413 * Unique state id.
@@ -420,14 +420,14 @@ struct REGEX_ITERNAL_Context
420 unsigned int transition_id; 420 unsigned int transition_id;
421 421
422 /** 422 /**
423 * DLL of REGEX_ITERNAL_Automaton's used as a stack. 423 * DLL of REGEX_INTERNAL_Automaton's used as a stack.
424 */ 424 */
425 struct REGEX_ITERNAL_Automaton *stack_head; 425 struct REGEX_INTERNAL_Automaton *stack_head;
426 426
427 /** 427 /**
428 * DLL of REGEX_ITERNAL_Automaton's used as a stack. 428 * DLL of REGEX_INTERNAL_Automaton's used as a stack.
429 */ 429 */
430 struct REGEX_ITERNAL_Automaton *stack_tail; 430 struct REGEX_INTERNAL_Automaton *stack_tail;
431}; 431};
432 432
433 433
@@ -439,8 +439,8 @@ struct REGEX_ITERNAL_Context
439 * @param stride_len length of the strides. 439 * @param stride_len length of the strides.
440 */ 440 */
441void 441void
442REGEX_ITERNAL_dfa_add_multi_strides (struct REGEX_ITERNAL_Context *regex_ctx, 442REGEX_INTERNAL_dfa_add_multi_strides (struct REGEX_INTERNAL_Context *regex_ctx,
443 struct REGEX_ITERNAL_Automaton *dfa, 443 struct REGEX_INTERNAL_Automaton *dfa,
444 const unsigned int stride_len); 444 const unsigned int stride_len);
445 445
446 446