diff options
author | Max Kellermann <max@duempel.org> | 2009-12-15 20:41:26 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-12-15 20:49:38 +0100 |
commit | 440cfc80525cbca4b1fe6ae89e20cea68b6c5460 (patch) | |
tree | be9d7b16e1a9ea743dee8216f88100e888dcfcb3 /src | |
parent | c959148ed1aae9b31a649a08f5dd8a51ef128942 (diff) | |
download | mpd-440cfc80525cbca4b1fe6ae89e20cea68b6c5460.tar.gz mpd-440cfc80525cbca4b1fe6ae89e20cea68b6c5460.tar.xz mpd-440cfc80525cbca4b1fe6ae89e20cea68b6c5460.zip |
archive/zzip: removed the "zip_context" typedef
Use the raw struct name.
Diffstat (limited to '')
-rw-r--r-- | src/archive/zzip_archive_plugin.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/archive/zzip_archive_plugin.c b/src/archive/zzip_archive_plugin.c index 236158507..91c1fed4f 100644 --- a/src/archive/zzip_archive_plugin.c +++ b/src/archive/zzip_archive_plugin.c @@ -30,13 +30,13 @@ #include <glib.h> #include <string.h> -typedef struct { +struct zzip_archive { ZZIP_DIR *dir; ZZIP_FILE *file; size_t length; GSList *list; GSList *iter; -} zip_context; +}; static const struct input_plugin zzip_input_plugin; @@ -45,7 +45,7 @@ static const struct input_plugin zzip_input_plugin; static struct archive_file * zzip_archive_open(char *pathname) { - zip_context *context = g_malloc(sizeof(zip_context)); + struct zzip_archive *context = g_malloc(sizeof(*context)); ZZIP_DIRENT dirent; // open archive @@ -70,7 +70,7 @@ zzip_archive_open(char *pathname) static void zzip_archive_scan_reset(struct archive_file *file) { - zip_context *context = (zip_context *) file; + struct zzip_archive *context = (struct zzip_archive *) file; //reset iterator context->iter = context->list; } @@ -78,7 +78,7 @@ zzip_archive_scan_reset(struct archive_file *file) static char * zzip_archive_scan_next(struct archive_file *file) { - zip_context *context = (zip_context *) file; + struct zzip_archive *context = (struct zzip_archive *) file; char *data = NULL; if (context->iter != NULL) { ///fetch data and goto next @@ -91,7 +91,7 @@ zzip_archive_scan_next(struct archive_file *file) static void zzip_archive_close(struct archive_file *file) { - zip_context *context = (zip_context *) file; + struct zzip_archive *context = (struct zzip_archive *) file; if (context->list) { //free list for (GSList *tmp = context->list; tmp != NULL; tmp = g_slist_next(tmp)) @@ -110,7 +110,7 @@ static bool zzip_archive_open_stream(struct archive_file *file, struct input_stream *is, const char *pathname) { - zip_context *context = (zip_context *) file; + struct zzip_archive *context = (struct zzip_archive *) file; ZZIP_STAT z_stat; //setup file ops @@ -133,7 +133,7 @@ zzip_archive_open_stream(struct archive_file *file, struct input_stream *is, static void zzip_input_close(struct input_stream *is) { - zip_context *context = (zip_context *) is->data; + struct zzip_archive *context = (struct zzip_archive *) is->data; zzip_file_close (context->file); zzip_archive_close((struct archive_file *)context); @@ -142,7 +142,7 @@ zzip_input_close(struct input_stream *is) static size_t zzip_input_read(struct input_stream *is, void *ptr, size_t size) { - zip_context *context = (zip_context *) is->data; + struct zzip_archive *context = (struct zzip_archive *) is->data; int ret; ret = zzip_file_read(context->file, ptr, size); if (ret < 0) { @@ -155,7 +155,7 @@ zzip_input_read(struct input_stream *is, void *ptr, size_t size) static bool zzip_input_eof(struct input_stream *is) { - zip_context *context = (zip_context *) is->data; + struct zzip_archive *context = (struct zzip_archive *) is->data; return ((size_t) zzip_tell(context->file) == context->length); } @@ -163,7 +163,7 @@ static bool zzip_input_seek(G_GNUC_UNUSED struct input_stream *is, G_GNUC_UNUSED goffset offset, G_GNUC_UNUSED int whence) { - zip_context *context = (zip_context *) is->data; + struct zzip_archive *context = (struct zzip_archive *) is->data; zzip_off_t ofs = zzip_seek(context->file, offset, whence); if (ofs != -1) { is->offset = ofs; |