aboutsummaryrefslogtreecommitdiff
path: root/src/util/container_meta_data.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-31 08:24:42 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-31 08:24:42 +0000
commit5554d773fef027d978d8b94f2cfe10b3206c5916 (patch)
tree22c4d3cf3b820248a15fa86552dfa3d505dbc09d /src/util/container_meta_data.c
parent46e277f53de5d77ba4414c178b511278c21b1789 (diff)
downloadgnunet-5554d773fef027d978d8b94f2cfe10b3206c5916.tar.gz
gnunet-5554d773fef027d978d8b94f2cfe10b3206c5916.zip
done
Diffstat (limited to 'src/util/container_meta_data.c')
-rw-r--r--src/util/container_meta_data.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index e9c33bab2..f39b15930 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -608,71 +608,6 @@ GNUNET_CONTAINER_meta_data_duplicate (const struct GNUNET_CONTAINER_MetaData
608} 608}
609 609
610 610
611/**
612 * Add meta data that libextractor finds to our meta data
613 * container.
614 *
615 * @param cls closure, our meta data container
616 * @param plugin_name name of the plugin that produced this value;
617 * special values can be used (i.e. '&lt;zlib&gt;' for zlib being
618 * used in the main libextractor library and yielding
619 * meta data).
620 * @param type libextractor-type describing the meta data
621 * @param format basic format information about data
622 * @param data_mime_type mime-type of data (not of the original file);
623 * can be NULL (if mime-type is not known)
624 * @param data actual meta-data found
625 * @param data_len number of bytes in data
626 * @return always 0 to continue extracting
627 */
628static int
629add_to_md(void *cls,
630 const char *plugin_name,
631 enum EXTRACTOR_MetaType type,
632 enum EXTRACTOR_MetaFormat format,
633 const char *data_mime_type,
634 const char *data,
635 size_t data_len)
636{
637 struct GNUNET_CONTAINER_MetaData *md = cls;
638 (void) GNUNET_CONTAINER_meta_data_insert (md,
639 plugin_name,
640 type,
641 format,
642 data_mime_type,
643 data,
644 data_len);
645 return 0;
646}
647
648
649/**
650 * Extract meta-data from a file.
651 *
652 * @return GNUNET_SYSERR on error, otherwise the number
653 * of meta-data items obtained
654 */
655int
656GNUNET_CONTAINER_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData
657 *md, const char *filename,
658 struct EXTRACTOR_PluginList *
659 extractors)
660{
661 unsigned int old;
662
663 if (filename == NULL)
664 return GNUNET_SYSERR;
665 if (extractors == NULL)
666 return 0;
667 old = md->item_count;
668 EXTRACTOR_extract (extractors,
669 filename,
670 NULL, 0,
671 &add_to_md,
672 md);
673 return (int) (md->item_count - old);
674}
675
676 611
677/** 612/**
678 * Try to compress the given block of data. 613 * Try to compress the given block of data.