aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_peerstore_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-18 16:22:14 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-18 16:22:14 +0000
commitfb12af8319a84389a536ab2f3735daf3b24f11bd (patch)
tree53e1424149fe8e7d5673e783868fcaa8a6bdbb55 /src/include/gnunet_peerstore_service.h
parentd19064a18f3fcf35c94d7f56485e41fb3425d066 (diff)
downloadgnunet-fb12af8319a84389a536ab2f3735daf3b24f11bd.tar.gz
gnunet-fb12af8319a84389a536ab2f3735daf3b24f11bd.zip
-use const in peerstore callback
Diffstat (limited to 'src/include/gnunet_peerstore_service.h')
-rw-r--r--src/include/gnunet_peerstore_service.h53
1 files changed, 33 insertions, 20 deletions
diff --git a/src/include/gnunet_peerstore_service.h b/src/include/gnunet_peerstore_service.h
index a3fed7065..49166659b 100644
--- a/src/include/gnunet_peerstore_service.h
+++ b/src/include/gnunet_peerstore_service.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 (C) 3 (C)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 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 6 it under the terms of the GNU General Public License as published
@@ -52,7 +52,7 @@ enum GNUNET_PEERSTORE_StoreOption
52 * Delete any previous values for the given key before 52 * Delete any previous values for the given key before
53 * storing the given value. 53 * storing the given value.
54 */ 54 */
55 GNUNET_PEERSTORE_STOREOPTION_REPLACE = 1, 55 GNUNET_PEERSTORE_STOREOPTION_REPLACE = 1
56 56
57}; 57};
58 58
@@ -93,7 +93,7 @@ struct GNUNET_PEERSTORE_Record
93 void *value; 93 void *value;
94 94
95 /** 95 /**
96 * Size of 'value' BLOB 96 * Size of @e value BLOB
97 */ 97 */
98 size_t value_size; 98 size_t value_size;
99 99
@@ -108,13 +108,15 @@ struct GNUNET_PEERSTORE_Record
108 struct GNUNET_SERVER_Client *client; 108 struct GNUNET_SERVER_Client *client;
109}; 109};
110 110
111
111/** 112/**
112 * Continuation called with a status result. 113 * Continuation called with a status result.
113 * 114 *
114 * @param cls closure 115 * @param cls closure
115 * @param success #GNUNET_OK or #GNUNET_SYSERR 116 * @param success #GNUNET_OK or #GNUNET_SYSERR
116 */ 117 */
117typedef void (*GNUNET_PEERSTORE_Continuation)(void *cls, int success); 118typedef void
119(*GNUNET_PEERSTORE_Continuation)(void *cls, int success);
118 120
119/** 121/**
120 * Function called by PEERSTORE for each matching record. 122 * Function called by PEERSTORE for each matching record.
@@ -124,9 +126,10 @@ typedef void (*GNUNET_PEERSTORE_Continuation)(void *cls, int success);
124 * @param emsg error message, or NULL if no errors 126 * @param emsg error message, or NULL if no errors
125 * @return #GNUNET_YES to continue iterating, #GNUNET_NO to stop 127 * @return #GNUNET_YES to continue iterating, #GNUNET_NO to stop
126 */ 128 */
127typedef int (*GNUNET_PEERSTORE_Processor) (void *cls, 129typedef int
128 struct GNUNET_PEERSTORE_Record *record, 130(*GNUNET_PEERSTORE_Processor) (void *cls,
129 char *emsg); 131 const struct GNUNET_PEERSTORE_Record *record,
132 const char *emsg);
130 133
131/** 134/**
132 * Connect to the PEERSTORE service. 135 * Connect to the PEERSTORE service.
@@ -136,6 +139,7 @@ typedef int (*GNUNET_PEERSTORE_Processor) (void *cls,
136struct GNUNET_PEERSTORE_Handle * 139struct GNUNET_PEERSTORE_Handle *
137GNUNET_PEERSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); 140GNUNET_PEERSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
138 141
142
139/** 143/**
140 * Disconnect from the PEERSTORE service. Any pending ITERATE and WATCH requests 144 * Disconnect from the PEERSTORE service. Any pending ITERATE and WATCH requests
141 * will be canceled. 145 * will be canceled.
@@ -145,7 +149,9 @@ GNUNET_PEERSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
145 * @param sync_first send any pending STORE requests before disconnecting 149 * @param sync_first send any pending STORE requests before disconnecting
146 */ 150 */
147void 151void
148GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h, int sync_first); 152GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h,
153 int sync_first);
154
149 155
150/** 156/**
151 * Store a new entry in the PEERSTORE. 157 * Store a new entry in the PEERSTORE.
@@ -161,7 +167,7 @@ GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h, int sync_first);
161 * @param expiry absolute time after which the entry is (possibly) deleted 167 * @param expiry absolute time after which the entry is (possibly) deleted
162 * @param options options specific to the storage operation 168 * @param options options specific to the storage operation
163 * @param cont Continuation function after the store request is sent 169 * @param cont Continuation function after the store request is sent
164 * @param cont_cls Closure for 'cont' 170 * @param cont_cls Closure for @a cont
165 */ 171 */
166struct GNUNET_PEERSTORE_StoreContext * 172struct GNUNET_PEERSTORE_StoreContext *
167GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h, 173GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h,
@@ -175,6 +181,7 @@ GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h,
175 GNUNET_PEERSTORE_Continuation cont, 181 GNUNET_PEERSTORE_Continuation cont,
176 void *cont_cls); 182 void *cont_cls);
177 183
184
178/** 185/**
179 * Cancel a store request 186 * Cancel a store request
180 * 187 *
@@ -183,6 +190,7 @@ GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h,
183void 190void
184GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc); 191GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc);
185 192
193
186/** 194/**
187 * Iterate over records matching supplied key information 195 * Iterate over records matching supplied key information
188 * 196 *
@@ -196,11 +204,13 @@ GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc);
196 */ 204 */
197struct GNUNET_PEERSTORE_IterateContext * 205struct GNUNET_PEERSTORE_IterateContext *
198GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h, 206GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h,
199 const char *sub_system, 207 const char *sub_system,
200 const struct GNUNET_PeerIdentity *peer, 208 const struct GNUNET_PeerIdentity *peer,
201 const char *key, 209 const char *key,
202 struct GNUNET_TIME_Relative timeout, 210 struct GNUNET_TIME_Relative timeout,
203 GNUNET_PEERSTORE_Processor callback, void *callback_cls); 211 GNUNET_PEERSTORE_Processor callback,
212 void *callback_cls);
213
204 214
205/** 215/**
206 * Cancel an iterate request 216 * Cancel an iterate request
@@ -211,9 +221,10 @@ GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h,
211void 221void
212GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic); 222GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic);
213 223
224
214/** 225/**
215 * Request watching a given key 226 * Request watching a given key
216 * User will be notified with any new values added to key 227 * User will be notified with any new values added to key.
217 * 228 *
218 * @param h handle to the PEERSTORE service 229 * @param h handle to the PEERSTORE service
219 * @param sub_system name of sub system 230 * @param sub_system name of sub system
@@ -225,10 +236,12 @@ GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic);
225 */ 236 */
226struct GNUNET_PEERSTORE_WatchContext * 237struct GNUNET_PEERSTORE_WatchContext *
227GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h, 238GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h,
228 const char *sub_system, 239 const char *sub_system,
229 const struct GNUNET_PeerIdentity *peer, 240 const struct GNUNET_PeerIdentity *peer,
230 const char *key, 241 const char *key,
231 GNUNET_PEERSTORE_Processor callback, void *callback_cls); 242 GNUNET_PEERSTORE_Processor callback,
243 void *callback_cls);
244
232 245
233/** 246/**
234 * Cancel a watch request 247 * Cancel a watch request
@@ -236,7 +249,7 @@ GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h,
236 * @param wc handle to the watch request 249 * @param wc handle to the watch request
237 */ 250 */
238void 251void
239GNUNET_PEERSTORE_watch_cancel(struct GNUNET_PEERSTORE_WatchContext *wc); 252GNUNET_PEERSTORE_watch_cancel (struct GNUNET_PEERSTORE_WatchContext *wc);
240 253
241#if 0 /* keep Emacsens' auto-indent happy */ 254#if 0 /* keep Emacsens' auto-indent happy */
242{ 255{