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). --- src/archive_plugin.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/archive_plugin.h') diff --git a/src/archive_plugin.h b/src/archive_plugin.h index 254c81f66..b08c93389 100644 --- a/src/archive_plugin.h +++ b/src/archive_plugin.h @@ -71,8 +71,9 @@ struct archive_plugin { * @param error_r location to store the error occuring, or * NULL to ignore errors */ - bool (*open_stream)(struct archive_file *, struct input_stream *is, - const char *path, GError **error_r); + struct input_stream *(*open_stream)(struct archive_file *af, + const char *path, + GError **error_r); /** * closes archive file. @@ -99,8 +100,8 @@ archive_file_scan_reset(struct archive_file *file); char * archive_file_scan_next(struct archive_file *file); -bool -archive_file_open_stream(struct archive_file *file, struct input_stream *is, +struct input_stream * +archive_file_open_stream(struct archive_file *file, const char *path, GError **error_r); #endif -- cgit v1.2.3