diff options
author | Max Kellermann <max@duempel.org> | 2009-12-16 16:28:26 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-12-16 17:09:58 +0100 |
commit | 0bc8c0c1da4490aad502dddbbc7c60564c4083a7 (patch) | |
tree | 3a7b9ed55fbbdb757e4822e7ea262237d0562dbc /src/archive/zzip_archive_plugin.c | |
parent | 74156d5bed810209a777ba6ade7ef279691f3091 (diff) | |
download | mpd-0bc8c0c1da4490aad502dddbbc7c60564c4083a7.tar.gz mpd-0bc8c0c1da4490aad502dddbbc7c60564c4083a7.tar.xz mpd-0bc8c0c1da4490aad502dddbbc7c60564c4083a7.zip |
archive_plugin: wrap method calls
Make archive_file a "real" struct, extended by all plugins. Add the
plugin pointer to it. Wrap all method calls in functions.
Diffstat (limited to 'src/archive/zzip_archive_plugin.c')
-rw-r--r-- | src/archive/zzip_archive_plugin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/archive/zzip_archive_plugin.c b/src/archive/zzip_archive_plugin.c index ba89e82b3..1174629ae 100644 --- a/src/archive/zzip_archive_plugin.c +++ b/src/archive/zzip_archive_plugin.c @@ -32,6 +32,8 @@ #include <string.h> struct zzip_archive { + struct archive_file base; + ZZIP_DIR *dir; ZZIP_FILE *file; size_t length; @@ -55,6 +57,8 @@ zzip_archive_open(const char *pathname) struct zzip_archive *context = g_malloc(sizeof(*context)); ZZIP_DIRENT dirent; + archive_file_init(&context->base, &zzip_archive_plugin); + // open archive context->list = NULL; context->dir = zzip_dir_open(pathname, NULL); @@ -71,7 +75,7 @@ zzip_archive_open(const char *pathname) } } - return (struct archive_file *)context; + return &context->base; } static void |