From b69c7b8a5f0504a344475aa75071e2687d66cebf Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 7 Aug 2010 21:45:14 +0000 Subject: adding missing API call --- src/fs/fs_uri.c | 22 ++++++++++++++++++++++ src/include/gnunet_fs_service.h | 12 ++++++++++++ src/include/gnunet_pseudonym_lib.h | 3 +++ 3 files changed, 37 insertions(+) (limited to 'src') diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index c844bdd31..7d0321464 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c @@ -909,6 +909,27 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, } +/** + * Create an SKS URI from a namespace ID and an identifier. + * + * @param nsid namespace ID + * @param id identifier + * @return an FS URI for the given namespace and identifier + */ +struct GNUNET_FS_Uri * +GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode *nsid, + const char *id) +{ + struct GNUNET_FS_Uri *ns_uri; + + ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); + ns_uri->type = sks; + ns_uri->data.sks.namespace = *nsid; + ns_uri->data.sks.identifier = GNUNET_strdup (id); + return ns_uri; +} + + /** * Canonicalize a keyword. * @@ -1151,6 +1172,7 @@ GNUNET_FS_uri_ksk_create (const char *keywords, if (keywords == NULL) { + *emsg = GNUNET_strdup (_("No keywords specified!\n")); GNUNET_break (0); return NULL; } diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 758a4895c..8e71308ba 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h @@ -327,6 +327,18 @@ GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, char **emsg); +/** + * Create an SKS URI from a namespace ID and an identifier. + * + * @param nsid namespace ID + * @param id identifier + * @return an FS URI for the given namespace and identifier + */ +struct GNUNET_FS_Uri * +GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode *nsid, + const char *id); + + /** * Get the ID of a namespace from the given * namespace URI. diff --git a/src/include/gnunet_pseudonym_lib.h b/src/include/gnunet_pseudonym_lib.h index ba240941b..124de04f9 100644 --- a/src/include/gnunet_pseudonym_lib.h +++ b/src/include/gnunet_pseudonym_lib.h @@ -42,6 +42,9 @@ extern "C" /** * Iterator over all known pseudonyms. * + * @param cls closure + * @param pseudonym hash code of public key of pseudonym + * @param md meta data known about the pseudonym * @param rating the local rating of the pseudonym * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort */ -- cgit v1.2.3