aboutsummaryrefslogtreecommitdiff
path: root/src/regex/regex_block_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex/regex_block_lib.h')
-rw-r--r--src/regex/regex_block_lib.h51
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 @@
31extern "C" 31extern "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 */
52struct REGEX_BLOCK_Edge 52struct 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 */
75int 74int
76REGEX_BLOCK_check_proof (const char *proof, 75REGEX_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 */
93int 92int
94REGEX_BLOCK_check (const struct RegexBlock *block, 93REGEX_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 */
133int 132int
134REGEX_BLOCK_iterate (const struct RegexBlock *block, 133REGEX_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 */
148int 147int
149REGEX_BLOCK_get_key (const struct RegexBlock *block, 148REGEX_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 */
161int 160int
162GNUNET_BLOCK_is_accepting (const struct RegexBlock *block, 161GNUNET_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 */
176struct RegexBlock * 175struct RegexBlock *
177REGEX_BLOCK_create (const char *proof, 176REGEX_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 */