diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-07-18 21:38:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-07-18 21:38:14 +0000 |
commit | b103d434085de5070880f3bcb025cda5fff6836d (patch) | |
tree | 789bf45f4ea9d5bd560bd76330f42dc0259b6b04 /src/include/gnunet_datastore_service.h | |
parent | 5ee114a710348292e44f1f7865095381df3166fc (diff) | |
download | gnunet-b103d434085de5070880f3bcb025cda5fff6836d.tar.gz gnunet-b103d434085de5070880f3bcb025cda5fff6836d.zip |
work on datastore API implementation
Diffstat (limited to 'src/include/gnunet_datastore_service.h')
-rw-r--r-- | src/include/gnunet_datastore_service.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index 2dcc153e6..2e55da24e 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -98,13 +98,15 @@ typedef void (*GNUNET_DATASTORE_ContinuationWithStatus)(void *cls, | |||
98 | * @param cont continuation to call when done; "success" will be set to | 98 | * @param cont continuation to call when done; "success" will be set to |
99 | * a positive reservation value if space could be reserved. | 99 | * a positive reservation value if space could be reserved. |
100 | * @param cont_cls closure for cont | 100 | * @param cont_cls closure for cont |
101 | * @param timeout how long to wait at most for a response | ||
101 | */ | 102 | */ |
102 | void | 103 | void |
103 | GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, | 104 | GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, |
104 | uint64_t amount, | 105 | uint64_t amount, |
105 | uint64_t entries, | 106 | uint64_t entries, |
106 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 107 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
107 | void *cont_cls); | 108 | void *cont_cls, |
109 | struct GNUNET_TIME_Relative timeout); | ||
108 | 110 | ||
109 | 111 | ||
110 | /** | 112 | /** |
@@ -151,12 +153,14 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, | |||
151 | * from the "reserve" function). | 153 | * from the "reserve" function). |
152 | * @param cont continuation to call when done | 154 | * @param cont continuation to call when done |
153 | * @param cont_cls closure for cont | 155 | * @param cont_cls closure for cont |
156 | * @param timeout how long to wait at most for a response | ||
154 | */ | 157 | */ |
155 | void | 158 | void |
156 | GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, | 159 | GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, |
157 | int rid, | 160 | int rid, |
158 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 161 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
159 | void *cont_cls); | 162 | void *cont_cls, |
163 | struct GNUNET_TIME_Relative timeout); | ||
160 | 164 | ||
161 | 165 | ||
162 | /** | 166 | /** |
@@ -168,6 +172,7 @@ GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, | |||
168 | * @param expiration new expiration value should be MAX of existing and this argument | 172 | * @param expiration new expiration value should be MAX of existing and this argument |
169 | * @param cont continuation to call when done | 173 | * @param cont continuation to call when done |
170 | * @param cont_cls closure for cont | 174 | * @param cont_cls closure for cont |
175 | * @param timeout how long to wait at most for a response | ||
171 | */ | 176 | */ |
172 | void | 177 | void |
173 | GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, | 178 | GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, |
@@ -175,7 +180,8 @@ GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, | |||
175 | uint32_t priority, | 180 | uint32_t priority, |
176 | struct GNUNET_TIME_Absolute expiration, | 181 | struct GNUNET_TIME_Absolute expiration, |
177 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 182 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
178 | void *cont_cls); | 183 | void *cont_cls, |
184 | struct GNUNET_TIME_Relative timeout); | ||
179 | 185 | ||
180 | 186 | ||
181 | /** | 187 | /** |
@@ -213,12 +219,14 @@ typedef void (*GNUNET_DATASTORE_Iterator) (void *cls, | |||
213 | * @param iter function to call on each matching value; | 219 | * @param iter function to call on each matching value; |
214 | * will be called once with a NULL value at the end | 220 | * will be called once with a NULL value at the end |
215 | * @param iter_cls closure for iter | 221 | * @param iter_cls closure for iter |
222 | * @param timeout how long to wait at most for a response | ||
216 | */ | 223 | */ |
217 | void | 224 | void |
218 | GNUNET_DATASTORE_get (struct GNUNET_DATASTORE_Handle *h, | 225 | GNUNET_DATASTORE_get (struct GNUNET_DATASTORE_Handle *h, |
219 | const GNUNET_HashCode * key, | 226 | const GNUNET_HashCode * key, |
220 | uint32_t type, | 227 | uint32_t type, |
221 | GNUNET_DATASTORE_Iterator iter, void *iter_cls); | 228 | GNUNET_DATASTORE_Iterator iter, void *iter_cls, |
229 | struct GNUNET_TIME_Relative timeout); | ||
222 | 230 | ||
223 | 231 | ||
224 | /** | 232 | /** |
@@ -229,10 +237,12 @@ GNUNET_DATASTORE_get (struct GNUNET_DATASTORE_Handle *h, | |||
229 | * will be called once with a value (if available) | 237 | * will be called once with a value (if available) |
230 | * and always once with a value of NULL. | 238 | * and always once with a value of NULL. |
231 | * @param iter_cls closure for iter | 239 | * @param iter_cls closure for iter |
240 | * @param timeout how long to wait at most for a response | ||
232 | */ | 241 | */ |
233 | void | 242 | void |
234 | GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, | 243 | GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, |
235 | GNUNET_DATASTORE_Iterator iter, void *iter_cls); | 244 | GNUNET_DATASTORE_Iterator iter, void *iter_cls, |
245 | struct GNUNET_TIME_Relative timeout); | ||
236 | 246 | ||
237 | 247 | ||
238 | /** | 248 | /** |
@@ -244,13 +254,15 @@ GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, | |||
244 | * @param data content stored | 254 | * @param data content stored |
245 | * @param cont continuation to call when done | 255 | * @param cont continuation to call when done |
246 | * @param cont_cls closure for cont | 256 | * @param cont_cls closure for cont |
257 | * @param timeout how long to wait at most for a response | ||
247 | */ | 258 | */ |
248 | void | 259 | void |
249 | GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, | 260 | GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, |
250 | const GNUNET_HashCode *key, | 261 | const GNUNET_HashCode *key, |
251 | uint32_t size, const void *data, | 262 | uint32_t size, const void *data, |
252 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 263 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
253 | void *cont_cls); | 264 | void *cont_cls, |
265 | struct GNUNET_TIME_Relative timeout); | ||
254 | 266 | ||
255 | 267 | ||
256 | #if 0 /* keep Emacsens' auto-indent happy */ | 268 | #if 0 /* keep Emacsens' auto-indent happy */ |