diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-12-13 19:15:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-12-13 19:15:14 +0000 |
commit | 913ee2753481f2344233aba17066cd637e7a1b27 (patch) | |
tree | 344f4da025328c00150754474750de0990a9e608 /src/regex/regex_internal.h | |
parent | 1c921f74a5d8ec145b5dd6479c089a5fe3fedbec (diff) | |
download | gnunet-913ee2753481f2344233aba17066cd637e7a1b27.tar.gz gnunet-913ee2753481f2344233aba17066cd637e7a1b27.zip |
-eliminating mallocing of state sets
Diffstat (limited to 'src/regex/regex_internal.h')
-rw-r--r-- | src/regex/regex_internal.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/regex/regex_internal.h b/src/regex/regex_internal.h index c25b938c3..fe76d1537 100644 --- a/src/regex/regex_internal.h +++ b/src/regex/regex_internal.h | |||
@@ -84,6 +84,29 @@ struct GNUNET_REGEX_Transition | |||
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 | */ |
87 | struct GNUNET_REGEX_State; | ||
88 | |||
89 | |||
90 | /** | ||
91 | * Set of states. | ||
92 | */ | ||
93 | struct GNUNET_REGEX_StateSet | ||
94 | { | ||
95 | /** | ||
96 | * Array of states. | ||
97 | */ | ||
98 | struct GNUNET_REGEX_State **states; | ||
99 | |||
100 | /** | ||
101 | * Length of the 'states' array. | ||
102 | */ | ||
103 | unsigned int len; | ||
104 | }; | ||
105 | |||
106 | |||
107 | /** | ||
108 | * A state. Can be used in DFA and NFA automatons. | ||
109 | */ | ||
87 | struct GNUNET_REGEX_State | 110 | struct GNUNET_REGEX_State |
88 | { | 111 | { |
89 | /** | 112 | /** |
@@ -210,7 +233,7 @@ struct GNUNET_REGEX_State | |||
210 | * Set of states on which this state is based on. Used when creating a DFA out | 233 | * Set of states on which this state is based on. Used when creating a DFA out |
211 | * of several NFA states. | 234 | * of several NFA states. |
212 | */ | 235 | */ |
213 | struct GNUNET_REGEX_StateSet *nfa_set; | 236 | struct GNUNET_REGEX_StateSet nfa_set; |
214 | }; | 237 | }; |
215 | 238 | ||
216 | 239 | ||