diff options
Diffstat (limited to 'src/include/gnunet_datastore_service.h')
-rw-r--r-- | src/include/gnunet_datastore_service.h | 224 |
1 files changed, 72 insertions, 152 deletions
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index 584537f39..3d2cc35c9 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -63,9 +63,8 @@ struct GNUNET_DATASTORE_Handle; | |||
63 | * @param cfg configuration to use | 63 | * @param cfg configuration to use |
64 | * @return handle to use to access the service | 64 | * @return handle to use to access the service |
65 | */ | 65 | */ |
66 | struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct | 66 | struct GNUNET_DATASTORE_Handle * |
67 | GNUNET_CONFIGURATION_Handle | 67 | GNUNET_DATASTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); |
68 | *cfg); | ||
69 | 68 | ||
70 | 69 | ||
71 | /** | 70 | /** |
@@ -75,7 +74,8 @@ struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct | |||
75 | * @param h handle to the datastore | 74 | * @param h handle to the datastore |
76 | * @param drop set to GNUNET_YES to delete all data in datastore (!) | 75 | * @param drop set to GNUNET_YES to delete all data in datastore (!) |
77 | */ | 76 | */ |
78 | void GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); | 77 | void |
78 | GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); | ||
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
@@ -112,21 +112,13 @@ typedef void (*GNUNET_DATASTORE_ContinuationWithStatus) (void *cls, | |||
112 | * cancel; note that even if NULL is returned, the callback will be invoked | 112 | * cancel; note that even if NULL is returned, the callback will be invoked |
113 | * (or rather, will already have been invoked) | 113 | * (or rather, will already have been invoked) |
114 | */ | 114 | */ |
115 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_reserve (struct | 115 | struct GNUNET_DATASTORE_QueueEntry * |
116 | GNUNET_DATASTORE_Handle | 116 | GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, uint64_t amount, |
117 | *h, | 117 | uint32_t entries, unsigned int queue_priority, |
118 | uint64_t amount, | 118 | unsigned int max_queue_size, |
119 | uint32_t entries, | 119 | struct GNUNET_TIME_Relative timeout, |
120 | unsigned int | 120 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
121 | queue_priority, | 121 | void *cont_cls); |
122 | unsigned int | ||
123 | max_queue_size, | ||
124 | struct | ||
125 | GNUNET_TIME_Relative | ||
126 | timeout, | ||
127 | GNUNET_DATASTORE_ContinuationWithStatus | ||
128 | cont, | ||
129 | void *cont_cls); | ||
130 | 122 | ||
131 | 123 | ||
132 | /** | 124 | /** |
@@ -155,29 +147,17 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_reserve (struct | |||
155 | * cancel; note that even if NULL is returned, the callback will be invoked | 147 | * cancel; note that even if NULL is returned, the callback will be invoked |
156 | * (or rather, will already have been invoked) | 148 | * (or rather, will already have been invoked) |
157 | */ | 149 | */ |
158 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_put (struct | 150 | struct GNUNET_DATASTORE_QueueEntry * |
159 | GNUNET_DATASTORE_Handle | 151 | GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, uint32_t rid, |
160 | *h, uint32_t rid, | 152 | const GNUNET_HashCode * key, size_t size, |
161 | const GNUNET_HashCode | 153 | const void *data, enum GNUNET_BLOCK_Type type, |
162 | * key, size_t size, | 154 | uint32_t priority, uint32_t anonymity, |
163 | const void *data, | 155 | uint32_t replication, |
164 | enum GNUNET_BLOCK_Type | 156 | struct GNUNET_TIME_Absolute expiration, |
165 | type, | 157 | unsigned int queue_priority, unsigned int max_queue_size, |
166 | uint32_t priority, | 158 | struct GNUNET_TIME_Relative timeout, |
167 | uint32_t anonymity, | 159 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
168 | uint32_t replication, | 160 | void *cont_cls); |
169 | struct | ||
170 | GNUNET_TIME_Absolute | ||
171 | expiration, | ||
172 | unsigned int | ||
173 | queue_priority, | ||
174 | unsigned int | ||
175 | max_queue_size, | ||
176 | struct | ||
177 | GNUNET_TIME_Relative | ||
178 | timeout, | ||
179 | GNUNET_DATASTORE_ContinuationWithStatus | ||
180 | cont, void *cont_cls); | ||
181 | 161 | ||
182 | 162 | ||
183 | /** | 163 | /** |
@@ -201,24 +181,13 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_put (struct | |||
201 | * cancel; note that even if NULL is returned, the callback will be invoked | 181 | * cancel; note that even if NULL is returned, the callback will be invoked |
202 | * (or rather, will already have been invoked) | 182 | * (or rather, will already have been invoked) |
203 | */ | 183 | */ |
204 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_release_reserve (struct | 184 | struct GNUNET_DATASTORE_QueueEntry * |
205 | GNUNET_DATASTORE_Handle | 185 | GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, |
206 | *h, | 186 | uint32_t rid, unsigned int queue_priority, |
207 | uint32_t | 187 | unsigned int max_queue_size, |
208 | rid, | 188 | struct GNUNET_TIME_Relative timeout, |
209 | unsigned | 189 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
210 | int | 190 | void *cont_cls); |
211 | queue_priority, | ||
212 | unsigned | ||
213 | int | ||
214 | max_queue_size, | ||
215 | struct | ||
216 | GNUNET_TIME_Relative | ||
217 | timeout, | ||
218 | GNUNET_DATASTORE_ContinuationWithStatus | ||
219 | cont, | ||
220 | void | ||
221 | *cont_cls); | ||
222 | 191 | ||
223 | 192 | ||
224 | /** | 193 | /** |
@@ -238,23 +207,15 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_release_reserve (struct | |||
238 | * cancel; note that even if NULL is returned, the callback will be invoked | 207 | * cancel; note that even if NULL is returned, the callback will be invoked |
239 | * (or rather, will already have been invoked) | 208 | * (or rather, will already have been invoked) |
240 | */ | 209 | */ |
241 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_update (struct | 210 | struct GNUNET_DATASTORE_QueueEntry * |
242 | GNUNET_DATASTORE_Handle | 211 | GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, uint64_t uid, |
243 | *h, uint64_t uid, | 212 | uint32_t priority, |
244 | uint32_t priority, | 213 | struct GNUNET_TIME_Absolute expiration, |
245 | struct | 214 | unsigned int queue_priority, |
246 | GNUNET_TIME_Absolute | 215 | unsigned int max_queue_size, |
247 | expiration, | 216 | struct GNUNET_TIME_Relative timeout, |
248 | unsigned int | 217 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
249 | queue_priority, | 218 | void *cont_cls); |
250 | unsigned int | ||
251 | max_queue_size, | ||
252 | struct | ||
253 | GNUNET_TIME_Relative | ||
254 | timeout, | ||
255 | GNUNET_DATASTORE_ContinuationWithStatus | ||
256 | cont, | ||
257 | void *cont_cls); | ||
258 | 219 | ||
259 | 220 | ||
260 | /** | 221 | /** |
@@ -278,23 +239,14 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_update (struct | |||
278 | * cancel; note that even if NULL is returned, the callback will be invoked | 239 | * cancel; note that even if NULL is returned, the callback will be invoked |
279 | * (or rather, will already have been invoked) | 240 | * (or rather, will already have been invoked) |
280 | */ | 241 | */ |
281 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_remove (struct | 242 | struct GNUNET_DATASTORE_QueueEntry * |
282 | GNUNET_DATASTORE_Handle | 243 | GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, |
283 | *h, | 244 | const GNUNET_HashCode * key, size_t size, |
284 | const | 245 | const void *data, unsigned int queue_priority, |
285 | GNUNET_HashCode * | 246 | unsigned int max_queue_size, |
286 | key, size_t size, | 247 | struct GNUNET_TIME_Relative timeout, |
287 | const void *data, | 248 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
288 | unsigned int | 249 | void *cont_cls); |
289 | queue_priority, | ||
290 | unsigned int | ||
291 | max_queue_size, | ||
292 | struct | ||
293 | GNUNET_TIME_Relative | ||
294 | timeout, | ||
295 | GNUNET_DATASTORE_ContinuationWithStatus | ||
296 | cont, | ||
297 | void *cont_cls); | ||
298 | 250 | ||
299 | 251 | ||
300 | /** | 252 | /** |
@@ -342,26 +294,14 @@ typedef void (*GNUNET_DATASTORE_DatumProcessor) (void *cls, | |||
342 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | 294 | * @return NULL if the entry was not queued, otherwise a handle that can be used to |
343 | * cancel | 295 | * cancel |
344 | */ | 296 | */ |
345 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_key (struct | 297 | struct GNUNET_DATASTORE_QueueEntry * |
346 | GNUNET_DATASTORE_Handle | 298 | GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, uint64_t offset, |
347 | *h, | 299 | const GNUNET_HashCode * key, |
348 | uint64_t offset, | 300 | enum GNUNET_BLOCK_Type type, |
349 | const | 301 | unsigned int queue_priority, |
350 | GNUNET_HashCode * | 302 | unsigned int max_queue_size, |
351 | key, | 303 | struct GNUNET_TIME_Relative timeout, |
352 | enum | 304 | GNUNET_DATASTORE_DatumProcessor proc, void *proc_cls); |
353 | GNUNET_BLOCK_Type | ||
354 | type, | ||
355 | unsigned int | ||
356 | queue_priority, | ||
357 | unsigned int | ||
358 | max_queue_size, | ||
359 | struct | ||
360 | GNUNET_TIME_Relative | ||
361 | timeout, | ||
362 | GNUNET_DATASTORE_DatumProcessor | ||
363 | proc, | ||
364 | void *proc_cls); | ||
365 | 305 | ||
366 | 306 | ||
367 | /** | 307 | /** |
@@ -388,27 +328,15 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_key (struct | |||
388 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | 328 | * @return NULL if the entry was not queued, otherwise a handle that can be used to |
389 | * cancel | 329 | * cancel |
390 | */ | 330 | */ |
391 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_zero_anonymity (struct | 331 | struct GNUNET_DATASTORE_QueueEntry * |
392 | GNUNET_DATASTORE_Handle | 332 | GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, |
393 | *h, | 333 | uint64_t offset, |
394 | uint64_t | 334 | unsigned int queue_priority, |
395 | offset, | 335 | unsigned int max_queue_size, |
396 | unsigned | 336 | struct GNUNET_TIME_Relative timeout, |
397 | int | 337 | enum GNUNET_BLOCK_Type type, |
398 | queue_priority, | 338 | GNUNET_DATASTORE_DatumProcessor proc, |
399 | unsigned | 339 | void *proc_cls); |
400 | int | ||
401 | max_queue_size, | ||
402 | struct | ||
403 | GNUNET_TIME_Relative | ||
404 | timeout, | ||
405 | enum | ||
406 | GNUNET_BLOCK_Type | ||
407 | type, | ||
408 | GNUNET_DATASTORE_DatumProcessor | ||
409 | proc, | ||
410 | void | ||
411 | *proc_cls); | ||
412 | 340 | ||
413 | 341 | ||
414 | /** | 342 | /** |
@@ -430,22 +358,13 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_zero_anonymity (struct | |||
430 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | 358 | * @return NULL if the entry was not queued, otherwise a handle that can be used to |
431 | * cancel | 359 | * cancel |
432 | */ | 360 | */ |
433 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_for_replication (struct | 361 | struct GNUNET_DATASTORE_QueueEntry * |
434 | GNUNET_DATASTORE_Handle | 362 | GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, |
435 | *h, | 363 | unsigned int queue_priority, |
436 | unsigned | 364 | unsigned int max_queue_size, |
437 | int | 365 | struct GNUNET_TIME_Relative timeout, |
438 | queue_priority, | 366 | GNUNET_DATASTORE_DatumProcessor proc, |
439 | unsigned | 367 | void *proc_cls); |
440 | int | ||
441 | max_queue_size, | ||
442 | struct | ||
443 | GNUNET_TIME_Relative | ||
444 | timeout, | ||
445 | GNUNET_DATASTORE_DatumProcessor | ||
446 | proc, | ||
447 | void | ||
448 | *proc_cls); | ||
449 | 368 | ||
450 | 369 | ||
451 | 370 | ||
@@ -455,7 +374,8 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_for_replication (struct | |||
455 | * | 374 | * |
456 | * @param qe operation to cancel | 375 | * @param qe operation to cancel |
457 | */ | 376 | */ |
458 | void GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe); | 377 | void |
378 | GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe); | ||
459 | 379 | ||
460 | 380 | ||
461 | #if 0 /* keep Emacsens' auto-indent happy */ | 381 | #if 0 /* keep Emacsens' auto-indent happy */ |