diff options
Diffstat (limited to 'src/set/gnunet-service-set.h')
-rw-r--r-- | src/set/gnunet-service-set.h | 54 |
1 files changed, 19 insertions, 35 deletions
diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h index c39c68d21..2234a5c72 100644 --- a/src/set/gnunet-service-set.h +++ b/src/set/gnunet-service-set.h | |||
@@ -11,12 +11,12 @@ | |||
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 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file set/gnunet-service-set.h | 21 | * @file set/gnunet-service-set.h |
22 | * @brief common components for the implementation the different set operations | 22 | * @brief common components for the implementation the different set operations |
@@ -86,7 +86,7 @@ typedef struct SetState * | |||
86 | */ | 86 | */ |
87 | typedef void | 87 | typedef void |
88 | (*SetAddRemoveImpl) (struct SetState *state, | 88 | (*SetAddRemoveImpl) (struct SetState *state, |
89 | struct ElementEntry *ee); | 89 | struct ElementEntry *ee); |
90 | 90 | ||
91 | 91 | ||
92 | /** | 92 | /** |
@@ -159,8 +159,7 @@ typedef void | |||
159 | * Dispatch table for a specific set operation. Every set operation | 159 | * Dispatch table for a specific set operation. Every set operation |
160 | * has to implement the callback in this struct. | 160 | * has to implement the callback in this struct. |
161 | */ | 161 | */ |
162 | struct SetVT | 162 | struct SetVT { |
163 | { | ||
164 | /** | 163 | /** |
165 | * Callback for the set creation. | 164 | * Callback for the set creation. |
166 | */ | 165 | */ |
@@ -205,7 +204,6 @@ struct SetVT | |||
205 | * Callback called in case the CADET channel died. | 204 | * Callback called in case the CADET channel died. |
206 | */ | 205 | */ |
207 | OpChannelDeathImpl channel_death; | 206 | OpChannelDeathImpl channel_death; |
208 | |||
209 | }; | 207 | }; |
210 | 208 | ||
211 | 209 | ||
@@ -213,8 +211,7 @@ struct SetVT | |||
213 | * MutationEvent gives information about changes | 211 | * MutationEvent gives information about changes |
214 | * to an element (removal / addition) in a set content. | 212 | * to an element (removal / addition) in a set content. |
215 | */ | 213 | */ |
216 | struct MutationEvent | 214 | struct MutationEvent { |
217 | { | ||
218 | /** | 215 | /** |
219 | * First generation affected by this mutation event. | 216 | * First generation affected by this mutation event. |
220 | * | 217 | * |
@@ -237,8 +234,7 @@ struct MutationEvent | |||
237 | * Element`, so that the remove and add operations are reasonably | 234 | * Element`, so that the remove and add operations are reasonably |
238 | * fast. | 235 | * fast. |
239 | */ | 236 | */ |
240 | struct ElementEntry | 237 | struct ElementEntry { |
241 | { | ||
242 | /** | 238 | /** |
243 | * The actual element. The data for the element | 239 | * The actual element. The data for the element |
244 | * should be allocated at the end of this struct. | 240 | * should be allocated at the end of this struct. |
@@ -285,8 +281,7 @@ struct Listener; | |||
285 | /** | 281 | /** |
286 | * State we keep per client. | 282 | * State we keep per client. |
287 | */ | 283 | */ |
288 | struct ClientState | 284 | struct ClientState { |
289 | { | ||
290 | /** | 285 | /** |
291 | * Set, if associated with the client, otherwise NULL. | 286 | * Set, if associated with the client, otherwise NULL. |
292 | */ | 287 | */ |
@@ -306,16 +301,13 @@ struct ClientState | |||
306 | * Message queue. | 301 | * Message queue. |
307 | */ | 302 | */ |
308 | struct GNUNET_MQ_Handle *mq; | 303 | struct GNUNET_MQ_Handle *mq; |
309 | |||
310 | }; | 304 | }; |
311 | 305 | ||
312 | 306 | ||
313 | /** | 307 | /** |
314 | * Operation context used to execute a set operation. | 308 | * Operation context used to execute a set operation. |
315 | */ | 309 | */ |
316 | struct Operation | 310 | struct Operation { |
317 | { | ||
318 | |||
319 | /** | 311 | /** |
320 | * Kept in a DLL of the listener, if @e listener is non-NULL. | 312 | * Kept in a DLL of the listener, if @e listener is non-NULL. |
321 | */ | 313 | */ |
@@ -427,7 +419,6 @@ struct Operation | |||
427 | * was created. | 419 | * was created. |
428 | */ | 420 | */ |
429 | unsigned int generation_created; | 421 | unsigned int generation_created; |
430 | |||
431 | }; | 422 | }; |
432 | 423 | ||
433 | 424 | ||
@@ -435,9 +426,7 @@ struct Operation | |||
435 | * SetContent stores the actual set elements, which may be shared by | 426 | * SetContent stores the actual set elements, which may be shared by |
436 | * multiple generations derived from one set. | 427 | * multiple generations derived from one set. |
437 | */ | 428 | */ |
438 | struct SetContent | 429 | struct SetContent { |
439 | { | ||
440 | |||
441 | /** | 430 | /** |
442 | * Maps `struct GNUNET_HashCode *` to `struct ElementEntry *`. | 431 | * Maps `struct GNUNET_HashCode *` to `struct ElementEntry *`. |
443 | */ | 432 | */ |
@@ -474,8 +463,7 @@ struct SetContent | |||
474 | }; | 463 | }; |
475 | 464 | ||
476 | 465 | ||
477 | struct GenerationRange | 466 | struct GenerationRange { |
478 | { | ||
479 | /** | 467 | /** |
480 | * First generation that is excluded. | 468 | * First generation that is excluded. |
481 | */ | 469 | */ |
@@ -491,8 +479,7 @@ struct GenerationRange | |||
491 | /** | 479 | /** |
492 | * Information about a mutation to apply to a set. | 480 | * Information about a mutation to apply to a set. |
493 | */ | 481 | */ |
494 | struct PendingMutation | 482 | struct PendingMutation { |
495 | { | ||
496 | /** | 483 | /** |
497 | * Mutations are kept in a DLL. | 484 | * Mutations are kept in a DLL. |
498 | */ | 485 | */ |
@@ -520,9 +507,7 @@ struct PendingMutation | |||
520 | /** | 507 | /** |
521 | * A set that supports a specific operation with other peers. | 508 | * A set that supports a specific operation with other peers. |
522 | */ | 509 | */ |
523 | struct Set | 510 | struct Set { |
524 | { | ||
525 | |||
526 | /** | 511 | /** |
527 | * Sets are held in a doubly linked list (in `sets_head` and `sets_tail`). | 512 | * Sets are held in a doubly linked list (in `sets_head` and `sets_tail`). |
528 | */ | 513 | */ |
@@ -606,7 +591,6 @@ struct Set | |||
606 | * can distinguish iterations. | 591 | * can distinguish iterations. |
607 | */ | 592 | */ |
608 | uint16_t iteration_id; | 593 | uint16_t iteration_id; |
609 | |||
610 | }; | 594 | }; |
611 | 595 | ||
612 | 596 | ||
@@ -627,8 +611,8 @@ extern struct GNUNET_STATISTICS_Handle *_GSS_statistics; | |||
627 | * @param gc #GNUNET_YES to perform garbage collection on the set | 611 | * @param gc #GNUNET_YES to perform garbage collection on the set |
628 | */ | 612 | */ |
629 | void | 613 | void |
630 | _GSS_operation_destroy (struct Operation *op, | 614 | _GSS_operation_destroy(struct Operation *op, |
631 | int gc); | 615 | int gc); |
632 | 616 | ||
633 | 617 | ||
634 | /** | 618 | /** |
@@ -637,7 +621,7 @@ _GSS_operation_destroy (struct Operation *op, | |||
637 | * logic in the various places where it is called. | 621 | * logic in the various places where it is called. |
638 | */ | 622 | */ |
639 | void | 623 | void |
640 | _GSS_operation_destroy2 (struct Operation *op); | 624 | _GSS_operation_destroy2(struct Operation *op); |
641 | 625 | ||
642 | 626 | ||
643 | /** | 627 | /** |
@@ -646,7 +630,7 @@ _GSS_operation_destroy2 (struct Operation *op); | |||
646 | * @return the operation specific VTable | 630 | * @return the operation specific VTable |
647 | */ | 631 | */ |
648 | const struct SetVT * | 632 | const struct SetVT * |
649 | _GSS_union_vt (void); | 633 | _GSS_union_vt(void); |
650 | 634 | ||
651 | 635 | ||
652 | /** | 636 | /** |
@@ -655,7 +639,7 @@ _GSS_union_vt (void); | |||
655 | * @return the operation specific VTable | 639 | * @return the operation specific VTable |
656 | */ | 640 | */ |
657 | const struct SetVT * | 641 | const struct SetVT * |
658 | _GSS_intersection_vt (void); | 642 | _GSS_intersection_vt(void); |
659 | 643 | ||
660 | 644 | ||
661 | /** | 645 | /** |
@@ -666,8 +650,8 @@ _GSS_intersection_vt (void); | |||
666 | * @return #GNUNET_YES if the element is in the set, #GNUNET_NO if not | 650 | * @return #GNUNET_YES if the element is in the set, #GNUNET_NO if not |
667 | */ | 651 | */ |
668 | int | 652 | int |
669 | _GSS_is_element_of_operation (struct ElementEntry *ee, | 653 | _GSS_is_element_of_operation(struct ElementEntry *ee, |
670 | struct Operation *op); | 654 | struct Operation *op); |
671 | 655 | ||
672 | 656 | ||
673 | #endif | 657 | #endif |