aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-09-10 22:17:19 +0000
committerChristian Grothoff <christian@grothoff.org>2012-09-10 22:17:19 +0000
commit7dc9c567366b73f192eaf4eab4570e6119e07000 (patch)
tree03b0db913f12dfa0e575ff5d735902360e0df3b7 /src/fs
parentd0e3840931750ca4bf4848d950ab9a0c0b5022bc (diff)
downloadgnunet-7dc9c567366b73f192eaf4eab4570e6119e07000.tar.gz
gnunet-7dc9c567366b73f192eaf4eab4570e6119e07000.zip
eliminating use of 'namespace' as a fieldname / variable name to be C++ compatible
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_api.c6
-rw-r--r--src/fs/fs_api.h4
-rw-r--r--src/fs/fs_namespace.c106
-rw-r--r--src/fs/fs_publish.c20
-rw-r--r--src/fs/fs_search.c8
-rw-r--r--src/fs/fs_uri.c28
6 files changed, 86 insertions, 86 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index bdde163ae..d6a434e6e 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -1538,8 +1538,8 @@ deserialize_publish_file (void *cls, const char *filename)
1538 } 1538 }
1539 if (NULL != ns) 1539 if (NULL != ns)
1540 { 1540 {
1541 pc->namespace = GNUNET_FS_namespace_create (h, ns); 1541 pc->ns = GNUNET_FS_namespace_create (h, ns);
1542 if (NULL == pc->namespace) 1542 if (NULL == pc->ns)
1543 { 1543 {
1544 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1544 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1545 _ 1545 _
@@ -1658,7 +1658,7 @@ GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc)
1658 (NULL == pc->fi_pos) ? NULL : pc->fi_pos->serialization)) || 1658 (NULL == pc->fi_pos) ? NULL : pc->fi_pos->serialization)) ||
1659 (GNUNET_OK != 1659 (GNUNET_OK !=
1660 GNUNET_BIO_write_string (wh, 1660 GNUNET_BIO_write_string (wh,
1661 (NULL == pc->namespace) ? NULL : pc->namespace->name))) 1661 (NULL == pc->ns) ? NULL : pc->ns->name)))
1662 { 1662 {
1663 GNUNET_break (0); 1663 GNUNET_break (0);
1664 goto cleanup; 1664 goto cleanup;
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index 7c91b5d23..9325c6023 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -205,7 +205,7 @@ struct GNUNET_FS_Uri
205 /** 205 /**
206 * Hash of the public key for the namespace. 206 * Hash of the public key for the namespace.
207 */ 207 */
208 struct GNUNET_HashCode namespace; 208 struct GNUNET_HashCode ns;
209 209
210 /** 210 /**
211 * Human-readable identifier chosen for this 211 * Human-readable identifier chosen for this
@@ -1159,7 +1159,7 @@ struct GNUNET_FS_PublishContext
1159 /** 1159 /**
1160 * Namespace that we are publishing in, NULL if we have no namespace. 1160 * Namespace that we are publishing in, NULL if we have no namespace.
1161 */ 1161 */
1162 struct GNUNET_FS_Namespace *namespace; 1162 struct GNUNET_FS_Namespace *ns;
1163 1163
1164 /** 1164 /**
1165 * ID of the content in the namespace, NULL if we have no namespace. 1165 * ID of the content in the namespace, NULL if we have no namespace.
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c
index 0c7b445ad..29cef7472 100644
--- a/src/fs/fs_namespace.c
+++ b/src/fs/fs_namespace.c
@@ -282,44 +282,44 @@ GNUNET_FS_namespace_dup (struct GNUNET_FS_Namespace *ns)
282 * memory) or also to freeze the namespace to prevent further 282 * memory) or also to freeze the namespace to prevent further
283 * insertions by anyone. 283 * insertions by anyone.
284 * 284 *
285 * @param namespace handle to the namespace that should be deleted / freed 285 * @param ns handle to the namespace that should be deleted / freed
286 * @param freeze prevents future insertions; creating a namespace 286 * @param freeze prevents future insertions; creating a namespace
287 * with the same name again will create a fresh namespace instead 287 * with the same name again will create a fresh namespace instead
288 * 288 *
289 * @return GNUNET_OK on success, GNUNET_SYSERR on error 289 * @return GNUNET_OK on success, GNUNET_SYSERR on error
290 */ 290 */
291int 291int
292GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze) 292GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *ns, int freeze)
293{ 293{
294 unsigned int i; 294 unsigned int i;
295 struct NamespaceUpdateNode *nsn; 295 struct NamespaceUpdateNode *nsn;
296 296
297 namespace->rc--; 297 ns->rc--;
298 if (freeze) 298 if (freeze)
299 { 299 {
300 if (0 != UNLINK (namespace->filename)) 300 if (0 != UNLINK (ns->filename))
301 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "unlink", 301 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "unlink",
302 namespace->filename); 302 ns->filename);
303 } 303 }
304 if (0 != namespace->rc) 304 if (0 != ns->rc)
305 return GNUNET_OK; 305 return GNUNET_OK;
306 GNUNET_CRYPTO_rsa_key_free (namespace->key); 306 GNUNET_CRYPTO_rsa_key_free (ns->key);
307 GNUNET_free (namespace->filename); 307 GNUNET_free (ns->filename);
308 GNUNET_free (namespace->name); 308 GNUNET_free (ns->name);
309 for (i = 0; i < namespace->update_node_count; i++) 309 for (i = 0; i < ns->update_node_count; i++)
310 { 310 {
311 nsn = namespace->update_nodes[i]; 311 nsn = ns->update_nodes[i];
312 GNUNET_CONTAINER_meta_data_destroy (nsn->md); 312 GNUNET_CONTAINER_meta_data_destroy (nsn->md);
313 GNUNET_FS_uri_destroy (nsn->uri); 313 GNUNET_FS_uri_destroy (nsn->uri);
314 GNUNET_free (nsn->id); 314 GNUNET_free (nsn->id);
315 GNUNET_free (nsn->update); 315 GNUNET_free (nsn->update);
316 GNUNET_free (nsn); 316 GNUNET_free (nsn);
317 } 317 }
318 GNUNET_array_grow (namespace->update_nodes, namespace->update_node_count, 318 GNUNET_array_grow (ns->update_nodes, ns->update_node_count,
319 0); 319 0);
320 if (namespace->update_map != NULL) 320 if (ns->update_map != NULL)
321 GNUNET_CONTAINER_multihashmap_destroy (namespace->update_map); 321 GNUNET_CONTAINER_multihashmap_destroy (ns->update_map);
322 GNUNET_free (namespace); 322 GNUNET_free (ns);
323 return GNUNET_OK; 323 return GNUNET_OK;
324} 324}
325 325
@@ -429,7 +429,7 @@ struct GNUNET_FS_PublishSksContext
429 /** 429 /**
430 * Namespace we're publishing to. 430 * Namespace we're publishing to.
431 */ 431 */
432 struct GNUNET_FS_Namespace *namespace; 432 struct GNUNET_FS_Namespace *ns;
433 433
434 /** 434 /**
435 * Handle to the datastore. 435 * Handle to the datastore.
@@ -483,19 +483,19 @@ sb_put_cont (void *cls, int success,
483 /* FIXME: this can be done much more 483 /* FIXME: this can be done much more
484 * efficiently by simply appending to the 484 * efficiently by simply appending to the
485 * file and overwriting the 4-byte header */ 485 * file and overwriting the 4-byte header */
486 if (psc->namespace->update_nodes == NULL) 486 if (psc->ns->update_nodes == NULL)
487 read_update_information_graph (psc->namespace); 487 read_update_information_graph (psc->ns);
488 GNUNET_array_append (psc->namespace->update_nodes, 488 GNUNET_array_append (psc->ns->update_nodes,
489 psc->namespace->update_node_count, psc->nsn); 489 psc->ns->update_node_count, psc->nsn);
490 if (psc->namespace->update_map != NULL) 490 if (psc->ns->update_map != NULL)
491 { 491 {
492 GNUNET_CRYPTO_hash (psc->nsn->id, strlen (psc->nsn->id), &hc); 492 GNUNET_CRYPTO_hash (psc->nsn->id, strlen (psc->nsn->id), &hc);
493 GNUNET_CONTAINER_multihashmap_put (psc->namespace->update_map, &hc, 493 GNUNET_CONTAINER_multihashmap_put (psc->ns->update_map, &hc,
494 psc->nsn, 494 psc->nsn,
495 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 495 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
496 } 496 }
497 psc->nsn = NULL; 497 psc->nsn = NULL;
498 write_update_information_graph (psc->namespace); 498 write_update_information_graph (psc->ns);
499 } 499 }
500 if (NULL != psc->cont) 500 if (NULL != psc->cont)
501 psc->cont (psc->cont_cls, psc->uri, NULL); 501 psc->cont (psc->cont_cls, psc->uri, NULL);
@@ -507,7 +507,7 @@ sb_put_cont (void *cls, int success,
507 * Publish an SBlock on GNUnet. 507 * Publish an SBlock on GNUnet.
508 * 508 *
509 * @param h handle to the file sharing subsystem 509 * @param h handle to the file sharing subsystem
510 * @param namespace namespace to publish in 510 * @param ns namespace to publish in
511 * @param identifier identifier to use 511 * @param identifier identifier to use
512 * @param update update identifier to use 512 * @param update update identifier to use
513 * @param meta metadata to use 513 * @param meta metadata to use
@@ -520,7 +520,7 @@ sb_put_cont (void *cls, int success,
520 */ 520 */
521struct GNUNET_FS_PublishSksContext * 521struct GNUNET_FS_PublishSksContext *
522GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, 522GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
523 struct GNUNET_FS_Namespace *namespace, 523 struct GNUNET_FS_Namespace *ns,
524 const char *identifier, const char *update, 524 const char *identifier, const char *update,
525 const struct GNUNET_CONTAINER_MetaData *meta, 525 const struct GNUNET_CONTAINER_MetaData *meta,
526 const struct GNUNET_FS_Uri *uri, 526 const struct GNUNET_FS_Uri *uri,
@@ -592,12 +592,12 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
592 GNUNET_CRYPTO_hash (&key, sizeof (struct GNUNET_HashCode), &id); 592 GNUNET_CRYPTO_hash (&key, sizeof (struct GNUNET_HashCode), &id);
593 sks_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 593 sks_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
594 sks_uri->type = sks; 594 sks_uri->type = sks;
595 GNUNET_CRYPTO_rsa_key_get_public (namespace->key, &sb_enc->subspace); 595 GNUNET_CRYPTO_rsa_key_get_public (ns->key, &sb_enc->subspace);
596 GNUNET_CRYPTO_hash (&sb_enc->subspace, 596 GNUNET_CRYPTO_hash (&sb_enc->subspace,
597 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 597 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
598 &sks_uri->data.sks.namespace); 598 &sks_uri->data.sks.ns);
599 sks_uri->data.sks.identifier = GNUNET_strdup (identifier); 599 sks_uri->data.sks.identifier = GNUNET_strdup (identifier);
600 GNUNET_CRYPTO_hash_xor (&id, &sks_uri->data.sks.namespace, 600 GNUNET_CRYPTO_hash_xor (&id, &sks_uri->data.sks.ns,
601 &sb_enc->identifier); 601 &sb_enc->identifier);
602 GNUNET_CRYPTO_hash_to_aes_key (&key, &sk, &iv); 602 GNUNET_CRYPTO_hash_to_aes_key (&key, &sk, &iv);
603 GNUNET_CRYPTO_aes_encrypt (&sb[1], size - sizeof (struct SBlock), &sk, &iv, 603 GNUNET_CRYPTO_aes_encrypt (&sb[1], size - sizeof (struct SBlock), &sk, &iv,
@@ -607,12 +607,12 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
607 htonl (slen + mdsize + nidlen + sizeof (struct SBlock) - 607 htonl (slen + mdsize + nidlen + sizeof (struct SBlock) -
608 sizeof (struct GNUNET_CRYPTO_RsaSignature)); 608 sizeof (struct GNUNET_CRYPTO_RsaSignature));
609 GNUNET_assert (GNUNET_OK == 609 GNUNET_assert (GNUNET_OK ==
610 GNUNET_CRYPTO_rsa_sign (namespace->key, &sb_enc->purpose, 610 GNUNET_CRYPTO_rsa_sign (ns->key, &sb_enc->purpose,
611 &sb_enc->signature)); 611 &sb_enc->signature));
612 psc = GNUNET_malloc (sizeof (struct GNUNET_FS_PublishSksContext)); 612 psc = GNUNET_malloc (sizeof (struct GNUNET_FS_PublishSksContext));
613 psc->uri = sks_uri; 613 psc->uri = sks_uri;
614 psc->cont = cont; 614 psc->cont = cont;
615 psc->namespace = GNUNET_FS_namespace_dup (namespace); 615 psc->ns = GNUNET_FS_namespace_dup (ns);
616 psc->cont_cls = cont_cls; 616 psc->cont_cls = cont_cls;
617 if (0 != (options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) 617 if (0 != (options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY))
618 { 618 {
@@ -629,7 +629,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
629 sb_put_cont (psc, GNUNET_NO, GNUNET_TIME_UNIT_ZERO_ABS, _("Failed to connect to datastore.")); 629 sb_put_cont (psc, GNUNET_NO, GNUNET_TIME_UNIT_ZERO_ABS, _("Failed to connect to datastore."));
630 return NULL; 630 return NULL;
631 } 631 }
632 GNUNET_CRYPTO_hash_xor (&sks_uri->data.sks.namespace, &id, &query); 632 GNUNET_CRYPTO_hash_xor (&sks_uri->data.sks.ns, &id, &query);
633 if (NULL != update) 633 if (NULL != update)
634 { 634 {
635 psc->nsn = GNUNET_malloc (sizeof (struct NamespaceUpdateNode)); 635 psc->nsn = GNUNET_malloc (sizeof (struct NamespaceUpdateNode));
@@ -667,7 +667,7 @@ GNUNET_FS_publish_sks_cancel (struct GNUNET_FS_PublishSksContext *psc)
667 GNUNET_DATASTORE_disconnect (psc->dsh, GNUNET_NO); 667 GNUNET_DATASTORE_disconnect (psc->dsh, GNUNET_NO);
668 psc->dsh = NULL; 668 psc->dsh = NULL;
669 } 669 }
670 GNUNET_FS_namespace_delete (psc->namespace, GNUNET_NO); 670 GNUNET_FS_namespace_delete (psc->ns, GNUNET_NO);
671 GNUNET_FS_uri_destroy (psc->uri); 671 GNUNET_FS_uri_destroy (psc->uri);
672 if (NULL != psc->nsn) 672 if (NULL != psc->nsn)
673 { 673 {
@@ -727,7 +727,7 @@ struct FindTreeClosure
727 /** 727 /**
728 * Namespace we are operating on. 728 * Namespace we are operating on.
729 */ 729 */
730 struct GNUNET_FS_Namespace *namespace; 730 struct GNUNET_FS_Namespace *ns;
731 731
732 /** 732 /**
733 * Array with 'head's of TREEs. 733 * Array with 'head's of TREEs.
@@ -799,7 +799,7 @@ find_trees (void *cls, const struct GNUNET_HashCode * key, void *value)
799 nsn->tree_id = UINT_MAX; /* mark as undef */ 799 nsn->tree_id = UINT_MAX; /* mark as undef */
800 /* trace */ 800 /* trace */
801 GNUNET_CRYPTO_hash (nsn->update, strlen (nsn->update), &hc); 801 GNUNET_CRYPTO_hash (nsn->update, strlen (nsn->update), &hc);
802 GNUNET_CONTAINER_multihashmap_get_multiple (fc->namespace->update_map, &hc, 802 GNUNET_CONTAINER_multihashmap_get_multiple (fc->ns->update_map, &hc,
803 &find_trees, fc); 803 &find_trees, fc);
804 } 804 }
805 return GNUNET_YES; 805 return GNUNET_YES;
@@ -823,13 +823,13 @@ find_trees (void *cls, const struct GNUNET_HashCode * key, void *value)
823 * I know, odd definition of a tree, but the GUI will display an actual 823 * I know, odd definition of a tree, but the GUI will display an actual
824 * tree (GtkTreeView), so that's what counts for the term here. 824 * tree (GtkTreeView), so that's what counts for the term here.
825 * 825 *
826 * @param namespace namespace to inspect for updateable content 826 * @param ns namespace to inspect for updateable content
827 * @param next_id ID to look for; use NULL to look for tree roots 827 * @param next_id ID to look for; use NULL to look for tree roots
828 * @param ip function to call on each updateable identifier 828 * @param ip function to call on each updateable identifier
829 * @param ip_cls closure for ip 829 * @param ip_cls closure for ip
830 */ 830 */
831void 831void
832GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, 832GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *ns,
833 const char *next_id, 833 const char *next_id,
834 GNUNET_FS_IdentifierProcessor ip, 834 GNUNET_FS_IdentifierProcessor ip,
835 void *ip_cls) 835 void *ip_cls)
@@ -841,26 +841,26 @@ GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace,
841 struct ProcessUpdateClosure pc; 841 struct ProcessUpdateClosure pc;
842 struct FindTreeClosure fc; 842 struct FindTreeClosure fc;
843 843
844 if (NULL == namespace->update_nodes) 844 if (NULL == ns->update_nodes)
845 read_update_information_graph (namespace); 845 read_update_information_graph (ns);
846 if (NULL == namespace->update_nodes) 846 if (NULL == ns->update_nodes)
847 { 847 {
848 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 848 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
849 "No updateable nodes found for ID `%s'\n", next_id); 849 "No updateable nodes found for ID `%s'\n", next_id);
850 return; /* no nodes */ 850 return; /* no nodes */
851 } 851 }
852 if (NULL == namespace->update_map) 852 if (NULL == ns->update_map)
853 { 853 {
854 /* need to construct */ 854 /* need to construct */
855 namespace->update_map = 855 ns->update_map =
856 GNUNET_CONTAINER_multihashmap_create (2 + 856 GNUNET_CONTAINER_multihashmap_create (2 +
857 3 * namespace->update_node_count / 857 3 * ns->update_node_count /
858 4); 858 4);
859 for (i = 0; i < namespace->update_node_count; i++) 859 for (i = 0; i < ns->update_node_count; i++)
860 { 860 {
861 nsn = namespace->update_nodes[i]; 861 nsn = ns->update_nodes[i];
862 GNUNET_CRYPTO_hash (nsn->id, strlen (nsn->id), &hc); 862 GNUNET_CRYPTO_hash (nsn->id, strlen (nsn->id), &hc);
863 GNUNET_CONTAINER_multihashmap_put (namespace->update_map, &hc, nsn, 863 GNUNET_CONTAINER_multihashmap_put (ns->update_map, &hc, nsn,
864 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 864 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
865 } 865 }
866 } 866 }
@@ -869,20 +869,20 @@ GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace,
869 GNUNET_CRYPTO_hash (next_id, strlen (next_id), &hc); 869 GNUNET_CRYPTO_hash (next_id, strlen (next_id), &hc);
870 pc.ip = ip; 870 pc.ip = ip;
871 pc.ip_cls = ip_cls; 871 pc.ip_cls = ip_cls;
872 GNUNET_CONTAINER_multihashmap_get_multiple (namespace->update_map, &hc, 872 GNUNET_CONTAINER_multihashmap_get_multiple (ns->update_map, &hc,
873 &process_update_node, &pc); 873 &process_update_node, &pc);
874 return; 874 return;
875 } 875 }
876 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 876 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
877 "Calculating TREEs to find roots of update trees\n"); 877 "Calculating TREEs to find roots of update trees\n");
878 /* Find heads of TREEs in update graph */ 878 /* Find heads of TREEs in update graph */
879 nug = ++namespace->nug_gen; 879 nug = ++ns->nug_gen;
880 fc.tree_array = NULL; 880 fc.tree_array = NULL;
881 fc.tree_array_size = 0; 881 fc.tree_array_size = 0;
882 882
883 for (i = 0; i < namespace->update_node_count; i++) 883 for (i = 0; i < ns->update_node_count; i++)
884 { 884 {
885 nsn = namespace->update_nodes[i]; 885 nsn = ns->update_nodes[i];
886 if (nsn->nug == nug) 886 if (nsn->nug == nug)
887 { 887 {
888 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TREE of node `%s' is %u\n", nsn->id, 888 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TREE of node `%s' is %u\n", nsn->id,
@@ -894,8 +894,8 @@ GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace,
894 nsn->tree_id = UINT_MAX; 894 nsn->tree_id = UINT_MAX;
895 fc.id = UINT_MAX; 895 fc.id = UINT_MAX;
896 fc.nug = nug; 896 fc.nug = nug;
897 fc.namespace = namespace; 897 fc.ns = ns;
898 GNUNET_CONTAINER_multihashmap_get_multiple (namespace->update_map, &hc, 898 GNUNET_CONTAINER_multihashmap_get_multiple (ns->update_map, &hc,
899 &find_trees, &fc); 899 &find_trees, &fc);
900 if (UINT_MAX == fc.id) 900 if (UINT_MAX == fc.id)
901 { 901 {
@@ -921,8 +921,8 @@ GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace,
921 GNUNET_CRYPTO_hash (nsn->id, strlen (nsn->id), &hc); 921 GNUNET_CRYPTO_hash (nsn->id, strlen (nsn->id), &hc);
922 fc.id = nsn->tree_id; 922 fc.id = nsn->tree_id;
923 fc.nug = nug; 923 fc.nug = nug;
924 fc.namespace = namespace; 924 fc.ns = ns;
925 GNUNET_CONTAINER_multihashmap_get_multiple (namespace->update_map, &hc, 925 GNUNET_CONTAINER_multihashmap_get_multiple (ns->update_map, &hc,
926 &find_trees, &fc); 926 &find_trees, &fc);
927 } 927 }
928 else 928 else
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 6f8a9d248..30ab1ee6f 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -83,10 +83,10 @@ publish_cleanup (struct GNUNET_FS_PublishContext *pc)
83 pc->fhc = NULL; 83 pc->fhc = NULL;
84 } 84 }
85 GNUNET_FS_file_information_destroy (pc->fi, NULL, NULL); 85 GNUNET_FS_file_information_destroy (pc->fi, NULL, NULL);
86 if (pc->namespace != NULL) 86 if (pc->ns != NULL)
87 { 87 {
88 GNUNET_FS_namespace_delete (pc->namespace, GNUNET_NO); 88 GNUNET_FS_namespace_delete (pc->ns, GNUNET_NO);
89 pc->namespace = NULL; 89 pc->ns = NULL;
90 } 90 }
91 GNUNET_free_non_null (pc->nid); 91 GNUNET_free_non_null (pc->nid);
92 GNUNET_free_non_null (pc->nuid); 92 GNUNET_free_non_null (pc->nuid);
@@ -269,8 +269,8 @@ publish_sblocks_cont (void *cls, const struct GNUNET_FS_Uri *uri,
269static void 269static void
270publish_sblock (struct GNUNET_FS_PublishContext *pc) 270publish_sblock (struct GNUNET_FS_PublishContext *pc)
271{ 271{
272 if (NULL != pc->namespace) 272 if (NULL != pc->ns)
273 pc->sks_pc = GNUNET_FS_publish_sks (pc->h, pc->namespace, pc->nid, pc->nuid, 273 pc->sks_pc = GNUNET_FS_publish_sks (pc->h, pc->ns, pc->nid, pc->nuid,
274 pc->fi->meta, pc->fi->chk_uri, &pc->fi->bo, 274 pc->fi->meta, pc->fi->chk_uri, &pc->fi->bo,
275 pc->options, &publish_sblocks_cont, pc); 275 pc->options, &publish_sblocks_cont, pc);
276 else 276 else
@@ -1105,7 +1105,7 @@ finish_reserve (void *cls, int success,
1105 * 1105 *
1106 * @param h handle to the file sharing subsystem 1106 * @param h handle to the file sharing subsystem
1107 * @param fi information about the file or directory structure to publish 1107 * @param fi information about the file or directory structure to publish
1108 * @param namespace namespace to publish the file in, NULL for no namespace 1108 * @param ns namespace to publish the file in, NULL for no namespace
1109 * @param nid identifier to use for the publishd content in the namespace 1109 * @param nid identifier to use for the publishd content in the namespace
1110 * (can be NULL, must be NULL if namespace is NULL) 1110 * (can be NULL, must be NULL if namespace is NULL)
1111 * @param nuid update-identifier that will be used for future updates 1111 * @param nuid update-identifier that will be used for future updates
@@ -1116,7 +1116,7 @@ finish_reserve (void *cls, int success,
1116struct GNUNET_FS_PublishContext * 1116struct GNUNET_FS_PublishContext *
1117GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, 1117GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
1118 struct GNUNET_FS_FileInformation *fi, 1118 struct GNUNET_FS_FileInformation *fi,
1119 struct GNUNET_FS_Namespace *namespace, const char *nid, 1119 struct GNUNET_FS_Namespace *ns, const char *nid,
1120 const char *nuid, 1120 const char *nuid,
1121 enum GNUNET_FS_PublishOptions options) 1121 enum GNUNET_FS_PublishOptions options)
1122{ 1122{
@@ -1138,11 +1138,11 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
1138 ret->dsh = dsh; 1138 ret->dsh = dsh;
1139 ret->h = h; 1139 ret->h = h;
1140 ret->fi = fi; 1140 ret->fi = fi;
1141 ret->namespace = namespace; 1141 ret->ns = ns;
1142 ret->options = options; 1142 ret->options = options;
1143 if (namespace != NULL) 1143 if (ns != NULL)
1144 { 1144 {
1145 namespace->rc++; 1145 ns->rc++;
1146 GNUNET_assert (NULL != nid); 1146 GNUNET_assert (NULL != nid);
1147 ret->nid = GNUNET_strdup (nid); 1147 ret->nid = GNUNET_strdup (nid);
1148 if (NULL != nuid) 1148 if (NULL != nuid)
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index bef623287..3b28c9a58 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -505,7 +505,7 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, const char *id_update,
505 if (0 == strlen (id_update)) 505 if (0 == strlen (id_update))
506 return; /* no updates */ 506 return; /* no updates */
507 uu.type = sks; 507 uu.type = sks;
508 uu.data.sks.namespace = sc->uri->data.sks.namespace; 508 uu.data.sks.ns = sc->uri->data.sks.ns;
509 uu.data.sks.identifier = GNUNET_strdup (id_update); 509 uu.data.sks.identifier = GNUNET_strdup (id_update);
510 (void) search_start (sc->h, &uu, sc->anonymity, sc->options, NULL, sr); 510 (void) search_start (sc->h, &uu, sc->anonymity, sc->options, NULL, sr);
511 GNUNET_free (uu.data.sks.identifier); 511 GNUNET_free (uu.data.sks.identifier);
@@ -671,13 +671,13 @@ process_nblock (struct GNUNET_FS_SearchContext *sc, const struct NBlock *nb,
671 uri->data.sks.identifier = GNUNET_strdup (pt); 671 uri->data.sks.identifier = GNUNET_strdup (pt);
672 GNUNET_CRYPTO_hash (&nb->subspace, 672 GNUNET_CRYPTO_hash (&nb->subspace,
673 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 673 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
674 &uri->data.sks.namespace); 674 &uri->data.sks.ns);
675 uris = GNUNET_FS_uri_to_string (uri); 675 uris = GNUNET_FS_uri_to_string (uri);
676 GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>", EXTRACTOR_METATYPE_URI, 676 GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>", EXTRACTOR_METATYPE_URI,
677 EXTRACTOR_METAFORMAT_UTF8, "text/plain", 677 EXTRACTOR_METAFORMAT_UTF8, "text/plain",
678 uris, strlen (uris) + 1); 678 uris, strlen (uris) + 1);
679 GNUNET_free (uris); 679 GNUNET_free (uris);
680 GNUNET_PSEUDONYM_add (sc->h->cfg, &uri->data.sks.namespace, meta); 680 GNUNET_PSEUDONYM_add (sc->h->cfg, &uri->data.sks.ns, meta);
681 /* process */ 681 /* process */
682 process_ksk_result (sc, &sc->requests[i], uri, meta); 682 process_ksk_result (sc, &sc->requests[i], uri, meta);
683 683
@@ -1058,7 +1058,7 @@ transmit_search_request (void *cls, size_t size, void *buf)
1058 GNUNET_assert (size >= msize); 1058 GNUNET_assert (size >= msize);
1059 sm->type = htonl (GNUNET_BLOCK_TYPE_FS_SBLOCK); 1059 sm->type = htonl (GNUNET_BLOCK_TYPE_FS_SBLOCK);
1060 sm->anonymity_level = htonl (sc->anonymity); 1060 sm->anonymity_level = htonl (sc->anonymity);
1061 sm->target = sc->uri->data.sks.namespace; 1061 sm->target = sc->uri->data.sks.ns;
1062 identifier = sc->uri->data.sks.identifier; 1062 identifier = sc->uri->data.sks.identifier;
1063 GNUNET_CRYPTO_hash (identifier, strlen (identifier), &key); 1063 GNUNET_CRYPTO_hash (identifier, strlen (identifier), &key);
1064 GNUNET_CRYPTO_hash (&key, sizeof (struct GNUNET_HashCode), &idh); 1064 GNUNET_CRYPTO_hash (&key, sizeof (struct GNUNET_HashCode), &idh);
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index d25c3a2e0..ad21692c9 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -355,7 +355,7 @@ static struct GNUNET_FS_Uri *
355uri_sks_parse (const char *s, char **emsg) 355uri_sks_parse (const char *s, char **emsg)
356{ 356{
357 struct GNUNET_FS_Uri *ret; 357 struct GNUNET_FS_Uri *ret;
358 struct GNUNET_HashCode namespace; 358 struct GNUNET_HashCode ns;
359 char *identifier; 359 char *identifier;
360 unsigned int pos; 360 unsigned int pos;
361 size_t slen; 361 size_t slen;
@@ -374,7 +374,7 @@ uri_sks_parse (const char *s, char **emsg)
374 } 374 }
375 memcpy (enc, &s[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); 375 memcpy (enc, &s[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded));
376 enc[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] = '\0'; 376 enc[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] = '\0';
377 if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (enc, &namespace)) 377 if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (enc, &ns))
378 { 378 {
379 *emsg = GNUNET_strdup (_("Malformed SKS URI")); 379 *emsg = GNUNET_strdup (_("Malformed SKS URI"));
380 return NULL; 380 return NULL;
@@ -383,7 +383,7 @@ uri_sks_parse (const char *s, char **emsg)
383 GNUNET_strdup (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)]); 383 GNUNET_strdup (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)]);
384 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 384 ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
385 ret->type = sks; 385 ret->type = sks;
386 ret->data.sks.namespace = namespace; 386 ret->data.sks.ns = ns;
387 ret->data.sks.identifier = identifier; 387 ret->data.sks.identifier = identifier;
388 return ret; 388 return ret;
389} 389}
@@ -949,7 +949,7 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id,
949 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 949 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
950 ns_uri->type = sks; 950 ns_uri->type = sks;
951 GNUNET_CRYPTO_rsa_key_get_public (ns->key, &pk); 951 GNUNET_CRYPTO_rsa_key_get_public (ns->key, &pk);
952 GNUNET_CRYPTO_hash (&pk, sizeof (pk), &ns_uri->data.sks.namespace); 952 GNUNET_CRYPTO_hash (&pk, sizeof (pk), &ns_uri->data.sks.ns);
953 ns_uri->data.sks.identifier = GNUNET_strdup (id); 953 ns_uri->data.sks.identifier = GNUNET_strdup (id);
954 return ns_uri; 954 return ns_uri;
955} 955}
@@ -969,7 +969,7 @@ GNUNET_FS_uri_sks_create_from_nsid (struct GNUNET_HashCode * nsid, const char *i
969 969
970 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); 970 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
971 ns_uri->type = sks; 971 ns_uri->type = sks;
972 ns_uri->data.sks.namespace = *nsid; 972 ns_uri->data.sks.ns = *nsid;
973 ns_uri->data.sks.identifier = GNUNET_strdup (id); 973 ns_uri->data.sks.identifier = GNUNET_strdup (id);
974 return ns_uri; 974 return ns_uri;
975} 975}
@@ -1272,7 +1272,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
1272 return GNUNET_NO; 1272 return GNUNET_NO;
1273 case sks: 1273 case sks:
1274 if ((0 == 1274 if ((0 ==
1275 memcmp (&u1->data.sks.namespace, &u2->data.sks.namespace, 1275 memcmp (&u1->data.sks.ns, &u2->data.sks.ns,
1276 sizeof (struct GNUNET_HashCode))) && 1276 sizeof (struct GNUNET_HashCode))) &&
1277 (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier))) 1277 (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier)))
1278 1278
@@ -1341,7 +1341,7 @@ GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
1341 GNUNET_break (0); 1341 GNUNET_break (0);
1342 return GNUNET_SYSERR; 1342 return GNUNET_SYSERR;
1343 } 1343 }
1344 *nsid = uri->data.sks.namespace; 1344 *nsid = uri->data.sks.ns;
1345 return GNUNET_OK; 1345 return GNUNET_OK;
1346} 1346}
1347 1347
@@ -1382,9 +1382,9 @@ GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg,
1382 1382
1383 if (uri->type != sks) 1383 if (uri->type != sks)
1384 return NULL; 1384 return NULL;
1385 (void) GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.namespace, 1385 (void) GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.ns,
1386 NULL, NULL, &name, NULL); 1386 NULL, NULL, &name, NULL);
1387 unique_name = GNUNET_PSEUDONYM_name_uniquify (cfg, &uri->data.sks.namespace, name, NULL); 1387 unique_name = GNUNET_PSEUDONYM_name_uniquify (cfg, &uri->data.sks.ns, name, NULL);
1388 GNUNET_free (name); 1388 GNUNET_free (name);
1389 GNUNET_asprintf (&ret, "%s: %s", unique_name, uri->data.sks.identifier); 1389 GNUNET_asprintf (&ret, "%s: %s", unique_name, uri->data.sks.identifier);
1390 GNUNET_free (unique_name); 1390 GNUNET_free (unique_name);
@@ -1931,18 +1931,18 @@ uri_ksk_to_string (const struct GNUNET_FS_Uri *uri)
1931static char * 1931static char *
1932uri_sks_to_string (const struct GNUNET_FS_Uri *uri) 1932uri_sks_to_string (const struct GNUNET_FS_Uri *uri)
1933{ 1933{
1934 const struct GNUNET_HashCode *namespace; 1934 const struct GNUNET_HashCode *ns;
1935 const char *identifier; 1935 const char *identifier;
1936 char *ret; 1936 char *ret;
1937 struct GNUNET_CRYPTO_HashAsciiEncoded ns; 1937 struct GNUNET_CRYPTO_HashAsciiEncoded nsasc;
1938 1938
1939 if (uri->type != sks) 1939 if (uri->type != sks)
1940 return NULL; 1940 return NULL;
1941 namespace = &uri->data.sks.namespace; 1941 ns = &uri->data.sks.ns;
1942 identifier = uri->data.sks.identifier; 1942 identifier = uri->data.sks.identifier;
1943 GNUNET_CRYPTO_hash_to_enc (namespace, &ns); 1943 GNUNET_CRYPTO_hash_to_enc (ns, &nsasc);
1944 GNUNET_asprintf (&ret, "%s%s%s/%s", GNUNET_FS_URI_PREFIX, 1944 GNUNET_asprintf (&ret, "%s%s%s/%s", GNUNET_FS_URI_PREFIX,
1945 GNUNET_FS_URI_SKS_INFIX, (const char *) &ns, identifier); 1945 GNUNET_FS_URI_SKS_INFIX, (const char *) &nsasc, identifier);
1946 return ret; 1946 return ret;
1947} 1947}
1948 1948