diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-01-20 15:16:18 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-01-20 15:16:18 +0000 |
commit | 696383a074039ed8389f688bdaffedde6bc5ac31 (patch) | |
tree | f2a07238de863fe81b4c878ee42380a53b037afd /src/fs/gnunet-directory.c | |
parent | c9432075d84d3c50171367e7d648a3a09f431994 (diff) | |
download | gnunet-696383a074039ed8389f688bdaffedde6bc5ac31.tar.gz gnunet-696383a074039ed8389f688bdaffedde6bc5ac31.zip |
nicer
Diffstat (limited to 'src/fs/gnunet-directory.c')
-rw-r--r-- | src/fs/gnunet-directory.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c index ba280db7a..c40a26b74 100644 --- a/src/fs/gnunet-directory.c +++ b/src/fs/gnunet-directory.c | |||
@@ -48,10 +48,16 @@ item_printer (void *cls, | |||
48 | const char *data, | 48 | const char *data, |
49 | size_t data_size) | 49 | size_t data_size) |
50 | { | 50 | { |
51 | if (type == EXTRACTOR_METATYPE_GNUNET_FULL_DATA) | ||
52 | { | ||
53 | printf(_("\t<original file embedded in %u bytes of meta data>\n"), | ||
54 | (unsigned int) data_size); | ||
55 | return 0; | ||
56 | } | ||
51 | if ( (format != EXTRACTOR_METAFORMAT_UTF8) && | 57 | if ( (format != EXTRACTOR_METAFORMAT_UTF8) && |
52 | (format != EXTRACTOR_METAFORMAT_C_STRING) ) | 58 | (format != EXTRACTOR_METAFORMAT_C_STRING) ) |
53 | return 0; | 59 | return 0; |
54 | if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME) | 60 | if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME) |
55 | return 0; | 61 | return 0; |
56 | printf ("\t%20s: %s\n", | 62 | printf ("\t%20s: %s\n", |
57 | dgettext (LIBEXTRACTOR_GETTEXT_DOMAIN, | 63 | dgettext (LIBEXTRACTOR_GETTEXT_DOMAIN, |
@@ -85,22 +91,31 @@ print_entry (void *cls, | |||
85 | const void *data) | 91 | const void *data) |
86 | { | 92 | { |
87 | char *string; | 93 | char *string; |
88 | 94 | char *name; | |
95 | |||
96 | name = GNUNET_CONTAINER_meta_data_get_by_type (meta, | ||
97 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); | ||
89 | if (uri == NULL) | 98 | if (uri == NULL) |
90 | { | 99 | { |
91 | printf (_("Directory summary:\n")); | 100 | printf (_("Directory `%s' meta data:\n"), |
101 | name); | ||
92 | GNUNET_CONTAINER_meta_data_iterate (meta, | 102 | GNUNET_CONTAINER_meta_data_iterate (meta, |
93 | &item_printer, | 103 | &item_printer, |
94 | NULL); | 104 | NULL); |
95 | printf ("\n"); | 105 | printf ("\n"); |
106 | printf (_("Directory `%s' contents:\n"), | ||
107 | name); | ||
108 | GNUNET_free (name); | ||
96 | return; | 109 | return; |
97 | } | 110 | } |
98 | string = GNUNET_FS_uri_to_string (uri); | 111 | string = GNUNET_FS_uri_to_string (uri); |
99 | printf ("%s:\n", string); | 112 | printf ("%s (%s):\n", name, string); |
100 | GNUNET_free (string); | 113 | GNUNET_free (string); |
101 | GNUNET_CONTAINER_meta_data_iterate (meta, | 114 | GNUNET_CONTAINER_meta_data_iterate (meta, |
102 | &item_printer, | 115 | &item_printer, |
103 | NULL); | 116 | NULL); |
117 | printf ("\n"); | ||
118 | GNUNET_free (name); | ||
104 | } | 119 | } |
105 | 120 | ||
106 | 121 | ||
@@ -161,6 +176,7 @@ run (void *cls, | |||
161 | 0, | 176 | 0, |
162 | &print_entry, | 177 | &print_entry, |
163 | NULL); | 178 | NULL); |
179 | printf ("\n"); | ||
164 | GNUNET_DISK_file_unmap (map); | 180 | GNUNET_DISK_file_unmap (map); |
165 | GNUNET_DISK_file_close (h); | 181 | GNUNET_DISK_file_close (h); |
166 | } | 182 | } |