diff options
Diffstat (limited to 'src/regex/regex_block_lib.h')
-rw-r--r-- | src/regex/regex_block_lib.h | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/regex/regex_block_lib.h b/src/regex/regex_block_lib.h index 920c9d1d0..6b2d3bf26 100644 --- a/src/regex/regex_block_lib.h +++ b/src/regex/regex_block_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Bartlomiej Polot | 22 | * @author Bartlomiej Polot |
@@ -31,7 +31,7 @@ | |||
31 | extern "C" | 31 | extern "C" |
32 | { | 32 | { |
33 | #if 0 | 33 | #if 0 |
34 | /* keep Emacsens' auto-indent happy */ | 34 | /* keep Emacsens' auto-indent happy */ |
35 | } | 35 | } |
36 | #endif | 36 | #endif |
37 | #endif | 37 | #endif |
@@ -49,8 +49,7 @@ struct RegexBlock; | |||
49 | /** | 49 | /** |
50 | * Edge representation. | 50 | * Edge representation. |
51 | */ | 51 | */ |
52 | struct REGEX_BLOCK_Edge | 52 | struct REGEX_BLOCK_Edge { |
53 | { | ||
54 | /** | 53 | /** |
55 | * Label of the edge. FIXME: might want to not consume exactly | 54 | * Label of the edge. FIXME: might want to not consume exactly |
56 | * multiples of 8 bits, need length! | 55 | * multiples of 8 bits, need length! |
@@ -73,9 +72,9 @@ struct REGEX_BLOCK_Edge | |||
73 | * @return #GNUNET_OK if the proof is valid for the given key. | 72 | * @return #GNUNET_OK if the proof is valid for the given key. |
74 | */ | 73 | */ |
75 | int | 74 | int |
76 | REGEX_BLOCK_check_proof (const char *proof, | 75 | REGEX_BLOCK_check_proof(const char *proof, |
77 | size_t proof_len, | 76 | size_t proof_len, |
78 | const struct GNUNET_HashCode *key); | 77 | const struct GNUNET_HashCode *key); |
79 | 78 | ||
80 | 79 | ||
81 | /** | 80 | /** |
@@ -91,10 +90,10 @@ REGEX_BLOCK_check_proof (const char *proof, | |||
91 | * #GNUNET_SYSERR if the block is invalid. | 90 | * #GNUNET_SYSERR if the block is invalid. |
92 | */ | 91 | */ |
93 | int | 92 | int |
94 | REGEX_BLOCK_check (const struct RegexBlock *block, | 93 | REGEX_BLOCK_check(const struct RegexBlock *block, |
95 | size_t size, | 94 | size_t size, |
96 | const struct GNUNET_HashCode *query, | 95 | const struct GNUNET_HashCode *query, |
97 | const char *xquery); | 96 | const char *xquery); |
98 | 97 | ||
99 | 98 | ||
100 | /* FIXME: might want to use 'struct REGEX_BLOCK_Edge' here instead of 3 arguments! */ | 99 | /* FIXME: might want to use 'struct REGEX_BLOCK_Edge' here instead of 3 arguments! */ |
@@ -131,10 +130,10 @@ typedef int | |||
131 | * be errors in further edges. | 130 | * be errors in further edges. |
132 | */ | 131 | */ |
133 | int | 132 | int |
134 | REGEX_BLOCK_iterate (const struct RegexBlock *block, | 133 | REGEX_BLOCK_iterate(const struct RegexBlock *block, |
135 | size_t size, | 134 | size_t size, |
136 | REGEX_INTERNAL_EgdeIterator iterator, | 135 | REGEX_INTERNAL_EgdeIterator iterator, |
137 | void *iter_cls); | 136 | void *iter_cls); |
138 | 137 | ||
139 | 138 | ||
140 | /** | 139 | /** |
@@ -146,9 +145,9 @@ REGEX_BLOCK_iterate (const struct RegexBlock *block, | |||
146 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the block is malformed | 145 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the block is malformed |
147 | */ | 146 | */ |
148 | int | 147 | int |
149 | REGEX_BLOCK_get_key (const struct RegexBlock *block, | 148 | REGEX_BLOCK_get_key(const struct RegexBlock *block, |
150 | size_t block_len, | 149 | size_t block_len, |
151 | struct GNUNET_HashCode *key); | 150 | struct GNUNET_HashCode *key); |
152 | 151 | ||
153 | 152 | ||
154 | /** | 153 | /** |
@@ -159,8 +158,8 @@ REGEX_BLOCK_get_key (const struct RegexBlock *block, | |||
159 | * @return #GNUNET_YES if the block is accepting, #GNUNET_NO if not | 158 | * @return #GNUNET_YES if the block is accepting, #GNUNET_NO if not |
160 | */ | 159 | */ |
161 | int | 160 | int |
162 | GNUNET_BLOCK_is_accepting (const struct RegexBlock *block, | 161 | GNUNET_BLOCK_is_accepting(const struct RegexBlock *block, |
163 | size_t block_len); | 162 | size_t block_len); |
164 | 163 | ||
165 | 164 | ||
166 | /** | 165 | /** |
@@ -174,11 +173,11 @@ GNUNET_BLOCK_is_accepting (const struct RegexBlock *block, | |||
174 | * @return the regex block, NULL on error | 173 | * @return the regex block, NULL on error |
175 | */ | 174 | */ |
176 | struct RegexBlock * | 175 | struct RegexBlock * |
177 | REGEX_BLOCK_create (const char *proof, | 176 | REGEX_BLOCK_create(const char *proof, |
178 | unsigned int num_edges, | 177 | unsigned int num_edges, |
179 | const struct REGEX_BLOCK_Edge *edges, | 178 | const struct REGEX_BLOCK_Edge *edges, |
180 | int accepting, | 179 | int accepting, |
181 | size_t *rsize); | 180 | size_t *rsize); |
182 | 181 | ||
183 | 182 | ||
184 | #if 0 /* keep Emacsens' auto-indent happy */ | 183 | #if 0 /* keep Emacsens' auto-indent happy */ |