diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-01-30 12:21:21 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-01-30 12:21:21 +0000 |
commit | 4fcdbad343f0d8b9c54fcfe5b9d8076ca1474887 (patch) | |
tree | 8cc026fc0ac98a732aa4e559c5f49b5826e3b994 /src/fs/fs_file_information.c | |
parent | 057fc25b54b87d95a13d398632bf27dd82f2cc05 (diff) |
-all meta data extraction should happen in helper, removing from API
git-svn-id: https://gnunet.org/svn/gnunet@19527 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/fs/fs_file_information.c')
-rw-r--r-- | src/fs/fs_file_information.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index 01ce6f54bc..a633dcb7b1 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c @@ -22,10 +22,6 @@ * @file fs/fs_file_information.c * @brief Manage information for publishing directory hierarchies * @author Christian Grothoff - * - * TODO: - * - metadata filename clean up code - * - metadata/ksk generation for directories from contained files */ #include "platform.h" #include <extractor.h> @@ -35,61 +31,6 @@ /** - * Add meta data that libextractor finds to our meta data - * container. - * - * @param cls closure, our meta data container - * @param plugin_name name of the plugin that produced this value; - * special values can be used (i.e. '<zlib>' for zlib being - * used in the main libextractor library and yielding - * meta data). - * @param type libextractor-type describing the meta data - * @param format basic format information about data - * @param data_mime_type mime-type of data (not of the original file); - * can be NULL (if mime-type is not known) - * @param data actual meta-data found - * @param data_len number of bytes in data - * @return always 0 to continue extracting - */ -static int -add_to_md (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_len) -{ - struct GNUNET_CONTAINER_MetaData *md = cls; - - (void) GNUNET_CONTAINER_meta_data_insert (md, plugin_name, type, format, - data_mime_type, data, data_len); - return 0; -} - - -/** - * Extract meta-data from a file. - * - * @return GNUNET_SYSERR on error, otherwise the number - * of meta-data items obtained - */ -int -GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md, - const char *filename, - struct EXTRACTOR_PluginList *extractors) -{ - int old; - - if (filename == NULL) - return GNUNET_SYSERR; - if (extractors == NULL) - return 0; - old = GNUNET_CONTAINER_meta_data_iterate (md, NULL, NULL); - GNUNET_assert (old >= 0); - EXTRACTOR_extract (extractors, filename, NULL, 0, &add_to_md, md); - return (GNUNET_CONTAINER_meta_data_iterate (md, NULL, NULL) - old); -} - - - -/** * Obtain the name under which this file information * structure is stored on disk. Only works for top-level * file information structures. |