From 700bd44fdaaa0b3ebc6924180daae8f5105d0cd8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 3 Jan 2009 23:29:45 +0100 Subject: input_stream: added tag() method The tag() method reads a tag from the stream. This replaces the meta_name and meta_title attributes. --- src/input_stream.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/input_stream.h') diff --git a/src/input_stream.h b/src/input_stream.h index 7ed0039a..5761adc1 100644 --- a/src/input_stream.h +++ b/src/input_stream.h @@ -29,6 +29,7 @@ struct input_plugin { bool (*open)(struct input_stream *is, const char *url); void (*close)(struct input_stream *is); + struct tag *(*tag)(struct input_stream *is); int (*buffer)(struct input_stream *is); size_t (*read)(struct input_stream *is, void *ptr, size_t size); bool (*eof)(struct input_stream *is); @@ -46,8 +47,6 @@ struct input_stream { char *mime; void *data; - char *meta_name; - char *meta_title; void *archive; }; @@ -67,6 +66,15 @@ input_stream_seek(struct input_stream *is, off_t offset, int whence); void input_stream_close(struct input_stream *is); bool input_stream_eof(struct input_stream *is); +/** + * Reads the tag from the stream. + * + * @return a tag object which must be freed with tag_free(), or NULL + * if the tag has not changed since the last call + */ +struct tag * +input_stream_tag(struct input_stream *is); + /* return value: -1 is error, 1 inidicates stuff was buffered, 0 means nothing was buffered */ int input_stream_buffer(struct input_stream *is); -- cgit v1.2.3