aboutsummaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-service-messenger_list_handles.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/messenger/gnunet-service-messenger_list_handles.h')
-rw-r--r--src/messenger/gnunet-service-messenger_list_handles.h101
1 files changed, 0 insertions, 101 deletions
diff --git a/src/messenger/gnunet-service-messenger_list_handles.h b/src/messenger/gnunet-service-messenger_list_handles.h
deleted file mode 100644
index f4d7ca5c0..000000000
--- a/src/messenger/gnunet-service-messenger_list_handles.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2020--2021 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
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/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20/**
21 * @author Tobias Frisch
22 * @file src/messenger/gnunet-service-messenger_list_handles.h
23 * @brief GNUnet MESSENGER service
24 */
25
26#ifndef GNUNET_SERVICE_MESSENGER_LIST_HANDLES_H
27#define GNUNET_SERVICE_MESSENGER_LIST_HANDLES_H
28
29#include "platform.h"
30#include "gnunet_crypto_lib.h"
31#include "gnunet_container_lib.h"
32
33struct GNUNET_MESSENGER_SrvHandle;
34
35struct GNUNET_MESSENGER_ListHandle
36{
37 struct GNUNET_MESSENGER_ListHandle *prev;
38 struct GNUNET_MESSENGER_ListHandle *next;
39
40 struct GNUNET_MESSENGER_SrvHandle *handle;
41};
42
43struct GNUNET_MESSENGER_ListHandles
44{
45 struct GNUNET_MESSENGER_ListHandle *head;
46 struct GNUNET_MESSENGER_ListHandle *tail;
47};
48
49/**
50 * Initializes list of <i>handles</i> as empty list.
51 *
52 * @param[out] handles List of handles
53 */
54void
55init_list_handles (struct GNUNET_MESSENGER_ListHandles *handles);
56
57/**
58 * Destroys remaining <i>handles</i> and clears the list.
59 *
60 * @param[in/out] handles List of handles
61 */
62void
63clear_list_handles (struct GNUNET_MESSENGER_ListHandles *handles);
64
65/**
66 * Adds a specific <i>handle</i> to the end of the list.
67 *
68 * @param[in/out] handles List of handles
69 * @param[in/out] handle Handle
70 */
71void
72add_list_handle (struct GNUNET_MESSENGER_ListHandles *handles,
73 struct GNUNET_MESSENGER_SrvHandle *handle);
74
75/**
76 * Removes the first entry matching with a specific <i>handle</i> from the list of
77 * <i>handles</i> and returns #GNUNET_YES on success or #GNUNET_NO on failure.
78 *
79 * @param[in/out] handles List of handles
80 * @param[in/out] handle Handle
81 * @return #GNUNET_YES on success, otherwise #GNUNET_NO
82 */
83int
84remove_list_handle (struct GNUNET_MESSENGER_ListHandles *handles,
85 struct GNUNET_MESSENGER_SrvHandle *handle);
86
87/**
88 * Searches linearly through the list of <i>handles</i> for members of a specific room
89 * which is identified by a given <i>key</i>.
90 *
91 * If no handle is found which is a current member, NULL gets returned.
92 *
93 * @param[in] handles List of handles
94 * @param[in] key Common key of a room
95 * @return First handle which is a current member
96 */
97struct GNUNET_MESSENGER_SrvHandle*
98find_list_handle_by_member (const struct GNUNET_MESSENGER_ListHandles *handles,
99 const struct GNUNET_HashCode *key);
100
101#endif //GNUNET_SERVICE_MESSENGER_LIST_HANDLES_H