aboutsummaryrefslogtreecommitdiff
path: root/src/regex/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex/regex.c')
-rw-r--r--src/regex/regex.c102
1 files changed, 0 insertions, 102 deletions
diff --git a/src/regex/regex.c b/src/regex/regex.c
index d9c776efd..d60ffdc00 100644
--- a/src/regex/regex.c
+++ b/src/regex/regex.c
@@ -52,104 +52,6 @@ struct GNUNET_REGEX_StateSet
52}; 52};
53 53
54 54
55/*
56 * Debug helper functions
57 */
58
59/**
60 * Print all the transitions of state 's'.
61 *
62 * @param s state for which to print it's transitions.
63 */
64void
65debug_print_transitions (struct GNUNET_REGEX_State *s);
66
67
68/**
69 * Print information of the given state 's'.
70 *
71 * @param s state for which debug information should be printed.
72 */
73void
74debug_print_state (struct GNUNET_REGEX_State *s)
75{
76 char *proof;
77
78 if (NULL == s->proof)
79 proof = "NULL";
80 else
81 proof = s->proof;
82
83 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
84 "State %i: %s marked: %i accepting: %i scc_id: %i transitions: %i proof: %s\n",
85 s->id, s->name, s->marked, s->accepting, s->scc_id,
86 s->transition_count, proof);
87
88 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transitions:\n");
89 debug_print_transitions (s);
90}
91
92
93/**
94 * Print debug information for all states contained in the automaton 'a'.
95 *
96 * @param a automaton for which debug information of it's states should be printed.
97 */
98void
99debug_print_states (struct GNUNET_REGEX_Automaton *a)
100{
101 struct GNUNET_REGEX_State *s;
102
103 for (s = a->states_head; NULL != s; s = s->next)
104 debug_print_state (s);
105}
106
107
108/**
109 * Print debug information for given transition 't'.
110 *
111 * @param t transition for which to print debug info.
112 */
113void
114debug_print_transition (struct GNUNET_REGEX_Transition *t)
115{
116 char *to_state;
117 char *from_state;
118 char *label;
119
120 if (NULL == t)
121 return;
122
123 if (0 == t->label)
124 label = "0";
125 else
126 label = t->label;
127
128 if (NULL == t->to_state)
129 to_state = "NULL";
130 else
131 to_state = t->to_state->name;
132
133 if (NULL == t->from_state)
134 from_state = "NULL";
135 else
136 from_state = t->from_state->name;
137
138 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transition %i: From %s on %s to %s\n",
139 t->id, from_state, label, to_state);
140}
141
142
143void
144debug_print_transitions (struct GNUNET_REGEX_State *s)
145{
146 struct GNUNET_REGEX_Transition *t;
147
148 for (t = s->transitions_head; NULL != t; t = t->next)
149 debug_print_transition (t);
150}
151
152
153/** 55/**
154 * Compare two strings for equality. If either is NULL they are not equal. 56 * Compare two strings for equality. If either is NULL they are not equal.
155 * 57 *
@@ -2320,10 +2222,6 @@ GNUNET_REGEX_construct_nfa (const char *regex, const size_t len)
2320 } 2222 }
2321 nfa_add_question_op (&ctx); 2223 nfa_add_question_op (&ctx);
2322 break; 2224 break;
2323 case 92: /* escape: \ */
2324 regexp++;
2325 count++;
2326 /* fall through! */
2327 default: 2225 default:
2328 if (atomcount > 1) 2226 if (atomcount > 1)
2329 { 2227 {