display content of GNUnet directories More...
Go to the source code of this file.
Functions | |
static int | item_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, enum EXTRACTOR_MetaFormat format, const char *data_mime_type, const char *data, size_t data_size) |
Print a meta data entry. More... | |
static void | print_entry (void *cls, const char *filename, const struct GNUNET_FS_Uri *uri, const struct GNUNET_FS_MetaData *meta, size_t length, const void *data) |
Print an entry in a directory. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main function that will be run by the scheduler. More... | |
int | main (int argc, char *const *argv) |
The main function to inspect GNUnet directories. More... | |
Variables | |
static int | ret |
display content of GNUnet directories
Definition in file gnunet-directory.c.
|
static |
Print a meta data entry.
cls | closure (unused) |
plugin_name | name of the plugin that generated the meta data |
type | type of the keyword |
format | format of data |
data_mime_type | mime type of data |
data | value of the meta data |
data_size | number of bytes in data |
Definition at line 44 of file gnunet-directory.c.
References _, data, data_size, dgettext, EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, LIBEXTRACTOR_GETTEXT_DOMAIN, and type.
Referenced by print_entry().
|
static |
Print an entry in a directory.
cls | closure (not used) |
filename | name of the file in the directory |
uri | URI of the file |
meta | metadata for the file; metadata for the directory if everything else is NULL/zero |
length | length of the available data for the file (of type size_t since data must certainly fit into memory; if files are larger than size_t permits, then they will certainly not be embedded with the directory itself). |
data | data available for the file (length bytes) |
Definition at line 91 of file gnunet-directory.c.
References _, EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, GNUNET_free, GNUNET_FS_meta_data_get_by_type(), GNUNET_FS_meta_data_iterate(), GNUNET_FS_uri_to_string(), item_printer(), meta, name, and uri.
Referenced by run().
|
static |
Main function that will be run by the scheduler.
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
cfg | configuration |
Definition at line 131 of file gnunet-directory.c.
References _, consensus-simulation::args, data, filename, GNUNET_assert, GNUNET_DISK_file_close(), GNUNET_DISK_file_map(), GNUNET_DISK_file_open(), GNUNET_DISK_file_size(), GNUNET_DISK_file_unmap(), GNUNET_DISK_MAP_TYPE_READ, GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE, GNUNET_ERROR_TYPE_ERROR, GNUNET_FS_directory_list_contents(), GNUNET_log, GNUNET_OK, GNUNET_YES, h, map, print_entry(), ret, and size.
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
The main function to inspect GNUnet directories.
argc | number of arguments from the command line |
argv | command line arguments |
Definition at line 187 of file gnunet-directory.c.
References gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_OK, GNUNET_OS_project_data_gnunet(), GNUNET_PROGRAM_run(), options, ret, and run().
|
static |
Definition at line 29 of file gnunet-directory.c.