diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-05 11:23:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-05 11:23:06 +0000 |
commit | 3066c800a6d6b6e16d6c174519025608b6f7f250 (patch) | |
tree | f6b216578bf89c7474b40c7566c267dabcdc2f0d /src/namestore/namestore_api.c | |
parent | e097895ea54b316c3ede8640f6dd49f864313a2d (diff) | |
download | gnunet-3066c800a6d6b6e16d6c174519025608b6f7f250.tar.gz gnunet-3066c800a6d6b6e16d6c174519025608b6f7f250.zip |
-allow passing NULL for zone to iterate over all of our zones
Diffstat (limited to 'src/namestore/namestore_api.c')
-rw-r--r-- | src/namestore/namestore_api.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 112b71ba8..9e2e13066 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c | |||
@@ -1185,18 +1185,18 @@ GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, | |||
1185 | 1185 | ||
1186 | /** | 1186 | /** |
1187 | * Starts a new zone iteration (used to periodically PUT all of our | 1187 | * Starts a new zone iteration (used to periodically PUT all of our |
1188 | * records into our DHT). This MUST lock the GNUNET_NAMESTORE_Handle | 1188 | * records into our DHT). This MUST lock the struct GNUNET_NAMESTORE_Handle |
1189 | * for any other calls than GNUNET_NAMESTORE_zone_iterator_next and | 1189 | * for any other calls than #GNUNET_NAMESTORE_zone_iterator_next and |
1190 | * GNUNET_NAMESTORE_zone_iteration_stop. "proc" will be called once | 1190 | * #GNUNET_NAMESTORE_zone_iteration_stop. @a proc will be called once |
1191 | * immediately, and then again after | 1191 | * immediately, and then again after |
1192 | * "GNUNET_NAMESTORE_zone_iterator_next" is invoked. | 1192 | * #GNUNET_NAMESTORE_zone_iterator_next is invoked. |
1193 | * | 1193 | * |
1194 | * @param h handle to the namestore | 1194 | * @param h handle to the namestore |
1195 | * @param zone zone to access | 1195 | * @param zone zone to access, NULL for all zones |
1196 | * @param proc function to call on each name from the zone; it | 1196 | * @param proc function to call on each name from the zone; it |
1197 | * will be called repeatedly with a value (if available) | 1197 | * will be called repeatedly with a value (if available) |
1198 | * and always once at the end with a name of NULL. | 1198 | * and always once at the end with a name of NULL. |
1199 | * @param proc_cls closure for proc | 1199 | * @param proc_cls closure for @a proc |
1200 | * @return an iterator handle to use for iteration | 1200 | * @return an iterator handle to use for iteration |
1201 | */ | 1201 | */ |
1202 | struct GNUNET_NAMESTORE_ZoneIterator * | 1202 | struct GNUNET_NAMESTORE_ZoneIterator * |
@@ -1218,7 +1218,8 @@ GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, | |||
1218 | it->proc = proc; | 1218 | it->proc = proc; |
1219 | it->proc_cls = proc_cls; | 1219 | it->proc_cls = proc_cls; |
1220 | it->op_id = rid; | 1220 | it->op_id = rid; |
1221 | it->zone = *zone; | 1221 | if (NULL != zone) |
1222 | it->zone = *zone; | ||
1222 | GNUNET_CONTAINER_DLL_insert_tail (h->z_head, h->z_tail, it); | 1223 | GNUNET_CONTAINER_DLL_insert_tail (h->z_head, h->z_tail, it); |
1223 | 1224 | ||
1224 | msg_size = sizeof (struct ZoneIterationStartMessage); | 1225 | msg_size = sizeof (struct ZoneIterationStartMessage); |
@@ -1228,7 +1229,8 @@ GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, | |||
1228 | msg->gns_header.header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START); | 1229 | msg->gns_header.header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START); |
1229 | msg->gns_header.header.size = htons (msg_size); | 1230 | msg->gns_header.header.size = htons (msg_size); |
1230 | msg->gns_header.r_id = htonl (rid); | 1231 | msg->gns_header.r_id = htonl (rid); |
1231 | msg->zone = *zone; | 1232 | if (NULL != zone) |
1233 | msg->zone = *zone; | ||
1232 | GNUNET_CONTAINER_DLL_insert_tail (h->pending_head, h->pending_tail, pe); | 1234 | GNUNET_CONTAINER_DLL_insert_tail (h->pending_head, h->pending_tail, pe); |
1233 | do_transmit(h); | 1235 | do_transmit(h); |
1234 | return it; | 1236 | return it; |
@@ -1236,7 +1238,7 @@ GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, | |||
1236 | 1238 | ||
1237 | 1239 | ||
1238 | /** | 1240 | /** |
1239 | * Calls the record processor specified in GNUNET_NAMESTORE_zone_iteration_start | 1241 | * Calls the record processor specified in #GNUNET_NAMESTORE_zone_iteration_start |
1240 | * for the next record. | 1242 | * for the next record. |
1241 | * | 1243 | * |
1242 | * @param it the iterator | 1244 | * @param it the iterator |