diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-11-27 13:55:23 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-11-27 13:55:23 +0000 |
commit | e98619f67a3e1ddf4962c20f77c7a1a669345eaa (patch) | |
tree | 50f3a427277571036043bde17e11f8b85fd2b4d6 /src/include/gnunet_set_service.h | |
parent | 1d96a7f8dc2aa6311eae76e60a92eb2a2b397fe2 (diff) | |
download | gnunet-e98619f67a3e1ddf4962c20f77c7a1a669345eaa.tar.gz gnunet-e98619f67a3e1ddf4962c20f77c7a1a669345eaa.zip |
adding logic to allow GNUNET_SET_iterate_cancel
Diffstat (limited to 'src/include/gnunet_set_service.h')
-rw-r--r-- | src/include/gnunet_set_service.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h index c0e65cb72..4106f4beb 100644 --- a/src/include/gnunet_set_service.h +++ b/src/include/gnunet_set_service.h | |||
@@ -283,6 +283,11 @@ GNUNET_SET_remove_element (struct GNUNET_SET_Handle *set, | |||
283 | 283 | ||
284 | /** | 284 | /** |
285 | * Destroy the set handle, and free all associated resources. | 285 | * Destroy the set handle, and free all associated resources. |
286 | * Iterations must have completed (or be explicitly canceled) | ||
287 | * before destroying the corresponding set. Operations may | ||
288 | * still be pending when a set is destroyed. | ||
289 | * | ||
290 | * @param set set to destroy | ||
286 | */ | 291 | */ |
287 | void | 292 | void |
288 | GNUNET_SET_destroy (struct GNUNET_SET_Handle *set); | 293 | GNUNET_SET_destroy (struct GNUNET_SET_Handle *set); |
@@ -334,9 +339,8 @@ GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
334 | 339 | ||
335 | 340 | ||
336 | /** | 341 | /** |
337 | * Cancel the given listen operation. | 342 | * Cancel the given listen operation. After calling cancel, the |
338 | * After calling cancel, the listen callback for this listen handle | 343 | * listen callback for this listen handle will not be called again. |
339 | * will not be called again. | ||
340 | * | 344 | * |
341 | * @param lh handle for the listen operation | 345 | * @param lh handle for the listen operation |
342 | */ | 346 | */ |
@@ -404,13 +408,24 @@ GNUNET_SET_operation_cancel (struct GNUNET_SET_OperationHandle *oh); | |||
404 | * @param iter the iterator to call for each element | 408 | * @param iter the iterator to call for each element |
405 | * @param iter_cls closure for @a iter | 409 | * @param iter_cls closure for @a iter |
406 | * @return #GNUNET_YES if the iteration started successfuly, | 410 | * @return #GNUNET_YES if the iteration started successfuly, |
407 | * #GNUNET_SYSERR if the set is invalid (e.g. the server crashed, disconnected) | 411 | * #GNUNET_NO if another iteration was still active, |
412 | * #GNUNET_SYSERR if the set is invalid (e.g. the server crashed, disconnected) | ||
408 | */ | 413 | */ |
409 | int | 414 | int |
410 | GNUNET_SET_iterate (struct GNUNET_SET_Handle *set, | 415 | GNUNET_SET_iterate (struct GNUNET_SET_Handle *set, |
411 | GNUNET_SET_ElementIterator iter, | 416 | GNUNET_SET_ElementIterator iter, |
412 | void *iter_cls); | 417 | void *iter_cls); |
413 | 418 | ||
419 | /** | ||
420 | * Stop iteration over all elements in the given set. Can only | ||
421 | * be called before the iteration has "naturally" completed its | ||
422 | * turn. | ||
423 | * | ||
424 | * @param set the set to stop iterating over | ||
425 | */ | ||
426 | void | ||
427 | GNUNET_SET_iterate_cancel (struct GNUNET_SET_Handle *set); | ||
428 | |||
414 | 429 | ||
415 | #if 0 /* keep Emacsens' auto-indent happy */ | 430 | #if 0 /* keep Emacsens' auto-indent happy */ |
416 | { | 431 | { |