diff options
Diffstat (limited to 'src/messenger/gnunet-service-messenger_ego_store.c')
-rw-r--r-- | src/messenger/gnunet-service-messenger_ego_store.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/src/messenger/gnunet-service-messenger_ego_store.c b/src/messenger/gnunet-service-messenger_ego_store.c index 3b069fcf5..c460ac1c7 100644 --- a/src/messenger/gnunet-service-messenger_ego_store.c +++ b/src/messenger/gnunet-service-messenger_ego_store.c | |||
@@ -28,7 +28,10 @@ | |||
28 | #include "gnunet-service-messenger_handle.h" | 28 | #include "gnunet-service-messenger_handle.h" |
29 | 29 | ||
30 | static void | 30 | static void |
31 | callback_update_ego (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier) | 31 | callback_update_ego (void *cls, |
32 | struct GNUNET_IDENTITY_Ego *ego, | ||
33 | void **ctx, | ||
34 | const char *identifier) | ||
32 | { | 35 | { |
33 | if ((!ego) || (!identifier)) | 36 | if ((!ego) || (!identifier)) |
34 | return; | 37 | return; |
@@ -41,7 +44,8 @@ callback_update_ego (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, con | |||
41 | } | 44 | } |
42 | 45 | ||
43 | void | 46 | void |
44 | init_ego_store(struct GNUNET_MESSENGER_EgoStore *store, const struct GNUNET_CONFIGURATION_Handle *config) | 47 | init_ego_store(struct GNUNET_MESSENGER_EgoStore *store, |
48 | const struct GNUNET_CONFIGURATION_Handle *config) | ||
45 | { | 49 | { |
46 | GNUNET_assert ((store) && (config)); | 50 | GNUNET_assert ((store) && (config)); |
47 | 51 | ||
@@ -58,7 +62,9 @@ init_ego_store(struct GNUNET_MESSENGER_EgoStore *store, const struct GNUNET_CONF | |||
58 | 62 | ||
59 | 63 | ||
60 | static int | 64 | static int |
61 | iterate_destroy_egos (void *cls, const struct GNUNET_HashCode *key, void *value) | 65 | iterate_destroy_egos (void *cls, |
66 | const struct GNUNET_HashCode *key, | ||
67 | void *value) | ||
62 | { | 68 | { |
63 | struct GNUNET_MESSENGER_Ego *ego = value; | 69 | struct GNUNET_MESSENGER_Ego *ego = value; |
64 | GNUNET_free(ego); | 70 | GNUNET_free(ego); |
@@ -112,7 +118,9 @@ clear_ego_store(struct GNUNET_MESSENGER_EgoStore *store) | |||
112 | } | 118 | } |
113 | 119 | ||
114 | static void | 120 | static void |
115 | callback_ego_create (void *cls, const struct GNUNET_IDENTITY_PrivateKey *key, const char *emsg) | 121 | callback_ego_create (void *cls, |
122 | const struct GNUNET_IDENTITY_PrivateKey *key, | ||
123 | const char *emsg) | ||
116 | { | 124 | { |
117 | struct GNUNET_MESSENGER_EgoOperation *element = cls; | 125 | struct GNUNET_MESSENGER_EgoOperation *element = cls; |
118 | struct GNUNET_MESSENGER_EgoStore *store = element->store; | 126 | struct GNUNET_MESSENGER_EgoStore *store = element->store; |
@@ -139,7 +147,8 @@ callback_ego_create (void *cls, const struct GNUNET_IDENTITY_PrivateKey *key, co | |||
139 | } | 147 | } |
140 | 148 | ||
141 | void | 149 | void |
142 | create_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, | 150 | create_store_ego (struct GNUNET_MESSENGER_EgoStore *store, |
151 | const char *identifier, | ||
143 | void *handle) | 152 | void *handle) |
144 | { | 153 | { |
145 | GNUNET_assert ((store) && (identifier)); | 154 | GNUNET_assert ((store) && (identifier)); |
@@ -158,7 +167,8 @@ create_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *identifie | |||
158 | } | 167 | } |
159 | 168 | ||
160 | static void | 169 | static void |
161 | callback_ego_lookup (void *cls, struct GNUNET_IDENTITY_Ego *ego) | 170 | callback_ego_lookup (void *cls, |
171 | struct GNUNET_IDENTITY_Ego *ego) | ||
162 | { | 172 | { |
163 | struct GNUNET_MESSENGER_EgoLookup *element = cls; | 173 | struct GNUNET_MESSENGER_EgoLookup *element = cls; |
164 | struct GNUNET_MESSENGER_EgoStore *store = element->store; | 174 | struct GNUNET_MESSENGER_EgoStore *store = element->store; |
@@ -183,8 +193,10 @@ callback_ego_lookup (void *cls, struct GNUNET_IDENTITY_Ego *ego) | |||
183 | } | 193 | } |
184 | 194 | ||
185 | void | 195 | void |
186 | lookup_store_ego(struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, | 196 | lookup_store_ego(struct GNUNET_MESSENGER_EgoStore *store, |
187 | GNUNET_MESSENGER_EgoLookupCallback lookup, void *cls) | 197 | const char *identifier, |
198 | GNUNET_MESSENGER_EgoLookupCallback lookup, | ||
199 | void *cls) | ||
188 | { | 200 | { |
189 | GNUNET_assert (store); | 201 | GNUNET_assert (store); |
190 | 202 | ||
@@ -219,7 +231,8 @@ lookup_store_ego(struct GNUNET_MESSENGER_EgoStore *store, const char *identifier | |||
219 | } | 231 | } |
220 | 232 | ||
221 | struct GNUNET_MESSENGER_Ego* | 233 | struct GNUNET_MESSENGER_Ego* |
222 | update_store_ego(struct GNUNET_MESSENGER_EgoStore *store, const char *identifier, | 234 | update_store_ego(struct GNUNET_MESSENGER_EgoStore *store, |
235 | const char *identifier, | ||
223 | const struct GNUNET_IDENTITY_PrivateKey *key) | 236 | const struct GNUNET_IDENTITY_PrivateKey *key) |
224 | { | 237 | { |
225 | GNUNET_assert ((store) && (identifier) && (key)); | 238 | GNUNET_assert ((store) && (identifier) && (key)); |
@@ -244,7 +257,8 @@ update_store_ego(struct GNUNET_MESSENGER_EgoStore *store, const char *identifier | |||
244 | } | 257 | } |
245 | 258 | ||
246 | static void | 259 | static void |
247 | callback_ego_rename (void *cls, const char *emsg) | 260 | callback_ego_rename (void *cls, |
261 | const char *emsg) | ||
248 | { | 262 | { |
249 | struct GNUNET_MESSENGER_EgoOperation *element = cls; | 263 | struct GNUNET_MESSENGER_EgoOperation *element = cls; |
250 | struct GNUNET_MESSENGER_EgoStore *store = element->store; | 264 | struct GNUNET_MESSENGER_EgoStore *store = element->store; |
@@ -277,7 +291,8 @@ callback_ego_rename (void *cls, const char *emsg) | |||
277 | } | 291 | } |
278 | 292 | ||
279 | void | 293 | void |
280 | rename_store_ego (struct GNUNET_MESSENGER_EgoStore *store, const char *old_identifier, | 294 | rename_store_ego (struct GNUNET_MESSENGER_EgoStore *store, |
295 | const char *old_identifier, | ||
281 | const char *new_identifier) | 296 | const char *new_identifier) |
282 | { | 297 | { |
283 | GNUNET_assert ((store) && (old_identifier) && (new_identifier)); | 298 | GNUNET_assert ((store) && (old_identifier) && (new_identifier)); |