diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-09-10 22:17:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-09-10 22:17:19 +0000 |
commit | 7dc9c567366b73f192eaf4eab4570e6119e07000 (patch) | |
tree | 03b0db913f12dfa0e575ff5d735902360e0df3b7 /src/fs/fs_uri.c | |
parent | d0e3840931750ca4bf4848d950ab9a0c0b5022bc (diff) | |
download | gnunet-7dc9c567366b73f192eaf4eab4570e6119e07000.tar.gz gnunet-7dc9c567366b73f192eaf4eab4570e6119e07000.zip |
eliminating use of 'namespace' as a fieldname / variable name to be C++ compatible
Diffstat (limited to 'src/fs/fs_uri.c')
-rw-r--r-- | src/fs/fs_uri.c | 28 |
1 files changed, 14 insertions, 14 deletions
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 * | |||
355 | uri_sks_parse (const char *s, char **emsg) | 355 | uri_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) | |||
1931 | static char * | 1931 | static char * |
1932 | uri_sks_to_string (const struct GNUNET_FS_Uri *uri) | 1932 | uri_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 | ||