diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-26 15:54:54 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-26 15:54:54 +0000 |
commit | 7706f0a08b2425622121c23a7d2054794f2d677c (patch) | |
tree | d4b658006d8b0418b2afabe51bfae14c3f59bb97 /src/regex/regex_block_lib.h | |
parent | 133a5ecf306d35f9e86fb5a1f8b120783f6afdf9 (diff) | |
download | gnunet-7706f0a08b2425622121c23a7d2054794f2d677c.tar.gz gnunet-7706f0a08b2425622121c23a7d2054794f2d677c.zip |
-removing unnecessary key from regex blocks, compacting some of the other fields
Diffstat (limited to 'src/regex/regex_block_lib.h')
-rw-r--r-- | src/regex/regex_block_lib.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/regex/regex_block_lib.h b/src/regex/regex_block_lib.h index 985296b4f..dec025205 100644 --- a/src/regex/regex_block_lib.h +++ b/src/regex/regex_block_lib.h | |||
@@ -68,8 +68,8 @@ struct REGEX_BLOCK_Edge | |||
68 | */ | 68 | */ |
69 | int | 69 | int |
70 | REGEX_BLOCK_check_proof (const char *proof, | 70 | REGEX_BLOCK_check_proof (const char *proof, |
71 | size_t proof_len, | 71 | size_t proof_len, |
72 | const struct GNUNET_HashCode *key); | 72 | const struct GNUNET_HashCode *key); |
73 | 73 | ||
74 | 74 | ||
75 | /** | 75 | /** |
@@ -77,6 +77,7 @@ REGEX_BLOCK_check_proof (const char *proof, | |||
77 | * | 77 | * |
78 | * @param block The start of the block. | 78 | * @param block The start of the block. |
79 | * @param size The size of the block. | 79 | * @param size The size of the block. |
80 | * @param query the query for the block | ||
80 | * @param xquery String describing the edge we are looking for. | 81 | * @param xquery String describing the edge we are looking for. |
81 | * Can be NULL in case this is a put block. | 82 | * Can be NULL in case this is a put block. |
82 | * | 83 | * |
@@ -87,6 +88,7 @@ REGEX_BLOCK_check_proof (const char *proof, | |||
87 | int | 88 | int |
88 | REGEX_BLOCK_check (const struct RegexBlock *block, | 89 | REGEX_BLOCK_check (const struct RegexBlock *block, |
89 | size_t size, | 90 | size_t size, |
91 | const struct GNUNET_HashCode *query, | ||
90 | const char *xquery); | 92 | const char *xquery); |
91 | 93 | ||
92 | 94 | ||
@@ -130,6 +132,20 @@ REGEX_BLOCK_iterate (const struct RegexBlock *block, | |||
130 | REGEX_INTERNAL_EgdeIterator iterator, | 132 | REGEX_INTERNAL_EgdeIterator iterator, |
131 | void *iter_cls); | 133 | void *iter_cls); |
132 | 134 | ||
135 | /** | ||
136 | * Obtain the key that a particular block is to be stored under. | ||
137 | * | ||
138 | * @param block block to get the key from | ||
139 | * @param block_len number of bytes in block | ||
140 | * @param query where to store the key | ||
141 | * @return GNUNET_OK on success, GNUNET_SYSERR if the block is malformed | ||
142 | */ | ||
143 | int | ||
144 | REGEX_BLOCK_get_key (const struct RegexBlock *block, | ||
145 | size_t block_len, | ||
146 | struct GNUNET_HashCode *key); | ||
147 | |||
148 | |||
133 | 149 | ||
134 | /** | 150 | /** |
135 | * Construct a regex block to be stored in the DHT. | 151 | * Construct a regex block to be stored in the DHT. |
@@ -137,15 +153,16 @@ REGEX_BLOCK_iterate (const struct RegexBlock *block, | |||
137 | * @param proof proof string for the block | 153 | * @param proof proof string for the block |
138 | * @param num_edges number of edges in the block | 154 | * @param num_edges number of edges in the block |
139 | * @param edges the edges of the block | 155 | * @param edges the edges of the block |
140 | * @return the regex block | 156 | * @param accepting is this an accepting state |
157 | * @param rsize set to the size of the returned block (OUT-only) | ||
158 | * @return the regex block, NULL on error | ||
141 | */ | 159 | */ |
142 | struct RegexBlock * | 160 | struct RegexBlock * |
143 | REGEX_BLOCK_create (const struct GNUNET_HashCode *key, | 161 | REGEX_BLOCK_create (const char *proof, |
144 | const char *proof, | 162 | unsigned int num_edges, |
145 | unsigned int num_edges, | 163 | const struct REGEX_BLOCK_Edge *edges, |
146 | const struct REGEX_BLOCK_Edge *edges, | 164 | int accepting, |
147 | int accepting, | 165 | size_t *rsize); |
148 | size_t *rsize); | ||
149 | 166 | ||
150 | 167 | ||
151 | #if 0 /* keep Emacsens' auto-indent happy */ | 168 | #if 0 /* keep Emacsens' auto-indent happy */ |