#include "gnunet_pseudonym_lib.h"
#include "gnunet_bio_lib.h"
-/**
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
+
+/**
* Name of the directory which stores meta data for pseudonym
*/
#define PS_METADATA_DIR DIR_SEPARATOR_STR "data" DIR_SEPARATOR_STR "pseudonyms" DIR_SEPARATOR_STR "metadata" DIR_SEPARATOR_STR
-/**
+/**
* Name of the directory which stores names for pseudonyms
*/
#define PS_NAMES_DIR DIR_SEPARATOR_STR "data" DIR_SEPARATOR_STR "pseudonyms" DIR_SEPARATOR_STR "names" DIR_SEPARATOR_STR
-/**
+/**
+ * Configuration section we use.
+ */
+#define GNUNET_CLIENT_SERVICE_NAME "client"
+
+
+
+/**
* Registered callbacks for discovery of pseudonyms.
*/
struct DiscoveryCallback
{
- /**
+ /**
* This is a linked list.
*/
struct DiscoveryCallback *next;
- /**
+ /**
* Function to call each time a pseudonym is discovered.
*/
GNUNET_PSEUDONYM_Iterator callback;
- /**
+ /**
* Closure for callback.
*/
void *closure;
};
-/**
- * Head of the linked list of functions to call when
+/**
+ * Head of the linked list of functions to call when
* new pseudonyms are added.
*/
static struct DiscoveryCallback *head;
}
if (GNUNET_OK != GNUNET_BIO_read_close (fileR, &emsg))
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _
- ("Failed to parse metadata about pseudonym from file `%s': %s\n"),
- fn, emsg);
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ _("Failed to parse metadata about pseudonym from file `%s': %s\n"), fn,
+ emsg);
GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
GNUNET_CONTAINER_meta_data_destroy (*meta);
*meta = NULL;
/**
* Return the unique, human readable name for the given namespace.
*
- * @param cfg configuration
+ * @param cfg configuration
* @param nsid cryptographic ID of the namespace
* @return NULL on failure (should never happen)
*/
name =
GNUNET_CONTAINER_meta_data_get_first_by_types (meta,
EXTRACTOR_METATYPE_TITLE,
+ EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME,
EXTRACTOR_METATYPE_FILENAME,
EXTRACTOR_METATYPE_DESCRIPTION,
EXTRACTOR_METATYPE_SUBJECT,
idx = i;
if (sizeof (GNUNET_HashCode) !=
GNUNET_DISK_file_write (fh, nsid, sizeof (GNUNET_HashCode)))
- GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "write", fn);
+ LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "write", fn);
}
GNUNET_DISK_file_close (fh);
ret = GNUNET_malloc (strlen (name) + 32);
/**
* List all available pseudonyms.
*
- * @param cfg overall configuration
+ * @param cfg overall configuration
* @param iterator function to call for each pseudonym
* @param closure closure for iterator
* @return number of pseudonyms found