diff options
Diffstat (limited to 'src/include/gnunet_set_service.h')
-rw-r--r-- | src/include/gnunet_set_service.h | 106 |
1 files changed, 50 insertions, 56 deletions
diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h index ac54153e1..4016fc362 100644 --- a/src/include/gnunet_set_service.h +++ b/src/include/gnunet_set_service.h | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -52,7 +52,7 @@ extern "C" | |||
52 | /** | 52 | /** |
53 | * Maximum size of a context message for set operation requests. | 53 | * Maximum size of a context message for set operation requests. |
54 | */ | 54 | */ |
55 | #define GNUNET_SET_CONTEXT_MESSAGE_MAX_SIZE ((1<<16) - 1024) | 55 | #define GNUNET_SET_CONTEXT_MESSAGE_MAX_SIZE ((1 << 16) - 1024) |
56 | 56 | ||
57 | 57 | ||
58 | /** | 58 | /** |
@@ -79,8 +79,7 @@ struct GNUNET_SET_OperationHandle; | |||
79 | /** | 79 | /** |
80 | * The operation that a set set supports. | 80 | * The operation that a set set supports. |
81 | */ | 81 | */ |
82 | enum GNUNET_SET_OperationType | 82 | enum GNUNET_SET_OperationType { |
83 | { | ||
84 | /** | 83 | /** |
85 | * A purely local set that does not support any operation. | 84 | * A purely local set that does not support any operation. |
86 | */ | 85 | */ |
@@ -101,8 +100,7 @@ enum GNUNET_SET_OperationType | |||
101 | /** | 100 | /** |
102 | * Status for the result callback | 101 | * Status for the result callback |
103 | */ | 102 | */ |
104 | enum GNUNET_SET_Status | 103 | enum GNUNET_SET_Status { |
105 | { | ||
106 | /** | 104 | /** |
107 | * Everything went ok, we are transmitting an element of the | 105 | * Everything went ok, we are transmitting an element of the |
108 | * result (in set, or to be removed from set, depending on | 106 | * result (in set, or to be removed from set, depending on |
@@ -157,8 +155,7 @@ enum GNUNET_SET_Status | |||
157 | /** | 155 | /** |
158 | * The way results are given to the client. | 156 | * The way results are given to the client. |
159 | */ | 157 | */ |
160 | enum GNUNET_SET_ResultMode | 158 | enum GNUNET_SET_ResultMode { |
161 | { | ||
162 | /** | 159 | /** |
163 | * Client gets every element in the resulting set. | 160 | * Client gets every element in the resulting set. |
164 | * | 161 | * |
@@ -193,8 +190,7 @@ enum GNUNET_SET_ResultMode | |||
193 | /** | 190 | /** |
194 | * Element stored in a set. | 191 | * Element stored in a set. |
195 | */ | 192 | */ |
196 | struct GNUNET_SET_Element | 193 | struct GNUNET_SET_Element { |
197 | { | ||
198 | /** | 194 | /** |
199 | * Number of bytes in the buffer pointed to by data. | 195 | * Number of bytes in the buffer pointed to by data. |
200 | */ | 196 | */ |
@@ -217,8 +213,7 @@ struct GNUNET_SET_Element | |||
217 | * | 213 | * |
218 | * Used as tag for struct #GNUNET_SET_Option. | 214 | * Used as tag for struct #GNUNET_SET_Option. |
219 | */ | 215 | */ |
220 | enum GNUNET_SET_OptionType | 216 | enum GNUNET_SET_OptionType { |
221 | { | ||
222 | /** | 217 | /** |
223 | * List terminator. | 218 | * List terminator. |
224 | */ | 219 | */ |
@@ -248,8 +243,7 @@ enum GNUNET_SET_OptionType | |||
248 | /** | 243 | /** |
249 | * Option for set operations. | 244 | * Option for set operations. |
250 | */ | 245 | */ |
251 | struct GNUNET_SET_Option | 246 | struct GNUNET_SET_Option { |
252 | { | ||
253 | /** | 247 | /** |
254 | * Type of the option. | 248 | * Type of the option. |
255 | */ | 249 | */ |
@@ -341,8 +335,8 @@ typedef void | |||
341 | * @return a handle to the set | 335 | * @return a handle to the set |
342 | */ | 336 | */ |
343 | struct GNUNET_SET_Handle * | 337 | struct GNUNET_SET_Handle * |
344 | GNUNET_SET_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | 338 | GNUNET_SET_create(const struct GNUNET_CONFIGURATION_Handle *cfg, |
345 | enum GNUNET_SET_OperationType op); | 339 | enum GNUNET_SET_OperationType op); |
346 | 340 | ||
347 | 341 | ||
348 | /** | 342 | /** |
@@ -359,10 +353,10 @@ GNUNET_SET_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
359 | * set is invalid (e.g. the set service crashed) | 353 | * set is invalid (e.g. the set service crashed) |
360 | */ | 354 | */ |
361 | int | 355 | int |
362 | GNUNET_SET_add_element (struct GNUNET_SET_Handle *set, | 356 | GNUNET_SET_add_element(struct GNUNET_SET_Handle *set, |
363 | const struct GNUNET_SET_Element *element, | 357 | const struct GNUNET_SET_Element *element, |
364 | GNUNET_SET_Continuation cont, | 358 | GNUNET_SET_Continuation cont, |
365 | void *cont_cls); | 359 | void *cont_cls); |
366 | 360 | ||
367 | 361 | ||
368 | /** | 362 | /** |
@@ -379,16 +373,16 @@ GNUNET_SET_add_element (struct GNUNET_SET_Handle *set, | |||
379 | * set is invalid (e.g. the set service crashed) | 373 | * set is invalid (e.g. the set service crashed) |
380 | */ | 374 | */ |
381 | int | 375 | int |
382 | GNUNET_SET_remove_element (struct GNUNET_SET_Handle *set, | 376 | GNUNET_SET_remove_element(struct GNUNET_SET_Handle *set, |
383 | const struct GNUNET_SET_Element *element, | 377 | const struct GNUNET_SET_Element *element, |
384 | GNUNET_SET_Continuation cont, | 378 | GNUNET_SET_Continuation cont, |
385 | void *cont_cls); | 379 | void *cont_cls); |
386 | 380 | ||
387 | 381 | ||
388 | void | 382 | void |
389 | GNUNET_SET_copy_lazy (struct GNUNET_SET_Handle *set, | 383 | GNUNET_SET_copy_lazy(struct GNUNET_SET_Handle *set, |
390 | GNUNET_SET_CopyReadyCallback cb, | 384 | GNUNET_SET_CopyReadyCallback cb, |
391 | void *cls); | 385 | void *cls); |
392 | 386 | ||
393 | 387 | ||
394 | /** | 388 | /** |
@@ -400,7 +394,7 @@ GNUNET_SET_copy_lazy (struct GNUNET_SET_Handle *set, | |||
400 | * @param set set to destroy | 394 | * @param set set to destroy |
401 | */ | 395 | */ |
402 | void | 396 | void |
403 | GNUNET_SET_destroy (struct GNUNET_SET_Handle *set); | 397 | GNUNET_SET_destroy(struct GNUNET_SET_Handle *set); |
404 | 398 | ||
405 | 399 | ||
406 | /** | 400 | /** |
@@ -418,13 +412,13 @@ GNUNET_SET_destroy (struct GNUNET_SET_Handle *set); | |||
418 | * @return a handle to cancel the operation | 412 | * @return a handle to cancel the operation |
419 | */ | 413 | */ |
420 | struct GNUNET_SET_OperationHandle * | 414 | struct GNUNET_SET_OperationHandle * |
421 | GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer, | 415 | GNUNET_SET_prepare(const struct GNUNET_PeerIdentity *other_peer, |
422 | const struct GNUNET_HashCode *app_id, | 416 | const struct GNUNET_HashCode *app_id, |
423 | const struct GNUNET_MessageHeader *context_msg, | 417 | const struct GNUNET_MessageHeader *context_msg, |
424 | enum GNUNET_SET_ResultMode result_mode, | 418 | enum GNUNET_SET_ResultMode result_mode, |
425 | struct GNUNET_SET_Option options[], | 419 | struct GNUNET_SET_Option options[], |
426 | GNUNET_SET_ResultIterator result_cb, | 420 | GNUNET_SET_ResultIterator result_cb, |
427 | void *result_cls); | 421 | void *result_cls); |
428 | 422 | ||
429 | 423 | ||
430 | /** | 424 | /** |
@@ -442,11 +436,11 @@ GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer, | |||
442 | * @return a handle that can be used to cancel the listen operation | 436 | * @return a handle that can be used to cancel the listen operation |
443 | */ | 437 | */ |
444 | struct GNUNET_SET_ListenHandle * | 438 | struct GNUNET_SET_ListenHandle * |
445 | GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, | 439 | GNUNET_SET_listen(const struct GNUNET_CONFIGURATION_Handle *cfg, |
446 | enum GNUNET_SET_OperationType op_type, | 440 | enum GNUNET_SET_OperationType op_type, |
447 | const struct GNUNET_HashCode *app_id, | 441 | const struct GNUNET_HashCode *app_id, |
448 | GNUNET_SET_ListenCallback listen_cb, | 442 | GNUNET_SET_ListenCallback listen_cb, |
449 | void *listen_cls); | 443 | void *listen_cls); |
450 | 444 | ||
451 | 445 | ||
452 | /** | 446 | /** |
@@ -458,7 +452,7 @@ GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
458 | * @param lh handle for the listen operation | 452 | * @param lh handle for the listen operation |
459 | */ | 453 | */ |
460 | void | 454 | void |
461 | GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh); | 455 | GNUNET_SET_listen_cancel(struct GNUNET_SET_ListenHandle *lh); |
462 | 456 | ||
463 | 457 | ||
464 | /** | 458 | /** |
@@ -476,11 +470,11 @@ GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh); | |||
476 | * @return a handle to cancel the operation | 470 | * @return a handle to cancel the operation |
477 | */ | 471 | */ |
478 | struct GNUNET_SET_OperationHandle * | 472 | struct GNUNET_SET_OperationHandle * |
479 | GNUNET_SET_accept (struct GNUNET_SET_Request *request, | 473 | GNUNET_SET_accept(struct GNUNET_SET_Request *request, |
480 | enum GNUNET_SET_ResultMode result_mode, | 474 | enum GNUNET_SET_ResultMode result_mode, |
481 | struct GNUNET_SET_Option options[], | 475 | struct GNUNET_SET_Option options[], |
482 | GNUNET_SET_ResultIterator result_cb, | 476 | GNUNET_SET_ResultIterator result_cb, |
483 | void *result_cls); | 477 | void *result_cls); |
484 | 478 | ||
485 | 479 | ||
486 | /** | 480 | /** |
@@ -497,8 +491,8 @@ GNUNET_SET_accept (struct GNUNET_SET_Request *request, | |||
497 | * set is invalid (e.g. the set service crashed) | 491 | * set is invalid (e.g. the set service crashed) |
498 | */ | 492 | */ |
499 | int | 493 | int |
500 | GNUNET_SET_commit (struct GNUNET_SET_OperationHandle *oh, | 494 | GNUNET_SET_commit(struct GNUNET_SET_OperationHandle *oh, |
501 | struct GNUNET_SET_Handle *set); | 495 | struct GNUNET_SET_Handle *set); |
502 | 496 | ||
503 | 497 | ||
504 | /** | 498 | /** |
@@ -509,7 +503,7 @@ GNUNET_SET_commit (struct GNUNET_SET_OperationHandle *oh, | |||
509 | * @param oh set operation to cancel | 503 | * @param oh set operation to cancel |
510 | */ | 504 | */ |
511 | void | 505 | void |
512 | GNUNET_SET_operation_cancel (struct GNUNET_SET_OperationHandle *oh); | 506 | GNUNET_SET_operation_cancel(struct GNUNET_SET_OperationHandle *oh); |
513 | 507 | ||
514 | 508 | ||
515 | /** | 509 | /** |
@@ -526,9 +520,9 @@ GNUNET_SET_operation_cancel (struct GNUNET_SET_OperationHandle *oh); | |||
526 | * #GNUNET_SYSERR if the set is invalid (e.g. the server crashed, disconnected) | 520 | * #GNUNET_SYSERR if the set is invalid (e.g. the server crashed, disconnected) |
527 | */ | 521 | */ |
528 | int | 522 | int |
529 | GNUNET_SET_iterate (struct GNUNET_SET_Handle *set, | 523 | GNUNET_SET_iterate(struct GNUNET_SET_Handle *set, |
530 | GNUNET_SET_ElementIterator iter, | 524 | GNUNET_SET_ElementIterator iter, |
531 | void *iter_cls); | 525 | void *iter_cls); |
532 | 526 | ||
533 | 527 | ||
534 | /** | 528 | /** |
@@ -539,7 +533,7 @@ GNUNET_SET_iterate (struct GNUNET_SET_Handle *set, | |||
539 | * @param set the set to stop iterating over | 533 | * @param set the set to stop iterating over |
540 | */ | 534 | */ |
541 | void | 535 | void |
542 | GNUNET_SET_iterate_cancel (struct GNUNET_SET_Handle *set); | 536 | GNUNET_SET_iterate_cancel(struct GNUNET_SET_Handle *set); |
543 | 537 | ||
544 | 538 | ||
545 | /** | 539 | /** |
@@ -550,7 +544,7 @@ GNUNET_SET_iterate_cancel (struct GNUNET_SET_Handle *set); | |||
550 | * @return the copied element | 544 | * @return the copied element |
551 | */ | 545 | */ |
552 | struct GNUNET_SET_Element * | 546 | struct GNUNET_SET_Element * |
553 | GNUNET_SET_element_dup (const struct GNUNET_SET_Element *element); | 547 | GNUNET_SET_element_dup(const struct GNUNET_SET_Element *element); |
554 | 548 | ||
555 | 549 | ||
556 | /** | 550 | /** |
@@ -561,8 +555,8 @@ GNUNET_SET_element_dup (const struct GNUNET_SET_Element *element); | |||
561 | * should be stored | 555 | * should be stored |
562 | */ | 556 | */ |
563 | void | 557 | void |
564 | GNUNET_SET_element_hash (const struct GNUNET_SET_Element *element, | 558 | GNUNET_SET_element_hash(const struct GNUNET_SET_Element *element, |
565 | struct GNUNET_HashCode *ret_hash); | 559 | struct GNUNET_HashCode *ret_hash); |
566 | 560 | ||
567 | 561 | ||
568 | #if 0 /* keep Emacsens' auto-indent happy */ | 562 | #if 0 /* keep Emacsens' auto-indent happy */ |