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