From d3b763a48c09a60a0c0b5ccb6cccd9376875c470 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Dec 2009 23:27:37 +0100 Subject: 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). --- test/run_input.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/run_input.c') diff --git a/test/run_input.c b/test/run_input.c index 581b22dca..9a31019dd 100644 --- a/test/run_input.c +++ b/test/run_input.c @@ -103,7 +103,7 @@ dump_input_stream(struct input_stream *is) int main(int argc, char **argv) { GError *error = NULL; - struct input_stream is; + struct input_stream *is; int ret; if (argc != 2) { @@ -133,9 +133,10 @@ int main(int argc, char **argv) /* open the stream and dump it */ - if (input_stream_open(&is, argv[1], &error)) { - ret = dump_input_stream(&is); - input_stream_close(&is); + is = input_stream_open(argv[1], &error); + if (is != NULL) { + ret = dump_input_stream(is); + input_stream_close(is); } else { if (error != NULL) { g_warning("%s", error->message); -- cgit v1.2.3