diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-04-25 16:18:31 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-04-25 16:18:31 +0200 |
commit | 4dc79497d7f745996068e62e973e34d220580323 (patch) | |
tree | e6d429d3cf2240ec3459f1d4533201dc40b27015 /src/include | |
parent | bdbb7c684f2c9711989d2543ecc08a95be23e6c4 (diff) | |
download | gnunet-4dc79497d7f745996068e62e973e34d220580323.tar.gz gnunet-4dc79497d7f745996068e62e973e34d220580323.zip |
extend namestore API to enable faster iterations by returning more than one result at a time
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_namestore_plugin.h | 6 | ||||
-rw-r--r-- | src/include/gnunet_namestore_service.h | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 3ebf48987..802d7bac5 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h | |||
@@ -109,19 +109,21 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
109 | 109 | ||
110 | /** | 110 | /** |
111 | * Iterate over the results for a particular zone in the | 111 | * Iterate over the results for a particular zone in the |
112 | * datastore. Will return at most one result to the iterator. | 112 | * datastore. Will return at most @a limit results to the iterator. |
113 | * | 113 | * |
114 | * @param cls closure (internal context for the plugin) | 114 | * @param cls closure (internal context for the plugin) |
115 | * @param zone private key of the zone, NULL for all zones | 115 | * @param zone private key of the zone, NULL for all zones |
116 | * @param offset offset in the list of all matching records | 116 | * @param offset offset in the list of all matching records |
117 | * @param limit maximum number of results to return to @a iter | ||
117 | * @param iter function to call with the result | 118 | * @param iter function to call with the result |
118 | * @param iter_cls closure for @a iter | 119 | * @param iter_cls closure for @a iter |
119 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | 120 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no more results, #GNUNET_SYSERR on error |
120 | */ | 121 | */ |
121 | int | 122 | int |
122 | (*iterate_records) (void *cls, | 123 | (*iterate_records) (void *cls, |
123 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 124 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
124 | uint64_t offset, | 125 | uint64_t offset, |
126 | uint64_t limit, | ||
125 | GNUNET_NAMESTORE_RecordIterator iter, | 127 | GNUNET_NAMESTORE_RecordIterator iter, |
126 | void *iter_cls); | 128 | void *iter_cls); |
127 | 129 | ||
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index f8c2eaf3b..4828f72ad 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -267,9 +267,12 @@ GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h, | |||
267 | * for the next record. | 267 | * for the next record. |
268 | * | 268 | * |
269 | * @param it the iterator | 269 | * @param it the iterator |
270 | * @param limit number of records to return to the iterator in one shot | ||
271 | * (before #GNUNET_NAMESTORE_zone_iterator_next is to be called again) | ||
270 | */ | 272 | */ |
271 | void | 273 | void |
272 | GNUNET_NAMESTORE_zone_iterator_next (struct GNUNET_NAMESTORE_ZoneIterator *it); | 274 | GNUNET_NAMESTORE_zone_iterator_next (struct GNUNET_NAMESTORE_ZoneIterator *it, |
275 | uint64_t limit); | ||
273 | 276 | ||
274 | 277 | ||
275 | /** | 278 | /** |