input_stream: return allocated input_stream objects

Major API redesign: don't let the caller allocate the input_stream
object.  Let each input plugin allocate its own (derived/extended)
input_stream pointer.  The "data" attribute can now be removed, and
all input plugins simply cast the input_stream pointer to their own
structure (with an "struct input_stream base" as the first attribute).
This commit is contained in:
Max Kellermann
2009-12-30 23:27:37 +01:00
parent 816b6ad4a7
commit d3b763a48c
25 changed files with 315 additions and 326 deletions

View File

@@ -48,8 +48,7 @@ struct input_plugin {
*/
void (*finish)(void);
bool (*open)(struct input_stream *is, const char *url,
GError **error_r);
struct input_stream *(*open)(const char *uri, GError **error_r);
void (*close)(struct input_stream *is);
struct tag *(*tag)(struct input_stream *is);