diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-12-04 23:26:25 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-12-04 23:26:25 +0900 |
commit | 395bc9345a005a55e29a7882fdcc82f35c06d2e5 (patch) | |
tree | b111592f9f57025a19ddafe11877f6038263ae7f /src/fs/fs_namespace.c | |
parent | 3f0d91045d29435feef723f09f9ff75c80296d3d (diff) | |
download | gnunet-395bc9345a005a55e29a7882fdcc82f35c06d2e5.tar.gz gnunet-395bc9345a005a55e29a7882fdcc82f35c06d2e5.zip |
Large refactor in order to restore some sanity with respect to private defines used in headers
Diffstat (limited to 'src/fs/fs_namespace.c')
-rw-r--r-- | src/fs/fs_namespace.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c index bc94dd1fc..b3eeeb23c 100644 --- a/src/fs/fs_namespace.c +++ b/src/fs/fs_namespace.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "gnunet_constants.h" | 28 | #include "gnunet_constants.h" |
29 | #include "gnunet_signatures.h" | 29 | #include "gnunet_signatures.h" |
30 | #include "gnunet_util_lib.h" | 30 | #include "gnunet_util_lib.h" |
31 | #include "gnunet_extractor_compat.h" | ||
31 | #include "gnunet_fs_service.h" | 32 | #include "gnunet_fs_service.h" |
32 | #include "fs_api.h" | 33 | #include "fs_api.h" |
33 | #include "fs_publish_ublock.h" | 34 | #include "fs_publish_ublock.h" |
@@ -52,7 +53,7 @@ struct NamespaceUpdateNode | |||
52 | /** | 53 | /** |
53 | * Metadata for this entry. | 54 | * Metadata for this entry. |
54 | */ | 55 | */ |
55 | struct GNUNET_CONTAINER_MetaData *md; | 56 | struct GNUNET_FS_MetaData *md; |
56 | 57 | ||
57 | /** | 58 | /** |
58 | * URI of this entry in the namespace. | 59 | * URI of this entry in the namespace. |
@@ -167,7 +168,7 @@ free_update_information_graph (struct GNUNET_FS_UpdateInformationGraph *uig) | |||
167 | for (i = 0; i < uig->update_node_count; i++) | 168 | for (i = 0; i < uig->update_node_count; i++) |
168 | { | 169 | { |
169 | nsn = uig->update_nodes[i]; | 170 | nsn = uig->update_nodes[i]; |
170 | GNUNET_CONTAINER_meta_data_destroy (nsn->md); | 171 | GNUNET_FS_meta_data_destroy (nsn->md); |
171 | GNUNET_FS_uri_destroy (nsn->uri); | 172 | GNUNET_FS_uri_destroy (nsn->uri); |
172 | GNUNET_free (nsn->id); | 173 | GNUNET_free (nsn->id); |
173 | GNUNET_free (nsn->update); | 174 | GNUNET_free (nsn->update); |
@@ -215,7 +216,7 @@ write_update_information_graph (struct GNUNET_FS_UpdateInformationGraph *uig) | |||
215 | uris = GNUNET_FS_uri_to_string (n->uri); | 216 | uris = GNUNET_FS_uri_to_string (n->uri); |
216 | struct GNUNET_BIO_WriteSpec ws[] = { | 217 | struct GNUNET_BIO_WriteSpec ws[] = { |
217 | GNUNET_BIO_write_spec_string ("fs-namespace-node-id", n->id), | 218 | GNUNET_BIO_write_spec_string ("fs-namespace-node-id", n->id), |
218 | GNUNET_BIO_write_spec_meta_data ("fs-namespace-node-meta", n->md), | 219 | GNUNET_FS_write_spec_meta_data ("fs-namespace-node-meta", n->md), |
219 | GNUNET_BIO_write_spec_string ("fs-namespace-node-update", n->update), | 220 | GNUNET_BIO_write_spec_string ("fs-namespace-node-update", n->update), |
220 | GNUNET_BIO_write_spec_string ("fs-namespace-uris", uris), | 221 | GNUNET_BIO_write_spec_string ("fs-namespace-uris", uris), |
221 | GNUNET_BIO_write_spec_end (), | 222 | GNUNET_BIO_write_spec_end (), |
@@ -227,7 +228,7 @@ write_update_information_graph (struct GNUNET_FS_UpdateInformationGraph *uig) | |||
227 | } | 228 | } |
228 | GNUNET_free (uris); | 229 | GNUNET_free (uris); |
229 | } | 230 | } |
230 | END: | 231 | END: |
231 | if (GNUNET_OK != GNUNET_BIO_write_close (wh, NULL)) | 232 | if (GNUNET_OK != GNUNET_BIO_write_close (wh, NULL)) |
232 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 233 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
233 | _ ("Failed to write `%s': %s\n"), | 234 | _ ("Failed to write `%s': %s\n"), |
@@ -293,7 +294,7 @@ read_update_information_graph (struct GNUNET_FS_Handle *h, | |||
293 | n = GNUNET_new (struct NamespaceUpdateNode); | 294 | n = GNUNET_new (struct NamespaceUpdateNode); |
294 | struct GNUNET_BIO_ReadSpec rs[] = { | 295 | struct GNUNET_BIO_ReadSpec rs[] = { |
295 | GNUNET_BIO_read_spec_string ("identifier", &n->id, 1024), | 296 | GNUNET_BIO_read_spec_string ("identifier", &n->id, 1024), |
296 | GNUNET_BIO_read_spec_meta_data ("meta", &n->md), | 297 | GNUNET_FS_read_spec_meta_data ("meta", &n->md), |
297 | GNUNET_BIO_read_spec_string ("update-id", &n->update, 1024), | 298 | GNUNET_BIO_read_spec_string ("update-id", &n->update, 1024), |
298 | GNUNET_BIO_read_spec_string ("uri", &uris, 1024 * 2), | 299 | GNUNET_BIO_read_spec_string ("uri", &uris, 1024 * 2), |
299 | GNUNET_BIO_read_spec_end (), | 300 | GNUNET_BIO_read_spec_end (), |
@@ -304,7 +305,7 @@ read_update_information_graph (struct GNUNET_FS_Handle *h, | |||
304 | GNUNET_free (n->id); | 305 | GNUNET_free (n->id); |
305 | GNUNET_free (n->update); | 306 | GNUNET_free (n->update); |
306 | if (n->md != NULL) | 307 | if (n->md != NULL) |
307 | GNUNET_CONTAINER_meta_data_destroy (n->md); | 308 | GNUNET_FS_meta_data_destroy (n->md); |
308 | GNUNET_free (n); | 309 | GNUNET_free (n); |
309 | break; | 310 | break; |
310 | } | 311 | } |
@@ -316,14 +317,14 @@ read_update_information_graph (struct GNUNET_FS_Handle *h, | |||
316 | GNUNET_free (emsg); | 317 | GNUNET_free (emsg); |
317 | GNUNET_free (n->id); | 318 | GNUNET_free (n->id); |
318 | GNUNET_free (n->update); | 319 | GNUNET_free (n->update); |
319 | GNUNET_CONTAINER_meta_data_destroy (n->md); | 320 | GNUNET_FS_meta_data_destroy (n->md); |
320 | GNUNET_free (n); | 321 | GNUNET_free (n); |
321 | break; | 322 | break; |
322 | } | 323 | } |
323 | uig->update_nodes[i] = n; | 324 | uig->update_nodes[i] = n; |
324 | } | 325 | } |
325 | uig->update_node_count = i; | 326 | uig->update_node_count = i; |
326 | END: | 327 | END: |
327 | if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) | 328 | if (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)) |
328 | { | 329 | { |
329 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 330 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -428,7 +429,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
428 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, | 429 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, |
429 | const char *identifier, | 430 | const char *identifier, |
430 | const char *update, | 431 | const char *update, |
431 | const struct GNUNET_CONTAINER_MetaData *meta, | 432 | const struct GNUNET_FS_MetaData *meta, |
432 | const struct GNUNET_FS_Uri *uri, | 433 | const struct GNUNET_FS_Uri *uri, |
433 | const struct GNUNET_FS_BlockOptions *bo, | 434 | const struct GNUNET_FS_BlockOptions *bo, |
434 | enum GNUNET_FS_PublishOptions options, | 435 | enum GNUNET_FS_PublishOptions options, |
@@ -463,7 +464,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
463 | psc->nsn = GNUNET_new (struct NamespaceUpdateNode); | 464 | psc->nsn = GNUNET_new (struct NamespaceUpdateNode); |
464 | psc->nsn->id = GNUNET_strdup (identifier); | 465 | psc->nsn->id = GNUNET_strdup (identifier); |
465 | psc->nsn->update = GNUNET_strdup (update); | 466 | psc->nsn->update = GNUNET_strdup (update); |
466 | psc->nsn->md = GNUNET_CONTAINER_meta_data_duplicate (meta); | 467 | psc->nsn->md = GNUNET_FS_meta_data_duplicate (meta); |
467 | psc->nsn->uri = GNUNET_FS_uri_dup (uri); | 468 | psc->nsn->uri = GNUNET_FS_uri_dup (uri); |
468 | } | 469 | } |
469 | psc->uc = GNUNET_FS_publish_ublock_ (h, | 470 | psc->uc = GNUNET_FS_publish_ublock_ (h, |
@@ -502,7 +503,7 @@ GNUNET_FS_publish_sks_cancel (struct GNUNET_FS_PublishSksContext *psc) | |||
502 | GNUNET_FS_uri_destroy (psc->uri); | 503 | GNUNET_FS_uri_destroy (psc->uri); |
503 | if (NULL != psc->nsn) | 504 | if (NULL != psc->nsn) |
504 | { | 505 | { |
505 | GNUNET_CONTAINER_meta_data_destroy (psc->nsn->md); | 506 | GNUNET_FS_meta_data_destroy (psc->nsn->md); |
506 | GNUNET_FS_uri_destroy (psc->nsn->uri); | 507 | GNUNET_FS_uri_destroy (psc->nsn->uri); |
507 | GNUNET_free (psc->nsn->id); | 508 | GNUNET_free (psc->nsn->id); |
508 | GNUNET_free (psc->nsn->update); | 509 | GNUNET_free (psc->nsn->update); |