2 This file is part of GNUnet.
3 (C) 2013 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file include/gnunet_psycstore_service.h
23 * @brief PSYCstore service; implements persistent storage for the PSYC service
25 * @author Christian Grothoff
27 #ifndef GNUNET_PSYCSTORE_SERVICE_H
28 #define GNUNET_PSYCSTORE_SERVICE_H
33 #if 0 /* keep Emacsens' auto-indent happy */
38 #include "gnunet_util_lib.h"
41 * Version number of GNUnet PSYCstore API.
43 #define GNUNET_PSYCSTORE_VERSION 0x00000000
46 * Handle for a PSYCstore
48 struct GNUNET_PSYCSTORE_Handle;
51 struct GNUNET_PSYCSTORE_Handle *
52 GNUNET_PSYCSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
56 GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h);
60 * Handle for an operation on the PSYCSTORE (useful to cancel the operation).
62 struct GNUNET_PSYCSTORE_OperationHandle;
67 * @param result GNUNET_SYSERR on error,
68 * GNUNET_YES on success or if the peer was a member,
69 * GNUNET_NO if the peer was not a member
71 typedef void (*GNUNET_PSYCSTORE_ContinuationCallback)(void *cls,
75 struct GNUNET_PSYCSTORE_OperationHandle *
76 GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h,
77 const struct GNUNET_HashCode *channel_id,
79 const struct GNUNET_PeerIdentity *peer,
81 GNUNET_PSYCSTORE_ContinuationCallback ccb,
85 struct GNUNET_PSYCSTORE_OperationHandle *
86 GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h,
87 const struct GNUNET_HashCode *channel_id,
89 const struct GNUNET_PeerIdentity *peer,
90 GNUNET_PSYCSTORE_ContinuationCallback ccb,
94 struct GNUNET_PSYCSTORE_OperationHandle *
95 GNUNET_PSYCSTORE_message_store (struct GNUNET_PSYCSTORE_Handle *h,
96 const struct GNUNET_HashCode *channel_id,
97 const struct GNUNET_MULTICAST_MessageHeader *message,
98 GNUNET_PSYCSTORE_ContinuationCallback ccb,
102 typedef void (*GNUNET_PSYCSTORE_MessageResultCallback)(void *cls,
104 const struct GNUNET_MULTICAST_MessageHeader *message);
107 struct GNUNET_PSYCSTORE_OperationHandle *
108 GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
109 const struct GNUNET_HashCode *channel_id,
111 GNUNET_PSYCSTORE_MessageResultCallback rcb,
115 struct GNUNET_PSYCSTORE_OperationHandle *
116 GNUNET_PSYCSTORE_message_get_latest (struct GNUNET_PSYCSTORE_Handle *h,
117 const struct GNUNET_HashCode *channel_id,
118 GNUNET_PSYCSTORE_MessageResultCallback rcb,
122 struct GNUNET_PSYCSTORE_OperationHandle *
123 GNUNET_PSYCSTORE_state_set (struct GNUNET_PSYCSTORE_Handle *h,
124 const struct GNUNET_HashCode *channel_id,
125 const char *state_name,
128 GNUNET_PSYCSTORE_ContinuationCallback ccb,
132 typedef void (*GNUNET_PSYCSTORE_StateResultCallback)(void *cls,
133 const char *state_name,
138 struct GNUNET_PSYCSTORE_OperationHandle *
139 GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h,
140 const struct GNUNET_HashCode *channel_id,
141 const char *state_name,
142 GNUNET_PSYCSTORE_StateResultCallback rcb,
146 struct GNUNET_PSYCSTORE_OperationHandle *
147 GNUNET_PSYCSTORE_state_get_all (struct GNUNET_PSYCSTORE_Handle *h,
148 const struct GNUNET_HashCode *channel_id,
149 GNUNET_PSYCSTORE_StateResultCallback rcb,
154 GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *oh);
159 #if 0 /* keep Emacsens' auto-indent happy */
166 /* ifndef GNUNET_PSYCSTORE_SERVICE_H */
168 /* end of gnunet_psycstore_service.h */