diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2015-03-21 03:38:29 +0000 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2015-03-21 03:38:29 +0000 |
commit | c77d4e5c69ac54ffddf5bd60c18bcb0504389311 (patch) | |
tree | bb40b73db6ed428d6ab44ffee91ca0ed6f16b592 /src/datastore/plugin_datastore_template.c | |
parent | ce6f1156a58aafed6563585b3be560ec0b4eabe7 (diff) | |
download | gnunet-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.c | 25 |
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 | */ |
75 | static int | 75 | static void |
76 | template_plugin_put (void *cls, const struct GNUNET_HashCode * key, uint32_t size, | 76 | template_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 | */ |
176 | static int | 176 | static void |
177 | template_plugin_update (void *cls, uint64_t uid, int delta, | 177 | template_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 | ||