aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_template.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2015-03-21 03:38:29 +0000
committerDavid Barksdale <amatus.amongus@gmail.com>2015-03-21 03:38:29 +0000
commitc77d4e5c69ac54ffddf5bd60c18bcb0504389311 (patch)
treebb40b73db6ed428d6ab44ffee91ca0ed6f16b592 /src/datastore/plugin_datastore_template.c
parentce6f1156a58aafed6563585b3be560ec0b4eabe7 (diff)
downloadgnunet-c77d4e5c69ac54ffddf5bd60c18bcb0504389311.tar.gz
gnunet-c77d4e5c69ac54ffddf5bd60c18bcb0504389311.zip
Convert datastore plugin API to asynchronous
Diffstat (limited to 'src/datastore/plugin_datastore_template.c')
-rw-r--r--src/datastore/plugin_datastore_template.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/datastore/plugin_datastore_template.c b/src/datastore/plugin_datastore_template.c
index e9d10a25c..4b8c9c016 100644
--- a/src/datastore/plugin_datastore_template.c
+++ b/src/datastore/plugin_datastore_template.c
@@ -69,19 +69,19 @@ template_plugin_estimate_size (void *cls, unsigned long long *estimate)
69 * @param anonymity anonymity-level for the content 69 * @param anonymity anonymity-level for the content
70 * @param replication replication-level for the content 70 * @param replication replication-level for the content
71 * @param expiration expiration time for the content 71 * @param expiration expiration time for the content
72 * @param msg set to error message 72 * @param cont continuation called with success or failure status
73 * @return GNUNET_OK on success 73 * @param cont_cls continuation closure
74 */ 74 */
75static int 75static void
76template_plugin_put (void *cls, const struct GNUNET_HashCode * key, uint32_t size, 76template_plugin_put (void *cls, const struct GNUNET_HashCode * key, uint32_t size,
77 const void *data, enum GNUNET_BLOCK_Type type, 77 const void *data, enum GNUNET_BLOCK_Type type,
78 uint32_t priority, uint32_t anonymity, 78 uint32_t priority, uint32_t anonymity,
79 uint32_t replication, 79 uint32_t replication,
80 struct GNUNET_TIME_Absolute expiration, char **msg) 80 struct GNUNET_TIME_Absolute expiration, PluginPutCont cont,
81 void *cont_cls)
81{ 82{
82 GNUNET_break (0); 83 GNUNET_break (0);
83 *msg = GNUNET_strdup ("not implemented"); 84 cont (cont_cls, key, size, GNUNET_SYSERR, "not implemented");
84 return GNUNET_SYSERR;
85} 85}
86 86
87 87
@@ -170,16 +170,16 @@ template_plugin_get_expiration (void *cls, PluginDatumProcessor proc,
170 * @param expire new expiration time should be the 170 * @param expire new expiration time should be the
171 * MAX of any existing expiration time and 171 * MAX of any existing expiration time and
172 * this value 172 * this value
173 * @param msg set to error message 173 * @param cont continuation called with success or failure status
174 * @return GNUNET_OK on success 174 * @param cons_cls continuation closure
175 */ 175 */
176static int 176static void
177template_plugin_update (void *cls, uint64_t uid, int delta, 177template_plugin_update (void *cls, uint64_t uid, int delta,
178 struct GNUNET_TIME_Absolute expire, char **msg) 178 struct GNUNET_TIME_Absolute expire,
179 PluginUpdateCont cont, void *cont_cls)
179{ 180{
180 GNUNET_break (0); 181 GNUNET_break (0);
181 *msg = GNUNET_strdup ("not implemented"); 182 cont (cont_cls, GNUNET_SYSERR, "not implemented");
182 return GNUNET_SYSERR;
183} 183}
184 184
185 185
@@ -226,6 +226,7 @@ template_get_keys (void *cls,
226 PluginKeyProcessor proc, 226 PluginKeyProcessor proc,
227 void *proc_cls) 227 void *proc_cls)
228{ 228{
229 proc (proc_cls, NULL, 0);
229} 230}
230 231
231 232