From 4d7c98986379b0ab93cbf9092b60dfb5ab1cee7c Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 21 Jun 2011 21:24:07 -0400 Subject: archive: pass archiver struct to write_archive callback The current archivers are very static; when you are in the write_tar_archive function, you know you are writing a tar. However, to facilitate runtime-configurable archivers that will share a common write function we need to tell the function which archiver was used. As a convenience, we also provide an opaque data pointer in the archiver struct so that individual archivers can put something useful there when they register themselves. Technically they could just use the "name" field to look in an internal map of names to data, but this is much simpler. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- archive-zip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'archive-zip.c') diff --git a/archive-zip.c b/archive-zip.c index a776d8359c..42df66080a 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -261,7 +261,8 @@ static void dos_time(time_t *time, int *dos_date, int *dos_time) *dos_time = t->tm_sec / 2 + t->tm_min * 32 + t->tm_hour * 2048; } -static int write_zip_archive(struct archiver_args *args) +static int write_zip_archive(const struct archiver *ar, + struct archiver_args *args) { int err; -- cgit v1.2.3