diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-12 20:41:51 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-12 20:41:51 +0000 |
commit | 130dc5a3fe63470ccb626648f42e1ec739b0d0e6 (patch) | |
tree | 5451a59b7d3fa8cfee141e6ff994e21a4e7fcf28 /src/include/gnunet_psycstore_service.h | |
parent | 4ca6ea4f01c9e1a1b40f6e4232fc3ce18358667e (diff) | |
download | gnunet-130dc5a3fe63470ccb626648f42e1ec739b0d0e6.tar.gz gnunet-130dc5a3fe63470ccb626648f42e1ec739b0d0e6.zip |
first design for psycstore API
Diffstat (limited to 'src/include/gnunet_psycstore_service.h')
-rw-r--r-- | src/include/gnunet_psycstore_service.h | 113 |
1 files changed, 111 insertions, 2 deletions
diff --git a/src/include/gnunet_psycstore_service.h b/src/include/gnunet_psycstore_service.h index 730469479..856824e60 100644 --- a/src/include/gnunet_psycstore_service.h +++ b/src/include/gnunet_psycstore_service.h | |||
@@ -22,6 +22,7 @@ | |||
22 | * @file include/gnunet_psycstore_service.h | 22 | * @file include/gnunet_psycstore_service.h |
23 | * @brief PSYCstore service; implements persistent storage for the PSYC service | 23 | * @brief PSYCstore service; implements persistent storage for the PSYC service |
24 | * @author tg | 24 | * @author tg |
25 | * @author Christian Grothoff | ||
25 | */ | 26 | */ |
26 | #ifndef GNUNET_PSYCSTORE_SERVICE_H | 27 | #ifndef GNUNET_PSYCSTORE_SERVICE_H |
27 | #define GNUNET_PSYCSTORE_SERVICE_H | 28 | #define GNUNET_PSYCSTORE_SERVICE_H |
@@ -47,6 +48,114 @@ extern "C" | |||
47 | struct GNUNET_PSYCSTORE_Handle; | 48 | struct GNUNET_PSYCSTORE_Handle; |
48 | 49 | ||
49 | 50 | ||
51 | struct GNUNET_PSYCSTORE_Handle * | ||
52 | GNUNET_PSYCSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
53 | |||
54 | |||
55 | void | ||
56 | GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h); | ||
57 | |||
58 | |||
59 | /** | ||
60 | * Handle for an operation on the PSYCSTORE (useful to cancel the operation). | ||
61 | */ | ||
62 | struct GNUNET_PSYCSTORE_OperationHandle; | ||
63 | |||
64 | |||
65 | /** | ||
66 | * | ||
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 | ||
70 | */ | ||
71 | typedef void (*GNUNET_PSYCSTORE_ContinuationCallback)(void *cls, | ||
72 | int result); | ||
73 | |||
74 | |||
75 | struct GNUNET_PSYCSTORE_OperationHandle * | ||
76 | GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | ||
77 | const struct GNUNET_HashCode *channel_id, | ||
78 | uint64_t message_id, | ||
79 | const struct GNUNET_PeerIdentity *peer, | ||
80 | int did_join, | ||
81 | GNUNET_PSYCSTORE_ContinuationCallback ccb, | ||
82 | void *ccb_cls); | ||
83 | |||
84 | |||
85 | struct GNUNET_PSYCSTORE_OperationHandle * | ||
86 | GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, | ||
87 | const struct GNUNET_HashCode *channel_id, | ||
88 | uint64_t message_id, | ||
89 | const struct GNUNET_PeerIdentity *peer, | ||
90 | GNUNET_PSYCSTORE_ContinuationCallback ccb, | ||
91 | void *ccb_cls); | ||
92 | |||
93 | |||
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, | ||
99 | void *ccb_cls); | ||
100 | |||
101 | |||
102 | typedef void (*GNUNET_PSYCSTORE_MessageResultCallback)(void *cls, | ||
103 | uint64_t message_id, | ||
104 | const struct GNUNET_MULTICAST_MessageHeader *message); | ||
105 | |||
106 | |||
107 | struct GNUNET_PSYCSTORE_OperationHandle * | ||
108 | GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, | ||
109 | const struct GNUNET_HashCode *channel_id, | ||
110 | uint64_t message_id, | ||
111 | GNUNET_PSYCSTORE_MessageResultCallback rcb, | ||
112 | void *rcb_cls); | ||
113 | |||
114 | |||
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, | ||
119 | void *rcb_cls); | ||
120 | |||
121 | |||
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, | ||
126 | size_t size, | ||
127 | const void *value, | ||
128 | GNUNET_PSYCSTORE_ContinuationCallback ccb, | ||
129 | void *ccb_cls); | ||
130 | |||
131 | |||
132 | typedef void (*GNUNET_PSYCSTORE_StateResultCallback)(void *cls, | ||
133 | const char *state_name, | ||
134 | size_t size, | ||
135 | const void *value); | ||
136 | |||
137 | |||
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, | ||
143 | void *rcb_cls); | ||
144 | |||
145 | |||
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, | ||
150 | void *rcb_cls); | ||
151 | |||
152 | |||
153 | void | ||
154 | GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *oh); | ||
155 | |||
156 | |||
157 | |||
158 | |||
50 | #if 0 /* keep Emacsens' auto-indent happy */ | 159 | #if 0 /* keep Emacsens' auto-indent happy */ |
51 | { | 160 | { |
52 | #endif | 161 | #endif |
@@ -54,6 +163,6 @@ struct GNUNET_PSYCSTORE_Handle; | |||
54 | } | 163 | } |
55 | #endif | 164 | #endif |
56 | 165 | ||
57 | /* ifndef GNUNET_SOCIAL_SERVICE_H */ | 166 | /* ifndef GNUNET_PSYCSTORE_SERVICE_H */ |
58 | #endif | 167 | #endif |
59 | /* end of gnunet_social_service.h */ | 168 | /* end of gnunet_psycstore_service.h */ |