aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_file_information.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/fs_file_information.c')
-rw-r--r--src/fs/fs_file_information.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c
index dc5db9d3f..f23b9da2a 100644
--- a/src/fs/fs_file_information.c
+++ b/src/fs/fs_file_information.c
@@ -57,7 +57,8 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s)
57 * @return "filename" field of the structure (can be NULL) 57 * @return "filename" field of the structure (can be NULL)
58 */ 58 */
59const char * 59const char *
60GNUNET_FS_file_information_get_filename (const struct GNUNET_FS_FileInformation *s) 60GNUNET_FS_file_information_get_filename (const struct
61 GNUNET_FS_FileInformation *s)
61{ 62{
62 return s->filename; 63 return s->filename;
63} 64}
@@ -89,7 +90,7 @@ GNUNET_FS_file_information_create_from_file (
89 void *client_info, 90 void *client_info,
90 const char *filename, 91 const char *filename,
91 const struct GNUNET_FS_Uri *keywords, 92 const struct GNUNET_FS_Uri *keywords,
92 const struct GNUNET_CONTAINER_MetaData *meta, 93 const struct GNUNET_FS_MetaData *meta,
93 int do_index, 94 int do_index,
94 const struct GNUNET_FS_BlockOptions *bo) 95 const struct GNUNET_FS_BlockOptions *bo)
95{ 96{
@@ -132,13 +133,13 @@ GNUNET_FS_file_information_create_from_file (
132/* FIXME: If we assume that on other platforms CRT is UTF-8-aware, then 133/* FIXME: If we assume that on other platforms CRT is UTF-8-aware, then
133 * this should be changed to EXTRACTOR_METAFORMAT_UTF8 134 * this should be changed to EXTRACTOR_METAFORMAT_UTF8
134 */ 135 */
135 GNUNET_CONTAINER_meta_data_insert (ret->meta, 136 GNUNET_FS_meta_data_insert (ret->meta,
136 "<gnunet>", 137 "<gnunet>",
137 EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, 138 EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME,
138 EXTRACTOR_METAFORMAT_C_STRING, 139 EXTRACTOR_METAFORMAT_C_STRING,
139 "text/plain", 140 "text/plain",
140 fn, 141 fn,
141 strlen (fn) + 1); 142 strlen (fn) + 1);
142 return ret; 143 return ret;
143} 144}
144 145
@@ -150,7 +151,7 @@ GNUNET_FS_file_information_create_from_data (
150 uint64_t length, 151 uint64_t length,
151 void *data, 152 void *data,
152 const struct GNUNET_FS_Uri *keywords, 153 const struct GNUNET_FS_Uri *keywords,
153 const struct GNUNET_CONTAINER_MetaData *meta, 154 const struct GNUNET_FS_MetaData *meta,
154 int do_index, 155 int do_index,
155 const struct GNUNET_FS_BlockOptions *bo) 156 const struct GNUNET_FS_BlockOptions *bo)
156{ 157{
@@ -180,7 +181,7 @@ GNUNET_FS_file_information_create_from_reader (
180 GNUNET_FS_DataReader reader, 181 GNUNET_FS_DataReader reader,
181 void *reader_cls, 182 void *reader_cls,
182 const struct GNUNET_FS_Uri *keywords, 183 const struct GNUNET_FS_Uri *keywords,
183 const struct GNUNET_CONTAINER_MetaData *meta, 184 const struct GNUNET_FS_MetaData *meta,
184 int do_index, 185 int do_index,
185 const struct GNUNET_FS_BlockOptions *bo) 186 const struct GNUNET_FS_BlockOptions *bo)
186{ 187{
@@ -194,9 +195,9 @@ GNUNET_FS_file_information_create_from_reader (
194 ret = GNUNET_new (struct GNUNET_FS_FileInformation); 195 ret = GNUNET_new (struct GNUNET_FS_FileInformation);
195 ret->h = h; 196 ret->h = h;
196 ret->client_info = client_info; 197 ret->client_info = client_info;
197 ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); 198 ret->meta = GNUNET_FS_meta_data_duplicate (meta);
198 if (ret->meta == NULL) 199 if (ret->meta == NULL)
199 ret->meta = GNUNET_CONTAINER_meta_data_create (); 200 ret->meta = GNUNET_FS_meta_data_create ();
200 ret->keywords = (keywords == NULL) ? NULL : GNUNET_FS_uri_dup (keywords); 201 ret->keywords = (keywords == NULL) ? NULL : GNUNET_FS_uri_dup (keywords);
201 ret->data.file.reader = reader; 202 ret->data.file.reader = reader;
202 ret->data.file.reader_cls = reader_cls; 203 ret->data.file.reader_cls = reader_cls;
@@ -226,7 +227,7 @@ GNUNET_FS_file_information_create_empty_directory (
226 struct GNUNET_FS_Handle *h, 227 struct GNUNET_FS_Handle *h,
227 void *client_info, 228 void *client_info,
228 const struct GNUNET_FS_Uri *keywords, 229 const struct GNUNET_FS_Uri *keywords,
229 const struct GNUNET_CONTAINER_MetaData *meta, 230 const struct GNUNET_FS_MetaData *meta,
230 const struct GNUNET_FS_BlockOptions *bo, 231 const struct GNUNET_FS_BlockOptions *bo,
231 const char *filename) 232 const char *filename)
232{ 233{
@@ -235,7 +236,7 @@ GNUNET_FS_file_information_create_empty_directory (
235 ret = GNUNET_new (struct GNUNET_FS_FileInformation); 236 ret = GNUNET_new (struct GNUNET_FS_FileInformation);
236 ret->h = h; 237 ret->h = h;
237 ret->client_info = client_info; 238 ret->client_info = client_info;
238 ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); 239 ret->meta = GNUNET_FS_meta_data_duplicate (meta);
239 ret->keywords = GNUNET_FS_uri_dup (keywords); 240 ret->keywords = GNUNET_FS_uri_dup (keywords);
240 ret->bo = *bo; 241 ret->bo = *bo;
241 ret->is_directory = GNUNET_YES; 242 ret->is_directory = GNUNET_YES;
@@ -392,7 +393,7 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
392 if (NULL != fi->keywords) 393 if (NULL != fi->keywords)
393 GNUNET_FS_uri_destroy (fi->keywords); 394 GNUNET_FS_uri_destroy (fi->keywords);
394 if (NULL != fi->meta) 395 if (NULL != fi->meta)
395 GNUNET_CONTAINER_meta_data_destroy (fi->meta); 396 GNUNET_FS_meta_data_destroy (fi->meta);
396 GNUNET_free (fi->serialization); 397 GNUNET_free (fi->serialization);
397 if (NULL != fi->te) 398 if (NULL != fi->te)
398 { 399 {