* struct zip_stat increased for future encryption support * zip_add return value changed (now returns new index of added file) * shared library major bump because of previous two --HG-- branch : HEAD
diff --git a/ChangeLog b/ChangeLog index 36a9921..9575cb1 100644 --- a/ChangeLog +++ b/ChangeLog
@@ -1,3 +1,15 @@ +2006-04-09 Thomas Klausner <wiz@danbala.tuwien.ac.at> + + * lib/zip_replace.c (_zip_replace): return idx of changed file, + for zip_add. + (zip_replace): return 0 on success, as before. + * man/zip_add.mdoc: update. + + * lib/Makefile.am (libzip_la_SOURCES): bump libzip major. + + * lib/zip.h: add encryption_method to zip_stat. + * man/zip_stat.mdoc: update docs. + 2006-03-25 Thomas Klausner <wiz@danbala.tuwien.ac.at> * man/zip_source_function.mdoc: fix return values; correct
diff --git a/NEWS b/NEWS index f6aa184..7f77f1b 100644 --- a/NEWS +++ b/NEWS
@@ -1,3 +1,9 @@ +0.x [2006/xx/xx] + +* struct zip_stat increased for future encryption support +* zip_add return value changed (now returns new index of added file) +* shared library major bump because of previous two + 0.6.1 [2005/07/14] * various bug fixes
diff --git a/TODO b/TODO index ae3b71d..f736f65 100644 --- a/TODO +++ b/TODO
@@ -2,7 +2,6 @@ . zip_close: close za->zp before rename, reopen on error . HAVE_UNISTD_H * fix distcheck (3 tests fail, I don't understand why) -* make zip_add return index of new file entry * add functions to: . set compression method for new/changed entry . set last modification time for entry
diff --git a/configure.ac b/configure.ac index 45e287f..3f808ac 100644 --- a/configure.ac +++ b/configure.ac
@@ -1,5 +1,5 @@ AC_PREREQ(2.57) -AC_INIT([libzip],[0.6.1b],[nih@giga.or.at]) +AC_INIT([libzip],[0.6.1c],[nih@giga.or.at]) AC_CONFIG_SRCDIR([lib/zip_add.c]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE
diff --git a/lib/Makefile.am b/lib/Makefile.am index 8f5aa7a..a9481a6 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am
@@ -2,7 +2,7 @@ noinst_HEADERS = zipint.h include_HEADERS = zip.h -libzip_la_LDFLAGS=-version-info 0:5 +libzip_la_LDFLAGS=-version-info 1:0 libzip_la_LIBADD=@LIBOBJS@ libzip_la_SOURCES=\
diff --git a/lib/zip.h b/lib/zip.h index fe80d21..4d8f515 100644 --- a/lib/zip.h +++ b/lib/zip.h
@@ -2,10 +2,10 @@ #define _HAD_ZIP_H /* - $NiH: zip.h,v 1.50 2005/07/14 14:08:11 dillo Exp $ + $NiH: zip.h,v 1.51 2005/09/06 23:44:25 wiz Exp $ zip.h -- exported declarations. - Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner + Copyright (C) 1999, 2003, 2004, 2005, 2006 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <nih@giga.or.at> @@ -133,6 +133,7 @@ off_t size; /* size of file (uncompressed) */ off_t comp_size; /* size of file (compressed) */ unsigned short comp_method; /* compression method used */ + unsigned short encryption_method; /* encryption method used */ }; struct zip;
diff --git a/lib/zip_replace.c b/lib/zip_replace.c index 92929aa..9d62199 100644 --- a/lib/zip_replace.c +++ b/lib/zip_replace.c
@@ -1,8 +1,8 @@ /* - $NiH: zip_replace.c,v 1.18 2004/11/30 21:42:23 wiz Exp $ + $NiH: zip_replace.c,v 1.19 2004/11/30 22:19:38 wiz Exp $ zip_replace.c -- replace file via callback function - Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner + Copyright (C) 1999, 2003, 2004, 2006 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <nih@giga.or.at> @@ -48,7 +48,10 @@ return -1; } - return _zip_replace(za, idx, NULL, source); + if (_zip_replace(za, idx, NULL, source) == -1) + return -1; + + return 0; } @@ -74,5 +77,5 @@ ? ZIP_ST_ADDED : ZIP_ST_REPLACED); za->entry[idx].source = source; - return 0; + return idx; }
diff --git a/man/zip_add.mdoc b/man/zip_add.mdoc index 00416a7..5acbfe3 100644 --- a/man/zip_add.mdoc +++ b/man/zip_add.mdoc
@@ -1,7 +1,7 @@ -.\" $NiH: zip_add.mdoc,v 1.8 2005/06/09 21:13:12 wiz Exp $ +.\" $NiH: zip_add.mdoc,v 1.9 2005/06/09 21:14:54 wiz Exp $ .\" .\" zip_add.mdoc -- add files to zip archive -.\" Copyright (C) 2004, 2005 Dieter Baron and Thomas Klausner +.\" Copyright (C) 2004, 2005, 2006 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. .\" The authors can be contacted at <nih@giga.or.at> @@ -31,7 +31,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 30, 2004 +.Dd April 9, 2006 .Dt ZIP_ADD 3 .Os .Sh NAME @@ -72,7 +72,8 @@ functions cited in .Sx SEE ALSO . .Sh RETURN VALUES -Upon successful completion 0 is returned. +Upon successful completion, the index of the new file in the archive +is returned. Otherwise, \-1 is returned and the error code in .Ar archive is set to indicate the error.
diff --git a/man/zip_stat.mdoc b/man/zip_stat.mdoc index 2d99903..001b24a 100644 --- a/man/zip_stat.mdoc +++ b/man/zip_stat.mdoc
@@ -1,7 +1,7 @@ -.\" $NiH: zip_stat.mdoc,v 1.9 2005/06/09 21:13:12 wiz Exp $ +.\" $NiH: zip_stat.mdoc,v 1.10 2005/06/09 21:14:54 wiz Exp $ .\" .\" zip_stat.mdoc -- get information about file -.\" Copyright (C) 2003, 2004, 2005 Dieter Baron and Thomas Klausner +.\" Copyright (C) 2003, 2004, 2005, 2006 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. .\" The authors can be contacted at <nih@giga.or.at> @@ -31,7 +31,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 9, 2005 +.Dd April 9, 2006 .Dt ZIP_STAT 3 .Os .Sh NAME @@ -84,6 +84,7 @@ time_t mtime; /* modification time */ unsigned int comp_size; /* size of file (compressed) */ unsigned short comp_method; /* compression method used */ + unsigned short encryption_method; /* encryption method used */ }; .Sh RETURN VALUES Upon successful completion 0 is returned.