Imported Upstream version 1.4.0 55/176855/1 upstream/1.4.0
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 24 Apr 2018 04:13:18 +0000 (13:13 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 24 Apr 2018 04:13:21 +0000 (13:13 +0900)
Change-Id: I75d7f310d624ffb70667c913f80a16e33ff1e16a
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
316 files changed:
.hgignore [deleted file]
.hgtags [deleted file]
.travis.yml [deleted file]
API-CHANGES [deleted file]
API-CHANGES.md [new file with mode: 0644]
CMakeLists.txt
INSTALL [deleted file]
INSTALL.md [new file with mode: 0644]
LICENSE
Makefile.am [deleted file]
NEWS.md
README-snapshot.md [deleted file]
README.md
THANKS
TODO.md
cmake-config.h.in
cmake-zipconf.h.in
configure.ac [deleted file]
create-cmake-config.h.in.pl [deleted file]
docs/aes_coding_tips.txt [deleted file]
docs/aes_info.txt [deleted file]
docs/appnote.iz [deleted file]
docs/appnote.txt [deleted file]
docs/extrafld.txt [deleted file]
examples/Makefile.am [deleted file]
examples/in-memory.c
lib/CMakeLists.txt
lib/Makefile.am [deleted file]
lib/compat.h
lib/gladman-fcrypt.c
lib/gladman-fcrypt/Makefile.am [deleted file]
lib/gladman-fcrypt/aescrypt.c
lib/gladman-fcrypt/main.c [deleted file]
lib/gladman-fcrypt/prng.c [deleted file]
lib/gladman-fcrypt/prng.h [deleted file]
lib/zip.h
lib/zip_algorithm_bzip2.c
lib/zip_close.c
lib/zip_dirent.c
lib/zip_discard.c
lib/zip_extra_field.c
lib/zip_fdopen.c
lib/zip_file_get_offset.c
lib/zip_file_set_encryption.c
lib/zip_hash.c
lib/zip_new.c
lib/zip_open.c
lib/zip_random_unix.c
lib/zip_random_uwp.c [new file with mode: 0644]
lib/zip_set_file_compression.c
lib/zip_source_begin_write_cloning.c [new file with mode: 0644]
lib/zip_source_buffer.c
lib/zip_source_compress.c
lib/zip_source_crc.c
lib/zip_source_filep.c
lib/zip_source_function.c
lib/zip_source_open.c
lib/zip_source_read.c
lib/zip_source_win32a.c
lib/zip_source_win32handle.c
lib/zip_source_win32w.c
lib/zip_source_window.c
lib/zip_source_winzip_aes_decode.c
lib/zip_source_winzip_aes_encode.c
lib/zip_source_zip_new.c
lib/zip_unchange_all.c
lib/zipint.h
lib/zipwin32.h
libzip-uninstalled.pc.in [deleted file]
m4/.empty [deleted file]
m4/visibility.m4 [deleted file]
man/CMakeLists.txt
man/Makefile.am [deleted file]
man/ZIP_SOURCE_GET_ARGS.man [new file with mode: 0644]
man/ZIP_SOURCE_GET_ARGS.mdoc
man/fix-man-links.sh [deleted file]
man/libzip.man [new file with mode: 0644]
man/libzip.mdoc
man/links
man/make_zip_errors.sh [deleted file]
man/mkdocset.pl [deleted file]
man/nih-man.css [deleted file]
man/update-html.cmake [new file with mode: 0644]
man/update-man.cmake [new file with mode: 0644]
man/zip_add.man [new file with mode: 0644]
man/zip_add.mdoc
man/zip_add_dir.man [new file with mode: 0644]
man/zip_add_dir.mdoc
man/zip_close.man [new file with mode: 0644]
man/zip_close.mdoc
man/zip_delete.man [new file with mode: 0644]
man/zip_delete.mdoc
man/zip_dir_add.man [new file with mode: 0644]
man/zip_dir_add.mdoc
man/zip_discard.man [new file with mode: 0644]
man/zip_discard.mdoc
man/zip_error_clear.man [new file with mode: 0644]
man/zip_error_clear.mdoc
man/zip_error_code_system.man [new file with mode: 0644]
man/zip_error_code_system.mdoc
man/zip_error_code_zip.man [new file with mode: 0644]
man/zip_error_code_zip.mdoc
man/zip_error_fini.man [new file with mode: 0644]
man/zip_error_fini.mdoc
man/zip_error_get.man [new file with mode: 0644]
man/zip_error_get.mdoc
man/zip_error_get_sys_type.man [new file with mode: 0644]
man/zip_error_get_sys_type.mdoc
man/zip_error_init.man [new file with mode: 0644]
man/zip_error_init.mdoc
man/zip_error_set.man [new file with mode: 0644]
man/zip_error_set.mdoc
man/zip_error_strerror.man [new file with mode: 0644]
man/zip_error_strerror.mdoc
man/zip_error_system_type.man [new file with mode: 0644]
man/zip_error_system_type.mdoc
man/zip_error_to_data.man [new file with mode: 0644]
man/zip_error_to_data.mdoc
man/zip_error_to_str.man [new file with mode: 0644]
man/zip_error_to_str.mdoc
man/zip_errors.man [new file with mode: 0644]
man/zip_errors.mdoc
man/zip_fclose.man [new file with mode: 0644]
man/zip_fclose.mdoc
man/zip_fdopen.man [new file with mode: 0644]
man/zip_fdopen.mdoc
man/zip_file_add.man [new file with mode: 0644]
man/zip_file_add.mdoc
man/zip_file_extra_field_delete.man [new file with mode: 0644]
man/zip_file_extra_field_delete.mdoc
man/zip_file_extra_field_get.man [new file with mode: 0644]
man/zip_file_extra_field_get.mdoc
man/zip_file_extra_field_set.man [new file with mode: 0644]
man/zip_file_extra_field_set.mdoc
man/zip_file_extra_fields_count.man [new file with mode: 0644]
man/zip_file_extra_fields_count.mdoc
man/zip_file_get_comment.man [new file with mode: 0644]
man/zip_file_get_comment.mdoc
man/zip_file_get_error.man [new file with mode: 0644]
man/zip_file_get_error.mdoc
man/zip_file_get_external_attributes.man [new file with mode: 0644]
man/zip_file_get_external_attributes.mdoc
man/zip_file_rename.man [new file with mode: 0644]
man/zip_file_rename.mdoc
man/zip_file_set_comment.man [new file with mode: 0644]
man/zip_file_set_comment.mdoc
man/zip_file_set_encryption.man [new file with mode: 0644]
man/zip_file_set_encryption.mdoc
man/zip_file_set_external_attributes.man [new file with mode: 0644]
man/zip_file_set_external_attributes.mdoc
man/zip_file_set_mtime.man [new file with mode: 0644]
man/zip_file_set_mtime.mdoc
man/zip_file_strerror.man [new file with mode: 0644]
man/zip_file_strerror.mdoc
man/zip_fopen.man [new file with mode: 0644]
man/zip_fopen.mdoc
man/zip_fopen_encrypted.man [new file with mode: 0644]
man/zip_fopen_encrypted.mdoc
man/zip_fread.man [new file with mode: 0644]
man/zip_fread.mdoc
man/zip_fseek.man [new file with mode: 0644]
man/zip_fseek.mdoc
man/zip_ftell.man [new file with mode: 0644]
man/zip_ftell.mdoc
man/zip_get_archive_comment.man [new file with mode: 0644]
man/zip_get_archive_comment.mdoc
man/zip_get_archive_flag.man [new file with mode: 0644]
man/zip_get_archive_flag.mdoc
man/zip_get_error.man [new file with mode: 0644]
man/zip_get_error.mdoc
man/zip_get_file_comment.man [new file with mode: 0644]
man/zip_get_file_comment.mdoc
man/zip_get_name.man [new file with mode: 0644]
man/zip_get_name.mdoc
man/zip_get_num_entries.man [new file with mode: 0644]
man/zip_get_num_entries.mdoc
man/zip_get_num_files.man [new file with mode: 0644]
man/zip_get_num_files.mdoc
man/zip_libzip_version.man [new file with mode: 0644]
man/zip_libzip_version.mdoc
man/zip_name_locate.man [new file with mode: 0644]
man/zip_name_locate.mdoc
man/zip_open.man [new file with mode: 0644]
man/zip_open.mdoc
man/zip_register_progress_callback.man [new file with mode: 0644]
man/zip_register_progress_callback.mdoc
man/zip_register_progress_callback_with_state.man [new file with mode: 0644]
man/zip_register_progress_callback_with_state.mdoc
man/zip_rename.man [new file with mode: 0644]
man/zip_rename.mdoc
man/zip_set_archive_comment.man [new file with mode: 0644]
man/zip_set_archive_comment.mdoc
man/zip_set_archive_flag.man [new file with mode: 0644]
man/zip_set_archive_flag.mdoc
man/zip_set_default_password.man [new file with mode: 0644]
man/zip_set_default_password.mdoc
man/zip_set_file_comment.man [new file with mode: 0644]
man/zip_set_file_comment.mdoc
man/zip_set_file_compression.man [new file with mode: 0644]
man/zip_set_file_compression.mdoc
man/zip_source.man [new file with mode: 0644]
man/zip_source.mdoc
man/zip_source_begin_write.man [new file with mode: 0644]
man/zip_source_begin_write.mdoc
man/zip_source_buffer.man [new file with mode: 0644]
man/zip_source_buffer.mdoc
man/zip_source_buffer_fragment.man [new file with mode: 0644]
man/zip_source_buffer_fragment.mdoc [new file with mode: 0644]
man/zip_source_close.man [new file with mode: 0644]
man/zip_source_close.mdoc
man/zip_source_commit_write.man [new file with mode: 0644]
man/zip_source_commit_write.mdoc
man/zip_source_error.man [new file with mode: 0644]
man/zip_source_error.mdoc
man/zip_source_file.man [new file with mode: 0644]
man/zip_source_file.mdoc
man/zip_source_filep.man [new file with mode: 0644]
man/zip_source_filep.mdoc
man/zip_source_free.man [new file with mode: 0644]
man/zip_source_free.mdoc
man/zip_source_function.man [new file with mode: 0644]
man/zip_source_function.mdoc
man/zip_source_is_deleted.man [new file with mode: 0644]
man/zip_source_is_deleted.mdoc
man/zip_source_keep.man [new file with mode: 0644]
man/zip_source_keep.mdoc
man/zip_source_make_command_bitmap.man [new file with mode: 0644]
man/zip_source_make_command_bitmap.mdoc
man/zip_source_open.man [new file with mode: 0644]
man/zip_source_open.mdoc
man/zip_source_read.man [new file with mode: 0644]
man/zip_source_read.mdoc
man/zip_source_rollback_write.man [new file with mode: 0644]
man/zip_source_rollback_write.mdoc
man/zip_source_seek.man [new file with mode: 0644]
man/zip_source_seek.mdoc
man/zip_source_seek_compute_offset.man [new file with mode: 0644]
man/zip_source_seek_compute_offset.mdoc
man/zip_source_seek_write.man [new file with mode: 0644]
man/zip_source_seek_write.mdoc
man/zip_source_stat.man [new file with mode: 0644]
man/zip_source_stat.mdoc
man/zip_source_tell.man [new file with mode: 0644]
man/zip_source_tell.mdoc
man/zip_source_tell_write.man [new file with mode: 0644]
man/zip_source_tell_write.mdoc
man/zip_source_win32a.man [new file with mode: 0644]
man/zip_source_win32a.mdoc
man/zip_source_win32handle.man [new file with mode: 0644]
man/zip_source_win32handle.mdoc
man/zip_source_win32w.man [new file with mode: 0644]
man/zip_source_win32w.mdoc
man/zip_source_write.man [new file with mode: 0644]
man/zip_source_write.mdoc
man/zip_source_zip.man [new file with mode: 0644]
man/zip_source_zip.mdoc
man/zip_stat.man [new file with mode: 0644]
man/zip_stat.mdoc
man/zip_stat_init.man [new file with mode: 0644]
man/zip_stat_init.mdoc
man/zip_unchange.man [new file with mode: 0644]
man/zip_unchange.mdoc
man/zip_unchange_all.man [new file with mode: 0644]
man/zip_unchange_all.mdoc
man/zip_unchange_archive.man [new file with mode: 0644]
man/zip_unchange_archive.mdoc
man/zipcmp.man [new file with mode: 0644]
man/zipcmp.mdoc
man/zipmerge.man [new file with mode: 0644]
man/zipmerge.mdoc
man/ziptool.man [new file with mode: 0644]
man/ziptool.mdoc
regress/CMakeLists.txt
regress/Makefile.am [deleted file]
regress/NiHTest.pm
regress/buffer-fragment-read.test [new file with mode: 0644]
regress/buffer-fragment-write.test [new file with mode: 0644]
regress/can_clone_file.c [new file with mode: 0644]
regress/cleanup.cmake [new file with mode: 0644]
regress/clone-buffer-add.test [new file with mode: 0644]
regress/clone-buffer-delete.test [new file with mode: 0644]
regress/clone-buffer-replace.test [new file with mode: 0644]
regress/clone-fs-add.test [new file with mode: 0644]
regress/clone-fs-delete.test [new file with mode: 0644]
regress/clone-fs-replace.test [new file with mode: 0644]
regress/fseek.c
regress/gap-add.zip [new file with mode: 0644]
regress/gap-delete.zip [new file with mode: 0644]
regress/gap-replace.zip [new file with mode: 0644]
regress/gap.zip [new file with mode: 0644]
regress/hole.c [moved from src/hole.c with 98% similarity]
regress/malloc.c
regress/nonrandomopen.c
regress/nonrandomopentest.c
regress/open_nonarchive.test
regress/runtest.in
regress/set_file_mtime.test [moved from regress/set_mtime.test with 66% similarity]
regress/source_hole.c [moved from src/source_hole.c with 99% similarity]
regress/testfile2014.zip
regress/tryopen.c
regress/ziptool_regress.c [new file with mode: 0644]
src/CMakeLists.txt
src/Makefile.am [deleted file]
src/zipcmp.c
src/zipmerge.c
src/ziptool.c
vstudio/readme.txt [deleted file]
vstudio/vsbuild.cmd [deleted file]
vstudio/zlib/unpack_zlib_here.txt [deleted file]
xcode/Info.plist [deleted file]
xcode/config.h [deleted file]
xcode/extract-version.sh [deleted file]
xcode/libzip.xcodeproj/project.pbxproj [deleted file]
xcode/libzip.xcodeproj/project.xcworkspace/contents.xcworkspacedata [deleted file]
xcode/mkconfig-h.sh [deleted file]
xcode/zipconf.h [deleted file]

diff --git a/.hgignore b/.hgignore
deleted file mode 100644 (file)
index 6d5224a..0000000
--- a/.hgignore
+++ /dev/null
@@ -1,68 +0,0 @@
-(^|/)Makefile$
-(^|/)Makefile.in$
-/.deps/
-/.libs/
-\.DS_Store$
-\.la$
-\.lo$
-\.o$
-\.pc$
-^GPATH$
-^GRTAGS$
-^GTAGS$
-^aclocal.m4$
-^autom4te\.cache/
-^build
-^compile$
-^config\.(guess|h|h\.in|log|status|sub)$
-^configure$
-^cov-int$
-^depcomp$
-^examples/in-memory$
-^install-sh$
-^lib/zip_err_str\.c$
-^lib/zipconf\.h$
-^libtool$
-^ltmain.sh$
-^m4/libtool.m4$
-^m4/ltoptions.m4$
-^m4/ltsugar.m4$
-^m4/ltversion.m4$
-^m4/lt~obsolete.m4$
-^man/.*\.html$
-^man/.*\.man$
-^man/at\.nih\.libzip\.docset/
-^man/at.nih.libzip-.*\.xar$
-^man/at.nih.libzip.*\.atom$
-^missing$
-^regress/.*log$
-^regress/.*trs$
-^regress/add_from_filep$
-^regress/bigzero.zip$
-^regress/fopen_unchanged$
-^regress/fread$
-^regress/fseek$
-^regress/nonrandomopentest$
-^regress/manyfiles.zip$
-^regress/manyfiles-133000.zip$
-^regress/manyfiles-65536.zip$
-^regress/manyfiles-fewer.zip$
-^regress/manyfiles-more.zip$
-^regress/manyfiles-zip64-modulo.zip$
-^regress/manyfiles-zip64.zip$
-^regress/runtest$
-^regress/tryopen$
-^src/hole$
-^src/zipcmp$
-^src/zipmerge$
-^src/ziptool$
-^stamp-h1$
-^test-driver$
-^xcode/libzip\.xcodeproj/project\.xcworkspace/xcuserdata
-^xcode/libzip\.xcodeproj/xcuserdata/
-~$
-^.git
-^.gitignore
-.tar.bz2$
-.tar.gz$
-.tar.xz$
diff --git a/.hgtags b/.hgtags
deleted file mode 100644 (file)
index fc0a088..0000000
--- a/.hgtags
+++ /dev/null
@@ -1,27 +0,0 @@
-e5ac19fb4c5bea4a42ca62c10f6499b7f25538bc rel-0-8
-1c04fdb0f57bbb8e3823eb52b541ca2d8a348fde rel-0-9
-305c067cba3a04d11e95c7cd1e0ae55d662620ee rel-0-9-1
-a523a1da577163bb4255d0f670444964bbf9d43e rel-0-9-2
-a3023e707845ef0d87b9cb33cb3c330afbb5a3c3 rel-0-9-3
-70e00fa4feefae33235b72c072c30c90f76b8204 rel-0-10
-cb69d6146a09acd15af55d27eb7fe910b59dbe60 rel-0-10-1
-20242e19f6b57bdcbdceb98b422e81aef5611db4 rel-0-11
-6aa6fa05cd0bd9adfee8fab32dbacafa687a513b rel-0-11-1
-7ce71a0ca2b3bcd5fbdbef31f2523834d1d697ca rel-0-11-2
-c9d841a87266e0699f19ed2c91a9289e4a999b6e rel-1-0-beta1
-4a0158ebd70ab4f64bf8ec6f351a1c2019f4fb23 rel-1-0
-19018f1628ab3932385b91d20e99d1368a04da3a rel-1-0-1
-b0b4673045e1560293826ab56d8c7e3aa27dbb7a rel-1-1
-ddc1d1fb3194ceed50ca1d8db2cf6f1291ac5629 rel-1-1-1
-8ca6b46cc7510d849000d0058f6c4021d4f15ed1 rel-1-1-2
-61b0bc44c60b904afc594d58348a3c0936528026 rel-1-1-3
-bdc57015a9a903b1ec935295d77e54cb90800b3f brian-gladman-fcrypt-2008-11-18
-aefb3263e2449b0b62095b2e50e9010d073fb670 s
-aefb3263e2449b0b62095b2e50e9010d073fb670 s
-0000000000000000000000000000000000000000 s
-c43a9681c5ca2d577636a75dc1f29b384c82f51a rel-1-2-0
-1863a86ceda84a68b6eba34dfff5fc15f1f65ea8 rel-1-3-0
-6e80ae292bc56c1749d26a1ba20e8e4c8c036fe5 rel-1-3-1
-d5963473a0bac25adca83505cb6ac701538b53b6 rel-1-3-2
-d5963473a0bac25adca83505cb6ac701538b53b6 rel-1-3-2
-0000000000000000000000000000000000000000 rel-1-3-2
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index bbcbe14..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-language: c
-compiler:
-  - clang
-  - gcc
-os:
- - linux
- - osx
-before_install:
- - if [ "$TRAVIS_OS_NAME" != "linux" ]; then
-     brew update;
-     brew uninstall libtool;
-     brew install libtool;
-   fi
-script:
- - autoreconf -fiv
- - ./configure
- - make
- - make check
diff --git a/API-CHANGES b/API-CHANGES
deleted file mode 100644 (file)
index a83b183..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-* libzip API changes
-
-This file describes changes in the libzip API and how to adapt your
-code for them.
-
-You can define ZIP_DISABLE_DEPRECATED before including <zip.h> to hide
-prototypes for deprecated functions, to find out about functions that
-might be removed at some point.
-
-* 1.0
-
-** new type zip_error_t
-
-Error information is stored in the newly public type zip_error_t. Use
-this to access information about an error, instead of the deprecated
-functions that operated on two ints.
-
-deprecated functions: zip_error_get_sys_type(), zip_error_get(),
-zip_error_to_str(), zip_file_error_get()
-
-See their man pages for instructions on how to replace them.
-
-The most common affected use is zip_open. The new recommended usage
-is:
-
-int err;
-if ((za = zip_open(archive, flags, &err)) == NULL) {
-       zip_error_t error;
-       zip_error_init_with_code(&error, err);
-       fprintf(stderr, "can't open zip archive '%s': %s\n", archive, zip_error_strerror(&error));
-       zip_error_fini(&error);
-}
-
-** more typedefs
-
-The following typedefs have been added for better readability:
-
-typedef struct zip zip_t;
-typedef struct zip_file zip_file_t;
-typedef struct zip_source zip_source_t;
-typedef struct zip_stat zip_stat_t;
-
-This means you can use "zip_t" instead of "struct zip", etc.
-
-
-** torrentzip support removed
-
-torrentzip depends on a particular zlib version which is by now quite
-old.
-
-* 0.11
-
-** new type zip_flags_t
-
-The functions which have flags now use the zip_flags_t type for this.
-All old flags fit; you need code only to adapt if you were saving flags in a
-local variable. Use zip_flags_t for such a variable.
-This affects:
-zip_fopen()
-zip_fopen_encrypted()
-zip_fopen_index()
-zip_fopen_index_encrypted()
-zip_get_archive_comment()
-zip_get_archive_flag()
-zip_get_num_entries()
-zip_get_name()
-zip_name_locate()
-zip_set_archive_flag()
-zip_source_zip()
-zip_stat()
-zip_stat_index()
-
-*** ZIP_FL_*, ZIP_AFL_*, ZIP_STAT_* are now unsigned constants
-
-To match the new zip_flags_t type.
-
-*** zip_add(), zip_add_dir()
-
-These functions were replaced with zip_file_add() and zip_dir_add(), respectively,
-to add a flags argument.
-
-*** zip_rename(), zip_replace()
-
-These functions were replaced with zip_file_rename() and zip_file_replace(),
-respectively, to add a flags argument.
-
-*** zip_get_file_comment()
-
-This function was replaced with zip_file_get_comment(); one argument was promoted from
-int to zip_uint32_t, the other is now a zip_flags_t.
-
-*** zip_set_file_comment()
-
-This function was replaced with zip_file_set_comment(); an argument was promoted from
-int to zip_uint16_t, and a zip_flags_t argument was added.
-
-** integer type size changes
-
-Some argument and return values were not the right size or sign.
-
-*** zip_name_locate()
-
-The return value was int, which can be too small. The function now returns zip_int64_t.
-
-
-*** zip_get_num_entries()
-
-The return type is now signed, to allow signaling errors.
-
-*** zip_set_archive_comment()
-
-The last argument changed from int to zip_uint16_t.
-
-** extra field handling rewritten
-
-The zip_get_file_extra() and zip_set_file_extra() functions were removed.
-They only worked on the whole extra field set.
-
-Instead, you can now set, get, count, and delete each extra field separately,
-using the functions:
-zip_file_extra_field_delete()
-zip_file_extra_field_delete_by_id()
-zip_file_extra_field_get()
-zip_file_extra_field_get_by_id()
-zip_file_extra_fields_count()
-zip_file_extra_fields_count_by_id()
-zip_file_extra_field_set()
-Please read the corresponding man pages for details.
-
-** new functions
-
-*** zip_discard()
-
-The new zip_discard() function closes an archive without committing the
-scheduled changes.
-
-*** zip_set_file_compression()
-
-The new zip_set_file_compression() function allows setting compression
-levels for files.
-
-** argument changes
-
-*** file names
-
-File names arguments are now allowed to be NULL to have an empty file name.
-This mostly affects zip_file_add(), zip_dir_add(), and zip_file_rename().
-
-For zip_get_name(), zip_file_get_comment(), and zip_get_archive_comment(), if
-the file name or comment is empty, a string of length 0 is returned.
-NULL is returned for errors only.
-
-Previously, NULL was returned for empty/unset file names and comments and
-errors, leaving no way to differentiate between the two.
-
-/* Local Variables:  */
-/* mode: org         */
-/* End:              */
-
diff --git a/API-CHANGES.md b/API-CHANGES.md
new file mode 100644 (file)
index 0000000..24e3d8e
--- /dev/null
@@ -0,0 +1,162 @@
+# libzip API changes
+
+This file describes changes in the libzip API and how to adapt your
+code for them.
+
+You can define `ZIP_DISABLE_DEPRECATED` before including `<zip.h>` to hide
+prototypes for deprecated functions, to find out about functions that
+might be removed at some point.
+
+## Changed in libzip-1.0
+
+### new type `zip_error_t`
+
+Error information is stored in the newly public type `zip_error_t`. Use
+this to access information about an error, instead of the deprecated
+functions that operated on two ints.
+
+deprecated functions:
+- `zip_error_get_sys_type()`
+- `zip_error_get()`
+- `zip_error_to_str()`
+- `zip_file_error_get()`
+
+See their man pages for instructions on how to replace them.
+
+The most common affected use is `zip_open`. The new recommended usage
+is:
+
+```c
+int err;
+if ((za = zip_open(archive, flags, &err)) == NULL) {
+       zip_error_t error;
+       zip_error_init_with_code(&error, err);
+       fprintf(stderr, "can't open zip archive '%s': %s\n", archive, zip_error_strerror(&error));
+       zip_error_fini(&error);
+}
+```
+
+### more typedefs
+
+The following typedefs have been added for better readability:
+
+```c
+typedef struct zip zip_t;
+typedef struct zip_file zip_file_t;
+typedef struct zip_source zip_source_t;
+typedef struct zip_stat zip_stat_t;
+```
+
+This means you can use "`zip_t`" instead of "`struct zip`", etc.
+
+
+### torrentzip support removed
+
+torrentzip depends on a particular zlib version which is by now quite
+old.
+
+## Changed in libzip-0.11
+
+### new type `zip_flags_t`
+
+The functions which have flags now use the `zip_flags_t` type for this.
+All old flags fit; you need only to adapt code if you were saving flags in a
+local variable. Use `zip_flags_t` for such a variable.
+This affects:
+- `zip_fopen()`
+- `zip_fopen_encrypted()`
+- `zip_fopen_index()`
+- `zip_fopen_index_encrypted()`
+- `zip_get_archive_comment()`
+- `zip_get_archive_flag()`
+- `zip_get_num_entries()`
+- `zip_get_name()`
+- `zip_name_locate()`
+- `zip_set_archive_flag()`
+- `zip_source_zip()`
+- `zip_stat()`
+- `zip_stat_index()`
+
+#### `ZIP_FL_*`, `ZIP_AFL_*`, `ZIP_STAT_*` are now unsigned constants
+
+To match the new `zip_flags_t` type.
+
+#### `zip_add()`, `zip_add_dir()`
+
+These functions were replaced with `zip_file_add()` and `zip_dir_add()`, respectively,
+to add a flags argument.
+
+#### `zip_rename()`, `zip_replace()`
+
+These functions were replaced with `zip_file_rename()` and `zip_file_replace()`,
+respectively, to add a flags argument.
+
+#### `zip_get_file_comment()`
+
+This function was replaced with `zip_file_get_comment()`; one argument was promoted from
+`int` to `zip_uint32_t`, the other is now a `zip_flags_t`.
+
+#### `zip_set_file_comment()`
+
+This function was replaced with `zip_file_set_comment()`; an argument was promoted from
+`int` to `zip_uint16_t`, and a `zip_flags_t` argument was added.
+
+### integer type size changes
+
+Some argument and return values were not the right size or sign.
+
+#### `zip_name_locate()`
+
+The return value was `int`, which can be too small. The function now returns `zip_int64_t`.
+
+
+#### `zip_get_num_entries()`
+
+The return type is now signed, to allow signaling errors.
+
+#### `zip_set_archive_comment()`
+
+The last argument changed from `int` to `zip_uint16_t`.
+
+### extra field handling rewritten
+
+The `zip_get_file_extra()` and `zip_set_file_extra()` functions were removed.
+They only worked on the whole extra field set.
+
+Instead, you can now set, get, count, and delete each extra field separately,
+using the functions:
+- `zip_file_extra_field_delete()`
+- `zip_file_extra_field_delete_by_id()`
+- `zip_file_extra_field_get()`
+- `zip_file_extra_field_get_by_id()`
+- `zip_file_extra_fields_count()`
+- `zip_file_extra_fields_count_by_id()`
+- `zip_file_extra_field_set()`
+
+Please read the corresponding man pages for details.
+
+### new functions
+
+#### `zip_discard()`
+
+The new `zip_discard()` function closes an archive without committing the
+scheduled changes.
+
+#### `zip_set_file_compression()`
+
+The new `zip_set_file_compression()` function allows setting compression
+levels for files.
+
+### argument changes
+
+#### file names
+
+File names arguments are now allowed to be `NULL` to have an empty file name.
+This mostly affects `zip_file_add()`, `zip_dir_add()`, and `zip_file_rename()`.
+
+For `zip_get_name()`, `zip_file_get_comment()`, and `zip_get_archive_comment()`, if
+the file name or comment is empty, a string of length 0 is returned.
+`NULL` is returned for errors only.
+
+Previously, `NULL` was returned for empty/unset file names and comments and
+errors, leaving no way to differentiate between the two.
index deceb65..69cdb8b 100644 (file)
@@ -16,16 +16,35 @@ INCLUDE(CheckStructHasMember)
 INCLUDE(TestBigEndian)
 INCLUDE(GNUInstallDirs)
 
+OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
+
 SET(PACKAGE "libzip")
 SET(PACKAGE_NAME ${PACKAGE})
 SET(PACKAGE_VERSION_MAJOR "1")
-SET(PACKAGE_VERSION_MINOR "3")
-SET(PACKAGE_VERSION_PATCH "2")
+SET(PACKAGE_VERSION_MINOR "4")
+SET(PACKAGE_VERSION_MICRO "0")
 #SET(VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
-SET(VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
+SET(VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_MICRO}")
 SET(PACKAGE_VERSION ${VERSION})
+SET(LIBZIP_VERSION ${PACKAGE_VERSION})
+SET(LIBZIP_VERSION_MAJOR ${PACKAGE_VERSION_MAJOR})
+SET(LIBZIP_VERSION_MINOR ${PACKAGE_VERSION_MINOR})
+SET(LIBZIP_VERSION_MICRO ${PACKAGE_VERSION_MICRO})
 SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 
+SET(ARCHIVE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION})
+ADD_CUSTOM_TARGET(dist
+  COMMAND git config tar.tar.xz.command "xz -c"
+  COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${ARCHIVE_NAME}.tar.gz HEAD
+  COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${ARCHIVE_NAME}.tar.xz HEAD
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+  )
+IF(BUILD_SHARED_LIBS)
+  SET(HAVE_SHARED TRUE)
+ELSE()
+  SET(ZIP_STATIC TRUE)
+ENDIF()
+
 # Checks
 
 CHECK_FUNCTION_EXISTS(_chmod HAVE__CHMOD)
@@ -42,6 +61,7 @@ CHECK_FUNCTION_EXISTS(_strtoi64 HAVE__STRTOI64)
 CHECK_FUNCTION_EXISTS(_strtoui64 HAVE__STRTOUI64)
 CHECK_FUNCTION_EXISTS(_umask HAVE__UMASK)
 CHECK_FUNCTION_EXISTS(_unlink HAVE__UNLINK)
+CHECK_FUNCTION_EXISTS(clonefile HAVE_CLONEFILE)
 CHECK_FUNCTION_EXISTS(explict_bzero HAVE_EXPLICIT_BZERO)
 CHECK_FUNCTION_EXISTS(explicit_memset HAVE_EXPLICIT_MEMSET)
 CHECK_FUNCTION_EXISTS(fileno HAVE_FILENO)
@@ -95,7 +115,7 @@ TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
 
 FIND_PACKAGE(ZLIB REQUIRED)
 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
-set(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIR})
+SET(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIR})
 IF(ZLIB_VERSION_STRING VERSION_LESS "1.1.2")
   MESSAGE(FATAL_ERROR "-- ZLIB version too old, please install at least v1.1.2")
 ENDIF(ZLIB_VERSION_STRING VERSION_LESS "1.1.2")
@@ -113,12 +133,20 @@ ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
 ADD_DEFINITIONS("-D_CRT_NONSTDC_NO_DEPRECATE")
 ENDIF(MSVC)
 
+if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
+  ADD_DEFINITIONS(-DMS_UWP)
+  SET (OPTIONAL_LIBRARY "${OPTIONAL_LIBRARY}" bcrypt)
+endif(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
+
 ADD_DEFINITIONS("-DHAVE_CONFIG_H")
 
 # rpath handling: use rpath in installed binaries
 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
+# Testing
+ENABLE_TESTING()
+
 # Targets
 ADD_SUBDIRECTORY(lib)
 ADD_SUBDIRECTORY(man)
@@ -137,15 +165,13 @@ ENDIF()
 SET(LIBS "${LIBS} -lz")
 IF(CMAKE_SYSTEM_NAME MATCHES BSD)
   SET(PKG_CONFIG_RPATH "-Wl,-R\${libdir}")
-ENDif(CMAKE_SYSTEM_NAME MATCHES BSD)
+ENDIF(CMAKE_SYSTEM_NAME MATCHES BSD)
 CONFIGURE_FILE(libzip.pc.in libzip.pc @ONLY)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzip.pc DESTINATION lib/pkgconfig)
 
 # write out config file
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake-config.h.in
-  ${CMAKE_CURRENT_BINARY_DIR}/config.h)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake-zipconf.h.in
-  ${CMAKE_CURRENT_BINARY_DIR}/zipconf.h)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake-zipconf.h.in ${CMAKE_CURRENT_BINARY_DIR}/zipconf.h)
 
 # for tests
 
@@ -159,6 +185,7 @@ FILE(COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/runtest
   FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
 )
 
+
 # installation
 
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zipconf.h DESTINATION lib/libzip/include)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zipconf.h DESTINATION include)
diff --git a/INSTALL b/INSTALL
deleted file mode 100644 (file)
index 54caf7c..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,229 +0,0 @@
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
-Foundation, Inc.
-
-   This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-
-   These are generic installation instructions.
-
-   The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions.  Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
-   It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  (Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.)
-
-   If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release.  If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
-   The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
-  1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.  If you're
-     using `csh' on an old version of System V, you might need to type
-     `sh ./configure' instead to prevent `csh' from trying to execute
-     `configure' itself.
-
-     Running `configure' takes awhile.  While running, it prints some
-     messages telling which features it is checking for.
-
-  2. Type `make' to compile the package.
-
-  3. Optionally, type `make check' to run any self-tests that come with
-     the package.
-
-  4. Type `make install' to install the programs and any data files and
-     documentation.
-
-  5. You can remove the program binaries and object files from the
-     source code directory by typing `make clean'.  To also remove the
-     files that `configure' created (so you can compile the package for
-     a different kind of computer), type `make distclean'.  There is
-     also a `make maintainer-clean' target, but that is intended mainly
-     for the package's developers.  If you use it, you may have to get
-     all sorts of other programs in order to regenerate files that came
-     with the distribution.
-
-Compilers and Options
-=====================
-
-   Some systems require unusual options for compilation or linking that
-the `configure' script does not know about.  Run `./configure --help'
-for details on some of the pertinent environment variables.
-
-   You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment.  Here
-is an example:
-
-     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
-
-   *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
-   You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory.  To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'.  `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
-   If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory.  After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
-
-Installation Names
-==================
-
-   By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc.  You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
-   You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files.  If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
-   In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
-kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
-   If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
-   Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System).  The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
-   For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
-   There may be some features `configure' cannot figure out
-automatically, but needs to determine by the type of machine the package
-will run on.  Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
-a message saying it cannot guess the machine type, give it the
-`--build=TYPE' option.  TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
-     CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
-     OS KERNEL-OS
-
-   See the file `config.sub' for the possible values of each field.  If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
-   If you are _building_ compiler tools for cross-compiling, you should
-use the `--target=TYPE' option to select the type of system they will
-produce code for.
-
-   If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
-   If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists.  Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
-   Variables not defined in a site shell script can be set in the
-environment passed to `configure'.  However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost.  In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'.  For example:
-
-     ./configure CC=/usr/local2/bin/gcc
-
-will cause the specified gcc to be used as the C compiler (unless it is
-overridden in the site shell script).
-
-`configure' Invocation
-======================
-
-   `configure' recognizes the following options to control how it
-operates.
-
-`--help'
-`-h'
-     Print a summary of the options to `configure', and exit.
-
-`--version'
-`-V'
-     Print the version of Autoconf used to generate the `configure'
-     script, and exit.
-
-`--cache-file=FILE'
-     Enable the cache: use and save the results of the tests in FILE,
-     traditionally `config.cache'.  FILE defaults to `/dev/null' to
-     disable caching.
-
-`--config-cache'
-`-C'
-     Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
-     Do not print messages saying which checks are being made.  To
-     suppress all normal output, redirect it to `/dev/null' (any error
-     messages will still be shown).
-
-`--srcdir=DIR'
-     Look for the package's source code in directory DIR.  Usually
-     `configure' can determine that directory automatically.
-
-`configure' also accepts some other, not widely useful, options.  Run
-`configure --help' for more details.
-
diff --git a/INSTALL.md b/INSTALL.md
new file mode 100644 (file)
index 0000000..72079da
--- /dev/null
@@ -0,0 +1,28 @@
+libzip uses [cmake](https://cmake.org) to build.
+
+For running the tests, you need to have [perl](https://www.perl.org).
+
+You'll need [zlib](http://www.zlib.net/) (at least version 1.1.2). It
+comes with most operating systems.
+
+For supporting bzip2-compressed zip archives, you need
+[bzip2](http://bzip.org/).
+
+The basic usage is
+```sh
+mkdir build
+cd build
+cmake ..
+make
+make test
+make install
+```
+
+Some useful parameters you can pass to `cmake` with `-Dparameter=value`:
+- `BUILD_SHARED_LIBS`: set to `ON` or `OFF` to enable/disable building
+  of shared libraries, defaults to `ON`
+- `CMAKE_INSTALL_PREFIX`: for setting the installation path
+
+You can get verbose build output with by passing `VERBOSE=1` to `make`.
+
+You can also check the [cmake FAQ](https://cmake.org/Wiki/CMake_FAQ).
diff --git a/LICENSE b/LICENSE
index 1c2e86b..cb7be68 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
 The authors can be contacted at <libzip@nih.at>
 
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644 (file)
index f8d487f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# not GPL, thus no COPYING
-AUTOMAKE_OPTIONS=dist-xz foreign
-
-ACLOCAL_AMFLAGS=       -I m4
-
-SUBDIRS=lib man src regress examples
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libzip.pc
-
-EXTRA_DIST=    API-CHANGES \
-               CMakeLists.txt \
-               LICENSE \
-               NEWS.md \
-               README.md \
-               TODO.md \
-               cmake-config.h.in \
-               cmake-zipconf.h.in \
-               libzip-uninstalled.pc.in \
-               libzip.pc.in \
-               m4
-
-not-dist-hook:
-       mkdir $(distdir)/xcode
-       mkdir $(distdir)/xcode/libzip.xcodeproj
-       mkdir $(distdir)/xcode/libzip.xcodeproj/project.xcworkspace
-       cp -p $(srcdir)/xcode/Info.plist \
-                 $(srcdir)/xcode/config.h \
-                 $(srcdir)/xcode/extract-version.sh \
-                 $(srcdir)/xcode/zipconf.h $(distdir)/xcode
-       cp -p $(srcdir)/xcode/libzip.xcodeproj/project.pbxproj $(distdir)/xcode/libzip.xcodeproj
-       cp -p $(srcdir)/xcode/libzip.xcodeproj/project.xcworkspace/contents.xcworkspacedata \
-               $(distdir)/xcode/libzip.xcodeproj/project.xcworkspace
diff --git a/NEWS.md b/NEWS.md
index 400e867..7f07ea4 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,13 @@
+1.4.0 [2017-12-29]
+==================
+
+* Improve build with cmake
+* Retire autoconf/automake build system
+* Add `zip_source_buffer_fragment()`.
+* Add support to clone unchanged beginning of archive (instead of rewriting it).
+  Supported for buffer sources and on Apple File System.
+* Add support for Microsoft Universal Windows Platform.
+
 1.3.2 [2017-11-20]
 ==================
 * Fix bug introduced in last: zip_t was erroneously freed if zip_close() failed.
diff --git a/README-snapshot.md b/README-snapshot.md
deleted file mode 100644 (file)
index 6b8fd9d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-To build libzip from the repository using autotools, you need to
-install autoconf, automake, and libtool; then run
-```shell
-autoreconf -fi
-```
-
-Afterwards you can run configure as usual.
-
-Alternatively, use cmake.
-
-```shell
-mkdir build
-cd build
-cmake .. -DBUILD_SHARED_LIBS:BOOL=ON
-```
-
-If you prefer building a static library, leave define `BUILD_SHARED_LIBS` to `OFF`
index 0ff171f..cc9fdfb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,36 +6,22 @@ Winzip AES and decryption of legacy PKware encrypted files is
 supported. The API is documented by man pages.
 
 For more information, take a look at the included man pages.  You can
-start with [libzip(3)](https:/libzip.org/documentation/libzip.html), which lists
-all others.  Example source code is in the `src/` subdirectory.
+start with [libzip(3)](https://libzip.org/documentation/libzip.html), which lists
+all others.  Example source code is in the `examples/` and  `src/` subdirectories.
 
 If you have developed an application using libzip, you can find out
 about API changes and how to adapt your code for them in the included
-file `API-CHANGES`.
+file [API-CHANGES.md](API-CHANGES.md).
 
-For generic installation instructions, see file `INSTALL`, which
-describes the approach using autoconf; alternatively, you can
-use cmake to build.
-
-Additionally, you'll need zlib (at least version 1.1.2). It comes
-with most operating systems nowadays, or you can get it at
->      http://www.zlib.net/
-
-For supporting bzip2-compressed zip archives, bzip2 from
->      http://bzip.org/
-
-needs to be installed.
-
-When using a static Windows library, you need to define `ZIP_STATIC`
-when compiling packages using libzip.
+See the [INSTALL.md](INSTALL.md) file for installation instructions and
+dependencies.
 
 If you make a binary distribution, please include a pointer to the
 distribution site:
 >      https://libzip.org/
 
-The latest version can always be found there.  The official mercurial
-repository is at https://hg.nih.at/libzip/ and a read-only git mirror
-exists at https://github.com/nih-at/libzip/
+The latest version can always be found there.  The official repository
+is at [github](https://github.com/nih-at/libzip/).
 
 There is a mailing list for developers using libzip.  You can
 subscribe to it by sending a mail with the subject "subscribe
diff --git a/THANKS b/THANKS
index dadd1bd..c441c0c 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -15,6 +15,7 @@ Benjamin Gilbert <bgilbert@backtick.net>
 Boaz Stolk <bstolk@aweta.nl>
 Bogdan <bogiebog@gmail.com>
 Brian 'geeknik' Carpenter <geeknik@protonmail.ch>
+Carl Mastrangelo <notcarl@google.com>
 Cédric Tabin
 Chris Nehren <cnehren+libzip@pobox.com>
 Coverity <info@coverity.com>
@@ -40,6 +41,7 @@ Lubomir I. Ivanov <neolit123@gmail.com>
 Martin Buchholz <martinrb@google.com>
 Martin Szulecki <m.szulecki@libimobiledevice.org>
 Michael Beck <mm.beck@gmx.net>
+Michał Janiszewski
 Michal Vyskocil <mvyskocil@suse.cz>
 Mikhail Gusarov <dottedmag@dottedmag.net>.
 Oliver Kaiser <under.northern.sky@googlemail.com>
diff --git a/TODO.md b/TODO.md
index 1adb737..d896b33 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -1,4 +1,29 @@
-# API Plans
+# Soon
+
+* review guidelines/community standards
+  - (Linux Foundation Core Infrastructure Initiative Best Practices)[https://bestpractices.coreinfrastructure.org/]
+  - (Readme Maturity Level)[https://github.com/LappleApple/feedmereadmes/blob/master/README-maturity-model.md]
+  - (Github Community Profile)[https://github.com/nih-at/libzip/community]
+
+* migration to CMake
+  - replace `make distcheck`
+
+* run Coverity tests automatically via github/travis
+
+* switch to newer fcrypt sources, see https://github.com/BrianGladman/AES/issues/19
+
+* improve man page formatting of tagged lists on webpage (`<dl>`)
+
+* test error cases with special source
+  - tell it which command should fail
+  - use it both as source for `zip_add` and `zip_open_from_source`
+  
+
+# Later
+
+## macOS / iOS framework
+
+* get cmake to optionally build frameworks
 
 ## Prefixes
 
@@ -8,12 +33,11 @@ zip_set_archive_prefix(struct zip *za, const zip_uint8_t *data, zip_uint64_t len
 const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp);
 ````
 
-# Compression
+## Compression
 
-* Test CMAKE for bzip2
 * add lzma support
 
-# API Issues
+## API Issues
 
 * `zip_get_archive_comment` has `int *lenp` argument.  Cleaner would be `zip_uint32_t *`.
   rename and fix.  which other functions for naming consistency?
@@ -22,12 +46,8 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp)
 * compression/crypt error messages a la `ZIP_ER_ZLIB` (no detailed info passing)
 * check arguments for every entry point into libzip
 
-# Features
+## Features
 
-* Winzip AES support
-  * test cases decryption: <=20, >20, stat for both
-  * test cases encryption: no password, default password, file-specific password, 128/192/256, <=20, >20
-  * support testing on macOS
 * consistently use `_zip_crypto_clear()` for passwords
 * support setting extra fields from `zip_source`
   * introduce layers of extra fields:
@@ -66,7 +86,7 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp)
 
 * support for old compression methods?????
 
-# Bugs
+## Bugs
 
 * support InfoZIP encryption header extension (copy data descriptor for encrypted files)
 * ensure that nentries is small enough not to cause overflow (size_t for entry, uint64 for CD on disk)
@@ -78,7 +98,7 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp)
 * `cdr == NULL` -> `ER_NOENT` vs. `idx > cdir->nentry` -> `ER_INVAL` inconsistent (still there?)
 
 
-# Cleanup
+## Cleanup
 
 * go over cdir parser and rename various offset/size variables to make it clearer
 * use bool
@@ -87,17 +107,23 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp)
 * get rid of `zip_get_{compression,encryption}_implementation()`
 * use `zip_*int*_t` internally
 
-# Analysis
+## Analysis
 
 * pass through coverity
 
-# Infrastructure
+## Infrastructure
 
-* create CMakefile.txt man page linking from links file
-* handle missing mandoc on Linux
+* rewrite make_zip_errors.sh in cmake
+* rewrite make_zip_err_str.sh in cmake
+* configure appveyor for Windows builds of libzip
 
-# Test Case Issues
+## Test Case Issues
 
+* consider testing for malloc/realloc failures (see `ckmame/regress/malloc.c`)
+* Winzip AES support
+  * test cases decryption: <=20, >20, stat for both
+  * test cases encryption: no password, default password, file-specific password, 128/192/256, <=20, >20
+  * support testing on macOS
 * add test cases for lots of files (including too many)
 * add test cases for holes (between files, between files and cdir, between cdir and eocd, + zip64 where appropriate)
 * unchange on added file
@@ -154,7 +180,7 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp)
   * zip_open_from_source
 * read two zip entries interleaved
 
-# Unsorted
+## Unsorted
 
 * `zip_source_file()`: don't allow write if start/len specify a part of the file
 * script to check if all exported symbols are marked with `ZIP_EXTERN`, add to make distcheck
index 0d1839c..0624a2b 100644 (file)
@@ -19,6 +19,7 @@
 #cmakedefine HAVE__STRTOUI64
 #cmakedefine HAVE__UMASK
 #cmakedefine HAVE__UNLINK
+#cmakedefine HAVE_CLONEFILE
 #cmakedefine HAVE_FILENO
 #cmakedefine HAVE_FSEEKO
 #cmakedefine HAVE_FTELLO
 #cmakedefine SIZE_T_LIBZIP ${SIZE_T_LIBZIP}
 #cmakedefine SSIZE_T_LIBZIP ${SSIZE_T_LIBZIP}
 #cmakedefine HAVE_DIRENT_H
+#cmakedefine HAVE_FTS_H
 #cmakedefine HAVE_NDIR_H
 #cmakedefine HAVE_SYS_DIR_H
 #cmakedefine HAVE_SYS_NDIR_H
 #cmakedefine WORDS_BIGENDIAN
+#cmakedefine HAVE_SHARED
 /* END DEFINES */
 #define PACKAGE "@PACKAGE@"
 #define VERSION "@VERSION@"
index 6a276f6..f0e24e8 100644 (file)
@@ -8,6 +8,13 @@
    based on ../cmake-zipconf.h.in.
  */
 
+#cmakedefine LIBZIP_VERSION "@PACKAGE_VERSION@"
+#cmakedefine LIBZIP_VERSION_MAJOR @PACKAGE_VERSION_MAJOR@
+#cmakedefine LIBZIP_VERSION_MINOR @PACKAGE_VERSION_MINOR@
+#cmakedefine LIBZIP_VERSION_MICRO @PACKAGE_VERSION_MICRO@
+
+#cmakedefine ZIP_STATIC
+
 #cmakedefine HAVE_INTTYPES_H_LIBZIP
 #cmakedefine HAVE_STDINT_H_LIBZIP
 #cmakedefine HAVE_SYS_TYPES_H_LIBZIP
diff --git a/configure.ac b/configure.ac
deleted file mode 100644 (file)
index fe54a18..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-AC_PREREQ([2.60])
-AC_INIT([libzip],[1.3.2],[libzip@nih.at])
-AC_CONFIG_SRCDIR([lib/zip_add.c])
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE
-
-AC_CANONICAL_HOST
-dnl Add rpath flags to installed pkg-config (.pc) file on systems that prefer it this way.
-case $host_os in
-    *bsd*)
-        PKG_CONFIG_RPATH=-Wl,-R\${libdir};;
-    *)
-        PKG_CONFIG_RPATH=;;
-esac
-AC_SUBST(PKG_CONFIG_RPATH)
-
-
-AC_PROG_CC
-AC_SYS_LARGEFILE
-AM_PROG_CC_C_O
-AC_C_BIGENDIAN
-
-AC_ARG_WITH(zlib,
-    [  --with-zlib=PREFIX  specify prefix for ZLIB library],,
-    with_zlib=yes)
-
-if test "$with_zlib" != "yes"
-then
-    if test -f "$with_zlib"/zlib.h
-    then
-       # PREFIX is to uninstalled version in distribution directory
-       CFLAGS="$CFLAGS -I$with_zlib"
-       LDFLAGS="$LDFLAGS -L$with_zlib"
-    else if test -f "$with_zlib"/include/zlib.h
-    then
-       # PREFIX is installation prefix
-       CFLAGS="$CFLAGS -I$with_zlib/include"
-       LDFLAGS="$LDFLAGS -L$with_zlib/lib"
-    fi
-    fi
-fi
-
-AC_CHECK_LIB(z, main)
-AC_CACHE_CHECK(new ZLIB version, id_cv_lib_zlib_ok, 
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[extern ZEXPORT int unzOpen (const char *path);]])],[id_cv_lib_zlib_ok=yes],[id_cv_lib_zlib_ok=no]))
-if test "$id_cv_lib_zlib_ok" = "no"
-then
-    AC_MSG_ERROR([ZLIB version too old, please install at least v1.1.2])
-fi
-
-AC_ARG_WITH(bzip2,
-    [  --with-bzip2=PREFIX  specify prefix for bzip2 library],,
-    with_bzip2=yes)
-
-if test "$with_bzip2" != "yes"
-then
-    if test -f "$with_bzip2"/bzlib.h
-    then
-       # PREFIX is to uninstalled version in distribution directory
-       CFLAGS="$CFLAGS -I$with_bzip2"
-       LDFLAGS="$LDFLAGS -L$with_bzip2"
-    else if test -f "$with_bzip2"/include/bzlib.h
-    then
-       # PREFIX is installation prefix
-       CFLAGS="$CFLAGS -I$with_bzip2/include"
-       LDFLAGS="$LDFLAGS -L$with_bzip2/lib"
-    fi
-    fi
-fi
-if test "$with_bzip2" != "no"
-then
-    AC_CHECK_LIB(bz2, main)
-fi
-
-AC_EXEEXT
-
-LT_INIT
-
-if test "$enable_shared" = "yes"
-then
-    AC_DEFINE([HAVE_SHARED], [1], [Define when building shared libraries])
-fi
-
-AC_CHECK_FUNCS([_chmod _close _dup _fdopen _fileno _open _setmode _snprintf _strdup _stricmp _strtoi64 _strtoui64 _umask _unlink explicit_bzero explicit_memset fileno fseeko ftello getopt getprogname open setmode snprintf strcasecmp strdup stricmp strtoll strtoull])
-AC_CHECK_FUNCS([mkstemp], [], [AC_LIBOBJ(mkstemp)])
-
-dnl assume dlsym in libc, but check in libdl
-DLSYM_LIB=
-AC_CHECK_LIB([dl], [dlsym], [DLSYM_LIB="-ldl"])
-AC_SUBST([DLSYM_LIB])
-
-AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname,
-              [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
-                                                [[ extern char *__progname; printf("%s", __progname); ]])],
-                                                [ ac_cv_libc_defines___progname="yes" ],
-                                                [ ac_cv_libc_defines___progname="no" ])
-              ])
-if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
-    AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname])
-fi
-
-AC_CACHE_CHECK([whether we are building for a Win32 host], [ac_cv_win32_host],
-              AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#ifdef _WIN32
- choke me
- #endif
- ]])],
- [ac_cv_win32_host=no], [ac_cv_win32_host=yes]))
-AM_CONDITIONAL([WIN32_HOST], [test "x$ac_cv_win32_host" = "xyes"])
-
-AC_CHECK_HEADERS([fts.h stdbool.h strings.h unistd.h])
-
-AC_CHECK_TYPES([int8_t])
-AC_CHECK_TYPES([int16_t])
-AC_CHECK_TYPES([int32_t])
-AC_CHECK_TYPES([int64_t])
-AC_CHECK_TYPES([uint8_t])
-AC_CHECK_TYPES([uint16_t])
-AC_CHECK_TYPES([uint32_t])
-AC_CHECK_TYPES([uint64_t])
-AC_CHECK_TYPES([ssize_t])
-
-AC_CHECK_SIZEOF([short])
-AC_CHECK_SIZEOF([int])
-AC_CHECK_SIZEOF([long])
-AC_CHECK_SIZEOF([long long])
-AC_CHECK_SIZEOF([off_t])
-AC_CHECK_SIZEOF([size_t])
-
-AC_STRUCT_TIMEZONE
-
-case $host_os
-in
-    *bsd*) MANFMT=mdoc;;
-    *) MANFMT=man;;
-esac
-AC_SUBST([MANFMT])
-
-AH_BOTTOM([
-#ifndef HAVE_SSIZE_T
-#  if SIZEOF_SIZE_T == SIZEOF_INT
-typedef int ssize_t;
-#  elif SIZEOF_SIZE_T == SIZEOF_LONG
-typedef long ssize_t;
-#  elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
-typedef long long ssize_t;
-#  else
-#error no suitable type for ssize_t found
-#  endif
-#endif
-])
-
-gl_VISIBILITY
-
-AC_CONFIG_FILES([Makefile
-                libzip.pc
-                libzip-uninstalled.pc
-                examples/Makefile
-                man/Makefile
-                lib/Makefile
-                lib/gladman-fcrypt/Makefile
-                regress/Makefile
-                src/Makefile])
-AC_OUTPUT
diff --git a/create-cmake-config.h.in.pl b/create-cmake-config.h.in.pl
deleted file mode 100755 (executable)
index 9e06ceb..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env perl
-# Haiku OS: we don't care!
-
-use strict;
-
-my $in = 'cmake-config.h.in';
-my $out = "$in.$$";
-
-my ($fin, $fout);
-open $fin, "< $in" or die "can't open $in: $!";
-open $fout, "> $out" or die "can't create $out: $!";
-
-my $zipconf_defines = read_zipconf_defines();
-
-my $in_defines = 0;
-while (my $line = <$fin>) {
-       if ($in_defines) {
-               if ($line =~ m,/* END DEFINES,) {
-                       $in_defines = 0;
-               }
-               else {
-                       next;
-               }
-       }
-       print $fout $line;
-       if ($line =~ m,/\* BEGIN DEFINES,) {
-               $in_defines = 1;
-               add_defines($fout, $zipconf_defines);
-       }
-}
-
-close $fin;
-close $fout;
-
-rename($out, $in);
-
-sub add_defines {
-       my ($fout, $zipconf_defines) = @_;
-
-       my $fin;
-       open $fin, "< CMakeLists.txt" or die "can't open CMakeLists.txt: $!";
-
-       while (my $line = <$fin>) {
-               my ($key, $value);
-
-               if ($line =~ m/CHECK_TYPE_SIZE\(.* (\S*)\)/) {
-                       $key = $1;
-                       $value = "\${$1}";
-               }
-               elsif ($line =~ m/CHECK_\S*\(.* (\S*)\)/) {
-                       $key = $1;
-               }
-
-               if (defined($key) && !defined($zipconf_defines->{$key})) {
-                       print $fout "#cmakedefine $key" . ($value ? " $value" : "") . "\n";
-               }
-       }
-
-       close $fin;
-}
-
-sub read_zipconf_defines {
-       my %zipconf_defines = ();
-
-       my $fin;
-       open $fin, "< cmake-zipconf.h.in" or die "can't open cmake-zipconf.h.in: $!";
-
-       while (my $line = <$fin>) {
-               if ($line =~ m/#cmakedefine\s+(\S+)/) {
-                       $zipconf_defines{$1} = 1;
-               }
-       }
-
-       close $fin;
-
-       return \%zipconf_defines;
-}
diff --git a/docs/aes_coding_tips.txt b/docs/aes_coding_tips.txt
deleted file mode 100644 (file)
index 052864a..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-AES Coding Tips for Developers
-
-NOTE: WinZip^(R) users do not need to read or understand the information
-contained on this page. It is intended for developers of Zip file utilities.
-
-This document contains information that may be helpful to developers and other
-interested parties who wish to support the AE-1 and AE-2 AES encryption formats
-in their own Zip file utilities. WinZip Computing makes no warranties regarding
-the information provided in this document. In particular, WinZip Computing does
-not represent or warrant that the information provided here is free from errors
-or is suitable for any particular use, or that the file formats described here
-will be supported in future versions of WinZip. You should test and validate
-all code and techniques in accordance with good programming practice.
-
-This information supplements the basic encryption specification document found
-here.
-
-This document assumes that you are using Dr. Brian Gladman's AES encryption
-package. Dr. Gladman has generously made public a sample application that
-demonstrates the use of his encryption/decryption and other routines, and the
-code samples shown below are derived from this sample application. Dr.
-Gladman's AES library and the sample application are available from the AES
-project page on Dr. Gladman's web site.
-
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
-Generating a salt value
-
-Please read the discussion of salt values in the encryption specification.
-
-Dr. Gladman has provided a pseudo-random number generator in the files PRNG.C
-and PRNG.H. You may find this suitable for generating salt values. These files
-are included in the sample package available through the AES project page on
-Dr. Gladman's web site.
-
-Here are guidelines for using Dr. Gladman's generator. Note that the generator
-is used rather like an I/O stream: it is opened (initialized), used, and
-finally closed. To obtain the best results, it is recommended that you
-initialize the generator when your application starts and close it when your
-application closes. (If you are coding in C++, you may wish to wrap these
-actions in a C++ class that initializes the generator on construction and
-closes it on destruction.)
-
- 1. You will need to provide an entropy function in your code for
-    initialization of the generator. The entropy function need not be
-    particularly sophisticated for this use. Here is one possibility for such a
-    function, based primarily upon the Windows performance counter:
-
-    int entropy_fun(
-     unsigned char buf[],
-     unsigned int len)
-        {
-        unsigned __int64 pentium_tsc[1];
-        unsigned int     i;
-        static unsigned int num = 0;
-        // this sample code returns the following sequence of entropy information
-        // - the current 8-byte Windows performance counter value
-        // - an 8-byte representation of the current date/time
-        // - an 8-byte value built from the current process ID and thread ID
-        // - all subsequent calls return the then-current 8-byte performance
-        //      counter value
-        switch (num)
-            {
-        case 1:
-            ++num;
-            // use a value that is unlikely to repeat across system reboots
-            GetSystemTimeAsFileTime((FILETIME *)pentium_tsc);
-            break;
-        case 2:
-            ++num;
-            {
-            // use a value that distinguishes between different instances of this
-            // code that might be running on different processors at the same time
-            unsigned __int32 processtest = GetCurrentProcessId();
-            unsigned __int32 threadtest = GetCurrentThreadId();
-            pentium_tsc[0] = processtest;
-            pentium_tsc[0] = (pentium_tsc[0] << 32) + threadtest;
-            }
-            break;
-        case 0:
-            ++num;
-            // fall through to default case
-        default:
-            // use a rapidly-changing value
-            //  Note: check QueryPerformanceFrequency() first to
-            //  ensure that QueryPerformanceCounter() will work.
-            QueryPerformanceCounter((LARGE_INTEGER *)pentium_tsc);
-            break;
-            }
-        for(i = 0; i < 8 && i < len; ++i)
-            buf[i] = ((unsigned char*)pentium_tsc)[i];
-        return i;
-        }
-
-    Note: the required prototype for the entropy function is defined in PRNG.H.
-
- 2. Initialize the generator by calling prng_init(), providing the addresses of
-    your entropy function and of an instance of a prng_ctx structure (defined
-    in PRNG.H). The prng_ctx variable maintains a context for the generator and
-    is used as a parameter for the other generator functions. Therefore, the
-    variable's state must be maintained until the generator is closed.
-
-    prng_ctx ctx;
-    prng_init(entropy_fun, &ctx);
-
-    You only need to do this once per application session (as long as you keep
-    the "stream" open).
-
- 3. To obtain a sequence of random bytes of arbitrary size, use prng_rand().
-    This code obtains 16 random bytes, suitable for use as a salt value for
-    256-bit AES encryption:
-
-    unsigned char buffer[16];
-    prng_rand(buffer, sizeof(buffer), &ctx);
-
-    Note that the ctx parameter is the same prng_ctx variable that was used in
-    the initialization call.
-
- 4. When you are done with the generator (this would normally be when your
-    application closes), close it by calling prng_end:
-
-    prng_end(&ctx);
-
-    Again, the ctx parameter is the same prng_ctx variable that was used in the
-    initialization call.
-
-Encryption and decryption
-
-The actual encryption and decryption of data are handled quite similarly, and
-again are rather stream-like: a stream is "opened", data is passed to it for
-encryption or decryption, and then it is closed. The password verifier is
-returned when the stream is opened, and the authentication code is returned
-when the stream is closed.
-
-Here is the basic technique:
-
- 1. Initialize the "stream" for encryption or decryption and obtain the
-    password verification value.
-
-    There is no difference in the initialization, regardless of whether you are
-    encrypting or decrypting:
-
-    fcrypt_ctx zctx;     // the encryption context
-    int rc = fcrypt_init(
-      KeySize,       // extra data value indicating key size
-      pszPassword,     // the password
-      strlen(pszPassword), // number of bytes in password
-      achSALT,       // the salt
-      achPswdVerifier,   // on return contains password verifier
-      &zctx);       // encryption context
-
-    The return value is 0 if the initialization was successful; non-zero values
-    indicate errors. Note that passwords are null-terminated ANSI strings;
-    embedded nulls must not be used. (To avoid incompatibilities between the
-    various character sets in use, especially in different versions of Windows,
-    users should be encouraged to use passwords containing only the "standard"
-    characters in the range 32-127.)
-
-    The function returns the password verification value in achPswdVerifier,
-    which must be a 2-byte buffer. If you are encrypting, store this value in
-    the Zip file as indicated by the encryption specification. If you are
-    decrypting, compare this returned value to the value stored in the Zip
-    file. If they are different, then either the password provided by your user
-    was incorrect or the encrypted file has been altered in some way since it
-    was encrypted. (Note that if they match, there is still a 1 in 65,536
-    chance that an incorrect password was provided.)
-
-    The initialized encryption context (zctx) is used as a parameter to the
-    encryption/decryption functions. Therefore, its state must be maintained
-    until the "stream" is closed.
-
- 2. Encrypt or decrypt the data.
-
-    To encrypt:
-
-    fcrypt_encrypt(
-      pchData, // pointer to the data to encrypt
-      cb,   // how many bytes to encrypt
-      &zctx); // encryption context
-
-    To decrypt:
-
-    fcrypt_decrypt(
-      pchData, // pointer to the data to decrypt
-      cb,   // how many bytes to decrypt
-      &zctx); // decryption context
-
-    You may need to call the encrypt or decrypt function multiple times,
-    passing in successive chunks of data in the buffer. For AE-1 and AE-2
-    compatibility, the buffer size must be a multiple of 16 bytes except for
-    the last buffer, which may be smaller. For efficiency, a larger buffer size
-    such as 32,768 would generally be used.
-
-    Note: to encrypt zero-length files, simply skip this step. You will still
-    obtain and use the password verifier (step 1) and authentication code (step
-    3).
-
- 3. Close the "stream" and obtain the authentication code.
-
-    When encryption/decryption is complete, close the "stream" as follows:
-
-    int rc = fcrypt_end(
-      achMAC, // on return contains the authentication code
-      &zctx); // encryption context
-
-    The return value is the size of the authentication code, which will always
-    be 10 for AE-1 and AE-2. The authentication code itself is returned in your
-    buffer at achMAC, which is an array of char, sized to hold at least 10
-    characters. If you are encrypting, store this value in the Zip file as
-    indicated by the encryption specification; if you are decrypting, compare
-    this value to the value stored in the Zip file. If the values are
-    different, either the password is incorrect or the encrypted data has been
-    altered subsequent to storage.
-
-    Note that decryption can fail even if the encrypted data is unaltered and
-    the password verifier was correct in step 1. The password verifier is
-    useful as a quick way to detect most incorrect passwords, but it is not
-    perfect and on rare occasions (1 out of 65,536) it will fail to detect an
-    incorrect password. It is therefore important for you to check the
-    authentication code on completion even though the password verifier was
-    correct.
-
-Notes
-
-  • Dr. Gladman's AES code depends on the byte order (little-endian or
-    big-endian) used by the computing platform the code will run on. This is
-    determined by a C preprocessor constant called PLATFORM_BYTE_ORDER, which
-    is defined in the file AESOPT.H. You should be sure that
-    PLATFORM_BYTE_ORDER gets the proper value for your platform; if it does
-    not, you will need to define it yourself to the correct value. When using
-    the Microsoft compiler on Intel platforms it does get the proper value,
-    which on these platforms is AES_LITTLE_ENDIAN. We have, however, had a
-    report that it does not default properly when Borland C++ Builder is used,
-    and that manual assignment is necessary. For additional information on this
-    topic, refer to the comments within AESOPT.H.
-
-Change history
-
-Changes made in document version 1.04, July, 2008:
-
- A. Sample Entropy Function
-
-    The sample entropy function was changed to include information near the
-    very beginning of the entropy stream that's unique to the day and to the
-    process and thread.
-
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
-Document version: 1.04
-Last modified: July 21, 2008
-
-Copyright(C) 2003-2016 WinZip International LLC.
-All Rights Reserved
diff --git a/docs/aes_info.txt b/docs/aes_info.txt
deleted file mode 100644 (file)
index c7995d5..0000000
+++ /dev/null
@@ -1,607 +0,0 @@
-AES Encryption Information:
-Encryption Specification AE-1 and AE-2
-
-Document version: 1.04
-Last modified: January 30, 2009
-
-NOTE: WinZip^(R) users do not need to read or understand the information
-contained on this page. It is intended for developers of Zip file utilities.
-
-Changes since the original version of this document are summarized in the
-Change History section below.
-
-This document describes the file format that WinZip uses to create
-AES-encrypted Zip files. The AE-1 encryption specification was introduced in
-WinZip 9.0 Beta 1, released in May 2003. The AE-2 encryption specification, a
-minor variant of the original AE-1 specification differing only in how the CRC
-is handled, was introduced in WinZip 9.0 Beta 3, released in January, 2004.
-Note that as of WinZip 11, WinZip itself encrypts most files using the AE-1
-format and encrypts others using the AE-2 format.
-
-From time to time we may update the information provided here, for example to
-document any changes to the file formats, or to add additional notes or
-implementation tips. If you would like to receive e-mail announcements of any
-substantive changes we make to this document, you can sign up below for our
-Developer Information mailing list.
-
-Without compromising the basic Zip file format, WinZip Computing has extended
-the format specification to support AES encryption, and this document fully
-describes the format extension. Additionally, we are providing information
-about a no-cost third-party source for the actual AES encryption code--the same
-code that is used by WinZip. We believe that use of the free encryption code
-and of this specification will make it easy for all developers to add
-compatible advanced encryption to their Zip file utilities.
-
-This document is not a tutorial on encryption or Zip file structure. While we
-have attempted to provide the necessary details of the current WinZip AES
-encryption format, developers and other interested third parties will need to
-have or obtain an understanding of basic encryption concepts, Zip file format,
-etc.
-
-Developers should also review AES Coding Tips page.
-
-WinZip Computing makes no warranties regarding the information provided in this
-document. In particular, WinZip Computing does not represent or warrant that
-the information provided here is free from errors or is suitable for any
-particular use, or that the file formats described here will be supported in
-future versions of WinZip. You should test and validate all code and techniques
-in accordance with good programming practice.
-
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
-Contents
-
- I. Encryption services
-II. Zip file format
-     A. Base format reference
-     B. Compression method and encryption flag
-     C. CRC value
-     D. AES extra data field
-III. Encrypted file storage format
-     A. File format
-     B. Salt value
-     C. Password verification value
-     D. Encrypted file data
-     E. Authentication code
-IV. Changes in WinZip 11
- V. Notes
-     A. Non-files and zero-length files
-     B. "Mixed" Zip files
-     C. Key generation
-VI. FAQs
-VII. Change history
-VIII. Mailing list signup
-
-
-I. Encryption services
-
-To perform AES encryption and decryption, WinZip uses AES functions written by
-Dr. Brian Gladman. The source code for these functions is available in C/C++
-and Pentium family assembler for anyone to use under an open source BSD or GPL
-license from the AES project page on Dr. Gladman's web site. The AES Coding
-Tips page also has some information on the use of these functions. WinZip
-Computing thanks Dr. Gladman for making his AES functions available to anyone
-under liberal license terms.
-
-Dr. Gladman's encryption functions are portable to a number of operating
-systems and can be static linked into your applications, so there are no
-operating system version or library dependencies. In particular, the functions
-do not require Microsoft's Cryptography API.
-
-General information on the AES standard and the encryption algorithm (also
-known as Rijndael) is readily available on the Internet. A good place to start
-is http://www.nist.gov/public_affairs/releases/g00-176.htm.
-
-II. Zip file format
-
- A. Base format reference
-
-    AES-encrypted files are stored within the guidelines of the standard Zip
-    file format using only a new "extra data" field, a new compression method
-    code, and a value in the CRC field dependant on the encryption version,
-    AE-1 or AE-2. The basic Zip file format is otherwise unchanged.
-
-    WinZip sets the version needed to extract and version made by fields in the
-    local and central headers to the same values it would use if the file were
-    not encrypted.
-
-    The basic Zip file format specification used by WinZip is available via FTP
-    from the Info-ZIP group at ftp://ftp.info-zip.org/pub/infozip/doc/
-    appnote-iz-latest.zip.
-
- B. Compression method and encryption flag
-
-    As for any encrypted file, bit 0 of the "general purpose bit flags" field
-    must be set to 1 in each AES-encrypted file's local header and central
-    directory entry.
-
-    Additionally, the presence of an AES-encrypted file in a Zip file is
-    indicated by a new compression method code (decimal 99) in the file's local
-    header and central directory entry, used along with the AES extra data
-    field described below. There is no change in either the version made by or
-    version needed to extract codes.
-
-    The code for the actual compression method is stored in the AES extra data
-    field (see below).
-
- C. CRC value
-
-    For files encrypted using the AE-2 method, the standard Zip CRC value is
-    not used, and a 0 must be stored in this field. Corruption of encrypted
-    data within a Zip file is instead detected via the authentication code
-    field.
-
-    Files encrypted using the AE-1 method do include the standard Zip CRC
-    value. This, along with the fact that the vendor version stored in the AES
-    extra data field is 0x0001 for AE-1 and 0x0002 for AE-2, is the only
-    difference between the AE-1 and AE-2 formats.
-
-    NOTE: Zip utilities that support the AE-2 format are required to be able to
-    read files that were created in the AE-1 format, and during decryption/
-    extraction of files in AE-1 format should verify that the file's CRC
-    matches the value stored in the CRC field.
-
- D. AES extra data field
-     1. A file encrypted with AES encryption will have a special "extra data"
-        field associated with it. This extra data field is stored in both the
-        local header and central directory entry for the file.
-
-        Note: see the Zip file format document referenced above for general
-        information on the format and use of extra data fields.
-
-     2. The extra data header ID for AES encryption is 0x9901. The fields are
-        all stored in Intel low-byte/high-byte order. The extra data field
-        currently has a length of 11: seven data bytes plus two bytes for the
-        header ID and two bytes for the data size. Therefore, the extra data
-        overhead for each file in the archive is 22 bytes (11 bytes in the
-        central header plus 11 bytes in the local header).
-     3. The format of the data in the AES extra data field is as follows. See
-        the notes below for additional information.
-
-        Offset Size(bytes) Content
-
-        0      2           Extra field header ID (0x9901)
-
-        2      2           Data size (currently 7, but subject
-                           to possible increase in the future)
-
-        4      2           Integer version number specific to
-                           the zip vendor
-
-        6      2           2-character vendor ID
-
-        8      1           Integer mode value indicating AES
-                           encryption strength
-
-        9      2           The actual compression method used to
-                           compress the file
-
-     4. Notes
-          ☆ Data size: this value is currently 7, but because it is possible
-            that this specification will be modified in the future to store
-            additional data in this extra field, vendors should not assume that
-            it will always remain 7.
-          ☆ Vendor ID: the vendor ID field should always be set to the two
-            ASCII characters "AE".
-          ☆ Vendor version: the vendor version for AE-1 is 0x0001. The vendor
-            version for AE-2 is 0x0002.
-
-            Zip utilities that support AE-2 must also be able to process files
-            that are encrypted in AE-1 format. The handling of the CRC value is
-            the only difference between the AE-1 and AE-2 formats.
-
-          ☆ Encryption strength: the mode values (encryption strength) for AE-1
-            and AE-2 are:
-
-            Value Strength
-
-            0x01  128-bit encryption key
-
-            0x02  192-bit encryption key
-
-            0x03  256-bit encryption key
-
-            The encryption specification supports only 128-, 192-, and 256-bit
-            encryption keys. No other key lengths are permitted.
-
-            (Note: the current version of WinZip does not support encrypting
-            files using 192-bit keys. This specification, however, does provide
-            for the use of 192-bit keys, and WinZip is able to decrypt such
-            files.)
-
-          ☆ Compression method: the compression method is the one that would
-            otherwise have been stored in the local and central headers for the
-            file. For example, if the file is imploded, this field will contain
-            the compression code 6. This is needed because a compression method
-            of 99 is used to indicate the presence of an AES-encrypted file
-            (see above).
-
-III. Encrypted file storage format
-
- A. File format
-
-    Additional overhead data required for decryption is stored with the
-    encrypted file itself (i.e., not in the headers). The actual format of the
-    stored file is as follows; additional information about these fields is
-    below. All fields are byte-aligned.
-
-    Size     Content
-    (bytes)
-
-    Variable Salt value
-
-    2        Password verification value
-
-    Variable Encrypted file data
-
-    10       Authentication code
-
-    Note that the value in the "compressed size" fields of the local file
-    header and the central directory entry is the total size of all the items
-    listed above. In other words, it is the total size of the salt value,
-    password verification value, encrypted data, and authentication code.
-
- B. Salt value
-
-    The "salt" or "salt value" is a random or pseudo-random sequence of bytes
-    that is combined with the encryption password to create encryption and
-    authentication keys. The salt is generated by the encrypting application
-    and is stored unencrypted with the file data. The addition of salt values
-    to passwords provides a number of security benefits and makes dictionary
-    attacks based on precomputed keys much more difficult.
-
-    Good cryptographic practice requires that a different salt value be used
-    for each of multiple files encrypted with the same password. If two files
-    are encrypted with the same password and salt, they can leak information
-    about each other. For example, it is possible to determine whether two
-    files encrypted with the same password and salt are identical, and an
-    attacker who somehow already knows the contents of one of two files
-    encrypted with the same password and salt can determine some or all of the
-    contents of the other file. Therefore, you should make every effort to use
-    a unique salt value for each file.
-
-    The size of the salt value depends on the length of the encryption key, as
-    follows:
-
-    Key size Salt size
-
-    128 bits 8 bytes
-
-    192 bits 12 bytes
-
-    256 bits 16 bytes
-
- C. Password verification value
-
-    This two-byte value is produced as part of the process that derives the
-    encryption and decryption keys from the password. When encrypting, a
-    verification value is derived from the encryption password and stored with
-    the encrypted file. Before decrypting, a verification value can be derived
-    from the decryption password and compared to the value stored with the
-    file, serving as a quick check that will detect most, but not all,
-    incorrect passwords. There is a 1 in 65,536 chance that an incorrect
-    password will yield a matching verification value; therefore, a matching
-    verification value cannot be absolutely relied on to indicate a correct
-    password.
-
-    Information on how to obtain the password verification value from Dr.
-    Gladman's encryption library can be found on the coding tips page.
-
-    This value is stored unencrypted.
-
- D. Encrypted file data
-
-    Encryption is applied only to the content of files. It is performed after
-    compression, and not to any other associated data. The file data is
-    encrypted byte-for-byte using the AES encryption algorithm operating in
-    "CTR" mode, which means that the lengths of the compressed data and the
-    compressed, encrypted data are the same.
-
-    It is important for implementors to note that, although the data is
-    encrypted byte-for-byte, it is presented to the encryption and decryption
-    functions in blocks. The block size used for encryption and decryption must
-    be the same. To be compatible with the encryption specification, this block
-    size must be 16 bytes (although the last block may be smaller).
-
- E. Authentication code
-
-    Authentication provides a high quality check that the contents of an
-    encrypted file have not been inadvertently changed or deliberately tampered
-    with since they were first encrypted. In effect, this is a super-CRC check
-    on the data in the file after compression and encryption. (Additionally,
-    authentication is essential when using CTR mode encryption because this
-    mode is vulnerable to several trivial attacks in its absence.)
-
-    The authentication code is derived from the output of the encryption
-    process. Dr. Gladman's AES code provides this service, and information
-    about how to obtain it is in the coding tips.
-
-    The authentication code is stored unencrypted. It is byte-aligned and
-    immediately follows the last byte of encrypted data.
-
-    For more discussion about authentication, see the authentication code FAQ
-    below.
-
-IV. Changes in WinZip 11
-
-Beginning with WinZip 11, WinZip makes a change in its use of the AE-1 and AE-2
-file formats. The file formats themselves have not changed, and AES-encrypted
-files created by WinZip 11 are completely compatible with version 1.02 the
-WinZip AES encryption specification, which was published in January 2004.
-
-WinZip 9.0 and WinZip 10.0 stored all AES-encrypted files using the AE-2 file
-format, which does not store the encrypted file's CRC. WinZip 11 instead uses
-the AE-1 file format, which does store the CRC, for most files. This provides
-an extra integrity check against the possibility of hardware or software errors
-that occur during the actual process of file compression/encryption or
-decryption/decompression. For more information on this point, see the
-discussion of the CRC below.
-
-Because for some very small files the CRC can be used to determine the exact
-contents of a file, regardless of the encryption method used, WinZip 11
-continues to use the AE-2 file format, with no CRC stored, for files with an
-uncompressed size of less than 20 bytes. WinZip 11 also uses the AE-2 file
-format for files compressed in BZIP2 format, because the BZIP2 format contains
-its own integrity checks equivalent to those provided by the Zip format's CRC.
-
-Other vendors who support WinZip's AES encryption specification may want to
-consider making a similar change to their own implementations of the
-specification, to get the benefit of the extra integrity check that it
-provides.
-
-Note that the January 2004 version of the WinZip AE-2 specification, version
-1.0.2, already required that all utilities that implemented the AE-2 format
-also be able to process files in AE-1 format, and should check on decryption/
-extraction of those files that the CRC was correct.
-
-V. Notes
-
- A. Non-files and zero-length files
-
-    To reduce Zip file size, it is recommended that non-file entries such as
-    folder/directory entries not be encrypted. This, however, is only a
-    recommendation; it is permissible to encrypt or not encrypt these entries,
-    as you prefer.
-
-    On the other hand, it is recommended that you do encrypt zero-length files.
-    The presence of both encrypted and unencrypted files in a Zip file may
-    trigger user warnings in some Zip file utilities, so the user experience
-    may be improved if all files (including zero-length files) are encrypted.
-
-    If zero-length files are encrypted, the encrypted data portion of the file
-    storage (see above) will be empty, but the remainder of the encryption
-    overhead data must be present, both in the file storage area and in the
-    local and central headers.
-
- B. "Mixed" Zip files
-
-    There is no requirement that all files in a Zip file be encrypted or that
-    all files that are encrypted use the same encryption method or the same
-    password.
-
-    A Zip file can contain any combination of unencrypted files and files
-    encrypted with any of the four currently defined encryption methods (Zip
-    2.0, AES-128, AES-192, AES-256). Encrypted files may use the same password
-    or different passwords.
-
- C. Key Generation
-
-    Key derivation, as used by AE-1 and AE-2 and as implemented in Dr.
-    Gladman's library, is done according to the PBKDF2 algorithm, which is
-    described in the RFC2898 guidelines. An iteration count of 1000 is used. An
-    appropriate number of bits from the resulting hash value are used to
-    compose three output values: an encryption key, an authentication key, and
-    a password verification value. The first n bits become the encryption key,
-    the next m bits become the authentication key, and the last 16 bits (two
-    bytes) become the password verification value.
-
-    As part of the process outlined in RFC 2898 a pseudo-random function must
-    be called; AE-2 uses the HMAC-SHA1 function, since it is a well-respected
-    algorithm that has been in wide use for this purpose for several years.
-
-    Note that, when used in connection with 192- or 256-bit AES encryption, the
-    fact that HMAC-SHA1 produces a 160-bit result means that, regardless of the
-    password that you specify, the search space for the encryption key is
-    unlikely to reach the theoretical 192- or 256-bit maximum, and cannot be
-    guaranteed to exceed 160 bits. This is discussed in section B.1.1 of the
-    RFC2898 specification.
-
-VI. FAQs
-
-  • Why is the compression method field used to indicate AES encryption?
-
-    As opposed to using new version made by and version needed to extract
-    values to signal AES encryption for a file, the new compression method is
-    more likely to be handled gracefully by older versions of existing Zip file
-    utilities. Zip file utilities typically do not attempt to extract files
-    compressed with unknown methods, presumably notifying the user with an
-    appropriate message.
-
-  • How can I guarantee that the salt value is unique?
-
-    In principle, the value of the salt should be different whenever the same
-    password is used more than once, for the reasons described above, but this
-    is difficult to guarantee.
-
-    In practice, the number of bytes in the salt (as specified by AE-1 and
-    AE-2) is such that using a pseudo-random value will ensure that the
-    probability of duplicated salt values is very low and can be safely
-    ignored.
-
-    There is one exception to this: With the 8-byte salt values used with
-    WinZip's 128-bit encryption it is likely that, if approximately 4 billion
-    files are encrypted with the same password, two of the files will have the
-    same salt, so it is advisable to stay well below this limit. Because of
-    this, when using the same password to encrypt very large numbers of files
-    in WinZip's AES encryption format (that is, files totalling in the
-    millions, for example 2000 Zip files, each containing 1000 encrypted
-    files), we recommend the use of 192-bit or 256-bit AES keys, with their 12-
-    and 16-byte salt values, rather than 128-bit AES keys, with their 8-byte
-    salt values.
-
-    Although salt values do not need to be truly random, it is important that
-    they be generated in a way that the probability of duplicated salt values
-    is not significantly higher than that which would be expected if truly
-    random values were being used.
-
-    One technique for generating salt values is presented in the coding tips
-    page.
-
-  • Why is there an authentication code?
-
-    The purpose of the authentication code is to insure that, once a file's
-    data has been compressed and encrypted, any accidental corruption of the
-    encrypted data, and any deliberate attempts to modify the encrypted data by
-    an attacker who does not know the password, can be detected.
-
-    The current consensus in the cryptographic community is that associating a
-    message authentication code (or MAC) with encrypted data has strong
-    security value because it makes a number of attacks more difficult to
-    engineer. For AES CTR mode encryption in particular, a MAC is especially
-    important because a number of trivial attacks are possible in its absence.
-    The MAC used with WinZip's AES encryption is based on HMAC-SHA1-80, a
-    mature and widely respected authentication algorithm.
-
-    The MAC is calculated after the file data has been compressed and
-    encrypted. This order of calculation is referred to as Encrypt-then-MAC,
-    and is preferred by many cryptographers to the alternative order of
-    MAC-then-Encrypt because Encrypt-then-MAC is immune to some known attacks
-    on MAC-then-Encrypt.
-
-  • What is the role of the CRC in WinZip 11?
-
-    Within the Zip format, the primary use of the CRC value is to detect
-    accidental corruption of data that has been stored in the Zip file. With
-    files encrypted according to the Zip 2.0 encryption specification, it also
-    functions to some extent as a method of detecting deliberate attempts to
-    modify the encrypted data, but not one that can be considered
-    cryptographically strong. The CRC is not needed for these purposes with the
-    WinZip AES encryption specification, where the HMAC-SHA1-based
-    authentication code instead serves these roles.
-
-    The CRC has a drawback in that for very small files, such as files with
-    four or fewer bytes, the CRC can be used, independent of the encryption
-    algorithm, to determine the unencrypted contents of the file. And, in
-    general, it is preferable to store as little information as possible about
-    the encrypted file in the unencrypted Zip headers.
-
-    The CRC does serve one purpose that the authentication code does not. The
-    CRC is computed based on the original uncompressed, unencrypted contents of
-    the file, and it is checked after the file has been decrypted and
-    decompressed. In contrast, the authentication code used with WinZip AES
-    encryption is computed after compression/encryption and it is checked
-    before decryption/decompression. In the very rare event of a hardware or
-    software error that corrupts data during compression and encryption, or
-    during decryption and decompression, the CRC will catch the error, but the
-    authentication code will not.
-
-    WinZip 9.0 and WinZip 10.0 used AE-2 for all files that they created, and
-    did not store the CRC. As of WinZip 11, WinZip instead uses AE-1 for most
-    files, storing the CRC as an additional integrity check against hardware or
-    software errors occurring during the actual compression/encryption or
-    decryption/decompression processes. WinZip 11 will continue to use AE-2,
-    with no CRC, for very small files of less than 20 bytes. It will also use
-    AE-2 for files compressed in BZIP2 format, because this format has internal
-    integrity checks equivalent to a CRC check built in.
-
-    Note that the AES-encrypted files created by WinZip 11 are fully compatible
-    with January 2004's version 1.0.2 of the WinZip AES encryption
-    specification, in which both the AE-1 and AE-2 variants of the file format
-    were already defined.
-
-VII. Change history
-
-Changes made in document version 1.04, January, 2009: Minor clarification
-regarding the algorithm used to generate the authentication code.
-
-Changes made in document version 1.03, November, 2006: Minor editorial and
-clarifying changes have been made throughout the document. The following
-substantive technical changes have been made:
-
- A. WinZip 11 Usage of AE-1 and AE-2
-
-    WinZip's AES encryption specification defines two formats, known as AE-1
-    and AE-2, which differ in whether the CRC of the encrypted file is stored
-    in the Zip headers. While the file formats themselves remain unchanged,
-    WinZip's usage of them is changing. Beginning with WinZip 11, WinZip uses
-    the AE-1 format, which includes the CRC of the encrypted file, for many
-    encrypted files, in order to provide an additional integrity check against
-    hardware or software errors occurring during the compression/encryption or
-    decryption/decompression processes. Note that AES-encrypted files created
-    by WinZip 11 are completely compatible with the previous version of the
-    WinZip encryption specification, January 2004's version 1.0.2.
-
- B. The discussion of salt values mentions a limitation that applies to the
-    uniqueness of salt values when very large numbers of files are encrypted
-    with 128-bit encryption.
- C. Older versions of this specification suggested that other vendors might
-    want to use their own vendor IDs to create their own unique encryption
-    formats. We no longer suggest that vendor-specific alternative encryption
-    methods be created in this way.
-
-Changes made in document version 1.02, January, 2004: The introductory text at
-the start of the document has been rewritten, and minor editorial and
-clarifying changes have been made throughout the document. Two substantive
-technical changes have been made:
-
- A. AE-2 Specification
-
-    Standard Zip files store the CRC of each file's unencrypted data. This
-    value is used to help detect damage or other alterations to Zip files.
-    However, storing the CRC value has a drawback in that, for a very small
-    file, such as a file of four or fewer bytes, the CRC value can be used,
-    independent of the encryption algorithm, to help determine the unencrypted
-    contents of the file.
-
-    Because of this, files encrypted with the new AE-2 method store a 0 in the
-    CRC field of the Zip header, and use the authentication code instead of the
-    CRC value to verify that encrypted data within the Zip file has not been
-    corrupted.
-
-    The only differences between the AE-1 and AE-2 methods are the storage in
-    AE-2 of 0 instead of the CRC in the Zip file header,and the use in the AES
-    extra data field of 0x0002 for AE-2 instead of 0x0001 for AE-1 as the
-    vendor version.
-
-    Zip utilities that support the AE-2 format are required to be able to read
-    files that were created in the AE-1 format, and during decryption/
-    extraction of files in AE-1 format should verify that the file's CRC
-    matches the value stored in the CRC field.
-
- B. Key Generation and HMAC-SHA1
-
-    The description of the key generation mechanism has been updated to point
-    out a limitation arising from its use of HMAC-SHA1 as the pseudo-random
-    function: When used in connection with 192- or 256-bit AES encryption, the
-    fact that HMAC-SHA1 produces a 160-bit result means that, regardless of the
-    password that you specify, the search space for the encryption key is
-    unlikely to reach the theoretical 192- or 256-bit maximum, and cannot be
-    guaranteed to exceed 160 bits. This is discussed in section B.1.1 of the
-    RFC2898 specification.
-
-VII. Developer Information Mailing List Signup
-
-We plan to use this mailing list to notify subscribers of any substantive
-changes made to the Developer Information pages on the WinZip web site.
-
-
-
-   If you enter your e-mail address above, you will receive a message
-   asking you to confirm your wish to be added to the mailing list. If you
-   don't reply to the confirmation message, you will not be added to the
-   list.
-
-   By subscribing to this complimentary mailing list service, you
-   acknowledge and agree that WinZip Computing makes no representations
-   regarding the completeness or accuracy of the information provided
-   through the service, and that this service may be discontinued, in whole
-   or in part, with respect to any or all subscribers at any time.
-   * E-mail Address:
-     [                    ]   [Submit to Support] [Clear Form]
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
-Document version: 1.04
-Last modified: January 30, 2009
-
-Copyright(C) 2003-2015 WinZip International LLC.
-All Rights Reserved
diff --git a/docs/appnote.iz b/docs/appnote.iz
deleted file mode 100644 (file)
index eed5663..0000000
+++ /dev/null
@@ -1,3686 +0,0 @@
-[Info-ZIP note, 20040528:  this file is based on PKWARE's appnote.txt of\r
- 15 February 1996, taking into account PKWARE's revised appnote.txt\r
- version 6.2.0 of 26 April 2004.  It has been unofficially corrected\r
- and extended by Info-ZIP without explicit permission by PKWARE.\r
- Although Info-ZIP believes the information to be accurate and complete,\r
- it is provided under a disclaimer similar to the PKWARE disclaimer below,\r
- differing only in the substitution of "Info-ZIP" for "PKWARE".  In other\r
- words, use this information at your own risk, but we think it's correct.\r
-\r
- Specification info from PKWARE that was obviously wrong has been corrected\r
- silently (e.g. missing structure fields, wrong numbers).\r
- As of PKZIPW 2.50, two new incompatibilities have been introduced by PKWARE;\r
- they are noted below.  Note that the "NTFS tag" conflict is currently not\r
- real; PKZIPW 2.50 actually tags NTFS files as having come from a FAT\r
- file system, too.]\r
-\r
-File:    APPNOTE.TXT - .ZIP File Format Specification\r
-Version: 6.2.0 - NOTIFICATION OF CHANGE\r
-Revised: 04/26/2004 [2004-05-28 Info-ZIP]\r
-Copyright (c) 1989 - 2004 PKWARE Inc., All Rights Reserved.\r
-\r
-I. Purpose\r
-----------\r
-\r
-This specification is intended to define a cross-platform,\r
-interoperable file format.  Since its first publication\r
-in 1989, PKWARE has remained committed to ensuring the\r
-interoperability of the .ZIP file format through this\r
-specification.  We trust that all .ZIP compatible vendors\r
-and application developers that have adopted this format\r
-will share and support this commitment.\r
-\r
-\r
-II. Disclaimer\r
---------------\r
-\r
-Although PKWARE will attempt to supply current and accurate\r
-information relating to its file formats, algorithms, and the\r
-subject programs, the possibility of error or omission can not\r
-be eliminated. PKWARE therefore expressly disclaims any warranty\r
-that the information contained in the associated materials relating\r
-to the subject programs and/or the format of the files created or\r
-accessed by the subject programs and/or the algorithms used by\r
-the subject programs, or any other matter, is current, correct or\r
-accurate as delivered.  Any risk of damage due to any possible\r
-inaccurate information is assumed by the user of the information.\r
-Furthermore, the information relating to the subject programs\r
-and/or the file formats created or accessed by the subject\r
-programs and/or the algorithms used by the subject programs is\r
-subject to change without notice.\r
-\r
-If the version of this file is marked as a NOTIFICATION OF CHANGE,\r
-the content defines an Early Feature Specification (EFS) change\r
-to the .ZIP file format that may be subject to modification prior\r
-to publication of the Final Feature Specification (FFS).  This\r
-document may also contain information on Planned Feature\r
-Specifications (PFS) defining recognized future extensions.\r
-\r
-\r
-III. Change Log\r
----------------\r
-\r
-Version       Change Description                      Date\r
--------       ------------------                     ----------\r
-5.2           -Single Password Symmetric Encryption  06/02/2003\r
-               storage\r
-\r
-6.1.0         -Smart Card compatibility              01/20/2004\r
-              -Documentation on certificate storage\r
-\r
-6.2.0         -Introduction of Central Directory     04/26/2004\r
-               Encryption for encrypting metadata\r
-              -Added OS/X to Version Made By values\r
-\r
-\r
-IV. General Format of a .ZIP file\r
----------------------------------\r
-\r
-  Files stored in arbitrary order.  Large .ZIP files can span multiple\r
-  diskette media or be split into user-defined segment sizes.  [The\r
-  minimum user-defined segment size for a split .ZIP file is 64K.\r
-  (removed by PKWare 2003-06-01)]\r
-\r
-  Overall .ZIP file format:\r
-\r
-    [local file header 1]\r
-    [file data 1]\r
-    [data descriptor 1]\r
-    .\r
-    .\r
-    .\r
-    [local file header n]\r
-    [file data n]\r
-    [data descriptor n]\r
-    [archive decryption header] (EFS)\r
-    [archive extra data record] (EFS)\r
-    [central directory]\r
-    [zip64 end of central directory record]\r
-    [zip64 end of central directory locator]\r
-    [end of central directory record]\r
-\r
-\r
-  A.  Local file header:\r
-\r
-        local file header signature     4 bytes  (0x04034b50)\r
-        version needed to extract       2 bytes\r
-        general purpose bit flag        2 bytes\r
-        compression method              2 bytes\r
-        last mod file time              2 bytes\r
-        last mod file date              2 bytes\r
-        crc-32                          4 bytes\r
-        compressed size                 4 bytes\r
-        uncompressed size               4 bytes\r
-        file name length                2 bytes\r
-        extra field length              2 bytes\r
-\r
-        file name (variable size)\r
-        extra field (variable size)\r
-\r
-\r
-  B.  File data\r
-\r
-      Immediately following the local header for a file\r
-      is the compressed or stored data for the file.\r
-      The series of [local file header][file data][data\r
-      descriptor] repeats for each file in the .ZIP archive.\r
-\r
-\r
-  C.  Data descriptor:\r
-\r
-      [Info-ZIP discrepancy:\r
-       The Info-ZIP zip program starts the data descriptor with a 4-byte\r
-       PK-style signature.  Despite the specification, none of the PKWARE\r
-       programs supports the data descriptor.  PKZIP 4.0 -fix function\r
-       (and PKZIPFIX 2.04) ignores the data descriptor info even when bit 3\r
-       of the general purpose bit flag is set.\r
-        data descriptor signature       4 bytes  (0x08074b50)\r
-      ]\r
-        crc-32                          4 bytes\r
-        compressed size                 4 bytes\r
-        uncompressed size               4 bytes\r
-\r
-      This descriptor exists only if bit 3 of the general\r
-      purpose bit flag is set (see below).  It is byte aligned\r
-      and immediately follows the last byte of compressed data.\r
-      This descriptor is used only when it was not possible to\r
-      seek in the output .ZIP file, e.g., when the output .ZIP file\r
-      was standard output or a non seekable device.  For Zip64 format\r
-      archives, the compressed and uncompressed sizes are 8 bytes each.\r
-\r
-\r
-  D.  Archive decryption header:  (EFS)\r
-\r
-      The Archive Decryption Header is introduced in version 6.2\r
-      of the ZIP format specification.  This record exists in support\r
-      of the Central Directory Encryption Feature implemented as part of\r
-      the Strong Encryption Specification as described in this document.\r
-      When the Central Directory Structure is encrypted, this decryption\r
-      header will precede the encrypted data segment.  The encrypted\r
-      data segment will consist of the Archive extra data record (if\r
-      present) and the encrypted Central Directory Structure data.\r
-      The format of this data record is identical to the Decryption\r
-      header record preceding compressed file data.  If the central\r
-      directory structure is encrypted, the location of the start of\r
-      this data record is determined using the Start of Central Directory\r
-      field in the Zip64 End of Central Directory record.  Refer to the\r
-      section on the Strong Encryption Specification for information\r
-      on the fields used in the Archive Decryption Header record.\r
-\r
-\r
-  E.  Archive extra data record: (EFS)\r
-\r
-        archive extra data signature    4 bytes  (0x08064b50)\r
-        extra field length              4 bytes\r
-        extra field data                (variable size)\r
-\r
-      The Archive Extra Data Record is introduced in version 6.2\r
-      of the ZIP format specification.  This record exists in support\r
-      of the Central Directory Encryption Feature implemented as part of\r
-      the Strong Encryption Specification as described in this document.\r
-      When present, this record immediately precedes the central\r
-      directory data structure.  The size of this data record will be\r
-      included in the Size of the Central Directory field in the\r
-      End of Central Directory record.  If the central directory structure\r
-      is compressed, but not encrypted, the location of the start of\r
-      this data record is determined using the Start of Central Directory\r
-      field in the Zip64 End of Central Directory record.\r
-\r
-\r
-  F.  Central directory structure:\r
-\r
-      [file header 1]\r
-      .\r
-      .\r
-      .\r
-      [file header n]\r
-      [digital signature]\r
-\r
-      File header:\r
-\r
-        central file header signature   4 bytes  (0x02014b50)\r
-        version made by                 2 bytes\r
-        version needed to extract       2 bytes\r
-        general purpose bit flag        2 bytes\r
-        compression method              2 bytes\r
-        last mod file time              2 bytes\r
-        last mod file date              2 bytes\r
-        crc-32                          4 bytes\r
-        compressed size                 4 bytes\r
-        uncompressed size               4 bytes\r
-        file name length                2 bytes\r
-        extra field length              2 bytes\r
-        file comment length             2 bytes\r
-        disk number start               2 bytes\r
-        internal file attributes        2 bytes\r
-        external file attributes        4 bytes\r
-        relative offset of local header 4 bytes\r
-\r
-        file name (variable size)\r
-        extra field (variable size)\r
-        file comment (variable size)\r
-\r
-      Digital signature:\r
-\r
-        header signature                4 bytes  (0x05054b50)\r
-        size of data                    2 bytes\r
-        signature data (variable size)\r
-\r
-      With the introduction of the Central Directory Encryption\r
-      feature in version 6.2 of this specification, the Central\r
-      Directory Structure may be stored both compressed and encrypted.\r
-      Although not required, it is assumed when encrypting the\r
-      Central Directory Structure, that it will be compressed\r
-      for greater storage efficiency.  Information on the\r
-      Central Directory Encryption feature can be found in the section\r
-      describing the Strong Encryption Specification. The Digital\r
-      Signature record will be neither compressed nor encrypted.\r
-\r
-\r
-  G.  Zip64 end of central directory record\r
-\r
-        zip64 end of central dir\r
-        signature                       4 bytes  (0x06064b50)\r
-        size of zip64 end of central\r
-        directory record                8 bytes\r
-        version made by                 2 bytes\r
-        version needed to extract       2 bytes\r
-        number of this disk             4 bytes\r
-        number of the disk with the\r
-        start of the central directory  4 bytes\r
-        total number of entries in the\r
-        central directory on this disk  8 bytes\r
-        total number of entries in the\r
-        central directory               8 bytes\r
-        size of the central directory   8 bytes\r
-        offset of start of central\r
-        directory with respect to\r
-        the starting disk number        8 bytes\r
-        zip64 extensible data sector    (variable size)\r
-\r
-        The above record structure defines Version 1 of the\r
-        Zip64 end of central directory record. Version 1 was\r
-        implemented in versions of this specification preceding\r
-        6.2 in support of the ZIP64(tm) large file feature. The\r
-        introduction of the Central Directory Encryption feature\r
-        implemented in version 6.2 as part of the Strong Encryption\r
-        Specification defines Version 2 of this record structure.\r
-        Refer to the section describing the Strong Encryption\r
-        Specification for details on the version 2 format for\r
-        this record.\r
-\r
-\r
-  H.  Zip64 end of central directory locator\r
-\r
-        zip64 end of central dir locator\r
-        signature                       4 bytes  (0x07064b50)\r
-        number of the disk with the\r
-        start of the zip64 end of\r
-        central directory               4 bytes\r
-        relative offset of the zip64\r
-        end of central directory record 8 bytes\r
-        total number of disks           4 bytes\r
-\r
-\r
-  I.  End of central directory record:\r
-\r
-        end of central dir signature    4 bytes  (0x06054b50)\r
-        number of this disk             2 bytes\r
-        number of the disk with the\r
-        start of the central directory  2 bytes\r
-        total number of entries in the\r
-        central directory on this disk  2 bytes\r
-        total number of entries in\r
-        the central directory           2 bytes\r
-        size of the central directory   4 bytes\r
-        offset of start of central\r
-        directory with respect to\r
-        the starting disk number        4 bytes\r
-        .ZIP file comment length        2 bytes\r
-        .ZIP file comment       (variable size)\r
-\r
-\r
-  J.  Explanation of fields:\r
-\r
-      version made by (2 bytes)\r
-\r
-          [PKWARE describes "OS made by" now (since 1998) as follows:\r
-          The upper byte indicates the compatibility of the file\r
-          attribute information.  If the external file attributes\r
-          are compatible with MS-DOS and can be read by PKZIP for\r
-          DOS version 2.04g then this value will be zero.  If these\r
-          attributes are not compatible, then this value will\r
-          identify the host system on which the attributes are\r
-          compatible.]\r
-          The upper byte indicates the host system (OS) for the\r
-          file.  Software can use this information to determine\r
-          the line record format for text files etc.  The current\r
-          mappings are:\r
-\r
-          0 - FAT file system (DOS, OS/2, NT)      + PKWARE 2.50+ VFAT, NTFS\r
-          1 - Amiga\r
-          2 - OpenVMS\r
-          3 - Unix\r
-          4 - VM/CMS\r
-          5 - Atari ST\r
-          6 - HPFS file system (OS/2, NT 3.x)\r
-          7 - Macintosh\r
-          8 - Z-System\r
-          9 - CP/M\r
-          ---------------------------------------------------------------------\r
-               PKWARE assignment             | Info-ZIP assignment\r
-          -----------------------------------|---------------------------------\r
-          10 - Windows NTFS                  | TOPS-20\r
-               (since PKZIPW 2.50, but       | (assigned Oct-1992,\r
-                not used by any PKWARE prog) |  no longer used)\r
-          11 - MVS                           | NTFS file system (WinNT)\r
-                                             | (actively used by Info-ZIP's\r
-                                             |  Zip for NT since Sep-1993)\r
-          12 - VSE                           | SMS/QDOS\r
-          ---------------------------------------------------------------------\r
-          13 - Acorn RISC OS\r
-          14 - VFAT file system (Win95, NT)     [Info-ZIP reservation, unused]\r
-          15 - MVS [PKWARE describes this assignment as "alternate MVS"]\r
-          16 - BeOS (BeBox or PowerMac)\r
-          17 - Tandem\r
-          18 - OS/400 (IBM)                  | THEOS\r
-          19 - OS/X (Darwin)\r
-          20 thru 29 - unused\r
-          30 - AtheOS/Syllable\r
-          31 thru 255 - unused\r
-\r
-          The lower byte indicates the ZIP specification version\r
-          (the version of this document) supported by the software\r
-          used to encode the file.  The value/10 indicates the major\r
-          version number, and the value mod 10 is the minor version\r
-          number.\r
-\r
-      version needed to extract (2 bytes)\r
-\r
-          The minimum supported ZIP specification version needed to\r
-          extract the file, mapped as above.  This value is based on\r
-          the specific format features a ZIP program must support to\r
-          be able to extract the file.  If multiple features are\r
-          applied to a file, the minimum version should be set to the\r
-          feature having the highest value. New features or feature\r
-          changes affecting the published format specification will be\r
-          implemented using higher version numbers than the last\r
-          published value to avoid conflict.\r
-\r
-          Current minimum feature versions are as defined below:\r
-\r
-          1.0 - Default value\r
-          1.1 - File is a volume label\r
-          2.0 - File is a folder (directory)\r
-          2.0 - File is compressed using Deflate compression\r
-          2.0 - File is encrypted using traditional PKWARE encryption\r
-          2.1 - File is compressed using Deflate64(tm)\r
-          2.5 - File is compressed using PKWARE DCL Implode\r
-          2.7 - File is a patch data set\r
-          4.5 - File uses ZIP64 format extensions\r
-          4.6 - File is compressed using BZIP2 compression*\r
-          5.0 - File is encrypted using DES\r
-          5.0 - File is encrypted using 3DES\r
-          5.0 - File is encrypted using original RC2 encryption\r
-          5.0 - File is encrypted using RC4 encryption\r
-          5.1 - File is encrypted using AES encryption\r
-          5.1 - File is encrypted using corrected RC2 encryption**\r
-          5.2 - File is encrypted using corrected RC2-64 encryption**\r
-          6.1 - File is encrypted using non-OAEP key wrapping***\r
-          6.2 - Central directory encryption\r
-\r
-\r
-          * Early 7.x (pre-7.2) versions of PKZIP incorrectly set the\r
-          version needed to extract for BZIP2 compression to be 50\r
-          when it should have been 46.\r
-\r
-          ** Refer to the section on Strong Encryption Specification\r
-          for additional information regarding RC2 corrections.\r
-\r
-          *** Certificate encryption using non-OAEP key wrapping is the\r
-          intended mode of operation for all versions beginning with 6.1.\r
-          Support for OAEP key wrapping should only be used for\r
-          backward compatibility when sending ZIP files to be opened by\r
-          versions of PKZIP older than 6.1 (5.0 or 6.0).\r
-\r
-          When using ZIP64 extensions, the corresponding value in the\r
-          Zip64 end of central directory record should also be set.\r
-          This field currently supports only the value 45 to indicate\r
-          ZIP64 extensions are present.\r
-\r
-      general purpose bit flag: (2 bytes)\r
-\r
-          Bit 0: If set, indicates that the file is encrypted.\r
-\r
-          (For Method 6 - Imploding)\r
-          Bit 1: If the compression method used was type 6,\r
-                 Imploding, then this bit, if set, indicates\r
-                 an 8K sliding dictionary was used.  If clear,\r
-                 then a 4K sliding dictionary was used.\r
-          Bit 2: If the compression method used was type 6,\r
-                 Imploding, then this bit, if set, indicates\r
-                 3 Shannon-Fano trees were used to encode the\r
-                 sliding dictionary output.  If clear, then 2\r
-                 Shannon-Fano trees were used.\r
-\r
-          (For Methods 8 and 9 - Deflating)\r
-          Bit 2  Bit 1\r
-            0      0    Normal (-en) compression option was used.\r
-            0      1    Maximum (-exx/-ex) compression option was used.\r
-            1      0    Fast (-ef) compression option was used.\r
-            1      1    Super Fast (-es) compression option was used.\r
-\r
-          Note:  Bits 1 and 2 are undefined if the compression\r
-                 method is any other.\r
-\r
-          Bit 3: If this bit is set, the fields crc-32, compressed\r
-                 size and uncompressed size are set to zero in the\r
-                 local header.  The correct values are put in the\r
-                 data descriptor immediately following the compressed\r
-                 data.  (Note: PKZIP version 2.04g for DOS only\r
-                 recognizes this bit for method 8 compression, newer\r
-                 versions of PKZIP recognize this bit for any\r
-                 compression method.)\r
-                [Info-ZIP note: This bit was introduced by PKZIP 2.04 for\r
-                 DOS. In general, this feature can only be reliably used\r
-                 together with compression methods that allow intrinsic\r
-                 detection of the "end-of-compressed-data" condition. From\r
-                 the set of compression methods described in this Zip archive\r
-                 specification, only "deflate" and "bzip2" fulfill this\r
-                 requirement.\r
-                 Especially, the method STORED does not work!\r
-                 The Info-ZIP tools recognize this bit regardless of the\r
-                 compression method; but, they rely on correctly set\r
-                 "compressed size" information in the central directory entry.]\r
-\r
-          Bit 4: Reserved for use with method 8, for enhanced\r
-                 deflating.\r
-\r
-          Bit 5: If this bit is set, this indicates that the file is\r
-                 compressed patched data.  (Note: Requires PKZIP\r
-                 version 2.70 or greater)\r
-\r
-          Bit 6: Strong encryption.  If this bit is set, you should\r
-                 set the version needed to extract value to at least\r
-                 50 and you must also set bit 0.  If AES encryption\r
-                 is used, the version needed to extract value must\r
-                 be at least 51.\r
-\r
-          Bit 7: Currently unused.\r
-\r
-          Bit 8: Currently unused.\r
-\r
-          Bit 9: Currently unused.\r
-\r
-          Bit 10: Currently unused.\r
-\r
-          Bit 11: Currently unused.\r
-\r
-          Bit 12: Reserved by PKWARE for enhanced compression.\r
-\r
-          Bit 13: Used when encrypting the Central Directory to indicate\r
-                  selected data values in the Local Header are masked to\r
-                  hide their actual values.  See the section describing\r
-                  the Strong Encryption Specification for details.\r
-\r
-          Bit 14: Reserved by PKWARE.\r
-\r
-          Bit 15: Reserved by PKWARE.\r
-\r
-      compression method: (2 bytes)\r
-\r
-          (see accompanying documentation for algorithm\r
-          descriptions)\r
-\r
-          0 - The file is stored (no compression)\r
-          1 - The file is Shrunk\r
-          2 - The file is Reduced with compression factor 1\r
-          3 - The file is Reduced with compression factor 2\r
-          4 - The file is Reduced with compression factor 3\r
-          5 - The file is Reduced with compression factor 4\r
-          6 - The file is Imploded\r
-          7 - Reserved for Tokenizing compression algorithm\r
-          8 - The file is Deflated\r
-          9 - Enhanced Deflating using Deflate64(tm)\r
-         10 - PKWARE Data Compression Library Imploding\r
-         11 - Reserved by PKWARE\r
-         12 - File is compressed using BZIP2 algorithm\r
-\r
-      date and time fields: (2 bytes each)\r
-\r
-          The date and time are encoded in standard MS-DOS format.\r
-          If input came from standard input, the date and time are\r
-          those at which compression was started for this data.\r
-          If encrypting the central directory and general purpose bit\r
-          flag 13 is set indicating masking, the value stored in the\r
-          Local Header will be zero.\r
-\r
-      CRC-32: (4 bytes)\r
-\r
-          The CRC-32 algorithm was generously contributed by\r
-          David Schwaderer and can be found in his excellent\r
-          book "C Programmers Guide to NetBIOS" published by\r
-          Howard W. Sams & Co. Inc.  The 'magic number' for\r
-          the CRC is 0xdebb20e3.  The proper CRC pre and post\r
-          conditioning is used, meaning that the CRC register\r
-          is pre-conditioned with all ones (a starting value\r
-          of 0xffffffff) and the value is post-conditioned by\r
-          taking the one's complement of the CRC residual.\r
-          If bit 3 of the general purpose flag is set, this\r
-          field is set to zero in the local header and the correct\r
-          value is put in the data descriptor and in the central\r
-          directory.  If encrypting the central directory and general\r
-          purpose bit flag 13 is set indicating masking, the value\r
-          stored in the Local Header will be zero.\r
-\r
-      compressed size: (4 bytes)\r
-      uncompressed size: (4 bytes)\r
-\r
-          The size of the file compressed and uncompressed,\r
-          respectively.  If bit 3 of the general purpose bit flag\r
-          is set, these fields are set to zero in the local header\r
-          and the correct values are put in the data descriptor and\r
-          in the central directory.  If an archive is in zip64 format\r
-          and the value in this field is 0xFFFFFFFF, the size will be\r
-          in the corresponding 8 byte zip64 extended information\r
-          extra field.  If encrypting the central directory and general\r
-          purpose bit flag 13 is set indicating masking, the value stored\r
-          for the uncompressed size in the Local Header will be zero.\r
-\r
-      file name length: (2 bytes)\r
-      extra field length: (2 bytes)\r
-      file comment length: (2 bytes)\r
-\r
-          The length of the file name, extra field, and comment\r
-          fields respectively.  The combined length of any\r
-          directory record and these three fields should not\r
-          generally exceed 65,535 bytes.  If input came from standard\r
-          input, the file name length is set to zero.\r
-\r
-         [Info-ZIP note:\r
-          This feature is not yet supported by any PKWARE version of ZIP\r
-          (at least not in PKZIP for DOS and PKZIP for Windows/WinNT).\r
-          The Info-ZIP programs handle standard input differently:\r
-          If input came from standard input, the filename is set to "-"\r
-          (length one).]\r
-\r
-\r
-      disk number start: (2 bytes)\r
-\r
-          The number of the disk on which this file begins.  If an\r
-          archive is in zip64 format and the value in this field is\r
-          0xFFFF, the size will be in the corresponding 4 byte zip64\r
-          extended information extra field.\r
-\r
-      internal file attributes: (2 bytes)\r
-\r
-          Bits 1 and 2 are reserved for use by PKWARE.\r
-\r
-          The lowest bit of this field indicates, if set, that\r
-          the file is apparently an ASCII or text file.  If not\r
-          set, that the file apparently contains binary data.\r
-          The remaining bits are unused in version 1.0.\r
-\r
-          The 0x0002 bit of this field indicates, if set, that a\r
-          4 byte variable record length control field precedes each\r
-          logical record indicating the length of the record. This\r
-          flag is independent of text control characters, and if used\r
-          in conjunction with text data, includes any control\r
-          characters in the total length of the record. This value is\r
-          provided for mainframe data transfer support.\r
-\r
-      external file attributes: (4 bytes)\r
-\r
-          The mapping of the external attributes is\r
-          host-system dependent (see 'version made by').  For\r
-          MS-DOS, the low order byte is the MS-DOS directory\r
-          attribute byte.  If input came from standard input, this\r
-          field is set to zero.\r
-\r
-      relative offset of local header: (4 bytes)\r
-\r
-          This is the offset from the start of the first disk on\r
-          which this file appears, to where the local header should\r
-          be found.  If an archive is in zip64 format and the value\r
-          in this field is 0xFFFFFFFF, the size will be in the\r
-          corresponding 8 byte zip64 extended information extra field.\r
-\r
-      file name: (Variable)\r
-\r
-          The name of the file, with optional relative path.\r
-          The path stored should not contain a drive or\r
-          device letter, or a leading slash.  All slashes\r
-          should be forward slashes '/' as opposed to\r
-          backwards slashes '\' for compatibility with Amiga\r
-          and Unix file systems etc.  If input came from standard\r
-          input, there is no file name field.  If encrypting\r
-          the central directory and general purpose bit flag 13 is set\r
-          indicating masking, the file name stored in the Local Header\r
-          will not be the actual file name.  A masking value consisting\r
-          of a unique hexadecimal value will be stored.  This value will\r
-          be sequentially incremented for each file in the archive.  See\r
-          the section on the Strong Encryption Specification for details\r
-          on retrieving the encrypted file name.\r
-         [Info-ZIP discrepancy:\r
-          If input came from standard input, the file name is set\r
-          to "-" (without the quotes).\r
-          As far as we know, the PKWARE specification for "input from\r
-          stdin" is not supported by PKZIP/PKUNZIP for DOS, OS/2, Windows\r
-          Windows NT.]\r
-\r
-      extra field: (Variable)\r
-\r
-          This is for expansion.  If additional information\r
-          needs to be stored for special needs or for specific\r
-          platforms, it should be stored here.  Earlier versions\r
-          of the software can then safely skip this file, and\r
-          find the next file or header.  This field will be 0\r
-          length in version 1.0.\r
-\r
-          In order to allow different programs and different types\r
-          of information to be stored in the 'extra' field in .ZIP\r
-          files, the following structure should be used for all\r
-          programs storing data in this field:\r
-\r
-          header1+data1 + header2+data2 . . .\r
-\r
-          Each header should consist of:\r
-\r
-            Header ID - 2 bytes\r
-            Data Size - 2 bytes\r
-\r
-          Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          The Header ID field indicates the type of data that is in\r
-          the following data block.\r
-\r
-          Header ID's of 0 thru 31 are reserved for use by PKWARE.\r
-          The remaining ID's can be used by third party vendors for\r
-          proprietary usage.\r
-\r
-          The current Header ID mappings defined by PKWARE are:\r
-\r
-          0x0001        ZIP64 extended information extra field\r
-          0x0007        AV Info\r
-          0x0008        Reserved for future Unicode file name data (PFS)\r
-          0x0009        OS/2 extended attributes      (also Info-ZIP)\r
-          0x000a        NTFS (Win9x/WinNT FileTimes)\r
-          0x000c        OpenVMS                       (also Info-ZIP)\r
-          0x000d        Unix\r
-          0x000e        Reserved for file stream and fork descriptors\r
-          0x000f        Patch Descriptor\r
-          0x0014        PKCS#7 Store for X.509 Certificates\r
-          0x0015        X.509 Certificate ID and Signature for\r
-                        individual file\r
-          0x0016        X.509 Certificate ID for Central Directory\r
-          0x0017        Strong Encryption Header\r
-          0x0018        Record Management Controls\r
-          0x0019        PKCS#7 Encryption Recipient Certificate List\r
-          0x0065        IBM S/390 (Z390), AS/400 (I400) attributes\r
-                        - uncompressed\r
-          0x0066        Reserved for IBM S/390 (Z390), AS/400 (I400)\r
-                        attributes - compressed\r
-\r
-          The Header ID mappings defined by Info-ZIP and third parties are:\r
-\r
-          0x07c8        Info-ZIP Macintosh (old, J. Lee)\r
-          0x2605        ZipIt Macintosh (first version)\r
-          0x2705        ZipIt Macintosh v 1.3.5 and newer (w/o full filename)\r
-          0x2805        ZipIt Macintosh 1.3.5+\r
-          0x334d        Info-ZIP Macintosh (new, D. Haase's 'Mac3' field)\r
-          0x4154        Tandem NSK\r
-          0x4341        Acorn/SparkFS (David Pilling)\r
-          0x4453        Windows NT security descriptor (binary ACL)\r
-          0x4704        VM/CMS\r
-          0x470f        MVS\r
-          0x4854        Theos, old inofficial port\r
-          0x4b46        FWKCS MD5 (see below)\r
-          0x4c41        OS/2 access control list (text ACL)\r
-          0x4d49        Info-ZIP OpenVMS (obsolete)\r
-          0x4d63        Macintosh SmartZIP, by Macro Bambini\r
-          0x4f4c        Xceed original location extra field\r
-          0x5356        AOS/VS (binary ACL)\r
-          0x5455        extended timestamp\r
-          0x554e        Xceed unicode extra field\r
-          0x5855        Info-ZIP Unix (original; also OS/2, NT, etc.)\r
-          0x6542        BeOS (BeBox, PowerMac, etc.)\r
-          0x6854        Theos\r
-          0x7441        AtheOS (AtheOS/Syllable attributes)\r
-          0x756e        ASi Unix\r
-          0x7855        Info-ZIP Unix (new)\r
-          0xfb4a        SMS/QDOS\r
-\r
-          Detailed descriptions of Extra Fields defined by third\r
-          party mappings will be documented as information on\r
-          these data structures is made available to PKWARE.\r
-          PKWARE does not guarantee the accuracy of any published\r
-          third party data.\r
-\r
-          The Data Size field indicates the size of the following\r
-          data block. Programs can use this value to skip to the\r
-          next header block, passing over any data blocks that are\r
-          not of interest.\r
-\r
-          Note: As stated above, the size of the entire .ZIP file\r
-                header, including the file name, comment, and extra\r
-                field should not exceed 64K in size.\r
-\r
-          In case two different programs should appropriate the same\r
-          Header ID value, it is strongly recommended that each\r
-          program place a unique signature of at least two bytes in\r
-          size (and preferably 4 bytes or bigger) at the start of\r
-          each data area.  Every program should verify that its\r
-          unique signature is present, in addition to the Header ID\r
-          value being correct, before assuming that it is a block of\r
-          known type.\r
-\r
-          In the following descriptions, note that "Short" means two bytes,\r
-          "Long" means four bytes, and "Long-Long" means eight bytes,\r
-          regardless of their native sizes.  Unless specifically noted, all\r
-          integer fields should be interpreted as unsigned (non-negative)\r
-          numbers.\r
-\r
-\r
-         -ZIP64 Extended Information Extra Field (0x0001):\r
-          ===============================================\r
-\r
-          The following is the layout of the ZIP64 extended\r
-          information "extra" block. If one of the size or\r
-          offset fields in the Local or Central directory\r
-          record is too small to hold the required data,\r
-          a ZIP64 extended information record is created.\r
-          The order of the fields in the ZIP64 extended\r
-          information record is fixed, but the fields will\r
-          only appear if the corresponding Local or Central\r
-          directory record field is set to 0xFFFF or 0xFFFFFFFF.\r
-\r
-          Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          Value      Size       Description\r
-          -----      ----       -----------\r
-  (ZIP64) 0x0001     2 bytes    Tag for this "extra" block type\r
-          Size       2 bytes    Size of this "extra" block\r
-          Original\r
-          Size       8 bytes    Original uncompressed file size\r
-          Compressed\r
-          Size       8 bytes    Size of compressed data\r
-          Relative Header\r
-          Offset     8 bytes    Offset of local header record\r
-          Disk Start\r
-          Number     4 bytes    Number of the disk on which\r
-                                this file starts\r
-\r
-          This entry in the Local header must include BOTH original\r
-          and compressed file sizes.\r
-\r
-\r
-         -OS/2 Extended Attributes Extra Field (0x0009):\r
-          =============================================\r
-\r
-          The following is the layout of the OS/2 extended attributes "extra"\r
-          block.  (Last Revision 19960922)\r
-\r
-          Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (OS/2)  0x0009        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block\r
-          BSize         Long        uncompressed EA data size\r
-          CType         Short       compression type\r
-          EACRC         Long        CRC value for uncompressed EA data\r
-          (var.)        variable    compressed EA data\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (OS/2)  0x0009        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block (4)\r
-          BSize         Long        size of uncompressed local EA data\r
-\r
-          The value of CType is interpreted according to the "compression\r
-          method" section above; i.e., 0 for stored, 8 for deflated, etc.\r
-\r
-          The OS/2 extended attribute structure (FEA2LIST) is\r
-          compressed and then stored in its entirety within this\r
-          structure.  There will only ever be one "block" of data in\r
-          the variable-length field.\r
-\r
-\r
-         -OS/2 Access Control List Extra Field:\r
-          ====================================\r
-\r
-          The following is the layout of the OS/2 ACL extra block.\r
-          (Last Revision 19960922)\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (ACL)   0x4c41        Short       tag for this extra block type ("AL")\r
-          TSize         Short       total data size for this block\r
-          BSize         Long        uncompressed ACL data size\r
-          CType         Short       compression type\r
-          EACRC         Long        CRC value for uncompressed ACL data\r
-          (var.)        variable    compressed ACL data\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (ACL)   0x4c41        Short       tag for this extra block type ("AL")\r
-          TSize         Short       total data size for this block (4)\r
-          BSize         Long        size of uncompressed local ACL data\r
-\r
-          The value of CType is interpreted according to the "compression\r
-          method" section above; i.e., 0 for stored, 8 for deflated, etc.\r
-\r
-          The uncompressed ACL data consist of a text header of the form\r
-          "ACL1:%hX,%hd\n", where the first field is the OS/2 ACCINFO acc_attr\r
-          member and the second is acc_count, followed by acc_count strings\r
-          of the form "%s,%hx\n", where the first field is acl_ugname (user\r
-          group name) and the second acl_access.  This block type will be\r
-          extended for other operating systems as needed.\r
-\r
-\r
-         -Windows NT Security Descriptor Extra Field (0x4453):\r
-          ===================================================\r
-\r
-          The following is the layout of the NT Security Descriptor (another\r
-          type of ACL) extra block.  (Last Revision 19960922)\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (SD)    0x4453        Short       tag for this extra block type ("SD")\r
-          TSize         Short       total data size for this block\r
-          BSize         Long        uncompressed SD data size\r
-          Version       Byte        version of uncompressed SD data format\r
-          CType         Short       compression type\r
-          EACRC         Long        CRC value for uncompressed SD data\r
-          (var.)        variable    compressed SD data\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (SD)    0x4453        Short       tag for this extra block type ("SD")\r
-          TSize         Short       total data size for this block (4)\r
-          BSize         Long        size of uncompressed local SD data\r
-\r
-          The value of CType is interpreted according to the "compression\r
-          method" section above; i.e., 0 for stored, 8 for deflated, etc.\r
-          Version specifies how the compressed data are to be interpreted\r
-          and allows for future expansion of this extra field type.  Currently\r
-          only version 0 is defined.\r
-\r
-          For version 0, the compressed data are to be interpreted as a single\r
-          valid Windows NT SECURITY_DESCRIPTOR data structure, in self-relative\r
-          format.\r
-\r
-\r
-         -PKWARE Win95/WinNT Extra Field (0x000a):\r
-          =======================================\r
-\r
-          The following description covers PKWARE's "NTFS" attributes\r
-          "extra" block, introduced with the release of PKZIP 2.50 for\r
-          Windows. (Last Revision 20001118)\r
-\r
-          (Note: At this time the Mtime, Atime and Ctime values may\r
-          be used on any WIN32 system.)\r
-         [Info-ZIP note: In the current implementations, this field has\r
-          a fixed total data size of 32 bytes and is only stored as local\r
-          extra field.]\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (NTFS)  0x000a        Short       Tag for this "extra" block type\r
-          TSize         Short       Total Data Size for this block\r
-          Reserved      Long        for future use\r
-          Tag1          Short       NTFS attribute tag value #1\r
-          Size1         Short       Size of attribute #1, in bytes\r
-          (var.)        SubSize1    Attribute #1 data\r
-          .\r
-          .\r
-          .\r
-          TagN          Short       NTFS attribute tag value #N\r
-          SizeN         Short       Size of attribute #N, in bytes\r
-          (var.)        SubSizeN    Attribute #N data\r
-\r
-          For NTFS, values for Tag1 through TagN are as follows:\r
-          (currently only one set of attributes is defined for NTFS)\r
-\r
-          Tag        Size       Description\r
-          -----      ----       -----------\r
-          0x0001     2 bytes    Tag for attribute #1\r
-          Size1      2 bytes    Size of attribute #1, in bytes (24)\r
-          Mtime      8 bytes    64-bit NTFS file last modification time\r
-          Atime      8 bytes    64-bit NTFS file last access time\r
-          Ctime      8 bytes    64-bit NTFS file creation time\r
-\r
-          The total length for this block is 28 bytes, resulting in a\r
-          fixed size value of 32 for the TSize field of the NTFS block.\r
-\r
-          The NTFS filetimes are 64-bit unsigned integers, stored in Intel\r
-          (least significant byte first) byte order. They determine the\r
-          number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch",\r
-          which is "01-Jan-1601 00:00:00 UTC".\r
-\r
-\r
-         -PKWARE OpenVMS Extra Field (0x000c):\r
-          ===================================\r
-\r
-          The following is the layout of PKWARE's OpenVMS attributes\r
-          "extra" block.  (Last Revision 12/17/91)\r
-\r
-          Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (VMS)   0x000c        Short       Tag for this "extra" block type\r
-          TSize         Short       Total Data Size for this block\r
-          CRC           Long        32-bit CRC for remainder of the block\r
-          Tag1          Short       OpenVMS attribute tag value #1\r
-          Size1         Short       Size of attribute #1, in bytes\r
-          (var.)        Size1       Attribute #1 data\r
-          .\r
-          .\r
-          .\r
-          TagN          Short       OpenVMS attribute tage value #N\r
-          SizeN         Short       Size of attribute #N, in bytes\r
-          (var.)        SizeN       Attribute #N data\r
-\r
-          Rules:\r
-\r
-          1. There will be one or more of attributes present, which\r
-             will each be preceded by the above TagX & SizeX values.\r
-             These values are identical to the ATR$C_XXXX and\r
-             ATR$S_XXXX constants which are defined in ATR.H under\r
-             OpenVMS C.  Neither of these values will ever be zero.\r
-\r
-          2. No word alignment or padding is performed.\r
-\r
-          3. A well-behaved PKZIP/OpenVMS program should never produce\r
-             more than one sub-block with the same TagX value.  Also,\r
-             there will never be more than one "extra" block of type\r
-             0x000c in a particular directory record.\r
-\r
-\r
-         -Info-ZIP VMS Extra Field:\r
-          ========================\r
-\r
-          The following is the layout of Info-ZIP's VMS attributes extra\r
-          block for VAX or Alpha AXP.  The local-header and central-header\r
-          versions are identical.  (Last Revision 19960922)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (VMS2)  0x4d49        Short       tag for this extra block type ("JM")\r
-          TSize         Short       total data size for this block\r
-          ID            Long        block ID\r
-          Flags         Short       info bytes\r
-          BSize         Short       uncompressed block size\r
-          Reserved      Long        (reserved)\r
-          (var.)        variable    compressed VMS file-attributes block\r
-\r
-          The block ID is one of the following unterminated strings:\r
-\r
-                "VFAB"          struct FAB\r
-                "VALL"          struct XABALL\r
-                "VFHC"          struct XABFHC\r
-                "VDAT"          struct XABDAT\r
-                "VRDT"          struct XABRDT\r
-                "VPRO"          struct XABPRO\r
-                "VKEY"          struct XABKEY\r
-                "VMSV"          version (e.g., "V6.1"; truncated at hyphen)\r
-                "VNAM"          reserved\r
-\r
-          The lower three bits of Flags indicate the compression method.  The\r
-          currently defined methods are:\r
-\r
-                0       stored (not compressed)\r
-                1       simple "RLE"\r
-                2       deflated\r
-\r
-          The "RLE" method simply replaces zero-valued bytes with zero-valued\r
-          bits and non-zero-valued bytes with a "1" bit followed by the byte\r
-          value.\r
-\r
-          The variable-length compressed data contains only the data corre-\r
-          sponding to the indicated structure or string.  Typically multiple\r
-          VMS2 extra fields are present (each with a unique block type).\r
-\r
-\r
-         -Info-ZIP Macintosh Extra Field:\r
-          ==============================\r
-\r
-          The following is the layout of the (old) Info-ZIP resource-fork extra\r
-          block for Macintosh.  The local-header and central-header versions\r
-          are identical.  (Last Revision 19960922)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Mac)   0x07c8        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block\r
-          "JLEE"        beLong      extra-field signature\r
-          FInfo         16 bytes    Macintosh FInfo structure\r
-          CrDat         beLong      HParamBlockRec fileParam.ioFlCrDat\r
-          MdDat         beLong      HParamBlockRec fileParam.ioFlMdDat\r
-          Flags         beLong      info bits\r
-          DirID         beLong      HParamBlockRec fileParam.ioDirID\r
-          VolName       28 bytes    volume name (optional)\r
-\r
-          All fields but the first two are in native Macintosh format\r
-          (big-endian Motorola order, not little-endian Intel).  The least\r
-          significant bit of Flags is 1 if the file is a data fork, 0 other-\r
-          wise.  In addition, if this extra field is present, the filename\r
-          has an extra 'd' or 'r' appended to indicate data fork or resource\r
-          fork.  The 28-byte VolName field may be omitted.\r
-\r
-\r
-         -ZipIt Macintosh Extra Field (long):\r
-          ==================================\r
-\r
-          The following is the layout of the ZipIt extra block for Macintosh.\r
-          The local-header and central-header versions are identical.\r
-          (Last Revision 19970130)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Mac2)  0x2605        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block\r
-          "ZPIT"        beLong      extra-field signature\r
-          FnLen         Byte        length of FileName\r
-          FileName      variable    full Macintosh filename\r
-          FileType      Byte[4]     four-byte Mac file type string\r
-          Creator       Byte[4]     four-byte Mac creator string\r
-\r
-\r
-         -ZipIt Macintosh Extra Field (short, for files):\r
-          ==============================================\r
-\r
-          The following is the layout of a shortened variant of the\r
-          ZipIt extra block for Macintosh (without "full name" entry).\r
-          This variant is used by ZipIt 1.3.5 and newer for entries of\r
-          files (not directories) that do not have a MacBinary encoded\r
-          file.  The local-header and central-header versions are identical.\r
-          (Last Revision 20030602)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Mac2b) 0x2705        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block (min. 12)\r
-          "ZPIT"        beLong      extra-field signature\r
-          FileType      Byte[4]     four-byte Mac file type string\r
-          Creator       Byte[4]     four-byte Mac creator string\r
-          fdFlags       beShort     attributes from FInfo.frFlags,\r
-                                    may be omitted\r
-          0x0000        beShort     reserved, may be omitted\r
-\r
-\r
-         -ZipIt Macintosh Extra Field (short, for directories):\r
-          ====================================================\r
-\r
-          The following is the layout of a shortened variant of the\r
-          ZipIt extra block for Macintosh used only for directory\r
-          entries. This variant is used by ZipIt 1.3.5 and newer to\r
-          save some optional Mac-specific information about directories.\r
-          The local-header and central-header versions are identical.\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Mac2c) 0x2805        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block (12)\r
-          "ZPIT"        beLong      extra-field signature\r
-          frFlags       beShort     attributes from DInfo.frFlags, may\r
-                                    be omitted\r
-          View          beShort     ZipIt view flag, may be omitted\r
-\r
-\r
-          The View field specifies ZipIt-internal settings as follows:\r
-\r
-          Bits of the Flags:\r
-              bit 0           if set, the folder is shown expanded (open)\r
-                              when the archive contents are viewed in ZipIt.\r
-              bits 1-15       reserved, zero;\r
-\r
-\r
-         -Info-ZIP Macintosh Extra Field (new):\r
-          ====================================\r
-\r
-          The following is the layout of the (new) Info-ZIP extra\r
-          block for Macintosh, designed by Dirk Haase.\r
-          All values are in little-endian.\r
-          (Last Revision 19981005)\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Mac3)  0x334d        Short       tag for this extra block type ("M3")\r
-          TSize         Short       total data size for this block\r
-          BSize         Long        uncompressed finder attribute data size\r
-          Flags         Short       info bits\r
-          fdType        Byte[4]     Type of the File (4-byte string)\r
-          fdCreator     Byte[4]     Creator of the File (4-byte string)\r
-          (CType)       Short       compression type\r
-          (CRC)         Long        CRC value for uncompressed MacOS data\r
-          Attribs       variable    finder attribute data (see below)\r
-\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Mac3)  0x334d        Short       tag for this extra block type ("M3")\r
-          TSize         Short       total data size for this block\r
-          BSize         Long        uncompressed finder attribute data size\r
-          Flags         Short       info bits\r
-          fdType        Byte[4]     Type of the File (4-byte string)\r
-          fdCreator     Byte[4]     Creator of the File (4-byte string)\r
-\r
-          The third bit of Flags in both headers indicates whether\r
-          the LOCAL extra field is uncompressed (and therefore whether CType\r
-          and CRC are omitted):\r
-\r
-          Bits of the Flags:\r
-              bit 0           if set, file is a data fork; otherwise unset\r
-              bit 1           if set, filename will be not changed\r
-              bit 2           if set, Attribs is uncompressed (no CType, CRC)\r
-              bit 3           if set, date and times are in 64 bit\r
-                              if zero date and times are in 32 bit.\r
-              bit 4           if set, timezone offsets fields for the native\r
-                              Mac times are omitted (UTC support deactivated)\r
-              bits 5-15       reserved;\r
-\r
-\r
-          Attributes:\r
-\r
-          Attribs is a Mac-specific block of data in little-endian format with\r
-          the following structure (if compressed, uncompress it first):\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-          fdFlags       Short       Finder Flags\r
-          fdLocation.v  Short       Finder Icon Location\r
-          fdLocation.h  Short       Finder Icon Location\r
-          fdFldr        Short       Folder containing file\r
-\r
-          FXInfo        16 bytes    Macintosh FXInfo structure\r
-            FXInfo-Structure:\r
-                fdIconID        Short\r
-                fdUnused[3]     Short       unused but reserved 6 bytes\r
-                fdScript        Byte        Script flag and number\r
-                fdXFlags        Byte        More flag bits\r
-                fdComment       Short       Comment ID\r
-                fdPutAway       Long        Home Dir ID\r
-\r
-          FVersNum      Byte        file version number\r
-                                    may be not used by MacOS\r
-          ACUser        Byte        directory access rights\r
-\r
-          FlCrDat       ULong       date and time of creation\r
-          FlMdDat       ULong       date and time of last modification\r
-          FlBkDat       ULong       date and time of last backup\r
-            These time numbers are original Mac FileTime values (local time!).\r
-            Currently, date-time width is 32-bit, but future version may\r
-            support be 64-bit times (see flags)\r
-\r
-          CrGMTOffs     Long(signed!)   difference "local Creat. time - UTC"\r
-          MdGMTOffs     Long(signed!)   difference "local Modif. time - UTC"\r
-          BkGMTOffs     Long(signed!)   difference "local Backup time - UTC"\r
-            These "local time - UTC" differences (stored in seconds) may be\r
-            used to support timestamp adjustment after inter-timezone transfer.\r
-            These fields are optional; bit 4 of the flags word controls their\r
-            presence.\r
-\r
-          Charset       Short       TextEncodingBase (Charset)\r
-                                    valid for the following two fields\r
-\r
-          FullPath      variable    Path of the current file.\r
-                                    Zero terminated string (C-String)\r
-                                    Currently coded in the native Charset.\r
-\r
-          Comment       variable    Finder Comment of the current file.\r
-                                    Zero terminated string (C-String)\r
-                                    Currently coded in the native Charset.\r
-\r
-\r
-         -SmartZIP Macintosh Extra Field:\r
-          ====================================\r
-\r
-          The following is the layout of the SmartZIP extra\r
-          block for Macintosh, designed by Marco Bambini.\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-          0x4d63        Short       tag for this extra block type ("cM")\r
-          TSize         Short       total data size for this block (64)\r
-          "dZip"        beLong      extra-field signature\r
-          fdType        Byte[4]     Type of the File (4-byte string)\r
-          fdCreator     Byte[4]     Creator of the File (4-byte string)\r
-          fdFlags       beShort     Finder Flags\r
-          fdLocation.v  beShort     Finder Icon Location\r
-          fdLocation.h  beShort     Finder Icon Location\r
-          fdFldr        beShort     Folder containing file\r
-          CrDat         beLong      HParamBlockRec fileParam.ioFlCrDat\r
-          MdDat         beLong      HParamBlockRec fileParam.ioFlMdDat\r
-          frScroll.v    Byte        vertical pos. of folder's scroll bar\r
-          fdScript      Byte        Script flag and number\r
-          frScroll.h    Byte        horizontal pos. of folder's scroll bar\r
-          fdXFlags      Byte        More flag bits\r
-          FileName      Byte[32]    full Macintosh filename (pascal string)\r
-\r
-          All fields but the first two are in native Macintosh format\r
-          (big-endian Motorola order, not little-endian Intel).\r
-          The extra field size is fixed to 64 bytes.\r
-          The local-header and central-header versions are identical.\r
-\r
-\r
-         -Acorn SparkFS Extra Field:\r
-          =========================\r
-\r
-          The following is the layout of David Pilling's SparkFS extra block\r
-          for Acorn RISC OS.  The local-header and central-header versions are\r
-          identical.  (Last Revision 19960922)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Acorn) 0x4341        Short       tag for this extra block type ("AC")\r
-          TSize         Short       total data size for this block (20)\r
-          "ARC0"        Long        extra-field signature\r
-          LoadAddr      Long        load address or file type\r
-          ExecAddr      Long        exec address\r
-          Attr          Long        file permissions\r
-          Zero          Long        reserved; always zero\r
-\r
-          The following bits of Attr are associated with the given file\r
-          permissions:\r
-\r
-                bit 0           user-writable ('W')\r
-                bit 1           user-readable ('R')\r
-                bit 2           reserved\r
-                bit 3           locked ('L')\r
-                bit 4           publicly writable ('w')\r
-                bit 5           publicly readable ('r')\r
-                bit 6           reserved\r
-                bit 7           reserved\r
-\r
-\r
-         -VM/CMS Extra Field:\r
-          ==================\r
-\r
-          The following is the layout of the file-attributes extra block for\r
-          VM/CMS.  The local-header and central-header versions are\r
-          identical.  (Last Revision 19960922)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
- (VM/CMS) 0x4704        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block\r
-          flData        variable    file attributes data\r
-\r
-          flData is an uncompressed fldata_t struct.\r
-\r
-\r
-         -MVS Extra Field:\r
-          ===============\r
-\r
-          The following is the layout of the file-attributes extra block for\r
-          MVS.  The local-header and central-header versions are identical.\r
-          (Last Revision 19960922)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (MVS)   0x470f        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block\r
-          flData        variable    file attributes data\r
-\r
-          flData is an uncompressed fldata_t struct.\r
-\r
-\r
-         -PKWARE Unix Extra Field (0x000d):\r
-          ================================\r
-\r
-          The following is the layout of PKWARE's Unix "extra" block.\r
-          It was introduced with the release of PKZIP for Unix 2.50.\r
-          Note: all fields are stored in Intel low-byte/high-byte order.\r
-          (Last Revision 19980901)\r
-\r
-          This field has a minimum data size of 12 bytes and is only stored\r
-          as local extra field.\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
- (Unix0)  0x000d        Short       Tag for this "extra" block type\r
-          TSize         Short       Total Data Size for this block\r
-          AcTime        Long        time of last access (UTC/GMT)\r
-          ModTime       Long        time of last modification (UTC/GMT)\r
-          UID           Short       Unix user ID\r
-          GID           Short       Unix group ID\r
-          (var)         variable    Variable length data field\r
-\r
-          The variable length data field will contain file type\r
-          specific data.  Currently the only values allowed are\r
-          the original "linked to" file names for hard or symbolic\r
-          links, and the major and minor device node numbers for\r
-          character and block device nodes.  Since device nodes\r
-          cannot be either symbolic or hard links, only one set of\r
-          variable length data is stored.  Link files will have the\r
-          name of the original file stored.  This name is NOT NULL\r
-          terminated.  Its size can be determined by checking TSize -\r
-          12.  Device entries will have eight bytes stored as two 4\r
-          byte entries (in little-endian format).  The first entry\r
-          will be the major device number, and the second the minor\r
-          device number.\r
-\r
-         [Info-ZIP note: The fixed part of this field has the same layout as\r
-          Info-ZIP's abandoned "Unix1 timestamps & owner ID info" extra field;\r
-          only the two tag bytes are different.]\r
-\r
-\r
-         -PATCH Descriptor Extra Field (0x000f):\r
-          =====================================\r
-\r
-          The following is the layout of the Patch Descriptor "extra"\r
-          block.\r
-\r
-          Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Patch) 0x000f        Short       Tag for this "extra" block type\r
-          TSize         Short       Size of the total "extra" block\r
-          Version       Short       Version of the descriptor\r
-          Flags         Long        Actions and reactions (see below)\r
-          OldSize       Long        Size of the file about to be patched\r
-          OldCRC        Long        32-bit CRC of the file about to be patched\r
-          NewSize       Long        Size of the resulting file\r
-          NewCRC        Long        32-bit CRC of the resulting file\r
-\r
-\r
-          Actions and reactions\r
-\r
-          Bits          Description\r
-          ----          ----------------\r
-          0             Use for auto detection\r
-          1             Treat as a self-patch\r
-          2-3           RESERVED\r
-          4-5           Action (see below)\r
-          6-7           RESERVED\r
-          8-9           Reaction (see below) to absent file\r
-          10-11         Reaction (see below) to newer file\r
-          12-13         Reaction (see below) to unknown file\r
-          14-15         RESERVED\r
-          16-31         RESERVED\r
-\r
-          Actions\r
-\r
-          Action       Value\r
-          ------       -----\r
-          none         0\r
-          add          1\r
-          delete       2\r
-          patch        3\r
-\r
-          Reactions\r
-\r
-          Reaction     Value\r
-          --------     -----\r
-          ask          0\r
-          skip         1\r
-          ignore       2\r
-          fail         3\r
-\r
-          Patch support is provided by PKPatchMaker(tm) technology and is\r
-          covered under U.S. Patents and Patents Pending.\r
-\r
-\r
-         -PKCS#7 Store for X.509 Certificates (0x0014):\r
-          ============================================\r
-\r
-          This field contains information about each of the certificates\r
-          files may be signed with.  When the Central Directory Encryption\r
-          feature is enabled for a ZIP file, this record will appear in\r
-          the Archive Extra Data Record, otherwise it will appear in the\r
-          first central directory record and will be ignored in any\r
-          other record.\r
-\r
-          Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-  (Store) 0x0014    2 bytes  Tag for this "extra" block type\r
-          TSize     2 bytes  Size of the store data\r
-          SData     TSize    Data about the store\r
-\r
-          SData\r
-          Value     Size        Description\r
-          -----     ----        -----------\r
-          Version   2 bytes     Version number, 0x0001 for now\r
-          StoreD    (variable)  Actual store data\r
-\r
-          The StoreD member is suitable for passing as the pbData\r
-          member of a CRYPT_DATA_BLOB to the CertOpenStore() function\r
-          in Microsoft's CryptoAPI.  The SSize member above will be\r
-          cbData + 6, where cbData is the cbData member of the same\r
-          CRYPT_DATA_BLOB.  The encoding type to pass to\r
-          CertOpenStore() should be\r
-          PKCS_7_ANS_ENCODING | X509_ASN_ENCODING.\r
-\r
-\r
-         -X.509 Certificate ID and Signature for individual file (0x0015):\r
-          ===============================================================\r
-\r
-          This field contains the information about which certificate in\r
-          the PKCS#7 store was used to sign a particular file.  It also\r
-          contains the signature data.  This field can appear multiple\r
-          times, but can only appear once per certificate.\r
-\r
-          Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (CID)   0x0015        2 bytes     Tag for this "extra" block type\r
-          CSize         2 bytes     Size of Method\r
-          Method        (variable)\r
-\r
-          Method\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-          Version       2 bytes     Version number, for now 0x0001\r
-          AlgID         2 bytes     Algorithm ID used for signing\r
-          IDSize        2 bytes     Size of Certificate ID data\r
-          CertID        (variable)  Certificate ID data\r
-          SigSize       2 bytes     Size of Signature data\r
-          Sig           (variable)  Signature data\r
-\r
-          CertID\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-          Size1         4 bytes     Size of CertID, should be (IDSize - 4)\r
-          Size1         4 bytes     A bug in version one causes this value\r
-                                    to appear twice.\r
-          IssSize       4 bytes     Issuer data size\r
-          Issuer        (variable)  Issuer data\r
-          SerSize       4 bytes     Serial Number size\r
-          Serial        (variable)  Serial Number data\r
-\r
-          The Issuer and IssSize members are suitable for creating a\r
-          CRYPT_DATA_BLOB to be the Issuer member of a CERT_INFO\r
-          struct. The Serial and SerSize members would be the\r
-          SerialNumber member of the same CERT_INFO struct.  This\r
-          struct would be used to find the certificate in the store\r
-          the file was signed with.  Those structures are from the MS\r
-          CryptoAPI.\r
-\r
-          Sig and SigSize are the actual signature data and size\r
-          generated by signing the file with the MS CryptoAPI using a\r
-          hash created with the given AlgID.\r
-\r
-\r
-         -X.509 Certificate ID and Signature for central directory (0x0016):\r
-          =================================================================\r
-\r
-          This field contains the information about which certificate in\r
-          the PKCS#7 store was used to sign the central directory structure.\r
-          When the Central Directory Encryption feature is enabled for a\r
-          ZIP file, this record will appear in the Archive Extra Data Record,\r
-          otherwise it will appear in the first central directory record,\r
-          along with the store.  The data structure is the\r
-          same as the CID, except that SigSize will be 0, and there\r
-          will be no Sig member.\r
-\r
-          This field is also kept after the last central directory\r
-          record, as the signature data (ID 0x05054b50, it looks like\r
-          a central directory record of a different type).  This\r
-          second copy of the data is the Signature Data member of the\r
-          record, and will have a SigSize that is non-zero, and will\r
-          have Sig data.\r
-\r
-          Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-  (CDID)  0x0016    2 bytes  Tag for this "extra" block type\r
-          TSize     2 bytes  Size of data that follows\r
-          TData     TSize    Data\r
-\r
-\r
-         -Strong Encryption Header (0x0017) (EFS):\r
-          ===============================\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          0x0017    2 bytes  Tag for this "extra" block type\r
-          TSize     2 bytes  Size of data that follows\r
-          Format    2 bytes  Format definition for this record\r
-          AlgID     2 bytes  Encryption algorithm identifier\r
-          Bitlen    2 bytes  Bit length of encryption key\r
-          Flags     2 bytes  Processing flags\r
-          CertData  TSize-8  Certificate decryption extra field data\r
-                             (refer to the explanation for CertData\r
-                              in the section describing the\r
-                              Certificate Processing Method under\r
-                              the Strong Encryption Specification)\r
-\r
-\r
-         -Record Management Controls (0x0018):\r
-          ===================================\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-(Rec-CTL) 0x0018    2 bytes  Tag for this "extra" block type\r
-          CSize     2 bytes  Size of total extra block data\r
-          Tag1      2 bytes  Record control attribute 1\r
-          Size1     2 bytes  Size of attribute 1, in bytes\r
-          Data1     Size1    Attribute 1 data\r
-            .\r
-            .\r
-            .\r
-          TagN      2 bytes  Record control attribute N\r
-          SizeN     2 bytes  Size of attribute N, in bytes\r
-          DataN     SizeN    Attribute N data\r
-\r
-\r
-         -PKCS#7 Encryption Recipient Certificate List (0x0019): (EFS)\r
-          =====================================================\r
-\r
-          This field contains the information about each of the certificates\r
-          that files may be encrypted with. This field should only appear\r
-          in the archive extra data record. This field is not required and\r
-          serves only to aide archive modifications by preserving public\r
-          encryption data. Individual security requirements may dictate\r
-          that this data be omitted to deter information exposure.\r
-\r
-          Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
- (CStore) 0x0019    2 bytes  Tag for this "extra" block type\r
-          TSize     2 bytes  Size of the store data\r
-          TData     TSize    Data about the store\r
-\r
-          TData:\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          Version   2 bytes  Format version number - must 0x0001 at this time\r
-          CStore    (var)    PKCS#7 data blob\r
-\r
-\r
-         -MVS Extra Field (PKWARE, 0x0065):\r
-          ================================\r
-\r
-          The following is the layout of the MVS "extra" block.\r
-          Note: Some fields are stored in Big Endian format.\r
-          All text is in EBCDIC format unless otherwise specified.\r
-\r
-          Value       Size          Description\r
-          -----       ----          -----------\r
-  (MVS)   0x0065      2 bytes       Tag for this "extra" block type\r
-          TSize       2 bytes       Size for the following data block\r
-          ID          4 bytes       EBCDIC "Z390" 0xE9F3F9F0 or\r
-                                    "T4MV" for TargetFour\r
-          (var)       TSize-4       Attribute data\r
-\r
-\r
-         -OS/400 Extra Field (0x0065):\r
-          ===========================\r
-\r
-          The following is the layout of the OS/400 "extra" block.\r
-          Note: Some fields are stored in Big Endian format.\r
-          All text is in EBCDIC format unless otherwise specified.\r
-\r
-          Value       Size          Description\r
-          -----       ----          -----------\r
-  (OS400) 0x0065      2 bytes       Tag for this "extra" block type\r
-          TSize       2 bytes       Size for the following data block\r
-          ID          4 bytes       EBCDIC "I400" 0xC9F4F0F0 or\r
-                                    "T4MV" for TargetFour\r
-          (var)       TSize-4       Attribute data\r
-\r
-\r
-         -Extended Timestamp Extra Field:\r
-          ==============================\r
-\r
-          The following is the layout of the extended-timestamp extra block.\r
-          (Last Revision 19970118)\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (time)  0x5455        Short       tag for this extra block type ("UT")\r
-          TSize         Short       total data size for this block\r
-          Flags         Byte        info bits\r
-          (ModTime)     Long        time of last modification (UTC/GMT)\r
-          (AcTime)      Long        time of last access (UTC/GMT)\r
-          (CrTime)      Long        time of original creation (UTC/GMT)\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (time)  0x5455        Short       tag for this extra block type ("UT")\r
-          TSize         Short       total data size for this block\r
-          Flags         Byte        info bits (refers to local header!)\r
-          (ModTime)     Long        time of last modification (UTC/GMT)\r
-\r
-          The central-header extra field contains the modification time only,\r
-          or no timestamp at all.  TSize is used to flag its presence or\r
-          absence.  But note:\r
-\r
-              If "Flags" indicates that Modtime is present in the local header\r
-              field, it MUST be present in the central header field, too!\r
-              This correspondence is required because the modification time\r
-              value may be used to support trans-timezone freshening and\r
-              updating operations with zip archives.\r
-\r
-          The time values are in standard Unix signed-long format, indicating\r
-          the number of seconds since 1 January 1970 00:00:00.  The times\r
-          are relative to Coordinated Universal Time (UTC), also sometimes\r
-          referred to as Greenwich Mean Time (GMT).  To convert to local time,\r
-          the software must know the local timezone offset from UTC/GMT.\r
-\r
-          The lower three bits of Flags in both headers indicate which time-\r
-          stamps are present in the LOCAL extra field:\r
-\r
-                bit 0           if set, modification time is present\r
-                bit 1           if set, access time is present\r
-                bit 2           if set, creation time is present\r
-                bits 3-7        reserved for additional timestamps; not set\r
-\r
-          Those times that are present will appear in the order indicated, but\r
-          any combination of times may be omitted.  (Creation time may be\r
-          present without access time, for example.)  TSize should equal\r
-          (1 + 4*(number of set bits in Flags)), as the block is currently\r
-          defined.  Other timestamps may be added in the future.\r
-\r
-\r
-         -Info-ZIP Unix Extra Field (type 1):\r
-          ==================================\r
-\r
-          The following is the layout of the old Info-ZIP extra block for\r
-          Unix.  It has been replaced by the extended-timestamp extra block\r
-          (0x5455) and the Unix type 2 extra block (0x7855).\r
-          (Last Revision 19970118)\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Unix1) 0x5855        Short       tag for this extra block type ("UX")\r
-          TSize         Short       total data size for this block\r
-          AcTime        Long        time of last access (UTC/GMT)\r
-          ModTime       Long        time of last modification (UTC/GMT)\r
-          UID           Short       Unix user ID (optional)\r
-          GID           Short       Unix group ID (optional)\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Unix1) 0x5855        Short       tag for this extra block type ("UX")\r
-          TSize         Short       total data size for this block\r
-          AcTime        Long        time of last access (GMT/UTC)\r
-          ModTime       Long        time of last modification (GMT/UTC)\r
-\r
-          The file access and modification times are in standard Unix signed-\r
-          long format, indicating the number of seconds since 1 January 1970\r
-          00:00:00.  The times are relative to Coordinated Universal Time\r
-          (UTC), also sometimes referred to as Greenwich Mean Time (GMT).  To\r
-          convert to local time, the software must know the local timezone\r
-          offset from UTC/GMT.  The modification time may be used by non-Unix\r
-          systems to support inter-timezone freshening and updating of zip\r
-          archives.\r
-\r
-          The local-header extra block may optionally contain UID and GID\r
-          info for the file.  The local-header TSize value is the only\r
-          indication of this.  Note that Unix UIDs and GIDs are usually\r
-          specific to a particular machine, and they generally require root\r
-          access to restore.\r
-\r
-          This extra field type is obsolete, but it has been in use since\r
-          mid-1994.  Therefore future archiving software should continue to\r
-          support it.  Some guidelines:\r
-\r
-              An archive member should either contain the old "Unix1"\r
-              extra field block or the new extra field types "time" and/or\r
-              "Unix2".\r
-\r
-              If both the old "Unix1" block type and one or both of the new\r
-              block types "time" and "Unix2" are found, the "Unix1" block\r
-              should be considered invalid and ignored.\r
-\r
-              Unarchiving software should recognize both old and new extra\r
-              field block types, but the info from new types overrides the\r
-              old "Unix1" field.\r
-\r
-              Archiving software should recognize "Unix1" extra fields for\r
-              timestamp comparison but never create it for updated, freshened\r
-              or new archive members.  When copying existing members to a new\r
-              archive, any "Unix1" extra field blocks should be converted to\r
-              the new "time" and/or "Unix2" types.\r
-\r
-\r
-         -Info-ZIP Unix Extra Field (type 2):\r
-          ==================================\r
-\r
-          The following is the layout of the new Info-ZIP extra block for\r
-          Unix.  (Last Revision 19960922)\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Unix2) 0x7855        Short       tag for this extra block type ("Ux")\r
-          TSize         Short       total data size for this block (4)\r
-          UID           Short       Unix user ID\r
-          GID           Short       Unix group ID\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Unix2) 0x7855        Short       tag for this extra block type ("Ux")\r
-          TSize         Short       total data size for this block (0)\r
-\r
-          The data size of the central-header version is zero; it is used\r
-          solely as a flag that UID/GID info is present in the local-header\r
-          extra field.  If additional fields are ever added to the local\r
-          version, the central version may be extended to indicate this.\r
-\r
-          Note that Unix UIDs and GIDs are usually specific to a particular\r
-          machine, and they generally require root access to restore.\r
-\r
-\r
-         -ASi Unix Extra Field:\r
-          ====================\r
-\r
-          The following is the layout of the ASi extra block for Unix.  The\r
-          local-header and central-header versions are identical.\r
-          (Last Revision 19960916)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Unix3) 0x756e        Short       tag for this extra block type ("nu")\r
-          TSize         Short       total data size for this block\r
-          CRC           Long        CRC-32 of the remaining data\r
-          Mode          Short       file permissions\r
-          SizDev        Long        symlink'd size OR major/minor dev num\r
-          UID           Short       user ID\r
-          GID           Short       group ID\r
-          (var.)        variable    symbolic link filename\r
-\r
-          Mode is the standard Unix st_mode field from struct stat, containing\r
-          user/group/other permissions, setuid/setgid and symlink info, etc.\r
-\r
-          If Mode indicates that this file is a symbolic link, SizDev is the\r
-          size of the file to which the link points.  Otherwise, if the file\r
-          is a device, SizDev contains the standard Unix st_rdev field from\r
-          struct stat (includes the major and minor numbers of the device).\r
-          SizDev is undefined in other cases.\r
-\r
-          If Mode indicates that the file is a symbolic link, the final field\r
-          will be the name of the file to which the link points.  The file-\r
-          name length can be inferred from TSize.\r
-\r
-          [Note that TSize may incorrectly refer to the data size not counting\r
-           the CRC; i.e., it may be four bytes too small.]\r
-\r
-\r
-         -BeOS Extra Field:\r
-          ================\r
-\r
-          The following is the layout of the file-attributes extra block for\r
-          BeOS.  (Last Revision 19970531)\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (BeOS)  0x6542        Short       tag for this extra block type ("Be")\r
-          TSize         Short       total data size for this block\r
-          BSize         Long        uncompressed file attribute data size\r
-          Flags         Byte        info bits\r
-          (CType)       Short       compression type\r
-          (CRC)         Long        CRC value for uncompressed file attribs\r
-          Attribs       variable    file attribute data\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (BeOS)  0x6542        Short       tag for this extra block type ("Be")\r
-          TSize         Short       total data size for this block (5)\r
-          BSize         Long        size of uncompr. local EF block data\r
-          Flags         Byte        info bits\r
-\r
-          The least significant bit of Flags in both headers indicates whether\r
-          the LOCAL extra field is uncompressed (and therefore whether CType\r
-          and CRC are omitted):\r
-\r
-                bit 0           if set, Attribs is uncompressed (no CType, CRC)\r
-                bits 1-7        reserved; if set, assume error or unknown data\r
-\r
-          Currently the only supported compression types are deflated (type 8)\r
-          and stored (type 0); the latter is not used by Info-ZIP's Zip but is\r
-          supported by UnZip.\r
-\r
-          Attribs is a BeOS-specific block of data in big-endian format with\r
-          the following structure (if compressed, uncompress it first):\r
-\r
-              Value     Size        Description\r
-              -----     ----        -----------\r
-              Name      variable    attribute name (null-terminated string)\r
-              Type      Long        attribute type (32-bit unsigned integer)\r
-              Size      Long Long   data size for this sub-block (64 bits)\r
-              Data      variable    attribute data\r
-\r
-          The attribute structure is repeated for every attribute.  The Data\r
-          field may contain anything--text, flags, bitmaps, etc.\r
-\r
-\r
-         -AtheOS Extra Field:\r
-          ==================\r
-\r
-          The following is the layout of the file-attributes extra block for\r
-          AtheOS.  This field is a very close spin-off from the BeOS e.f.\r
-          The only differences are:\r
-           - a new extra field signature\r
-           - numeric field in the attributes data are stored in little-endian\r
-             format ("i386" was initial hardware for AtheOS)\r
-          (Last Revision 20040908)\r
-\r
-          Local-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
- (AtheOS) 0x7441        Short       tag for this extra block type ("At")\r
-          TSize         Short       total data size for this block\r
-          BSize         Long        uncompressed file attribute data size\r
-          Flags         Byte        info bits\r
-          (CType)       Short       compression type\r
-          (CRC)         Long        CRC value for uncompressed file attribs\r
-          Attribs       variable    file attribute data\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
- (AtheOS) 0x7441        Short       tag for this extra block type ("At")\r
-          TSize         Short       total data size for this block (5)\r
-          BSize         Long        size of uncompr. local EF block data\r
-          Flags         Byte        info bits\r
-\r
-          The least significant bit of Flags in both headers indicates whether\r
-          the LOCAL extra field is uncompressed (and therefore whether CType\r
-          and CRC are omitted):\r
-\r
-                bit 0           if set, Attribs is uncompressed (no CType, CRC)\r
-                bits 1-7        reserved; if set, assume error or unknown data\r
-\r
-          Currently the only supported compression types are deflated (type 8)\r
-          and stored (type 0); the latter is not used by Info-ZIP's Zip but is\r
-          supported by UnZip.\r
-\r
-          Attribs is a AtheOS-specific block of data in little-endian format\r
-          with the following structure (if compressed, uncompress it first):\r
-\r
-              Value     Size        Description\r
-              -----     ----        -----------\r
-              Name      variable    attribute name (null-terminated string)\r
-              Type      Long        attribute type (32-bit unsigned integer)\r
-              Size      Long Long   data size for this sub-block (64 bits)\r
-              Data      variable    attribute data\r
-\r
-          The attribute structure is repeated for every attribute.  The Data\r
-          field may contain anything--text, flags, bitmaps, etc.\r
-\r
-\r
-         -SMS/QDOS Extra Field:\r
-          ====================\r
-\r
-          The following is the layout of the file-attributes extra block for\r
-          SMS/QDOS.  The local-header and central-header versions are identical.\r
-          (Last Revision 19960929)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (QDOS)  0xfb4a        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block\r
-          LongID        Long        extra-field signature\r
-          (ExtraID)     Long        additional signature/flag bytes\r
-          QDirect       64 bytes    qdirect structure\r
-\r
-          LongID may be "QZHD" or "QDOS".  In the latter case, ExtraID will\r
-          be present.  Its first three bytes are "02\0"; the last byte is\r
-          currently undefined.\r
-\r
-          QDirect contains the file's uncompressed directory info (qdirect\r
-          struct).  Its elements are in native (big-endian) format:\r
-\r
-          d_length      beLong          file length\r
-          d_access      byte            file access type\r
-          d_type        byte            file type\r
-          d_datalen     beLong          data length\r
-          d_reserved    beLong          unused\r
-          d_szname      beShort         size of filename\r
-          d_name        36 bytes        filename\r
-          d_update      beLong          time of last update\r
-          d_refdate     beLong          file version number\r
-          d_backup      beLong          time of last backup (archive date)\r
-\r
-\r
-         -AOS/VS Extra Field:\r
-          ==================\r
-\r
-          The following is the layout of the extra block for Data General\r
-          AOS/VS.  The local-header and central-header versions are identical.\r
-          (Last Revision 19961125)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (AOSVS) 0x5356        Short       tag for this extra block type ("VS")\r
-          TSize         Short       total data size for this block\r
-          "FCI\0"       Long        extra-field signature\r
-          Version       Byte        version of AOS/VS extra block (10 = 1.0)\r
-          Fstat         variable    fstat packet\r
-          AclBuf        variable    raw ACL data ($MXACL bytes)\r
-\r
-          Fstat contains the file's uncompressed fstat packet, which is one of\r
-          the following:\r
-\r
-                normal fstat packet             (P_FSTAT struct)\r
-                DIR/CPD fstat packet            (P_FSTAT_DIR struct)\r
-                unit (device) fstat packet      (P_FSTAT_UNIT struct)\r
-                IPC file fstat packet           (P_FSTAT_IPC struct)\r
-\r
-          AclBuf contains the raw ACL data; its length is $MXACL.\r
-\r
-\r
-         -Tandem NSK Extra Field:\r
-          ======================\r
-\r
-          The following is the layout of the file-attributes extra block for\r
-          Tandem NSK.  The local-header and central-header versions are\r
-          identical.  (Last Revision 19981221)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (TA)    0x4154        Short       tag for this extra block type ("TA")\r
-          TSize         Short       total data size for this block (20)\r
-          NSKattrs      20 Bytes    NSK attributes\r
-\r
-\r
-         -THEOS Extra Field:\r
-          =================\r
-\r
-          The following is the layout of the file-attributes extra block for\r
-          Theos.  The local-header and central-header versions are identical.\r
-          (Last Revision 19990206)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Theos) 0x6854        Short       'Th' signature\r
-          size          Short       size of extra block\r
-          flags         Byte        reserved for future use\r
-          filesize      Long        file size\r
-          fileorg       Byte        type of file (see below)\r
-          keylen        Short       key length for indexed and keyed files,\r
-                                    data segment size for 16 bits programs\r
-          reclen        Short       record length for indexed,keyed and direct,\r
-                                    text segment size for 16 bits programs\r
-          filegrow      Byte        growing factor for indexed,keyed and direct\r
-          protect       Byte        protections (see below)\r
-          reserved      Short       reserved for future use\r
-\r
-            File types\r
-            ==========\r
-\r
-            0x80  library (keyed access list of files)\r
-            0x40  directory\r
-            0x10  stream file\r
-            0x08  direct file\r
-            0x04  keyed file\r
-            0x02  indexed file\r
-            0x0e  reserved\r
-            0x01  16 bits real mode program (obsolete)\r
-            0x21  16 bits protected mode program\r
-            0x41  32 bits protected mode program\r
-\r
-            Protection codes\r
-            ================\r
-\r
-            User protection\r
-            ---------------\r
-            0x01  non readable\r
-            0x02  non writable\r
-            0x04  non executable\r
-            0x08  non erasable\r
-\r
-            Other protection\r
-            ----------------\r
-            0x10  non readable\r
-            0x20  non writable\r
-            0x40  non executable Theos before 4.0\r
-            0x40  modified Theos 4.x\r
-            0x80  not hidden\r
-\r
-\r
-         -THEOS old inofficial Extra Field:\r
-          ================================\r
-\r
-          The following is the layout of an inoffical former version of a\r
-          Theos file-attributes extra blocks.  This layout was never published\r
-          and is no longer created. However, UnZip can optionally support it\r
-          when compiling with the option flag OLD_THEOS_EXTRA defined.\r
-          Both the local-header and central-header versions are identical.\r
-          (Last Revision 19990206)\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (THS0)  0x4854        Short       'TH' signature\r
-          size          Short       size of extra block\r
-          flags         Short       reserved for future use\r
-          filesize      Long        file size\r
-          reclen        Short       record length for indexed,keyed and direct,\r
-                                    text segment size for 16 bits programs\r
-          keylen        Short       key length for indexed and keyed files,\r
-                                    data segment size for 16 bits programs\r
-          filegrow      Byte        growing factor for indexed,keyed and direct\r
-          reserved      3 Bytes     reserved for future use\r
-\r
-\r
-         -FWKCS MD5 Extra Field (0x4b46):\r
-          ==============================\r
-\r
-          The FWKCS Contents_Signature System, used in automatically\r
-          identifying files independent of filename, optionally adds\r
-          and uses an extra field to support the rapid creation of\r
-          an enhanced contents_signature.\r
-          There is no local-header version; the following applies\r
-          only to the central header.  (Last Revision 19961207)\r
-\r
-          Central-header version:\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (MD5)   0x4b46        Short       tag for this extra block type ("FK")\r
-          TSize         Short       total data size for this block (19)\r
-          "MD5"         3 bytes     extra-field signature\r
-          MD5hash       16 bytes    128-bit MD5 hash of uncompressed data\r
-                                    (low byte first)\r
-\r
-          When FWKCS revises a .ZIP file central directory to add\r
-          this extra field for a file, it also replaces the\r
-          central directory entry for that file's uncompressed\r
-          file length with a measured value.\r
-\r
-          FWKCS provides an option to strip this extra field, if\r
-          present, from a .ZIP file central directory. In adding\r
-          this extra field, FWKCS preserves .ZIP file Authenticity\r
-          Verification; if stripping this extra field, FWKCS\r
-          preserves all versions of AV through PKZIP version 2.04g.\r
-\r
-          FWKCS, and FWKCS Contents_Signature System, are\r
-          trademarks of Frederick W. Kantor.\r
-\r
-          (1) R. Rivest, RFC1321.TXT, MIT Laboratory for Computer\r
-              Science and RSA Data Security, Inc., April 1992.\r
-              ll.76-77: "The MD5 algorithm is being placed in the\r
-              public domain for review and possible adoption as a\r
-              standard."\r
-\r
-\r
-      file comment: (Variable)\r
-\r
-          The comment for this file.\r
-\r
-      number of this disk: (2 bytes)\r
-\r
-          The number of this disk, which contains central\r
-          directory end record.  If an archive is in zip64 format\r
-          and the value in this field is 0xFFFF, the size will\r
-          be in the corresponding 4 byte zip64 end of central\r
-          directory field.\r
-\r
-      number of the disk with the start of the central directory: (2 bytes)\r
-\r
-          The number of the disk on which the central\r
-          directory starts.  If an archive is in zip64 format\r
-          and the value in this field is 0xFFFF, the size will\r
-          be in the corresponding 4 byte zip64 end of central\r
-          directory field.\r
-\r
-      total number of entries in the central dir on this disk: (2 bytes)\r
-\r
-          The number of central directory entries on this disk.\r
-          If an archive is in zip64 format and the value in\r
-          this field is 0xFFFF, the size will be in the\r
-          corresponding 8 byte zip64 end of central\r
-          directory field.\r
-\r
-      total number of entries in the central dir: (2 bytes)\r
-\r
-          The total number of files in the .ZIP file.  If an\r
-          archive is in zip64 format and the value in this field\r
-          is 0xFFFF, the size will be in the corresponding 8 byte\r
-          zip64 end of central directory field.\r
-\r
-      size of the central directory: (4 bytes)\r
-\r
-          The size (in bytes) of the entire central directory.\r
-          If an archive is in zip64 format and the value in\r
-          this field is 0xFFFFFFFF, the size will be in the\r
-          corresponding 8 byte zip64 end of central\r
-          directory field.\r
-\r
-      offset of start of central directory with respect to\r
-      the starting disk number:  (4 bytes)\r
-\r
-          Offset of the start of the central directory on the\r
-          disk on which the central directory starts.  If an\r
-          archive is in zip64 format and the value in this\r
-          field is 0xFFFFFFFF, the size will be in the\r
-          corresponding 8 byte zip64 end of central\r
-          directory field.\r
-\r
-      .ZIP file comment length: (2 bytes)\r
-\r
-          The length of the comment for this .ZIP file.\r
-\r
-      .ZIP file comment: (Variable)\r
-\r
-          The comment for this .ZIP file.  ZIP file comment data\r
-          is stored unsecured.  No encryption or data authentication\r
-          is applied to this area at this time.  Confidential information\r
-          should not be stored in this section.\r
-\r
-      zip64 extensible data sector    (variable size)\r
-\r
-          (currently reserved for use by PKWARE)\r
-\r
-\r
-  K.  General notes:\r
-\r
-      1)  All fields unless otherwise noted are unsigned and stored\r
-          in Intel low-byte:high-byte, low-word:high-word order.\r
-\r
-      2)  String fields are not null terminated, since the\r
-          length is given explicitly.\r
-\r
-      3)  Local headers should not span disk boundaries.  Also, even\r
-          though the central directory can span disk boundaries, no\r
-          single record in the central directory should be split\r
-          across disks.\r
-\r
-      4)  The entries in the central directory may not necessarily\r
-          be in the same order that files appear in the .ZIP file.\r
-\r
-      5)  Spanned/Split archives created using PKZIP for Windows\r
-          (V2.50 or greater), PKZIP Command Line (V2.50 or greater),\r
-          or PKZIP Explorer will include a special spanning\r
-          signature as the first 4 bytes of the first segment of\r
-          the archive.  This signature (0x08074b50) will be\r
-          followed immediately by the local header signature for\r
-          the first file in the archive.  A special spanning\r
-          marker may also appear in spanned/split archives if the\r
-          spanning or splitting process starts but only requires\r
-          one segment.  In this case the 0x08074b50 signature\r
-          will be replaced with the temporary spanning marker\r
-          signature of 0x30304b50.  Spanned/split archives\r
-          created with this special signature are compatible with\r
-          all versions of PKZIP from PKWARE.  Split archives can\r
-          only be uncompressed by other versions of PKZIP that\r
-          know how to create a split archive.\r
-\r
-      6)  If one of the fields in the end of central directory\r
-          record is too small to hold required data, the field\r
-          should be set to -1 (0xFFFF or 0xFFFFFFFF) and the\r
-          Zip64 format record should be created.\r
-\r
-      7)  The end of central directory record and the\r
-          Zip64 end of central directory locator record must\r
-          reside on the same disk when splitting or spanning\r
-          an archive.\r
-\r
-V. UnShrinking - Method 1\r
--------------------------\r
-\r
-Shrinking is a Dynamic Ziv-Lempel-Welch compression algorithm\r
-with partial clearing.  The initial code size is 9 bits, and\r
-the maximum code size is 13 bits.  Shrinking differs from\r
-conventional Dynamic Ziv-Lempel-Welch implementations in several\r
-respects:\r
-\r
-1)  The code size is controlled by the compressor, and is not\r
-    automatically increased when codes larger than the current\r
-    code size are created (but not necessarily used).  When\r
-    the decompressor encounters the code sequence 256\r
-    (decimal) followed by 1, it should increase the code size\r
-    read from the input stream to the next bit size.  No\r
-    blocking of the codes is performed, so the next code at\r
-    the increased size should be read from the input stream\r
-    immediately after where the previous code at the smaller\r
-    bit size was read.  Again, the decompressor should not\r
-    increase the code size used until the sequence 256,1 is\r
-    encountered.\r
-\r
-2)  When the table becomes full, total clearing is not\r
-    performed.  Rather, when the compressor emits the code\r
-    sequence 256,2 (decimal), the decompressor should clear\r
-    all leaf nodes from the Ziv-Lempel tree, and continue to\r
-    use the current code size.  The nodes that are cleared\r
-    from the Ziv-Lempel tree are then re-used, with the lowest\r
-    code value re-used first, and the highest code value\r
-    re-used last.  The compressor can emit the sequence 256,2\r
-    at any time.\r
-\r
-\r
-VI. Expanding - Methods 2-5\r
----------------------------\r
-\r
-The Reducing algorithm is actually a combination of two\r
-distinct algorithms.  The first algorithm compresses repeated\r
-byte sequences, and the second algorithm takes the compressed\r
-stream from the first algorithm and applies a probabilistic\r
-compression method.\r
-\r
-The probabilistic compression stores an array of 'follower\r
-sets' S(j), for j=0 to 255, corresponding to each possible\r
-ASCII character.  Each set contains between 0 and 32\r
-characters, to be denoted as S(j)[0],...,S(j)[m], where m<32.\r
-The sets are stored at the beginning of the data area for a\r
-Reduced file, in reverse order, with S(255) first, and S(0)\r
-last.\r
-\r
-The sets are encoded as { N(j), S(j)[0],...,S(j)[N(j)-1] },\r
-where N(j) is the size of set S(j).  N(j) can be 0, in which\r
-case the follower set for S(j) is empty.  Each N(j) value is\r
-encoded in 6 bits, followed by N(j) eight bit character values\r
-corresponding to S(j)[0] to S(j)[N(j)-1] respectively.  If\r
-N(j) is 0, then no values for S(j) are stored, and the value\r
-for N(j-1) immediately follows.\r
-\r
-Immediately after the follower sets, is the compressed data\r
-stream.  The compressed data stream can be interpreted for the\r
-probabilistic decompression as follows:\r
-\r
-\r
-let Last-Character <- 0.\r
-loop until done\r
-    if the follower set S(Last-Character) is empty then\r
-        read 8 bits from the input stream, and copy this\r
-        value to the output stream.\r
-    otherwise if the follower set S(Last-Character) is non-empty then\r
-        read 1 bit from the input stream.\r
-        if this bit is not zero then\r
-            read 8 bits from the input stream, and copy this\r
-            value to the output stream.\r
-        otherwise if this bit is zero then\r
-            read B(N(Last-Character)) bits from the input\r
-            stream, and assign this value to I.\r
-            Copy the value of S(Last-Character)[I] to the\r
-            output stream.\r
-\r
-    assign the last value placed on the output stream to\r
-    Last-Character.\r
-end loop\r
-\r
-\r
-B(N(j)) is defined as the minimal number of bits required to\r
-encode the value N(j)-1.\r
-\r
-\r
-The decompressed stream from above can then be expanded to\r
-re-create the original file as follows:\r
-\r
-\r
-let State <- 0.\r
-\r
-loop until done\r
-    read 8 bits from the input stream into C.\r
-    case State of\r
-        0:  if C is not equal to DLE (144 decimal) then\r
-                copy C to the output stream.\r
-            otherwise if C is equal to DLE then\r
-                let State <- 1.\r
-\r
-        1:  if C is non-zero then\r
-                let V <- C.\r
-                let Len <- L(V)\r
-                let State <- F(Len).\r
-            otherwise if C is zero then\r
-                copy the value 144 (decimal) to the output stream.\r
-                let State <- 0\r
-\r
-        2:  let Len <- Len + C\r
-            let State <- 3.\r
-\r
-        3:  move backwards D(V,C) bytes in the output stream\r
-            (if this position is before the start of the output\r
-            stream, then assume that all the data before the\r
-            start of the output stream is filled with zeros).\r
-            copy Len+3 bytes from this position to the output stream.\r
-            let State <- 0.\r
-    end case\r
-end loop\r
-\r
-\r
-The functions F,L, and D are dependent on the 'compression\r
-factor', 1 through 4, and are defined as follows:\r
-\r
-For compression factor 1:\r
-    L(X) equals the lower 7 bits of X.\r
-    F(X) equals 2 if X equals 127 otherwise F(X) equals 3.\r
-    D(X,Y) equals the (upper 1 bit of X) * 256 + Y + 1.\r
-For compression factor 2:\r
-    L(X) equals the lower 6 bits of X.\r
-    F(X) equals 2 if X equals 63 otherwise F(X) equals 3.\r
-    D(X,Y) equals the (upper 2 bits of X) * 256 + Y + 1.\r
-For compression factor 3:\r
-    L(X) equals the lower 5 bits of X.\r
-    F(X) equals 2 if X equals 31 otherwise F(X) equals 3.\r
-    D(X,Y) equals the (upper 3 bits of X) * 256 + Y + 1.\r
-For compression factor 4:\r
-    L(X) equals the lower 4 bits of X.\r
-    F(X) equals 2 if X equals 15 otherwise F(X) equals 3.\r
-    D(X,Y) equals the (upper 4 bits of X) * 256 + Y + 1.\r
-\r
-\r
-VII. Imploding - Method 6\r
--------------------------\r
-\r
-The Imploding algorithm is actually a combination of two distinct\r
-algorithms.  The first algorithm compresses repeated byte\r
-sequences using a sliding dictionary.  The second algorithm is\r
-used to compress the encoding of the sliding dictionary output,\r
-using multiple Shannon-Fano trees.\r
-\r
-The Imploding algorithm can use a 4K or 8K sliding dictionary\r
-size. The dictionary size used can be determined by bit 1 in the\r
-general purpose flag word; a 0 bit indicates a 4K dictionary\r
-while a 1 bit indicates an 8K dictionary.\r
-\r
-The Shannon-Fano trees are stored at the start of the compressed\r
-file. The number of trees stored is defined by bit 2 in the\r
-general purpose flag word; a 0 bit indicates two trees stored, a\r
-1 bit indicates three trees are stored.  If 3 trees are stored,\r
-the first Shannon-Fano tree represents the encoding of the\r
-Literal characters, the second tree represents the encoding of\r
-the Length information, the third represents the encoding of the\r
-Distance information.  When 2 Shannon-Fano trees are stored, the\r
-Length tree is stored first, followed by the Distance tree.\r
-\r
-The Literal Shannon-Fano tree, if present is used to represent\r
-the entire ASCII character set, and contains 256 values.  This\r
-tree is used to compress any data not compressed by the sliding\r
-dictionary algorithm.  When this tree is present, the Minimum\r
-Match Length for the sliding dictionary is 3.  If this tree is\r
-not present, the Minimum Match Length is 2.\r
-\r
-The Length Shannon-Fano tree is used to compress the Length part\r
-of the (length,distance) pairs from the sliding dictionary\r
-output.  The Length tree contains 64 values, ranging from the\r
-Minimum Match Length, to 63 plus the Minimum Match Length.\r
-\r
-The Distance Shannon-Fano tree is used to compress the Distance\r
-part of the (length,distance) pairs from the sliding dictionary\r
-output. The Distance tree contains 64 values, ranging from 0 to\r
-63, representing the upper 6 bits of the distance value.  The\r
-distance values themselves will be between 0 and the sliding\r
-dictionary size, either 4K or 8K.\r
-\r
-The Shannon-Fano trees themselves are stored in a compressed\r
-format. The first byte of the tree data represents the number of\r
-bytes of data representing the (compressed) Shannon-Fano tree\r
-minus 1.  The remaining bytes represent the Shannon-Fano tree\r
-data encoded as:\r
-\r
-    High 4 bits: Number of values at this bit length + 1. (1 - 16)\r
-    Low  4 bits: Bit Length needed to represent value + 1. (1 - 16)\r
-\r
-The Shannon-Fano codes can be constructed from the bit lengths\r
-using the following algorithm:\r
-\r
-1)  Sort the Bit Lengths in ascending order, while retaining the\r
-    order of the original lengths stored in the file.\r
-\r
-2)  Generate the Shannon-Fano trees:\r
-\r
-    Code <- 0\r
-    CodeIncrement <- 0\r
-    LastBitLength <- 0\r
-    i <- number of Shannon-Fano codes - 1   (either 255 or 63)\r
-\r
-    loop while i >= 0\r
-        Code = Code + CodeIncrement\r
-        if BitLength(i) <> LastBitLength then\r
-            LastBitLength=BitLength(i)\r
-            CodeIncrement = 1 shifted left (16 - LastBitLength)\r
-        ShannonCode(i) = Code\r
-        i <- i - 1\r
-    end loop\r
-\r
-\r
-3)  Reverse the order of all the bits in the above ShannonCode()\r
-    vector, so that the most significant bit becomes the least\r
-    significant bit.  For example, the value 0x1234 (hex) would\r
-    become 0x2C48 (hex).\r
-\r
-4)  Restore the order of Shannon-Fano codes as originally stored\r
-    within the file.\r
-\r
-Example:\r
-\r
-    This example will show the encoding of a Shannon-Fano tree\r
-    of size 8.  Notice that the actual Shannon-Fano trees used\r
-    for Imploding are either 64 or 256 entries in size.\r
-\r
-Example:   0x02, 0x42, 0x01, 0x13\r
-\r
-    The first byte indicates 3 values in this table.  Decoding the\r
-    bytes:\r
-            0x42 = 5 codes of 3 bits long\r
-            0x01 = 1 code  of 2 bits long\r
-            0x13 = 2 codes of 4 bits long\r
-\r
-    This would generate the original bit length array of:\r
-    (3, 3, 3, 3, 3, 2, 4, 4)\r
-\r
-    There are 8 codes in this table for the values 0 thru 7.  Using\r
-    the algorithm to obtain the Shannon-Fano codes produces:\r
-\r
-                                  Reversed     Order     Original\r
-Val  Sorted   Constructed Code      Value     Restored    Length\r
----  ------   -----------------   --------    --------    ------\r
-0:     2      1100000000000000        11       101          3\r
-1:     3      1010000000000000       101       001          3\r
-2:     3      1000000000000000       001       110          3\r
-3:     3      0110000000000000       110       010          3\r
-4:     3      0100000000000000       010       100          3\r
-5:     3      0010000000000000       100        11          2\r
-6:     4      0001000000000000      1000      1000          4\r
-7:     4      0000000000000000      0000      0000          4\r
-\r
-\r
-The values in the Val, Order Restored and Original Length columns\r
-now represent the Shannon-Fano encoding tree that can be used for\r
-decoding the Shannon-Fano encoded data.  How to parse the\r
-variable length Shannon-Fano values from the data stream is beyond\r
-the scope of this document.  (See the references listed at the end of\r
-this document for more information.)  However, traditional decoding\r
-schemes used for Huffman variable length decoding, such as the\r
-Greenlaw algorithm, can be successfully applied.\r
-\r
-The compressed data stream begins immediately after the\r
-compressed Shannon-Fano data.  The compressed data stream can be\r
-interpreted as follows:\r
-\r
-loop until done\r
-    read 1 bit from input stream.\r
-\r
-    if this bit is non-zero then       (encoded data is literal data)\r
-        if Literal Shannon-Fano tree is present\r
-            read and decode character using Literal Shannon-Fano tree.\r
-        otherwise\r
-            read 8 bits from input stream.\r
-        copy character to the output stream.\r
-    otherwise              (encoded data is sliding dictionary match)\r
-        if 8K dictionary size\r
-            read 7 bits for offset Distance (lower 7 bits of offset).\r
-        otherwise\r
-            read 6 bits for offset Distance (lower 6 bits of offset).\r
-\r
-        using the Distance Shannon-Fano tree, read and decode the\r
-          upper 6 bits of the Distance value.\r
-\r
-        using the Length Shannon-Fano tree, read and decode\r
-          the Length value.\r
-\r
-        Length <- Length + Minimum Match Length\r
-\r
-        if Length = 63 + Minimum Match Length\r
-            read 8 bits from the input stream,\r
-            add this value to Length.\r
-\r
-        move backwards Distance+1 bytes in the output stream, and\r
-        copy Length characters from this position to the output\r
-        stream.  (if this position is before the start of the output\r
-        stream, then assume that all the data before the start of\r
-        the output stream is filled with zeros).\r
-end loop\r
-\r
-VIII. Tokenizing - Method 7\r
----------------------------\r
-\r
-This method is not used by PKZIP.\r
-\r
-IX. Deflating - Method 8\r
-------------------------\r
-\r
-The Deflate algorithm is similar to the Implode algorithm using\r
-a sliding dictionary of up to 32K with secondary compression\r
-from Huffman/Shannon-Fano codes.\r
-\r
-The compressed data is stored in blocks with a header describing\r
-the block and the Huffman codes used in the data block.  The header\r
-format is as follows:\r
-\r
-   Bit 0: Last Block bit     This bit is set to 1 if this is the last\r
-                             compressed block in the data.\r
-   Bits 1-2: Block type\r
-      00 (0) - Block is stored - All stored data is byte aligned.\r
-               Skip bits until next byte, then next word = block\r
-               length, followed by the ones compliment of the block\r
-               length word. Remaining data in block is the stored\r
-               data.\r
-\r
-      01 (1) - Use fixed Huffman codes for literal and distance codes.\r
-               Lit Code    Bits             Dist Code   Bits\r
-               ---------   ----             ---------   ----\r
-                 0 - 143    8                 0 - 31      5\r
-               144 - 255    9\r
-               256 - 279    7\r
-               280 - 287    8\r
-\r
-               Literal codes 286-287 and distance codes 30-31 are\r
-               never used but participate in the huffman construction.\r
-\r
-      10 (2) - Dynamic Huffman codes.  (See expanding Huffman codes)\r
-\r
-      11 (3) - Reserved - Flag a "Error in compressed data" if seen.\r
-\r
-Expanding Huffman Codes\r
------------------------\r
-If the data block is stored with dynamic Huffman codes, the Huffman\r
-codes are sent in the following compressed format:\r
-\r
-   5 Bits: # of Literal codes sent - 257 (257 - 286)\r
-           All other codes are never sent.\r
-   5 Bits: # of Dist codes - 1           (1 - 32)\r
-   4 Bits: # of Bit Length codes - 4     (4 - 19)\r
-\r
-The Huffman codes are sent as bit lengths and the codes are built as\r
-described in the implode algorithm.  The bit lengths themselves are\r
-compressed with Huffman codes.  There are 19 bit length codes:\r
-\r
-   0 - 15: Represent bit lengths of 0 - 15\r
-       16: Copy the previous bit length 3 - 6 times.\r
-           The next 2 bits indicate repeat length (0 = 3, ... ,3 = 6)\r
-              Example:  Codes 8, 16 (+2 bits 11), 16 (+2 bits 10) will\r
-                        expand to 12 bit lengths of 8 (1 + 6 + 5)\r
-       17: Repeat a bit length of 0 for 3 - 10 times. (3 bits of length)\r
-       18: Repeat a bit length of 0 for 11 - 138 times (7 bits of length)\r
-\r
-The lengths of the bit length codes are sent packed 3 bits per value\r
-(0 - 7) in the following order:\r
-\r
-   16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15\r
-\r
-The Huffman codes should be built as described in the Implode algorithm\r
-except codes are assigned starting at the shortest bit length, i.e. the\r
-shortest code should be all 0's rather than all 1's.  Also, codes with\r
-a bit length of zero do not participate in the tree construction.  The\r
-codes are then used to decode the bit lengths for the literal and\r
-distance tables.\r
-\r
-The bit lengths for the literal tables are sent first with the number\r
-of entries sent described by the 5 bits sent earlier.  There are up\r
-to 286 literal characters; the first 256 represent the respective 8\r
-bit character, code 256 represents the End-Of-Block code, the remaining\r
-29 codes represent copy lengths of 3 thru 258.  There are up to 30\r
-distance codes representing distances from 1 thru 32k as described\r
-below.\r
-\r
-                             Length Codes\r
-                             ------------\r
-      Extra             Extra              Extra              Extra\r
- Code Bits Length  Code Bits Lengths  Code Bits Lengths  Code Bits Length(s)\r
- ---- ---- ------  ---- ---- -------  ---- ---- -------  ---- ---- ---------\r
-  257   0     3     265   1   11,12    273   3   35-42    281   5  131-162\r
-  258   0     4     266   1   13,14    274   3   43-50    282   5  163-194\r
-  259   0     5     267   1   15,16    275   3   51-58    283   5  195-226\r
-  260   0     6     268   1   17,18    276   3   59-66    284   5  227-258\r
-  261   0     7     269   2   19-22    277   4   67-82    285   0    258\r
-  262   0     8     270   2   23-26    278   4   83-98\r
-  263   0     9     271   2   27-30    279   4   99-114\r
-  264   0    10     272   2   31-34    280   4  115-130\r
-\r
-                            Distance Codes\r
-                            --------------\r
-      Extra           Extra             Extra               Extra\r
- Code Bits Dist  Code Bits  Dist   Code Bits Distance  Code Bits Distance\r
- ---- ---- ----  ---- ---- ------  ---- ---- --------  ---- ---- --------\r
-   0   0    1      8   3   17-24    16    7  257-384    24   11  4097-6144\r
-   1   0    2      9   3   25-32    17    7  385-512    25   11  6145-8192\r
-   2   0    3     10   4   33-48    18    8  513-768    26   12  8193-12288\r
-   3   0    4     11   4   49-64    19    8  769-1024   27   12 12289-16384\r
-   4   1   5,6    12   5   65-96    20    9 1025-1536   28   13 16385-24576\r
-   5   1   7,8    13   5   97-128   21    9 1537-2048   29   13 24577-32768\r
-   6   2   9-12   14   6  129-192   22   10 2049-3072\r
-   7   2  13-16   15   6  193-256   23   10 3073-4096\r
-\r
-The compressed data stream begins immediately after the\r
-compressed header data.  The compressed data stream can be\r
-interpreted as follows:\r
-\r
-do\r
-   read header from input stream.\r
-\r
-   if stored block\r
-      skip bits until byte aligned\r
-      read count and 1's compliment of count\r
-      copy count bytes data block\r
-   otherwise\r
-      loop until end of block code sent\r
-         decode literal character from input stream\r
-         if literal < 256\r
-            copy character to the output stream\r
-         otherwise\r
-            if literal = end of block\r
-               break from loop\r
-            otherwise\r
-               decode distance from input stream\r
-\r
-               move backwards distance bytes in the output stream, and\r
-               copy length characters from this position to the output\r
-               stream.\r
-      end loop\r
-while not last block\r
-\r
-if data descriptor exists\r
-   skip bits until byte aligned\r
-   check data descriptor signature\r
-   read crc and sizes\r
-endif\r
-\r
-X. Enhanced Deflating - Method 9\r
---------------------------------\r
-\r
-The Enhanced Deflating algorithm is similar to Deflate but\r
-uses a sliding dictionary of up to 64K. Deflate64(tm) is supported\r
-by the Deflate extractor.\r
-\r
-[This description is inofficial.  It has been deduced by Info-ZIP from\r
-close inspection of PKZIP 4.x Deflate64(tm) compressed output.]\r
-\r
-The Deflate64 algorithm is almost identical to the normal Deflate algorithm.\r
-Differences are:\r
-\r
-- The sliding window size is 64k.\r
-\r
-- The previously unused distance codes 30 and 31 are now used to describe\r
-  match distances from 32k-48k and 48k-64k.\r
-         Extra\r
-    Code Bits Distance\r
-    ---- ---- -----------\r
-     ..   ..      ...\r
-     29   13  24577-32768\r
-     30   14  32769-49152\r
-     31   14  49153-65536\r
-\r
-- The semantics of the "maximum match length" code #258 has been changed to\r
-  allow the specification of arbitrary large match lengths (up to 64k).\r
-         Extra\r
-    Code Bits Lengths\r
-    ---- ---- ------\r
-     ...  ..    ...\r
-     284   5  227-258\r
-     285  16  3-65538\r
-\r
-Whereas the first two modifications fit into the framework of Deflate,\r
-this last change breaks compatibility with Deflate method 8. Thus, a\r
-Deflate64 decompressor cannot decode normal deflated data.\r
-\r
-XI. BZIP2 - Method 12\r
----------------------\r
-\r
-BZIP2 is an open-source data compression algorithm developed by\r
-Julian Seward.  Information and source code for this algorithm\r
-can be found on the internet.\r
-\r
-\r
-XII. Traditional PKWARE Encryption\r
-----------------------------------\r
-\r
-The following information discusses the decryption steps\r
-required to support traditional PKWARE encryption.  This\r
-form of encryption is considered weak by today's standards\r
-and its use is recommended only for situations with\r
-low security needs or for compatibility with older .ZIP\r
-applications.\r
-\r
-XIII. Decryption\r
-----------------\r
-\r
-The encryption used in PKZIP was generously supplied by Roger\r
-Schlafly.  PKWARE is grateful to Mr. Schlafly for his expert\r
-help and advice in the field of data encryption.\r
-\r
-PKZIP encrypts the compressed data stream.  Encrypted files must\r
-be decrypted before they can be extracted.\r
-\r
-Each encrypted file has an extra 12 bytes stored at the start of\r
-the data area defining the encryption header for that file.  The\r
-encryption header is originally set to random values, and then\r
-itself encrypted, using three, 32-bit keys.  The key values are\r
-initialized using the supplied encryption password.  After each byte\r
-is encrypted, the keys are then updated using pseudo-random number\r
-generation techniques in combination with the same CRC-32 algorithm\r
-used in PKZIP and described elsewhere in this document.\r
-\r
-The following is the basic steps required to decrypt a file:\r
-\r
-1) Initialize the three 32-bit keys with the password.\r
-2) Read and decrypt the 12-byte encryption header, further\r
-   initializing the encryption keys.\r
-3) Read and decrypt the compressed data stream using the\r
-   encryption keys.\r
-\r
-\r
-Step 1 - Initializing the encryption keys\r
------------------------------------------\r
-\r
-Key(0) <- 305419896\r
-Key(1) <- 591751049\r
-Key(2) <- 878082192\r
-\r
-loop for i <- 0 to length(password)-1\r
-    update_keys(password(i))\r
-end loop\r
-\r
-\r
-Where update_keys() is defined as:\r
-\r
-\r
-update_keys(char):\r
-  Key(0) <- crc32(key(0),char)\r
-  Key(1) <- Key(1) + (Key(0) & 000000ffH)\r
-  Key(1) <- Key(1) * 134775813 + 1\r
-  Key(2) <- crc32(key(2),key(1) >> 24)\r
-end update_keys\r
-\r
-\r
-Where crc32(old_crc,char) is a routine that given a CRC value and a\r
-character, returns an updated CRC value after applying the CRC-32\r
-algorithm described elsewhere in this document.\r
-\r
-\r
-Step 2 - Decrypting the encryption header\r
------------------------------------------\r
-\r
-The purpose of this step is to further initialize the encryption\r
-keys, based on random data, to render a plaintext attack on the\r
-data ineffective.\r
-\r
-\r
-Read the 12-byte encryption header into Buffer, in locations\r
-Buffer(0) thru Buffer(11).\r
-\r
-loop for i <- 0 to 11\r
-    C <- buffer(i) ^ decrypt_byte()\r
-    update_keys(C)\r
-    buffer(i) <- C\r
-end loop\r
-\r
-\r
-Where decrypt_byte() is defined as:\r
-\r
-\r
-unsigned char decrypt_byte()\r
-    local unsigned short temp\r
-    temp <- Key(2) | 2\r
-    decrypt_byte <- (temp * (temp ^ 1)) >> 8\r
-end decrypt_byte\r
-\r
-\r
-After the header is decrypted,  the last 1 or 2 bytes in Buffer\r
-should be the high-order word/byte of the CRC for the file being\r
-decrypted, stored in Intel low-byte/high-byte order, or the high-order\r
-byte of the file time if bit 3 of the general purpose bit flag is set.\r
-Versions of PKZIP prior to 2.0 used a 2 byte CRC check; a 1 byte CRC check is\r
-used on versions after 2.0.  This can be used to test if the password\r
-supplied is correct or not.\r
-\r
-\r
-Step 3 - Decrypting the compressed data stream\r
-----------------------------------------------\r
-\r
-The compressed data stream can be decrypted as follows:\r
-\r
-\r
-loop until done\r
-    read a character into C\r
-    Temp <- C ^ decrypt_byte()\r
-    update_keys(temp)\r
-    output Temp\r
-end loop\r
-\r
-\r
-XIV. Strong Encryption Specification (EFS)\r
-------------------------------------------\r
-\r
-Version 5.x of this specification introduced support for strong\r
-encryption algorithms.  These algorithms can be used with either\r
-a password or an X.509v3 digital certificate to encrypt each file.\r
-This format specification supports either password or certificate\r
-based encryption to meet the security needs of today, to enable\r
-interoperability between users within both PKI and non-PKI\r
-environments, and to ensure interoperability between different\r
-computing platforms that are running a ZIP program.\r
-\r
-Password based encryption is the most common form of encryption\r
-people are familiar with.  However, inherent weaknesses with\r
-passwords (e.g. susceptibility to dictionary/brute force attack)\r
-as well as password management and support issues make certificate\r
-based encryption a more secure and scalable option.  Industry\r
-efforts and support are defining and moving towards more advanced\r
-security solutions built around X.509v3 digital certificates and\r
-Public Key Infrastructures(PKI) because of the greater scalability,\r
-administrative options, and more robust security over traditional\r
-password-based encryption.\r
-\r
-Most standard encryption algorithms are supported with this\r
-specification. Reference implementations for many of these\r
-algorithms are available from either commercial or open source\r
-distributors.  Readily available cryptographic toolkits make\r
-implementation of the encryption features straight-forward.\r
-This document is not intended to provide a treatise on data\r
-encryption principles or theory.  Its purpose is to document the\r
-data structures required for implementing interoperable data\r
-encryption within the .ZIP format.  It is strongly recommended that\r
-you have a good understanding of data encryption before reading\r
-further.\r
-\r
-The algorithms introduced in Version 5.0 of this specification\r
-include:\r
-\r
-    RC2 40 bit, 64 bit, and 128 bit\r
-    RC4 40 bit, 64 bit, and 128 bit\r
-    DES\r
-    3DES 112 bit and 168 bit\r
-\r
-Version 5.1 adds support for the following:\r
-\r
-    AES 128 bit, 192 bit, and 256 bit\r
-\r
-Version 6.1 introduces encryption data changes to support\r
-interoperability with SmartCard and USB Token certificate storage\r
-methods which do not support the OAEP strengthening standard.\r
-\r
-Version 6.2 introduces support for encrypting metadata by compressing\r
-and encrypting the central directory data structure to reduce information\r
-leakage.   Information leakage can occur in legacy ZIP applications\r
-through exposure of information about a file even though that file is\r
-stored encrypted.  The information exposed consists of file\r
-characteristics stored within the records and fields defined by this\r
-specification.  This includes data such as a files name, its original\r
-size, timestamp and CRC32 value.\r
-\r
-Central Directory Encryption provides greater protection against\r
-information leakage by encrypting the Central Directory structure and\r
-by masking key values that are replicated in the unencrypted Local\r
-Header.   ZIP compatible programs that cannot interpret an encrypted\r
-Central Directory structure cannot rely on the data in the corresponding\r
-Local Header for decompression information.\r
-\r
-Extra Field records that may contain information about a file that should\r
-not be exposed should not be stored in the Local Header and should only\r
-be written to the Central Directory where they can be encrypted.  This\r
-design currently does not support streaming.  Information in the End of\r
-Central Directory record, the ZIP64 End of Central Directory Locator,\r
-and the ZIP64 End of Central Directory record are not encrypted.  Access\r
-to view data on files within a ZIP file with an encrypted Central Directory\r
-requires the appropriate password or private key for decryption prior to\r
-viewing any files, or any information about the files, in the archive.\r
-\r
-Older ZIP compatible programs not familiar with the Central Directory\r
-Encryption feature will no longer be able to recognize the Central\r
-Directory and may assume the ZIP file is corrupt.  Programs that\r
-attempt streaming access using Local Headers will see invalid\r
-information for each file.  Central Directory Encryption need not be\r
-used for every ZIP file.  Its use is recommended for greater security.\r
-ZIP files not using Central Directory Encryption should operate as\r
-in the past.\r
-\r
-The details of the strong encryption specification for certificates\r
-remain under development as design and testing issues are worked out\r
-for the range of algorithms, encryption methods, certificate processing\r
-and cross-platform support necessary to meet the advanced security needs\r
-of .ZIP file users today and in the future.\r
-\r
-This feature specification is intended to support basic encryption needs\r
-of today, such as password support.  However this specification is also\r
-designed to lay the foundation for future advanced security needs.\r
-\r
-Encryption provides data confidentiality and privacy.  It is\r
-recommended that you combine X.509 digital signing with encryption\r
-to add authentication and non-repudiation.\r
-\r
-\r
-Single Password Symmetric Encryption Method:\r
--------------------------------------------\r
-\r
-The Single Password Symmetric Encryption Method using strong\r
-encryption algorithms operates similarly to the traditional\r
-PKWARE encryption defined in this format.  Additional data\r
-structures are added to support the processing needs of the\r
-strong algorithms.\r
-\r
-The Strong Encryption data structures are:\r
-\r
-1. General Purpose Bits - Bits 0 and 6 of the General Purpose bit\r
-flag in both local and central header records.  Both bits set\r
-indicates strong encryption.  Bit 13, when set indicates the Central\r
-Directory is encrypted and that selected fields in the Local Header\r
-are masked to hide their actual value.\r
-\r
-\r
-2. Extra Field 0x0017 in central header only.\r
-\r
-     Fields to consider in this record are:\r
-\r
-     Format - the data format identifier for this record.  The only\r
-     value allowed at this time is the integer value 2.\r
-\r
-     AlgId - integer identifier of the encryption algorithm from the\r
-     following range\r
-\r
-         0x6601 - DES\r
-         0x6602 - RC2 (version needed to extract < 5.2)\r
-         0x6603 - 3DES 168\r
-         0x6609 - 3DES 112\r
-         0x660E - AES 128\r
-         0x660F - AES 192\r
-         0x6610 - AES 256\r
-         0x6702 - RC2 (version needed to extract >= 5.2)\r
-         0x6801 - RC4\r
-         0xFFFF - Unknown algorithm\r
-\r
-     Bitlen - Explicit bit length of key\r
-\r
-          40\r
-          56\r
-          64\r
-         112\r
-         128\r
-         168\r
-         192\r
-         256\r
-\r
-     Flags - Processing flags needed for decryption\r
-\r
-         0x0001 - Password is required to decrypt\r
-         0x0002 - Certificates only\r
-         0x0003 - Password or certificate required to decrypt\r
-\r
-         Values > 0x0003 reserved for certificate processing\r
-\r
-\r
-3. Decryption header record preceeding compressed file data.\r
-\r
-         -Decryption Header:\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          IVSize    2 bytes  Size of initialization vector (IV)\r
-          IVData    IVSize   Initialization vector for this file\r
-          Size      4 bytes  Size of remaining decryption header data\r
-          Format    2 bytes  Format definition for this record\r
-          AlgID     2 bytes  Encryption algorithm identifier\r
-          Bitlen    2 bytes  Bit length of encryption key\r
-          Flags     2 bytes  Processing flags\r
-          ErdSize   2 bytes  Size of Encrypted Random Data\r
-          ErdData   ErdSize  Encrypted Random Data\r
-          Reserved1 4 bytes  Reserved certificate processing data\r
-          Reserved2 (var)    Reserved for certificate processing data\r
-          VSize     2 bytes  Size of password validation data\r
-          VData     VSize-4  Password validation data\r
-          VCRC32    4 bytes  Standard ZIP CRC32 of password validation data\r
-\r
-     IVData - The size of the IV should match the algorithm block size.\r
-              The IVData can be completely random data.  If the size of\r
-              the randomly generated data does not match the block size\r
-              it should be complemented with zero's or truncated as\r
-              necessary.  If IVSize is 0, then IV = CRC32 + Uncompressed\r
-              File Size (as a 64 bit little-endian, unsigned integer value).\r
-\r
-     Format - the data format identifier for this record.  The only\r
-     value allowed at this time is the integer value 3.\r
-\r
-     AlgId - integer identifier of the encryption algorithm from the\r
-     following range\r
-\r
-         0x6601 - DES\r
-         0x6602 - RC2 (version needed to extract < 5.2)\r
-         0x6603 - 3DES 168\r
-         0x6609 - 3DES 112\r
-         0x660E - AES 128\r
-         0x660F - AES 192\r
-         0x6610 - AES 256\r
-         0x6702 - RC2 (version needed to extract >= 5.2)\r
-         0x6801 - RC4\r
-         0xFFFF - Unknown algorithm\r
-\r
-     Bitlen - Explicit bit length of key\r
-\r
-          40\r
-          56\r
-          64\r
-         112\r
-         128\r
-         168\r
-         192\r
-         256\r
-\r
-     Flags - Processing flags needed for decryption\r
-\r
-         0x0001 - Password is required to decrypt\r
-         0x0002 - Certificates only\r
-         0x0003 - Password or certificate required to decrypt\r
-\r
-         Values > 0x0003 reserved for certificate processing\r
-\r
-     ErdData - Encrypted random data is used to generate a file\r
-               session key for encrypting each file.  SHA1 is\r
-               used to calculate hash data used to derive keys.\r
-               File session keys are derived from a master session\r
-               key generated from the user-supplied password.\r
-               If the Flags field in the decryption header contains\r
-               the value 0x4000, then the ErdData field must be\r
-               decrypted using 3DES.\r
-\r
-     Reserved1 - Reserved for certificate processing, if value is\r
-               zero, then Reserved2 data is absent.  See the explanation\r
-               under the Certificate Processing Method for details on\r
-               this data structure.\r
-\r
-     Reserved2 - If present, the size of the Reserved2 data structure\r
-               is located by skipping the first 4 bytes of this field\r
-               and using the next 2 bytes as the remaining size.  See\r
-               the explanation under the Certificate Processing Method\r
-               for details on this data structure.\r
-\r
-     VSize - This size value will always include the 4 bytes of the\r
-             VCRC32 data and will be greater than 4 bytes.\r
-\r
-     VData - Random data for password validation.  This data is VSize\r
-             in length and VSize must be a multiple of the encryption\r
-             block size.  VCRC32 is a checksum value of VData.\r
-             VData and VCRC32 are stored encrypted and start the\r
-             stream of encrypted data for a file.\r
-\r
-4. Single Password Central Directory Encryption\r
-\r
-Central Directory Encryption is achieved within the .ZIP format by\r
-encrypting the Central Directory structure.  This encapsulates the metadata\r
-most often used for processing .ZIP files.  Additional metadata is stored for\r
-redundancy in the Local Header for each file.  The process of concealing\r
-metadata by encrypting the Central Directory does not protect the data within\r
-the Local Header.  To avoid information leakage from the exposed metadata\r
-in the Local Header, the fields containing information about a file are masked.\r
-\r
-Local Header:\r
-\r
-Masking replaces the true content of the fields for a file in the Local\r
-Header with false information.  When masked, the Local Header is not\r
-suitable for streaming access and the options for data recovery of damaged\r
-archives is reduced.  Extra Data fields that may contain confidential\r
-data should not be stored within the Local Header.  The value set into\r
-the Version needed to extract field should be the correct value needed to\r
-extract the file without regard to Central Directory Encryption. The fields\r
-within the Local Header targeted for masking when the Central Directory is\r
-encrypted are:\r
-\r
-        Field Name                     Mask Value\r
-        ------------------             ---------------------------\r
-        compression method              0\r
-        last mod file time              0\r
-        last mod file date              0\r
-        crc-32                          0\r
-        compressed size                 0\r
-        uncompressed size               0\r
-        file name (variable size)       Base 16 value from the\r
-                                        range 1 - FFFFFFFFFFFFFFFF\r
-                                        represented as a string whose\r
-                                        size will be set into the\r
-                                        file name length field\r
-\r
-The Base 16 value assigned as a masked file name is simply a sequentially\r
-incremented value for each file starting with 1 for the first file.\r
-Modifications to a ZIP file may cause different values to be stored for\r
-each file.  For compatibility, the file name field in the Local Header\r
-should never be left blank.  As of Version 6.2 of this specification,\r
-the Compression Method and Compressed Size fields are not yet masked.\r
-\r
-Encrypting the Central Directory:\r
-\r
-Encryption of the Central Directory does not include encryption of the\r
-Central Directory Signature data, the ZIP64 End of Central Directory\r
-record, the ZIP64 End of Central Directory Locator, or the End\r
-of Central Directory record.  The ZIP file comment data is never\r
-encrypted.\r
-\r
-Before encrypting the Central Directory, it may optionally be compressed.\r
-Compression is not required, but for storage efficiency it is assumed\r
-this structure will be compressed before encrypting.  Similarly, this\r
-specification supports compressing the Central Directory without\r
-requiring that it also be encrypted.  Early implementations of this\r
-feature will assume the encryption method applied to files matches the\r
-encryption applied to the Central Directory.\r
-\r
-Encryption of the Central Directory is done in a manner similar to\r
-that of file encryption.  The encrypted data is preceded by a\r
-decryption header.  The decryption header is known as the Archive\r
-Decryption Header.  The fields of this record are identical to\r
-the decryption header preceding each encrypted file.  The location\r
-of the Archive Decryption Header is determined by the value in the\r
-Start of the Central Directory field in the ZIP64 End of Central\r
-Directory record.  When the Central Directory is encrypted, the\r
-ZIP64 End of Central Directory record will always be present.\r
-\r
-The layout of the ZIP64 End of Central Directory record for all\r
-versions starting with 6.2 of this specification will follow the\r
-Version 2 format.  The Version 2 format is as follows:\r
-\r
-The first 48 bytes will remain identical to that of Version 1.\r
-The record signature for both Version 1 and Version 2 will be\r
-0x06064b50.  Immediately following the 48th byte, which identifies\r
-the end of the field known as the Offset of Start of Central\r
-Directory With Respect to the Starting Disk Number will begin the\r
-new fields defining Version 2 of this record.\r
-\r
-New fields for Version 2:\r
-\r
-Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-          Value                 Size       Description\r
-          -----                 ----       -----------\r
-          Compression Method    2 bytes    Method used to compress the\r
-                                           Central Directory\r
-          Compressed Size       8 bytes    Size of the compressed data\r
-          Original   Size       8 bytes    Original uncompressed size\r
-          AlgId                 2 bytes    Encryption algorithm ID\r
-          BitLen                2 bytes    Encryption key length\r
-          Flags                 2 bytes    Encryption flags\r
-          HashID                2 bytes    Hash algorithm identifier\r
-          Hash Length           2 bytes    Length of hash data\r
-          Hash Data             (variable) Hash data\r
-\r
-The Compression Method accepts the same range of values as the\r
-corresponding field in the Central Header.\r
-\r
-The Compressed Size and Original Size values will not include the\r
-data of the Central Directory Signature which is compressed or\r
-encrypted.\r
-\r
-The AlgId, BitLen, and Flags fields accept the same range of values\r
-the corresponding fields within the 0x0017 record.\r
-\r
-Hash ID identifies the algorithm used to hash the Central Directory\r
-data.  This data does not have to be hashed, in which case the\r
-values for both the HashID and Hash Length will be 0.  Possible\r
-values for HashID are:\r
-\r
-      Value         Algorithm\r
-     ------         ---------\r
-     0x0000          none\r
-     0x0001          CRC32\r
-     0x8003          MD5\r
-     0x8004          SHA1\r
-\r
-When the Central Directory data is signed, the same hash algorithm\r
-used to hash the Central Directory for signing should be used.\r
-This is recommended for processing efficiency, however, it is\r
-permissible for any of the above algorithms to be used independent\r
-of the signing process.\r
-\r
-The Hash Data will contain the hash data for the Central Directory.\r
-The length of this data will vary depending on the algorithm used.\r
-\r
-The Version Needed to Extract should be set to 62.\r
-\r
-The value for the Total Number of Entries on the Current Disk will\r
-be 0.  These records will no longer support random access when\r
-encrypting the Central Directory.\r
-\r
-When the Central Directory is compressed and/or encrypted, the\r
-End of Central Directory record will store the value 0xFFFFFFFF\r
-as the value for the Total Number of Entries in the Central\r
-Directory.  The value stored in the Total Number of Entries in\r
-the Central Directory on this Disk field will be 0.  The actual\r
-values will be stored in the equivalent fields of the ZIP64\r
-End of Central Directory record.\r
-\r
-Decrypting and decompressing the Central Directory is accomplished\r
-in the same manner as decrypting and decompressing a file.\r
-\r
-\r
-5. Useful Tips\r
-\r
-Strong Encryption is always applied to a file after compression. The\r
-block oriented algorithms all operate in Cypher Block Chaining (CBC)\r
-mode.  The block size used for AES encryption is 16.  All other block\r
-algorithms use a block size of 8.  Two ID's are defined for RC2 to\r
-account for a discrepancy found in the implementation of the RC2\r
-algorithm in the cryptographic library on Windows XP SP1 and all\r
-earlier versions of Windows.\r
-\r
-A pseudo-code representation of the encryption process is as follows:\r
-\r
-Password = GetUserPassword()\r
-RD  = Random()\r
-ERD = Encrypt(RD,DeriveKey(SHA1(Password)))\r
-For Each File\r
-    IV = Random()\r
-    VData = Random()\r
-    FileSessionKey = DeriveKey(SHA1(IV + RD))\r
-    Encrypt(VData + VCRC32 + FileData,FileSessionKey)\r
-Done\r
-\r
-The function names and parameter requirements will depend on\r
-the choice of the cryptographic toolkit selected.  Almost any\r
-toolkit supporting the reference implementations for each\r
-algorithm can be used.  The RSA BSAFE(r), OpenSSL, and Microsoft\r
-CryptoAPI libraries are all known to work well.\r
-\r
-\r
-Certificate Processing Method:\r
------------------------------\r
-\r
-The Certificate Processing Method for ZIP file encryption remains\r
-under development.  The information provided here serves as a guide\r
-to those interested in certificate-based data decryption.  This\r
-information may be subject to change in future versions of this\r
-specification and is subject to change without notice.\r
-\r
-OAEP Processing with Certificate-based Encryption:\r
-\r
-Versions of PKZIP available during this development phase of the\r
-certificate processing method may set a value of 61 into the\r
-version needed to extract field for a file.  This indicates that\r
-non-OAEP key wrapping is used.  This affects certificate encryption\r
-only, and password encryption functions should not be affected by\r
-this value.  This means values of 61 may be found on files encrypted\r
-with certificates only, or on files encrypted with both password\r
-encryption and certificate encryption.  Files encrypted with both\r
-methods can safely be decrypted using the password methods documented.\r
-\r
-OAEP stands for Optimal Asymmetric Encryption Padding.  It is a\r
-strengthening technique used for small encoded items such as decryption\r
-keys.  This is commonly applied in cryptographic key-wrapping techniques\r
-and is supported by PKCS #1.  Versions 5.0 and 6.0 of this specification\r
-were designed to support OAEP key-wrapping for certificate-based\r
-decryption keys for additional security.\r
-\r
-Support for private keys stored on Smart Cards or Tokens introduced\r
-a conflict with this OAEP logic.  Most card and token products do\r
-not support the additional strengthening applied to OAEP key-wrapped\r
-data.  In order to resolve this conflict, versions 6.1 and above of this\r
-specification will no longer support OAEP when encrypting using\r
-digital certificates.\r
-\r
-Certificate Processing Data Fields:\r
-\r
-The Certificate Processing Method of this specification defines the\r
-following additional data fields:\r
-\r
-\r
-1. Certificate Flag Values\r
-\r
-Additional processing flags that can be present in the Flags field of both\r
-the 0x0017 field of the central directory Extra Field and the Decryption\r
-header record preceding compressed file data are:\r
-\r
-         0x0007 - reserved for future use\r
-         0x000F - reserved for future use\r
-         0x0100 - Indicates non-OAEP key wrapping was used.  If this\r
-                  this field is set, the version needed to extract must\r
-                  be at least 61.  This means OAEP key wrapping is not\r
-                  used when generating a Master Session Key using\r
-                  ErdData.\r
-         0x4000 - ErdData must be decrypted using 3DES-168, otherwise use the\r
-                  same algorithm used for encrypting the file contents.\r
-         0x8000 - reserved for future use\r
-\r
-\r
-2. CertData - Extra Field 0x0017 record certificate data structure\r
-\r
-The data structure used to store certificate data within the section\r
-of the Extra Field defined by the CertData field of the 0x0017\r
-record are as shown:\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          RCount    4 bytes  Number of recipients.\r
-          HashAlg   2 bytes  Hash algorithm identifier\r
-          HSize     2 bytes  Hash size\r
-          SRList    (var)    Simple list of recipients hashed public keys\r
-\r
-\r
-     RCount    This defines the number intended recipients whose\r
-               public keys were used for encryption.  This identifies\r
-               the number of elements in the SRList.\r
-\r
-     HashAlg   This defines the hash algorithm used to calculate\r
-               the public key hash of each public key used\r
-               for encryption. This field currently supports\r
-               only the following value for SHA-1\r
-\r
-               0x8004 - SHA1\r
-\r
-     HSize     This defines the size of a hashed public key.\r
-\r
-     SRList    This is a variable length list of the hashed\r
-               public keys for each intended recipient.  Each\r
-               element in this list is HSize.  The total size of\r
-               SRList is determined using RCount * HSize.\r
-\r
-\r
-3. Reserved1 - Certificate Decryption Header Reserved1 Data:\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          RCount    4 bytes  Number of recipients.\r
-\r
-     RCount    This defines the number intended recipients whose\r
-               public keys were used for encryption.  This defines\r
-               the number of elements in the REList field defined below.\r
-\r
-\r
-4. Reserved2 - Certificate Decryption Header Reserved2 Data Structures:\r
-\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          HashAlg   2 bytes  Hash algorithm identifier\r
-          HSize     2 bytes  Hash size\r
-          REList    (var)    List of recipient data elements\r
-\r
-\r
-     HashAlg   This defines the hash algorithm used to calculate\r
-               the public key hash of each public key used\r
-               for encryption. This field currently supports\r
-               only the following value for SHA-1\r
-\r
-               0x8004 - SHA1\r
-\r
-     HSize     This defines the size of a hashed public key\r
-               defined in REHData.\r
-\r
-     REList    This is a variable length of list of recipient data.\r
-               Each element in this list consists of a Recipient\r
-               Element data structure as follows:\r
-\r
-\r
-    Recipient Element (REList) Data Structure:\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          RESize    2 bytes  Size of REHData + REKData\r
-          REHData   HSize    Hash of recipients public key\r
-          REKData   (var)    Simple key blob\r
-\r
-\r
-     RESize    This defines the size of an individual REList\r
-               element.  This value is the combined size of the\r
-               REHData field + REKData field.  REHData is defined by\r
-               HSize.  REKData is variable and can be calculated\r
-               for each REList element using RESize and HSize.\r
-\r
-     REHData   Hashed public key for this recipient.\r
-\r
-     REKData   Simple Key Blob.  The format of this data structure\r
-               is identical to that defined in the Microsoft\r
-               CryptoAPI and generated using the CryptExportKey()\r
-               function.  The version of the Simple Key Blob\r
-               supported at this time is 0x02 as defined by\r
-               Microsoft.\r
-\r
-5. Certificate Processing - Central Directory Encryption:\r
-\r
-Central Directory Encryption using Digital Certificates will\r
-operate in a manner similar to that of Single Password Central\r
-Directory Encryption.  This record will only be present when there\r
-is data to place into it.  Currently, data is placed into this\r
-record when digital certificates are used for either encrypting\r
-or signing the files within a ZIP file.  When only password\r
-encryption is used with no certificate encryption or digital\r
-signing, this record is not currently needed. When present, this\r
-record will appear before the start of the actual Central Directory\r
-data structure and will be located immediately after the Archive\r
-Decryption Header if the Central Directory is encrypted.\r
-\r
-The Archive Extra Data record will be used to store the following\r
-information.  Additional data may be added in future versions.\r
-\r
-Extra Data Fields:\r
-\r
-0x0014 - PKCS#7 Store for X.509 Certificates\r
-0x0016 - X.509 Certificate ID and Signature for central directory\r
-0x0019 - PKCS#7 Encryption Recipient Certificate List\r
-\r
-The 0x0014 and 0x0016 Extra Data records that otherwise would be\r
-located in the first record of the Central Directory for digital\r
-certificate processing. When encrypting or compressing the Central\r
-Directory, the 0x0014 and 0x0016 records must be located in the\r
-Archive Extra Data record and they should not remain in the first\r
-Central Directory record.  The Archive Extra Data record will also\r
-be used to store the 0x0019 data.\r
-\r
-When present, the size of the Archive Extra Data record will be\r
-included in the size of the Central Directory.  The data of the\r
-Archive Extra Data record will also be compressed and encrypted\r
-along with the Central Directory data structure.\r
-\r
-6. Certificate Processing Differences:\r
-\r
-The Certificate Processing Method of encryption differs from the\r
-Single Password Symmetric Encryption Method as follows.  Instead\r
-of using a user-defined password to generate a master session key,\r
-cryptographically random data is used.  The key material is then\r
-wrapped using standard key-wrapping techniques.  This key material\r
-is wrapped using the public key of each recipient that will need\r
-to decrypt the file using their corresponding private key.\r
-\r
-This specification currently assumes digital certificates will follow\r
-the X.509 V3 format for 1024 bit and higher RSA format digital\r
-certificates.  Implementation of this Certificate Processing Method\r
-requires supporting logic for key access and management.  This logic\r
-is outside the scope of this specification.\r
-\r
-\r
-License Agreement:\r
------------------\r
-\r
-The features set forth in this Section XIV (the "Strong Encryption\r
-Specification") are covered by a pending patent application. Portions of\r
-this Strong Encryption technology are available for use at no charge\r
-under the following terms and conditions.\r
-\r
-1. License Grant.\r
-\r
-   a. NOTICE TO USER. PLEASE READ THIS ENTIRE SECTION XIV OF THE\r
-   APPNOTE (THE "AGREEMENT") CAREFULLY. BY USING ALL OR ANY PORTION OF THE\r
-   LICENSED TECHNOLOGY, YOU ACCEPT ALL THE TERMS AND CONDITIONS OF THIS\r
-   AGREEMENT AND YOU AGREE THAT THIS AGREEMENT IS ENFORCEABLE LIKE ANY\r
-   WRITTEN NEGOTIATED AGREEMENT SIGNED BY YOU. IF YOU DO NOT AGREE, DO NOT\r
-   USE THE LICENSED TECHNOLOGY.\r
-\r
-   b. Definitions.\r
-\r
-      i. "Licensed Technology" shall mean that proprietary technology now or\r
-      hereafter owned or controlled by PKWare, Inc. ("PKWARE") or any\r
-      subsidiary or affiliate  that covers or is necessary to be used to give\r
-      software the ability to a) extract and decrypt data from zip files\r
-      encrypted using any methods of data encryption and key processing which\r
-      are published in this APPNOTE or any prior APPNOTE, as supplemented by\r
-      any Additional Compatibility Information; and b) encrypt file contents\r
-      as part of .ZIP file processing using only the Single Password Symmetric\r
-      Encryption Method as published in this APPNOTE or any prior APPNOTE, as\r
-      supplemented by any Additional Compatibility Information.  For purposes\r
-      of this AGREEMENT, "Additional Compatibility Information" means, with\r
-      regard to any method of data encryption and key processing published in\r
-      this or any prior APPNOTE, any corrections, additions, or clarifications\r
-      to the information in such APPNOTE that are required in order to give\r
-      software the ability to successfully extract and decrypt zip files (or,\r
-      but solely in the case of the Single Password Symmetric Encryption Method,\r
-      to successfully encrypt zip files) in a manner interoperable with the\r
-      actual implementation of such method in any PKWARE product that is\r
-      documented or publicly described by PKWARE as being able to create, or\r
-      to extract and decrypt, zip files using that method.\r
-\r
-      ii. "Licensed Products" shall mean any products you produce that\r
-      incorporate the Licensed Technology.\r
-\r
-   c. License to Licensed Technology.\r
-\r
-   PKWARE hereby grants to you a non-exclusive license to use the Licensed\r
-   Technology for the purpose of manufacturing, offering, selling and using\r
-   Licensed Products, which license shall extend to permit the practice of all\r
-   claims in any patent or patent application (collectively, "Patents") now or\r
-   hereafter owned or controlled by PKWARE in any jurisdiction in the world\r
-   that are infringed by implementation of the Licensed Technology.  You have\r
-   the right to sublicense rights you receive under the terms of this AGREEMENT\r
-   for the purpose of allowing sublicensee to manufacture, offer, sell and use\r
-   products that incorporate all or a portion of any of your Licensed Products,\r
-   but if you do, you agree to i) impose the same restrictions on any such\r
-   sublicensee as these terms impose on you and ii) notify the sublicensee,\r
-   by means chosen by you in your unfettered discretion, including a notice on\r
-   your web site, of the terms of this AGREEMENT and make available to each\r
-   sublicensee the full text of this APPNOTE.   Further, PKWARE hereby grants to\r
-   you a non-exclusive right to reproduce and distribute, in any form, copies of\r
-   this APPNOTE, without modification.  Notwithstanding anything to the contrary\r
-   in this AGREEMENT, you have the right to sublicense the rights, without any of\r
-   the restrictions described above or elsewhere in this AGREEMENT, to use, offer\r
-   to sell and sell Licensed Technology as incorporated in executable object code\r
-   or byte code forms of your Licensed Products.  Any sublicense to use the\r
-   Licensed Technology incorporated in a Licensed Product granted by you shall\r
-   survive the termination of this AGREEMENT for any reason.  PKWARE warrants that\r
-   this license shall continue to encumber the Licensed Technology regardless of\r
-   changes in ownership of the Licensed Technology.\r
-\r
-   d. Proprietary Notices.\r
-\r
-      i. With respect to any Licensed Product that is distributed by you either\r
-      in source code form or in the form of an object code library of externally\r
-      callable functions that has been designed by you for incorporation into third\r
-      party products, you agree to include, in the source code, or in the case of\r
-      an object code library, in accompanying documentation, a notice using the\r
-      words "patent pending" until a patent is issued to PKWARE covering any\r
-      portion of the Licensed Technology or PKWARE provides notice, by means\r
-      chosen by PKWARE in its unfettered discretion, that it no longer has any\r
-      patent pending covering any portion of the Licensed Technology.  With respect\r
-      to any Licensed Product, upon your becoming aware that at least one patent has\r
-      been granted covering the Licensed Technology, you agree to include in any\r
-      revisions made by you to the documentation (or any source code distributed\r
-      by you) the words "Pat. No.", or "Patent Number" and the patent number or\r
-      numbers of the applicable patent or patents.  PKWARE shall, from time to time,\r
-      inform you of the patent number or numbers of the patents covering the\r
-      Licensed Technology, by means chosen by PKWARE in its unfettered discretion,\r
-      including a notice on its web site.  It shall be a violation of the terms of\r
-      this AGREEMENT for you to sell Licensed Products without complying with the\r
-      foregoing marking provisions.\r
-\r
-      ii. You acknowledge that the terms of this AGREEMENT do not grant you any\r
-      license or other right to use any PKWARE trademark in connection with the sale,\r
-      offering for sale, distribution and delivery of the Licensed Products, or in\r
-      connection with the advertising, promotion and offering of the Licensed Products.\r
-      You acknowledge PKWARE's ownership of the PKZIP trademark and all other marks\r
-      owned by PKWARE.\r
-\r
-   e. Covenant of Compliance and Remedies.\r
-\r
-   To the extent that you have elected to implement portions of the Licensed\r
-   Technology, you agree to use reasonable diligence to comply with those portions\r
-   of this Section XIV, as modified or supplemented by Additional Compatibility\r
-   Information available to you, describing the portions of the Licensed Technology\r
-   that you have elected to implement.  Upon reasonable request by PKWARE, you will\r
-   provide written notice to PKWARE identifying which version of this APPNOTE you\r
-   have relied upon for your implementation of any specified Licensed Product.\r
-\r
-   If any substantial non-compliance with the terms of this AGREEMENT is determined\r
-   to exist, you will make such changes as necessary to bring your Licensed Products\r
-   into substantial compliance with the terms of this AGREEMENT.  If, within sixty\r
-   days of receipt of notice that a Licensed Product fails to comply with the terms\r
-   of this AGREEMENT, you fail to make such changes as necessary to bring your\r
-   Licensed Products into compliance with the terms of this AGREEMENT, PKWARE may\r
-   terminate your rights under this AGREEMENT.  PKWARE does not waive and expressly\r
-   reserves the right to pursue any and all additional remedies that are or may\r
-   become available to PKWARE.\r
-\r
-   f. Warranty and Indemnification Regarding Exportation.\r
-\r
-   You realize and acknowledge that, as between yourself and PKWARE, you are fully\r
-   responsible for compliance with the import and export laws and regulations of\r
-   any country in or to which you import or export any Licensed Products, and you\r
-   agree to hold PKWARE harmless from any claim of violation of any such import\r
-   or export laws.\r
-\r
-   g. Patent Infringement.\r
-\r
-   You agree that you will not bring or threaten to bring any action against PKWARE\r
-   for infringement of the claims of any patent owned or controlled by you solely\r
-   as a result of PKWARE's own implementation of the Licensed Technology.  As its\r
-   exclusive remedy for your breach of the foregoing agreement, PKWARE reserves\r
-   the right to suspend or terminate all rights granted under the terms of this\r
-   AGREEMENT if you bring or threaten to bring any such action against PKWARE,\r
-   effective immediately upon delivery of written notice of suspension or\r
-   termination to you.\r
-\r
-   h. Governing Law.\r
-\r
-   The license granted in this AGREEMENT shall be governed by and construed under\r
-   the laws of the State of Wisconsin and the United States.\r
-\r
-   i. Revisions and Notice.\r
-\r
-   The license granted in this APPNOTE is irrevocable, except as expressly set\r
-   forth above.  You agree and understand that any changes which PKWARE determines\r
-   to make to this APPNOTE shall be posted at the same location as the current\r
-   APPNOTE or at a location which will be identified by means chosen by PKWARE,\r
-   including a notice on its web site, and shall be available for adoption by you\r
-   immediately upon such posting, or at such other time as PKWARE shall determine.\r
-   Any changes to the terms of the license published in a subsequent version of\r
-   this AGREEMENT shall be binding upon you only with respect to your products\r
-   that (i) incorporate any Licensed Technology (as defined in the subsequent\r
-   AGREEMENT) that is not otherwise included in the definition of Licensed\r
-   Technology under this AGREEMENT, or (ii) that you expressly identify are to\r
-   be licensed under the subsequent AGREEMENT, which identification shall be by\r
-   written notice with reference to the APPNOTE (version and release date or other\r
-   unique identifier) in which the subsequent AGREEMENT is published.  PKWARE\r
-   agrees to identify each change to this APPNOTE by using a unique version and\r
-   release date identifier or other unique identifier.\r
-\r
-   j. Warranty by PKWARE\r
-\r
-   PKWare, Inc. warrants that it has the right to grant the license hereunder.\r
-\r
-XV. Change Process\r
-------------------\r
-\r
-In order for the .ZIP file format to remain a viable definition, this\r
-specification should be considered as open for periodic review and\r
-revision.  Although this format was originally designed with a\r
-certain level of extensibility, not all changes in technology\r
-(present or future) were or will be necessarily considered in its\r
-design.  If your application requires new definitions to the\r
-extensible sections in this format, or if you would like to\r
-submit new data structures, please forward your request to\r
-zipformat@pkware.com.  All submissions will be reviewed by the\r
-ZIP File Specification Committee for possible inclusion into\r
-future versions of this specification.  Periodic revisions\r
-to this specification will be published to ensure interoperability.\r
-We encourage comments and feedback that may help improve clarity\r
-or content.\r
-\r
-\r
-XVI. Acknowledgements\r
----------------------\r
-\r
-In addition to the above mentioned contributors to PKZIP and PKUNZIP,\r
-I would like to extend special thanks to Robert Mahoney for suggesting\r
-the extension .ZIP for this software.\r
-\r
-\r
-XVII. References\r
-----------------\r
-\r
-    Fiala, Edward R., and Greene, Daniel H., "Data compression with\r
-       finite windows",  Communications of the ACM, Volume 32, Number 4,\r
-       April 1989, pages 490-505.\r
-\r
-    Held, Gilbert, "Data Compression, Techniques and Applications,\r
-       Hardware and Software Considerations", John Wiley & Sons, 1987.\r
-\r
-    Huffman, D.A., "A method for the construction of minimum-redundancy\r
-       codes", Proceedings of the IRE, Volume 40, Number 9, September 1952,\r
-       pages 1098-1101.\r
-\r
-    Nelson, Mark, "LZW Data Compression", Dr. Dobbs Journal, Volume 14,\r
-       Number 10, October 1989, pages 29-37.\r
-\r
-    Nelson, Mark, "The Data Compression Book",  M&T Books, 1991.\r
-\r
-    Storer, James A., "Data Compression, Methods and Theory",\r
-       Computer Science Press, 1988\r
-\r
-    Welch, Terry, "A Technique for High-Performance Data Compression",\r
-       IEEE Computer, Volume 17, Number 6, June 1984, pages 8-19.\r
-\r
-    Ziv, J. and Lempel, A., "A universal algorithm for sequential data\r
-       compression", Communications of the ACM, Volume 30, Number 6,\r
-       June 1987, pages 520-540.\r
-\r
-    Ziv, J. and Lempel, A., "Compression of individual sequences via\r
-       variable-rate coding", IEEE Transactions on Information Theory,\r
-       Volume 24, Number 5, September 1978, pages 530-536.\r
diff --git a/docs/appnote.txt b/docs/appnote.txt
deleted file mode 100644 (file)
index 985f6f8..0000000
+++ /dev/null
@@ -1,3497 +0,0 @@
-File:    APPNOTE.TXT - .ZIP File Format Specification\r
-Version: 6.3.4 \r
-Status: Final - replaces version 6.3.3\r
-Revised: October 1, 2014\r
-Copyright (c) 1989 - 2014 PKWARE Inc., All Rights Reserved.\r
-\r
-1.0 Introduction\r
----------------\r
-\r
-1.1 Purpose\r
------------\r
-\r
-   1.1.1 This specification is intended to define a cross-platform,\r
-   interoperable file storage and transfer format.  Since its \r
-   first publication in 1989, PKWARE, Inc. ("PKWARE") has remained \r
-   committed to ensuring the interoperability of the .ZIP file \r
-   format through periodic publication and maintenance of this \r
-   specification.  We trust that all .ZIP compatible vendors and \r
-   application developers that use and benefit from this format \r
-   will share and support this commitment to interoperability.\r
-\r
-1.2 Scope\r
----------\r
-\r
-   1.2.1 ZIP is one of the most widely used compressed file formats. It is \r
-   universally used to aggregate, compress, and encrypt files into a single\r
-   interoperable container. No specific use or application need is \r
-   defined by this format and no specific implementation guidance is \r
-   provided. This document provides details on the storage format for \r
-   creating ZIP files.  Information is provided on the records and \r
-   fields that describe what a ZIP file is. \r
-\r
-1.3 Trademarks\r
---------------\r
-\r
-   1.3.1 PKWARE, PKZIP, SecureZIP, and PKSFX are registered trademarks of \r
-   PKWARE, Inc. in the United States and elsewhere.  PKPatchMaker, \r
-   Deflate64, and ZIP64 are trademarks of PKWARE, Inc.  Other marks \r
-   referenced within this document appear for identification\r
-   purposes only and are the property of their respective owners.\r
-   \r
-\r
-1.4 Permitted Use\r
------------------ \r
-\r
-   1.4.1 This document, "APPNOTE.TXT -  .ZIP File Format Specification" is the\r
-   exclusive property of PKWARE.  Use of the information contained in this \r
-   document is permitted solely for the purpose of creating products, \r
-   programs and processes that read and write files in the ZIP format\r
-   subject to the terms and conditions herein.\r
-\r
-   1.4.2 Use of the content of this document within other publications is \r
-   permitted only through reference to this document.  Any reproduction\r
-   or distribution of this document in whole or in part without prior\r
-   written permission from PKWARE is strictly prohibited.\r
-\r
-   1.4.3 Certain technological components provided in this document are the \r
-   patented proprietary technology of PKWARE and as such require a \r
-   separate, executed license agreement from PKWARE.  Applicable \r
-   components are marked with the following, or similar, statement: \r
-   'Refer to the section in this document entitled  "Incorporating \r
-   PKWARE Proprietary Technology into Your Product" for more information'.\r
-\r
-1.5 Contacting PKWARE\r
----------------------\r
-\r
-   1.5.1 If you have questions on this format, its use, or licensing, or if you \r
-   wish to report defects, request changes or additions, please contact:\r
-\r
-     PKWARE, Inc.\r
-     201 E. Pittsburgh Avenue, Suite 400\r
-     Milwaukee, WI 53204\r
-     +1-414-289-9788\r
-     +1-414-289-9789 FAX\r
-     zipformat@pkware.com\r
-\r
-   1.5.2 Information about this format and copies of this document are publicly\r
-   available at:\r
-\r
-     http://www.pkware.com/appnote\r
-\r
-1.6 Disclaimer\r
---------------\r
-\r
-   1.6.1 Although PKWARE will attempt to supply current and accurate\r
-   information relating to its file formats, algorithms, and the\r
-   subject programs, the possibility of error or omission cannot \r
-   be eliminated. PKWARE therefore expressly disclaims any warranty \r
-   that the information contained in the associated materials relating \r
-   to the subject programs and/or the format of the files created or\r
-   accessed by the subject programs and/or the algorithms used by\r
-   the subject programs, or any other matter, is current, correct or\r
-   accurate as delivered.  Any risk of damage due to any possible\r
-   inaccurate information is assumed by the user of the information.\r
-   Furthermore, the information relating to the subject programs\r
-   and/or the file formats created or accessed by the subject\r
-   programs and/or the algorithms used by the subject programs is\r
-   subject to change without notice.\r
-\r
-2.0 Revisions\r
---------------\r
-\r
-2.1 Document Status\r
---------------------\r
-\r
-   2.1.1 If the STATUS of this file is marked as DRAFT, the content \r
-   defines proposed revisions to this specification which may consist \r
-   of changes to the ZIP format itself, or that may consist of other \r
-   content changes to this document.  Versions of this document and \r
-   the format in DRAFT form may be subject to modification prior to \r
-   publication STATUS of FINAL. DRAFT versions are published periodically \r
-   to provide notification to the ZIP community of pending changes and to \r
-   provide opportunity for review and comment.\r
-\r
-   2.1.2 Versions of this document having a STATUS of FINAL are \r
-   considered to be in the final form for that version of the document \r
-   and are not subject to further change until a new, higher version\r
-   numbered document is published.  Newer versions of this format \r
-   specification are intended to remain interoperable with with all prior \r
-   versions whenever technically possible.  \r
-\r
-2.2 Change Log\r
---------------\r
-\r
-   Version       Change Description                        Date\r
-   -------       ------------------                       ----------\r
-   5.2           -Single Password Symmetric Encryption    06/02/2003\r
-                  storage\r
-\r
-   6.1.0         -Smartcard compatibility                 01/20/2004\r
-                 -Documentation on certificate storage\r
-\r
-   6.2.0         -Introduction of Central Directory       04/26/2004\r
-                  Encryption for encrypting metadata\r
-                 -Added OS X to Version Made By values\r
-\r
-   6.2.1         -Added Extra Field placeholder for       04/01/2005\r
-                  POSZIP using ID 0x4690\r
-\r
-                 -Clarified size field on \r
-                  "zip64 end of central directory record"\r
-\r
-   6.2.2         -Documented Final Feature Specification  01/06/2006\r
-                  for Strong Encryption\r
-\r
-                 -Clarifications and typographical \r
-                  corrections\r
-\r
-   6.3.0         -Added tape positioning storage          09/29/2006\r
-                  parameters\r
-\r
-                 -Expanded list of supported hash algorithms\r
-\r
-                 -Expanded list of supported compression\r
-                  algorithms\r
-\r
-                 -Expanded list of supported encryption\r
-                  algorithms\r
-\r
-                 -Added option for Unicode filename \r
-                  storage\r
-\r
-                 -Clarifications for consistent use\r
-                  of Data Descriptor records\r
-\r
-                 -Added additional "Extra Field" \r
-                  definitions\r
-\r
-   6.3.1         -Corrected standard hash values for      04/11/2007\r
-                  SHA-256/384/512\r
-\r
-   6.3.2         -Added compression method 97             09/28/2007\r
-\r
-                 -Documented InfoZIP "Extra Field"\r
-                  values for UTF-8 file name and\r
-                  file comment storage\r
-\r
-   6.3.3         -Formatting changes to support           09/01/2012\r
-                  easier referencing of this APPNOTE\r
-                  from other documents and standards        \r
-\r
-   6.3.4         -Address change                          10/01/2014\r
-\r
-\r
-3.0 Notations\r
--------------\r
-\r
-   3.1 Use of the term MUST or SHALL indicates a required element. \r
-\r
-   3.2 MAY NOT or SHALL NOT indicates an element is prohibited from use. \r
-\r
-   3.3 SHOULD indicates a RECOMMENDED element.\r
-\r
-   3.4 SHOULD NOT indicates an element NOT RECOMMENDED for use.\r
-   \r
-   3.5 MAY indicates an OPTIONAL element.\r
-\r
-\r
-4.0 ZIP Files\r
--------------\r
-\r
-4.1 What is a ZIP file\r
-----------------------\r
-\r
-   4.1.1 ZIP files MAY be identified by the standard .ZIP file extension \r
-   although use of a file extension is not required.  Use of the \r
-   extension .ZIPX is also recognized and MAY be used for ZIP files.  \r
-   Other common file extensions using the ZIP format include .JAR, .WAR, \r
-   .DOCX, .XLXS, .PPTX, .ODT, .ODS, .ODP and others. Programs reading or \r
-   writing ZIP files SHOULD rely on internal record signatures described \r
-   in this document to identify files in this format.\r
-\r
-   4.1.2 ZIP files SHOULD contain at least one file and MAY contain \r
-   multiple files.  \r
-\r
-   4.1.3 Data compression MAY be used to reduce the size of files\r
-   placed into a ZIP file, but is not required.  This format supports the \r
-   use of multiple data compression algorithms.  When compression is used, \r
-   one of the documented compression algorithms MUST be used.  Implementors \r
-   are advised to experiment with their data to determine which of the \r
-   available algorithms provides the best compression for their needs.\r
-   Compression method 8 (Deflate) is the method used by default by most \r
-   ZIP compatible application programs.  \r
-\r
-\r
-   4.1.4 Data encryption MAY be used to protect files within a ZIP file. \r
-   Keying methods supported for encryption within this format include\r
-   passwords and public/private keys.  Either MAY be used individually\r
-   or in combination. Encryption MAY be applied to individual files.  \r
-   Additional security MAY be used through the encryption of ZIP file \r
-   metadata stored within the Central Directory. See the section on the \r
-   Strong Encryption Specification for information. Refer to the section \r
-   in this document entitled "Incorporating PKWARE Proprietary Technology \r
-   into Your Product" for more information.\r
-\r
-   4.1.5 Data integrity MUST be provided for each file using CRC32.  \r
-   \r
-   4.1.6 Additional data integrity MAY be included through the use of \r
-   digital signatures.  Individual files MAY be signed with one or more \r
-   digital signatures. The Central Directory, if signed, MUST use a \r
-   single signature.  \r
-\r
-   4.1.7 Files MAY be placed within a ZIP file uncompressed or stored. \r
-   The term "stored" as used in the context of this document means the file \r
-   is copied into the ZIP file uncompressed.  \r
-\r
-   4.1.8 Each data file placed into a ZIP file MAY be compressed, stored, \r
-   encrypted or digitally signed independent of how other data files in the \r
-   same ZIP file are archived.\r
-\r
-   4.1.9 ZIP files MAY be streamed, split into segments (on fixed or on\r
-   removable media) or "self-extracting".  Self-extracting ZIP \r
-   files MUST include extraction code for a target platform within \r
-   the ZIP file.  \r
-\r
-   4.1.10 Extensibility is provided for platform or application specific\r
-   needs through extra data fields that MAY be defined for custom\r
-   purposes.  Extra data definitions MUST NOT conflict with existing\r
-   documented record definitions.  \r
-\r
-   4.1.11 Common uses for ZIP MAY also include the use of manifest files.  \r
-   Manifest files store application specific information within a file stored \r
-   within the ZIP file.  This manifest file SHOULD be the first file in the \r
-   ZIP file. This specification does not provide any information or guidance on \r
-   the use of manifest files within ZIP files.  Refer to the application developer\r
-   for information on using manifest files and for any additional profile\r
-   information on using ZIP within an application.\r
-\r
-   4.1.12 ZIP files MAY be placed within other ZIP files.\r
-\r
-4.2 ZIP Metadata\r
-----------------\r
-\r
-   4.2.1 ZIP files are identified by metadata consisting of defined record types \r
-   containing the storage information necessary for maintaining the files \r
-   placed into a ZIP file.  Each record type MUST be identified using a header \r
-   signature that identifies the record type.  Signature values begin with the \r
-   two byte constant marker of 0x4b50, representing the characters "PK".\r
-\r
-\r
-4.3 General Format of a .ZIP file\r
----------------------------------\r
-\r
-   4.3.1 A ZIP file MUST contain an "end of central directory record". A ZIP \r
-   file containing only an "end of central directory record" is considered an \r
-   empty ZIP file.  Files may be added or replaced within a ZIP file, or deleted. \r
-   A ZIP file MUST have only one "end of central directory record".  Other \r
-   records defined in this specification MAY be used as needed to support \r
-   storage requirements for individual ZIP files.\r
-\r
-   4.3.2 Each file placed into a ZIP file MUST be preceeded by  a "local \r
-   file header" record for that file.  Each "local file header" MUST be \r
-   accompanied by a corresponding "central directory header" record within \r
-   the central directory section of the ZIP file.\r
-\r
-   4.3.3 Files MAY be stored in arbitrary order within a ZIP file.  A ZIP \r
-   file MAY span multiple volumes or it MAY be split into user-defined \r
-   segment sizes. All values MUST be stored in little-endian byte order unless \r
-   otherwise specified in this document for a specific data element. \r
-\r
-   4.3.4 Compression MUST NOT be applied to a "local file header", an "encryption\r
-   header", or an "end of central directory record".  Individual "central \r
-   directory records" must not be compressed, but the aggregate of all central\r
-   directory records MAY be compressed.    \r
-\r
-   4.3.5 File data MAY be followed by a "data descriptor" for the file.  Data \r
-   descriptors are used to facilitate ZIP file streaming.  \r
-\r
\r
-   4.3.6 Overall .ZIP file format:\r
-\r
-      [local file header 1]\r
-      [encryption header 1]\r
-      [file data 1]\r
-      [data descriptor 1]\r
-      . \r
-      .\r
-      .\r
-      [local file header n]\r
-      [encryption header n]\r
-      [file data n]\r
-      [data descriptor n]\r
-      [archive decryption header] \r
-      [archive extra data record] \r
-      [central directory header 1]\r
-      .\r
-      .\r
-      .\r
-      [central directory header n]\r
-      [zip64 end of central directory record]\r
-      [zip64 end of central directory locator] \r
-      [end of central directory record]\r
-\r
-\r
-   4.3.7  Local file header:\r
-\r
-      local file header signature     4 bytes  (0x04034b50)\r
-      version needed to extract       2 bytes\r
-      general purpose bit flag        2 bytes\r
-      compression method              2 bytes\r
-      last mod file time              2 bytes\r
-      last mod file date              2 bytes\r
-      crc-32                          4 bytes\r
-      compressed size                 4 bytes\r
-      uncompressed size               4 bytes\r
-      file name length                2 bytes\r
-      extra field length              2 bytes\r
-\r
-      file name (variable size)\r
-      extra field (variable size)\r
-\r
-   4.3.8  File data\r
-\r
-      Immediately following the local header for a file\r
-      SHOULD be placed the compressed or stored data for the file.\r
-      If the file is encrypted, the encryption header for the file \r
-      SHOULD be placed after the local header and before the file \r
-      data. The series of [local file header][encryption header]\r
-      [file data][data descriptor] repeats for each file in the \r
-      .ZIP archive. \r
-\r
-      Zero-byte files, directories, and other file types that \r
-      contain no content MUST not include file data.\r
-\r
-   4.3.9  Data descriptor:\r
-\r
-        crc-32                          4 bytes\r
-        compressed size                 4 bytes\r
-        uncompressed size               4 bytes\r
-\r
-      4.3.9.1 This descriptor MUST exist if bit 3 of the general\r
-      purpose bit flag is set (see below).  It is byte aligned\r
-      and immediately follows the last byte of compressed data.\r
-      This descriptor SHOULD be used only when it was not possible to\r
-      seek in the output .ZIP file, e.g., when the output .ZIP file\r
-      was standard output or a non-seekable device.  For ZIP64(tm) format\r
-      archives, the compressed and uncompressed sizes are 8 bytes each.\r
-\r
-      4.3.9.2 When compressing files, compressed and uncompressed sizes \r
-      should be stored in ZIP64 format (as 8 byte values) when a \r
-      file's size exceeds 0xFFFFFFFF.   However ZIP64 format may be \r
-      used regardless of the size of a file.  When extracting, if \r
-      the zip64 extended information extra field is present for \r
-      the file the compressed and uncompressed sizes will be 8\r
-      byte values.  \r
-\r
-      4.3.9.3 Although not originally assigned a signature, the value \r
-      0x08074b50 has commonly been adopted as a signature value \r
-      for the data descriptor record.  Implementers should be \r
-      aware that ZIP files may be encountered with or without this \r
-      signature marking data descriptors and SHOULD account for\r
-      either case when reading ZIP files to ensure compatibility.\r
-\r
-      4.3.9.4 When writing ZIP files, implementors SHOULD include the\r
-      signature value marking the data descriptor record.  When\r
-      the signature is used, the fields currently defined for\r
-      the data descriptor record will immediately follow the\r
-      signature.\r
-\r
-      4.3.9.5 An extensible data descriptor will be released in a \r
-      future version of this APPNOTE.  This new record is intended to\r
-      resolve conflicts with the use of this record going forward,\r
-      and to provide better support for streamed file processing.\r
-\r
-      4.3.9.6 When the Central Directory Encryption method is used, \r
-      the data descriptor record is not required, but MAY be used.  \r
-      If present, and bit 3 of the general purpose bit field is set to \r
-      indicate its presence, the values in fields of the data descriptor\r
-      record MUST be set to binary zeros.  See the section on the Strong \r
-      Encryption Specification for information. Refer to the section in \r
-      this document entitled "Incorporating PKWARE Proprietary Technology \r
-      into Your Product" for more information.\r
-\r
-\r
-   4.3.10  Archive decryption header:  \r
-\r
-      4.3.10.1 The Archive Decryption Header is introduced in version 6.2\r
-      of the ZIP format specification.  This record exists in support\r
-      of the Central Directory Encryption Feature implemented as part of \r
-      the Strong Encryption Specification as described in this document.\r
-      When the Central Directory Structure is encrypted, this decryption\r
-      header MUST precede the encrypted data segment.  \r
-\r
-      4.3.10.2 The encrypted data segment SHALL consist of the Archive \r
-      extra data record (if present) and the encrypted Central Directory \r
-      Structure data.  The format of this data record is identical to the \r
-      Decryption header record preceding compressed file data.  If the \r
-      central directory structure is encrypted, the location of the start of\r
-      this data record is determined using the Start of Central Directory\r
-      field in the Zip64 End of Central Directory record.  See the \r
-      section on the Strong Encryption Specification for information\r
-      on the fields used in the Archive Decryption Header record.\r
-      Refer to the section in this document entitled "Incorporating \r
-      PKWARE Proprietary Technology into Your Product" for more information.\r
-\r
-\r
-   4.3.11  Archive extra data record: \r
-\r
-        archive extra data signature    4 bytes  (0x08064b50)\r
-        extra field length              4 bytes\r
-        extra field data                (variable size)\r
-\r
-      4.3.11.1 The Archive Extra Data Record is introduced in version 6.2\r
-      of the ZIP format specification.  This record MAY be used in support\r
-      of the Central Directory Encryption Feature implemented as part of \r
-      the Strong Encryption Specification as described in this document.\r
-      When present, this record MUST immediately precede the central \r
-      directory data structure.  \r
-\r
-      4.3.11.2 The size of this data record SHALL be included in the \r
-      Size of the Central Directory field in the End of Central \r
-      Directory record.  If the central directory structure is compressed, \r
-      but not encrypted, the location of the start of this data record is \r
-      determined using the Start of Central Directory field in the Zip64 \r
-      End of Central Directory record. Refer to the section in this document \r
-      entitled "Incorporating PKWARE Proprietary Technology into Your \r
-      Product" for more information.\r
-\r
-   4.3.12  Central directory structure:\r
-\r
-      [central directory header 1]\r
-      .\r
-      .\r
-      . \r
-      [central directory header n]\r
-      [digital signature] \r
-\r
-      File header:\r
-\r
-        central file header signature   4 bytes  (0x02014b50)\r
-        version made by                 2 bytes\r
-        version needed to extract       2 bytes\r
-        general purpose bit flag        2 bytes\r
-        compression method              2 bytes\r
-        last mod file time              2 bytes\r
-        last mod file date              2 bytes\r
-        crc-32                          4 bytes\r
-        compressed size                 4 bytes\r
-        uncompressed size               4 bytes\r
-        file name length                2 bytes\r
-        extra field length              2 bytes\r
-        file comment length             2 bytes\r
-        disk number start               2 bytes\r
-        internal file attributes        2 bytes\r
-        external file attributes        4 bytes\r
-        relative offset of local header 4 bytes\r
-\r
-        file name (variable size)\r
-        extra field (variable size)\r
-        file comment (variable size)\r
-\r
-   4.3.13 Digital signature:\r
-\r
-        header signature                4 bytes  (0x05054b50)\r
-        size of data                    2 bytes\r
-        signature data (variable size)\r
-\r
-      With the introduction of the Central Directory Encryption \r
-      feature in version 6.2 of this specification, the Central \r
-      Directory Structure MAY be stored both compressed and encrypted. \r
-      Although not required, it is assumed when encrypting the\r
-      Central Directory Structure, that it will be compressed\r
-      for greater storage efficiency.  Information on the\r
-      Central Directory Encryption feature can be found in the section\r
-      describing the Strong Encryption Specification. The Digital \r
-      Signature record will be neither compressed nor encrypted.\r
-\r
-   4.3.14  Zip64 end of central directory record\r
-\r
-        zip64 end of central dir \r
-        signature                       4 bytes  (0x06064b50)\r
-        size of zip64 end of central\r
-        directory record                8 bytes\r
-        version made by                 2 bytes\r
-        version needed to extract       2 bytes\r
-        number of this disk             4 bytes\r
-        number of the disk with the \r
-        start of the central directory  4 bytes\r
-        total number of entries in the\r
-        central directory on this disk  8 bytes\r
-        total number of entries in the\r
-        central directory               8 bytes\r
-        size of the central directory   8 bytes\r
-        offset of start of central\r
-        directory with respect to\r
-        the starting disk number        8 bytes\r
-        zip64 extensible data sector    (variable size)\r
-\r
-      4.3.14.1 The value stored into the "size of zip64 end of central\r
-      directory record" should be the size of the remaining\r
-      record and should not include the leading 12 bytes.\r
-  \r
-      Size = SizeOfFixedFields + SizeOfVariableData - 12.\r
-\r
-      4.3.14.2 The above record structure defines Version 1 of the \r
-      zip64 end of central directory record. Version 1 was \r
-      implemented in versions of this specification preceding \r
-      6.2 in support of the ZIP64 large file feature. The \r
-      introduction of the Central Directory Encryption feature \r
-      implemented in version 6.2 as part of the Strong Encryption \r
-      Specification defines Version 2 of this record structure. \r
-      Refer to the section describing the Strong Encryption \r
-      Specification for details on the version 2 format for \r
-      this record. Refer to the section in this document entitled \r
-      "Incorporating PKWARE Proprietary Technology into Your Product"\r
-      for more information applicable to use of Version 2 of this\r
-      record.\r
-\r
-      4.3.14.3 Special purpose data MAY reside in the zip64 extensible \r
-      data sector field following either a V1 or V2 version of this\r
-      record.  To ensure identification of this special purpose data\r
-      it must include an identifying header block consisting of the\r
-      following:\r
-\r
-         Header ID  -  2 bytes\r
-         Data Size  -  4 bytes\r
-\r
-      The Header ID field indicates the type of data that is in the \r
-      data block that follows.\r
-\r
-      Data Size identifies the number of bytes that follow for this\r
-      data block type.\r
-\r
-      4.3.14.4 Multiple special purpose data blocks MAY be present. \r
-      Each MUST be preceded by a Header ID and Data Size field.  Current\r
-      mappings of Header ID values supported in this field are as\r
-      defined in APPENDIX C.\r
-\r
-   4.3.15 Zip64 end of central directory locator\r
-\r
-      zip64 end of central dir locator \r
-      signature                       4 bytes  (0x07064b50)\r
-      number of the disk with the\r
-      start of the zip64 end of \r
-      central directory               4 bytes\r
-      relative offset of the zip64\r
-      end of central directory record 8 bytes\r
-      total number of disks           4 bytes\r
-        \r
-   4.3.16  End of central directory record:\r
-\r
-      end of central dir signature    4 bytes  (0x06054b50)\r
-      number of this disk             2 bytes\r
-      number of the disk with the\r
-      start of the central directory  2 bytes\r
-      total number of entries in the\r
-      central directory on this disk  2 bytes\r
-      total number of entries in\r
-      the central directory           2 bytes\r
-      size of the central directory   4 bytes\r
-      offset of start of central\r
-      directory with respect to\r
-      the starting disk number        4 bytes\r
-      .ZIP file comment length        2 bytes\r
-      .ZIP file comment       (variable size)\r
-                \r
-4.4  Explanation of fields\r
---------------------------\r
-      \r
-   4.4.1 General notes on fields\r
-\r
-      4.4.1.1  All fields unless otherwise noted are unsigned and stored\r
-      in Intel low-byte:high-byte, low-word:high-word order.\r
-\r
-      4.4.1.2  String fields are not null terminated, since the length \r
-      is given explicitly.\r
-\r
-      4.4.1.3  The entries in the central directory may not necessarily\r
-      be in the same order that files appear in the .ZIP file.\r
-\r
-      4.4.1.4  If one of the fields in the end of central directory\r
-      record is too small to hold required data, the field should be \r
-      set to -1 (0xFFFF or 0xFFFFFFFF) and the ZIP64 format record \r
-      should be created.\r
-\r
-      4.4.1.5  The end of central directory record and the Zip64 end \r
-      of central directory locator record MUST reside on the same \r
-      disk when splitting or spanning an archive.\r
-\r
-   4.4.2 version made by (2 bytes)\r
-\r
-        4.4.2.1 The upper byte indicates the compatibility of the file\r
-        attribute information.  If the external file attributes \r
-        are compatible with MS-DOS and can be read by PKZIP for \r
-        DOS version 2.04g then this value will be zero.  If these \r
-        attributes are not compatible, then this value will \r
-        identify the host system on which the attributes are \r
-        compatible.  Software can use this information to determine\r
-        the line record format for text files etc.  \r
-\r
-        4.4.2.2 The current mappings are:\r
-\r
-         0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems)\r
-         1 - Amiga                     2 - OpenVMS\r
-         3 - UNIX                      4 - VM/CMS\r
-         5 - Atari ST                  6 - OS/2 H.P.F.S.\r
-         7 - Macintosh                 8 - Z-System\r
-         9 - CP/M                     10 - Windows NTFS\r
-        11 - MVS (OS/390 - Z/OS)      12 - VSE\r
-        13 - Acorn Risc               14 - VFAT\r
-        15 - alternate MVS            16 - BeOS\r
-        17 - Tandem                   18 - OS/400\r
-        19 - OS X (Darwin)            20 thru 255 - unused\r
-\r
-        4.4.2.3 The lower byte indicates the ZIP specification version \r
-        (the version of this document) supported by the software \r
-        used to encode the file.  The value/10 indicates the major \r
-        version number, and the value mod 10 is the minor version \r
-        number.  \r
-\r
-   4.4.3 version needed to extract (2 bytes)\r
-\r
-        4.4.3.1 The minimum supported ZIP specification version needed \r
-        to extract the file, mapped as above.  This value is based on \r
-        the specific format features a ZIP program MUST support to \r
-        be able to extract the file.  If multiple features are\r
-        applied to a file, the minimum version MUST be set to the \r
-        feature having the highest value. New features or feature \r
-        changes affecting the published format specification will be \r
-        implemented using higher version numbers than the last \r
-        published value to avoid conflict.\r
-\r
-        4.4.3.2 Current minimum feature versions are as defined below:\r
-\r
-         1.0 - Default value\r
-         1.1 - File is a volume label\r
-         2.0 - File is a folder (directory)\r
-         2.0 - File is compressed using Deflate compression\r
-         2.0 - File is encrypted using traditional PKWARE encryption\r
-         2.1 - File is compressed using Deflate64(tm)\r
-         2.5 - File is compressed using PKWARE DCL Implode \r
-         2.7 - File is a patch data set \r
-         4.5 - File uses ZIP64 format extensions\r
-         4.6 - File is compressed using BZIP2 compression*\r
-         5.0 - File is encrypted using DES\r
-         5.0 - File is encrypted using 3DES\r
-         5.0 - File is encrypted using original RC2 encryption\r
-         5.0 - File is encrypted using RC4 encryption\r
-         5.1 - File is encrypted using AES encryption\r
-         5.1 - File is encrypted using corrected RC2 encryption**\r
-         5.2 - File is encrypted using corrected RC2-64 encryption**\r
-         6.1 - File is encrypted using non-OAEP key wrapping***\r
-         6.2 - Central directory encryption\r
-         6.3 - File is compressed using LZMA\r
-         6.3 - File is compressed using PPMd+\r
-         6.3 - File is encrypted using Blowfish\r
-         6.3 - File is encrypted using Twofish\r
-\r
-        4.4.3.3 Notes on version needed to extract \r
-\r
-        * Early 7.x (pre-7.2) versions of PKZIP incorrectly set the\r
-        version needed to extract for BZIP2 compression to be 50\r
-        when it should have been 46.\r
-\r
-        ** Refer to the section on Strong Encryption Specification\r
-        for additional information regarding RC2 corrections.\r
-\r
-        *** Certificate encryption using non-OAEP key wrapping is the\r
-        intended mode of operation for all versions beginning with 6.1.\r
-        Support for OAEP key wrapping MUST only be used for\r
-        backward compatibility when sending ZIP files to be opened by\r
-        versions of PKZIP older than 6.1 (5.0 or 6.0).\r
-\r
-        + Files compressed using PPMd MUST set the version\r
-        needed to extract field to 6.3, however, not all ZIP \r
-        programs enforce this and may be unable to decompress \r
-        data files compressed using PPMd if this value is set.\r
-\r
-        When using ZIP64 extensions, the corresponding value in the\r
-        zip64 end of central directory record MUST also be set.  \r
-        This field should be set appropriately to indicate whether \r
-        Version 1 or Version 2 format is in use. \r
-\r
-\r
-   4.4.4 general purpose bit flag: (2 bytes)\r
-\r
-        Bit 0: If set, indicates that the file is encrypted.\r
-\r
-        (For Method 6 - Imploding)\r
-        Bit 1: If the compression method used was type 6,\r
-               Imploding, then this bit, if set, indicates\r
-               an 8K sliding dictionary was used.  If clear,\r
-               then a 4K sliding dictionary was used.\r
-\r
-        Bit 2: If the compression method used was type 6,\r
-               Imploding, then this bit, if set, indicates\r
-               3 Shannon-Fano trees were used to encode the\r
-               sliding dictionary output.  If clear, then 2\r
-               Shannon-Fano trees were used.\r
-\r
-        (For Methods 8 and 9 - Deflating)\r
-        Bit 2  Bit 1\r
-          0      0    Normal (-en) compression option was used.\r
-          0      1    Maximum (-exx/-ex) compression option was used.\r
-          1      0    Fast (-ef) compression option was used.\r
-          1      1    Super Fast (-es) compression option was used.\r
-\r
-        (For Method 14 - LZMA)\r
-        Bit 1: If the compression method used was type 14,\r
-               LZMA, then this bit, if set, indicates\r
-               an end-of-stream (EOS) marker is used to\r
-               mark the end of the compressed data stream.\r
-               If clear, then an EOS marker is not present\r
-               and the compressed data size must be known\r
-               to extract.\r
-\r
-        Note:  Bits 1 and 2 are undefined if the compression\r
-               method is any other.\r
-\r
-        Bit 3: If this bit is set, the fields crc-32, compressed \r
-               size and uncompressed size are set to zero in the \r
-               local header.  The correct values are put in the \r
-               data descriptor immediately following the compressed\r
-               data.  (Note: PKZIP version 2.04g for DOS only \r
-               recognizes this bit for method 8 compression, newer \r
-               versions of PKZIP recognize this bit for any \r
-               compression method.)\r
-\r
-        Bit 4: Reserved for use with method 8, for enhanced\r
-               deflating. \r
-\r
-        Bit 5: If this bit is set, this indicates that the file is \r
-               compressed patched data.  (Note: Requires PKZIP \r
-               version 2.70 or greater)\r
-\r
-        Bit 6: Strong encryption.  If this bit is set, you MUST\r
-               set the version needed to extract value to at least\r
-               50 and you MUST also set bit 0.  If AES encryption\r
-               is used, the version needed to extract value MUST \r
-               be at least 51. See the section describing the Strong\r
-               Encryption Specification for details.  Refer to the \r
-               section in this document entitled "Incorporating PKWARE \r
-               Proprietary Technology into Your Product" for more \r
-               information.\r
-\r
-        Bit 7: Currently unused.\r
-\r
-        Bit 8: Currently unused.\r
-\r
-        Bit 9: Currently unused.\r
-\r
-        Bit 10: Currently unused.\r
-\r
-        Bit 11: Language encoding flag (EFS).  If this bit is set,\r
-                the filename and comment fields for this file\r
-                MUST be encoded using UTF-8. (see APPENDIX D)\r
-\r
-        Bit 12: Reserved by PKWARE for enhanced compression.\r
-\r
-        Bit 13: Set when encrypting the Central Directory to indicate \r
-                selected data values in the Local Header are masked to\r
-                hide their actual values.  See the section describing \r
-                the Strong Encryption Specification for details.  Refer\r
-                to the section in this document entitled "Incorporating \r
-                PKWARE Proprietary Technology into Your Product" for \r
-                more information.\r
-\r
-        Bit 14: Reserved by PKWARE.\r
-\r
-        Bit 15: Reserved by PKWARE.\r
-\r
-   4.4.5 compression method: (2 bytes)\r
-\r
-        0 - The file is stored (no compression)\r
-        1 - The file is Shrunk\r
-        2 - The file is Reduced with compression factor 1\r
-        3 - The file is Reduced with compression factor 2\r
-        4 - The file is Reduced with compression factor 3\r
-        5 - The file is Reduced with compression factor 4\r
-        6 - The file is Imploded\r
-        7 - Reserved for Tokenizing compression algorithm\r
-        8 - The file is Deflated\r
-        9 - Enhanced Deflating using Deflate64(tm)\r
-       10 - PKWARE Data Compression Library Imploding (old IBM TERSE)\r
-       11 - Reserved by PKWARE\r
-       12 - File is compressed using BZIP2 algorithm\r
-       13 - Reserved by PKWARE\r
-       14 - LZMA (EFS)\r
-       15 - Reserved by PKWARE\r
-       16 - Reserved by PKWARE\r
-       17 - Reserved by PKWARE\r
-       18 - File is compressed using IBM TERSE (new)\r
-       19 - IBM LZ77 z Architecture (PFS)\r
-       97 - WavPack compressed data\r
-       98 - PPMd version I, Rev 1\r
-\r
-\r
-   4.4.6 date and time fields: (2 bytes each)\r
-\r
-       The date and time are encoded in standard MS-DOS format.\r
-       If input came from standard input, the date and time are\r
-       those at which compression was started for this data. \r
-       If encrypting the central directory and general purpose bit \r
-       flag 13 is set indicating masking, the value stored in the \r
-       Local Header will be zero. \r
-\r
-   4.4.7 CRC-32: (4 bytes)\r
-\r
-       The CRC-32 algorithm was generously contributed by\r
-       David Schwaderer and can be found in his excellent\r
-       book "C Programmers Guide to NetBIOS" published by\r
-       Howard W. Sams & Co. Inc.  The 'magic number' for\r
-       the CRC is 0xdebb20e3.  The proper CRC pre and post\r
-       conditioning is used, meaning that the CRC register\r
-       is pre-conditioned with all ones (a starting value\r
-       of 0xffffffff) and the value is post-conditioned by\r
-       taking the one's complement of the CRC residual.\r
-       If bit 3 of the general purpose flag is set, this\r
-       field is set to zero in the local header and the correct\r
-       value is put in the data descriptor and in the central\r
-       directory. When encrypting the central directory, if the\r
-       local header is not in ZIP64 format and general purpose \r
-       bit flag 13 is set indicating masking, the value stored \r
-       in the Local Header will be zero. \r
-\r
-   4.4.8 compressed size: (4 bytes)\r
-   4.4.9 uncompressed size: (4 bytes)\r
-\r
-       The size of the file compressed (4.4.8) and uncompressed,\r
-       (4.4.9) respectively.  When a decryption header is present it \r
-       will be placed in front of the file data and the value of the\r
-       compressed file size will include the bytes of the decryption\r
-       header.  If bit 3 of the general purpose bit flag is set, \r
-       these fields are set to zero in the local header and the \r
-       correct values are put in the data descriptor and\r
-       in the central directory.  If an archive is in ZIP64 format\r
-       and the value in this field is 0xFFFFFFFF, the size will be\r
-       in the corresponding 8 byte ZIP64 extended information \r
-       extra field.  When encrypting the central directory, if the\r
-       local header is not in ZIP64 format and general purpose bit \r
-       flag 13 is set indicating masking, the value stored for the \r
-       uncompressed size in the Local Header will be zero. \r
-\r
-   4.4.10 file name length: (2 bytes)\r
-   4.4.11 extra field length: (2 bytes)\r
-   4.4.12 file comment length: (2 bytes)\r
-\r
-       The length of the file name, extra field, and comment\r
-       fields respectively.  The combined length of any\r
-       directory record and these three fields should not\r
-       generally exceed 65,535 bytes.  If input came from standard\r
-       input, the file name length is set to zero.  \r
-\r
-\r
-   4.4.13 disk number start: (2 bytes)\r
-\r
-       The number of the disk on which this file begins.  If an \r
-       archive is in ZIP64 format and the value in this field is \r
-       0xFFFF, the size will be in the corresponding 4 byte zip64 \r
-       extended information extra field.\r
-\r
-   4.4.14 internal file attributes: (2 bytes)\r
-\r
-       Bits 1 and 2 are reserved for use by PKWARE.\r
-\r
-       4.4.14.1 The lowest bit of this field indicates, if set, \r
-       that the file is apparently an ASCII or text file.  If not\r
-       set, that the file apparently contains binary data.\r
-       The remaining bits are unused in version 1.0.\r
-\r
-       4.4.14.2 The 0x0002 bit of this field indicates, if set, that \r
-       a 4 byte variable record length control field precedes each \r
-       logical record indicating the length of the record. The \r
-       record length control field is stored in little-endian byte\r
-       order.  This flag is independent of text control characters, \r
-       and if used in conjunction with text data, includes any \r
-       control characters in the total length of the record. This \r
-       value is provided for mainframe data transfer support.\r
-\r
-   4.4.15 external file attributes: (4 bytes)\r
-\r
-       The mapping of the external attributes is\r
-       host-system dependent (see 'version made by').  For\r
-       MS-DOS, the low order byte is the MS-DOS directory\r
-       attribute byte.  If input came from standard input, this\r
-       field is set to zero.\r
-\r
-   4.4.16 relative offset of local header: (4 bytes)\r
-\r
-       This is the offset from the start of the first disk on\r
-       which this file appears, to where the local header should\r
-       be found.  If an archive is in ZIP64 format and the value\r
-       in this field is 0xFFFFFFFF, the size will be in the \r
-       corresponding 8 byte zip64 extended information extra field.\r
-\r
-   4.4.17 file name: (Variable)\r
-\r
-       4.4.17.1 The name of the file, with optional relative path.\r
-       The path stored MUST not contain a drive or\r
-       device letter, or a leading slash.  All slashes\r
-       MUST be forward slashes '/' as opposed to\r
-       backwards slashes '\' for compatibility with Amiga\r
-       and UNIX file systems etc.  If input came from standard\r
-       input, there is no file name field.  \r
-\r
-       4.4.17.2 If using the Central Directory Encryption Feature and \r
-       general purpose bit flag 13 is set indicating masking, the file \r
-       name stored in the Local Header will not be the actual file name.  \r
-       A masking value consisting of a unique hexadecimal value will \r
-       be stored.  This value will be sequentially incremented for each \r
-       file in the archive. See the section on the Strong Encryption \r
-       Specification for details on retrieving the encrypted file name. \r
-       Refer to the section in this document entitled "Incorporating PKWARE \r
-       Proprietary Technology into Your Product" for more information.\r
-\r
-\r
-   4.4.18 file comment: (Variable)\r
-\r
-       The comment for this file.\r
-\r
-   4.4.19 number of this disk: (2 bytes)\r
-\r
-       The number of this disk, which contains central\r
-       directory end record. If an archive is in ZIP64 format\r
-       and the value in this field is 0xFFFF, the size will \r
-       be in the corresponding 4 byte zip64 end of central \r
-       directory field.\r
-\r
-\r
-   4.4.20 number of the disk with the start of the central\r
-            directory: (2 bytes)\r
-\r
-       The number of the disk on which the central\r
-       directory starts. If an archive is in ZIP64 format\r
-       and the value in this field is 0xFFFF, the size will \r
-       be in the corresponding 4 byte zip64 end of central \r
-       directory field.\r
-\r
-   4.4.21 total number of entries in the central dir on \r
-          this disk: (2 bytes)\r
-\r
-      The number of central directory entries on this disk.\r
-      If an archive is in ZIP64 format and the value in \r
-      this field is 0xFFFF, the size will be in the \r
-      corresponding 8 byte zip64 end of central \r
-      directory field.\r
-\r
-   4.4.22 total number of entries in the central dir: (2 bytes)\r
-\r
-      The total number of files in the .ZIP file. If an \r
-      archive is in ZIP64 format and the value in this field\r
-      is 0xFFFF, the size will be in the corresponding 8 byte \r
-      zip64 end of central directory field.\r
-\r
-   4.4.23 size of the central directory: (4 bytes)\r
-\r
-      The size (in bytes) of the entire central directory.\r
-      If an archive is in ZIP64 format and the value in \r
-      this field is 0xFFFFFFFF, the size will be in the \r
-      corresponding 8 byte zip64 end of central \r
-      directory field.\r
-\r
-   4.4.24 offset of start of central directory with respect to\r
-          the starting disk number:  (4 bytes)\r
-\r
-      Offset of the start of the central directory on the\r
-      disk on which the central directory starts. If an \r
-      archive is in ZIP64 format and the value in this \r
-      field is 0xFFFFFFFF, the size will be in the \r
-      corresponding 8 byte zip64 end of central \r
-      directory field.\r
-\r
-   4.4.25 .ZIP file comment length: (2 bytes)\r
-\r
-      The length of the comment for this .ZIP file.\r
-\r
-   4.4.26 .ZIP file comment: (Variable)\r
-\r
-      The comment for this .ZIP file.  ZIP file comment data\r
-      is stored unsecured.  No encryption or data authentication\r
-      is applied to this area at this time.  Confidential information\r
-      should not be stored in this section.\r
-\r
-   4.4.27 zip64 extensible data sector    (variable size)\r
-\r
-      (currently reserved for use by PKWARE)\r
-\r
-\r
-   4.4.28 extra field: (Variable)\r
-\r
-     This SHOULD be used for storage expansion.  If additional \r
-     information needs to be stored within a ZIP file for special \r
-     application or platform needs, it SHOULD be stored here.  \r
-     Programs supporting earlier versions of this specification can \r
-     then safely skip the file, and find the next file or header.  \r
-     This field will be 0 length in version 1.0.  \r
-\r
-     Existing extra fields are defined in the section\r
-     Extensible data fields that follows.\r
-\r
-4.5 Extensible data fields\r
---------------------------\r
-\r
-   4.5.1 In order to allow different programs and different types\r
-   of information to be stored in the 'extra' field in .ZIP\r
-   files, the following structure MUST be used for all\r
-   programs storing data in this field:\r
-\r
-       header1+data1 + header2+data2 . . .\r
-\r
-   Each header should consist of:\r
-\r
-       Header ID - 2 bytes\r
-       Data Size - 2 bytes\r
-\r
-   Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-   The Header ID field indicates the type of data that is in\r
-   the following data block.\r
-\r
-   Header IDs of 0 thru 31 are reserved for use by PKWARE.\r
-   The remaining IDs can be used by third party vendors for\r
-   proprietary usage.\r
-\r
-   4.5.2 The current Header ID mappings defined by PKWARE are:\r
-\r
-      0x0001        Zip64 extended information extra field\r
-      0x0007        AV Info\r
-      0x0008        Reserved for extended language encoding data (PFS)\r
-                    (see APPENDIX D)\r
-      0x0009        OS/2\r
-      0x000a        NTFS \r
-      0x000c        OpenVMS\r
-      0x000d        UNIX\r
-      0x000e        Reserved for file stream and fork descriptors\r
-      0x000f        Patch Descriptor\r
-      0x0014        PKCS#7 Store for X.509 Certificates\r
-      0x0015        X.509 Certificate ID and Signature for \r
-                    individual file\r
-      0x0016        X.509 Certificate ID for Central Directory\r
-      0x0017        Strong Encryption Header\r
-      0x0018        Record Management Controls\r
-      0x0019        PKCS#7 Encryption Recipient Certificate List\r
-      0x0065        IBM S/390 (Z390), AS/400 (I400) attributes \r
-                    - uncompressed\r
-      0x0066        Reserved for IBM S/390 (Z390), AS/400 (I400) \r
-                    attributes - compressed\r
-      0x4690        POSZIP 4690 (reserved) \r
-\r
-\r
-   4.5.3 -Zip64 Extended Information Extra Field (0x0001):\r
-\r
-      The following is the layout of the zip64 extended \r
-      information "extra" block. If one of the size or\r
-      offset fields in the Local or Central directory\r
-      record is too small to hold the required data,\r
-      a Zip64 extended information record is created.\r
-      The order of the fields in the zip64 extended \r
-      information record is fixed, but the fields MUST\r
-      only appear if the corresponding Local or Central\r
-      directory record field is set to 0xFFFF or 0xFFFFFFFF.\r
-\r
-      Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-        Value      Size       Description\r
-        -----      ----       -----------\r
-(ZIP64) 0x0001     2 bytes    Tag for this "extra" block type\r
-        Size       2 bytes    Size of this "extra" block\r
-        Original \r
-        Size       8 bytes    Original uncompressed file size\r
-        Compressed\r
-        Size       8 bytes    Size of compressed data\r
-        Relative Header\r
-        Offset     8 bytes    Offset of local header record\r
-        Disk Start\r
-        Number     4 bytes    Number of the disk on which\r
-                              this file starts \r
-\r
-      This entry in the Local header MUST include BOTH original\r
-      and compressed file size fields. If encrypting the \r
-      central directory and bit 13 of the general purpose bit\r
-      flag is set indicating masking, the value stored in the\r
-      Local Header for the original file size will be zero.\r
-\r
-\r
-   4.5.4 -OS/2 Extra Field (0x0009):\r
-\r
-      The following is the layout of the OS/2 attributes "extra" \r
-      block.  (Last Revision  09/05/95)\r
-\r
-      Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-        Value       Size          Description\r
-        -----       ----          -----------\r
-(OS/2)  0x0009      2 bytes       Tag for this "extra" block type\r
-        TSize       2 bytes       Size for the following data block\r
-        BSize       4 bytes       Uncompressed Block Size\r
-        CType       2 bytes       Compression type\r
-        EACRC       4 bytes       CRC value for uncompress block\r
-        (var)       variable      Compressed block\r
-\r
-      The OS/2 extended attribute structure (FEA2LIST) is \r
-      compressed and then stored in its entirety within this \r
-      structure.  There will only ever be one "block" of data in \r
-      VarFields[].\r
-\r
-   4.5.5 -NTFS Extra Field (0x000a):\r
-\r
-      The following is the layout of the NTFS attributes \r
-      "extra" block. (Note: At this time the Mtime, Atime\r
-      and Ctime values MAY be used on any WIN32 system.)  \r
-\r
-      Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-        Value      Size       Description\r
-        -----      ----       -----------\r
-(NTFS)  0x000a     2 bytes    Tag for this "extra" block type\r
-        TSize      2 bytes    Size of the total "extra" block\r
-        Reserved   4 bytes    Reserved for future use\r
-        Tag1       2 bytes    NTFS attribute tag value #1\r
-        Size1      2 bytes    Size of attribute #1, in bytes\r
-        (var)      Size1      Attribute #1 data\r
-         .\r
-         .\r
-         .\r
-         TagN       2 bytes    NTFS attribute tag value #N\r
-         SizeN      2 bytes    Size of attribute #N, in bytes\r
-         (var)      SizeN      Attribute #N data\r
-\r
-       For NTFS, values for Tag1 through TagN are as follows:\r
-       (currently only one set of attributes is defined for NTFS)\r
-\r
-         Tag        Size       Description\r
-         -----      ----       -----------\r
-         0x0001     2 bytes    Tag for attribute #1 \r
-         Size1      2 bytes    Size of attribute #1, in bytes\r
-         Mtime      8 bytes    File last modification time\r
-         Atime      8 bytes    File last access time\r
-         Ctime      8 bytes    File creation time\r
-\r
-   4.5.6 -OpenVMS Extra Field (0x000c):\r
-\r
-       The following is the layout of the OpenVMS attributes \r
-       "extra" block.\r
-\r
-       Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-         Value      Size       Description\r
-         -----      ----       -----------\r
- (VMS)   0x000c     2 bytes    Tag for this "extra" block type\r
-         TSize      2 bytes    Size of the total "extra" block\r
-         CRC        4 bytes    32-bit CRC for remainder of the block\r
-         Tag1       2 bytes    OpenVMS attribute tag value #1\r
-         Size1      2 bytes    Size of attribute #1, in bytes\r
-         (var)      Size1      Attribute #1 data\r
-         .\r
-         .\r
-         .\r
-         TagN       2 bytes    OpenVMS attribute tag value #N\r
-         SizeN      2 bytes    Size of attribute #N, in bytes\r
-         (var)      SizeN      Attribute #N data\r
-\r
-       OpenVMS Extra Field Rules:\r
-\r
-          4.5.6.1. There will be one or more attributes present, which \r
-          will each be preceded by the above TagX & SizeX values.  \r
-          These values are identical to the ATR$C_XXXX and ATR$S_XXXX \r
-          constants which are defined in ATR.H under OpenVMS C.  Neither \r
-          of these values will ever be zero.\r
-\r
-          4.5.6.2. No word alignment or padding is performed.\r
-\r
-          4.5.6.3. A well-behaved PKZIP/OpenVMS program should never produce\r
-          more than one sub-block with the same TagX value.  Also, there will \r
-          never be more than one "extra" block of type 0x000c in a particular \r
-          directory record.\r
-\r
-   4.5.7 -UNIX Extra Field (0x000d):\r
-\r
-        The following is the layout of the UNIX "extra" block.\r
-        Note: all fields are stored in Intel low-byte/high-byte \r
-        order.\r
-\r
-        Value       Size          Description\r
-        -----       ----          -----------\r
-(UNIX)  0x000d      2 bytes       Tag for this "extra" block type\r
-        TSize       2 bytes       Size for the following data block\r
-        Atime       4 bytes       File last access time\r
-        Mtime       4 bytes       File last modification time\r
-        Uid         2 bytes       File user ID\r
-        Gid         2 bytes       File group ID\r
-        (var)       variable      Variable length data field\r
-\r
-        The variable length data field will contain file type \r
-        specific data.  Currently the only values allowed are\r
-        the original "linked to" file names for hard or symbolic \r
-        links, and the major and minor device node numbers for\r
-        character and block device nodes.  Since device nodes\r
-        cannot be either symbolic or hard links, only one set of\r
-        variable length data is stored.  Link files will have the\r
-        name of the original file stored.  This name is NOT NULL\r
-        terminated.  Its size can be determined by checking TSize -\r
-        12.  Device entries will have eight bytes stored as two 4\r
-        byte entries (in little endian format).  The first entry\r
-        will be the major device number, and the second the minor\r
-        device number.\r
-                          \r
-   4.5.8 -PATCH Descriptor Extra Field (0x000f):\r
-\r
-        4.5.8.1 The following is the layout of the Patch Descriptor \r
-        "extra" block.\r
-\r
-        Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-        Value     Size     Description\r
-        -----     ----     -----------\r
-(Patch) 0x000f    2 bytes  Tag for this "extra" block type\r
-        TSize     2 bytes  Size of the total "extra" block\r
-        Version   2 bytes  Version of the descriptor\r
-        Flags     4 bytes  Actions and reactions (see below) \r
-        OldSize   4 bytes  Size of the file about to be patched \r
-        OldCRC    4 bytes  32-bit CRC of the file to be patched \r
-        NewSize   4 bytes  Size of the resulting file \r
-        NewCRC    4 bytes  32-bit CRC of the resulting file \r
-\r
-        4.5.8.2 Actions and reactions\r
-\r
-        Bits          Description\r
-        ----          ----------------\r
-        0             Use for auto detection\r
-        1             Treat as a self-patch\r
-        2-3           RESERVED\r
-        4-5           Action (see below)\r
-        6-7           RESERVED\r
-        8-9           Reaction (see below) to absent file \r
-        10-11         Reaction (see below) to newer file\r
-        12-13         Reaction (see below) to unknown file\r
-        14-15         RESERVED\r
-        16-31         RESERVED\r
-\r
-           4.5.8.2.1 Actions\r
-\r
-           Action       Value\r
-           ------       ----- \r
-           none         0\r
-           add          1\r
-           delete       2\r
-           patch        3\r
-\r
-           4.5.8.2.2 Reactions\r
-        \r
-           Reaction     Value\r
-           --------     -----\r
-           ask          0\r
-           skip         1\r
-           ignore       2\r
-           fail         3\r
-\r
-        4.5.8.3 Patch support is provided by PKPatchMaker(tm) technology \r
-        and is covered under U.S. Patents and Patents Pending. The use or \r
-        implementation in a product of certain technological aspects set\r
-        forth in the current APPNOTE, including those with regard to \r
-        strong encryption or patching requires a license from PKWARE.  \r
-        Refer to the section in this document entitled "Incorporating \r
-        PKWARE Proprietary Technology into Your Product" for more \r
-        information. \r
-\r
-   4.5.9 -PKCS#7 Store for X.509 Certificates (0x0014):\r
-\r
-        This field MUST contain information about each of the certificates \r
-        files may be signed with. When the Central Directory Encryption \r
-        feature is enabled for a ZIP file, this record will appear in \r
-        the Archive Extra Data Record, otherwise it will appear in the \r
-        first central directory record and will be ignored in any \r
-        other record.  \r
-\r
-                          \r
-        Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-        Value     Size     Description\r
-        -----     ----     -----------\r
-(Store) 0x0014    2 bytes  Tag for this "extra" block type\r
-        TSize     2 bytes  Size of the store data\r
-        TData     TSize    Data about the store\r
-\r
-\r
-   4.5.10 -X.509 Certificate ID and Signature for individual file (0x0015):\r
-\r
-        This field contains the information about which certificate in \r
-        the PKCS#7 store was used to sign a particular file. It also \r
-        contains the signature data. This field can appear multiple \r
-        times, but can only appear once per certificate.\r
-\r
-        Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-        Value     Size     Description\r
-        -----     ----     -----------\r
-(CID)   0x0015    2 bytes  Tag for this "extra" block type\r
-        TSize     2 bytes  Size of data that follows\r
-        TData     TSize    Signature Data\r
-\r
-   4.5.11 -X.509 Certificate ID and Signature for central directory (0x0016):\r
-\r
-        This field contains the information about which certificate in \r
-        the PKCS#7 store was used to sign the central directory structure.\r
-        When the Central Directory Encryption feature is enabled for a \r
-        ZIP file, this record will appear in the Archive Extra Data Record, \r
-        otherwise it will appear in the first central directory record.\r
-\r
-        Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-        Value     Size     Description\r
-        -----     ----     -----------\r
-(CDID)  0x0016    2 bytes  Tag for this "extra" block type\r
-        TSize     2 bytes  Size of data that follows\r
-        TData     TSize    Data\r
-\r
-   4.5.12 -Strong Encryption Header (0x0017):\r
-\r
-        Value     Size     Description\r
-        -----     ----     -----------\r
-        0x0017    2 bytes  Tag for this "extra" block type\r
-        TSize     2 bytes  Size of data that follows\r
-        Format    2 bytes  Format definition for this record\r
-        AlgID     2 bytes  Encryption algorithm identifier\r
-        Bitlen    2 bytes  Bit length of encryption key\r
-        Flags     2 bytes  Processing flags\r
-        CertData  TSize-8  Certificate decryption extra field data\r
-                           (refer to the explanation for CertData\r
-                            in the section describing the \r
-                            Certificate Processing Method under \r
-                            the Strong Encryption Specification)\r
-\r
-        See the section describing the Strong Encryption Specification \r
-        for details.  Refer to the section in this document entitled \r
-        "Incorporating PKWARE Proprietary Technology into Your Product" \r
-        for more information.\r
-\r
-   4.5.13 -Record Management Controls (0x0018):\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-(Rec-CTL) 0x0018    2 bytes  Tag for this "extra" block type\r
-          CSize     2 bytes  Size of total extra block data\r
-          Tag1      2 bytes  Record control attribute 1\r
-          Size1     2 bytes  Size of attribute 1, in bytes\r
-          Data1     Size1    Attribute 1 data\r
-          .\r
-          .\r
-          .\r
-          TagN      2 bytes  Record control attribute N\r
-          SizeN     2 bytes  Size of attribute N, in bytes\r
-          DataN     SizeN    Attribute N data\r
-\r
-\r
-   4.5.14 -PKCS#7 Encryption Recipient Certificate List (0x0019): \r
-\r
-        This field MAY contain information about each of the certificates\r
-        used in encryption processing and it can be used to identify who is\r
-        allowed to decrypt encrypted files.  This field should only appear \r
-        in the archive extra data record. This field is not required and \r
-        serves only to aid archive modifications by preserving public \r
-        encryption key data. Individual security requirements may dictate \r
-        that this data be omitted to deter information exposure.\r
-\r
-        Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-         Value     Size     Description\r
-         -----     ----     -----------\r
-(CStore) 0x0019    2 bytes  Tag for this "extra" block type\r
-         TSize     2 bytes  Size of the store data\r
-         TData     TSize    Data about the store\r
-\r
-         TData:\r
-\r
-         Value     Size     Description\r
-         -----     ----     -----------\r
-         Version   2 bytes  Format version number - must 0x0001 at this time\r
-         CStore    (var)    PKCS#7 data blob\r
-\r
-         See the section describing the Strong Encryption Specification \r
-         for details.  Refer to the section in this document entitled \r
-         "Incorporating PKWARE Proprietary Technology into Your Product" \r
-         for more information.\r
-\r
-   4.5.15 -MVS Extra Field (0x0065):\r
-\r
-        The following is the layout of the MVS "extra" block.\r
-        Note: Some fields are stored in Big Endian format.\r
-        All text is in EBCDIC format unless otherwise specified.\r
-\r
-        Value     Size      Description\r
-        -----     ----      -----------\r
-(MVS)   0x0065    2 bytes   Tag for this "extra" block type\r
-        TSize     2 bytes   Size for the following data block\r
-        ID        4 bytes   EBCDIC "Z390" 0xE9F3F9F0 or\r
-                            "T4MV" for TargetFour\r
-        (var)     TSize-4   Attribute data (see APPENDIX B)\r
-\r
-\r
-   4.5.16 -OS/400 Extra Field (0x0065):\r
-\r
-        The following is the layout of the OS/400 "extra" block.\r
-        Note: Some fields are stored in Big Endian format.\r
-        All text is in EBCDIC format unless otherwise specified.\r
-\r
-        Value     Size       Description\r
-        -----     ----       -----------\r
-(OS400) 0x0065    2 bytes    Tag for this "extra" block type\r
-        TSize     2 bytes    Size for the following data block\r
-        ID        4 bytes    EBCDIC "I400" 0xC9F4F0F0 or\r
-                             "T4MV" for TargetFour\r
-        (var)     TSize-4    Attribute data (see APPENDIX A)\r
-\r
-4.6 Third Party Mappings\r
-------------------------\r
-                 \r
-   4.6.1 Third party mappings commonly used are:\r
-\r
-          0x07c8        Macintosh\r
-          0x2605        ZipIt Macintosh\r
-          0x2705        ZipIt Macintosh 1.3.5+\r
-          0x2805        ZipIt Macintosh 1.3.5+\r
-          0x334d        Info-ZIP Macintosh\r
-          0x4341        Acorn/SparkFS \r
-          0x4453        Windows NT security descriptor (binary ACL)\r
-          0x4704        VM/CMS\r
-          0x470f        MVS\r
-          0x4b46        FWKCS MD5 (see below)\r
-          0x4c41        OS/2 access control list (text ACL)\r
-          0x4d49        Info-ZIP OpenVMS\r
-          0x4f4c        Xceed original location extra field\r
-          0x5356        AOS/VS (ACL)\r
-          0x5455        extended timestamp\r
-          0x554e        Xceed unicode extra field\r
-          0x5855        Info-ZIP UNIX (original, also OS/2, NT, etc)\r
-          0x6375        Info-ZIP Unicode Comment Extra Field\r
-          0x6542        BeOS/BeBox\r
-          0x7075        Info-ZIP Unicode Path Extra Field\r
-          0x756e        ASi UNIX\r
-          0x7855        Info-ZIP UNIX (new)\r
-          0xa220        Microsoft Open Packaging Growth Hint\r
-          0xfd4a        SMS/QDOS\r
-\r
-   Detailed descriptions of Extra Fields defined by third \r
-   party mappings will be documented as information on\r
-   these data structures is made available to PKWARE.  \r
-   PKWARE does not guarantee the accuracy of any published\r
-   third party data.\r
-\r
-   4.6.2 Third-party Extra Fields must include a Header ID using\r
-   the format defined in the section of this document \r
-   titled Extensible Data Fields (section 4.5).\r
-\r
-   The Data Size field indicates the size of the following\r
-   data block. Programs can use this value to skip to the\r
-   next header block, passing over any data blocks that are\r
-   not of interest.\r
-\r
-   Note: As stated above, the size of the entire .ZIP file\r
-         header, including the file name, comment, and extra\r
-         field should not exceed 64K in size.\r
-\r
-   4.6.3 In case two different programs should appropriate the same\r
-   Header ID value, it is strongly recommended that each\r
-   program SHOULD place a unique signature of at least two bytes in\r
-   size (and preferably 4 bytes or bigger) at the start of\r
-   each data area.  Every program SHOULD verify that its\r
-   unique signature is present, in addition to the Header ID\r
-   value being correct, before assuming that it is a block of\r
-   known type.\r
-         \r
-   Third-party Mappings:\r
-          \r
-   4.6.4 -ZipIt Macintosh Extra Field (long) (0x2605):\r
-\r
-      The following is the layout of the ZipIt extra block \r
-      for Macintosh. The local-header and central-header versions \r
-      are identical. This block must be present if the file is \r
-      stored MacBinary-encoded and it should not be used if the file \r
-      is not stored MacBinary-encoded.\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-  (Mac2)  0x2605        Short       tag for this extra block type\r
-          TSize         Short       total data size for this block\r
-          "ZPIT"        beLong      extra-field signature\r
-          FnLen         Byte        length of FileName\r
-          FileName      variable    full Macintosh filename\r
-          FileType      Byte[4]     four-byte Mac file type string\r
-          Creator       Byte[4]     four-byte Mac creator string\r
-\r
-\r
-   4.6.5 -ZipIt Macintosh Extra Field (short, for files) (0x2705):\r
-\r
-      The following is the layout of a shortened variant of the\r
-      ZipIt extra block for Macintosh (without "full name" entry).\r
-      This variant is used by ZipIt 1.3.5 and newer for entries of\r
-      files (not directories) that do not have a MacBinary encoded\r
-      file. The local-header and central-header versions are identical.\r
-\r
-         Value         Size        Description\r
-         -----         ----        -----------\r
- (Mac2b) 0x2705        Short       tag for this extra block type\r
-         TSize         Short       total data size for this block (12)\r
-         "ZPIT"        beLong      extra-field signature\r
-         FileType      Byte[4]     four-byte Mac file type string\r
-         Creator       Byte[4]     four-byte Mac creator string\r
-         fdFlags       beShort     attributes from FInfo.frFlags,\r
-                                   may be omitted\r
-         0x0000        beShort     reserved, may be omitted\r
-\r
-\r
-   4.6.6 -ZipIt Macintosh Extra Field (short, for directories) (0x2805):\r
-\r
-      The following is the layout of a shortened variant of the\r
-      ZipIt extra block for Macintosh used only for directory\r
-      entries. This variant is used by ZipIt 1.3.5 and newer to \r
-      save some optional Mac-specific information about directories.\r
-      The local-header and central-header versions are identical.\r
-\r
-         Value         Size        Description\r
-         -----         ----        -----------\r
- (Mac2c) 0x2805        Short       tag for this extra block type\r
-         TSize         Short       total data size for this block (12)\r
-         "ZPIT"        beLong      extra-field signature\r
-         frFlags       beShort     attributes from DInfo.frFlags, may\r
-                                   be omitted\r
-         View          beShort     ZipIt view flag, may be omitted\r
-\r
-\r
-     The View field specifies ZipIt-internal settings as follows:\r
-\r
-     Bits of the Flags:\r
-        bit 0           if set, the folder is shown expanded (open)\r
-                        when the archive contents are viewed in ZipIt.\r
-        bits 1-15       reserved, zero;\r
-\r
-\r
-   4.6.7 -FWKCS MD5 Extra Field (0x4b46):\r
-\r
-      The FWKCS Contents_Signature System, used in\r
-      automatically identifying files independent of file name,\r
-      optionally adds and uses an extra field to support the\r
-      rapid creation of an enhanced contents_signature:\r
-\r
-              Header ID = 0x4b46\r
-              Data Size = 0x0013\r
-              Preface   = 'M','D','5'\r
-              followed by 16 bytes containing the uncompressed file's\r
-              128_bit MD5 hash(1), low byte first.\r
-\r
-      When FWKCS revises a .ZIP file central directory to add\r
-      this extra field for a file, it also replaces the\r
-      central directory entry for that file's uncompressed\r
-      file length with a measured value.\r
-\r
-      FWKCS provides an option to strip this extra field, if\r
-      present, from a .ZIP file central directory. In adding\r
-      this extra field, FWKCS preserves .ZIP file Authenticity\r
-      Verification; if stripping this extra field, FWKCS\r
-      preserves all versions of AV through PKZIP version 2.04g.\r
-\r
-      FWKCS, and FWKCS Contents_Signature System, are\r
-      trademarks of Frederick W. Kantor.\r
-\r
-      (1) R. Rivest, RFC1321.TXT, MIT Laboratory for Computer\r
-          Science and RSA Data Security, Inc., April 1992.\r
-          ll.76-77: "The MD5 algorithm is being placed in the\r
-          public domain for review and possible adoption as a\r
-          standard."\r
-\r
-\r
-   4.6.8 -Info-ZIP Unicode Comment Extra Field (0x6375):\r
-\r
-      Stores the UTF-8 version of the file comment as stored in the\r
-      central directory header. (Last Revision 20070912)\r
-\r
-         Value         Size        Description\r
-         -----         ----        -----------\r
-  (UCom) 0x6375        Short       tag for this extra block type ("uc")\r
-         TSize         Short       total data size for this block\r
-         Version       1 byte      version of this extra field, currently 1\r
-         ComCRC32      4 bytes     Comment Field CRC32 Checksum\r
-         UnicodeCom    Variable    UTF-8 version of the entry comment\r
-\r
-       Currently Version is set to the number 1.  If there is a need\r
-       to change this field, the version will be incremented.  Changes\r
-       may not be backward compatible so this extra field should not be\r
-       used if the version is not recognized.\r
-\r
-       The ComCRC32 is the standard zip CRC32 checksum of the File Comment\r
-       field in the central directory header.  This is used to verify that\r
-       the comment field has not changed since the Unicode Comment extra field\r
-       was created.  This can happen if a utility changes the File Comment \r
-       field but does not update the UTF-8 Comment extra field.  If the CRC \r
-       check fails, this Unicode Comment extra field should be ignored and \r
-       the File Comment field in the header should be used instead.\r
-\r
-       The UnicodeCom field is the UTF-8 version of the File Comment field\r
-       in the header.  As UnicodeCom is defined to be UTF-8, no UTF-8 byte\r
-       order mark (BOM) is used.  The length of this field is determined by\r
-       subtracting the size of the previous fields from TSize.  If both the\r
-       File Name and Comment fields are UTF-8, the new General Purpose Bit\r
-       Flag, bit 11 (Language encoding flag (EFS)), can be used to indicate\r
-       both the header File Name and Comment fields are UTF-8 and, in this\r
-       case, the Unicode Path and Unicode Comment extra fields are not\r
-       needed and should not be created.  Note that, for backward\r
-       compatibility, bit 11 should only be used if the native character set\r
-       of the paths and comments being zipped up are already in UTF-8. It is\r
-       expected that the same file comment storage method, either general\r
-       purpose bit 11 or extra fields, be used in both the Local and Central\r
-       Directory Header for a file.\r
-\r
-\r
-   4.6.9 -Info-ZIP Unicode Path Extra Field (0x7075):\r
-\r
-       Stores the UTF-8 version of the file name field as stored in the\r
-       local header and central directory header. (Last Revision 20070912)\r
-\r
-         Value         Size        Description\r
-         -----         ----        -----------\r
- (UPath) 0x7075        Short       tag for this extra block type ("up")\r
-         TSize         Short       total data size for this block\r
-         Version       1 byte      version of this extra field, currently 1\r
-         NameCRC32     4 bytes     File Name Field CRC32 Checksum\r
-         UnicodeName   Variable    UTF-8 version of the entry File Name\r
-\r
-      Currently Version is set to the number 1.  If there is a need\r
-      to change this field, the version will be incremented.  Changes\r
-      may not be backward compatible so this extra field should not be\r
-      used if the version is not recognized.\r
-\r
-      The NameCRC32 is the standard zip CRC32 checksum of the File Name\r
-      field in the header.  This is used to verify that the header\r
-      File Name field has not changed since the Unicode Path extra field\r
-      was created.  This can happen if a utility renames the File Name but\r
-      does not update the UTF-8 path extra field.  If the CRC check fails,\r
-      this UTF-8 Path Extra Field should be ignored and the File Name field\r
-      in the header should be used instead.\r
-\r
-      The UnicodeName is the UTF-8 version of the contents of the File Name\r
-      field in the header.  As UnicodeName is defined to be UTF-8, no UTF-8\r
-      byte order mark (BOM) is used.  The length of this field is determined\r
-      by subtracting the size of the previous fields from TSize.  If both\r
-      the File Name and Comment fields are UTF-8, the new General Purpose\r
-      Bit Flag, bit 11 (Language encoding flag (EFS)), can be used to\r
-      indicate that both the header File Name and Comment fields are UTF-8\r
-      and, in this case, the Unicode Path and Unicode Comment extra fields\r
-      are not needed and should not be created.  Note that, for backward\r
-      compatibility, bit 11 should only be used if the native character set\r
-      of the paths and comments being zipped up are already in UTF-8. It is\r
-      expected that the same file name storage method, either general\r
-      purpose bit 11 or extra fields, be used in both the Local and Central\r
-      Directory Header for a file.\r
\r
-\r
-   4.6.10 -Microsoft Open Packaging Growth Hint (0xa220):\r
-\r
-          Value         Size        Description\r
-          -----         ----        -----------\r
-          0xa220        Short       tag for this extra block type\r
-          TSize         Short       size of Sig + PadVal + Padding\r
-          Sig           Short       verification signature (A028)\r
-          PadVal        Short       Initial padding value\r
-          Padding       variable    filled with NULL characters\r
-\r
-4.7 Manifest Files\r
-------------------\r
-\r
-    4.7.1 Applications using ZIP files may have a need for additional \r
-    information that must be included with the files placed into\r
-    a ZIP file. Application specific information that cannot be\r
-    stored using the defined ZIP storage records SHOULD be stored \r
-    using the extensible Extra Field convention defined in this \r
-    document.  However, some applications may use a manifest\r
-    file as a means for storing additional information.  One\r
-    example is the META-INF/MANIFEST.MF file used in ZIP formatted\r
-    files having the .JAR extension (JAR files).  \r
-\r
-    4.7.2 A manifest file is a file created for the application process\r
-    that requires this information.  A manifest file MAY be of any \r
-    file type required by the defining application process.  It is \r
-    placed within the same ZIP file as files to which this information \r
-    applies. By convention, this file is typically the first file placed\r
-    into the ZIP file and it may include a defined directory path.\r
-\r
-    4.7.3 Manifest files may be compressed or encrypted as needed for\r
-    application processing of the files inside the ZIP files.\r
-\r
-    Manifest files are outside of the scope of this specification.\r
-\r
-\r
-5.0 Explanation of compression methods\r
---------------------------------------\r
-\r
-\r
-5.1 UnShrinking - Method 1\r
---------------------------\r
-\r
-    5.1.1 Shrinking is a Dynamic Ziv-Lempel-Welch compression algorithm\r
-    with partial clearing.  The initial code size is 9 bits, and the \r
-    maximum code size is 13 bits.  Shrinking differs from conventional \r
-    Dynamic Ziv-Lempel-Welch implementations in several respects:\r
-\r
-    5.1.2 The code size is controlled by the compressor, and is \r
-    not automatically increased when codes larger than the current\r
-    code size are created (but not necessarily used).  When\r
-    the decompressor encounters the code sequence 256\r
-    (decimal) followed by 1, it should increase the code size\r
-    read from the input stream to the next bit size.  No\r
-    blocking of the codes is performed, so the next code at\r
-    the increased size should be read from the input stream\r
-    immediately after where the previous code at the smaller\r
-    bit size was read.  Again, the decompressor should not\r
-    increase the code size used until the sequence 256,1 is\r
-    encountered.\r
-\r
-    5.1.3 When the table becomes full, total clearing is not\r
-    performed.  Rather, when the compressor emits the code\r
-    sequence 256,2 (decimal), the decompressor should clear\r
-    all leaf nodes from the Ziv-Lempel tree, and continue to\r
-    use the current code size.  The nodes that are cleared\r
-    from the Ziv-Lempel tree are then re-used, with the lowest\r
-    code value re-used first, and the highest code value\r
-    re-used last.  The compressor can emit the sequence 256,2\r
-    at any time.\r
-\r
-5.2 Expanding - Methods 2-5\r
----------------------------\r
-\r
-    5.2.1 The Reducing algorithm is actually a combination of two\r
-    distinct algorithms.  The first algorithm compresses repeated\r
-    byte sequences, and the second algorithm takes the compressed\r
-    stream from the first algorithm and applies a probabilistic\r
-    compression method.\r
-\r
-    5.2.2 The probabilistic compression stores an array of 'follower\r
-    sets' S(j), for j=0 to 255, corresponding to each possible\r
-    ASCII character.  Each set contains between 0 and 32\r
-    characters, to be denoted as S(j)[0],...,S(j)[m], where m<32.\r
-    The sets are stored at the beginning of the data area for a\r
-    Reduced file, in reverse order, with S(255) first, and S(0)\r
-    last.\r
-\r
-    5.2.3 The sets are encoded as { N(j), S(j)[0],...,S(j)[N(j)-1] },\r
-    where N(j) is the size of set S(j).  N(j) can be 0, in which\r
-    case the follower set for S(j) is empty.  Each N(j) value is\r
-    encoded in 6 bits, followed by N(j) eight bit character values\r
-    corresponding to S(j)[0] to S(j)[N(j)-1] respectively.  If\r
-    N(j) is 0, then no values for S(j) are stored, and the value\r
-    for N(j-1) immediately follows.\r
-\r
-    5.2.4 Immediately after the follower sets, is the compressed data\r
-    stream.  The compressed data stream can be interpreted for the\r
-    probabilistic decompression as follows:\r
-\r
-    let Last-Character <- 0.\r
-    loop until done\r
-        if the follower set S(Last-Character) is empty then\r
-            read 8 bits from the input stream, and copy this\r
-            value to the output stream.\r
-        otherwise if the follower set S(Last-Character) is non-empty then\r
-            read 1 bit from the input stream.\r
-            if this bit is not zero then\r
-                read 8 bits from the input stream, and copy this\r
-                value to the output stream.\r
-            otherwise if this bit is zero then\r
-                read B(N(Last-Character)) bits from the input\r
-                stream, and assign this value to I.\r
-                Copy the value of S(Last-Character)[I] to the\r
-                output stream.\r
-\r
-        assign the last value placed on the output stream to\r
-        Last-Character.\r
-    end loop\r
-\r
-    B(N(j)) is defined as the minimal number of bits required to\r
-    encode the value N(j)-1.\r
-\r
-    5.2.5 The decompressed stream from above can then be expanded to\r
-    re-create the original file as follows:\r
-\r
-    let State <- 0.\r
-\r
-    loop until done\r
-        read 8 bits from the input stream into C.\r
-        case State of\r
-            0:  if C is not equal to DLE (144 decimal) then\r
-                   copy C to the output stream.\r
-                 otherwise if C is equal to DLE then\r
-                   let State <- 1.\r
-\r
-            1:  if C is non-zero then\r
-                   let V <- C.\r
-                   let Len <- L(V)\r
-                   let State <- F(Len).\r
-                 otherwise if C is zero then\r
-                   copy the value 144 (decimal) to the output stream.\r
-                   let State <- 0\r
-\r
-            2:  let Len <- Len + C\r
-                    let State <- 3.\r
-\r
-            3:  move backwards D(V,C) bytes in the output stream\r
-                    (if this position is before the start of the output\r
-                    stream, then assume that all the data before the\r
-                    start of the output stream is filled with zeros).\r
-                    copy Len+3 bytes from this position to the output stream.\r
-                    let State <- 0.\r
-          end case\r
-    end loop\r
-\r
-    The functions F,L, and D are dependent on the 'compression\r
-    factor', 1 through 4, and are defined as follows:\r
-\r
-    For compression factor 1:\r
-        L(X) equals the lower 7 bits of X.\r
-        F(X) equals 2 if X equals 127 otherwise F(X) equals 3.\r
-        D(X,Y) equals the (upper 1 bit of X) * 256 + Y + 1.\r
-    For compression factor 2:\r
-        L(X) equals the lower 6 bits of X.\r
-        F(X) equals 2 if X equals 63 otherwise F(X) equals 3.\r
-        D(X,Y) equals the (upper 2 bits of X) * 256 + Y + 1.\r
-    For compression factor 3:\r
-        L(X) equals the lower 5 bits of X.\r
-        F(X) equals 2 if X equals 31 otherwise F(X) equals 3.\r
-        D(X,Y) equals the (upper 3 bits of X) * 256 + Y + 1.\r
-    For compression factor 4:\r
-        L(X) equals the lower 4 bits of X.\r
-        F(X) equals 2 if X equals 15 otherwise F(X) equals 3.\r
-        D(X,Y) equals the (upper 4 bits of X) * 256 + Y + 1.\r
-\r
-5.3 Imploding - Method 6\r
-------------------------\r
-\r
-    5.3.1 The Imploding algorithm is actually a combination of two \r
-    distinct algorithms.  The first algorithm compresses repeated byte\r
-    sequences using a sliding dictionary.  The second algorithm is\r
-    used to compress the encoding of the sliding dictionary output,\r
-    using multiple Shannon-Fano trees.\r
-\r
-    5.3.2 The Imploding algorithm can use a 4K or 8K sliding dictionary\r
-    size. The dictionary size used can be determined by bit 1 in the\r
-    general purpose flag word; a 0 bit indicates a 4K dictionary\r
-    while a 1 bit indicates an 8K dictionary.\r
-\r
-    5.3.3 The Shannon-Fano trees are stored at the start of the \r
-    compressed file. The number of trees stored is defined by bit 2 in \r
-    the general purpose flag word; a 0 bit indicates two trees stored, \r
-    a 1 bit indicates three trees are stored.  If 3 trees are stored,\r
-    the first Shannon-Fano tree represents the encoding of the\r
-    Literal characters, the second tree represents the encoding of\r
-    the Length information, the third represents the encoding of the\r
-    Distance information.  When 2 Shannon-Fano trees are stored, the\r
-    Length tree is stored first, followed by the Distance tree.\r
-\r
-    5.3.4 The Literal Shannon-Fano tree, if present is used to represent\r
-    the entire ASCII character set, and contains 256 values.  This\r
-    tree is used to compress any data not compressed by the sliding\r
-    dictionary algorithm.  When this tree is present, the Minimum\r
-    Match Length for the sliding dictionary is 3.  If this tree is\r
-    not present, the Minimum Match Length is 2.\r
-\r
-    5.3.5 The Length Shannon-Fano tree is used to compress the Length \r
-    part of the (length,distance) pairs from the sliding dictionary\r
-    output.  The Length tree contains 64 values, ranging from the\r
-    Minimum Match Length, to 63 plus the Minimum Match Length.\r
-\r
-    5.3.6 The Distance Shannon-Fano tree is used to compress the Distance\r
-    part of the (length,distance) pairs from the sliding dictionary\r
-    output. The Distance tree contains 64 values, ranging from 0 to\r
-    63, representing the upper 6 bits of the distance value.  The\r
-    distance values themselves will be between 0 and the sliding\r
-    dictionary size, either 4K or 8K.\r
-\r
-    5.3.7 The Shannon-Fano trees themselves are stored in a compressed\r
-    format. The first byte of the tree data represents the number of\r
-    bytes of data representing the (compressed) Shannon-Fano tree\r
-    minus 1.  The remaining bytes represent the Shannon-Fano tree\r
-    data encoded as:\r
-\r
-        High 4 bits: Number of values at this bit length + 1. (1 - 16)\r
-        Low  4 bits: Bit Length needed to represent value + 1. (1 - 16)\r
-\r
-    5.3.8 The Shannon-Fano codes can be constructed from the bit lengths\r
-    using the following algorithm:\r
-\r
-    1)  Sort the Bit Lengths in ascending order, while retaining the\r
-        order of the original lengths stored in the file.\r
-\r
-    2)  Generate the Shannon-Fano trees:\r
-\r
-        Code <- 0\r
-        CodeIncrement <- 0\r
-        LastBitLength <- 0\r
-        i <- number of Shannon-Fano codes - 1   (either 255 or 63)\r
-\r
-        loop while i >= 0\r
-            Code = Code + CodeIncrement\r
-            if BitLength(i) <> LastBitLength then\r
-                LastBitLength=BitLength(i)\r
-                CodeIncrement = 1 shifted left (16 - LastBitLength)\r
-            ShannonCode(i) = Code\r
-            i <- i - 1\r
-        end loop\r
-\r
-    3)  Reverse the order of all the bits in the above ShannonCode()\r
-        vector, so that the most significant bit becomes the least\r
-        significant bit.  For example, the value 0x1234 (hex) would\r
-        become 0x2C48 (hex).\r
-\r
-    4)  Restore the order of Shannon-Fano codes as originally stored\r
-        within the file.\r
-\r
-    Example:\r
-\r
-        This example will show the encoding of a Shannon-Fano tree\r
-        of size 8.  Notice that the actual Shannon-Fano trees used\r
-        for Imploding are either 64 or 256 entries in size.\r
-\r
-    Example:   0x02, 0x42, 0x01, 0x13\r
-\r
-        The first byte indicates 3 values in this table.  Decoding the\r
-        bytes:\r
-                0x42 = 5 codes of 3 bits long\r
-                0x01 = 1 code  of 2 bits long\r
-                0x13 = 2 codes of 4 bits long\r
-\r
-        This would generate the original bit length array of:\r
-        (3, 3, 3, 3, 3, 2, 4, 4)\r
-\r
-        There are 8 codes in this table for the values 0 thru 7.  Using \r
-        the algorithm to obtain the Shannon-Fano codes produces:\r
-\r
-                                      Reversed     Order     Original\r
-    Val  Sorted   Constructed Code      Value     Restored    Length\r
-    ---  ------   -----------------   --------    --------    ------\r
-    0:     2      1100000000000000        11       101          3\r
-    1:     3      1010000000000000       101       001          3\r
-    2:     3      1000000000000000       001       110          3\r
-    3:     3      0110000000000000       110       010          3\r
-    4:     3      0100000000000000       010       100          3\r
-    5:     3      0010000000000000       100        11          2\r
-    6:     4      0001000000000000      1000      1000          4\r
-    7:     4      0000000000000000      0000      0000          4\r
-\r
-    The values in the Val, Order Restored and Original Length columns\r
-    now represent the Shannon-Fano encoding tree that can be used for\r
-    decoding the Shannon-Fano encoded data.  How to parse the\r
-    variable length Shannon-Fano values from the data stream is beyond\r
-    the scope of this document.  (See the references listed at the end of\r
-    this document for more information.)  However, traditional decoding\r
-    schemes used for Huffman variable length decoding, such as the\r
-    Greenlaw algorithm, can be successfully applied.\r
-\r
-    5.3.9 The compressed data stream begins immediately after the\r
-    compressed Shannon-Fano data.  The compressed data stream can be\r
-    interpreted as follows:\r
-\r
-    loop until done\r
-        read 1 bit from input stream.\r
-\r
-        if this bit is non-zero then       (encoded data is literal data)\r
-            if Literal Shannon-Fano tree is present\r
-                read and decode character using Literal Shannon-Fano tree.\r
-            otherwise\r
-                read 8 bits from input stream.\r
-            copy character to the output stream.\r
-        otherwise              (encoded data is sliding dictionary match)\r
-            if 8K dictionary size\r
-                read 7 bits for offset Distance (lower 7 bits of offset).\r
-            otherwise\r
-                read 6 bits for offset Distance (lower 6 bits of offset).\r
-\r
-            using the Distance Shannon-Fano tree, read and decode the\r
-              upper 6 bits of the Distance value.\r
-\r
-            using the Length Shannon-Fano tree, read and decode\r
-              the Length value.\r
-\r
-            Length <- Length + Minimum Match Length\r
-\r
-            if Length = 63 + Minimum Match Length\r
-                read 8 bits from the input stream,\r
-                add this value to Length.\r
-\r
-            move backwards Distance+1 bytes in the output stream, and\r
-            copy Length characters from this position to the output\r
-            stream.  (if this position is before the start of the output\r
-            stream, then assume that all the data before the start of\r
-            the output stream is filled with zeros).\r
-    end loop\r
-\r
-5.4 Tokenizing - Method 7\r
--------------------------\r
-\r
-    5.4.1 This method is not used by PKZIP.\r
-\r
-5.5 Deflating - Method 8\r
-------------------------\r
-\r
-    5.5.1 The Deflate algorithm is similar to the Implode algorithm using\r
-    a sliding dictionary of up to 32K with secondary compression\r
-    from Huffman/Shannon-Fano codes.\r
-\r
-    5.5.2 The compressed data is stored in blocks with a header describing\r
-    the block and the Huffman codes used in the data block.  The header\r
-    format is as follows:\r
-\r
-       Bit 0: Last Block bit     This bit is set to 1 if this is the last\r
-                                 compressed block in the data.\r
-       Bits 1-2: Block type\r
-          00 (0) - Block is stored - All stored data is byte aligned.\r
-                   Skip bits until next byte, then next word = block \r
-                   length, followed by the ones compliment of the block\r
-                   length word. Remaining data in block is the stored \r
-                   data.\r
-\r
-          01 (1) - Use fixed Huffman codes for literal and distance codes.\r
-                   Lit Code    Bits             Dist Code   Bits\r
-                   ---------   ----             ---------   ----\r
-                     0 - 143    8                 0 - 31      5\r
-                   144 - 255    9\r
-                   256 - 279    7\r
-                   280 - 287    8\r
-\r
-                   Literal codes 286-287 and distance codes 30-31 are \r
-                   never used but participate in the huffman construction.\r
-\r
-          10 (2) - Dynamic Huffman codes.  (See expanding Huffman codes)\r
-\r
-          11 (3) - Reserved - Flag a "Error in compressed data" if seen.\r
-\r
-    5.5.3 Expanding Huffman Codes\r
-    \r
-    If the data block is stored with dynamic Huffman codes, the Huffman\r
-    codes are sent in the following compressed format:\r
-\r
-       5 Bits: # of Literal codes sent - 256 (256 - 286)\r
-               All other codes are never sent.\r
-       5 Bits: # of Dist codes - 1           (1 - 32)\r
-       4 Bits: # of Bit Length codes - 3     (3 - 19)\r
-\r
-    The Huffman codes are sent as bit lengths and the codes are built as\r
-    described in the implode algorithm.  The bit lengths themselves are\r
-    compressed with Huffman codes.  There are 19 bit length codes:\r
-\r
-       0 - 15: Represent bit lengths of 0 - 15\r
-           16: Copy the previous bit length 3 - 6 times.\r
-               The next 2 bits indicate repeat length (0 = 3, ... ,3 = 6)\r
-                  Example:  Codes 8, 16 (+2 bits 11), 16 (+2 bits 10) will\r
-                            expand to 12 bit lengths of 8 (1 + 6 + 5)\r
-           17: Repeat a bit length of 0 for 3 - 10 times. (3 bits of length)\r
-           18: Repeat a bit length of 0 for 11 - 138 times (7 bits of length)\r
-\r
-    The lengths of the bit length codes are sent packed 3 bits per value\r
-    (0 - 7) in the following order:\r
-\r
-       16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15\r
-\r
-    The Huffman codes should be built as described in the Implode algorithm\r
-    except codes are assigned starting at the shortest bit length, i.e. the\r
-    shortest code should be all 0's rather than all 1's.  Also, codes with\r
-    a bit length of zero do not participate in the tree construction.  The\r
-    codes are then used to decode the bit lengths for the literal and \r
-    distance tables.\r
-\r
-    The bit lengths for the literal tables are sent first with the number\r
-    of entries sent described by the 5 bits sent earlier.  There are up\r
-    to 286 literal characters; the first 256 represent the respective 8\r
-    bit character, code 256 represents the End-Of-Block code, the remaining\r
-    29 codes represent copy lengths of 3 thru 258.  There are up to 30\r
-    distance codes representing distances from 1 thru 32k as described\r
-    below.\r
-\r
-                                 Length Codes\r
-                                 ------------\r
-          Extra             Extra              Extra              Extra\r
-     Code Bits Length  Code Bits Lengths  Code Bits Lengths  Code Bits Length(s)\r
-     ---- ---- ------  ---- ---- -------  ---- ---- -------  ---- ---- ---------\r
-      257   0     3     265   1   11,12    273   3   35-42    281   5  131-162\r
-      258   0     4     266   1   13,14    274   3   43-50    282   5  163-194\r
-      259   0     5     267   1   15,16    275   3   51-58    283   5  195-226\r
-      260   0     6     268   1   17,18    276   3   59-66    284   5  227-257\r
-      261   0     7     269   2   19-22    277   4   67-82    285   0    258\r
-      262   0     8     270   2   23-26    278   4   83-98\r
-      263   0     9     271   2   27-30    279   4   99-114\r
-      264   0    10     272   2   31-34    280   4  115-130\r
-\r
-                                Distance Codes\r
-                                --------------\r
-          Extra           Extra             Extra               Extra\r
-     Code Bits Dist  Code Bits  Dist   Code Bits Distance  Code Bits Distance\r
-     ---- ---- ----  ---- ---- ------  ---- ---- --------  ---- ---- --------\r
-       0   0    1      8   3   17-24    16    7  257-384    24   11  4097-6144\r
-       1   0    2      9   3   25-32    17    7  385-512    25   11  6145-8192\r
-       2   0    3     10   4   33-48    18    8  513-768    26   12  8193-12288\r
-       3   0    4     11   4   49-64    19    8  769-1024   27   12 12289-16384\r
-       4   1   5,6    12   5   65-96    20    9 1025-1536   28   13 16385-24576\r
-       5   1   7,8    13   5   97-128   21    9 1537-2048   29   13 24577-32768\r
-       6   2   9-12   14   6  129-192   22   10 2049-3072\r
-       7   2  13-16   15   6  193-256   23   10 3073-4096\r
-\r
-    5.5.4 The compressed data stream begins immediately after the\r
-    compressed header data.  The compressed data stream can be\r
-    interpreted as follows:\r
-\r
-    do\r
-       read header from input stream.\r
-\r
-       if stored block\r
-          skip bits until byte aligned\r
-          read count and 1's compliment of count\r
-          copy count bytes data block\r
-       otherwise\r
-          loop until end of block code sent\r
-             decode literal character from input stream\r
-             if literal < 256\r
-                copy character to the output stream\r
-             otherwise\r
-                if literal = end of block\r
-                   break from loop\r
-                otherwise\r
-                   decode distance from input stream\r
-\r
-                   move backwards distance bytes in the output stream, and\r
-                   copy length characters from this position to the output\r
-                   stream.\r
-          end loop\r
-    while not last block\r
-\r
-    if data descriptor exists\r
-       skip bits until byte aligned\r
-       read crc and sizes\r
-    endif\r
-\r
-5.6 Enhanced Deflating - Method 9\r
----------------------------------\r
-\r
-    5.6.1 The Enhanced Deflating algorithm is similar to Deflate but uses \r
-    a sliding dictionary of up to 64K. Deflate64(tm) is supported\r
-    by the Deflate extractor. \r
-\r
-5.7 BZIP2 - Method 12\r
----------------------\r
-\r
-    5.7.1 BZIP2 is an open-source data compression algorithm developed by \r
-    Julian Seward.  Information and source code for this algorithm\r
-    can be found on the internet.\r
-\r
-5.8 LZMA - Method 14 \r
----------------------\r
-\r
-    5.8.1 LZMA is a block-oriented, general purpose data compression \r
-    algorithm developed and maintained by Igor Pavlov.  It is a derivative \r
-    of LZ77 that utilizes Markov chains and a range coder.  Information and \r
-    source code for this algorithm can be found on the internet.  Consult \r
-    with the author of this algorithm for information on terms or \r
-    restrictions on use.\r
-\r
-    Support for LZMA within the ZIP format is defined as follows:   \r
-\r
-    5.8.2 The Compression method field within the ZIP Local and Central \r
-    Header records will be set to the value 14 to indicate data was\r
-    compressed using LZMA. \r
-\r
-    5.8.3 The Version needed to extract field within the ZIP Local and \r
-    Central Header records will be set to 6.3 to indicate the minimum \r
-    ZIP format version supporting this feature.\r
-\r
-    5.8.4 File data compressed using the LZMA algorithm must be placed \r
-    immediately following the Local Header for the file.  If a standard \r
-    ZIP encryption header is required, it will follow the Local Header \r
-    and will precede the LZMA compressed file data segment.  The location \r
-    of LZMA compressed data segment within the ZIP format will be as shown:\r
-\r
-        [local header file 1]\r
-        [encryption header file 1]\r
-        [LZMA compressed data segment for file 1]\r
-        [data descriptor 1]\r
-        [local header file 2]\r
-\r
-    5.8.5 The encryption header and data descriptor records may\r
-    be conditionally present.  The LZMA Compressed Data Segment \r
-    will consist of an LZMA Properties Header followed by the \r
-    LZMA Compressed Data as shown:\r
-\r
-        [LZMA properties header for file 1]\r
-        [LZMA compressed data for file 1]\r
-\r
-    5.8.6 The LZMA Compressed Data will be stored as provided by the \r
-    LZMA compression library.  Compressed size, uncompressed size and \r
-    other file characteristics about the file being compressed must be \r
-    stored in standard ZIP storage format.\r
-\r
-    5.8.7 The LZMA Properties Header will store specific data required \r
-    to decompress the LZMA compressed Data.  This data is set by the \r
-    LZMA compression engine using the function WriteCoderProperties() \r
-    as documented within the LZMA SDK. \r
-         \r
-    5.8.8 Storage fields for the property information within the LZMA \r
-    Properties Header are as follows:\r
-\r
-         LZMA Version Information 2 bytes\r
-         LZMA Properties Size 2 bytes\r
-         LZMA Properties Data variable, defined by "LZMA Properties Size"\r
-\r
-       5.8.8.1 LZMA Version Information - this field identifies which version \r
-       of the LZMA SDK was used to compress a file.  The first byte will \r
-       store the major version number of the LZMA SDK and the second \r
-       byte will store the minor number.  \r
-\r
-       5.8.8.2 LZMA Properties Size - this field defines the size of the \r
-       remaining property data.  Typically this size should be determined by \r
-       the version of the SDK.  This size field is included as a convenience\r
-       and to help avoid any ambiguity should it arise in the future due\r
-       to changes in this compression algorithm. \r
-\r
-       5.8.8.3 LZMA Property Data - this variable sized field records the \r
-       required values for the decompressor as defined by the LZMA SDK.  \r
-       The data stored in this field should be obtained using the \r
-       WriteCoderProperties() in the version of the SDK defined by \r
-       the "LZMA Version Information" field.  \r
-\r
-       5.8.8.4 The layout of the "LZMA Properties Data" field is a function of \r
-       the LZMA compression algorithm.  It is possible that this layout may be\r
-       changed by the author over time.  The data layout in version 4.3 of the \r
-       LZMA SDK defines a 5 byte array that uses 4 bytes to store the dictionary \r
-       size in little-endian order. This is preceded by a single packed byte as \r
-       the first element of the array that contains the following fields:\r
-\r
-         PosStateBits\r
-         LiteralPosStateBits\r
-         LiteralContextBits\r
-\r
-       Refer to the LZMA documentation for a more detailed explanation of \r
-       these fields.  \r
-\r
-    5.8.9 Data compressed with method 14, LZMA, may include an end-of-stream\r
-    (EOS) marker ending the compressed data stream.  This marker is not\r
-    required, but its use is highly recommended to facilitate processing\r
-    and implementers should include the EOS marker whenever possible.\r
-    When the EOS marker is used, general purpose bit 1 must be set.  If\r
-    general purpose bit 1 is not set, the EOS marker is not present.\r
-\r
-5.9 WavPack - Method 97\r
------------------------\r
-\r
-    5.9.1 Information describing the use of compression method 97 is \r
-    provided by WinZIP International, LLC.  This method relies on the\r
-    open source WavPack audio compression utility developed by David Bryant.  \r
-    Information on WavPack is available at www.wavpack.com.  Please consult \r
-    with the author of this algorithm for information on terms and \r
-    restrictions on use.\r
-\r
-    5.9.2 WavPack data for a file begins immediately after the end of the\r
-    local header data.  This data is the output from WavPack compression\r
-    routines.  Within the ZIP file, the use of WavPack compression is\r
-    indicated by setting the compression method field to a value of 97 \r
-    in both the local header and the central directory header.  The Version \r
-    needed to extract and version made by fields use the same values as are \r
-    used for data compressed using the Deflate algorithm.\r
-\r
-    5.9.3 An implementation note for storing digital sample data when using \r
-    WavPack compression within ZIP files is that all of the bytes of\r
-    the sample data should be compressed.  This includes any unused\r
-    bits up to the byte boundary.  An example is a 2 byte sample that\r
-    uses only 12 bits for the sample data with 4 unused bits.  If only\r
-    12 bits are passed as the sample size to the WavPack routines, the 4 \r
-    unused bits will be set to 0 on extraction regardless of their original \r
-    state.  To avoid this, the full 16 bits of the sample data size\r
-    should be provided. \r
-\r
-5.10 PPMd - Method 98\r
----------------------\r
-\r
-    5.10.1 PPMd is a data compression algorithm developed by Dmitry Shkarin\r
-    which includes a carryless rangecoder developed by Dmitry Subbotin.\r
-    This algorithm is based on predictive phrase matching on multiple\r
-    order contexts.  Information and source code for this algorithm\r
-    can be found on the internet. Consult with the author of this\r
-    algorithm for information on terms or restrictions on use.\r
-\r
-    5.10.2 Support for PPMd within the ZIP format currently is provided only \r
-    for version I, revision 1 of the algorithm.  Storage requirements\r
-    for using this algorithm are as follows:\r
-\r
-    5.10.3 Parameters needed to control the algorithm are stored in the two\r
-    bytes immediately preceding the compressed data.  These bytes are\r
-    used to store the following fields:\r
-\r
-    Model order - sets the maximum model order, default is 8, possible\r
-                  values are from 2 to 16 inclusive\r
-\r
-    Sub-allocator size - sets the size of sub-allocator in MB, default is 50,\r
-                    possible values are from 1MB to 256MB inclusive\r
-\r
-    Model restoration method - sets the method used to restart context\r
-                    model at memory insufficiency, values are:\r
-\r
-                    0 - restarts model from scratch - default\r
-                    1 - cut off model - decreases performance by as much as 2x\r
-                    2 - freeze context tree - not recommended\r
-\r
-    5.10.4 An example for packing these fields into the 2 byte storage field is\r
-    illustrated below.  These values are stored in Intel low-byte/high-byte\r
-    order.\r
-\r
-    wPPMd = (Model order - 1) + \r
-            ((Sub-allocator size - 1) << 4) + \r
-            (Model restoration method << 12)\r
-\r
-\r
-6.0  Traditional PKWARE Encryption\r
-----------------------------------\r
-\r
-    6.0.1 The following information discusses the decryption steps\r
-    required to support traditional PKWARE encryption.  This\r
-    form of encryption is considered weak by today's standards\r
-    and its use is recommended only for situations with\r
-    low security needs or for compatibility with older .ZIP \r
-    applications.\r
-\r
-6.1 Traditional PKWARE Decryption\r
----------------------------------\r
-\r
-    6.1.1 PKWARE is grateful to Mr. Roger Schlafly for his expert \r
-    contribution towards the development of PKWARE's traditional \r
-    encryption.\r
-\r
-    6.1.2 PKZIP encrypts the compressed data stream.  Encrypted files \r
-    must be decrypted before they can be extracted to their original\r
-    form.\r
-\r
-    6.1.3 Each encrypted file has an extra 12 bytes stored at the start \r
-    of the data area defining the encryption header for that file.  The\r
-    encryption header is originally set to random values, and then\r
-    itself encrypted, using three, 32-bit keys.  The key values are\r
-    initialized using the supplied encryption password.  After each byte\r
-    is encrypted, the keys are then updated using pseudo-random number\r
-    generation techniques in combination with the same CRC-32 algorithm\r
-    used in PKZIP and described elsewhere in this document.\r
-\r
-    6.1.4 The following are the basic steps required to decrypt a file:\r
-\r
-    1) Initialize the three 32-bit keys with the password.\r
-    2) Read and decrypt the 12-byte encryption header, further\r
-       initializing the encryption keys.\r
-    3) Read and decrypt the compressed data stream using the\r
-       encryption keys.\r
-\r
-    6.1.5 Initializing the encryption keys\r
-        \r
-    Key(0) <- 305419896\r
-    Key(1) <- 591751049\r
-    Key(2) <- 878082192\r
-\r
-    loop for i <- 0 to length(password)-1\r
-        update_keys(password(i))\r
-    end loop\r
-\r
-    Where update_keys() is defined as:\r
-\r
-    update_keys(char):\r
-      Key(0) <- crc32(key(0),char)\r
-      Key(1) <- Key(1) + (Key(0) & 000000ffH)\r
-      Key(1) <- Key(1) * 134775813 + 1\r
-      Key(2) <- crc32(key(2),key(1) >> 24)\r
-    end update_keys\r
-\r
-    Where crc32(old_crc,char) is a routine that given a CRC value and a\r
-    character, returns an updated CRC value after applying the CRC-32\r
-    algorithm described elsewhere in this document.\r
-\r
-    6.1.6 Decrypting the encryption header\r
-        \r
-    The purpose of this step is to further initialize the encryption\r
-    keys, based on random data, to render a plaintext attack on the\r
-    data ineffective.\r
-\r
-    Read the 12-byte encryption header into Buffer, in locations\r
-    Buffer(0) thru Buffer(11).\r
-\r
-    loop for i <- 0 to 11\r
-        C <- buffer(i) ^ decrypt_byte()\r
-        update_keys(C)\r
-        buffer(i) <- C\r
-    end loop\r
-\r
-    Where decrypt_byte() is defined as:\r
-\r
-    unsigned char decrypt_byte()\r
-        local unsigned short temp\r
-        temp <- Key(2) | 2\r
-        decrypt_byte <- (temp * (temp ^ 1)) >> 8\r
-    end decrypt_byte\r
-\r
-    After the header is decrypted,  the last 1 or 2 bytes in Buffer\r
-    should be the high-order word/byte of the CRC for the file being\r
-    decrypted, stored in Intel low-byte/high-byte order.  Versions of\r
-    PKZIP prior to 2.0 used a 2 byte CRC check; a 1 byte CRC check is\r
-    used on versions after 2.0.  This can be used to test if the password\r
-    supplied is correct or not.\r
-\r
-    6.1.7 Decrypting the compressed data stream\r
-    \r
-    The compressed data stream can be decrypted as follows:\r
-\r
-    loop until done\r
-        read a character into C\r
-        Temp <- C ^ decrypt_byte()\r
-        update_keys(temp)\r
-        output Temp\r
-    end loop\r
-\r
-\r
-7.0 Strong Encryption Specification\r
------------------------------------\r
-\r
-   7.0.1 Portions of the Strong Encryption technology defined in this \r
-   specification are covered under patents and pending patent applications.\r
-   Refer to the section in this document entitled "Incorporating \r
-   PKWARE Proprietary Technology into Your Product" for more information.\r
-\r
-7.1 Strong Encryption Overview\r
-------------------------------\r
-\r
-   7.1.1 Version 5.x of this specification introduced support for strong \r
-   encryption algorithms.  These algorithms can be used with either \r
-   a password or an X.509v3 digital certificate to encrypt each file. \r
-   This format specification supports either password or certificate \r
-   based encryption to meet the security needs of today, to enable \r
-   interoperability between users within both PKI and non-PKI \r
-   environments, and to ensure interoperability between different \r
-   computing platforms that are running a ZIP program.  \r
-\r
-   7.1.2 Password based encryption is the most common form of encryption \r
-   people are familiar with.  However, inherent weaknesses with \r
-   passwords (e.g. susceptibility to dictionary/brute force attack) \r
-   as well as password management and support issues make certificate \r
-   based encryption a more secure and scalable option.  Industry \r
-   efforts and support are defining and moving towards more advanced \r
-   security solutions built around X.509v3 digital certificates and \r
-   Public Key Infrastructures(PKI) because of the greater scalability, \r
-   administrative options, and more robust security over traditional \r
-   password based encryption. \r
-\r
-   7.1.3 Most standard encryption algorithms are supported with this\r
-   specification. Reference implementations for many of these \r
-   algorithms are available from either commercial or open source \r
-   distributors.  Readily available cryptographic toolkits make\r
-   implementation of the encryption features straight-forward.  \r
-   This document is not intended to provide a treatise on data \r
-   encryption principles or theory.  Its purpose is to document the \r
-   data structures required for implementing interoperable data \r
-   encryption within the .ZIP format.  It is strongly recommended that \r
-   you have a good understanding of data encryption before reading \r
-   further.\r
-\r
-   7.1.4 The algorithms introduced in Version 5.0 of this specification \r
-   include:\r
-\r
-      RC2 40 bit, 64 bit, and 128 bit\r
-      RC4 40 bit, 64 bit, and 128 bit\r
-      DES\r
-      3DES 112 bit and 168 bit\r
-  \r
-   Version 5.1 adds support for the following:\r
-\r
-      AES 128 bit, 192 bit, and 256 bit\r
-\r
-\r
-   7.1.5 Version 6.1 introduces encryption data changes to support \r
-   interoperability with Smartcard and USB Token certificate storage \r
-   methods which do not support the OAEP strengthening standard.\r
-\r
-   7.1.6 Version 6.2 introduces support for encrypting metadata by compressing \r
-   and encrypting the central directory data structure to reduce information \r
-   leakage.   Information leakage can occur in legacy ZIP applications \r
-   through exposure of information about a file even though that file is \r
-   stored encrypted.  The information exposed consists of file \r
-   characteristics stored within the records and fields defined by this \r
-   specification.  This includes data such as a file's name, its original \r
-   size, timestamp and CRC32 value. \r
-\r
-   7.1.7 Version 6.3 introduces support for encrypting data using the Blowfish\r
-   and Twofish algorithms.  These are symmetric block ciphers developed \r
-   by Bruce Schneier.  Blowfish supports using a variable length key from \r
-   32 to 448 bits.  Block size is 64 bits.  Implementations should use 16\r
-   rounds and the only mode supported within ZIP files is CBC. Twofish \r
-   supports key sizes 128, 192 and 256 bits.  Block size is 128 bits.  \r
-   Implementations should use 16 rounds and the only mode supported within\r
-   ZIP files is CBC.  Information and source code for both Blowfish and \r
-   Twofish algorithms can be found on the internet.  Consult with the author\r
-   of these algorithms for information on terms or restrictions on use.\r
-\r
-   7.1.8 Central Directory Encryption provides greater protection against \r
-   information leakage by encrypting the Central Directory structure and \r
-   by masking key values that are replicated in the unencrypted Local \r
-   Header.   ZIP compatible programs that cannot interpret an encrypted \r
-   Central Directory structure cannot rely on the data in the corresponding \r
-   Local Header for decompression information.  \r
-\r
-   7.1.9 Extra Field records that may contain information about a file that should \r
-   not be exposed should not be stored in the Local Header and should only \r
-   be written to the Central Directory where they can be encrypted.  This \r
-   design currently does not support streaming.  Information in the End of \r
-   Central Directory record, the Zip64 End of Central Directory Locator, \r
-   and the Zip64 End of Central Directory records are not encrypted.  Access \r
-   to view data on files within a ZIP file with an encrypted Central Directory\r
-   requires the appropriate password or private key for decryption prior to \r
-   viewing any files, or any information about the files, in the archive.  \r
-\r
-   7.1.10 Older ZIP compatible programs not familiar with the Central Directory \r
-   Encryption feature will no longer be able to recognize the Central \r
-   Directory and may assume the ZIP file is corrupt.  Programs that \r
-   attempt streaming access using Local Headers will see invalid \r
-   information for each file.  Central Directory Encryption need not be \r
-   used for every ZIP file.  Its use is recommended for greater security.  \r
-   ZIP files not using Central Directory Encryption should operate as \r
-   in the past. \r
-\r
-   7.1.11 This strong encryption feature specification is intended to provide for \r
-   scalable, cross-platform encryption needs ranging from simple password\r
-   encryption to authenticated public/private key encryption.  \r
-\r
-   7.1.12 Encryption provides data confidentiality and privacy.  It is \r
-   recommended that you combine X.509 digital signing with encryption \r
-   to add authentication and non-repudiation.\r
-\r
-\r
-7.2 Single Password Symmetric Encryption Method\r
------------------------------------------------\r
-\r
-   7.2.1 The Single Password Symmetric Encryption Method using strong    \r
-   encryption algorithms operates similarly to the traditional \r
-   PKWARE encryption defined in this format.  Additional data \r
-   structures are added to support the processing needs of the \r
-   strong algorithms.\r
-\r
-   The Strong Encryption data structures are:\r
-\r
-   7.2.2 General Purpose Bits - Bits 0 and 6 of the General Purpose bit \r
-   flag in both local and central header records.  Both bits set \r
-   indicates strong encryption.  Bit 13, when set indicates the Central\r
-   Directory is encrypted and that selected fields in the Local Header\r
-   are masked to hide their actual value.\r
-\r
-\r
-    7.2.3 Extra Field 0x0017 in central header only.\r
-\r
-    Fields to consider in this record are:\r
-\r
-       7.2.3.1 Format - the data format identifier for this record.  The only\r
-       value allowed at this time is the integer value 2.\r
-\r
-       7.2.3.2 AlgId - integer identifier of the encryption algorithm from the\r
-       following range\r
-\r
-                 0x6601 - DES\r
-                 0x6602 - RC2 (version needed to extract < 5.2)\r
-                 0x6603 - 3DES 168\r
-                 0x6609 - 3DES 112\r
-                 0x660E - AES 128 \r
-                 0x660F - AES 192 \r
-                 0x6610 - AES 256 \r
-                 0x6702 - RC2 (version needed to extract >= 5.2)\r
-                 0x6720 - Blowfish\r
-                 0x6721 - Twofish\r
-                 0x6801 - RC4\r
-                 0xFFFF - Unknown algorithm\r
-\r
-       7.2.3.3 Bitlen - Explicit bit length of key\r
-\r
-                 32 - 448 bits\r
-           \r
-       7.2.3.4 Flags - Processing flags needed for decryption\r
-\r
-                 0x0001 - Password is required to decrypt\r
-                 0x0002 - Certificates only\r
-                 0x0003 - Password or certificate required to decrypt\r
-\r
-                 Values > 0x0003 reserved for certificate processing\r
-\r
-\r
-   7.2.4 Decryption header record preceding compressed file data.\r
-\r
-                 -Decryption Header:\r
-\r
-                  Value     Size     Description\r
-                  -----     ----     -----------\r
-                  IVSize    2 bytes  Size of initialization vector (IV)\r
-                  IVData    IVSize   Initialization vector for this file\r
-                  Size      4 bytes  Size of remaining decryption header data\r
-                  Format    2 bytes  Format definition for this record\r
-                  AlgID     2 bytes  Encryption algorithm identifier\r
-                  Bitlen    2 bytes  Bit length of encryption key\r
-                  Flags     2 bytes  Processing flags\r
-                  ErdSize   2 bytes  Size of Encrypted Random Data\r
-                  ErdData   ErdSize  Encrypted Random Data\r
-                  Reserved1 4 bytes  Reserved certificate processing data\r
-                  Reserved2 (var)    Reserved for certificate processing data\r
-                  VSize     2 bytes  Size of password validation data\r
-                  VData     VSize-4  Password validation data\r
-                  VCRC32    4 bytes  Standard ZIP CRC32 of password validation data\r
-\r
-       7.2.4.1 IVData - The size of the IV should match the algorithm block size.\r
-       The IVData can be completely random data.  If the size of\r
-       the randomly generated data does not match the block size\r
-       it should be complemented with zero's or truncated as\r
-       necessary.  If IVSize is 0,then IV = CRC32 + Uncompressed\r
-       File Size (as a 64 bit little-endian, unsigned integer value).\r
-\r
-       7.2.4.2 Format - the data format identifier for this record.  The only\r
-       value allowed at this time is the integer value 3.\r
-\r
-       7.2.4.3 AlgId - integer identifier of the encryption algorithm from the\r
-       following range\r
-\r
-                     0x6601 - DES\r
-                     0x6602 - RC2 (version needed to extract < 5.2)\r
-                     0x6603 - 3DES 168\r
-                     0x6609 - 3DES 112\r
-                     0x660E - AES 128 \r
-                     0x660F - AES 192 \r
-                     0x6610 - AES 256 \r
-                     0x6702 - RC2 (version needed to extract >= 5.2)\r
-                     0x6720 - Blowfish\r
-                     0x6721 - Twofish\r
-                     0x6801 - RC4\r
-                     0xFFFF - Unknown algorithm\r
-\r
-        7.2.4.4 Bitlen - Explicit bit length of key\r
-\r
-                     32 - 448 bits\r
-               \r
-        7.2.4.5 Flags - Processing flags needed for decryption\r
-\r
-                     0x0001 - Password is required to decrypt\r
-                     0x0002 - Certificates only\r
-                     0x0003 - Password or certificate required to decrypt\r
-\r
-                     Values > 0x0003 reserved for certificate processing\r
-\r
-        7.2.4.6 ErdData - Encrypted random data is used to store random data that\r
-        is used to generate a file session key for encrypting \r
-        each file.  SHA1 is used to calculate hash data used to \r
-        derive keys.  File session keys are derived from a master \r
-        session key generated from the user-supplied password.\r
-        If the Flags field in the decryption header contains \r
-        the value 0x4000, then the ErdData field must be \r
-        decrypted using 3DES. If the value 0x4000 is not set,\r
-        then the ErdData field must be decrypted using AlgId.\r
-\r
-\r
-        7.2.4.7 Reserved1 - Reserved for certificate processing, if value is\r
-        zero, then Reserved2 data is absent.  See the explanation\r
-        under the Certificate Processing Method for details on\r
-        this data structure.\r
-\r
-        7.2.4.8 Reserved2 - If present, the size of the Reserved2 data structure \r
-        is located by skipping the first 4 bytes of this field \r
-        and using the next 2 bytes as the remaining size.  See\r
-        the explanation under the Certificate Processing Method\r
-        for details on this data structure.\r
-\r
-        7.2.4.9 VSize - This size value will always include the 4 bytes of the\r
-        VCRC32 data and will be greater than 4 bytes.\r
-\r
-        7.2.4.10 VData - Random data for password validation.  This data is VSize\r
-        in length and VSize must be a multiple of the encryption\r
-        block size.  VCRC32 is a checksum value of VData.  \r
-        VData and VCRC32 are stored encrypted and start the\r
-        stream of encrypted data for a file.\r
-\r
-\r
-    7.2.5 Useful Tips\r
-\r
-        7.2.5.1 Strong Encryption is always applied to a file after compression. The\r
-        block oriented algorithms all operate in Cypher Block Chaining (CBC) \r
-        mode.  The block size used for AES encryption is 16.  All other block\r
-        algorithms use a block size of 8.  Two IDs are defined for RC2 to \r
-        account for a discrepancy found in the implementation of the RC2\r
-        algorithm in the cryptographic library on Windows XP SP1 and all \r
-        earlier versions of Windows.  It is recommended that zero length files\r
-        not be encrypted, however programs should be prepared to extract them\r
-        if they are found within a ZIP file.\r
-\r
-        7.2.5.2 A pseudo-code representation of the encryption process is as follows:\r
-\r
-            Password = GetUserPassword()\r
-            MasterSessionKey = DeriveKey(SHA1(Password)) \r
-            RD = CryptographicStrengthRandomData() \r
-            For Each File\r
-               IV = CryptographicStrengthRandomData() \r
-               VData = CryptographicStrengthRandomData()\r
-               VCRC32 = CRC32(VData)\r
-               FileSessionKey = DeriveKey(SHA1(IV + RD) \r
-               ErdData = Encrypt(RD,MasterSessionKey,IV) \r
-               Encrypt(VData + VCRC32 + FileData, FileSessionKey,IV)\r
-            Done\r
-\r
-        7.2.5.3 The function names and parameter requirements will depend on\r
-        the choice of the cryptographic toolkit selected.  Almost any\r
-        toolkit supporting the reference implementations for each\r
-        algorithm can be used.  The RSA BSAFE(r), OpenSSL, and Microsoft\r
-        CryptoAPI libraries are all known to work well.  \r
-\r
-\r
- 7.3 Single Password - Central Directory Encryption\r
- --------------------------------------------------\r
-        \r
-    7.3.1 Central Directory Encryption is achieved within the .ZIP format by \r
-    encrypting the Central Directory structure.  This encapsulates the metadata \r
-    most often used for processing .ZIP files.  Additional metadata is stored for \r
-    redundancy in the Local Header for each file.  The process of concealing \r
-    metadata by encrypting the Central Directory does not protect the data within \r
-    the Local Header.  To avoid information leakage from the exposed metadata \r
-    in the Local Header, the fields containing information about a file are masked.  \r
-\r
-    7.3.2 Local Header\r
-\r
-    Masking replaces the true content of the fields for a file in the Local \r
-    Header with false information.  When masked, the Local Header is not \r
-    suitable for streaming access and the options for data recovery of damaged\r
-    archives is reduced.  Extra Data fields that may contain confidential\r
-    data should not be stored within the Local Header.  The value set into\r
-    the Version needed to extract field should be the correct value needed to\r
-    extract the file without regard to Central Directory Encryption. The fields \r
-    within the Local Header targeted for masking when the Central Directory is \r
-    encrypted are:\r
-\r
-            Field Name                     Mask Value\r
-            ------------------             ---------------------------\r
-            compression method              0\r
-            last mod file time              0\r
-            last mod file date              0\r
-            crc-32                          0\r
-            compressed size                 0\r
-            uncompressed size               0\r
-            file name (variable size)       Base 16 value from the\r
-                                            range 1 - 0xFFFFFFFFFFFFFFFF\r
-                                            represented as a string whose\r
-                                            size will be set into the\r
-                                            file name length field\r
-\r
-    The Base 16 value assigned as a masked file name is simply a sequentially\r
-    incremented value for each file starting with 1 for the first file.  \r
-    Modifications to a ZIP file may cause different values to be stored for \r
-    each file.  For compatibility, the file name field in the Local Header \r
-    should never be left blank.  As of Version 6.2 of this specification, \r
-    the Compression Method and Compressed Size fields are not yet masked.\r
-    Fields having a value of 0xFFFF or 0xFFFFFFFF for the ZIP64 format\r
-    should not be masked.  \r
-\r
-    7.3.3 Encrypting the Central Directory\r
-\r
-    Encryption of the Central Directory does not include encryption of the \r
-    Central Directory Signature data, the Zip64 End of Central Directory\r
-    record, the Zip64 End of Central Directory Locator, or the End\r
-    of Central Directory record.  The ZIP file comment data is never\r
-    encrypted.\r
-\r
-    Before encrypting the Central Directory, it may optionally be compressed.\r
-    Compression is not required, but for storage efficiency it is assumed\r
-    this structure will be compressed before encrypting.  Similarly, this \r
-    specification supports compressing the Central Directory without\r
-    requiring that it also be encrypted.  Early implementations of this\r
-    feature will assume the encryption method applied to files matches the \r
-    encryption applied to the Central Directory.\r
-\r
-    Encryption of the Central Directory is done in a manner similar to\r
-    that of file encryption.  The encrypted data is preceded by a \r
-    decryption header.  The decryption header is known as the Archive\r
-    Decryption Header.  The fields of this record are identical to\r
-    the decryption header preceding each encrypted file.  The location\r
-    of the Archive Decryption Header is determined by the value in the\r
-    Start of the Central Directory field in the Zip64 End of Central\r
-    Directory record.  When the Central Directory is encrypted, the\r
-    Zip64 End of Central Directory record will always be present.\r
-\r
-    The layout of the Zip64 End of Central Directory record for all\r
-    versions starting with 6.2 of this specification will follow the\r
-    Version 2 format.  The Version 2 format is as follows:\r
-\r
-    The leading fixed size fields within the Version 1 format for this\r
-    record remain unchanged.  The record signature for both Version 1 \r
-    and Version 2 will be 0x06064b50.  Immediately following the last\r
-    byte of the field known as the Offset of Start of Central \r
-    Directory With Respect to the Starting Disk Number will begin the \r
-    new fields defining Version 2 of this record.  \r
-\r
-    7.3.4 New fields for Version 2\r
-\r
-    Note: all fields stored in Intel low-byte/high-byte order.\r
-\r
-              Value                 Size       Description\r
-              -----                 ----       -----------\r
-              Compression Method    2 bytes    Method used to compress the\r
-                                               Central Directory\r
-              Compressed Size       8 bytes    Size of the compressed data\r
-              Original   Size       8 bytes    Original uncompressed size\r
-              AlgId                 2 bytes    Encryption algorithm ID\r
-              BitLen                2 bytes    Encryption key length\r
-              Flags                 2 bytes    Encryption flags\r
-              HashID                2 bytes    Hash algorithm identifier\r
-              Hash Length           2 bytes    Length of hash data\r
-              Hash Data             (variable) Hash data\r
-\r
-     The Compression Method accepts the same range of values as the \r
-     corresponding field in the Central Header.\r
-\r
-     The Compressed Size and Original Size values will not include the\r
-     data of the Central Directory Signature which is compressed or\r
-     encrypted.\r
-\r
-     The AlgId, BitLen, and Flags fields accept the same range of values\r
-     the corresponding fields within the 0x0017 record. \r
-\r
-     Hash ID identifies the algorithm used to hash the Central Directory \r
-     data.  This data does not have to be hashed, in which case the\r
-     values for both the HashID and Hash Length will be 0.  Possible \r
-     values for HashID are:\r
-\r
-              Value         Algorithm\r
-             ------         ---------\r
-             0x0000          none\r
-             0x0001          CRC32\r
-             0x8003          MD5\r
-             0x8004          SHA1\r
-             0x8007          RIPEMD160\r
-             0x800C          SHA256\r
-             0x800D          SHA384\r
-             0x800E          SHA512\r
-\r
-     7.3.5 When the Central Directory data is signed, the same hash algorithm\r
-     used to hash the Central Directory for signing should be used.\r
-     This is recommended for processing efficiency, however, it is \r
-     permissible for any of the above algorithms to be used independent \r
-     of the signing process.\r
-\r
-     The Hash Data will contain the hash data for the Central Directory.\r
-     The length of this data will vary depending on the algorithm used.\r
-\r
-     The Version Needed to Extract should be set to 62.\r
-\r
-     The value for the Total Number of Entries on the Current Disk will\r
-     be 0.  These records will no longer support random access when\r
-     encrypting the Central Directory.\r
-\r
-     7.3.6 When the Central Directory is compressed and/or encrypted, the\r
-     End of Central Directory record will store the value 0xFFFFFFFF\r
-     as the value for the Total Number of Entries in the Central\r
-     Directory.  The value stored in the Total Number of Entries in\r
-     the Central Directory on this Disk field will be 0.  The actual\r
-     values will be stored in the equivalent fields of the Zip64\r
-     End of Central Directory record.\r
-\r
-     7.3.7 Decrypting and decompressing the Central Directory is accomplished\r
-     in the same manner as decrypting and decompressing a file.\r
-\r
- 7.4 Certificate Processing Method\r
- ---------------------------------\r
-\r
-    The Certificate Processing Method for ZIP file encryption \r
-    defines the following additional data fields:\r
-\r
-    7.4.1 Certificate Flag Values\r
-\r
-    Additional processing flags that can be present in the Flags field of both \r
-    the 0x0017 field of the central directory Extra Field and the Decryption \r
-    header record preceding compressed file data are:\r
-\r
-         0x0007 - reserved for future use\r
-         0x000F - reserved for future use\r
-         0x0100 - Indicates non-OAEP key wrapping was used.  If this\r
-                  this field is set, the version needed to extract must\r
-                  be at least 61.  This means OAEP key wrapping is not\r
-                  used when generating a Master Session Key using\r
-                  ErdData.\r
-         0x4000 - ErdData must be decrypted using 3DES-168, otherwise use the\r
-                  same algorithm used for encrypting the file contents.\r
-         0x8000 - reserved for future use\r
-\r
-\r
-    7.4.2 CertData - Extra Field 0x0017 record certificate data structure\r
-\r
-    The data structure used to store certificate data within the section\r
-    of the Extra Field defined by the CertData field of the 0x0017\r
-    record are as shown:\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          RCount    4 bytes  Number of recipients.  \r
-          HashAlg   2 bytes  Hash algorithm identifier\r
-          HSize     2 bytes  Hash size\r
-          SRList    (var)    Simple list of recipients hashed public keys\r
-\r
-                          \r
-         RCount    This defines the number intended recipients whose \r
-                   public keys were used for encryption.  This identifies\r
-                   the number of elements in the SRList.\r
-\r
-         HashAlg   This defines the hash algorithm used to calculate\r
-                   the public key hash of each public key used\r
-                   for encryption. This field currently supports\r
-                   only the following value for SHA-1\r
-\r
-                   0x8004 - SHA1\r
-\r
-         HSize     This defines the size of a hashed public key.\r
-\r
-         SRList    This is a variable length list of the hashed \r
-                   public keys for each intended recipient.  Each \r
-                   element in this list is HSize.  The total size of \r
-                   SRList is determined using RCount * HSize.\r
-\r
-\r
-    7.4.3 Reserved1 - Certificate Decryption Header Reserved1 Data\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          RCount    4 bytes  Number of recipients.  \r
-                      \r
-          RCount   This defines the number intended recipients whose \r
-                   public keys were used for encryption.  This defines\r
-                   the number of elements in the REList field defined below.\r
-\r
-\r
-    7.4.4 Reserved2 - Certificate Decryption Header Reserved2 Data Structures\r
-\r
-\r
-          Value     Size     Description\r
-          -----     ----     -----------\r
-          HashAlg   2 bytes  Hash algorithm identifier\r
-          HSize     2 bytes  Hash size\r
-          REList    (var)    List of recipient data elements\r
-\r
-\r
-         HashAlg   This defines the hash algorithm used to calculate\r
-                   the public key hash of each public key used\r
-                   for encryption. This field currently supports\r
-                   only the following value for SHA-1\r
-\r
-                       0x8004 - SHA1\r
-\r
-         HSize     This defines the size of a hashed public key\r
-                   defined in REHData.\r
-\r
-         REList    This is a variable length of list of recipient data.  \r
-                   Each element in this list consists of a Recipient\r
-                   Element data structure as follows:\r
-\r
-\r
-        Recipient Element (REList) Data Structure:\r
-\r
-              Value     Size     Description\r
-              -----     ----     -----------\r
-              RESize    2 bytes  Size of REHData + REKData\r
-              REHData   HSize    Hash of recipients public key\r
-              REKData   (var)    Simple key blob\r
-\r
-\r
-             RESize    This defines the size of an individual REList \r
-                       element.  This value is the combined size of the\r
-                       REHData field + REKData field.  REHData is defined by\r
-                       HSize.  REKData is variable and can be calculated\r
-                       for each REList element using RESize and HSize.\r
-\r
-             REHData   Hashed public key for this recipient.\r
-\r
-             REKData   Simple Key Blob.  The format of this data structure\r
-                       is identical to that defined in the Microsoft\r
-                       CryptoAPI and generated using the CryptExportKey()\r
-                       function.  The version of the Simple Key Blob\r
-                       supported at this time is 0x02 as defined by\r
-                       Microsoft.\r
-\r
-7.5 Certificate Processing - Central Directory Encryption\r
----------------------------------------------------------\r
-        \r
-    7.5.1 Central Directory Encryption using Digital Certificates will \r
-    operate in a manner similar to that of Single Password Central\r
-    Directory Encryption.  This record will only be present when there \r
-    is data to place into it.  Currently, data is placed into this\r
-    record when digital certificates are used for either encrypting \r
-    or signing the files within a ZIP file.  When only password \r
-    encryption is used with no certificate encryption or digital \r
-    signing, this record is not currently needed. When present, this \r
-    record will appear before the start of the actual Central Directory \r
-    data structure and will be located immediately after the Archive \r
-    Decryption Header if the Central Directory is encrypted.\r
-\r
-    7.5.2 The Archive Extra Data record will be used to store the following\r
-    information.  Additional data may be added in future versions.\r
-\r
-    Extra Data Fields:\r
-\r
-    0x0014 - PKCS#7 Store for X.509 Certificates\r
-    0x0016 - X.509 Certificate ID and Signature for central directory\r
-    0x0019 - PKCS#7 Encryption Recipient Certificate List\r
-\r
-    The 0x0014 and 0x0016 Extra Data records that otherwise would be \r
-    located in the first record of the Central Directory for digital \r
-    certificate processing. When encrypting or compressing the Central \r
-    Directory, the 0x0014 and 0x0016 records must be located in the \r
-    Archive Extra Data record and they should not remain in the first \r
-    Central Directory record.  The Archive Extra Data record will also \r
-    be used to store the 0x0019 data. \r
-\r
-    7.5.3 When present, the size of the Archive Extra Data record will be\r
-    included in the size of the Central Directory.  The data of the\r
-    Archive Extra Data record will also be compressed and encrypted\r
-    along with the Central Directory data structure.\r
-\r
-7.6 Certificate Processing Differences\r
---------------------------------------\r
-\r
-    7.6.1 The Certificate Processing Method of encryption differs from the\r
-    Single Password Symmetric Encryption Method as follows.  Instead\r
-    of using a user-defined password to generate a master session key,\r
-    cryptographically random data is used.  The key material is then\r
-    wrapped using standard key-wrapping techniques.  This key material\r
-    is wrapped using the public key of each recipient that will need\r
-    to decrypt the file using their corresponding private key.\r
-\r
-    7.6.2 This specification currently assumes digital certificates will follow\r
-    the X.509 V3 format for 1024 bit and higher RSA format digital\r
-    certificates.  Implementation of this Certificate Processing Method\r
-    requires supporting logic for key access and management.  This logic\r
-    is outside the scope of this specification.\r
-\r
-7.7 OAEP Processing with Certificate-based Encryption\r
------------------------------------------------------\r
-\r
-    7.7.1 OAEP stands for Optimal Asymmetric Encryption Padding.  It is a\r
-    strengthening technique used for small encoded items such as decryption\r
-    keys.  This is commonly applied in cryptographic key-wrapping techniques\r
-    and is supported by PKCS #1.  Versions 5.0 and 6.0 of this specification \r
-    were designed to support OAEP key-wrapping for certificate-based \r
-    decryption keys for additional security.  \r
-\r
-    7.7.2 Support for private keys stored on Smartcards or Tokens introduced\r
-    a conflict with this OAEP logic.  Most card and token products do \r
-    not support the additional strengthening applied to OAEP key-wrapped \r
-    data.  In order to resolve this conflict, versions 6.1 and above of this \r
-    specification will no longer support OAEP when encrypting using \r
-    digital certificates. \r
-\r
-    7.7.3 Versions of PKZIP available during initial development of the \r
-    certificate processing method set a value of 61 into the \r
-    version needed to extract field for a file.  This indicates that \r
-    non-OAEP key wrapping is used.  This affects certificate encryption \r
-    only, and password encryption functions should not be affected by \r
-    this value.  This means values of 61 may be found on files encrypted\r
-    with certificates only, or on files encrypted with both password\r
-    encryption and certificate encryption.  Files encrypted with both\r
-    methods can safely be decrypted using the password methods documented.\r
-\r
-8.0  Splitting and Spanning ZIP files\r
--------------------------------------\r
-\r
-    8.1 Spanned ZIP files\r
-\r
-      8.1.1 Spanning is the process of segmenting a ZIP file across \r
-      multiple removable media. This support has typically only \r
-      been provided for DOS formatted floppy diskettes. \r
-\r
-    8.2 Split ZIP files\r
-\r
-      8.2.1 File splitting is a newer derivation of spanning.  \r
-      Splitting follows the same segmentation process as\r
-      spanning, however, it does not require writing each\r
-      segment to a unique removable medium and instead supports\r
-      placing all pieces onto local or non-removable locations\r
-      such as file systems, local drives, folders, etc.\r
-\r
-    8.3  File Naming Differences\r
-\r
-      8.3.1 A key difference between spanned and split ZIP files is\r
-      that all pieces of a spanned ZIP file have the same name.  \r
-      Since each piece is written to a separate volume, no name \r
-      collisions occur and each segment can reuse the original \r
-      .ZIP file name given to the archive.\r
-\r
-      8.3.2 Sequence ordering for DOS spanned archives uses the DOS \r
-      volume label to determine segment numbers.  Volume labels\r
-      for each segment are written using the form PKBACK#xxx, \r
-      where xxx is the segment number written as a decimal \r
-      value from 001 - nnn.\r
-\r
-      8.3.3 Split ZIP files are typically written to the same location\r
-      and are subject to name collisions if the spanned name\r
-      format is used since each segment will reside on the same \r
-      drive. To avoid name collisions, split archives are named \r
-      as follows.\r
-\r
-      Segment 1   = filename.z01\r
-      Segment n-1 = filename.z(n-1)\r
-      Segment n   = filename.zip\r
-\r
-      8.3.4 The .ZIP extension is used on the last segment to support\r
-      quickly reading the central directory.  The segment number\r
-      n should be a decimal value.\r
-        \r
-    8.4  Spanned Self-extracting ZIP Files\r
-        \r
-      8.4.1 Spanned ZIP files may be PKSFX Self-extracting ZIP files.\r
-      PKSFX files may also be split, however, in this case\r
-      the first segment must be named filename.exe.  The first\r
-      segment of a split PKSFX archive must be large enough to\r
-      include the entire executable program.\r
-\r
-    8.5  Capacities and Markers\r
-        \r
-      8.5.1 Capacities for split archives are as follows:\r
-\r
-      Maximum number of segments = 4,294,967,295 - 1\r
-      Maximum .ZIP segment size = 4,294,967,295 bytes\r
-      Minimum segment size = 64K\r
-      Maximum PKSFX segment size = 2,147,483,647 bytes\r
-          \r
-      8.5.2 Segment sizes may be different however by convention, all \r
-      segment sizes should be the same with the exception of the \r
-      last, which may be smaller.  Local and central directory \r
-      header records must never be split across a segment boundary. \r
-      When writing a header record, if the number of bytes remaining \r
-      within a segment is less than the size of the header record,\r
-      end the current segment and write the header at the start\r
-      of the next segment.  The central directory may span segment\r
-      boundaries, but no single record in the central directory\r
-      should be split across segments.\r
-\r
-      8.5.3 Spanned/Split archives created using PKZIP for Windows\r
-      (V2.50 or greater), PKZIP Command Line (V2.50 or greater),\r
-      or PKZIP Explorer will include a special spanning \r
-      signature as the first 4 bytes of the first segment of\r
-      the archive.  This signature (0x08074b50) will be \r
-      followed immediately by the local header signature for\r
-      the first file in the archive.  \r
-\r
-      8.5.4 A special spanning marker may also appear in spanned/split \r
-      archives if the spanning or splitting process starts but \r
-      only requires one segment.  In this case the 0x08074b50 \r
-      signature will be replaced with the temporary spanning \r
-      marker signature of 0x30304b50.  Split archives can\r
-      only be uncompressed by other versions of PKZIP that\r
-      know how to create a split archive.\r
-\r
-      8.5.5 The signature value 0x08074b50 is also used by some\r
-      ZIP implementations as a marker for the Data Descriptor \r
-      record.  Conflict in this alternate assignment can be\r
-      avoided by ensuring the position of the signature\r
-      within the ZIP file to determine the use for which it\r
-      is intended.  \r
-\r
-9.0 Change Process\r
-------------------\r
-\r
-   9.1 In order for the .ZIP file format to remain a viable technology, this\r
-   specification should be considered as open for periodic review and\r
-   revision.  Although this format was originally designed with a \r
-   certain level of extensibility, not all changes in technology\r
-   (present or future) were or will be necessarily considered in its\r
-   design.  \r
-\r
-   9.2 If your application requires new definitions to the\r
-   extensible sections in this format, or if you would like to \r
-   submit new data structures or new capabilities, please forward \r
-   your request to zipformat@pkware.com.  All submissions will be \r
-   reviewed by the ZIP File Specification Committee for possible \r
-   inclusion into future versions of this specification.  \r
-\r
-   9.3 Periodic revisions to this specification will be published as\r
-   DRAFT or as FINAL status to ensure interoperability. We encourage \r
-   comments and feedback that may help improve clarity or content.\r
-\r
-\r
-10.0 Incorporating PKWARE Proprietary Technology into Your Product\r
-------------------------------------------------------------------\r
-\r
-   10.1 The Use or Implementation in a product of APPNOTE technological \r
-   components pertaining to either strong encryption or patching requires \r
-   a separate, executed license agreement from PKWARE. Please contact \r
-   PKWARE at zipformat@pkware.com or +1-414-289-9788 with regard to \r
-   acquiring such a license.\r
-\r
-   10.2 Additional information regarding PKWARE proprietray technology is \r
-   available at http://www.pkware.com/appnote.\r
-\r
-11.0 Acknowledgements\r
----------------------\r
-\r
-   In addition to the above mentioned contributors to PKZIP and PKUNZIP,\r
-   PKWARE would like to extend special thanks to Robert Mahoney for \r
-   suggesting the extension .ZIP for this software.\r
-\r
-12.0 References\r
----------------\r
-\r
-   Fiala, Edward R., and Greene, Daniel H., "Data compression with\r
-      finite windows",  Communications of the ACM, Volume 32, Number 4,\r
-      April 1989, pages 490-505.\r
-\r
-   Held, Gilbert, "Data Compression, Techniques and Applications,\r
-      Hardware and Software Considerations", John Wiley & Sons, 1987.\r
-\r
-   Huffman, D.A., "A method for the construction of minimum-redundancy\r
-      codes", Proceedings of the IRE, Volume 40, Number 9, September 1952,\r
-      pages 1098-1101.\r
-\r
-   Nelson, Mark, "LZW Data Compression", Dr. Dobbs Journal, Volume 14,\r
-      Number 10, October 1989, pages 29-37.\r
-\r
-   Nelson, Mark, "The Data Compression Book",  M&T Books, 1991.\r
-\r
-   Storer, James A., "Data Compression, Methods and Theory",\r
-      Computer Science Press, 1988\r
-\r
-   Welch, Terry, "A Technique for High-Performance Data Compression",\r
-      IEEE Computer, Volume 17, Number 6, June 1984, pages 8-19.\r
-\r
-   Ziv, J. and Lempel, A., "A universal algorithm for sequential data\r
-      compression", Communications of the ACM, Volume 30, Number 6,\r
-       June 1987, pages 520-540.\r
-\r
-   Ziv, J. and Lempel, A., "Compression of individual sequences via\r
-      variable-rate coding", IEEE Transactions on Information Theory,\r
-      Volume 24, Number 5, September 1978, pages 530-536.\r
-\r
-\r
-APPENDIX A - AS/400 Extra Field (0x0065) Attribute Definitions\r
---------------------------------------------------------------\r
-\r
-A.1 Field Definition Structure:\r
-\r
-   a. field length including length             2 bytes\r
-   b. field code                                2 bytes\r
-   c. data                                      x bytes\r
-\r
-A.2 Field Code  Description\r
-\r
-   4001     Source type i.e. CLP etc\r
-   4002     The text description of the library \r
-   4003     The text description of the file\r
-   4004     The text description of the member\r
-   4005     x'F0' or 0 is PF-DTA,  x'F1' or 1 is PF_SRC\r
-   4007     Database Type Code                  1 byte\r
-   4008     Database file and fields definition\r
-   4009     GZIP file type                      2 bytes\r
-   400B     IFS code page                       2 bytes\r
-   400C     IFS Creation Time                   4 bytes\r
-   400D     IFS Access Time                     4 bytes\r
-   400E     IFS Modification time               4 bytes\r
-   005C     Length of the records in the file   2 bytes\r
-   0068     GZIP two words                      8 bytes\r
-\r
-APPENDIX B - z/OS Extra Field (0x0065) Attribute Definitions\r
-------------------------------------------------------------\r
-\r
-B.1 Field Definition Structure:\r
-\r
-   a. field length including length             2 bytes\r
-   b. field code                                2 bytes\r
-   c. data                                      x bytes\r
-\r
-B.2 Field Code  Description\r
-\r
-   0001     File Type                           2 bytes \r
-   0002     NonVSAM Record Format               1 byte\r
-   0003     Reserved                \r
-   0004     NonVSAM Block Size                  2 bytes Big Endian\r
-   0005     Primary Space Allocation            3 bytes Big Endian\r
-   0006     Secondary Space Allocation          3 bytes Big Endian\r
-   0007     Space Allocation Type1 byte flag                \r
-   0008     Modification Date                   Retired with PKZIP 5.0 +\r
-   0009     Expiration Date                     Retired with PKZIP 5.0 +\r
-   000A     PDS Directory Block Allocation      3 bytes Big Endian binary value\r
-   000B     NonVSAM Volume List                 variable                \r
-   000C     UNIT Reference                      Retired with PKZIP 5.0 +\r
-   000D     DF/SMS Management Class             8 bytes EBCDIC Text Value\r
-   000E     DF/SMS Storage Class                8 bytes EBCDIC Text Value\r
-   000F     DF/SMS Data Class                   8 bytes EBCDIC Text Value\r
-   0010     PDS/PDSE Member Info.               30 bytes        \r
-   0011     VSAM sub-filetype                   2 bytes                \r
-   0012     VSAM LRECL                          13 bytes EBCDIC "(num_avg num_max)"\r
-   0013     VSAM Cluster Name                   Retired with PKZIP 5.0 +\r
-   0014     VSAM KSDS Key Information           13 bytes EBCDIC "(num_length num_position)"\r
-   0015     VSAM Average LRECL                  5 bytes EBCDIC num_value padded with blanks\r
-   0016     VSAM Maximum LRECL                  5 bytes EBCDIC num_value padded with blanks\r
-   0017     VSAM KSDS Key Length                5 bytes EBCDIC num_value padded with blanks\r
-   0018     VSAM KSDS Key Position              5 bytes EBCDIC num_value padded with blanks\r
-   0019     VSAM Data Name                      1-44 bytes EBCDIC text string\r
-   001A     VSAM KSDS Index Name                1-44 bytes EBCDIC text string\r
-   001B     VSAM Catalog Name                   1-44 bytes EBCDIC text string\r
-   001C     VSAM Data Space Type                9 bytes EBCDIC text string\r
-   001D     VSAM Data Space Primary             9 bytes EBCDIC num_value left-justified\r
-   001E     VSAM Data Space Secondary           9 bytes EBCDIC num_value left-justified\r
-   001F     VSAM Data Volume List               variable EBCDIC text list of 6-character Volume IDs\r
-   0020     VSAM Data Buffer Space              8 bytes EBCDIC num_value left-justified\r
-   0021     VSAM Data CISIZE                    5 bytes EBCDIC num_value left-justified\r
-   0022     VSAM Erase Flag                     1 byte flag                \r
-   0023     VSAM Free CI %                      3 bytes EBCDIC num_value left-justified\r
-   0024     VSAM Free CA %                      3 bytes EBCDIC num_value left-justified\r
-   0025     VSAM Index Volume List              variable EBCDIC text list of 6-character Volume IDs\r
-   0026     VSAM Ordered Flag                   1 byte flag                \r
-   0027     VSAM REUSE Flag                     1 byte flag                \r
-   0028     VSAM SPANNED Flag                   1 byte flag                \r
-   0029     VSAM Recovery Flag                  1 byte flag                \r
-   002A     VSAM  WRITECHK  Flag                1 byte flag                \r
-   002B     VSAM Cluster/Data SHROPTS           3 bytes EBCDIC "n,y"        \r
-   002C     VSAM Index SHROPTS                  3 bytes EBCDIC "n,y"        \r
-   002D     VSAM Index Space Type               9 bytes EBCDIC text string\r
-   002E     VSAM Index Space Primary            9 bytes EBCDIC num_value left-justified\r
-   002F     VSAM Index Space Secondary          9 bytes EBCDIC num_value left-justified\r
-   0030     VSAM Index CISIZE                   5 bytes EBCDIC num_value left-justified\r
-   0031     VSAM Index IMBED                    1 byte flag                \r
-   0032     VSAM Index Ordered Flag             1 byte flag                \r
-   0033     VSAM REPLICATE Flag                 1 byte flag                \r
-   0034     VSAM Index REUSE Flag               1 byte flag                \r
-   0035     VSAM Index WRITECHK Flag            1 byte flag Retired with PKZIP 5.0 +\r
-   0036     VSAM Owner                          8 bytes EBCDIC text string\r
-   0037     VSAM Index Owner                    8 bytes EBCDIC text string\r
-   0038     Reserved\r
-   0039     Reserved\r
-   003A     Reserved\r
-   003B     Reserved\r
-   003C     Reserved\r
-   003D     Reserved\r
-   003E     Reserved\r
-   003F     Reserved\r
-   0040     Reserved\r
-   0041     Reserved\r
-   0042     Reserved\r
-   0043     Reserved\r
-   0044     Reserved\r
-   0045     Reserved\r
-   0046     Reserved\r
-   0047     Reserved\r
-   0048     Reserved\r
-   0049     Reserved\r
-   004A     Reserved\r
-   004B     Reserved\r
-   004C     Reserved\r
-   004D     Reserved\r
-   004E     Reserved\r
-   004F     Reserved\r
-   0050     Reserved\r
-   0051     Reserved\r
-   0052     Reserved\r
-   0053     Reserved\r
-   0054     Reserved\r
-   0055     Reserved\r
-   0056     Reserved\r
-   0057     Reserved\r
-   0058     PDS/PDSE Member TTR Info.           6 bytes  Big Endian\r
-   0059     PDS 1st LMOD Text TTR               3 bytes  Big Endian\r
-   005A     PDS LMOD EP Rec #                   4 bytes  Big Endian\r
-   005B     Reserved\r
-   005C     Max Length of records               2 bytes  Big Endian\r
-   005D     PDSE Flag                           1 byte flag\r
-   005E     Reserved\r
-   005F     Reserved\r
-   0060     Reserved\r
-   0061     Reserved\r
-   0062     Reserved\r
-   0063     Reserved\r
-   0064     Reserved\r
-   0065     Last Date Referenced                4 bytes  Packed Hex "yyyymmdd"\r
-   0066     Date Created                        4 bytes  Packed Hex "yyyymmdd"\r
-   0068     GZIP two words                      8 bytes\r
-   0071     Extended NOTE Location              12 bytes Big Endian\r
-   0072     Archive device UNIT                 6 bytes  EBCDIC\r
-   0073     Archive 1st Volume                  6 bytes  EBCDIC\r
-   0074     Archive 1st VOL File Seq#           2 bytes  Binary\r
-\r
-APPENDIX C - Zip64 Extensible Data Sector Mappings \r
----------------------------------------------------\r
-\r
-         -Z390   Extra Field:\r
-\r
-          The following is the general layout of the attributes for the \r
-          ZIP 64 "extra" block for extended tape operations.  \r
-\r
-          Note: some fields stored in Big Endian format.  All text is \r
-          in EBCDIC format unless otherwise specified.\r
-\r
-          Value       Size          Description\r
-          -----       ----          -----------\r
-  (Z390)  0x0065      2 bytes       Tag for this "extra" block type\r
-          Size        4 bytes       Size for the following data block\r
-          Tag         4 bytes       EBCDIC "Z390"\r
-          Length71    2 bytes       Big Endian\r
-          Subcode71   2 bytes       Enote type code\r
-          FMEPos      1 byte\r
-          Length72    2 bytes       Big Endian\r
-          Subcode72   2 bytes       Unit type code\r
-          Unit        1 byte        Unit\r
-          Length73    2 bytes       Big Endian\r
-          Subcode73   2 bytes       Volume1 type code\r
-          FirstVol    1 byte        Volume\r
-          Length74    2 bytes       Big Endian\r
-          Subcode74   2 bytes       FirstVol file sequence\r
-          FileSeq     2 bytes       Sequence \r
-\r
-APPENDIX D - Language Encoding (EFS)\r
-------------------------------------\r
-\r
-D.1 The ZIP format has historically supported only the original IBM PC character \r
-encoding set, commonly referred to as IBM Code Page 437.  This limits storing \r
-file name characters to only those within the original MS-DOS range of values \r
-and does not properly support file names in other character encodings, or \r
-languages. To address this limitation, this specification will support the \r
-following change. \r
-\r
-D.2 If general purpose bit 11 is unset, the file name and comment should conform \r
-to the original ZIP character encoding.  If general purpose bit 11 is set, the \r
-filename and comment must support The Unicode Standard, Version 4.1.0 or \r
-greater using the character encoding form defined by the UTF-8 storage \r
-specification.  The Unicode Standard is published by the The Unicode\r
-Consortium (www.unicode.org).  UTF-8 encoded data stored within ZIP files \r
-is expected to not include a byte order mark (BOM). \r
-\r
-D.3 Applications may choose to supplement this file name storage through the use \r
-of the 0x0008 Extra Field.  Storage for this optional field is currently \r
-undefined, however it will be used to allow storing extended information \r
-on source or target encoding that may further assist applications with file \r
-name, or file content encoding tasks.  Please contact PKWARE with any\r
-requirements on how this field should be used.\r
-\r
-D.4 The 0x0008 Extra Field storage may be used with either setting for general \r
-purpose bit 11.  Examples of the intended usage for this field is to store \r
-whether "modified-UTF-8" (JAVA) is used, or UTF-8-MAC.  Similarly, other \r
-commonly used character encoding (code page) designations can be indicated \r
-through this field.  Formalized values for use of the 0x0008 record remain \r
-undefined at this time.  The definition for the layout of the 0x0008 field\r
-will be published when available.  Use of the 0x0008 Extra Field provides\r
-for storing data within a ZIP file in an encoding other than IBM Code\r
-Page 437 or UTF-8.\r
-\r
-D.5 General purpose bit 11 will not imply any encoding of file content or\r
-password.  Values defining character encoding for file content or \r
-password must be stored within the 0x0008 Extended Language Encoding \r
-Extra Field.\r
-\r
-D.6 Ed Gordon of the Info-ZIP group has defined a pair of "extra field" records \r
-that can be used to store UTF-8 file name and file comment fields.  These\r
-records can be used for cases when the general purpose bit 11 method\r
-for storing UTF-8 data in the standard file name and comment fields is\r
-not desirable.  A common case for this alternate method is if backward\r
-compatibility with older programs is required.\r
-\r
-D.7 Definitions for the record structure of these fields are included above \r
-in the section on 3rd party mappings for "extra field" records.  These\r
-records are identified by Header ID's 0x6375 (Info-ZIP Unicode Comment \r
-Extra Field) and 0x7075 (Info-ZIP Unicode Path Extra Field).\r
-\r
-D.8 The choice of which storage method to use when writing a ZIP file is left\r
-to the implementation.  Developers should expect that a ZIP file may \r
-contain either method and should provide support for reading data in \r
-either format. Use of general purpose bit 11 reduces storage requirements \r
-for file name data by not requiring additional "extra field" data for\r
-each file, but can result in older ZIP programs not being able to extract \r
-files.  Use of the 0x6375 and 0x7075 records will result in a ZIP file \r
-that should always be readable by older ZIP programs, but requires more \r
-storage per file to write file name and/or file comment fields.\r
diff --git a/docs/extrafld.txt b/docs/extrafld.txt
deleted file mode 100644 (file)
index 624e05c..0000000
+++ /dev/null
@@ -1,1372 +0,0 @@
-The following are the known types of zipfile extra fields as of this
-writing.  Extra fields are documented in PKWARE's appnote.txt and are
-intended to allow for backward- and forward-compatible extensions to
-the zipfile format.  Multiple extra-field types may be chained together,
-provided that the total length of all extra-field data is less than 64KB.
-(In fact, PKWARE requires that the total length of the entire file header,
-including timestamp, file attributes, filename, comment, extra field, etc.,
-be no more than 64KB.)
-
-Each extra-field type (or subblock) must contain a four-byte header con-
-sisting of a two-byte header ID and a two-byte length (little-endian) for
-the remaining data in the subblock.  If there are additional subblocks
-within the extra field, the header for each one will appear immediately
-following the data for the previous subblock (i.e., with no padding for
-alignment).
-
-All integer fields in the descriptions below are in little-endian (Intel)
-format unless otherwise specified.  Note that "Short" means two bytes,
-"Long" means four bytes, and "Long-Long" means eight bytes, regardless
-of their native sizes.  Unless specifically noted, all integer fields should
-be interpreted as unsigned (non-negative) numbers.
-
-Christian Spieler, 20010517
-
-Updated to include the Unicode extra fields.  Added new Unix extra field.
-
-Ed Gordon, 20060819, 20070607, 20070909, 20080426, 20080509
-
-                        -------------------------
-
-          Header ID's of 0 thru 31 are reserved for use by PKWARE.
-          The remaining ID's can be used by third party vendors for
-          proprietary usage.
-
-          The current Header ID mappings defined by PKWARE are:
-
-          0x0001        ZIP64 extended information extra field
-          0x0007        AV Info
-          0x0009        OS/2 extended attributes      (also Info-ZIP)
-          0x000a        NTFS (Win9x/WinNT FileTimes)
-          0x000c        OpenVMS                       (also Info-ZIP)
-          0x000d        Unix
-          0x000f        Patch Descriptor
-          0x0014        PKCS#7 Store for X.509 Certificates
-          0x0015        X.509 Certificate ID and Signature for
-                        individual file
-          0x0016        X.509 Certificate ID for Central Directory
-
-          The Header ID mappings defined by Info-ZIP and third parties are:
-
-          0x0065        IBM S/390 attributes - uncompressed
-          0x0066        IBM S/390 attributes - compressed
-          0x07c8        Info-ZIP Macintosh (old, J. Lee)
-          0x2605        ZipIt Macintosh (first version)
-          0x2705        ZipIt Macintosh v 1.3.5 and newer (w/o full filename)
-          0x334d        Info-ZIP Macintosh (new, D. Haase's 'Mac3' field )
-          0x4154        Tandem NSK
-          0x4341        Acorn/SparkFS (David Pilling)
-          0x4453        Windows NT security descriptor (binary ACL)
-          0x4704        VM/CMS
-          0x470f        MVS
-          0x4854        Theos, old inofficial port
-          0x4b46        FWKCS MD5 (see below)
-          0x4c41        OS/2 access control list (text ACL)
-          0x4d49        Info-ZIP OpenVMS (obsolete)
-          0x4d63        Macintosh SmartZIP, by Macro Bambini
-          0x4f4c        Xceed original location extra field
-          0x5356        AOS/VS (binary ACL)
-          0x5455        extended timestamp
-          0x5855        Info-ZIP Unix (original; also OS/2, NT, etc.)
-          0x554e        Xceed unicode extra field
-          0x6375        Info-ZIP Unicode Comment
-          0x6542        BeOS (BeBox, PowerMac, etc.)
-          0x6854        Theos
-          0x7075        Info-ZIP Unicode Path
-          0x756e        ASi Unix
-          0x7855        Info-ZIP Unix (previous new)
-          0x7875        Info-ZIP Unix (new)
-          0xfb4a        SMS/QDOS
-
-The following are detailed descriptions of the known extra-field block types:
-
-         -OS/2 Extended Attributes Extra Field:
-          ====================================
-
-          The following is the layout of the OS/2 extended attributes "extra"
-          block.  (Last Revision 19960922)
-
-          Note: all fields stored in Intel low-byte/high-byte order.
-
-          Local-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (OS/2)  0x0009        Short       tag for this extra block type
-          TSize         Short       total data size for this block
-          BSize         Long        uncompressed EA data size
-          CType         Short       compression type
-          EACRC         Long        CRC value for uncompressed EA data
-          (var.)        variable    compressed EA data
-
-          Central-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (OS/2)  0x0009        Short       tag for this extra block type
-          TSize         Short       total data size for this block (4)
-          BSize         Long        size of uncompressed local EA data
-
-          The value of CType is interpreted according to the "compression
-          method" section above; i.e., 0 for stored, 8 for deflated, etc.
-
-          The OS/2 extended attribute structure (FEA2LIST) is compressed and
-          then stored in its entirety within this structure.  There will only
-          ever be one block of data in the variable-length field.
-
-
-         -OS/2 Access Control List Extra Field:
-          ====================================
-
-          The following is the layout of the OS/2 ACL extra block.
-          (Last Revision 19960922)
-
-          Local-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (ACL)   0x4c41        Short       tag for this extra block type ("AL")
-          TSize         Short       total data size for this block
-          BSize         Long        uncompressed ACL data size
-          CType         Short       compression type
-          EACRC         Long        CRC value for uncompressed ACL data
-          (var.)        variable    compressed ACL data
-
-          Central-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (ACL)   0x4c41        Short       tag for this extra block type ("AL")
-          TSize         Short       total data size for this block (4)
-          BSize         Long        size of uncompressed local ACL data
-
-          The value of CType is interpreted according to the "compression
-          method" section above; i.e., 0 for stored, 8 for deflated, etc.
-
-          The uncompressed ACL data consist of a text header of the form
-          "ACL1:%hX,%hd\n", where the first field is the OS/2 ACCINFO acc_attr
-          member and the second is acc_count, followed by acc_count strings
-          of the form "%s,%hx\n", where the first field is acl_ugname (user
-          group name) and the second acl_access.  This block type will be
-          extended for other operating systems as needed.
-
-
-         -Windows NT Security Descriptor Extra Field:
-          ==========================================
-
-          The following is the layout of the NT Security Descriptor (another
-          type of ACL) extra block.  (Last Revision 19960922)
-
-          Local-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (SD)    0x4453        Short       tag for this extra block type ("SD")
-          TSize         Short       total data size for this block
-          BSize         Long        uncompressed SD data size
-          Version       Byte        version of uncompressed SD data format
-          CType         Short       compression type
-          EACRC         Long        CRC value for uncompressed SD data
-          (var.)        variable    compressed SD data
-
-          Central-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (SD)    0x4453        Short       tag for this extra block type ("SD")
-          TSize         Short       total data size for this block (4)
-          BSize         Long        size of uncompressed local SD data
-
-          The value of CType is interpreted according to the "compression
-          method" section above; i.e., 0 for stored, 8 for deflated, etc.
-          Version specifies how the compressed data are to be interpreted
-          and allows for future expansion of this extra field type.  Currently
-          only version 0 is defined.
-
-          For version 0, the compressed data are to be interpreted as a single
-          valid Windows NT SECURITY_DESCRIPTOR data structure, in self-relative
-          format.
-
-
-         -PKWARE Win95/WinNT Extra Field:
-          ==============================
-
-          The following description covers PKWARE's "NTFS" attributes
-          "extra" block, introduced with the release of PKZIP 2.50 for
-          Windows. (Last Revision 20001118)
-
-          (Note: At this time the Mtime, Atime and Ctime values may
-          be used on any WIN32 system.)
-         [Info-ZIP note: In the current implementations, this field has
-          a fixed total data size of 32 bytes and is only stored as local
-          extra field.]
-
-          Value         Size        Description
-          -----         ----        -----------
-  (NTFS)  0x000a        Short       Tag for this "extra" block type
-          TSize         Short       Total Data Size for this block
-          Reserved      Long        for future use
-          Tag1          Short       NTFS attribute tag value #1
-          Size1         Short       Size of attribute #1, in bytes
-          (var.)        SubSize1    Attribute #1 data
-          .
-          .
-          .
-          TagN          Short       NTFS attribute tag value #N
-          SizeN         Short       Size of attribute #N, in bytes
-          (var.)        SubSize1    Attribute #N data
-
-          For NTFS, values for Tag1 through TagN are as follows:
-          (currently only one set of attributes is defined for NTFS)
-
-          Tag        Size       Description
-          -----      ----       -----------
-          0x0001     2 bytes    Tag for attribute #1
-          Size1      2 bytes    Size of attribute #1, in bytes (24)
-          Mtime      8 bytes    64-bit NTFS file last modification time
-          Atime      8 bytes    64-bit NTFS file last access time
-          Ctime      8 bytes    64-bit NTFS file creation time
-
-          The total length for this block is 28 bytes, resulting in a
-          fixed size value of 32 for the TSize field of the NTFS block.
-
-          The NTFS filetimes are 64-bit unsigned integers, stored in Intel
-          (least significant byte first) byte order. They determine the
-          number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch",
-          which is "01-Jan-1601 00:00:00 UTC".
-
-
-         -PKWARE OpenVMS Extra Field:
-          ==========================
-
-          The following is the layout of PKWARE's OpenVMS attributes "extra"
-          block.  (Last Revision 12/17/91)
-
-          Note: all fields stored in Intel low-byte/high-byte order.
-
-          Value         Size        Description
-          -----         ----        -----------
-  (VMS)   0x000c        Short       Tag for this "extra" block type
-          TSize         Short       Total Data Size for this block
-          CRC           Long        32-bit CRC for remainder of the block
-          Tag1          Short       OpenVMS attribute tag value #1
-          Size1         Short       Size of attribute #1, in bytes
-          (var.)        Size1       Attribute #1 data
-          .
-          .
-          .
-          TagN          Short       OpenVMS attribute tage value #N
-          SizeN         Short       Size of attribute #N, in bytes
-          (var.)        SizeN       Attribute #N data
-
-          Rules:
-
-          1. There will be one or more of attributes present, which
-             will each be preceded by the above TagX & SizeX values.
-             These values are identical to the ATR$C_XXXX and
-             ATR$S_XXXX constants which are defined in ATR.H under
-             OpenVMS C.  Neither of these values will ever be zero.
-
-          2. No word alignment or padding is performed.
-
-          3. A well-behaved PKZIP/OpenVMS program should never produce
-             more than one sub-block with the same TagX value.  Also,
-             there will never be more than one "extra" block of type
-             0x000c in a particular directory record.
-
-
-         -Info-ZIP VMS Extra Field:
-          ========================
-
-          The following is the layout of Info-ZIP's VMS attributes extra
-          block for VAX or Alpha AXP.  The local-header and central-header
-          versions are identical.  (Last Revision 19960922)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (VMS2)  0x4d49        Short       tag for this extra block type ("JM")
-          TSize         Short       total data size for this block
-          ID            Long        block ID
-          Flags         Short       info bytes
-          BSize         Short       uncompressed block size
-          Reserved      Long        (reserved)
-          (var.)        variable    compressed VMS file-attributes block
-
-          The block ID is one of the following unterminated strings:
-
-                "VFAB"          struct FAB
-                "VALL"          struct XABALL
-                "VFHC"          struct XABFHC
-                "VDAT"          struct XABDAT
-                "VRDT"          struct XABRDT
-                "VPRO"          struct XABPRO
-                "VKEY"          struct XABKEY
-                "VMSV"          version (e.g., "V6.1"; truncated at hyphen)
-                "VNAM"          reserved
-
-          The lower three bits of Flags indicate the compression method.  The
-          currently defined methods are:
-
-                0       stored (not compressed)
-                1       simple "RLE"
-                2       deflated
-
-          The "RLE" method simply replaces zero-valued bytes with zero-valued
-          bits and non-zero-valued bytes with a "1" bit followed by the byte
-          value.
-
-          The variable-length compressed data contains only the data corre-
-          sponding to the indicated structure or string.  Typically multiple
-          VMS2 extra fields are present (each with a unique block type).
-
-
-         -Info-ZIP Macintosh Extra Field:
-          ==============================
-
-          The following is the layout of the (old) Info-ZIP resource-fork extra
-          block for Macintosh.  The local-header and central-header versions
-          are identical.  (Last Revision 19960922)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Mac)   0x07c8        Short       tag for this extra block type
-          TSize         Short       total data size for this block
-          "JLEE"        beLong      extra-field signature
-          FInfo         16 bytes    Macintosh FInfo structure
-          CrDat         beLong      HParamBlockRec fileParam.ioFlCrDat
-          MdDat         beLong      HParamBlockRec fileParam.ioFlMdDat
-          Flags         beLong      info bits
-          DirID         beLong      HParamBlockRec fileParam.ioDirID
-          VolName       28 bytes    volume name (optional)
-
-          All fields but the first two are in native Macintosh format
-          (big-endian Motorola order, not little-endian Intel).  The least
-          significant bit of Flags is 1 if the file is a data fork, 0 other-
-          wise.  In addition, if this extra field is present, the filename
-          has an extra 'd' or 'r' appended to indicate data fork or resource
-          fork.  The 28-byte VolName field may be omitted.
-
-
-         -ZipIt Macintosh Extra Field (long):
-          ==================================
-
-          The following is the layout of the ZipIt extra block for Macintosh.
-          The local-header and central-header versions are identical.
-          (Last Revision 19970130)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Mac2)  0x2605        Short       tag for this extra block type
-          TSize         Short       total data size for this block
-          "ZPIT"        beLong      extra-field signature
-          FnLen         Byte        length of FileName
-          FileName      variable    full Macintosh filename
-          FileType      Byte[4]     four-byte Mac file type string
-          Creator       Byte[4]     four-byte Mac creator string
-
-
-         -ZipIt Macintosh Extra Field (short):
-          ===================================
-
-          The following is the layout of a shortened variant of the
-          ZipIt extra block for Macintosh (without "full name" entry).
-          This variant is used by ZipIt 1.3.5 and newer for entries that
-          do not need a "full Mac filename" record.
-          The local-header and central-header versions are identical.
-          (Last Revision 19980903)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Mac2b) 0x2705        Short       tag for this extra block type
-          TSize         Short       total data size for this block (12)
-          "ZPIT"        beLong      extra-field signature
-          FileType      Byte[4]     four-byte Mac file type string
-          Creator       Byte[4]     four-byte Mac creator string
-
-
-         -Info-ZIP Macintosh Extra Field (new):
-          ====================================
-
-          The following is the layout of the (new) Info-ZIP extra
-          block for Macintosh, designed by Dirk Haase.
-          All values are in little-endian.
-          (Last Revision 19981005)
-
-          Local-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Mac3)  0x334d        Short       tag for this extra block type ("M3")
-          TSize         Short       total data size for this block
-          BSize         Long        uncompressed finder attribute data size
-          Flags         Short       info bits
-          fdType        Byte[4]     Type of the File (4-byte string)
-          fdCreator     Byte[4]     Creator of the File (4-byte string)
-          (CType)       Short       compression type
-          (CRC)         Long        CRC value for uncompressed MacOS data
-          Attribs       variable    finder attribute data (see below)
-
-
-          Central-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Mac3)  0x334d        Short       tag for this extra block type ("M3")
-          TSize         Short       total data size for this block
-          BSize         Long        uncompressed finder attribute data size
-          Flags         Short       info bits
-          fdType        Byte[4]     Type of the File (4-byte string)
-          fdCreator     Byte[4]     Creator of the File (4-byte string)
-
-          The third bit of Flags in both headers indicates whether
-          the LOCAL extra field is uncompressed (and therefore whether CType
-          and CRC are omitted):
-
-          Bits of the Flags:
-              bit 0           if set, file is a data fork; otherwise unset
-              bit 1           if set, filename will be not changed
-              bit 2           if set, Attribs is uncompressed (no CType, CRC)
-              bit 3           if set, date and times are in 64 bit
-                              if zero date and times are in 32 bit.
-              bit 4           if set, timezone offsets fields for the native
-                              Mac times are omitted (UTC support deactivated)
-              bits 5-15       reserved;
-
-
-          Attributes:
-
-          Attribs is a Mac-specific block of data in little-endian format with
-          the following structure (if compressed, uncompress it first):
-
-          Value         Size        Description
-          -----         ----        -----------
-          fdFlags       Short       Finder Flags
-          fdLocation.v  Short       Finder Icon Location
-          fdLocation.h  Short       Finder Icon Location
-          fdFldr        Short       Folder containing file
-
-          FXInfo        16 bytes    Macintosh FXInfo structure
-            FXInfo-Structure:
-                fdIconID        Short
-                fdUnused[3]     Short       unused but reserved 6 bytes
-                fdScript        Byte        Script flag and number
-                fdXFlags        Byte        More flag bits
-                fdComment       Short       Comment ID
-                fdPutAway       Long        Home Dir ID
-
-          FVersNum      Byte        file version number
-                                    may be not used by MacOS
-          ACUser        Byte        directory access rights
-
-          FlCrDat       ULong       date and time of creation
-          FlMdDat       ULong       date and time of last modification
-          FlBkDat       ULong       date and time of last backup
-            These time numbers are original Mac FileTime values (local time!).
-            Currently, date-time width is 32-bit, but future version may
-            support be 64-bit times (see flags)
-
-          CrGMTOffs     Long(signed!)   difference "local Creat. time - UTC"
-          MdGMTOffs     Long(signed!)   difference "local Modif. time - UTC"
-          BkGMTOffs     Long(signed!)   difference "local Backup time - UTC"
-            These "local time - UTC" differences (stored in seconds) may be
-            used to support timestamp adjustment after inter-timezone transfer.
-            These fields are optional; bit 4 of the flags word controls their
-            presence.
-
-          Charset       Short       TextEncodingBase (Charset)
-                                    valid for the following two fields
-
-          FullPath      variable    Path of the current file.
-                                    Zero terminated string (C-String)
-                                    Currently coded in the native Charset.
-
-          Comment       variable    Finder Comment of the current file.
-                                    Zero terminated string (C-String)
-                                    Currently coded in the native Charset.
-
-
-         -SmartZIP Macintosh Extra Field:
-          ====================================
-
-          The following is the layout of the SmartZIP extra
-          block for Macintosh, designed by Marco Bambini.
-
-          Local-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-          0x4d63        Short       tag for this extra block type ("cM")
-          TSize         Short       total data size for this block (64)
-          "dZip"        beLong      extra-field signature
-          fdType        Byte[4]     Type of the File (4-byte string)
-          fdCreator     Byte[4]     Creator of the File (4-byte string)
-          fdFlags       beShort     Finder Flags
-          fdLocation.v  beShort     Finder Icon Location
-          fdLocation.h  beShort     Finder Icon Location
-          fdFldr        beShort     Folder containing file
-          CrDat         beLong      HParamBlockRec fileParam.ioFlCrDat
-          MdDat         beLong      HParamBlockRec fileParam.ioFlMdDat
-          frScroll.v    Byte        vertical pos. of folder's scroll bar
-          fdScript      Byte        Script flag and number
-          frScroll.h    Byte        horizontal pos. of folder's scroll bar
-          fdXFlags      Byte        More flag bits
-          FileName      Byte[32]    full Macintosh filename (pascal string)
-
-          All fields but the first two are in native Macintosh format
-          (big-endian Motorola order, not little-endian Intel).
-          The extra field size is fixed to 64 bytes.
-          The local-header and central-header versions are identical.
-
-
-         -Acorn SparkFS Extra Field:
-          =========================
-
-          The following is the layout of David Pilling's SparkFS extra block
-          for Acorn RISC OS.  The local-header and central-header versions are
-          identical.  (Last Revision 19960922)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Acorn) 0x4341        Short       tag for this extra block type ("AC")
-          TSize         Short       total data size for this block (20)
-          "ARC0"        Long        extra-field signature
-          LoadAddr      Long        load address or file type
-          ExecAddr      Long        exec address
-          Attr          Long        file permissions
-          Zero          Long        reserved; always zero
-
-          The following bits of Attr are associated with the given file
-          permissions:
-
-                bit 0           user-writable ('W')
-                bit 1           user-readable ('R')
-                bit 2           reserved
-                bit 3           locked ('L')
-                bit 4           publicly writable ('w')
-                bit 5           publicly readable ('r')
-                bit 6           reserved
-                bit 7           reserved
-
-
-         -VM/CMS Extra Field:
-          ==================
-
-          The following is the layout of the file-attributes extra block for
-          VM/CMS.  The local-header and central-header versions are
-          identical.  (Last Revision 19960922)
-
-          Value         Size        Description
-          -----         ----        -----------
- (VM/CMS) 0x4704        Short       tag for this extra block type
-          TSize         Short       total data size for this block
-          flData        variable    file attributes data
-
-          flData is an uncompressed fldata_t struct.
-
-
-         -MVS Extra Field:
-          ===============
-
-          The following is the layout of the file-attributes extra block for
-          MVS.  The local-header and central-header versions are identical.
-          (Last Revision 19960922)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (MVS)   0x470f        Short       tag for this extra block type
-          TSize         Short       total data size for this block
-          flData        variable    file attributes data
-
-          flData is an uncompressed fldata_t struct.
-
-
-         -PKWARE Unix Extra Field:
-          ========================
-
-          The following is the layout of PKWARE's Unix "extra" block.
-          It was introduced with the release of PKZIP for Unix 2.50.
-          Note: all fields are stored in Intel low-byte/high-byte order.
-          (Last Revision 19980901)
-
-          This field has a minimum data size of 12 bytes and is only stored
-          as local extra field.
-
-          Value         Size        Description
-          -----         ----        -----------
- (Unix0)  0x000d        Short       Tag for this "extra" block type
-          TSize         Short       Total Data Size for this block
-          AcTime        Long        time of last access (UTC/GMT)
-          ModTime       Long        time of last modification (UTC/GMT)
-          UID           Short       Unix user ID
-          GID           Short       Unix group ID
-          (var)         variable    Variable length data field
-
-          The variable length data field will contain file type
-          specific data.  Currently the only values allowed are
-          the original "linked to" file names for hard or symbolic
-          links, and the major and minor device node numbers for
-          character and block device nodes.  Since device nodes
-          cannot be either symbolic or hard links, only one set of
-          variable length data is stored.  Link files will have the
-          name of the original file stored.  This name is NOT NULL
-          terminated.  Its size can be determined by checking TSize -
-          12.  Device entries will have eight bytes stored as two 4
-          byte entries (in little-endian format).  The first entry
-          will be the major device number, and the second the minor
-          device number.
-
-         [Info-ZIP note: The fixed part of this field has the same layout as
-          Info-ZIP's abandoned "Unix1 timestamps & owner ID info" extra field;
-          only the two tag bytes are different.]
-
-
-         -PATCH Descriptor Extra Field:
-          ============================
-
-          The following is the layout of the Patch Descriptor "extra"
-          block.
-
-          Note: all fields stored in Intel low-byte/high-byte order.
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Patch) 0x000f        Short       Tag for this "extra" block type
-          TSize         Short       Size of the total "extra" block
-          Version       Short       Version of the descriptor
-          Flags         Long        Actions and reactions (see below)
-          OldSize       Long        Size of the file about to be patched
-          OldCRC        Long        32-bit CRC of the file about to be patched
-          NewSize       Long        Size of the resulting file
-          NewCRC        Long        32-bit CRC of the resulting file
-
-
-          Actions and reactions
-
-          Bits          Description
-          ----          ----------------
-          0             Use for autodetection
-          1             Treat as selfpatch
-          2-3           RESERVED
-          4-5           Action (see below)
-          6-7           RESERVED
-          8-9           Reaction (see below) to absent file
-          10-11         Reaction (see below) to newer file
-          12-13         Reaction (see below) to unknown file
-          14-15         RESERVED
-          16-31         RESERVED
-
-          Actions
-
-          Action       Value
-          ------       -----
-          none         0
-          add          1
-          delete       2
-          patch        3
-
-          Reactions
-
-          Reaction     Value
-          --------     -----
-          ask          0
-          skip         1
-          ignore       2
-          fail         3
-
-
-         -PKCS#7 Store for X.509 Certificates:
-          ===================================
-
-          This field is contains the information about each
-          certificate a file is signed with.  This field should only
-          appear in the first central directory record, and will be
-          ignored in any other record.
-
-          Note: all fields stored in Intel low-byte/high-byte order.
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Store) 0x0014        2 bytes     Tag for this "extra" block type
-          SSize         2 bytes     Size of the store data
-          SData         (variable)  Data about the store
-
-          SData
-          Value         Size        Description
-          -----         ----        -----------
-          Version       2 bytes     Version number, 0x0001 for now
-          StoreD        (variable)  Actual store data
-
-          The StoreD member is suitable for passing as the pbData
-          member of a CRYPT_DATA_BLOB to the CertOpenStore() function
-          in Microsoft's CryptoAPI.  The SSize member above will be
-          cbData + 6, where cbData is the cbData member of the same
-          CRYPT_DATA_BLOB.  The encoding type to pass to
-          CertOpenStore() should be
-          PKCS_7_ANS_ENCODING | X509_ASN_ENCODING.
-
-
-         -X.509 Certificate ID and Signature for individual file:
-          ======================================================
-
-          This field contains the information about which certificate
-          in the PKCS#7 Store was used to sign the particular file.
-          It also contains the signature data.  This field can appear
-          multiple times, but can only appear once per certificate.
-
-          Note: all fields stored in Intel low-byte/high-byte order.
-
-          Value         Size        Description
-          -----         ----        -----------
-  (CID)   0x0015        2 bytes     Tag for this "extra" block type
-          CSize         2 bytes     Size of Method
-          Method        (variable)
-
-          Method
-          Value         Size        Description
-          -----         ----        -----------
-          Version       2 bytes     Version number, for now 0x0001
-          AlgID         2 bytes     Algorithm ID used for signing
-          IDSize        2 bytes     Size of Certificate ID data
-          CertID        (variable)  Certificate ID data
-          SigSize       2 bytes     Size of Signature data
-          Sig           (variable)  Signature data
-
-          CertID
-          Value         Size        Description
-          -----         ----        -----------
-          Size1         4 bytes     Size of CertID, should be (IDSize - 4)
-          Size1         4 bytes     A bug in version one causes this value
-                                    to appear twice.
-          IssSize       4 bytes     Issuer data size
-          Issuer        (variable)  Issuer data
-          SerSize       4 bytes     Serial Number size
-          Serial        (variable)  Serial Number data
-
-          The Issuer and IssSize members are suitable for creating a
-          CRYPT_DATA_BLOB to be the Issuer member of a CERT_INFO
-          struct. The Serial and SerSize members would be the
-          SerialNumber member of the same CERT_INFO struct.  This
-          struct would be used to find the certificate in the store
-          the file was signed with.  Those structures are from the MS
-          CryptoAPI.
-
-          Sig and SigSize are the actual signature data and size
-          generated by signing the file with the MS CryptoAPI using a
-          hash created with the given AlgID.
-
-
-         -X.509 Certificate ID and Signature for central directory:
-          ========================================================
-
-          This field contains the information about which certificate
-          in the PKCS#7 Store was used to sign the central directory.
-          It should only appear with the first central directory
-          record, along with the store.  The data structure is the
-          same as the CID, except that SigSize will be 0, and there
-          will be no Sig member.
-
-          This field is also kept after the last central directory
-          record, as the signature data (ID 0x05054b50, it looks like
-          a central directory record of a different type).  This
-          second copy of the data is the Signature Data member of the
-          record, and will have a SigSize that is non-zero, and will
-          have Sig data.
-
-          Note: all fields stored in Intel low-byte/high-byte order.
-
-          Value         Size        Description
-          -----         ----        -----------
-  (CDID)  0x0016        2 bytes     Tag for this "extra" block type
-          CSize         2 bytes     Size of Method
-          Method       (variable)
-
-
-         -ZIP64 Extended Information Extra Field:
-          ======================================
-
-          The following is the layout of the ZIP64 extended
-          information "extra" block. If one of the size or
-          offset fields in the Local or Central directory
-          record is too small to hold the required data,
-          a ZIP64 extended information record is created.
-          The order of the fields in the ZIP64 extended
-          information record is fixed, but the fields will
-          only appear if the corresponding Local or Central
-          directory record field is set to 0xFFFF or 0xFFFFFFFF.
-
-          Note: all fields stored in Intel low-byte/high-byte order.
-
-          Value      Size       Description
-          -----      ----       -----------
-  (ZIP64) 0x0001     2 bytes    Tag for this "extra" block type
-          Size       2 bytes    Size of this "extra" block
-          Original
-          Size       8 bytes    Original uncompresseed file size
-          Compressed
-          Size       8 bytes    Size of compressed data
-          Relative Header
-          Offset     8 bytes    Offset of local header record
-          Disk Start
-          Number     4 bytes    Number of the disk on which
-                                this file starts
-
-          This entry in the Local header must include BOTH original
-          and compressed file sizes.
-
-
-         -Extended Timestamp Extra Field:
-          ==============================
-
-          The following is the layout of the extended-timestamp extra block.
-          (Last Revision 19970118)
-
-          Local-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (time)  0x5455        Short       tag for this extra block type ("UT")
-          TSize         Short       total data size for this block
-          Flags         Byte        info bits
-          (ModTime)     Long        time of last modification (UTC/GMT)
-          (AcTime)      Long        time of last access (UTC/GMT)
-          (CrTime)      Long        time of original creation (UTC/GMT)
-
-          Central-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (time)  0x5455        Short       tag for this extra block type ("UT")
-          TSize         Short       total data size for this block
-          Flags         Byte        info bits (refers to local header!)
-          (ModTime)     Long        time of last modification (UTC/GMT)
-
-          The central-header extra field contains the modification time only,
-          or no timestamp at all.  TSize is used to flag its presence or
-          absence.  But note:
-
-              If "Flags" indicates that Modtime is present in the local header
-              field, it MUST be present in the central header field, too!
-              This correspondence is required because the modification time
-              value may be used to support trans-timezone freshening and
-              updating operations with zip archives.
-
-          The time values are in standard Unix signed-long format, indicating
-          the number of seconds since 1 January 1970 00:00:00.  The times
-          are relative to Coordinated Universal Time (UTC), also sometimes
-          referred to as Greenwich Mean Time (GMT).  To convert to local time,
-          the software must know the local timezone offset from UTC/GMT.
-
-          The lower three bits of Flags in both headers indicate which time-
-          stamps are present in the LOCAL extra field:
-
-                bit 0           if set, modification time is present
-                bit 1           if set, access time is present
-                bit 2           if set, creation time is present
-                bits 3-7        reserved for additional timestamps; not set
-
-          Those times that are present will appear in the order indicated, but
-          any combination of times may be omitted.  (Creation time may be
-          present without access time, for example.)  TSize should equal
-          (1 + 4*(number of set bits in Flags)), as the block is currently
-          defined.  Other timestamps may be added in the future.
-
-
-         -Info-ZIP Unix Extra Field (type 1):
-          ==================================
-
-          The following is the layout of the old Info-ZIP extra block for
-          Unix.  It has been replaced by the extended-timestamp extra block
-          (0x5455) and the Unix type 2 extra block (0x7855).
-          (Last Revision 19970118)
-
-          Local-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Unix1) 0x5855        Short       tag for this extra block type ("UX")
-          TSize         Short       total data size for this block
-          AcTime        Long        time of last access (UTC/GMT)
-          ModTime       Long        time of last modification (UTC/GMT)
-          UID           Short       Unix user ID (optional)
-          GID           Short       Unix group ID (optional)
-
-          Central-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Unix1) 0x5855        Short       tag for this extra block type ("UX")
-          TSize         Short       total data size for this block
-          AcTime        Long        time of last access (GMT/UTC)
-          ModTime       Long        time of last modification (GMT/UTC)
-
-          The file access and modification times are in standard Unix signed-
-          long format, indicating the number of seconds since 1 January 1970
-          00:00:00.  The times are relative to Coordinated Universal Time
-          (UTC), also sometimes referred to as Greenwich Mean Time (GMT).  To
-          convert to local time, the software must know the local timezone
-          offset from UTC/GMT.  The modification time may be used by non-Unix
-          systems to support inter-timezone freshening and updating of zip
-          archives.
-
-          The local-header extra block may optionally contain UID and GID
-          info for the file.  The local-header TSize value is the only
-          indication of this.  Note that Unix UIDs and GIDs are usually
-          specific to a particular machine, and they generally require root
-          access to restore.
-
-          This extra field type is obsolete, but it has been in use since
-          mid-1994.  Therefore future archiving software should continue to
-          support it.  Some guidelines:
-
-              An archive member should either contain the old "Unix1"
-              extra field block or the new extra field types "time" and/or
-              "Unix2".
-
-              If both the old "Unix1" block type and one or both of the new
-              block types "time" and "Unix2" are found, the "Unix1" block
-              should be considered invalid and ignored.
-
-              Unarchiving software should recognize both old and new extra
-              field block types, but the info from new types overrides the
-              old "Unix1" field.
-
-              Archiving software should recognize "Unix1" extra fields for
-              timestamp comparison but never create it for updated, freshened
-              or new archive members.  When copying existing members to a new
-              archive, any "Unix1" extra field blocks should be converted to
-              the new "time" and/or "Unix2" types.
-
-
-         -Info-ZIP Unix Extra Field (type 2):
-          ==================================
-
-          The following is the layout of the new Info-ZIP extra block for
-          Unix.  (Last Revision 19960922)
-
-          Local-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Unix2) 0x7855        Short       tag for this extra block type ("Ux")
-          TSize         Short       total data size for this block (4)
-          UID           Short       Unix user ID
-          GID           Short       Unix group ID
-
-          Central-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Unix2) 0x7855        Short       tag for this extra block type ("Ux")
-          TSize         Short       total data size for this block (0)
-
-          The data size of the central-header version is zero; it is used
-          solely as a flag that UID/GID info is present in the local-header
-          extra field.  If additional fields are ever added to the local
-          version, the central version may be extended to indicate this.
-
-          Note that Unix UIDs and GIDs are usually specific to a particular
-          machine, and they generally require root access to restore.
-
-
-         -ASi Unix Extra Field:
-          ====================
-
-          The following is the layout of the ASi extra block for Unix.  The
-          local-header and central-header versions are identical.
-          (Last Revision 19960916)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Unix3) 0x756e        Short       tag for this extra block type ("nu")
-          TSize         Short       total data size for this block
-          CRC           Long        CRC-32 of the remaining data
-          Mode          Short       file permissions
-          SizDev        Long        symlink'd size OR major/minor dev num
-          UID           Short       user ID
-          GID           Short       group ID
-          (var.)        variable    symbolic link filename
-
-          Mode is the standard Unix st_mode field from struct stat, containing
-          user/group/other permissions, setuid/setgid and symlink info, etc.
-
-          If Mode indicates that this file is a symbolic link, SizDev is the
-          size of the file to which the link points.  Otherwise, if the file
-          is a device, SizDev contains the standard Unix st_rdev field from
-          struct stat (includes the major and minor numbers of the device).
-          SizDev is undefined in other cases.
-
-          If Mode indicates that the file is a symbolic link, the final field
-          will be the name of the file to which the link points.  The file-
-          name length can be inferred from TSize.
-
-          [Note that TSize may incorrectly refer to the data size not counting
-           the CRC; i.e., it may be four bytes too small.]
-
-
-         -BeOS Extra Field:
-          ================
-
-          The following is the layout of the file-attributes extra block for
-          BeOS.  (Last Revision 19970531)
-
-          Local-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (BeOS)  0x6542        Short       tag for this extra block type ("Be")
-          TSize         Short       total data size for this block
-          BSize         Long        uncompressed file attribute data size
-          Flags         Byte        info bits
-          (CType)       Short       compression type
-          (CRC)         Long        CRC value for uncompressed file attribs
-          Attribs       variable    file attribute data
-
-          Central-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (BeOS)  0x6542        Short       tag for this extra block type ("Be")
-          TSize         Short       total data size for this block (5)
-          BSize         Long        size of uncompr. local EF block data
-          Flags         Byte        info bits
-
-          The least significant bit of Flags in both headers indicates whether
-          the LOCAL extra field is uncompressed (and therefore whether CType
-          and CRC are omitted):
-
-                bit 0           if set, Attribs is uncompressed (no CType, CRC)
-                bits 1-7        reserved; if set, assume error or unknown data
-
-          Currently the only supported compression types are deflated (type 8)
-          and stored (type 0); the latter is not used by Info-ZIP's Zip but is
-          supported by UnZip.
-
-          Attribs is a BeOS-specific block of data in big-endian format with
-          the following structure (if compressed, uncompress it first):
-
-              Value     Size        Description
-              -----     ----        -----------
-              Name      variable    attribute name (null-terminated string)
-              Type      Long        attribute type (32-bit unsigned integer)
-              Size      Long Long   data size for this sub-block (64 bits)
-              Data      variable    attribute data
-
-          The attribute structure is repeated for every attribute.  The Data
-          field may contain anything--text, flags, bitmaps, etc.
-
-
-         -SMS/QDOS Extra Field:
-          ====================
-
-          The following is the layout of the file-attributes extra block for
-          SMS/QDOS.  The local-header and central-header versions are identical.
-          (Last Revision 19960929)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (QDOS)  0xfb4a        Short       tag for this extra block type
-          TSize         Short       total data size for this block
-          LongID        Long        extra-field signature
-          (ExtraID)     Long        additional signature/flag bytes
-          QDirect       64 bytes    qdirect structure
-
-          LongID may be "QZHD" or "QDOS".  In the latter case, ExtraID will
-          be present.  Its first three bytes are "02\0"; the last byte is
-          currently undefined.
-
-          QDirect contains the file's uncompressed directory info (qdirect
-          struct).  Its elements are in native (big-endian) format:
-
-          d_length      beLong          file length
-          d_access      byte            file access type
-          d_type        byte            file type
-          d_datalen     beLong          data length
-          d_reserved    beLong          unused
-          d_szname      beShort         size of filename
-          d_name        36 bytes        filename
-          d_update      beLong          time of last update
-          d_refdate     beLong          file version number
-          d_backup      beLong          time of last backup (archive date)
-
-
-         -AOS/VS Extra Field:
-          ==================
-
-          The following is the layout of the extra block for Data General
-          AOS/VS.  The local-header and central-header versions are identical.
-          (Last Revision 19961125)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (AOSVS) 0x5356        Short       tag for this extra block type ("VS")
-          TSize         Short       total data size for this block
-          "FCI\0"       Long        extra-field signature
-          Version       Byte        version of AOS/VS extra block (10 = 1.0)
-          Fstat         variable    fstat packet
-          AclBuf        variable    raw ACL data ($MXACL bytes)
-
-          Fstat contains the file's uncompressed fstat packet, which is one of
-          the following:
-
-                normal fstat packet             (P_FSTAT struct)
-                DIR/CPD fstat packet            (P_FSTAT_DIR struct)
-                unit (device) fstat packet      (P_FSTAT_UNIT struct)
-                IPC file fstat packet           (P_FSTAT_IPC struct)
-
-          AclBuf contains the raw ACL data; its length is $MXACL.
-
-
-         -Tandem NSK Extra Field:
-          ======================
-
-          The following is the layout of the file-attributes extra block for
-          Tandem NSK.  The local-header and central-header versions are
-          identical.  (Last Revision 19981221)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (TA)    0x4154        Short       tag for this extra block type ("TA")
-          TSize         Short       total data size for this block (20)
-          NSKattrs      20 Bytes    NSK attributes
-
-
-         -THEOS Extra Field:
-          =================
-
-          The following is the layout of the file-attributes extra block for
-          Theos.  The local-header and central-header versions are identical.
-          (Last Revision 19990206)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (Theos) 0x6854        Short       'Th' signature
-          size          Short       size of extra block
-          flags         Byte        reserved for future use
-          filesize      Long        file size
-          fileorg       Byte        type of file (see below)
-          keylen        Short       key length for indexed and keyed files,
-                                    data segment size for 16 bits programs
-          reclen        Short       record length for indexed,keyed and direct,
-                                    text segment size for 16 bits programs
-          filegrow      Byte        growing factor for indexed,keyed and direct
-          protect       Byte        protections (see below)
-          reserved      Short       reserved for future use
-
-            File types
-            ==========
-
-            0x80  library (keyed access list of files)
-            0x40  directory
-            0x10  stream file
-            0x08  direct file
-            0x04  keyed file
-            0x02  indexed file
-            0x0e  reserved
-            0x01  16 bits real mode program (obsolete)
-            0x21  16 bits protected mode program
-            0x41  32 bits protected mode program
-
-            Protection codes
-            ================
-
-            User protection
-            ---------------
-            0x01  non readable
-            0x02  non writable
-            0x04  non executable
-            0x08  non erasable
-
-            Other protection
-            ----------------
-            0x10  non readable
-            0x20  non writable
-            0x40  non executable Theos before 4.0
-            0x40  modified Theos 4.x
-            0x80  not hidden
-
-
-         -THEOS old inofficial Extra Field:
-          ================================
-
-          The following is the layout of an inoffical former version of a
-          Theos file-attributes extra blocks.  This layout was never published
-          and is no longer created. However, UnZip can optionally support it
-          when compiling with the option flag OLD_THEOS_EXTRA defined.
-          Both the local-header and central-header versions are identical.
-          (Last Revision 19990206)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (THS0)  0x4854        Short       'TH' signature
-          size          Short       size of extra block
-          flags         Short       reserved for future use
-          filesize      Long        file size
-          reclen        Short       record length for indexed,keyed and direct,
-                                    text segment size for 16 bits programs
-          keylen        Short       key length for indexed and keyed files,
-                                    data segment size for 16 bits programs
-          filegrow      Byte        growing factor for indexed,keyed and direct
-          reserved      3 Bytes     reserved for future use
-
-
-         -FWKCS MD5 Extra Field:
-          =====================
-
-          The FWKCS Contents_Signature System, used in automatically
-          identifying files independent of filename, optionally adds
-          and uses an extra field to support the rapid creation of
-          an enhanced contents_signature.
-          There is no local-header version; the following applies
-          only to the central header.  (Last Revision 19961207)
-
-          Central-header version:
-
-          Value         Size        Description
-          -----         ----        -----------
-  (MD5)   0x4b46        Short       tag for this extra block type ("FK")
-          TSize         Short       total data size for this block (19)
-          "MD5"         3 bytes     extra-field signature
-          MD5hash       16 bytes    128-bit MD5 hash of uncompressed data
-                                    (low byte first)
-
-          When FWKCS revises a .ZIP file central directory to add
-          this extra field for a file, it also replaces the
-          central directory entry for that file's uncompressed
-          file length with a measured value.
-
-          FWKCS provides an option to strip this extra field, if
-          present, from a .ZIP file central directory. In adding
-          this extra field, FWKCS preserves .ZIP file Authenticity
-          Verification; if stripping this extra field, FWKCS
-          preserves all versions of AV through PKZIP version 2.04g.
-
-          FWKCS, and FWKCS Contents_Signature System, are
-          trademarks of Frederick W. Kantor.
-
-          (1) R. Rivest, RFC1321.TXT, MIT Laboratory for Computer
-              Science and RSA Data Security, Inc., April 1992.
-              ll.76-77: "The MD5 algorithm is being placed in the
-              public domain for review and possible adoption as a
-              standard."
-
-
-         -Info-ZIP Unicode Path Extra Field:
-          =================================
-
-          Stores the UTF-8 version of the entry path as stored in the
-          local header and central directory header.
-          (Last Revision 20070912)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (UPath) 0x7075        Short       tag for this extra block type ("up")
-          TSize         Short       total data size for this block
-          Version       1 byte      version of this extra field, currently 1
-          NameCRC32     4 bytes     File Name Field CRC32 Checksum
-          UnicodeName   Variable    UTF-8 version of the entry File Name
-
-          Currently Version is set to the number 1.  If there is a need
-          to change this field, the version will be incremented.  Changes
-          may not be backward compatible so this extra field should not be
-          used if the version is not recognized.
-
-          The NameCRC32 is the standard zip CRC32 checksum of the File Name
-          field in the header.  This is used to verify that the header
-          File Name field has not changed since the Unicode Path extra field
-          was created.  This can happen if a utility renames the entry but
-          does not update the UTF-8 path extra field.  If the CRC check fails,
-          this UTF-8 Path Extra Field should be ignored and the File Name field
-          in the header used instead.
-
-          The UnicodeName is the UTF-8 version of the contents of the File Name
-          field in the header.  As UnicodeName is defined to be UTF-8, no UTF-8
-          byte order mark (BOM) is used.  The length of this field is determined
-          by subtracting the size of the previous fields from TSize.  If both
-          the File Name and Comment fields are UTF-8, the new General Purpose
-          Bit Flag, bit 11 (Language encoding flag (EFS)), can be used to
-          indicate that both the header File Name and Comment fields are UTF-8
-          and, in this case, the Unicode Path and Unicode Comment extra fields
-          are not needed and should not be created.  Note that, for backward
-          compatibility, bit 11 should only be used if the native character set
-          of the paths and comments being zipped up are already in UTF-8.  The
-          same method, either bit 11 or extra fields, should be used in both
-          the local and central directory headers.
-
-
-         -Info-ZIP Unicode Comment Extra Field:
-          ====================================
-
-          Stores the UTF-8 version of the entry comment as stored in the
-          central directory header.
-          (Last Revision 20070912)
-
-          Value         Size        Description
-          -----         ----        -----------
-   (UCom) 0x6375        Short       tag for this extra block type ("uc")
-          TSize         Short       total data size for this block
-          Version       1 byte      version of this extra field, currently 1
-          ComCRC32      4 bytes     Comment Field CRC32 Checksum
-          UnicodeCom    Variable    UTF-8 version of the entry comment
-
-          Currently Version is set to the number 1.  If there is a need
-          to change this field, the version will be incremented.  Changes
-          may not be backward compatible so this extra field should not be
-          used if the version is not recognized.
-
-          The ComCRC32 is the standard zip CRC32 checksum of the Comment
-          field in the central directory header.  This is used to verify that
-          the comment field has not changed since the Unicode Comment extra field
-          was created.  This can happen if a utility changes the Comment field
-          but does not update the UTF-8 Comment extra field.  If the CRC check
-          fails, this Unicode Comment extra field should be ignored and the
-          Comment field in the header used.
-
-          The UnicodeCom field is the UTF-8 version of the entry comment field
-          in the header.  As UnicodeCom is defined to be UTF-8, no UTF-8 byte
-          order mark (BOM) is used.  The length of this field is determined by
-          subtracting the size of the previous fields from TSize.  If both the
-          File Name and Comment fields are UTF-8, the new General Purpose Bit
-          Flag, bit 11 (Language encoding flag (EFS)), can be used to indicate
-          both the header File Name and Comment fields are UTF-8 and, in this
-          case, the Unicode Path and Unicode Comment extra fields are not
-          needed and should not be created.  Note that, for backward
-          compatibility, bit 11 should only be used if the native character set
-          of the paths and comments being zipped up are already in UTF-8.  The
-          same method, either bit 11 or extra fields, should be used in both
-          the local and central directory headers.
-
-
-         -Info-ZIP New Unix Extra Field:
-          ====================================
-
-          Currently stores Unix UIDs/GIDs up to 32 bits.
-          (Last Revision 20080509)
-
-          Value         Size        Description
-          -----         ----        -----------
-  (UnixN) 0x7875        Short       tag for this extra block type ("ux")
-          TSize         Short       total data size for this block
-          Version       1 byte      version of this extra field, currently 1
-          UIDSize       1 byte      Size of UID field
-          UID           Variable    UID for this entry
-          GIDSize       1 byte      Size of GID field
-          GID           Variable    GID for this entry
-
-          Currently Version is set to the number 1.  If there is a need
-          to change this field, the version will be incremented.  Changes
-          may not be backward compatible so this extra field should not be
-          used if the version is not recognized.
-
-          UIDSize is the size of the UID field in bytes.  This size should
-          match the size of the UID field on the target OS.
-
-          UID is the UID for this entry in standard little endian format.
-
-          GIDSize is the size of the GID field in bytes.  This size should
-          match the size of the GID field on the target OS.
-
-          GID is the GID for this entry in standard little endian format.
-
-          If both the old 16-bit Unix extra field (tag 0x7855, Info-ZIP Unix)
-          and this extra field are present, the values in this extra field
-          supercede the values in that extra field.
diff --git a/examples/Makefile.am b/examples/Makefile.am
deleted file mode 100644 (file)
index 7887ac4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-noinst_PROGRAMS=in-memory
-
-in_memory_CPPFLAGS=-I${top_srcdir}/lib -I../lib
-in_memory_LDADD=${top_builddir}/lib/libzip.la
-
-EXTRA_DIST=    CMakeLists.txt windows-open.c
index a37ee18..f618e21 100644 (file)
@@ -46,9 +46,9 @@ get_data(void **datap, size_t *sizep, const char *archive)
     struct stat st;
     FILE *fp;
 
-    if (stat(archive, &st) < 0) {
+    if ((fp=fopen(archive, "r")) == NULL) {
        if (errno != ENOENT) {
-           fprintf(stderr, "can't stat %s: %s\n", archive, strerror(errno));
+           fprintf(stderr, "can't open %s: %s\n", archive, strerror(errno));
            return -1;
        }
 
@@ -58,20 +58,21 @@ get_data(void **datap, size_t *sizep, const char *archive)
        return 0;
     }
 
+    if (fstat(fileno(fp), &st) < 0) {
+        fprintf(stderr, "can't stat %s: %s\n", archive, strerror(errno));
+        fclose(fp);
+        return -1;
+    }
+
     if ((*datap = malloc((size_t)st.st_size)) == NULL) {
        fprintf(stderr, "can't allocate buffer\n");
+       fclose(fp);
        return -1;
     }
 
-    if ((fp=fopen(archive, "r")) == NULL) {
-       free(*datap);
-       fprintf(stderr, "can't open %s: %s\n", archive, strerror(errno));
-       return -1;
-    }
-    
     if (fread(*datap, 1, (size_t)st.st_size, fp) < (size_t)st.st_size) {
-       free(*datap);
        fprintf(stderr, "can't read %s: %s\n", archive, strerror(errno));
+        free(*datap);
        fclose(fp);
        return -1;
     }
index 9223920..855ccf5 100644 (file)
@@ -4,13 +4,12 @@ INSTALL(FILES zip.h DESTINATION include)
 
 # from http://www.cmake.org/Wiki/CMakeMacroLibtoolFile
 MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value)
+  GET_TARGET_PROPERTY(${_variable} ${_target} ${_property})
+  IF(${_variable} STREQUAL NOTFOUND)
+    SET(${_variable} ${_default_value})
+  ENDIF()
   
-  GET_TARGET_PROPERTY (${_variable} ${_target} ${_property})
-  IF (${_variable} STREQUAL NOTFOUND)
-    SET (${_variable} ${_default_value})
-  ENDIF (${_variable} STREQUAL NOTFOUND)
-  
-ENDMACRO (GET_TARGET_PROPERTY_WITH_DEFAULT)
+ENDMACRO()
   
 MACRO(CREATE_LIBTOOL_FILE _target _install_DIR)
   GET_TARGET_PROPERTY(_target_location ${_target} LOCATION)
@@ -48,9 +47,8 @@ MACRO(CREATE_LIBTOOL_FILE _target _install_DIR)
   FILE(APPEND ${_laname} "dlpreopen='${_target_dlpreopen}'\n")
   FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
   FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/${_install_DIR}'\n")
-  INSTALL( FILES ${_laname} ${_soname}
-    DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR})
-ENDMACRO(CREATE_LIBTOOL_FILE)
+  INSTALL( FILES ${_laname} ${_soname} DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR})
+ENDMACRO()
  
 SET(LIBZIP_SOURCES
   gladman-fcrypt.c
@@ -122,6 +120,7 @@ SET(LIBZIP_SOURCES
   zip_set_file_compression.c
   zip_set_name.c
   zip_source_begin_write.c
+  zip_source_begin_write_cloning.c
   zip_source_buffer.c
   zip_source_call.c
   zip_source_close.c
@@ -166,12 +165,20 @@ SET(LIBZIP_SOURCES
 
 IF(WIN32)
   SET(LIBZIP_OPSYS_FILES
-    zip_random_win32.c
-    zip_source_win32a.c
     zip_source_win32handle.c
     zip_source_win32utf8.c
     zip_source_win32w.c
   )
+  IF(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
+    SET(LIBZIP_OPSYS_FILES "${LIBZIP_OPSYS_FILES}"
+      zip_random_uwp.c
+    )
+  ELSE()
+    SET(LIBZIP_OPSYS_FILES "${LIBZIP_OPSYS_FILES}"
+      zip_random_win32.c
+      zip_source_win32a.c
+    )
+  ENDIF()
 ELSE(WIN32)
   SET(LIBZIP_OPSYS_FILES
     zip_random_unix.c
@@ -183,21 +190,17 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/gladman-fcrypt
   ${CMAKE_CURRENT_BINARY_DIR}/..)
 
-# TODO: distribute instead?
-#ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c
-#  COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh
-#    ${CMAKE_CURRENT_SOURCE_DIR}/zip.h
-#    ${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c
-#  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/zip.h
-#    ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh
-#)
+ADD_CUSTOM_TARGET(update_zip_err_str
+  COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh ${CMAKE_CURRENT_SOURCE_DIR}/zip.h ${CMAKE_CURRENT_SOURCE_DIR}/zip_err_str.c
+  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/zip.h ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh
+)
 CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
 IF(NOT HAVE_MKSTEMP)
   SET(LIBZIP_EXTRA_FILES mkstemp.c)
 ENDIF(NOT HAVE_MKSTEMP)
 
 ADD_LIBRARY(zip ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPSYS_FILES})
-SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 3.0 SOVERSION 3 )
+SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 5.0 SOVERSION 5)
 TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY})
 INSTALL(TARGETS zip
   RUNTIME DESTINATION bin
diff --git a/lib/Makefile.am b/lib/Makefile.am
deleted file mode 100644 (file)
index 606410e..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-# for 'make dist'
-SUBDIRS=       gladman-fcrypt
-
-AM_CFLAGS=     @CFLAG_VISIBILITY@
-
-lib_LTLIBRARIES = libzip.la
-noinst_HEADERS = zipint.h gladman-fcrypt.h
-include_HEADERS = zip.h
-nodist_include_HEADERS = zipconf.h
-
-# also update CMakeLists.txt when changing version
-libzip_la_LDFLAGS=-no-undefined -version-info 5:0:0
-libzip_la_CPPFLAGS=-I$(srcdir)/gladman-fcrypt
-libzip_la_LIBADD=@LTLIBOBJS@
-
-if WIN32_HOST
-OS_SOURCES=\
-       zip_random_win32.c \
-       zip_source_win32a.c \
-       zip_source_win32handle.c \
-       zip_source_win32utf8.c \
-       zip_source_win32w.c
-else
-OS_SOURCES=\
-       zip_random_unix.c \
-       zip_source_file.c
-endif
-
-libzip_la_SOURCES=\
-       ${OS_SOURCES} \
-       gladman-fcrypt.c \
-       zip_add.c \
-       zip_add_dir.c \
-       zip_add_entry.c \
-       zip_algorithm_bzip2.c \
-       zip_algorithm_deflate.c \
-       zip_buffer.c \
-       zip_close.c \
-       zip_delete.c \
-       zip_dir_add.c \
-       zip_dirent.c \
-       zip_discard.c \
-       zip_entry.c \
-       zip_err_str.c \
-       zip_error.c \
-       zip_error_clear.c \
-       zip_error_get.c \
-       zip_error_get_sys_type.c \
-       zip_error_strerror.c \
-       zip_error_to_str.c \
-       zip_extra_field.c \
-       zip_extra_field_api.c \
-       zip_fclose.c \
-       zip_fdopen.c \
-       zip_file_add.c \
-       zip_file_error_clear.c \
-       zip_file_error_get.c \
-       zip_file_get_comment.c \
-       zip_file_get_external_attributes.c \
-       zip_file_get_offset.c \
-       zip_file_rename.c \
-       zip_file_replace.c \
-       zip_file_set_comment.c \
-       zip_file_set_encryption.c \
-       zip_file_set_external_attributes.c \
-       zip_file_set_mtime.c \
-       zip_file_strerror.c \
-       zip_filerange_crc.c \
-       zip_fopen.c \
-       zip_fopen_encrypted.c \
-       zip_fopen_index.c \
-       zip_fopen_index_encrypted.c \
-       zip_fread.c \
-       zip_fseek.c \
-       zip_ftell.c \
-       zip_get_archive_comment.c \
-       zip_get_archive_flag.c \
-       zip_get_encryption_implementation.c \
-       zip_get_file_comment.c \
-       zip_get_num_entries.c \
-       zip_get_num_files.c \
-       zip_get_name.c \
-       zip_hash.c \
-       zip_io_util.c \
-       zip_libzip_version.c \
-       zip_memdup.c \
-       zip_name_locate.c \
-       zip_new.c \
-       zip_open.c \
-       zip_progress.c \
-       zip_rename.c \
-       zip_replace.c \
-       zip_set_archive_comment.c \
-       zip_set_archive_flag.c \
-       zip_set_default_password.c \
-       zip_set_file_comment.c \
-       zip_set_file_compression.c \
-       zip_set_name.c \
-       zip_source_begin_write.c \
-       zip_source_buffer.c \
-       zip_source_call.c \
-       zip_source_close.c \
-       zip_source_commit_write.c \
-       zip_source_compress.c \
-       zip_source_crc.c \
-       zip_source_error.c \
-       zip_source_filep.c \
-       zip_source_free.c \
-       zip_source_function.c \
-       zip_source_get_compression_flags.c \
-       zip_source_is_deleted.c \
-       zip_source_layered.c \
-       zip_source_open.c \
-       zip_source_pkware.c \
-       zip_source_read.c \
-       zip_source_remove.c \
-       zip_source_rollback_write.c \
-       zip_source_seek.c \
-       zip_source_seek_write.c \
-       zip_source_stat.c \
-       zip_source_supports.c \
-       zip_source_tell.c \
-       zip_source_tell_write.c \
-       zip_source_window.c \
-       zip_source_winzip_aes_decode.c \
-       zip_source_winzip_aes_encode.c \
-       zip_source_write.c \
-       zip_source_zip.c \
-       zip_source_zip_new.c \
-       zip_stat.c \
-       zip_stat_index.c \
-       zip_stat_init.c \
-       zip_strerror.c \
-       zip_string.c \
-       zip_unchange.c \
-       zip_unchange_all.c \
-       zip_unchange_archive.c \
-       zip_unchange_data.c \
-       zip_utf-8.c
-
-BUILT_SOURCES=zipconf.h
-CLEANFILES=    ${BUILT_SOURCES}
-
-EXTRA_DIST=    CMakeLists.txt \
-               compat.h \
-               make_zip_err_str.sh \
-               make_zipconf.sh \
-               zip_source_win32a.c \
-               zip_source_win32handle.c \
-               zip_source_win32utf8.c \
-               zip_source_win32w.c \
-               zipwin32.h
-
-zip_err_str.c: zip.h make_zip_err_str.sh
-       sh $(srcdir)/make_zip_err_str.sh $(srcdir)/zip.h zip_err_str.c
-
-zipconf.h: ${top_builddir}/config.h make_zipconf.sh
-       sh ${srcdir}/make_zipconf.sh ${top_builddir}/config.h zipconf.h
index 625c84e..f2a5467 100644 (file)
@@ -3,7 +3,7 @@
 
 /*
   compat.h -- compatibility defines.
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 8488ae4..44622d3 100644 (file)
@@ -1,6 +1,6 @@
 /*
   gladman-fcrypt.c -- wrapper functions for Dr Gladman's AES functions
-  Copyright (C) 2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
diff --git a/lib/gladman-fcrypt/Makefile.am b/lib/gladman-fcrypt/Makefile.am
deleted file mode 100644 (file)
index 9714d6b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-EXTRA_DIST= \
-       aes.h \
-       aescrypt.c \
-       aeskey.c \
-       aesopt.h \
-       aestab.c \
-       fileenc.c \
-       fileenc.h \
-       hmac.c \
-       hmac.h \
-       pwd2key.c \
-       pwd2key.h \
-       sha1.c \
-       sha1.h
index b2c6c84..923d617 100644 (file)
@@ -46,7 +46,7 @@ extern "C"
 #error An illegal block size has been specified.
 #endif
 
-#define unused  77  /* Sunset Strip */
+#define libzip_fcrypt_unused  77  /* Sunset Strip */
 
 #define si(y,x,k,c) (s(y,c) = word_in(x + 4 * c) ^ k[c])
 #define so(y,x,c)   word_out(y + 4 * c, s(x,c))
@@ -61,14 +61,14 @@ extern "C"
    the following defines prevent the compiler requiring the declaration
    of generated but unused variables in the fwd_var and inv_var macros
  */
-#define b04 unused
-#define b05 unused
-#define b06 unused
-#define b07 unused
-#define b14 unused
-#define b15 unused
-#define b16 unused
-#define b17 unused
+#define b04 libzip_fcrypt_unused
+#define b05 libzip_fcrypt_unused
+#define b06 libzip_fcrypt_unused
+#define b07 libzip_fcrypt_unused
+#define b14 libzip_fcrypt_unused
+#define b15 libzip_fcrypt_unused
+#define b16 libzip_fcrypt_unused
+#define b17 libzip_fcrypt_unused
 #endif
 #define l_copy(y, x)    s(y,0) = s(x,0); s(y,1) = s(x,1); \
                         s(y,2) = s(x,2); s(y,3) = s(x,3);
@@ -83,10 +83,10 @@ extern "C"
 #else
 #define locals(y,x)     x##0,x##1,x##2,x##3,x##4,x##5, \
                         y##0,y##1,y##2,y##3,y##4,y##5
-#define b06 unused
-#define b07 unused
-#define b16 unused
-#define b17 unused
+#define b06 libzip_fcrypt_unused
+#define b07 libzip_fcrypt_unused
+#define b16 libzip_fcrypt_unused
+#define b17 libzip_fcrypt_unused
 #endif
 #define l_copy(y, x)    s(y,0) = s(x,0); s(y,1) = s(x,1); \
                         s(y,2) = s(x,2); s(y,3) = s(x,3); \
diff --git a/lib/gladman-fcrypt/main.c b/lib/gladman-fcrypt/main.c
deleted file mode 100644 (file)
index e5e5095..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- ---------------------------------------------------------------------------
- Copyright (c) 2002, Dr Brian Gladman <                 >, Worcester, UK.
- All rights reserved.
-
- LICENSE TERMS
-
- The free distribution and use of this software in both source and binary
- form is allowed (with or without changes) provided that:
-
-   1. distributions of this source code include the above copyright
-      notice, this list of conditions and the following disclaimer;
-
-   2. distributions in binary form include the above copyright
-      notice, this list of conditions and the following disclaimer
-      in the documentation and/or other associated materials;
-
-   3. the copyright holder's name is not used to endorse products
-      built using this software without specific written permission.
-
- ALTERNATIVELY, provided that this notice is retained in full, this product
- may be distributed under the terms of the GNU General Public License (GPL),
- in which case the provisions of the GPL apply INSTEAD OF those given above.
-
- DISCLAIMER
-
- This software is provided 'as is' with no explicit or implied warranties
- in respect of its properties, including, but not limited to, correctness
- and/or fitness for purpose.
- ---------------------------------------------------------------------------
- Issue Date: 18th November 2008
-
- A simple file encryption application based on
-
-    a. RFC2898 for key derivation (using HMAC-SHA1)
-    b. AES in CTR mode for encryption
-    c. HMAC-SHA1 for authentication
-    d. A Random Data Pool based on Peter Gutmann's ideas
-
-The command line is:
-
-    encfile password infile
-
- If the last file name extension is ".enc", the file is assumed to be an
- encrypted file and an attempt is made to decrypt it with the given password,
- writing the output to a file with the same name except for the ".enc" on the
- end.  Otherwise the file is encrypted with the given password and the output
- is written to a file with the same name except that ".enc" is added on the
- end.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <memory.h>
-#include <string.h>
-#include <windows.h>
-
-#include "fileenc.h"
-#include "prng.h"
-
-/* error numbers    */
-#define ERROR_USAGE              1
-#define ERROR_PASSWORD_LENGTH    2
-#define ERROR_OUT_OF_MEMORY      3
-#define ERROR_INPUT_FILE         4
-#define ERROR_OUTPUT_FILE        5
-#define ERROR_BAD_PASSWORD       6
-#define ERROR_BAD_AUTHENTICATION 7
-
-/* error messages   */
-char *err_string[] =
-{
-    "\nusage: encfile password infile outfile\n",
-    "\npassword is too short\n",
-    "\nmemory allocation has failed\n",
-    "\ncannot open the input file (%s)\n",
-    "\ncannot open the output file (%s)\n",
-    "\nbad password\n",
-    "\ndamaged file or incorrect password\n"
-};
-
-/* simple entropy collection function that uses the fast timer      */
-/* since we are not using the random pool for generating secret     */
-/* keys we don't need to be too worried about the entropy quality   */
-
-/* Modified in 2008 to add revised entropy generation courtesy of   */
-/* WinZip Inc. This code now performs the following sequence of     */
-/* entropy generation operations on sequential calls:               */ 
-/*                                                                  */
-/*      - the current 8-byte Windows performance counter value      */
-/*      - an 8-byte representation of the current date/time         */
-/*      - an 8-byte value built from the current process ID         */
-/*        and thread ID                                             */
-/*      - all subsequent calls return the then-current 8-byte       */
-/*        performance counter value                                 */
-
-int entropy_fun(unsigned char buf[], unsigned int len)
-{   unsigned __int64    pentium_tsc[1];
-    unsigned int        i;
-    static unsigned int num = 0;
-
-    switch(num)
-    {
-    /* use a value that is unlikely to repeat across system reboots         */
-    case 1: 
-        ++num;
-        GetSystemTimeAsFileTime((FILETIME *)pentium_tsc);
-        break;
-    /* use a value that distinguishes between different instances of this   */
-    /* code that might be running on different processors at the same time  */
-    case 2: 
-        ++num;
-        {   unsigned __int32 processtest = GetCurrentProcessId();
-            unsigned __int32 threadtest  = GetCurrentThreadId();
-
-            pentium_tsc[0] = processtest;
-            pentium_tsc[0] = (pentium_tsc[0] << 32) + threadtest;
-        }
-        break;
-    
-    /* use a rapidly-changing value -- check QueryPerformanceFrequency()    */
-    /* to ensure that QueryPerformanceCounter() will work                   */
-    case 0: 
-        ++num;
-    default:
-        QueryPerformanceCounter((LARGE_INTEGER *)pentium_tsc);
-        break;
-    }
-
-    for(i = 0; i < 8 && i < len; ++i)
-        buf[i] = ((unsigned char*)pentium_tsc)[i];
-    return i;
-}
-
-/* this is the main file encryption/decryption routine code */
-
-int main(int argc, char *argv[])
-{   FILE *inf, *outf;
-    unsigned char buf[1024], tmp_buf1[16], tmp_buf2[16], salt[16], *fname, *cp;
-    fcrypt_ctx  zcx[1];
-    int len, flen, err = 0;
-    unsigned char mode;
-
-    if(argc != 3)   /* the command line is bad  */
-    {
-        err = ERROR_USAGE; goto error_0;
-    }
-
-
-    len = (int)strlen(argv[1]);
-
-    if(len < 8)     /* password is too short    */
-    {
-        err = ERROR_PASSWORD_LENGTH; goto error_0;
-    }
-
-    /* set the key length based on password length assuming that there  */
-    /* are about 4 bits of entropy per password character (the key      */
-    /* length and other mode dependent parameter values are set using   */
-    /* macros defined in fileenc.h)                                     */
-    mode = (len < 32 ? 1 : len < 48 ? 2 : 3);
-
-    /* save input file name to a temporary memory area with extra space */
-    /* for the extension ".enc" to be added                             */
-    fname = (unsigned char*)malloc(strlen(argv[2]) + 5);
-    if(fname == NULL)
-    {
-        err = ERROR_OUT_OF_MEMORY; goto error_0;
-    }
-
-    /* open the input file  */
-    strcpy(fname, argv[2]);
-    if((inf = fopen(fname, "rb")) == NULL)
-    {
-        err = ERROR_INPUT_FILE; goto error_1;
-    }
-
-    /* if the file name extension is ".enc" assume this is an encrypted */
-    /* file                                                             */
-    if((cp = strrchr(fname, '.')) && strcmp(cp, ".enc") == 0)
-    {
-        *cp = 0;
-        mode |= 4;  /* signal decryption */
-    }
-    else                        /* add ".enc" to file name to mark the  */
-        strcat(fname, ".enc");  /* the file as an encrypted one         */
-
-    /* open output file for binary output */
-    if((outf = fopen(fname, "wb")) == NULL)
-    {
-        err = ERROR_OUTPUT_FILE; goto error_2;
-    }
-
-    if(!(mode & 4))         /* encryption operation     */
-    {
-        prng_ctx rng[1];    /* the context for the random number pool   */
-        prng_init(entropy_fun, rng);                /* initialise RNG   */
-        prng_rand(salt, SALT_LENGTH(mode), rng);    /* and the salt     */
-
-        /* write salt value         */
-        fwrite(salt, sizeof(unsigned char), SALT_LENGTH(mode), outf);
-
-        /* initialise encryption and authentication */
-#ifdef PASSWORD_VERIFIER
-        fcrypt_init(mode, argv[1], (unsigned int)strlen(argv[1]), salt, tmp_buf1, zcx);
-        /* write password verifier (if used)        */
-        fwrite(tmp_buf1, sizeof(unsigned char), PWD_VER_LENGTH, outf);
-#else
-        fcrypt_init(mode, argv[1], (unsigned int)strlen(argv[1]), salt, zcx);
-#endif
-        /* encrypt and authenticate the file        */
-        len = (int)fread(buf, sizeof(unsigned char), 1024, inf);
-        while(len)
-        {
-            fcrypt_encrypt(buf, len, zcx);
-            fwrite(buf, sizeof(unsigned char), len, outf);
-            len = (int)fread(buf, sizeof(unsigned char), len, inf);
-        }
-
-        /* write the MAC    */
-        fcrypt_end(tmp_buf1, zcx);
-        fwrite(tmp_buf1, sizeof(unsigned char), MAC_LENGTH(mode), outf);
-
-        /* and close random pool    */
-        prng_end(rng);
-    }
-    else                    /* decryption operation     */
-    {
-        /* we need to know the file length to avoid reading the MAC */
-        fseek(inf, 0, SEEK_END);
-        flen = ftell(inf);
-        fseek(inf, 0, SEEK_SET);
-        mode &= 3;
-
-        /* recover the password salt     */
-        fread(salt, sizeof(unsigned char), SALT_LENGTH(mode), inf); flen -= SALT_LENGTH(mode);
-#ifdef  PASSWORD_VERIFIER
-        /* initialise encryption and authentication */
-        fcrypt_init(mode, argv[1], (unsigned int)strlen(argv[1]), salt, tmp_buf2, zcx);
-        /* recover the password verifier (if used)  */
-        fread(tmp_buf1, sizeof(unsigned char), PWD_VER_LENGTH, inf); flen -= PWD_VER_LENGTH;
-        /* check password verifier  */
-        if(memcmp(tmp_buf1, tmp_buf2, PWD_VER_LENGTH))
-        {
-            err = ERROR_BAD_PASSWORD; fclose(outf); goto error_2;
-        }
-#else
-        /* initialise encryption and authentication */
-        fcrypt_init(mode, argv[1], (unsigned int)strlen(argv[1]), salt, zcx);
-#endif
-
-        flen -= MAC_LENGTH(mode);   /* avoid reading the MAC    */
-        /* decrypt the file     */
-        len = (int)fread(buf, sizeof(unsigned char),
-                    (size_t)(flen < 1024 ? flen : 1024), inf);
-        while(len)
-        {   flen -= len;
-            fcrypt_decrypt(buf, len, zcx);
-            fwrite(buf, sizeof(unsigned char), len, outf);
-            len = (int)fread(buf, sizeof(unsigned char),
-                        (size_t)(flen < 1024 ? flen : 1024), inf);
-        }
-
-        /* calculate the MAC value          */
-        fcrypt_end(tmp_buf2, zcx);
-
-        /* now read the stored MAC value    */
-        fread(tmp_buf1, sizeof(unsigned char), MAC_LENGTH(mode), inf);
-
-        /* compare the stored and calculated MAC values */
-        if(memcmp(tmp_buf1, tmp_buf2, MAC_LENGTH(mode)))
-        {   /* authentication failed        */
-
-            err = ERROR_BAD_AUTHENTICATION;
-            fclose(outf);
-            /* delete the (bad) output file */
-            remove(fname);
-            goto error_2;
-        }
-    }
-
-    fclose(outf);
-error_2:
-    fclose(inf);
-error_1:
-    free(fname);
-error_0:
-    if(err)
-        printf(err_string[err - 1], fname);
-    return -err;
-}
diff --git a/lib/gladman-fcrypt/prng.c b/lib/gladman-fcrypt/prng.c
deleted file mode 100644 (file)
index cdb3ca3..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- ---------------------------------------------------------------------------
- Copyright (c) 2002, Dr Brian Gladman <                 >, Worcester, UK.
- All rights reserved.
-
- LICENSE TERMS
-
- The free distribution and use of this software in both source and binary
- form is allowed (with or without changes) provided that:
-
-   1. distributions of this source code include the above copyright
-      notice, this list of conditions and the following disclaimer;
-
-   2. distributions in binary form include the above copyright
-      notice, this list of conditions and the following disclaimer
-      in the documentation and/or other associated materials;
-
-   3. the copyright holder's name is not used to endorse products
-      built using this software without specific written permission.
-
- ALTERNATIVELY, provided that this notice is retained in full, this product
- may be distributed under the terms of the GNU General Public License (GPL),
- in which case the provisions of the GPL apply INSTEAD OF those given above.
-
- DISCLAIMER
-
- This software is provided 'as is' with no explicit or implied warranties
- in respect of its properties, including, but not limited to, correctness
- and/or fitness for purpose.
- ---------------------------------------------------------------------------
- Issue Date: 24/01/2003
-
- This file implements a random data pool based on the use of an external
- entropy function.  It is based on the ideas advocated by Peter Gutmann in
- his work on pseudo random sequence generators.  It is not a 'paranoid'
- random sequence generator and no attempt is made to protect the pool
- from prying eyes either by memory locking or by techniques to obscure
- its location in memory.
-*/
-
-#include <memory.h>
-#include "prng.h"
-
-#if defined(__cplusplus)
-extern "C"
-{
-#endif
-
-/* mix a random data pool using the SHA1 compression function (as   */
-/* suggested by Peter Gutmann in his paper on random pools)         */
-
-static void prng_mix(unsigned char buf[])
-{   unsigned int    i, len;
-    sha1_ctx        ctx[1];
-
-    /*lint -e{663}  unusual array to pointer conversion */
-    for(i = 0; i < PRNG_POOL_SIZE; i += SHA1_DIGEST_SIZE)
-    {
-        /* copy digest size pool block into SHA1 hash block */
-        memcpy(ctx->hash, buf + (i ? i : PRNG_POOL_SIZE)
-                            - SHA1_DIGEST_SIZE, SHA1_DIGEST_SIZE);
-
-        /* copy data from pool into the SHA1 data buffer    */
-        len = PRNG_POOL_SIZE - i;
-        memcpy(ctx->wbuf, buf + i, (len > SHA1_BLOCK_SIZE ? SHA1_BLOCK_SIZE : len));
-
-        if(len < SHA1_BLOCK_SIZE)
-            memcpy(((char*)ctx->wbuf) + len, buf, SHA1_BLOCK_SIZE - len);
-
-        /* compress using the SHA1 compression function     */
-        sha1_compile(ctx);
-
-        /* put digest size block back into the random pool  */
-        memcpy(buf + i, ctx->hash, SHA1_DIGEST_SIZE);
-    }
-}
-
-/* refresh the output buffer and update the random pool by adding   */
-/* entropy and remixing                                             */
-
-static void update_pool(prng_ctx ctx[1])
-{   unsigned int    i = 0;
-
-    /* transfer random pool data to the output buffer   */
-    memcpy(ctx->obuf, ctx->rbuf, PRNG_POOL_SIZE);
-
-    /* enter entropy data into the pool */
-    while(i < PRNG_POOL_SIZE)
-        i += ctx->entropy(ctx->rbuf + i, PRNG_POOL_SIZE - i);
-
-    /* invert and xor the original pool data into the pool  */
-    for(i = 0; i < PRNG_POOL_SIZE; ++i)
-        ctx->rbuf[i] ^= ~ctx->obuf[i];
-
-    /* mix the pool and the output buffer   */
-    prng_mix(ctx->rbuf);
-    prng_mix(ctx->obuf);
-}
-
-INTERNAL void prng_init(prng_entropy_fn fun, prng_ctx ctx[1])
-{   int i;
-
-    /* clear the buffers and the counter in the context     */
-    memset(ctx, 0, sizeof(prng_ctx));
-
-    /* set the pointer to the entropy collection function   */
-    ctx->entropy = fun;
-
-    /* initialise the random data pool                      */
-    update_pool(ctx);
-
-    /* mix the pool a minimum number of times               */
-    for(i = 0; i < PRNG_MIN_MIX; ++i)
-        prng_mix(ctx->rbuf);
-
-    /* update the pool to prime the pool output buffer      */
-    update_pool(ctx);
-}
-
-/* provide random bytes from the random data pool   */
-
-INTERNAL void prng_rand(unsigned char data[], unsigned int data_len, prng_ctx ctx[1])
-{   unsigned char   *rp = data;
-    unsigned int    len, pos = ctx->pos;
-
-    while(data_len)
-    {
-        /* transfer 'data_len' bytes (or the number of bytes remaining  */
-        /* the pool output buffer if less) into the output              */
-        len = (data_len < PRNG_POOL_SIZE - pos ? data_len : PRNG_POOL_SIZE - pos);
-        memcpy(rp, ctx->obuf + pos, len);
-        rp += len;          /* update ouput buffer position pointer     */
-        pos += len;         /* update pool output buffer pointer        */
-        data_len -= len;    /* update the remaining data count          */
-
-        /* refresh the random pool if necessary */
-        if(pos == PRNG_POOL_SIZE)
-        {
-            update_pool(ctx); pos = 0;
-        }
-    }
-
-    ctx->pos = pos;
-}
-
-INTERNAL void prng_end(prng_ctx ctx[1])
-{
-    /* ensure the data in the context is destroyed  */
-    memset(ctx, 0, sizeof(prng_ctx));
-}
-
-#if defined(__cplusplus)
-}
-#endif
-
diff --git a/lib/gladman-fcrypt/prng.h b/lib/gladman-fcrypt/prng.h
deleted file mode 100644 (file)
index 87c99d1..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- ---------------------------------------------------------------------------
- Copyright (c) 2002, Dr Brian Gladman <                 >, Worcester, UK.
- All rights reserved.
-
- LICENSE TERMS
-
- The free distribution and use of this software in both source and binary
- form is allowed (with or without changes) provided that:
-
-   1. distributions of this source code include the above copyright
-      notice, this list of conditions and the following disclaimer;
-
-   2. distributions in binary form include the above copyright
-      notice, this list of conditions and the following disclaimer
-      in the documentation and/or other associated materials;
-
-   3. the copyright holder's name is not used to endorse products
-      built using this software without specific written permission.
-
- ALTERNATIVELY, provided that this notice is retained in full, this product
- may be distributed under the terms of the GNU General Public License (GPL),
- in which case the provisions of the GPL apply INSTEAD OF those given above.
-
- DISCLAIMER
-
- This software is provided 'as is' with no explicit or implied warranties
- in respect of its properties, including, but not limited to, correctness
- and/or fitness for purpose.
- ---------------------------------------------------------------------------
- Issue Date: 24/01/2003
-
- This is the header file for an implementation of a random data pool based on
- the use of an external entropy function (inspired by Peter Gutmann's work).
-*/
-
-#ifndef _PRNG_H
-#define _PRNG_H
-
-#include "sha1.h"
-
-#define PRNG_POOL_LEN    256    /* minimum random pool size             */
-#define PRNG_MIN_MIX      20    /* min initial pool mixing iterations   */
-
-/* ensure that pool length is a multiple of the SHA1 digest size        */
-
-#define PRNG_POOL_SIZE  (SHA1_DIGEST_SIZE * (1 + (PRNG_POOL_LEN - 1) / SHA1_DIGEST_SIZE))
-
-#if defined(__cplusplus)
-extern "C"
-{
-#endif
-
-/* A function for providing entropy is a parameter in the prng_init()   */
-/* call.  This function has the following form and returns a maximum    */
-/* of 'len' bytes of pseudo random data in the buffer 'buf'.  It can    */
-/* return less than 'len' bytes but will be repeatedly called for more  */
-/* data in this case.                                                   */
-
-typedef int (*prng_entropy_fn)(unsigned char buf[], unsigned int len);
-
-typedef struct
-{   unsigned char   rbuf[PRNG_POOL_SIZE];   /* the random pool          */
-    unsigned char   obuf[PRNG_POOL_SIZE];   /* pool output buffer       */
-    unsigned int    pos;                    /* output buffer position   */
-    prng_entropy_fn entropy;                /* entropy function pointer */
-} prng_ctx;
-
-/* initialise the random stream generator   */
-INTERNAL void prng_init(prng_entropy_fn fun, prng_ctx ctx[1]);
-
-/* obtain random bytes from the generator   */
-INTERNAL void prng_rand(unsigned char data[], unsigned int data_len, prng_ctx ctx[1]);
-
-/* close the random stream generator        */
-INTERNAL void prng_end(prng_ctx ctx[1]);
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif
index ec3ec30..3dc0695 100644 (file)
--- a/lib/zip.h
+++ b/lib/zip.h
@@ -3,7 +3,7 @@
 
 /*
   zip.h -- exported declarations.
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
 */
 
 
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* fix autoindent */
+#endif
+#endif
+
+#include <zipconf.h>
+
 #ifndef ZIP_EXTERN
 # ifndef ZIP_STATIC
 #  ifdef _WIN32
 # endif
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* fix autoindent */
-#endif
-#endif
-
-#include <zipconf.h>
-
 #include <sys/types.h>
 #include <stdio.h>
 #include <time.h>
@@ -228,11 +228,12 @@ enum zip_source_cmd {
     ZIP_SOURCE_TELL_WRITE,      /* get write position */
     ZIP_SOURCE_SUPPORTS,        /* check whether source supports command */
     ZIP_SOURCE_REMOVE,          /* remove file */
-    ZIP_SOURCE_GET_COMPRESSION_FLAGS   /* get compression flags, internal only */
+    ZIP_SOURCE_GET_COMPRESSION_FLAGS,  /* get compression flags, internal only */
+    ZIP_SOURCE_BEGIN_WRITE_CLONING     /* like ZIP_SOURCE_BEGIN_WRITE, but keep part of original file */
 };
 typedef enum zip_source_cmd zip_source_cmd_t;
 
-#define ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd)    (((zip_uint64_t)1)<<(cmd))
+#define ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd)    (((zip_int64_t)1)<<(cmd))
 
 #define ZIP_SOURCE_SUPPORTS_READABLE   (ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_OPEN) \
                                          | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_READ) \
@@ -296,6 +297,11 @@ struct zip_stat {
     zip_uint32_t flags;                        /* reserved for future use */
 };
 
+struct zip_buffer_fragment {
+    zip_uint8_t *data;
+    zip_uint64_t length;
+};
+
 struct zip;
 struct zip_file;
 struct zip_source;
@@ -305,6 +311,7 @@ typedef struct zip_error zip_error_t;
 typedef struct zip_file zip_file_t;
 typedef struct zip_source zip_source_t;
 typedef struct zip_stat zip_stat_t;
+typedef struct zip_buffer_fragment zip_buffer_fragment_t;
 
 typedef zip_uint32_t zip_flags_t;
 
@@ -313,7 +320,7 @@ typedef void (*zip_progress_callback)(zip_t *, double, void *);
 
 #ifndef ZIP_DISABLE_DEPRECATED
 typedef void (*zip_progress_callback_t)(double);
-ZIP_EXTERN void zip_register_progress_callback(zip_t *, zip_progress_callback_t);
+ZIP_EXTERN void zip_register_progress_callback(zip_t *, zip_progress_callback_t); /* use zip_register_progress_callback_with_state */
 
 ZIP_EXTERN zip_int64_t zip_add(zip_t *, const char *, zip_source_t *); /* use zip_file_add */
 ZIP_EXTERN zip_int64_t zip_add_dir(zip_t *, const char *); /* use zip_dir_add */
@@ -324,7 +331,7 @@ ZIP_EXTERN int zip_replace(zip_t *, zip_uint64_t, zip_source_t *); /* use zip_fi
 ZIP_EXTERN int zip_set_file_comment(zip_t *, zip_uint64_t, const char *, int); /* use zip_file_set_comment */
 ZIP_EXTERN int zip_error_get_sys_type(int); /* use zip_error_system_type */
 ZIP_EXTERN void zip_error_get(zip_t *, int *, int *); /* use zip_get_error, zip_error_code_zip / zip_error_code_system */
-ZIP_EXTERN int zip_error_to_str(char *, zip_uint64_t, int, int);
+ZIP_EXTERN int zip_error_to_str(char *, zip_uint64_t, int, int); /* use zip_error_init_with_code / zip_error_strerror */
 ZIP_EXTERN void zip_file_error_get(zip_file_t *, int *, int *); /* use zip_file_get_error, zip_error_code_zip / zip_error_code_system */
 #endif
 
@@ -387,8 +394,11 @@ ZIP_EXTERN int zip_set_archive_flag(zip_t *, zip_flags_t, int);
 ZIP_EXTERN int zip_set_default_password(zip_t *, const char *);
 ZIP_EXTERN int zip_set_file_compression(zip_t *, zip_uint64_t, zip_int32_t, zip_uint32_t);
 ZIP_EXTERN int zip_source_begin_write(zip_source_t *);
+ZIP_EXTERN int zip_source_begin_write_cloning(zip_source_t *, zip_uint64_t);
 ZIP_EXTERN zip_source_t *zip_source_buffer(zip_t *, const void *, zip_uint64_t, int);
 ZIP_EXTERN zip_source_t *zip_source_buffer_create(const void *, zip_uint64_t, int, zip_error_t *);
+ZIP_EXTERN zip_source_t *zip_source_buffer_fragment(zip_t *, const zip_buffer_fragment_t *, zip_uint64_t, int);
+ZIP_EXTERN zip_source_t *zip_source_buffer_fragment_create(const zip_buffer_fragment_t *, zip_uint64_t, int, zip_error_t *);
 ZIP_EXTERN int zip_source_close(zip_source_t *);
 ZIP_EXTERN int zip_source_commit_write(zip_source_t *);
 ZIP_EXTERN zip_error_t *zip_source_error(zip_source_t *);
index fd74503..1748fd4 100644 (file)
@@ -270,6 +270,6 @@ zip_compression_algorithm_t zip_algorithm_bzip2_decompress = {
 
 #else
 
-static int dummy;
+static int dummy __attribute__((used));
 
 #endif /* HAVE_LIBBZ2 */
index 2aff0dd..a4b1761 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_close.c -- close zip archive and update changes
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -59,7 +59,7 @@ static int write_cdir(zip_t *, const zip_filelist_t *, zip_uint64_t);
 ZIP_EXTERN int
 zip_close(zip_t *za)
 {
-    zip_uint64_t i, j, survivors;
+    zip_uint64_t i, j, survivors, unchanged_offset;
     zip_int64_t off;
     int error;
     zip_filelist_t *filelist;
@@ -95,10 +95,15 @@ zip_close(zip_t *za)
     if ((filelist=(zip_filelist_t *)malloc(sizeof(filelist[0])*(size_t)survivors)) == NULL)
        return -1;
 
+    unchanged_offset = ZIP_UINT64_MAX;
     /* create list of files with index into original archive  */
     for (i=j=0; i<za->nentry; i++) {
-       if (za->entry[i].deleted)
+        if (za->entry[i].orig != NULL && ZIP_ENTRY_HAS_CHANGES(&za->entry[i])) {
+            unchanged_offset = ZIP_MIN(unchanged_offset, za->entry[i].orig->offset);
+        }
+        if (za->entry[i].deleted) {
            continue;
+        }
 
         if (j >= survivors) {
             free(filelist);
@@ -115,10 +120,43 @@ zip_close(zip_t *za)
         return -1;
     }
 
-    if (zip_source_begin_write(za->src) < 0) {
-       _zip_error_set_from_source(&za->error, za->src);
-       free(filelist);
-       return -1;
+    if ((zip_source_supports(za->src) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_BEGIN_WRITE_CLONING)) == 0) {
+        unchanged_offset = 0;
+    }
+    else {
+        if (unchanged_offset == ZIP_UINT64_MAX) {
+            /* we're keeping all file data, find the end of the last one */
+            zip_uint64_t last_index = ZIP_UINT64_MAX;
+            unchanged_offset = 0;
+
+            for (i = 0; i < za->nentry; i++) {
+                if (za->entry[i].orig != NULL) {
+                    if (za->entry[i].orig->offset >= unchanged_offset) {
+                        unchanged_offset = za->entry[i].orig->offset;
+                        last_index = i;
+                    }
+                }
+            }
+            if (last_index != ZIP_UINT64_MAX) {
+                if ((unchanged_offset = _zip_file_get_end(za, last_index, &za->error)) == 0) {
+                    free(filelist);
+                    return -1;
+                }
+            }
+        }
+        if (unchanged_offset > 0) {
+            if (zip_source_begin_write_cloning(za->src, unchanged_offset) < 0) {
+                /* cloning not supported, need to copy everything */
+                unchanged_offset = 0;
+            }
+        }
+    }
+    if (unchanged_offset == 0) {
+        if (zip_source_begin_write(za->src) < 0) {
+            _zip_error_set_from_source(&za->error, za->src);
+            free(filelist);
+            return -1;
+        }
     }
 
     _zip_progress_start(za->progress);
@@ -133,6 +171,11 @@ zip_close(zip_t *za)
        i = filelist[j].idx;
        entry = za->entry+i;
 
+        if (entry->orig != NULL && entry->orig->offset < unchanged_offset) {
+            /* already implicitly copied by cloning */
+            continue;
+        }
+
        new_data = (ZIP_ENTRY_DATA_CHANGED(entry) || ZIP_ENTRY_CHANGED(entry, ZIP_DIRENT_COMP_METHOD) || ZIP_ENTRY_CHANGED(entry, ZIP_DIRENT_ENCRYPTION_METHOD));
 
        /* create new local directory entry */
@@ -567,18 +610,22 @@ _zip_changed(const zip_t *za, zip_uint64_t *survivorsp)
     changed = 0;
     survivors = 0;
 
-    if (za->comment_changed || za->ch_flags != za->flags)
+    if (za->comment_changed || za->ch_flags != za->flags) {
        changed = 1;
+    }
 
     for (i=0; i<za->nentry; i++) {
-       if (za->entry[i].deleted || za->entry[i].source || (za->entry[i].changes && za->entry[i].changes->changed != 0))
+        if (ZIP_ENTRY_HAS_CHANGES(&za->entry[i])) {
            changed = 1;
-       if (!za->entry[i].deleted)
-           survivors++;
+        }
+        if (!za->entry[i].deleted) {
+            survivors++;
+        }
     }
 
-    if (survivorsp)
+    if (survivorsp) {
        *survivorsp = survivors;
+    }
 
     return changed;
 }
index e5a7cc9..b9feb84 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_dirent.c -- read directory entry (local or central), clean dirent
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 93bdf3a..f0188b5 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_discard.c -- discard and free struct zip
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index a01ff79..92f36de 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_extra_field.c -- manipulate extra fields
-  Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -162,7 +162,7 @@ _zip_ef_merge(zip_extra_field_t *to, zip_extra_field_t *from)
 
        duplicate = 0;
        for (tt=to; tt; tt=tt->next) {
-           if (tt->id == from->id && tt->size == from->size && memcmp(tt->data, from->data, tt->size) == 0) {
+           if (tt->id == from->id && tt->size == from->size && (tt->size == 0 || memcmp(tt->data, from->data, tt->size) == 0)) {
                tt->flags |= (from->flags & ZIP_EF_BOTH);
                duplicate = 1;
                break;
index 8b0a66d..3fd771f 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_fdopen.c -- open read-only archive from file descriptor
-  Copyright (C) 2009-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2009-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 826650e..16becaf 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_file_get_offset.c -- get offset of file data in archive.
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -53,6 +53,11 @@ _zip_file_get_offset(const zip_t *za, zip_uint64_t idx, zip_error_t *error)
     zip_uint64_t offset;
     zip_int32_t size;
 
+    if (za->entry[idx].orig == NULL) {
+        zip_error_set(error, ZIP_ER_INTERNAL, 0);
+        return 0;
+    }
+
     offset = za->entry[idx].orig->offset;
 
     if (zip_source_seek(za->src, (zip_int64_t)offset, SEEK_SET) < 0) {
@@ -71,3 +76,47 @@ _zip_file_get_offset(const zip_t *za, zip_uint64_t idx, zip_error_t *error)
     
     return offset + (zip_uint32_t)size;
 }
+
+zip_uint64_t
+_zip_file_get_end(const zip_t *za, zip_uint64_t index, zip_error_t *error)
+{
+    zip_uint64_t offset;
+    zip_dirent_t *entry;
+
+    if ((offset = _zip_file_get_offset(za, index, error)) == 0) {
+        return 0;
+    }
+
+    entry = za->entry[index].orig;
+
+    if (offset + entry->comp_size < offset || offset + entry->comp_size > ZIP_INT64_MAX) {
+        zip_error_set(error, ZIP_ER_SEEK, EFBIG);
+        return 0;
+    }
+    offset += entry->comp_size;
+
+    if (entry->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) {
+        zip_uint8_t buf[4];
+        if (zip_source_seek(za->src, (zip_int64_t)offset, SEEK_SET) < 0) {
+            _zip_error_set_from_source(error, za->src);
+            return 0;
+        }
+        if (zip_source_read(za->src, buf, 4) != 4) {
+            _zip_error_set_from_source(error, za->src);
+            return 0;
+        }
+        if (memcmp(buf, DATADES_MAGIC, 4) == 0) {
+            offset += 4;
+        }
+        offset += 12;
+        if (_zip_dirent_needs_zip64(entry, 0)) {
+            offset += 8;
+        }
+        if (offset > ZIP_INT64_MAX) {
+            zip_error_set(error, ZIP_ER_SEEK, EFBIG);
+            return 0;
+        }
+    }
+
+    return offset;
+}
index a7ed748..6e16135 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_file_set_encryption.c -- set encryption for file in archive
-  Copyright (C) 2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index fc854a8..992e9d9 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_hash.c -- hash table string -> uint64
-  Copyright (C) 2015-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2015-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 96ece2d..da841ff 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_new.c -- create and init struct zip
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 9d3a4cb..6c62eef 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_open.c -- open zip archive by name
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 26706f0..2684456 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_random_unix.c -- fill the user's buffer with random stuff (Unix version)
-  Copyright (C) 2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
diff --git a/lib/zip_random_uwp.c b/lib/zip_random_uwp.c
new file mode 100644 (file)
index 0000000..aeead0f
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+  zip_random_uwp.c -- fill the user's buffer with random stuff (UWP version)
+  Copyright (C) 2017 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip@nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <windows.h>
+#include <ntstatus.h>
+#include <bcrypt.h>
+
+#include "zipint.h"
+#include "zipwin32.h"
+
+bool
+zip_random(zip_uint8_t *buffer, zip_uint16_t length)
+{
+    BCRYPT_ALG_HANDLE hAlg = NULL;
+    NTSTATUS hr = BCryptOpenAlgorithmProvider(&hAlg, BCRYPT_RNG_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0);
+    if (hr != STATUS_SUCCESS || hAlg == NULL) {
+       return false;
+    }
+    hr = BCryptGenRandom(&hAlg, buffer, length, 0);
+    BCryptCloseAlgorithmProvider(&hAlg, 0);
+    if (hr != STATUS_SUCCESS) {
+       return false;
+    }
+    return true;
+}
index a35290d..5738aab 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_set_file_compression.c -- set compression for file in archive
-  Copyright (C) 2012-2014 Dieter Baron and Thomas Klausner
+  Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
diff --git a/lib/zip_source_begin_write_cloning.c b/lib/zip_source_begin_write_cloning.c
new file mode 100644 (file)
index 0000000..ad2cfac
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+  zip_source_begin_write_cloning.c -- clone part of file for writing
+  Copyright (C) 2017 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip@nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#include "zipint.h"
+
+
+ZIP_EXTERN int
+zip_source_begin_write_cloning(zip_source_t *src, zip_uint64_t offset)
+{
+    if (ZIP_SOURCE_IS_OPEN_WRITING(src)) {
+        zip_error_set(&src->error, ZIP_ER_INVAL, 0);
+        return -1;
+    }
+    
+    if (_zip_source_call(src, NULL, offset, ZIP_SOURCE_BEGIN_WRITE_CLONING) < 0) {
+        return -1;
+    }
+
+    src->write_state = ZIP_SOURCE_WRITE_OPEN;
+    
+    return 0;
+}
index f3f8ee0..86ed750 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_buffer.c -- create zip data source from buffer
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
 #include "zipint.h"
 
 #ifndef WRITE_FRAGMENT_SIZE
-#define WRITE_FRAGMENT_SIZE 64*1024
+#define WRITE_FRAGMENT_SIZE (64*1024)
 #endif
 
 struct buffer {
-    zip_uint64_t fragment_size;                /* size of each fragment */
-
-    zip_uint8_t **fragments;           /* pointers to fragments */
-    zip_uint64_t nfragments;           /* number of allocated fragments */
-    zip_uint64_t fragments_capacity;   /* size of fragments (number of pointers) */
-    zip_uint64_t size;                 /* size of data in bytes */
-    zip_uint64_t offset;               /* current offset */
-    int free_data;
+    zip_buffer_fragment_t *fragments;  /* fragments */
+    zip_uint64_t *fragment_offsets;    /* offset of each fragment from start of buffer, nfragments+1 entries */
+    zip_uint64_t nfragments;           /* number of allocated fragments */
+    zip_uint64_t fragments_capacity;    /* size of fragments (number of pointers) */
+
+    zip_uint64_t first_owned_fragment; /* first fragment to free data from */
+
+    zip_uint64_t shared_fragments;     /* number of shared fragments */
+    struct buffer *shared_buffer;      /* buffer fragments are shared with */
+    zip_uint64_t size;                 /* size of buffer */
+
+    zip_uint64_t offset;               /* current offset in buffer */
+    zip_uint64_t current_fragment;     /* fragment current offset is in */
 };
 
 typedef struct buffer buffer_t;
@@ -60,10 +65,14 @@ struct read_data {
     buffer_t *out;
 };
 
+#define buffer_capacity(buffer)                ((buffer)->fragment_offsets[(buffer)->nfragments])
+#define buffer_size(buffer)    ((buffer)->size)
+
+static buffer_t *buffer_clone(buffer_t *buffer, zip_uint64_t length, zip_error_t *error);
+static zip_uint64_t buffer_find_fragment(const buffer_t *buffer, zip_uint64_t offset);
 static void buffer_free(buffer_t *buffer);
-static buffer_t *buffer_new(zip_uint64_t fragment_size);
-static buffer_t *buffer_new_read(const void *data, zip_uint64_t length, int free_data);
-static buffer_t *buffer_new_write(zip_uint64_t fragment_size);
+static bool buffer_grow_fragments(buffer_t *buffer, zip_uint64_t capacity, zip_error_t *error);
+static buffer_t *buffer_new(const zip_buffer_fragment_t *fragments, zip_uint64_t nfragments, int free_data, zip_error_t *error);
 static zip_int64_t buffer_read(buffer_t *buffer, zip_uint8_t *data, zip_uint64_t length);
 static int buffer_seek(buffer_t *buffer, void *data, zip_uint64_t len, zip_error_t *error);
 static zip_int64_t buffer_write(buffer_t *buffer, const zip_uint8_t *data, zip_uint64_t length, zip_error_t *);
@@ -84,25 +93,54 @@ zip_source_buffer(zip_t *za, const void *data, zip_uint64_t len, int freep)
 ZIP_EXTERN zip_source_t *
 zip_source_buffer_create(const void *data, zip_uint64_t len, int freep, zip_error_t *error)
 {
+    zip_buffer_fragment_t fragment;
+
+    if (data == NULL && len > 0) {
+        zip_error_set(error, ZIP_ER_INVAL, 0);
+        return NULL;
+    }
+
+    fragment.data = (zip_uint8_t *)data;
+    fragment.length = len;
+
+    return zip_source_buffer_fragment_create(&fragment, 1, freep, error);
+}
+
+
+ZIP_EXTERN zip_source_t *
+zip_source_buffer_fragment(zip_t *za, const zip_buffer_fragment_t *fragments, zip_uint64_t nfragments, int freep)
+{
+    if (za == NULL) {
+        return NULL;
+    }
+
+    return zip_source_buffer_fragment_create(fragments, nfragments, freep, &za->error);
+}
+
+
+ZIP_EXTERN zip_source_t *
+zip_source_buffer_fragment_create(const zip_buffer_fragment_t *fragments, zip_uint64_t nfragments, int freep, zip_error_t *error)
+{
     struct read_data *ctx;
     zip_source_t *zs;
+    buffer_t *buffer;
 
-    if (data == NULL && len > 0) {
-       zip_error_set(error, ZIP_ER_INVAL, 0);
-       return NULL;
+    if (fragments == NULL && nfragments > 0) {
+        zip_error_set(error, ZIP_ER_INVAL, 0);
+        return NULL;
     }
 
-    if ((ctx=(struct read_data *)malloc(sizeof(*ctx))) == NULL) {
-       zip_error_set(error, ZIP_ER_MEMORY, 0);
-       return NULL;
+    if ((buffer = buffer_new(fragments, nfragments, freep, error)) == NULL) {
+        return NULL;
     }
 
-    if ((ctx->in = buffer_new_read(data, len, freep)) == NULL) {
+    if ((ctx=(struct read_data *)malloc(sizeof(*ctx))) == NULL) {
        zip_error_set(error, ZIP_ER_MEMORY, 0);
-       free(ctx);
+        buffer_free(buffer);
        return NULL;
     }
 
+    ctx->in = buffer;
     ctx->out = NULL;
     ctx->mtime = time(NULL);
     zip_error_init(&ctx->error);
@@ -124,12 +162,21 @@ read_data(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd)
 
     switch (cmd) {
         case ZIP_SOURCE_BEGIN_WRITE:
-           if ((ctx->out = buffer_new_write(WRITE_FRAGMENT_SIZE)) == NULL) {
-               zip_error_set(&ctx->error, ZIP_ER_MEMORY, 0);
+           if ((ctx->out = buffer_new(NULL, 0, 0, &ctx->error)) == NULL) {
                return -1;
            }
+            ctx->out->offset = 0;
+            ctx->out->current_fragment = 0;
            return 0;
 
+        case ZIP_SOURCE_BEGIN_WRITE_CLONING:
+            if ((ctx->out = buffer_clone(ctx->in, len, &ctx->error)) == NULL) {
+                return -1;
+            }
+            ctx->out->offset = len;
+            ctx->out->current_fragment = ctx->out->nfragments;
+            return 0;
+
         case ZIP_SOURCE_CLOSE:
             return 0;
             
@@ -150,6 +197,7 @@ read_data(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd)
             
         case ZIP_SOURCE_OPEN:
            ctx->in->offset = 0;
+            ctx->in->current_fragment = 0;
             return 0;
        
         case ZIP_SOURCE_READ:
@@ -161,9 +209,8 @@ read_data(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd)
        
         case ZIP_SOURCE_REMOVE:
        {
-           buffer_t *empty = buffer_new_read(NULL, 0, 0);
-           if (empty == 0) {
-               zip_error_set(&ctx->error, ZIP_ER_MEMORY, 0);
+            buffer_t *empty = buffer_new(NULL, 0, 0, &ctx->error);
+           if (empty == NULL) {
                return -1;
            }
        
@@ -206,7 +253,7 @@ read_data(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd)
        }
 
         case ZIP_SOURCE_SUPPORTS:
-           return zip_source_make_command_bitmap(ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_SEEK, ZIP_SOURCE_TELL, ZIP_SOURCE_BEGIN_WRITE, ZIP_SOURCE_COMMIT_WRITE, ZIP_SOURCE_REMOVE, ZIP_SOURCE_ROLLBACK_WRITE, ZIP_SOURCE_SEEK_WRITE, ZIP_SOURCE_TELL_WRITE, ZIP_SOURCE_WRITE, -1);
+           return zip_source_make_command_bitmap(ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_SEEK, ZIP_SOURCE_TELL, ZIP_SOURCE_BEGIN_WRITE, ZIP_SOURCE_BEGIN_WRITE_CLONING, ZIP_SOURCE_COMMIT_WRITE, ZIP_SOURCE_REMOVE, ZIP_SOURCE_ROLLBACK_WRITE, ZIP_SOURCE_SEEK_WRITE, ZIP_SOURCE_TELL_WRITE, ZIP_SOURCE_WRITE, -1);
             
         case ZIP_SOURCE_TELL:
             if (ctx->in->offset > ZIP_INT64_MAX) {
@@ -237,94 +284,191 @@ read_data(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd)
 }
 
 
-static void
-buffer_free(buffer_t *buffer)
-{
-    if (buffer == NULL) {
-       return; 
+static buffer_t *
+buffer_clone(buffer_t *buffer, zip_uint64_t offset, zip_error_t *error) {
+    zip_uint64_t fragment, fragment_offset, waste;
+    buffer_t *clone;
+
+    if (offset == 0) {
+        return buffer_new(NULL, 0, 1, error);
     }
 
-    if (buffer->free_data) {
-       zip_uint64_t i;
+    if (offset > buffer->size) {
+        zip_error_set(error, ZIP_ER_INVAL, 0);
+        return NULL;
+    }
+    if (buffer->shared_buffer != NULL) {
+        zip_error_set(error, ZIP_ER_INUSE, 0);
+        return NULL;
+    }
 
-       for (i=0; i < buffer->nfragments; i++) {
-           free(buffer->fragments[i]);
-       }
+    fragment = buffer_find_fragment(buffer, offset);
+    fragment_offset = offset - buffer->fragment_offsets[fragment];
+
+    if (fragment_offset == 0) {
+        fragment--;
+        fragment_offset = buffer->fragments[fragment].length;
     }
-    free(buffer->fragments);
-    free(buffer);
+
+    waste = buffer->fragments[fragment].length - fragment_offset;
+    if (waste > offset) {
+        zip_error_set(error, ZIP_ER_OPNOTSUPP, 0);
+        return NULL;
+    }
+
+    if ((clone = buffer_new(buffer->fragments, fragment + 1, 0, error)) == NULL) {
+        return NULL;
+    }
+
+    clone->fragments[clone->nfragments - 1].length = fragment_offset;
+    clone->fragment_offsets[clone->nfragments] = offset;
+    clone->size = offset;
+
+    clone->first_owned_fragment = ZIP_MIN(buffer->first_owned_fragment, clone->nfragments - 1);
+
+    buffer->shared_buffer = clone;
+    clone->shared_buffer = buffer;
+    buffer->shared_fragments = clone->nfragments;
+    clone->shared_fragments = fragment + 1;
+
+    return clone;
 }
 
 
-static buffer_t *
-buffer_new(zip_uint64_t fragment_size)
+static zip_uint64_t
+buffer_find_fragment(const buffer_t *buffer, zip_uint64_t offset) {
+    zip_uint64_t low, high, mid;
+
+    low = 0;
+    high = buffer->nfragments - 1;
+
+    while (low < high) {
+        mid = (high - low) / 2 + low;
+        if (buffer->fragment_offsets[mid] > offset) {
+            high = mid - 1;
+        }
+        else if (mid == buffer->nfragments || buffer->fragment_offsets[mid + 1] > offset) {
+            return mid;
+        }
+        else {
+            low = mid + 1;
+        }
+    }
+
+    return low;
+}
+
+
+static void
+buffer_free(buffer_t *buffer)
 {
-    buffer_t *buffer;
+    zip_uint64_t i;
 
-    if ((buffer = malloc(sizeof(*buffer))) == NULL) {
-       return NULL;
+    if (buffer == NULL) {
+       return
     }
 
-    buffer->fragment_size = fragment_size;
-    buffer->offset = 0;
-    buffer->free_data = 0;
-    buffer->nfragments = 0;
-    buffer->fragments_capacity = 0;
-    buffer->fragments = NULL;
-    buffer->size = 0;
+    if (buffer->shared_buffer != NULL) {
+        buffer->shared_buffer->shared_buffer = NULL;
+        buffer->shared_buffer->shared_fragments = 0;
 
-    return buffer;
+        buffer->first_owned_fragment = ZIP_MAX(buffer->first_owned_fragment, buffer->shared_fragments);
+    }
+
+    for (i = buffer->first_owned_fragment; i < buffer->nfragments; i++) {
+        free(buffer->fragments[i].data);
+    }
+    free(buffer->fragments);
+    free(buffer);
 }
 
 
-static buffer_t *
-buffer_new_read(const void *data, zip_uint64_t length, int free_data)
+static bool
+buffer_grow_fragments(buffer_t *buffer, zip_uint64_t capacity, zip_error_t *error)
 {
-    buffer_t *buffer;
+    zip_buffer_fragment_t *fragments;
+    zip_uint64_t *offsets;
 
-    if ((buffer = buffer_new(length)) == NULL) {
-       return NULL;
+    if (capacity < buffer->fragments_capacity) {
+        return true;
     }
 
-    buffer->size = length;
-
-    if (length > 0) {
-       if ((buffer->fragments = malloc(sizeof(*(buffer->fragments)))) == NULL) {
-           buffer_free(buffer);
-           return NULL;
-       }
-       buffer->fragments_capacity = 1;
-
-       buffer->nfragments = 1;
-       buffer->fragments[0] = (zip_uint8_t *)data;
-       buffer->free_data = free_data;
+    if ((fragments = realloc(buffer->fragments, sizeof(buffer->fragments[0]) * capacity)) == NULL
+        || (offsets = realloc(buffer->fragment_offsets, sizeof(buffer->fragment_offsets[0]) * (capacity + 1))) == NULL) {
+        free(fragments);
+        zip_error_set(error, ZIP_ER_MEMORY, 0);
+        return false;
     }
 
-    return buffer;
+    buffer->fragments = fragments;
+    buffer->fragment_offsets = offsets;
+    buffer->fragments_capacity = capacity;
+
+    return true;
 }
 
 
 static buffer_t *
-buffer_new_write(zip_uint64_t fragment_size)
+buffer_new(const zip_buffer_fragment_t *fragments, zip_uint64_t nfragments, int free_data, zip_error_t *error)
 {
     buffer_t *buffer;
 
-    if ((buffer = buffer_new(fragment_size)) == NULL) {
+    if ((buffer = malloc(sizeof(*buffer))) == NULL) {
        return NULL;
     }
 
-    if ((buffer->fragments = malloc(sizeof(*(buffer->fragments)))) == NULL) {
-       buffer_free(buffer);
-       return NULL;
-    }
-    buffer->fragments_capacity = 1;
+    buffer->offset = 0;
+    buffer->first_owned_fragment = 0;
+    buffer->size = 0;
+    buffer->fragments = NULL;
+    buffer->fragment_offsets = NULL;
     buffer->nfragments = 0;
-    buffer->free_data = 1;
+    buffer->fragments_capacity = 0;
+    buffer->shared_buffer = NULL;
+    buffer->shared_fragments = 0;
+
+    if (nfragments == 0) {
+        if ((buffer->fragment_offsets = malloc(sizeof(buffer->fragment_offsets[0]))) == NULL) {
+            free(buffer);
+            zip_error_set(error, ZIP_ER_MEMORY, 0);
+            return NULL;
+        }
+        buffer->fragment_offsets[0] = 0;
+    }
+    else {
+        zip_uint64_t i, j, offset;
+
+        if (!buffer_grow_fragments(buffer, nfragments, NULL)) {
+            zip_error_set(error, ZIP_ER_MEMORY, 0);
+            buffer_free(buffer);
+            return NULL;
+        }
+
+        offset = 0;
+        for (i = 0, j = 0; i < nfragments; i++) {
+            if (fragments[i].length == 0) {
+                continue;
+            }
+            if (fragments[i].data == NULL) {
+                zip_error_set(error, ZIP_ER_INVAL, 0);
+                buffer_free(buffer);
+                return NULL;
+            }
+            buffer->fragments[j].data = fragments[i].data;
+            buffer->fragments[j].length = fragments[i].length;
+            buffer->fragment_offsets[i] = offset;
+            offset += fragments[i].length;
+            j++;
+        }
+        buffer->nfragments = j;
+        buffer->first_owned_fragment = free_data ? 0 : buffer->nfragments;
+        buffer->fragment_offsets[nfragments] = offset;
+        buffer->size = offset;
+    }
 
     return buffer;
 }
 
-
 static zip_int64_t
 buffer_read(buffer_t *buffer, zip_uint8_t *data, zip_uint64_t length)
 {
@@ -339,20 +483,23 @@ buffer_read(buffer_t *buffer, zip_uint8_t *data, zip_uint64_t length)
        return -1;
     }
 
-    i = buffer->offset / buffer->fragment_size;
-    fragment_offset = buffer->offset % buffer->fragment_size;
+    i = buffer->current_fragment;
+    fragment_offset = buffer->offset - buffer->fragment_offsets[i];
     n = 0;
     while (n < length) {
-       zip_uint64_t left = ZIP_MIN(length - n, buffer->fragment_size - fragment_offset);
+       zip_uint64_t left = ZIP_MIN(length - n, buffer->fragments[i].length - fragment_offset);
        
-       memcpy(data + n, buffer->fragments[i] + fragment_offset, left);
+       memcpy(data + n, buffer->fragments[i].data + fragment_offset, left);
 
+        if (left == buffer->fragments[i].length - fragment_offset) {
+            i++;
+        }
        n += left;
-       i++;
        fragment_offset = 0;
     }
 
     buffer->offset += n;
+    buffer->current_fragment = i;
     return (zip_int64_t)n;
 }
 
@@ -365,8 +512,9 @@ buffer_seek(buffer_t *buffer, void *data, zip_uint64_t len, zip_error_t *error)
     if (new_offset < 0) {
         return -1;
     }
-    
+
     buffer->offset = (zip_uint64_t)new_offset;
+    buffer->current_fragment = buffer_find_fragment(buffer, buffer->offset);
     return 0;
 }
 
@@ -374,59 +522,63 @@ buffer_seek(buffer_t *buffer, void *data, zip_uint64_t len, zip_error_t *error)
 static zip_int64_t
 buffer_write(buffer_t *buffer, const zip_uint8_t *data, zip_uint64_t length, zip_error_t *error)
 {
-    zip_uint64_t n, i, fragment_offset;
-    zip_uint8_t **fragments;
+    zip_uint64_t n, i, fragment_offset, capacity;
 
-    if (buffer->offset + length + buffer->fragment_size - 1 < length) {
+    if (buffer->offset + length + WRITE_FRAGMENT_SIZE - 1 < length) {
        zip_error_set(error, ZIP_ER_INVAL, 0);
        return -1;
     }
 
     /* grow buffer if needed */
-    if (buffer->offset + length > buffer->nfragments * buffer->fragment_size) {
-       zip_uint64_t needed_fragments = (buffer->offset + length + buffer->fragment_size - 1) / buffer->fragment_size;
-       
+    capacity = buffer_capacity(buffer);
+    if (buffer->offset + length > capacity) {
+        zip_uint64_t needed_fragments = buffer->nfragments + (length - (capacity - buffer->offset) + WRITE_FRAGMENT_SIZE - 1) / WRITE_FRAGMENT_SIZE;
+
        if (needed_fragments > buffer->fragments_capacity) {
            zip_uint64_t new_capacity = buffer->fragments_capacity;
 
+            if (new_capacity == 0) {
+                new_capacity = 16;
+            }
            while (new_capacity < needed_fragments) {
                new_capacity *= 2;
            }
 
-           fragments = realloc(buffer->fragments, new_capacity * sizeof(*fragments));
-
-           if (fragments == NULL) {
+            if (!buffer_grow_fragments(buffer, new_capacity, error)) {
                zip_error_set(error, ZIP_ER_MEMORY, 0);
                return -1;
            }
-
-           buffer->fragments = fragments;
-           buffer->fragments_capacity = new_capacity;
        }
 
        while (buffer->nfragments < needed_fragments) {
-           if ((buffer->fragments[buffer->nfragments] = malloc(buffer->fragment_size)) == NULL) {
+           if ((buffer->fragments[buffer->nfragments].data = malloc(WRITE_FRAGMENT_SIZE)) == NULL) {
                zip_error_set(error, ZIP_ER_MEMORY, 0);
                return -1;
            }
-           buffer->nfragments++;
+            buffer->fragments[buffer->nfragments].length = WRITE_FRAGMENT_SIZE;
+            buffer->nfragments++;
+            capacity += WRITE_FRAGMENT_SIZE;
+            buffer->fragment_offsets[buffer->nfragments] = capacity;
        }
     }
 
-    i = buffer->offset / buffer->fragment_size;
-    fragment_offset = buffer->offset % buffer->fragment_size;
+    i = buffer->current_fragment;
+    fragment_offset = buffer->offset - buffer->fragment_offsets[i];
     n = 0;
     while (n < length) {
-       zip_uint64_t left = ZIP_MIN(length - n, buffer->fragment_size - fragment_offset);
+       zip_uint64_t left = ZIP_MIN(length - n, buffer->fragments[i].length - fragment_offset);
                
-       memcpy(buffer->fragments[i] + fragment_offset, data + n, left);
+       memcpy(buffer->fragments[i].data + fragment_offset, data + n, left);
 
+        if (n == buffer->fragments[i].length - fragment_offset) {
+            i++;
+        }
        n += left;
-       i++;
        fragment_offset = 0;
     }
 
     buffer->offset += n;
+    buffer->current_fragment = i;
     if (buffer->offset > buffer->size) {
        buffer->size = buffer->offset;
     }
index 37e0318..0b97f93 100644 (file)
@@ -43,7 +43,7 @@ struct context {
     bool end_of_input;
     bool end_of_stream;
     bool can_store;
-    bool is_stored;
+    bool is_stored;            /* only valid if end_of_stream is true */
     bool compress;
     zip_int32_t method;
     
@@ -158,6 +158,9 @@ context_new(zip_int32_t method, bool compress, int compression_flags, zip_compre
     ctx->algorithm = algorithm;
     ctx->method = method;
     ctx->compress = compress;
+    ctx->end_of_input = false;
+    ctx->end_of_stream = false;
+    ctx->is_stored = false;
     
     if ((ctx->ud = ctx->algorithm->allocate(ZIP_CM_ACTUAL(method), compression_flags, &ctx->error)) == NULL) {
        zip_error_fini(&ctx->error);
@@ -325,17 +328,18 @@ compress_callback(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zip
            st = (zip_stat_t *)data;
 
            if (ctx->compress) {
-               st->comp_method = ctx->is_stored ? ZIP_CM_STORE : ZIP_CM_ACTUAL(ctx->method);
                if (ctx->end_of_stream) {
+                    st->comp_method = ctx->is_stored ? ZIP_CM_STORE : ZIP_CM_ACTUAL(ctx->method);
                    st->comp_size = ctx->size;
-                   st->valid |= ZIP_STAT_COMP_SIZE;
+                   st->valid |= ZIP_STAT_COMP_SIZE | ZIP_STAT_COMP_METHOD;
                }
                else {
-                   st->valid &= ~ZIP_STAT_COMP_SIZE;
+                   st->valid &= ~(ZIP_STAT_COMP_SIZE | ZIP_STAT_COMP_METHOD);
                }
            }
            else {
                st->comp_method = ZIP_CM_STORE;
+                st->valid |= ZIP_STAT_COMP_METHOD;
                if (ctx->end_of_stream) {
                    st->size = ctx->size;
                    st->valid |= ZIP_STAT_SIZE;
@@ -344,7 +348,6 @@ compress_callback(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zip
                    st->valid &= ~ZIP_STAT_SIZE;
                }
            }
-           st->valid |= ZIP_STAT_COMP_METHOD;
        }
        return 0;
 
index ef861bd..3c9c105 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_crc.c -- pass-through source that calculates CRC32 and size
-  Copyright (C) 2009-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2009-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 0cb0ed0..32dcdd4 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_filep.c -- create data source from FILE *
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
 #include <unistd.h>
 #endif
 
+#ifdef HAVE_CLONEFILE
+#include <sys/attr.h>
+#include <sys/clonefile.h>
+#endif
+
 #ifdef _WIN32
 /* WIN32 needs <fcntl.h> for _O_BINARY */
 #include <fcntl.h>
@@ -84,6 +89,9 @@ struct read_file {
 
 static zip_int64_t read_file(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd);
 static int create_temp_output(struct read_file *ctx);
+#ifdef HAVE_CLONEFILE
+static zip_int64_t create_temp_output_cloning(struct read_file *ctx, zip_uint64_t offset);
+#endif
 static int _zip_fseek_u(FILE *f, zip_uint64_t offset, int whence, zip_error_t *error);
 static int _zip_fseek(FILE *f, zip_int64_t offset, int whence, zip_error_t *error);
 
@@ -213,6 +221,12 @@ _zip_source_file_or_p(const char *fname, FILE *file, zip_uint64_t start, zip_int
        }
     }
 
+#ifdef HAVE_CLONEFILE
+    if (ctx->supports & ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_BEGIN_WRITE)) {
+        ctx->supports |= ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_BEGIN_WRITE_CLONING);
+    }
+#endif
+
     if ((zs=zip_source_function_create(read_file, ctx, error)) == NULL) {
        free(ctx->fname);
        free(ctx);
@@ -268,6 +282,56 @@ create_temp_output(struct read_file *ctx)
     return 0;
 }
 
+#ifdef HAVE_CLONEFILE
+zip_int64_t
+static create_temp_output_cloning(struct read_file *ctx, zip_uint64_t offset)
+{
+    char *temp;
+    FILE *tfp;
+
+    if (offset > ZIP_OFF_MAX) {
+        zip_error_set(&ctx->error, ZIP_ER_SEEK, E2BIG);
+        return -1;
+    }
+
+    if ((temp=(char *)malloc(strlen(ctx->fname)+8)) == NULL) {
+        zip_error_set(&ctx->error, ZIP_ER_MEMORY, 0);
+        return -1;
+    }
+    sprintf(temp, "%s.XXXXXX", ctx->fname);
+
+    if (mktemp(temp) == NULL) {
+        zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno);
+        free(temp);
+        return -1;
+    }
+
+    if (clonefile(ctx->fname, temp, 0) < 0) {
+        zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno);
+        free(temp);
+        return -1;
+    }
+    if ((tfp=fopen(temp, "r+b")) == NULL) {
+        zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno);
+        (void)remove(temp);
+        free(temp);
+        return -1;
+    }
+    if (ftruncate(fileno(tfp), (off_t)offset) < 0
+        || fseeko(tfp, (off_t)offset, SEEK_SET) < 0) {
+        zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno);
+        (void)remove(temp);
+        free(temp);
+        return -1;
+    }
+
+    ctx->fout = tfp;
+    ctx->tmpname = temp;
+
+    return 0;
+}
+#endif
+
 
 static zip_int64_t
 read_file(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd)
@@ -288,6 +352,15 @@ read_file(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd)
             }
             return create_temp_output(ctx);
 
+#ifdef HAVE_CLONEFILE
+        case ZIP_SOURCE_BEGIN_WRITE_CLONING:
+            if (ctx->fname == NULL) {
+                zip_error_set(&ctx->error, ZIP_ER_OPNOTSUPP, 0);
+                return -1;
+            }
+            return create_temp_output_cloning(ctx, len);
+#endif
+
         case ZIP_SOURCE_COMMIT_WRITE: {
            mode_t mask;
 
index 06ce5c9..3d4604c 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_function.c -- create zip data source from callback function
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -95,6 +95,7 @@ _zip_source_new(zip_error_t *error)
     src->refcount = 1;
     zip_error_init(&src->error);
     src->eof = false;
+    src->had_read_error = false;
 
     return src;
 }
index a5712b2..ec01b0d 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_open.c -- open zip_source (prepare for reading)
-  Copyright (C) 2009-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2009-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -68,6 +68,7 @@ zip_source_open(zip_source_t *src)
     }
 
     src->eof = false;
+    src->had_read_error = false;
     _zip_error_clear(&src->error);
     src->open_count++;
     
index 267128b..5288bf2 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_read.c -- read data from zip_source
-  Copyright (C) 2009-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2009-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -49,7 +49,7 @@ zip_source_read(zip_source_t *src, void *data, zip_uint64_t len)
        return -1;
     }
 
-    if (_zip_source_had_error(src)) {
+    if (src->had_read_error) {
        return -1;
     }
 
@@ -60,6 +60,7 @@ zip_source_read(zip_source_t *src, void *data, zip_uint64_t len)
     bytes_read = 0;
     while (bytes_read < len) {
        if ((n = _zip_source_call(src, (zip_uint8_t *)data + bytes_read, len - bytes_read, ZIP_SOURCE_READ)) < 0) {
+            src->had_read_error = true;
            if (bytes_read == 0) {
                return -1;
            }
index e343a70..de0bfb5 100644 (file)
@@ -1,6 +1,6 @@
 /*
 zip_source_win32a.c -- create data source from Windows file (ANSI)
-Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
 This file is part of libzip, a library to manipulate ZIP archives.
 The authors can be contacted at <libzip@nih.at>
index 7fe003d..543593b 100644 (file)
@@ -35,6 +35,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <wchar.h>
 #include <stdlib.h>
 #include <string.h>
+#include <aclapi.h>
 
 #include "zipint.h"
 #include "zipwin32.h"
@@ -420,12 +421,12 @@ _win32_create_temp_file(_zip_source_win32_read_file_t *ctx)
     int i;
     HANDLE th = INVALID_HANDLE_VALUE;
     void *temp = NULL;
-    SECURITY_INFORMATION si;
-    SECURITY_ATTRIBUTES sa;
     PSECURITY_DESCRIPTOR psd = NULL;
     PSECURITY_ATTRIBUTES psa = NULL;
-    DWORD len;
-    BOOL success;
+    SECURITY_ATTRIBUTES sa;
+    SECURITY_INFORMATION si;
+    DWORD success;
+    PACL dacl = NULL;
 
     /*
     Read the DACL from the original file, so we can copy it to the temp file.
@@ -434,16 +435,8 @@ _win32_create_temp_file(_zip_source_win32_read_file_t *ctx)
     */
     if (ctx->h != INVALID_HANDLE_VALUE && GetFileType(ctx->h) == FILE_TYPE_DISK) {
        si = DACL_SECURITY_INFORMATION | UNPROTECTED_DACL_SECURITY_INFORMATION;
-       len = 0;
-       success = GetUserObjectSecurity(ctx->h, &si, NULL, len, &len);
-       if (!success && GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
-           if ((psd = (PSECURITY_DESCRIPTOR)malloc(len)) == NULL) {
-               zip_error_set(&ctx->error, ZIP_ER_MEMORY, 0);
-               return -1;
-           }
-           success = GetUserObjectSecurity(ctx->h, &si, psd, len, &len);
-       }
-       if (success) {
+       success = GetSecurityInfo(ctx->h, SE_FILE_OBJECT, si, NULL, NULL, &dacl, NULL, &psd);
+       if (success == ERROR_SUCCESS) {
            sa.nLength = sizeof(SECURITY_ATTRIBUTES);
            sa.bInheritHandle = FALSE;
            sa.lpSecurityDescriptor = psd;
@@ -451,7 +444,13 @@ _win32_create_temp_file(_zip_source_win32_read_file_t *ctx)
        }
     }
 
+
+#ifndef MS_UWP
     value = GetTickCount();
+#else
+    value = (zip_uint32_t)GetTickCount64();
+#endif
+
     for (i = 0; i < 1024 && th == INVALID_HANDLE_VALUE; i++) {
        th = ctx->ops->op_create_temp(ctx, &temp, value + i, psa);
        if (th == INVALID_HANDLE_VALUE && GetLastError() != ERROR_FILE_EXISTS)
@@ -460,12 +459,12 @@ _win32_create_temp_file(_zip_source_win32_read_file_t *ctx)
 
     if (th == INVALID_HANDLE_VALUE) {
        free(temp);
-       free(psd);
+       LocalFree(psd);
        zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, _zip_win32_error_to_errno(GetLastError()));
        return -1;
     }
 
-    free(psd);
+    LocalFree(psd);
     ctx->hout = th;
     ctx->tmpname = temp;
 
index d8b8f86..685b57f 100644 (file)
@@ -1,34 +1,34 @@
 /*
-zip_source_win32w.c -- create data source from Windows file (UTF-16)
-Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
-
-This file is part of libzip, a library to manipulate ZIP archives.
-The authors can be contacted at <libzip@nih.at>
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in
-the documentation and/or other materials provided with the
-distribution.
-3. The names of the authors may not be used to endorse or promote
-products derived from this software without specific prior
-written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  zip_source_win32w.c -- create data source from Windows file (UTF-16)
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip@nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 
@@ -83,7 +83,19 @@ _win32_strdup_w(const void *str)
 static HANDLE
 _win32_open_w(_zip_source_win32_read_file_t *ctx)
 {
+#ifdef MS_UWP
+    CREATEFILE2_EXTENDED_PARAMETERS extParams = { 0 };
+    extParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
+    extParams.dwFileFlags = FILE_FLAG_RANDOM_ACCESS;
+    extParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
+    extParams.dwSize = sizeof(extParams);
+    extParams.hTemplateFile = NULL;
+    extParams.lpSecurityAttributes = NULL;
+
+    return CreateFile2(ctx->fname, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING, &extParams);
+#else
     return CreateFileW(ctx->fname, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+#endif
 }
 
 
@@ -103,7 +115,19 @@ _win32_create_temp_w(_zip_source_win32_read_file_t *ctx, void **temp, zip_uint32
        return INVALID_HANDLE_VALUE;
     }
 
+#ifdef MS_UWP
+    CREATEFILE2_EXTENDED_PARAMETERS extParams = { 0 };
+    extParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_TEMPORARY;
+    extParams.dwFileFlags = FILE_FLAG_RANDOM_ACCESS;
+    extParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
+    extParams.dwSize = sizeof(extParams);
+    extParams.hTemplateFile = NULL;
+    extParams.lpSecurityAttributes = NULL;
+
+    return CreateFile2((const wchar_t *)*temp, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, CREATE_NEW, &extParams);
+#else
     return CreateFileW((const wchar_t *)*temp, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, sa, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_TEMPORARY, NULL);
+#endif
 }
 
 
index ec0c8b4..3980370 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_window.c -- return part of lower source
-  Copyright (C) 2012-2014 Dieter Baron and Thomas Klausner
+  Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -143,7 +143,7 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou
 
         case ZIP_SOURCE_OPEN:
            if (ctx->source_archive) {
-               zip_int64_t offset;
+               zip_uint64_t offset;
 
                if ((offset = _zip_file_get_offset(ctx->source_archive, ctx->source_index, &ctx->error)) == 0) {
                    return -1;
index fc0b208..ddee1c8 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_winzip_aes.c -- Winzip AES de/encryption routines
-  Copyright (C) 2009-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2009-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index a7ca321..d2fe2c2 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_winzip_aes.c -- Winzip AES de/encryption routines
-  Copyright (C) 2009-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2009-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 47eae79..8a080e1 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_source_zip_new.c -- prepare data structures for zip_fopen/zip_source_zip
-  Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 39754b2..885c77d 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zip_unchange.c -- undo changes to all files in zip archive
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
index 0c2ab42..d912b7d 100644 (file)
@@ -3,7 +3,7 @@
 
 /*
   zipint.h -- internal declarations.
-  Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -51,7 +51,7 @@
 #define CENTRAL_MAGIC "PK\1\2"
 #define LOCAL_MAGIC   "PK\3\4"
 #define EOCD_MAGIC    "PK\5\6"
-#define DATADES_MAGIC "PK\7\8"
+#define DATADES_MAGIC "PK\7\10"
 #define EOCD64LOC_MAGIC "PK\6\7"
 #define EOCD64_MAGIC  "PK\6\6"
 #define CDENTRYSIZE         46u
@@ -330,6 +330,7 @@ struct zip_source {
     zip_t *source_archive;      /* zip archive we're reading from, NULL if not from archive */
     unsigned int refcount;
     bool eof;                   /* EOF reached */
+    bool had_read_error;       /* a previous ZIP_SOURCE_READ reported an error */
 };
 
 #define ZIP_SOURCE_IS_OPEN_READING(src) ((src)->open_count > 0)
@@ -386,8 +387,8 @@ extern const int _zip_err_type[];
 #define ZIP_MIN(a, b)  ((a) < (b) ? (a) : (b))
 
 #define ZIP_ENTRY_CHANGED(e, f)        ((e)->changes && ((e)->changes->changed & (f)))
-
 #define ZIP_ENTRY_DATA_CHANGED(x)      ((x)->source != NULL)
+#define ZIP_ENTRY_HAS_CHANGES(e)    (ZIP_ENTRY_DATA_CHANGED(e) || (e)->deleted || ZIP_ENTRY_CHANGED((e), ZIP_DIRENT_ALL))
 
 #define ZIP_IS_RDONLY(za)      ((za)->ch_flags & ZIP_AFL_RDONLY)
 
@@ -471,6 +472,7 @@ const zip_uint8_t *_zip_extract_extra_field_by_id(zip_error_t *, zip_uint16_t, i
 
 int _zip_file_extra_field_prepare_for_change(zip_t *, zip_uint64_t);
 int _zip_file_fillbuf(void *, size_t, zip_file_t *);
+zip_uint64_t _zip_file_get_end(const zip_t *za, zip_uint64_t index, zip_error_t *error);
 zip_uint64_t _zip_file_get_offset(const zip_t *, zip_uint64_t, zip_error_t *);
 
 int _zip_filerange_crc(zip_source_t *src, zip_uint64_t offset, zip_uint64_t length, uLong *crcp, zip_error_t *error);
index 60f8d0c..db549e2 100644 (file)
 */
 
 /* 0x0501 => Windows XP; needs to be at least this value because of GetFileSizeEx */
+#ifndef MS_UWP
 #define _WIN32_WINNT 0x0501
+#endif
+
 #include <windows.h>
 
 /* context for Win32 source */
diff --git a/libzip-uninstalled.pc.in b/libzip-uninstalled.pc.in
deleted file mode 100644 (file)
index b82bd7b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-zipcmp=${pc_top_builddir}/${pcfiledir}/src/zipcmp
-
-Name: libzip uninstalled
-Description: library for handling zip archvies, uninstalled
-Version: @VERSION@
-Libs: ${pc_top_builddir}/${pcfiledir}/lib/libzip.la @LIBS@
-Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@/lib
diff --git a/m4/.empty b/m4/.empty
deleted file mode 100644 (file)
index 8381f5a..0000000
--- a/m4/.empty
+++ /dev/null
@@ -1 +0,0 @@
-Directory needed by autoconf, but hg doesn't track empty dirs.
diff --git a/m4/visibility.m4 b/m4/visibility.m4
deleted file mode 100644 (file)
index 2ff6330..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# visibility.m4 serial 1 (gettext-0.15)
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-dnl Tests whether the compiler supports the command-line option
-dnl -fvisibility=hidden and the function and variable attributes
-dnl __attribute__((__visibility__("hidden"))) and
-dnl __attribute__((__visibility__("default"))).
-dnl Does *not* test for __visibility__("protected") - which has tricky
-dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
-dnl MacOS X.
-dnl Does *not* test for __visibility__("internal") - which has processor
-dnl dependent semantics.
-dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
-dnl "really only recommended for legacy code".
-dnl Set the variable CFLAG_VISIBILITY.
-dnl Defines and sets the variable HAVE_VISIBILITY.
-
-AC_DEFUN([gl_VISIBILITY],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  CFLAG_VISIBILITY=
-  HAVE_VISIBILITY=0
-  if test -n "$GCC"; then
-    AC_MSG_CHECKING([for simple visibility declarations])
-    AC_CACHE_VAL(gl_cv_cc_visibility, [
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -fvisibility=hidden"
-      AC_TRY_COMPILE(
-        [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
-         extern __attribute__((__visibility__("default"))) int exportedvar;
-         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
-         extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
-        [],
-        gl_cv_cc_visibility=yes,
-        gl_cv_cc_visibility=no)
-      CFLAGS="$gl_save_CFLAGS"])
-    AC_MSG_RESULT([$gl_cv_cc_visibility])
-    if test $gl_cv_cc_visibility = yes; then
-      CFLAG_VISIBILITY="-fvisibility=hidden"
-      HAVE_VISIBILITY=1
-    fi
-  fi
-  AC_SUBST([CFLAG_VISIBILITY])
-  AC_SUBST([HAVE_VISIBILITY])
-  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
-    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
-])
index 2ea72dd..4f5feeb 100644 (file)
-SET(MDOC3_PAGES
-  ZIP_SOURCE_GET_ARGS.mdoc
-  libzip.mdoc
-  zip_add.mdoc
-  zip_add_dir.mdoc
-  zip_close.mdoc
-  zip_delete.mdoc
-  zip_dir_add.mdoc
-  zip_discard.mdoc
-  zip_error_clear.mdoc
-  zip_error_code_system.mdoc
-  zip_error_code_zip.mdoc
-  zip_error_fini.mdoc
-  zip_error_get.mdoc
-  zip_error_get_sys_type.mdoc
-  zip_error_init.mdoc
-  zip_error_set.mdoc
-  zip_error_strerror.mdoc
-  zip_error_system_type.mdoc
-  zip_error_to_data.mdoc
-  zip_error_to_str.mdoc
-  zip_errors.mdoc
-  zip_fclose.mdoc
-  zip_fdopen.mdoc
-  zip_file_add.mdoc
-  zip_file_extra_field_delete.mdoc
-  zip_file_extra_field_get.mdoc
-  zip_file_extra_field_set.mdoc
-  zip_file_extra_fields_count.mdoc
-  zip_file_get_comment.mdoc 
-  zip_file_get_error.mdoc
-  zip_file_rename.mdoc
-  zip_file_set_comment.mdoc
-  zip_file_set_encryption.mdoc
-  zip_file_set_external_attributes.mdoc
-  zip_file_set_mtime.mdoc
-  zip_file_strerror.mdoc
-  zip_fopen.mdoc
-  zip_fopen_encrypted.mdoc
-  zip_fread.mdoc
-  zip_fseek.mdoc
-  zip_get_archive_comment.mdoc
-  zip_get_archive_flag.mdoc
-  zip_get_error.mdoc
-  zip_get_file_comment.mdoc
-  zip_get_name.mdoc
-  zip_get_num_entries.mdoc
-  zip_get_num_files.mdoc
-  zip_libzip_version.mdoc
-  zip_name_locate.mdoc
-  zip_open.mdoc
-  zip_register_progress_callback.mdoc
-  zip_register_progress_callback_with_state.mdoc
-  zip_rename.mdoc
-  zip_set_archive_comment.mdoc
-  zip_set_archive_flag.mdoc
-  zip_set_default_password.mdoc
-  zip_set_file_comment.mdoc
-  zip_set_file_compression.mdoc
-  zip_source_begin_write.mdoc
-  zip_source_buffer.mdoc
-  zip_source_close.mdoc
-  zip_source_commit_write.mdoc
-  zip_source_error.mdoc
-  zip_source_file.mdoc
-  zip_source_filep.mdoc
-  zip_source_free.mdoc
-  zip_source_function.mdoc
-  zip_source_is_deleted.mdoc
-  zip_source_keep.mdoc
-  zip_source_make_command_bitmap.mdoc
-  zip_source_open.mdoc
-  zip_source_read.mdoc
-  zip_source_rollback_write.mdoc
-  zip_source_seek.mdoc
-  zip_source_seek_compute_offset.mdoc
-  zip_source_seek_write.mdoc
-  zip_source_stat.mdoc
-  zip_source_tell.mdoc
-  zip_source_tell_write.mdoc
-  zip_source_win32a.mdoc
-  zip_source_win32handle.mdoc
-  zip_source_win32w.mdoc
-  zip_source_write.mdoc
-  zip_source_zip.mdoc
-  zip_stat.mdoc
-  zip_stat_init.mdoc
-  zip_unchange.mdoc
-  zip_unchange_all.mdoc
-  zip_unchange_archive.mdoc
+SET(MAN_PAGES
+  ZIP_SOURCE_GET_ARGS.3
+  libzip.3
+  zip_add.3
+  zip_add_dir.3
+  zip_close.3
+  zip_delete.3
+  zip_dir_add.3
+  zip_discard.3
+  zip_error_clear.3
+  zip_error_code_system.3
+  zip_error_code_zip.3
+  zip_error_fini.3
+  zip_error_get.3
+  zip_error_get_sys_type.3
+  zip_error_init.3
+  zip_error_set.3
+  zip_error_strerror.3
+  zip_error_system_type.3
+  zip_error_to_data.3
+  zip_error_to_str.3
+  zip_errors.3
+  zip_fclose.3
+  zip_fdopen.3
+  zip_file_add.3
+  zip_file_extra_field_delete.3
+  zip_file_extra_field_get.3
+  zip_file_extra_field_set.3
+  zip_file_extra_fields_count.3
+  zip_file_get_comment.3
+  zip_file_get_error.3
+  zip_file_get_external_attributes.3
+  zip_file_rename.3
+  zip_file_set_comment.3
+  zip_file_set_encryption.3
+  zip_file_set_external_attributes.3
+  zip_file_set_mtime.3
+  zip_file_strerror.3
+  zip_fopen.3
+  zip_fopen_encrypted.3
+  zip_fread.3
+  zip_fseek.3
+  zip_ftell.3
+  zip_get_archive_comment.3
+  zip_get_archive_flag.3
+  zip_get_error.3
+  zip_get_file_comment.3
+  zip_get_name.3
+  zip_get_num_entries.3
+  zip_get_num_files.3
+  zip_libzip_version.3
+  zip_name_locate.3
+  zip_open.3
+  zip_register_progress_callback.3
+  zip_register_progress_callback_with_state.3
+  zip_rename.3
+  zip_set_archive_comment.3
+  zip_set_archive_flag.3
+  zip_set_default_password.3
+  zip_set_file_comment.3
+  zip_set_file_compression.3
+  zip_source.3
+  zip_source_begin_write.3
+  zip_source_buffer.3
+  zip_source_buffer_fragment.3
+  zip_source_close.3
+  zip_source_commit_write.3
+  zip_source_error.3
+  zip_source_file.3
+  zip_source_filep.3
+  zip_source_free.3
+  zip_source_function.3
+  zip_source_is_deleted.3
+  zip_source_keep.3
+  zip_source_make_command_bitmap.3
+  zip_source_open.3
+  zip_source_read.3
+  zip_source_rollback_write.3
+  zip_source_seek.3
+  zip_source_seek_compute_offset.3
+  zip_source_seek_write.3
+  zip_source_stat.3
+  zip_source_tell.3
+  zip_source_tell_write.3
+  zip_source_win32a.3
+  zip_source_win32handle.3
+  zip_source_win32w.3
+  zip_source_write.3
+  zip_source_zip.3
+  zip_stat.3
+  zip_stat_init.3
+  zip_unchange.3
+  zip_unchange_all.3
+  zip_unchange_archive.3
+  zipcmp.1
+  zipmerge.1
+  ziptool.1
 )
-SET(MDOC1_PAGES
-  zipcmp.mdoc
-  zipmerge.mdoc
-  ziptool.mdoc
-)
-SET(MDOC_PAGES ${MDOC1_PAGES} ${MDOC3_PAGES})
-STRING(REGEX REPLACE .mdoc "" MAN1_PAGES "${MDOC1_PAGES}")
-STRING(REGEX REPLACE .mdoc "" MAN3_PAGES "${MDOC3_PAGES}")
-SET(MAN_PAGES ${MAN1_PAGES} ${MAN3_PAGES})
 
 IF(CMAKE_SYSTEM_NAME MATCHES BSD)
   SET(MANFMT mdoc)
-ELSE(CMAKE_SYSTEM_NAME MATCHES BSD)
+ELSE()
   SET(MANFMT man)
-ENDif(CMAKE_SYSTEM_NAME MATCHES BSD)
-
-# installation
+ENDIF()
 
-FOREACH(MAN_PAGE ${MAN1_PAGES})
-  INSTALL(FILES ${MAN_PAGE}.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
-    RENAME ${MAN_PAGE}.1)
-ENDFOREACH(MAN_PAGE ${PROGRAMS})
-FOREACH(MAN_PAGE ${MAN3_PAGES})
-  INSTALL(FILES ${MAN_PAGE}.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-    RENAME ${MAN_PAGE}.3)
-ENDFOREACH(MAN_PAGE ${PROGRAMS})
-# TODO: usually symlinks, but I only know how to do this way
-INSTALL(FILES zip_error_clear.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_file_error_clear.3)
-INSTALL(FILES zip_error_get.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_file_error_get.3)
-INSTALL(FILES zip_error_init.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_error_init_with_code.3)
-INSTALL(FILES zip_file_extra_field_delete.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_file_extra_field_delete_by_id.3)
-INSTALL(FILES zip_file_extra_field_get.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_file_extra_field_get_by_id.3)
-INSTALL(FILES zip_file_extra_fields_count.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_file_extra_fields_count_by_id.3)
-INSTALL(FILES zip_file_add.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_file_replace.3)
-INSTALL(FILES zip_fopen.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_fopen_index.3)
-INSTALL(FILES zip_fopen_encrypted.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_fopen_index_encrypted.3)
-INSTALL(FILES zip_open.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_open_from_source.3)
-INSTALL(FILES zip_add.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_replace.3)
-INSTALL(FILES zip_source_function.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_source_function_create.3)
-INSTALL(FILES zip_stat.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_stat_index.3)
-INSTALL(FILES zip_file_strerror.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
-  RENAME zip_strerror.3)
+FOREACH(MAN_PAGE ${MAN_PAGES})
+  STRING(REGEX REPLACE "[1-9]$" "${MANFMT}" SOURCE_FILE ${MAN_PAGE})
+  STRING(REGEX REPLACE ".*(.)$" "man\\1" SUBDIR ${MAN_PAGE})
+  # CONFIGURE_FILE does not find out about updates to the sources, and it does not provide a target
+  #CONFIGURE_FILE(${SOURCE_FILE} ${MAN_PAGE} COPYONLY)
+  ADD_CUSTOM_COMMAND(OUTPUT ${MAN_PAGE}
+    DEPENDS ${SOURCE_FILE}
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${MAN_PAGE}
+    COMMENT "Preparing ${MAN_PAGE}"
+    )
+  INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${MAN_PAGE} DESTINATION ${CMAKE_INSTALL_MANDIR}/${SUBDIR})
 
-# custom maintainer targets
+  STRING(REGEX REPLACE "[1-9]$" "html" HTML_FILE ${MAN_PAGE})
+  STRING(REGEX REPLACE "[1-9]$" "man" MAN_FILE ${MAN_PAGE})
+  STRING(REGEX REPLACE "[1-9]$" "mdoc" MDOC_FILE ${MAN_PAGE})
 
-#FOREACH(MAN ${MAN_PAGES})
-#  ADD_CUSTOM_TARGET(${MAN}.man
-#    DEPENDS ${MAN}.mdoc
-#    COMMAND mandoc -T man ${CMAKE_CURRENT_SOURCE_DIR}/${MAN}.mdoc | sed '/TH/s,"NetBSD [^"]*","NiH",' > ${MAN}.new
-#    COMMAND diff -I NiH ${MAN}.new ${CMAKE_CURRENT_SOURCE_DIR}/${MAN}.man || mv ${MAN}.new ${CMAKE_CURRENT_SOURCE_DIR}/${MAN}.man
-#    COMMAND rm -f ${MAN}.new
-#    COMMENT Updating man page ${MAN}.man
-#    )
-#  ADD_CUSTOM_TARGET(${MAN}.html
-#    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN}.mdoc
-#    COMMAND mandoc -Thtml -Oman="%N.html",style=../nih-man.css ${CMAKE_CURRENT_SOURCE_DIR}/${MAN}.mdoc > ${MAN}.html
-#    COMMENT Updating HTML page ${MAN}.html
-#    )
-#ENDFOREACH(MAN)
+  # html re-generation
+  ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_FILE}
+    DEPENDS ${MDOC_FILE}
+    COMMAND ${CMAKE_COMMAND} -DIN=${MDOC_FILE} -DOUT=${HTML_FILE} -DDIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/update-html.cmake
+    )
+  LIST(APPEND UPDATEHTML ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_FILE})
 
-#STRING(REGEX REPLACE .mdoc .man MANDEPEND "${MDOC_PAGES}")
-#ADD_CUSTOM_TARGET(update-man
-#  DEPENDS ${MANDEPEND})
+  # man re-generation
+  ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_FILE}
+    DEPENDS ${MDOC_FILE}
+    COMMAND ${CMAKE_COMMAND} -DIN=${MDOC_FILE} -DOUT=${MAN_FILE} -DDIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/update-man.cmake
+    )
+  LIST(APPEND UPDATEMAN ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_FILE})
+ENDFOREACH()
+ADD_CUSTOM_TARGET(man ALL DEPENDS ${MAN_PAGES})
+ADD_CUSTOM_TARGET(update-man DEPENDS ${UPDATEMAN})
+ADD_CUSTOM_TARGET(update-html DEPENDS ${UPDATEHTML})
 
-#STRING(REGEX REPLACE .mdoc .html HTMLDEPEND "${MDOC_PAGES}")
-#ADD_CUSTOM_TARGET(update-html
-#  DEPENDS ${HTMLDEPEND})
+FILE(STRINGS links MANPAGE_LINKS)
+FOREACH(LINKS_LINE ${MANPAGE_LINKS})
+  IF(${LINKS_LINE} MATCHES "(.*) (.*)")
+    INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_MATCH_1}.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 RENAME ${CMAKE_MATCH_2}.3)
+  ENDIF()
+ENDFOREACH()
 
-# TODO: strange error:
-#[ 94%] zipcmp.html
-#[ 97%] Built target zipcmp.html
-#[ 97%] zipmerge.html
-#[100%] Built target zipmerge.html
-#make: don't know how to make zipcmp.html. Stop
-
-# TODO: why are all the man pages rebuilt on a second 'make update-html'?
+ADD_CUSTOM_TARGET(update_zip_errors
+  COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_errors.sh ${CMAKE_SOURCE_DIR}/lib/zip.h ${CMAKE_CURRENT_SOURCE_DIR}/zip_errors.mdoc
+  DEPENDS ${CMAKE_SOURCE_DIR}/lib/zip.h ${CMAKE_CURRENT_SOURCE_DIR}/zip_errors.mdoc
+)
diff --git a/man/Makefile.am b/man/Makefile.am
deleted file mode 100644 (file)
index 82f9ddc..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-MANFMT=@MANFMT@
-man1_MANS=${MAN1:.mdoc=.${MANFMT}}
-man3_MANS=${MAN3:.mdoc=.${MANFMT}}
-
-DISTCLEANFILES=${HTML}
-EXTRA_DIST=${MANDOC} ${MAN} CMakeLists.txt handle_links links
-
-MAN1=  zipcmp.mdoc zipmerge.mdoc ziptool.mdoc
-MAN3=  \
-       ZIP_SOURCE_GET_ARGS.mdoc \
-       libzip.mdoc \
-       zip_add.mdoc \
-       zip_add_dir.mdoc \
-       zip_close.mdoc \
-       zip_delete.mdoc \
-       zip_dir_add.mdoc \
-       zip_discard.mdoc \
-       zip_error_clear.mdoc \
-       zip_error_code_system.mdoc \
-       zip_error_code_zip.mdoc \
-       zip_error_fini.mdoc \
-       zip_error_get.mdoc \
-       zip_error_get_sys_type.mdoc \
-       zip_error_init.mdoc \
-       zip_error_set.mdoc \
-       zip_error_strerror.mdoc \
-       zip_error_system_type.mdoc \
-       zip_error_to_data.mdoc \
-       zip_error_to_str.mdoc \
-       zip_errors.mdoc \
-       zip_fclose.mdoc \
-       zip_fdopen.mdoc \
-       zip_file_add.mdoc \
-       zip_file_extra_field_delete.mdoc \
-       zip_file_extra_field_get.mdoc \
-       zip_file_extra_field_set.mdoc \
-       zip_file_extra_fields_count.mdoc \
-       zip_file_get_comment.mdoc \
-       zip_file_get_error.mdoc \
-       zip_file_get_external_attributes.mdoc \
-       zip_file_rename.mdoc \
-       zip_file_set_comment.mdoc \
-       zip_file_set_encryption.mdoc \
-       zip_file_set_external_attributes.mdoc \
-       zip_file_set_mtime.mdoc \
-       zip_file_strerror.mdoc \
-       zip_fopen.mdoc \
-       zip_fopen_encrypted.mdoc \
-       zip_fread.mdoc \
-       zip_fseek.mdoc \
-       zip_ftell.mdoc \
-       zip_get_archive_comment.mdoc \
-       zip_get_archive_flag.mdoc \
-       zip_get_error.mdoc \
-       zip_get_file_comment.mdoc \
-       zip_get_name.mdoc \
-       zip_get_num_entries.mdoc \
-       zip_get_num_files.mdoc \
-       zip_libzip_version.mdoc \
-       zip_name_locate.mdoc \
-       zip_open.mdoc \
-       zip_rename.mdoc \
-       zip_register_progress_callback.mdoc \
-       zip_register_progress_callback_with_state.mdoc \
-       zip_set_archive_comment.mdoc \
-       zip_set_archive_flag.mdoc \
-       zip_set_default_password.mdoc \
-       zip_set_file_comment.mdoc \
-       zip_set_file_compression.mdoc \
-       zip_source.mdoc \
-       zip_source_begin_write.mdoc \
-       zip_source_buffer.mdoc \
-       zip_source_close.mdoc \
-       zip_source_commit_write.mdoc \
-       zip_source_error.mdoc \
-       zip_source_file.mdoc \
-       zip_source_filep.mdoc \
-       zip_source_free.mdoc \
-       zip_source_function.mdoc \
-       zip_source_is_deleted.mdoc \
-       zip_source_keep.mdoc \
-       zip_source_make_command_bitmap.mdoc \
-       zip_source_open.mdoc \
-       zip_source_read.mdoc \
-       zip_source_rollback_write.mdoc \
-       zip_source_seek.mdoc \
-       zip_source_seek_compute_offset.mdoc \
-       zip_source_seek_write.mdoc \
-       zip_source_stat.mdoc \
-       zip_source_tell.mdoc \
-       zip_source_tell_write.mdoc \
-       zip_source_win32a.mdoc \
-       zip_source_win32handle.mdoc \
-       zip_source_win32w.mdoc \
-       zip_source_write.mdoc \
-       zip_source_zip.mdoc \
-       zip_stat.mdoc \
-       zip_stat_init.mdoc \
-       zip_unchange.mdoc \
-       zip_unchange_all.mdoc \
-       zip_unchange_archive.mdoc
-
-install-data-hook: link-man3
-
-LN=ln -f
-
-link-man3: install-man3 uninstall-hook
-       @${srcdir}/handle_links install directory=${DESTDIR}${man3dir} extension=3 command="${LN}" file=${srcdir}/links
-
-uninstall-hook:
-       @${srcdir}/handle_links uninstall directory=${DESTDIR}${man3dir} extension=3 command="rm -f" file=${srcdir}/links
-
-link-html: ${HTML}
-       @${srcdir}/handle_links uninstall directory=. extension=html command="rm -f" file=${srcdir}/links
-       @${srcdir}/handle_links install directory=. extension=html command="${LN}" file=${srcdir}/links
-
-MANDOC=${MAN1} ${MAN3}
-HTML=${MANDOC:.mdoc=.html}
-MAN=${MANDOC:.mdoc=.man}
-
-SUFFIXES=.man .mdoc .html
-
-.PHONY: mkman update-errors
-
-mkman: ${MAN}
-mkhtml: ${HTML} link-html
-
-mkdocset: mkdocset.pl ${HTML}
-       SRCDIR=${srcdir} perl ${srcdir}/mkdocset.pl ${HTML}
-
-update-errors:
-       sh $(srcdir)/make_zip_errors.sh $(srcdir)/../lib/zip.h zip_errors.mdoc
-
-.mdoc.man:
-       mandoc -T man $< | sed '/TH/s,"NetBSD [^"]*","NiH",' > $@.$$$$ && mv $@.$$$$ $@
-
-.mdoc.html:
-       mandoc -Thtml -Oman="%N.html",style=../nih-man.css $< | ${srcdir}/fix-man-links.sh > $@.$$$$ && mv $@.$$$$ $@
diff --git a/man/ZIP_SOURCE_GET_ARGS.man b/man/ZIP_SOURCE_GET_ARGS.man
new file mode 100644 (file)
index 0000000..259acc2
--- /dev/null
@@ -0,0 +1,51 @@
+.TH "ZIP_SOURCE_GET_ARGS" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBZIP_SOURCE_GET_ARGS\fR
+\- validate and cast arguments to source callback
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fItype *\fR
+.br
+.PD 0
+.HP 4n
+\fBZIP_SOURCE_GET_ARGS\fR(\fItype\fR, \fIvoid\ *data\fR, \fIzip_uint64_t\ len\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBZIP_SOURCE_GET_ARGS\fR()
+macro casts
+\fIdata\fR
+to a pointer to
+\fItype\fR.
+.SH "RETURN VALUES"
+On success,
+\fBZIP_SOURCE_GET_ARGS\fR()
+returns
+\fIdata\fR.
+In case of error, it returns
+\fRNULL\fR
+and sets
+\fIerror\fR.
+.SH "ERRORS"
+\fBZIP_SOURCE_GET_ARGS\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIlen\fR
+is less than the size of
+\fItype\fR
+.SH "SEE ALSO"
+libzip(3),
+zip_source_function(3)
+.SH "HISTORY"
+\fBZIP_SOURCE_GET_ARGS\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index bb29412..2735964 100644 (file)
@@ -1,5 +1,5 @@
 .\" ZIP_SOURCE_GET_ARGS -- validate and cast arguments to source callback
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 30, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_GET_ARGS 3
 .Os
 .Sh NAME
@@ -69,6 +69,9 @@ is less than the size of
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_source_function 3
+.Sh HISTORY
+.Fn ZIP_SOURCE_GET_ARGS
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/fix-man-links.sh b/man/fix-man-links.sh
deleted file mode 100755 (executable)
index 9aa35ac..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-# <a class="link-man" href="zip_errors.html">
-LINKBASE='http://pubs.opengroup.org/onlinepubs/9699919799/functions/'
-
-sed -E -e 's,(<a class="link-man" href=")([^"]*)(">),\1'"$LINKBASE"'\2\3,g' -e "s,$LINKBASE"'(libzip|zip),\1,g'
diff --git a/man/libzip.man b/man/libzip.man
new file mode 100644 (file)
index 0000000..d1a997d
--- /dev/null
@@ -0,0 +1,256 @@
+.TH "LIBZIP" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBlibzip\fR
+\- library for manipulating zip archives
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.SH "DESCRIPTION"
+\fBlibzip\fR
+is a library for reading, creating, and modifying zip archives.
+.PP
+The main design criteria for
+\fBlibzip\fR
+were:
+.PD 0
+.TP 4n
+\fB\(bu\fR
+Do not create corrupt files, even in case of errors.
+.TP 4n
+\fB\(bu\fR
+Do not delete data.
+.TP 4n
+\fB\(bu\fR
+Be efficient.
+.PD
+.PP
+For this reason, when modifying zip archives,
+\fBlibzip\fR
+writes to a temporary file and replaces the original
+zip archive atomically.
+.PP
+Below there are two sections listing functions: one for how to read
+from zip archives and one for how to create/modify them.
+.SH "READING ZIP ARCHIVES"
+.SS "open archive"
+.TP 4n
+\fB\(bu\fR
+zip_open(3)
+.PD 0
+.TP 4n
+\fB\(bu\fR
+zip_fdopen(3)
+.PD
+.SS "find files"
+.TP 4n
+\fB\(bu\fR
+zip_name_locate(3)
+.SS "read files"
+.TP 4n
+\fB\(bu\fR
+zip_fopen(3)
+.PD 0
+.TP 4n
+\fB\(bu\fR
+zip_fopen_encrypted(3)
+.TP 4n
+\fB\(bu\fR
+zip_fopen_index(3)
+.TP 4n
+\fB\(bu\fR
+zip_fopen_index_encrypted(3)
+.TP 4n
+\fB\(bu\fR
+zip_fread(3)
+.TP 4n
+\fB\(bu\fR
+zip_fseek(3)
+(uncompressed files only)
+.TP 4n
+\fB\(bu\fR
+zip_ftell(3)
+(uncompressed files only)
+.TP 4n
+\fB\(bu\fR
+zip_fclose(3)
+.PD
+.SS "close archive"
+.TP 4n
+\fB\(bu\fR
+zip_close(3)
+.PD 0
+.TP 4n
+\fB\(bu\fR
+zip_discard(3)
+.PD
+.SS "miscellaneous"
+.TP 4n
+\fB\(bu\fR
+zip_stat(3)
+.PD 0
+.TP 4n
+\fB\(bu\fR
+zip_file_get_comment(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_get_external_attributes(3)
+.TP 4n
+\fB\(bu\fR
+zip_get_archive_comment(3)
+.TP 4n
+\fB\(bu\fR
+zip_get_archive_flag(3)
+.TP 4n
+\fB\(bu\fR
+zip_get_name(3)
+.TP 4n
+\fB\(bu\fR
+zip_get_num_entries(3)
+.TP 4n
+\fB\(bu\fR
+zip_set_default_password(3)
+.PD
+.SH "CREATING/MODIFYING ZIP ARCHIVES"
+.SS "create/open archive"
+.TP 4n
+\fB\(bu\fR
+zip_open(3)
+.SS "add/change files and directories"
+.TP 4n
+\fB\(bu\fR
+zip_dir_add(3)
+.PD 0
+.TP 4n
+\fB\(bu\fR
+zip_file_add(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_replace(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_set_comment(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_set_external_attributes(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_set_encryption(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_set_mtime(3)
+.TP 4n
+\fB\(bu\fR
+zip_set_file_compression(3)
+.TP 4n
+\fB\(bu\fR
+zip_source_buffer(3)
+.TP 4n
+\fB\(bu\fR
+zip_source_file(3)
+.TP 4n
+\fB\(bu\fR
+zip_source_filep(3)
+.TP 4n
+\fB\(bu\fR
+zip_source_free(3)
+.TP 4n
+\fB\(bu\fR
+zip_source_function(3)
+.TP 4n
+\fB\(bu\fR
+zip_source_zip(3)
+.PD
+.SS "rename files"
+.TP 4n
+\fB\(bu\fR
+zip_rename(3)
+.SS "delete files"
+.TP 4n
+\fB\(bu\fR
+zip_delete(3)
+.SS "revert changes"
+.TP 4n
+\fB\(bu\fR
+zip_unchange(3)
+.PD 0
+.TP 4n
+\fB\(bu\fR
+zip_unchange_all(3)
+.TP 4n
+\fB\(bu\fR
+zip_unchange_archive(3)
+.PD
+.SS "read/modify extra fields"
+.TP 4n
+\fB\(bu\fR
+zip_file_extra_field_by_id(3)
+.PD 0
+.TP 4n
+\fB\(bu\fR
+zip_file_extra_field_delete(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_extra_field_delete_by_id(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_extra_field_get(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_extra_field_set(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_extra_fields_count(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_extra_fields_count_by_id(3)
+.PD
+.SS "close archive"
+.TP 4n
+\fB\(bu\fR
+zip_close(3)
+.SS "miscellaneous"
+.TP 4n
+\fB\(bu\fR
+zip_libzip_version(3)
+.PD 0
+.TP 4n
+\fB\(bu\fR
+zip_register_progress_callback_with_state(3)
+.TP 4n
+\fB\(bu\fR
+zip_set_archive_comment(3)
+.TP 4n
+\fB\(bu\fR
+zip_set_archive_flag(3)
+.TP 4n
+\fB\(bu\fR
+zip_source(3)
+.PD
+.SH "ERROR HANDLING"
+.TP 4n
+\fB\(bu\fR
+zip_error_to_str(3)
+.PD 0
+.TP 4n
+\fB\(bu\fR
+zip_strerror(3)
+.TP 4n
+\fB\(bu\fR
+zip_file_strerror(3)
+.TP 4n
+\fB\(bu\fR
+zip_error_get(3)
+.TP 4n
+\fB\(bu\fR
+zip_error_get_sys_type(3)
+.TP 4n
+\fB\(bu\fR
+zip_errors(3)
+.PD
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index adbe294..6c0a281 100644 (file)
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt LIBZIP 3
 .Os
 .Sh NAME
index b2a0280..7364474 100644 (file)
--- a/man/links
+++ b/man/links
@@ -1,3 +1,4 @@
+zip_add zip_replace
 zip_error_clear zip_file_error_clear
 zip_error_get zip_file_error_get
 zip_error_init zip_error_init_with_code
@@ -5,13 +6,17 @@ zip_file_add zip_file_replace
 zip_file_extra_field_delete zip_file_extra_field_delete_by_id
 zip_file_extra_field_get zip_file_extra_field_get_by_id
 zip_file_extra_fields_count zip_file_extra_fields_count_by_id
+zip_file_strerror zip_strerror
 zip_fopen zip_fopen_index
 zip_fopen_encrypted zip_fopen_index_encrypted
-zip_add zip_replace
 zip_open zip_open_from_source
-zip_stat zip_stat_index
+zip_source_begin_write zip_source_begin_write_cloning
+zip_source_buffer zip_source_buffer_create
+zip_source_buffer_fragment zip_source_buffer_fragment_create
+zip_source_file zip_source_file_create
+zip_source_filep zip_source_filep_create
 zip_source_function zip_source_function_create
-zip_file_strerror zip_strerror
 zip_source_win32a zip_source_win32a_create
 zip_source_win32handle zip_source_win32handle_create
 zip_source_win32w zip_source_win32w_create
+zip_stat zip_stat_index
diff --git a/man/make_zip_errors.sh b/man/make_zip_errors.sh
deleted file mode 100755 (executable)
index d5e1dd7..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/bin/sh
-
-#  make_zip_errrors.sh: create zip_errors.mdoc from zip.h
-#  Copyright (C) 1999-2013 Dieter Baron and Thomas Klausner
-#
-#  This file is part of libzip, a library to manipulate ZIP archives.
-#  The authors can be contacted at <libzip@nih.at>
-#
-#  Redistribution and use in source and binary forms, with or without
-#  modification, are permitted provided that the following conditions
-#  are met:
-#  1. Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-#  2. Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in
-#     the documentation and/or other materials provided with the
-#     distribution.
-#  3. The names of the authors may not be used to endorse or promote
-#     products derived from this software without specific prior
-#     written permission.
-# 
-#  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
-#  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-#  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-#  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-#  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-#  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-if [ "$#" -ne 2 ]
-then
-    echo "Usage: $0 in_file out_file" >&2
-    echo "       e.g. $0 zip.h zip_err_str.c" >&2
-    exit 1
-fi
-
-if [ "$1" = "$2" ]
-then
-    echo "$0: error: output file = input file" >&2
-    exit 1
-fi
-
-date=`LC_TIME=en_US date '+%B %e, %Y' | sed 's/  / /'`
-
-cat <<EOF >> "$2.$$" || exit 1
-.\" zip_errors.mdoc -- list of all libzip error codes
-.\" Copyright (C) 1999-2013 Dieter Baron and Thomas Klausner
-.\"
-.\" This file is part of libzip, a library to manipulate ZIP archives.
-.\" The authors can be contacted at <libzip@nih.at>
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in
-.\"    the documentation and/or other materials provided with the
-.\"    distribution.
-.\" 3. The names of the authors may not be used to endorse or promote
-.\"    products derived from this software without specific prior
-.\"    written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS \`\`AS IS'' AND ANY EXPRESS
-.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
-.\"   This file was generated automatically by $0
-.\"   from $1; make changes there.
-.\"
-.Dd $date
-.Dt ZIP_ERRORS 3
-.Os
-.Sh NAME
-.Nm zip_errors
-.Nd list of all libzip error codes
-.Sh LIBRARY
-libzip (-lzip)
-.Sh SYNOPSIS
-.In zip.h
-.Sh DESCRIPTION
-The following error codes are used by libzip:
-.Bl -tag -width XZIPXERXCOMPNOTSUPPXX
-EOF
-
-sed -n  's/^#define \(ZIP_ER_[A-Z_0-9]*\).*\/\* \(.\) \([^*]*\) \*\//.It Bq Er \1@\3./p' "$1" \
-    | sort\
-    | tr @ '\012' \
-    >> "$2.$$" || exit 1
-
-cat <<EOF >> "$2.$$" || exit 1
-.El
-.Sh AUTHORS
-.An -nosplit
-.An Dieter Baron Aq Mt dillo@nih.at
-and
-.An Thomas Klausner Aq Mt tk@giga.or.at
-EOF
-
-mv "$2.$$" "$2" || exit 1
diff --git a/man/mkdocset.pl b/man/mkdocset.pl
deleted file mode 100755 (executable)
index 78be79b..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-#!/usr/bin/env perl
-
-use strict;
-
-my $DOCSETUTIL = '/Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil';
-
-my $BASE_URL = 'http://nih.at/libzip';
-my $BUNDLE_ID = 'at.nih.libzip';
-
-my $SRCDIR = $ENV{SRCDIR} // '.';
-
-my @files = @ARGV;
-
-my $docset = 'at.nih.libzip.docset';
-my @sh_nodes = qw(zipcmp zipmerge ziptool);
-
-(system('rm', '-rf', $docset) == 0) or die "can't remove old version of docset: $!";
-
-mkdir($docset) or die "can't create docset directory: $!";
-mkdir("$docset/Contents") or die "can't create docset directory: $!";
-mkdir("$docset/Contents/Resources") or die "can't create docset directory: $!";
-mkdir("$docset/Contents/Resources/Documents") or die "can't create docset directory: $!";
-
-my $version = `sed -n 's/#define PACKAGE_VERSION "\\(.*\\)"/\\1/p' ../config.h`;
-chomp $version;
-
-my $suffix = '';
-$suffix = '-hg' if ($version =~ /[a-z]$/);
-
-my $package_file = "$BUNDLE_ID-$version.xar";
-my $download_url = "$BASE_URL/$package_file";
-my $feed_url = "$BASE_URL/at.nih.libzip$suffix.atom";
-
-open I, "> $docset/Contents/Info.plist" or die "can't create Info.plist: $!";
-print I <<EOF;
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>CFBundleIdentifier</key>
-       <string>$BUNDLE_ID.docset</string>
-       <key>CFBundleName</key>
-       <string>libzip</string>
-       <key>DocSetPublisherIdentifier</key>
-       <string>at.nih</string>
-       <key>DocSetPublisherName</key>
-       <string>NiH</string>
-        <key>NSHumanReadableCopyright</key>
-        <string>Copyright © 2016 Dieter Baron and Thomas Klausner</string>
-       <key>CFBundleVersion</key>
-       <string>$version</string>
-       <key>DocSetFeedURL</key>
-       <string>$feed_url</string>
-       <key>DocSetFeedName</key>
-       <string>libzip</string>
-</dict>
-</plist>
-EOF
-close I;
-
-open N, "> $docset/Contents/Resources/Nodes.xml" or die "can't create Nodes.xml: $!";
-
-my %tl_nodes = (libzip => 1);
-
-for (@sh_nodes) {
-    $tl_nodes{$_} = 1;
-}
-
-my @tokens = ();
-
-print N <<EOF;
-<?xml version="1.0" encoding="UTF-8"?>
-<DocSetNodes version="1.0">
-  <TOC>
-    <Node noindex="1" type="folder">
-      <Name>libzip package</Name>
-      <Subnodes>
-        <Node noindex="1" type="folder">
-          <Name>Library</Name>
-          <Path>libzip.html</Path>
-          <Subnodes>
-EOF
-
-    
-my $id = 1001;
-
-for my $html (@files) {
-    my $name = $html;
-    $name =~ s/.html//;
-
-    if ($tl_nodes{$name}) {
-       next;
-    }
-
-    process_file($html, 'c', $id++);
-}
-
-print N "          </Subnodes>\n";
-print N "        </Node>\n";
-print N "        <Node noindex=\"1\" type=\"folder\">\n";
-print N "          <Name>Commands</Name>\n";
-print N "          <Subnodes>\n";
-
-$id = 2;
-
-for my $name (@sh_nodes) {
-    process_file("$name.html", 'c', $id++);
-}
-
-print N "          </Subnodes>\n";
-print N "        </Node>\n";
-print N "      </Subnodes>\n";
-print N "    </Node>\n";
-print N "  </TOC>\n";
-print N "</DocSetNodes>\n";
-
-close N;
-
-link("$SRCDIR/nih-man.css", "$docset/Contents/Resources/Documents/nih-man.css") or die "can't link css file: $!";
-copy_html('libzip.html', "$docset/Contents/Resources/Documents/libzip.html");
-
-write_tokens();
-
-system($DOCSETUTIL, 'index', $docset) == 0 or die "can't index docset: $!";
-system($DOCSETUTIL, 'validate', $docset) == 0 or die "can't validate docset: $!";
-
-unlink("$docset/Contents/Resources/Nodes.xml");
-unlink("$docset/Contents/Resources/Tokens.xml");
-
-system($DOCSETUTIL, 'package', '-output', "at.nih.libzip-$version.xar", '-atom', "at.nih.libzip$suffix.atom", '-download-url', "$BASE_URL/at.nih.libzip-$version.xar", $docset);
-
-
-sub copy_html {
-    my ($src, $dst) = @_;
-
-    my $content = `cat $src`;
-    $content =~ s,</head>,<meta name="viewport" content="width=device-width"></head>,;
-    $content =~ s,../nih-man.css,nih-man.css,;
-
-    # remove header and footer
-    $content =~ s,<table[^>]*class="(heade?r?|foote?r?)".*?</table>,,sg;
-
-    $content =~ s,(<div class="sec-body") style="margin-left: 5.00ex;",$1,g;
-    $content =~ s,(<div class="ssec-head") style="margin-left: -2.00ex;",$1,g;
-
-    open X, "> $dst" or die "can't create $dst: $!";
-    print X $content;
-    close X;
-}
-
-sub process_file {
-    my ($html, $lang, $id) = @_;
-
-    my $name = $html;
-    $name =~ s/.html//;
-    my $mdoc = "$SRCDIR/$name.mdoc";
-
-    my $description;
-    my @names = ();
-
-    open MD, "< $mdoc" or die "can't open $mdoc: $!";
-
-    while (my $line = <MD>) {
-       if ($line =~ m/^.Nm (.*?)( ,)?$/) {
-           push @names, $1;
-       }
-       elsif ($line =~ m/^.Nd (.*)/) {
-           $description = $1;
-       }
-       elsif ($line =~ m/^.Sh SYNOPSIS/) {
-           last;
-       }
-    }
-
-    close MD;
-
-    print N "            <Node id=\"$id\">\n";
-    print N "              <Name>$name</Name>\n";
-    print N "              <Path>$html</Path>\n";
-    print N "            </Node>\n";
-
-    for my $name (@names) {
-       push @tokens, { type => "//apple_ref/$lang/func",
-                       path => $html,
-                       name => $name,
-                       description => $description,
-                       id => $id };
-    }
-    
-    copy_html($html, "$docset/Contents/Resources/Documents/$html");
-}
-
-sub write_token {
-    my ($T, $token) = @_;
-
-    print $T "  <Token>\n";
-    print $T "    <TokenIdentifier>$token->{type}/$token->{name}</TokenIdentifier>\n";
-    print $T "    <Path>$token->{path}</Path>\n";
-    print $T "    <Abstract>$token->{description}</Abstract>\n";
-    print $T "    <NodeRef refid=\"$token->{id}\" />\n";
-    print $T "  </Token>\n";
-}
-
-sub write_tokens {
-    open my $T, "> $docset/Contents/Resources/Tokens.xml" or die "can't create Tokens.xml: $!";
-    print $T "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
-    print $T "<Tokens version=\"1.0\">\n";
-
-    for my $token (sort { $a->{name} cmp $b->{name} } @tokens) {
-       write_token($T, $token);
-    }
-
-    print $T "</Tokens>\n";
-
-    close $T;
-}
diff --git a/man/nih-man.css b/man/nih-man.css
deleted file mode 100644 (file)
index efabb03..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-div.lit {
-    font-family: monospace;
-}
-div.sec-head, div.ssec-head, h1, h2 {
-    padding: 4pt;
-    border: solid;
-    border-width: 1px;
-    border-color: #555555;
-    background: #aaaaaa;
-    font-weight: bold;
-}
-div.sec-head, h1 {
-    font-size: large;
-}
-h2 {
-    font-size: medium;
-}
-div.sec-body, div.ssec-body {
-    margin-top: 1em;
-}
-span.arg {
-    font-style: italic;
-}
-span.define {
-}
-span.emph {    
-}
-span.errno {
-}
-span.farg {
-    font-style: italic;
-}
-span.fname {
-    font-weight: bold;
-}
-span.ftype {
-    font-style: italic;
-}
-span.includes {
-    font-weight: bold;
-}
-span.name {
-    font-weight: bold;
-}
-
-/* copied from nih's style.css */
-body {
-    background: #cccccc;
-}
-a {
-    text-decoration: none;
-}
-a:link {
-    color: #555555;
-}
-a:visited {
-    color: #666666;
-}
-a:hover {
-    color: #777777;
-}
diff --git a/man/update-html.cmake b/man/update-html.cmake
new file mode 100644 (file)
index 0000000..9e405b2
--- /dev/null
@@ -0,0 +1,11 @@
+# expect variables IN, OUT, and DIR
+EXECUTE_PROCESS(COMMAND mandoc -T html -Oman=%N.html,style=../nih-man.css ${DIR}/${IN}
+  OUTPUT_VARIABLE HTML)
+SET(LINKBASE "http://pubs.opengroup.org/onlinepubs/9699919799/functions/")
+STRING(REGEX REPLACE "(<a class=\"Xr\" href=\")([^\"]*)(\">)" "\\1${LINKBASE}\\2\\3" HTML "${HTML}")
+STRING(REGEX REPLACE "${LINKBASE}(libzip|zip)" "\\1" HTML "${HTML}")
+FILE(WRITE ${DIR}/${OUT}.new "${HTML}")
+CONFIGURE_FILE(${DIR}/${OUT}.new ${DIR}/${OUT} COPYONLY)
+FILE(REMOVE ${DIR}/${OUT}.new)
+
+
diff --git a/man/update-man.cmake b/man/update-man.cmake
new file mode 100644 (file)
index 0000000..4254711
--- /dev/null
@@ -0,0 +1,7 @@
+# expect variables IN, OUT, and DIR
+EXECUTE_PROCESS(COMMAND mandoc -T man ${DIR}/${IN} OUTPUT_VARIABLE MAN)
+STRING(REGEX REPLACE "NetBSD [0-9.]*" "NiH" MAN "${MAN}")
+FILE(WRITE ${DIR}/${OUT}.new "${MAN}")
+CONFIGURE_FILE(${DIR}/${OUT}.new ${DIR}/${OUT} COPYONLY)
+FILE(REMOVE ${DIR}/${OUT}.new)
+
diff --git a/man/zip_add.man b/man/zip_add.man
new file mode 100644 (file)
index 0000000..51301f4
--- /dev/null
@@ -0,0 +1,74 @@
+.TH "ZIP_ADD" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_add\fR,
+\fBzip_replace\fR
+\- add file to zip archive or replace file in zip archive (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_add\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *name\fR, \fIzip_source_t\ *source\fR);
+.PD
+.PP
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_replace\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_add\fR()
+is the obsolete version of
+zip_file_add(3).
+It is the same as calling
+zip_file_add(3)
+with an empty
+\fIflags\fR
+argument.
+Similarly, the
+\fBzip_replace\fR()
+function is the obsolete version of
+zip_file_replace(3).
+It is the same as calling
+zip_file_replace(3)
+with an empty
+\fIflags\fR
+argument.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_add(3),
+zip_file_replace(3)
+.SH "HISTORY"
+\fBzip_add\fR()
+was added in libzip 0.6.
+In libzip 0.10 the return type was changed from
+\fIint\fR
+to
+\fIzip_int64_t\fR.
+It was deprecated in libzip 0.11, use
+\fBzip_file_add\fR()
+instead.
+.PP
+\fBzip_replace\fR()
+was added in libzip 0.6.
+In libzip 0.10 the type of
+\fIindex\fR
+was changed from
+\fIint\fR
+to
+\fIzip_uint64_t\fR.
+It was deprecated in libzip 0.11, use
+\fBzip_file_replace\fR()
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 511896f..27c5319 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_add.mdoc -- add files to zip archive
-.\" Copyright (C) 2004-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_ADD 3
 .Os
 .Sh NAME
@@ -67,6 +67,28 @@ argument.
 .Xr libzip 3 ,
 .Xr zip_file_add 3 ,
 .Xr zip_file_replace 3
+.Sh HISTORY
+.Fn zip_add
+was added in libzip 0.6.
+In libzip 0.10 the return type was changed from
+.Vt int
+to
+.Vt zip_int64_t .
+It was deprecated in libzip 0.11, use
+.Fn zip_file_add
+instead.
+.Pp
+.Fn zip_replace
+was added in libzip 0.6.
+In libzip 0.10 the type of
+.Ar index
+was changed from
+.Vt int
+to
+.Vt zip_uint64_t .
+It was deprecated in libzip 0.11, use
+.Fn zip_file_replace
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_add_dir.man b/man/zip_add_dir.man
new file mode 100644 (file)
index 0000000..b7b6665
--- /dev/null
@@ -0,0 +1,42 @@
+.TH "ZIP_ADD_DIR" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_add_dir\fR
+\- add directory to zip archive (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_add_dir\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *name\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_add_dir\fR()
+is the obsolete version of
+zip_dir_add(3).
+It is the same as calling
+zip_dir_add(3)
+with an empty flags argument.
+.SH "SEE ALSO"
+libzip(3),
+zip_dir_add(3)
+.SH "HISTORY"
+\fBzip_add_dir\fR()
+was added in libzip 0.8.
+In libzip 0.10 the return type was changed from
+\fIint\fR
+to
+\fIzip_int64_t\fR.
+It was deprecated in libzip 0.11, use
+\fBzip_dir_add\fR()
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 9a32ec3..f28d1d5 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_add_dir.mdoc -- add directory to zip archive
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_ADD_DIR 3
 .Os
 .Sh NAME
@@ -52,6 +52,16 @@ with an empty flags argument.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_dir_add 3
+.Sh HISTORY
+.Fn zip_add_dir
+was added in libzip 0.8.
+In libzip 0.10 the return type was changed from
+.Vt int
+to
+.Vt zip_int64_t .
+It was deprecated in libzip 0.11, use
+.Fn zip_dir_add
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_close.man b/man/zip_close.man
new file mode 100644 (file)
index 0000000..0c4ef60
--- /dev/null
@@ -0,0 +1,104 @@
+.TH "ZIP_CLOSE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_close\fR
+\- close zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_close\fR(\fIzip_t\ *archive\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_close\fR()
+function writes any changes made to
+\fIarchive\fR
+to disk.
+If
+\fIarchive\fR
+contains no files, the file is completely removed (no empty archive is
+written).
+If successful,
+\fIarchive\fR
+is freed.
+If writing fails,
+\fBzip_close\fR()
+fails;
+\fIarchive\fR
+is left unchanged and must still be freed.
+.PP
+To close and free a zip archive without saving changes, use
+zip_discard(3).
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_close\fR()
+will fail if:
+.TP 19n
+[\fRZIP_ER_EOF\fR]
+Unexpected end-of-file found while reading from a file.
+.TP 19n
+[\fRZIP_ER_INTERNAL\fR]
+The callback function of an added or replaced file returned an
+error but failed to report which.
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+The
+\fIpath\fR
+argument is
+\fRNULL\fR.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_NOZIP\fR]
+File is not a zip archive.
+.TP 19n
+[\fRZIP_ER_READ\fR]
+A file read failed.
+.TP 19n
+[\fRZIP_ER_RENAME\fR]
+A temporary file could not be renamed to its final name.
+.TP 19n
+[\fRZIP_ER_SEEK\fR]
+A file seek failed.
+.TP 19n
+[\fRZIP_ER_TMPOPEN\fR]
+A temporary file could not be created.
+.TP 19n
+[\fRZIP_ER_WRITE\fR]
+A file write failed.
+.TP 19n
+[\fRZIP_ER_ZLIB\fR]
+An error occurred while (de)compressing a stream with
+zlib(3).
+.PD 0
+.PP
+Additionally, any errors returned by the callback function
+for added or replaced files will be passed back.
+.PD
+.SH "SEE ALSO"
+libzip(3),
+zip_discard(3),
+zip_error_get(3),
+zip_fdopen(3),
+zip_open(3),
+zip_register_progress_callback_with_state(3),
+zip_strerror(3)
+.SH "HISTORY"
+\fBzip_close\fR()
+was added in libzip 0.6.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6e75282..5a8450c 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_close.mdoc -- close zip archive
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_CLOSE 3
 .Os
 .Sh NAME
@@ -44,22 +44,23 @@ libzip (-lzip)
 .Sh DESCRIPTION
 The
 .Fn zip_close
-function closes
+function writes any changes made to
 .Ar archive
-and frees the memory allocated for it.
-If any files within were changed, those changes are written to disk
-first.
-If writing changes fails,
-.Fn zip_close
-fails and
-.Ar archive
-is left unchanged.
+to disk.
 If
 .Ar archive
 contains no files, the file is completely removed (no empty archive is
 written).
+If successful,
+.Ar archive
+is freed.
+If writing fails,
+.Fn zip_close
+fails;
+.Ar archive
+is left unchanged and must still be freed.
 .Pp
-To close a zip file without saving changes, use
+To close and free a zip archive without saving changes, use
 .Xr zip_discard 3 .
 .Sh RETURN VALUES
 Upon successful completion 0 is returned.
@@ -108,6 +109,9 @@ for added or replaced files will be passed back.
 .Xr zip_open 3 ,
 .Xr zip_register_progress_callback_with_state 3 ,
 .Xr zip_strerror 3
+.Sh HISTORY
+.Fn zip_close
+was added in libzip 0.6.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_delete.man b/man/zip_delete.man
new file mode 100644 (file)
index 0000000..2a7404f
--- /dev/null
@@ -0,0 +1,52 @@
+.TH "ZIP_DELETE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_delete\fR
+\- delete file from zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_delete\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR);
+.PD
+.SH "DESCRIPTION"
+The file at position
+\fIindex\fR
+in the zip archive
+\fIarchive\fR
+is marked as deleted.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_delete\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_unchange(3)
+.SH "HISTORY"
+\fBzip_delete\fR()
+was added in libzip 0.6.
+In libzip 0.10 the type of
+\fIindex\fR
+was changed from
+\fIint\fR
+to
+\fIzip_uint64_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 0c9a62b..dc8346e 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_delete.mdoc -- delete files from zip archive
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 10, 2009
+.Dd December 18, 2017
 .Dt ZIP_DELETE 3
 .Os
 .Sh NAME
@@ -64,6 +64,15 @@ is not a valid file index in
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_unchange 3
+.Sh HISTORY
+.Fn zip_delete
+was added in libzip 0.6.
+In libzip 0.10 the type of
+.Ar index
+was changed from
+.Vt int
+to
+.Vt zip_uint64_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_dir_add.man b/man/zip_dir_add.man
new file mode 100644 (file)
index 0000000..951eac2
--- /dev/null
@@ -0,0 +1,83 @@
+.TH "ZIP_DIR_ADD" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_dir_add\fR
+\- add directory to zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_dir_add\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *name\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_dir_add\fR()
+adds a directory to a zip archive.
+The argument
+\fIarchive\fR
+specifies the zip archive to which the directory should be added.
+\fIname\fR
+is the directory's name in the zip archive.
+The
+\fIflags\fR
+argument can be any of:
+.TP 22n
+\fRZIP_FL_ENC_GUESS\fR
+Guess encoding of
+\fIname\fR
+(default).
+.TP 22n
+\fRZIP_FL_ENC_UTF_8\fR
+Interpret
+\fIname\fR
+as UTF-8.
+.TP 22n
+\fRZIP_FL_ENC_CP437\fR
+Interpret
+\fIname\fR
+as code page 437 (CP-437).
+.SH "RETURN VALUES"
+Upon successful completion, the index of the new entry in the archive
+is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_dir_add\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_EXISTS\fR]
+There is already an entry called
+\fIname\fR
+in the archive.
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIarchive\fR
+or
+\fIname\fR
+are
+\fRNULL\fR,
+or invalid UTF-8 encoded file names.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3)
+.SH "HISTORY"
+\fBzip_dir_add\fR()
+was added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
+.SH "CAVEATS"
+\fBzip_dir_add\fR()
+does not look in the file system, it just creates one entry in the
+archive for the provided name.
index d881bf5..82f3fb1 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_dir_add.mdoc -- add directory to zip archive
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 4, 2014
+.Dd December 18, 2017
 .Dt ZIP_DIR_ADD 3
 .Os
 .Sh NAME
@@ -94,6 +94,9 @@ Required memory could not be allocated.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_add 3
+.Sh HISTORY
+.Fn zip_dir_add
+was added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_discard.man b/man/zip_discard.man
new file mode 100644 (file)
index 0000000..57fb433
--- /dev/null
@@ -0,0 +1,34 @@
+.TH "ZIP_DISCARD" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_discard\fR
+\- close zip archive and discard changes
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_discard\fR(\fIzip_t\ *archive\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_discard\fR()
+function closes
+\fIarchive\fR
+and frees the memory allocated for it.
+Any changes to the archive are not written to disk and discarded.
+.SH "SEE ALSO"
+libzip(3),
+zip_close(3)
+.SH "HISTORY"
+\fBzip_discard\fR()
+was added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index b63b7bf..7404a48 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_discard.mdoc -- close zip archive and discard changes
-.\" Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 13, 2012
+.Dd December 18, 2017
 .Dt ZIP_DISCARD 3
 .Os
 .Sh NAME
@@ -51,6 +51,9 @@ Any changes to the archive are not written to disk and discarded.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_close 3
+.Sh HISTORY
+.Fn zip_discard
+was added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_clear.man b/man/zip_error_clear.man
new file mode 100644 (file)
index 0000000..0573ac3
--- /dev/null
@@ -0,0 +1,47 @@
+.TH "ZIP_ERROR_CLEAR" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_clear\fR,
+\fBzip_file_error_clear\fR
+\- clear error state for archive or file
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_clear\fR(\fIzip_t\ *archive\fR);
+.PD
+.PP
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_error_clear\fR(\fIzip_file_t\ *file\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_error_clear\fR()
+function clears the error state for the zip archive
+\fIarchive\fR.
+.PP
+The
+\fBzip_file_error_clear\fR()
+function does the same for the zip file
+\fIfile\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_error_get(3)
+.SH "HISTORY"
+\fBzip_error_clear\fR()
+and
+\fBzip_file_error_clear\fR()
+were added in libzip 0.8.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index fe1d79c..82a8437 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_clear.mdoc -- clear error state for archive or file
-.\" Copyright (C) 2006-2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 30, 2014
+.Dd December 18, 2017
 .Dt ZIP_ERROR_CLEAR 3
 .Os
 .Sh NAME
@@ -57,6 +57,11 @@ function does the same for the zip file
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_error_get 3
+.Sh HISTORY
+.Fn zip_error_clear
+and
+.Fn zip_file_error_clear
+were added in libzip 0.8.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_code_system.man b/man/zip_error_code_system.man
new file mode 100644 (file)
index 0000000..b7e8caa
--- /dev/null
@@ -0,0 +1,36 @@
+.TH "ZIP_ERROR_CODE_SYSTEM" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_code_system\fR
+\- get operating system error part of zip_error
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_code_system\fR(\fIconst\ zip_error_t\ *ze\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_error_code_system\fR()
+function returns the system specific part of the error from the
+zip_error error
+\fIze\fR.
+For finding out what system reported the error, use
+zip_error_system_type(3).
+.SH "SEE ALSO"
+libzip(3),
+zip_error_code_zip(3),
+zip_error_system_type(3)
+.SH "HISTORY"
+\fBzip_error_code_system\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6b9b3a4..c87a206 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_code_system.mdoc -- get system error part of zip_error
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 30, 2014
+.Dd December 18, 2017
 .Dt ZIP_ERROR_CODE_SYSTEM 3
 .Os
 .Sh NAME
@@ -53,6 +53,9 @@ For finding out what system reported the error, use
 .Xr libzip 3 ,
 .Xr zip_error_code_zip 3 ,
 .Xr zip_error_system_type 3
+.Sh HISTORY
+.Fn zip_error_code_system
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_code_zip.man b/man/zip_error_code_zip.man
new file mode 100644 (file)
index 0000000..8f4b5b1
--- /dev/null
@@ -0,0 +1,33 @@
+.TH "ZIP_ERROR_CODE_ZIP" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_code_zip\fR
+\- get libzip error part of zip_error
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_code_zip\fR(\fIconst\ zip_error_t\ *ze\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_error_code_zip\fR()
+function returns the libzip specific part of the error from the
+zip_error error
+\fIze\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_error_code_system(3)
+.SH "HISTORY"
+\fBzip_error_code_zip\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 2875d64..c68fff4 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_code_zip.mdoc -- get libzip error part of zip_error
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 30, 2014
+.Dd December 18, 2017
 .Dt ZIP_ERROR_CODE_ZIP 3
 .Os
 .Sh NAME
@@ -50,6 +50,9 @@ zip_error error
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_error_code_system 3
+.Sh HISTORY
+.Fn zip_error_code_zip
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_fini.man b/man/zip_error_fini.man
new file mode 100644 (file)
index 0000000..bf5063d
--- /dev/null
@@ -0,0 +1,33 @@
+.TH "ZIP_ERROR_FINI" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_fini\fR
+\- clean up zip_error structure
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_fini\fR(\fIzip_error_t\ *ze\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_error_fini\fR()
+function cleans up and frees internally allocated memory of the
+zip_error pointed to by
+\fIze\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_error_init(3)
+.SH "HISTORY"
+\fBzip_error_fini\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6f7dffa..136db4c 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_fini.mdoc -- clean up zip_error
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 30, 2014
+.Dd December 18, 2017
 .Dt ZIP_ERROR_FINI 3
 .Os
 .Sh NAME
@@ -50,6 +50,9 @@ zip_error pointed to by
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_error_init 3
+.Sh HISTORY
+.Fn zip_error_fini
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_get.man b/man/zip_error_get.man
new file mode 100644 (file)
index 0000000..c486936
--- /dev/null
@@ -0,0 +1,107 @@
+.TH "ZIP_ERROR_GET" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_get\fR,
+\fBzip_file_error_get\fR
+\- get error codes for archive or file (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_get\fR(\fIzip_t\ *archive\fR, \fIint\ *zep\fR, \fIint\ *sep\fR);
+.PD
+.PP
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_error_get\fR(\fIzip_file_t\ *file\fR, \fIint\ *zep\fR, \fIint\ *sep\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_error_get\fR()
+and
+\fBzip_file_error_get\fR()
+are deprecated.
+Use
+zip_error_code_system(3),
+zip_error_code_zip(3),
+zip_file_get_error(3),
+and
+zip_get_error(3)
+instead.
+.PP
+For
+\fBzip_error_get\fR(),
+replace
+.nf
+.sp
+.RS 6n
+int ze, se;
+zip_error_get(za, &ze, &se);
+.RE
+.fi
+with
+.nf
+.sp
+.RS 6n
+int ze, se;
+zip_error_t *error = zip_get_error(za);
+ze = zip_error_code_zip(error);
+se = zip_error_code_system(error);
+.RE
+.fi
+For
+\fBzip_file_error_get\fR(),
+replace
+.nf
+.sp
+.RS 6n
+int ze, se;
+zip_file_error_get(zf, &ze, &se);
+.RE
+.fi
+with
+.nf
+.sp
+.RS 6n
+int ze, se;
+zip_error_t *error = zip_file_get_error(zf);
+ze = zip_error_code_zip(error);
+se = zip_error_code_system(error);
+.RE
+.fi
+.SH "SEE ALSO"
+libzip(3),
+zip_error_code_system(3),
+zip_error_code_zip(3),
+zip_file_get_error(3),
+zip_get_error(3)
+.SH "HISTORY"
+\fBzip_error_get\fR()
+was added in libzip 0.6.
+It was deprecated in libzip 1.0, use
+\fBzip_get_error\fR(),
+\fBzip_error_code_zip\fR(),
+/
+\fBzip_error_code_system\fR()
+instead.
+.PP
+\fBzip_file_error_get\fR()
+was added in libzip 0.6.
+It was deprecated in libzip 1.0, use
+\fBzip_file_get_error\fR(),
+\fBzip_error_code_zip\fR(),
+/
+\fBzip_error_code_system\fR()
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index ff3dc38..5271394 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_get.mdoc -- get error codes for archive or file
-.\" Copyright (C) 2004-2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_ERROR_GET 3
 .Os
 .Sh NAME
@@ -92,6 +92,24 @@ se = zip_error_code_system(error);
 .Xr zip_error_code_zip 3 ,
 .Xr zip_file_get_error 3 ,
 .Xr zip_get_error 3
+.Sh HISTORY
+.Fn zip_error_get
+was added in libzip 0.6.
+It was deprecated in libzip 1.0, use
+.Fn zip_get_error ,
+.Fn zip_error_code_zip ,
+/
+.Fn zip_error_code_system
+instead.
+.Pp
+.Fn zip_file_error_get
+was added in libzip 0.6.
+It was deprecated in libzip 1.0, use
+.Fn zip_file_get_error ,
+.Fn zip_error_code_zip ,
+/
+.Fn zip_error_code_system
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_get_sys_type.man b/man/zip_error_get_sys_type.man
new file mode 100644 (file)
index 0000000..4ad9706
--- /dev/null
@@ -0,0 +1,56 @@
+.TH "ZIP_ERROR_GET_SYS_TYPE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_get_sys_type\fR
+\- get type of system error code (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_get_sys_type\fR(\fIint\ ze\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_error_get_sys_type\fR()
+is deprecated; use
+zip_error_init_with_code(3)
+and
+zip_error_system_type(3)
+instead.
+.PP
+Replace
+.nf
+.sp
+.RS 6n
+int i = zip_error_get_sys_type(ze);
+.RE
+.fi
+with
+.nf
+.sp
+.RS 6n
+zip_error_t error;
+zip_error_init_with_code(&error, ze);
+int i = zip_error_system_type(&error);
+.RE
+.fi
+.SH "SEE ALSO"
+libzip(3),
+zip_error_init_with_code(3),
+zip_error_system_type(3)
+.SH "HISTORY"
+\fBzip_error_get_sys_type\fR()
+was added in libzip 0.6.
+It was deprecated in libzip 1.0, use
+\fBzip_error_system_type\fR()
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 0ffabda..16d3af7 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_get_sys_type.mdoc -- get type of error
-.\" Copyright (C) 2004-2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_ERROR_GET_SYS_TYPE 3
 .Os
 .Sh NAME
@@ -64,6 +64,12 @@ int i = zip_error_system_type(&error);
 .Xr libzip 3 ,
 .Xr zip_error_init_with_code 3 ,
 .Xr zip_error_system_type 3
+.Sh HISTORY
+.Fn zip_error_get_sys_type
+was added in libzip 0.6.
+It was deprecated in libzip 1.0, use
+.Fn zip_error_system_type
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_init.man b/man/zip_error_init.man
new file mode 100644 (file)
index 0000000..9caf1d2
--- /dev/null
@@ -0,0 +1,53 @@
+.TH "ZIP_ERROR_INIT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_init\fR,
+\fBzip_error_init_with_code\fR
+\- initialize zip_error structure
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_init\fR(\fIzip_error_t\ *error\fR);
+.PD
+.PP
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_init_with_code\fR(\fIzip_error_t\ *error\fR, \fIint\ ze\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_error_init\fR()
+function initializes the zip_error pointed to by
+\fIerror\fR.
+\fI*error\fR
+must be allocated before calling
+\fBzip_error_init\fR().
+.PP
+The
+\fBzip_error_init_with_code\fR()
+function does the same, but additionally sets the zip error code to
+\fIze\fR
+and sets the system error code to the current
+errno(3)
+value, if appropriate.
+.SH "SEE ALSO"
+libzip(3),
+zip_error_fini(3)
+.SH "HISTORY"
+\fBzip_error_init\fR()
+and
+\fBzip_error_init_with_code\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 3f6cbf7..b524303 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_init.mdoc -- initialize zip_error
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 2, 2014
+.Dd December 18, 2017
 .Dt ZIP_ERROR_INIT 3
 .Os
 .Sh NAME
@@ -64,6 +64,11 @@ value, if appropriate.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_error_fini 3
+.Sh HISTORY
+.Fn zip_error_init
+and
+.Fn zip_error_init_with_code
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_set.man b/man/zip_error_set.man
new file mode 100644 (file)
index 0000000..35c46dd
--- /dev/null
@@ -0,0 +1,42 @@
+.TH "ZIP_ERROR_SET" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_set\fR
+\- fill in zip_error structure
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_set\fR(\fIzip_error_t\ *ze\fR, \fIint\ le\fR, \fIint\ se\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_error_set\fR()
+function sets the zip_error pointed to by
+\fIze\fR
+to the libzip error code
+\fIle\fR
+and the system error code
+\fIse\fR.
+.PP
+\fIze\fR
+must be allocated and initialized with
+zip_error_fini(3)
+before calling
+\fBzip_error\fR(\fIset\fR).
+.SH "SEE ALSO"
+libzip(3),
+zip_error_init(3)
+.SH "HISTORY"
+\fBzip_error_set\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 4cb82ff..f7cc446 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_set.mdoc -- set zip_error
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 30, 2014
+.Dd December 18, 2017
 .Dt ZIP_ERROR_SET 3
 .Os
 .Sh NAME
@@ -59,6 +59,9 @@ before calling
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_error_init 3
+.Sh HISTORY
+.Fn zip_error_set
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_strerror.man b/man/zip_error_strerror.man
new file mode 100644 (file)
index 0000000..ce47153
--- /dev/null
@@ -0,0 +1,40 @@
+.TH "ZIP_ERROR_STRERROR" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_strerror\fR
+\- create human-readable string for zip_error
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIconst char *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_strerror\fR(\fIzip_error_t\ *ze\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_error_strerror\fR()
+function returns an error message string corresponding to
+\fIze\fR
+like
+strerror(3).
+This string will stay valid until the next call to
+\fBzip_error_strerror\fR()
+or until
+zip_error_fini(3)
+is called.
+.SH "SEE ALSO"
+libzip(3),
+strerror(3),
+zip_error_fini(3)
+.SH "HISTORY"
+\fBzip_error_strerror\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6e8b27b..8d44c99 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_strerror.mdoc -- create human-readable version of zip_error
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 30, 2014
+.Dd December 18, 2017
 .Dt ZIP_ERROR_STRERROR 3
 .Os
 .Sh NAME
@@ -57,6 +57,9 @@ is called.
 .Xr libzip 3 ,
 .Xr strerror 3 ,
 .Xr zip_error_fini 3
+.Sh HISTORY
+.Fn zip_error_strerror
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_system_type.man b/man/zip_error_system_type.man
new file mode 100644 (file)
index 0000000..d240a9e
--- /dev/null
@@ -0,0 +1,51 @@
+.TH "ZIP_ERROR_SYSTEM_TYPE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_system_type\fR
+\- return type of system error
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_system_type\fR(\fIconst\ zip_error_t\ *ze\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_error_system_type\fR()
+function returns the type of the system specific part for the zip_error
+\fIze\fR.
+Currently, the following system types are defined:
+.TP 13n
+\fRZIP_ET_NONE\fR
+System specific part of
+\fIze\fR
+is unused.
+.TP 13n
+\fRZIP_ET_SYS\fR
+System specific part of
+\fIze\fR
+is an
+errno(2).
+.TP 13n
+\fRZIP_ET_ZLIB\fR
+System specific part of
+\fIze\fR
+is a
+zlib(3)
+error.
+.SH "SEE ALSO"
+libzip(3),
+zip_error_code_system(3)
+.SH "HISTORY"
+\fBzip_error_system_type\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index bfba6ba..f9fbfce 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_system_type.mdoc -- return system type for error
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 30, 2014
+.Dd December 18, 2017
 .Dt ZIP_ERROR_SYSTEM_TYPE 3
 .Os
 .Sh NAME
@@ -67,6 +67,9 @@ error.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_error_code_system 3
+.Sh HISTORY
+.Fn zip_error_system_type
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_to_data.man b/man/zip_error_to_data.man
new file mode 100644 (file)
index 0000000..546184c
--- /dev/null
@@ -0,0 +1,42 @@
+.TH "ZIP_ERROR_TO_DATA" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_to_data\fR
+\- convert zip_error to return value suitable for ZIP_SOURCE_ERROR
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_to_data\fR(\fIconst\ zip_error_t\ *ze\fR, \fIvoid\ *data\fR, \fIzip_uint64_t\ len\fR);
+.PD
+.SH "DESCRIPTION"
+\fBzip_error_to_data\fR()
+function converts the zip_error
+\fIze\fR
+into data suitable as return value for
+\fRZIP_SOURCE_ERROR\fR.
+The data is written into the buffer
+\fIdata\fR
+of size
+\fIlen\fR.
+If the buffer is not large enough to hold 2 ints, an error is
+returned.
+.SH "RETURN VALUES"
+\fBzip_error_to_data\fR()
+returns 2*(sizeof int) on success, and \-1 on error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source_function(3)
+.SH "HISTORY"
+\fBzip_error_to_data\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index d2cbf8e..e7ba170 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_to_data.mdoc -- create error data for ZIP_SOURCE_ERROR
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 2, 2014
+.Dd December 18, 2017
 .Dt ZIP_ERROR_TO_DATA 3
 .Os
 .Sh NAME
@@ -59,6 +59,9 @@ returns 2*(sizeof int) on success, and \-1 on error.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_source_function 3
+.Sh HISTORY
+.Fn zip_error_to_data
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_error_to_str.man b/man/zip_error_to_str.man
new file mode 100644 (file)
index 0000000..7067fe4
--- /dev/null
@@ -0,0 +1,67 @@
+.TH "ZIP_ERROR_TO_STR" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_error_to_str\fR
+\- get string representation of zip error (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_error_to_str\fR(\fIchar\ *buf\fR, \fIzip_uint64_t\ len\fR, \fIint\ ze\fR, \fIint\ se\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_error_to_str\fR()
+is deprecated; use
+zip_error_init_with_code(3)
+and
+zip_error_strerror(3)
+instead.
+.PP
+Replace
+.nf
+.sp
+.RS 6n
+char buf[BUFSIZE];
+zip_error_to_str(buf, sizeof(buf), ze, se);
+printf("%s", buf);
+.RE
+.fi
+with
+.nf
+.sp
+.RS 6n
+zip_error_t error;
+zip_error_init_with_code(&error, ze);
+printf("%s", zip_error_strerror(&error));
+zip_error_fini(&error);
+.RE
+.fi
+.SH "SEE ALSO"
+libzip(3),
+zip_error_init_with_code(3),
+zip_error_strerror(3)
+.SH "HISTORY"
+\fBzip_error_to_str\fR()
+was added in libzip 0.6.
+In libzip 0.10 the type of
+\fIlen\fR
+was changed from
+\fIsize_t\fR
+to
+\fIzip_uint64_t\fR.
+It was deprecated in libzip 1.0, use
+\fBzip_error_init_with_code\fR()
+and
+\fBzip_error_strerror\fR()
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 42bc61c..7054d3e 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_error_to_str.mdoc -- get string representation of zip error code
-.\" Copyright (C) 2003-2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_ERROR_TO_STR 3
 .Os
 .Sh NAME
@@ -67,6 +67,20 @@ zip_error_fini(&error);
 .Xr libzip 3 ,
 .Xr zip_error_init_with_code 3 ,
 .Xr zip_error_strerror 3
+.Sh HISTORY
+.Fn zip_error_to_str
+was added in libzip 0.6.
+In libzip 0.10 the type of
+.Ar len
+was changed from
+.Vt size_t
+to
+.Vt zip_uint64_t .
+It was deprecated in libzip 1.0, use
+.Fn zip_error_init_with_code
+and
+.Fn zip_error_strerror
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_errors.man b/man/zip_errors.man
new file mode 100644 (file)
index 0000000..45f8735
--- /dev/null
@@ -0,0 +1,112 @@
+.TH "ZIP_ERRORS" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_errors\fR
+\- list of all libzip error codes
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.SH "DESCRIPTION"
+The following error codes are used by libzip:
+.TP 23n
+[\fRZIP_ER_CHANGED\fR]
+Entry has been changed.
+.TP 23n
+[\fRZIP_ER_CLOSE\fR]
+Closing zip archive failed.
+.TP 23n
+[\fRZIP_ER_COMPNOTSUPP\fR]
+Compression method not supported.
+.TP 23n
+[\fRZIP_ER_COMPRESSED_DATA\fR]
+Compressed data invalid.
+.TP 23n
+[\fRZIP_ER_CRC\fR]
+CRC error.
+.TP 23n
+[\fRZIP_ER_DELETED\fR]
+Entry has been deleted.
+.TP 23n
+[\fRZIP_ER_ENCRNOTSUPP\fR]
+Encryption method not supported.
+.TP 23n
+[\fRZIP_ER_EOF\fR]
+Premature end of file.
+.TP 23n
+[\fRZIP_ER_EXISTS\fR]
+File already exists.
+.TP 23n
+[\fRZIP_ER_INCONS\fR]
+Zip archive inconsistent.
+.TP 23n
+[\fRZIP_ER_INTERNAL\fR]
+Internal error.
+.TP 23n
+[\fRZIP_ER_INUSE\fR]
+Resource still in use.
+.TP 23n
+[\fRZIP_ER_INVAL\fR]
+Invalid argument.
+.TP 23n
+[\fRZIP_ER_MEMORY\fR]
+Malloc failure.
+.TP 23n
+[\fRZIP_ER_MULTIDISK\fR]
+Multi-disk zip archives not supported.
+.TP 23n
+[\fRZIP_ER_NOENT\fR]
+No such file.
+.TP 23n
+[\fRZIP_ER_NOPASSWD\fR]
+No password provided.
+.TP 23n
+[\fRZIP_ER_NOZIP\fR]
+Not a zip archive.
+.TP 23n
+[\fRZIP_ER_OK\fR]
+No error.
+.TP 23n
+[\fRZIP_ER_OPEN\fR]
+Can't open file.
+.TP 23n
+[\fRZIP_ER_OPNOTSUPP\fR]
+Operation not supported.
+.TP 23n
+[\fRZIP_ER_RDONLY\fR]
+Read-only archive.
+.TP 23n
+[\fRZIP_ER_READ\fR]
+Read error.
+.TP 23n
+[\fRZIP_ER_REMOVE\fR]
+Can't remove file.
+.TP 23n
+[\fRZIP_ER_RENAME\fR]
+Renaming temporary file failed.
+.TP 23n
+[\fRZIP_ER_SEEK\fR]
+Seek error.
+.TP 23n
+[\fRZIP_ER_TELL\fR]
+Tell error.
+.TP 23n
+[\fRZIP_ER_TMPOPEN\fR]
+Failure to create temporary file.
+.TP 23n
+[\fRZIP_ER_WRITE\fR]
+Write error.
+.TP 23n
+[\fRZIP_ER_WRONGPASSWD\fR]
+Wrong password provided.
+.TP 23n
+[\fRZIP_ER_ZIPCLOSED\fR]
+Containing zip archive was closed.
+.TP 23n
+[\fRZIP_ER_ZLIB\fR]
+Zlib error.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 5397fc2..935d842 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_errors.mdoc -- list of all libzip error codes
-.\" Copyright (C) 1999-2013 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -32,7 +32,7 @@
 .\"   This file was generated automatically by ./make_zip_errors.sh
 .\"   from ./../lib/zip.h; make changes there.
 .\"
-.Dd October 6, 2017
+.Dd December 18, 2017
 .Dt ZIP_ERRORS 3
 .Os
 .Sh NAME
diff --git a/man/zip_fclose.man b/man/zip_fclose.man
new file mode 100644 (file)
index 0000000..d8ae594
--- /dev/null
@@ -0,0 +1,38 @@
+.TH "ZIP_FCLOSE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_fclose\fR
+\- close file in zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_fclose\fR(\fIzip_file_t\ *file\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_fclose\fR()
+function closes
+\fIfile\fR
+and frees the memory allocated for it.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, the error code is returned.
+.SH "SEE ALSO"
+libzip(3),
+zip_fopen(3),
+zip_fread(3),
+zip_fseek(3)
+.SH "HISTORY"
+\fBzip_fclose\fR()
+was added in libzip 0.6.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index e43cdf5..0bbeee7 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_fclose.mdoc -- close file in zip archive
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 12, 2016
+.Dd December 18, 2017
 .Dt ZIP_FCLOSE 3
 .Os
 .Sh NAME
@@ -55,6 +55,9 @@ Otherwise, the error code is returned.
 .Xr zip_fopen 3 ,
 .Xr zip_fread 3 ,
 .Xr zip_fseek 3
+.Sh HISTORY
+.Fn zip_fclose
+was added in libzip 0.6.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_fdopen.man b/man/zip_fdopen.man
new file mode 100644 (file)
index 0000000..92e0b6d
--- /dev/null
@@ -0,0 +1,126 @@
+.TH "ZIP_FDOPEN" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_fdopen\fR
+\- open zip archive using open file descriptor
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_fdopen\fR(\fIint\ fd\fR, \fIint\ flags\fR, \fIint\ *errorp\fR);
+.PD
+.SH "DESCRIPTION"
+The zip archive specified by the open file descriptor
+\fIfd\fR
+is opened and a pointer to a
+\fIstruct zip\fR,
+used to manipulate the archive, is returned.
+In contrast to
+zip_open(3),
+using
+\fBzip_fdopen\fR
+the archive can only be opened in read-only mode.
+The
+\fIfd\fR
+argument may not be used any longer after calling
+\fBzip_fdopen\fR.
+The
+\fIflags\fR
+are specified by
+\fIor\fR'ing
+the following values, or 0 for none of them.
+.RS 6n
+.TP 15n
+\fRZIP_CHECKCONS\fR
+Perform additional stricter consistency checks on the archive, and
+error if they fail.
+.RE
+.PP
+If an error occurs and
+\fIerrorp\fR
+is
+non-\fRNULL\fR,
+it will be set to the corresponding error code.
+.SH "RETURN VALUES"
+Upon successful completion
+\fBzip_fdopen\fR()
+returns a
+\fIstruct zip\fR
+pointer, and
+\fIfd\fR
+should not be used any longer, nor passed to
+close(2).
+Otherwise,
+\fRNULL\fR
+is returned and
+\fI*errorp\fR
+is set to indicate the error.
+In the error case,
+\fIfd\fR
+remains unchanged.
+.SH "ERRORS"
+The file specified by
+\fIfd\fR
+is prepared for use by
+libzip(3)
+unless:
+.TP 19n
+[\fRZIP_ER_INCONS\fR]
+Inconsistencies were found in the file specified by
+\fIpath\fR.
+This error is often caused by specifying
+\fRZIP_CHECKCONS\fR
+but can also happen without it.
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+The
+\fIflags\fR
+argument is invalid.
+Not all
+zip_open(3)
+flags are allowed for
+\fBzip_fdopen\fR,
+see
+\fIDESCRIPTION\fR.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_NOZIP\fR]
+The file specified by
+\fIfd\fR
+is not a zip archive.
+.TP 19n
+[\fRZIP_ER_OPEN\fR]
+The file specified by
+\fIfd\fR
+could not be prepared for use by
+libzip(3).
+.TP 19n
+[\fRZIP_ER_READ\fR]
+A read error occurred; see
+\fIerrno\fR
+for details.
+.TP 19n
+[\fRZIP_ER_SEEK\fR]
+The file specified by
+\fIfd\fR
+does not allow seeks.
+.SH "SEE ALSO"
+libzip(3),
+zip_close(3),
+zip_error_to_str(3),
+zip_open(3)
+.SH "HISTORY"
+\fBzip_fdopen\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 2c177a3..3e2672c 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_fdopen.mdoc -- open zip archive using existing file descriptor
-.\" Copyright (C) 2009-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2009-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 13, 2012
+.Dd December 18, 2017
 .Dt ZIP_FDOPEN 3
 .Os
 .Sh NAME
@@ -137,6 +137,9 @@ does not allow seeks.
 .Xr zip_close 3 ,
 .Xr zip_error_to_str 3 ,
 .Xr zip_open 3
+.Sh HISTORY
+.Fn zip_fdopen
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_add.man b/man/zip_file_add.man
new file mode 100644 (file)
index 0000000..1eb9ecf
--- /dev/null
@@ -0,0 +1,150 @@
+.TH "ZIP_FILE_ADD" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_add\fR,
+\fBzip_file_replace\fR
+\- add file to zip archive or replace file in zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_add\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *name\fR, \fIzip_source_t\ *source\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.PP
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_replace\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_source_t\ *source\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_file_add\fR()
+adds a file to a zip archive, while
+\fBzip_file_replace\fR()
+replaces an existing file in a zip archive.
+The argument
+\fIarchive\fR
+specifies the zip archive to which the file should be added.
+\fIname\fR
+is the file's name in the zip archive (for
+\fBzip_file_add\fR()),
+while
+\fIindex\fR
+specifies which file should be replaced (for
+\fBzip_file_replace\fR()).
+The
+\fIflags\fR
+argument can be any combination of
+\fRZIP_FL_OVERWRITE\fR
+with one of
+\fRZIP_FL_ENC_*\fR:
+.TP 22n
+\fRZIP_FL_OVERWRITE\fR
+Overwrite any existing file of the same name.
+For
+\fBzip_file_add\fR
+only.
+.TP 22n
+\fRZIP_FL_ENC_GUESS\fR
+Guess encoding of
+\fIname\fR
+(default).
+.TP 22n
+\fRZIP_FL_ENC_UTF_8\fR
+Interpret
+\fIname\fR
+as UTF-8.
+.TP 22n
+\fRZIP_FL_ENC_CP437\fR
+Interpret
+\fIname\fR
+as code page 437 (CP-437).
+.PD 0
+.PP
+The data is obtained from the
+\fIsource\fR
+argument, see
+zip_source(3).
+.PD
+.PP
+\fINOTE\fR:
+zip_source_free(3)
+should not be called on a
+\fIsource\fR
+after it was used successfully in a
+\fBzip_file_add\fR
+or
+\fBzip_file_replace\fR
+call.
+.SH "RETURN VALUES"
+Upon successful completion,
+\fBzip_file_add\fR()
+returns the index of the new file in the archive, and
+\fBzip_file_replace\fR()
+returns 0.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "EXAMPLES"
+.nf
+.RS 6n
+zip_source_t *s;
+const char buf="teststring";
+
+if ((s=zip_source_buffer(archive, buffer, sizeof(buf), 0)) == NULL ||
+    zip_file_add(archive, name, s, ZIP_FL_ENC_UTF_8) < 0) {
+    zip_source_free(s);
+    printf("error adding file: %s\en", zip_strerror(archive));
+}
+.RE
+.fi
+.SH "ERRORS"
+\fBzip_file_add\fR()
+and
+\fBzip_file_replace\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_EXISTS\fR]
+There is already a file called
+\fIname\fR
+in the archive.
+(Only applies to
+\fBzip_file_add\fR(),
+and only if
+\fRZIP_FL_OVERWRITE\fR
+is not provided).
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIsource\fR
+or
+\fIname\fR
+are
+\fRNULL\fR,
+or
+\fIindex\fR
+is invalid.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_RDONLY\fR]
+Archive was opened in read-only mode.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3)
+.SH "HISTORY"
+\fBzip_file_add\fR()
+and
+\fBzip_file_replace\fR()
+were added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 4c03d37..5600cc3 100644 (file)
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 6, 2017
+.Dd December 18, 2017
 .Dt ZIP_FILE_ADD 3
 .Os
 .Sh NAME
@@ -151,6 +151,11 @@ Archive was opened in read-only mode.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_source 3
+.Sh HISTORY
+.Fn zip_file_add
+and
+.Fn zip_file_replace
+were added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_extra_field_delete.man b/man/zip_file_extra_field_delete.man
new file mode 100644 (file)
index 0000000..69d67c8
--- /dev/null
@@ -0,0 +1,109 @@
+.TH "ZIP_FILE_EXTRA_FIELD_DELETE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_extra_field_delete\fR,
+\fBzip_file_extra_field_delete_by_id\fR
+\- delete extra field for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_extra_field_delete\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ extra_field_index\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.PP
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_extra_field_delete_by_id\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ extra_field_id\fR, \fIzip_uint16_t\ extra_field_index\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_extra_field_delete\fR()
+function deletes the extra field with index
+\fIextra_field_index\fR
+for the file at position
+\fIindex\fR
+in the zip archive.
+.PP
+If
+\fIextra_field_index\fR
+is
+\fRZIP_EXTRA_FIELD_ALL\fR,
+then all extra fields will be deleted.
+.PP
+The following
+\fIflags\fR
+are supported:
+.RS 6n
+.TP 18n
+\fRZIP_FL_CENTRAL\fR
+Delete extra fields from the archive's central directory.
+.TP 18n
+\fRZIP_FL_LOCAL\fR
+Delete extra fields from the local file headers.
+.RE
+.PP
+The
+\fBzip_file_extra_field_delete_by_id\fR()
+function deletes the extra field with ID (two-byte signature)
+\fIextra_field_id\fR
+and index
+\fIextra_field_index\fR
+(in other words, the
+\fIextra_field_index\fR'th
+extra field with ID
+\fIextra_field_id\fR)
+The other arguments are the same as for
+\fBzip_file_extra_field_delete\fR()
+(\fRZIP_EXTRA_FIELD_ALL\fR
+will delete all extra fields of the specified ID).
+.PP
+Please note that due to the library design, the index of an extra
+field may be different between central directory and local file
+headers.
+For this reason, it is not allowed to specify both
+\fRZIP_FL_CENTRAL\fR
+and
+\fRZIP_FL_LOCAL\fR
+in
+\fIflags\fR,
+except when deleting all extra fields (i.e.,
+\fIextra_field_index\fR
+being
+\fRZIP_EXTRA_FIELD_ALL\fR).
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_file_extra_field_delete\fR()
+and
+\fBzip_file_extra_field_delete_by_id\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_NOENT\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_extra_field_get(3),
+zip_file_extra_field_set(3),
+zip_file_extra_fields_count(3)
+.SH "HISTORY"
+\fBzip_file_extra_field_delete\fR()
+and
+\fBzip_file_extra_field_delete_by_id\fR()
+were added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 7fad9d4..005e747 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_extra_field_delete.mdoc -- delete extra field for file in zip
-.\" Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 31, 2013
+.Dd December 18, 2017
 .Dt ZIP_FILE_EXTRA_FIELD_DELETE 3
 .Os
 .Sh NAME
@@ -118,6 +118,11 @@ is not a valid file index in
 .Xr zip_file_extra_field_get 3 ,
 .Xr zip_file_extra_field_set 3 ,
 .Xr zip_file_extra_fields_count 3
+.Sh HISTORY
+.Fn zip_file_extra_field_delete
+and
+.Fn zip_file_extra_field_delete_by_id
+were added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_extra_field_get.man b/man/zip_file_extra_field_get.man
new file mode 100644 (file)
index 0000000..049dc1e
--- /dev/null
@@ -0,0 +1,137 @@
+.TH "ZIP_FILE_EXTRA_FIELD_GET" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_extra_field_get\fR,
+\fBzip_file_extra_field_get_by_id\fR
+\- get extra field for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIconst zip_uint8_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_extra_field_get\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ extra_field_index\fR, \fIzip_uint16_t\ *idp\fR, \fIzip_uint16_t\ *lenp\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.PP
+\fIconst zip_uint8_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_extra_field_get_by_id\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ extra_field_id\fR, \fIzip_uint16_t\ extra_field_index\fR, \fIzip_uint16_t\ *lenp\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_extra_field_get\fR()
+function returns the extra field with index
+\fIextra_field_index\fR
+for the file at position
+\fIindex\fR
+in the zip archive.
+This pointer should not be modified or
+free(3)'d,
+and becomes invalid when
+\fIarchive\fR
+is closed.
+If
+\fIidp\fR
+is not
+\fRNULL\fR,
+the integer to which it points will be set to the ID (two-byte
+signature) of the selected extra field.
+If
+\fIlenp\fR
+is not
+\fRNULL\fR,
+the integer to which it points will be set to the length of the
+extra field.
+Generally speaking,
+\fIlenp\fR
+and
+\fIidp\fR
+should be passed since only the extra field data is returned (i.e.,
+neither the ID nor the length, if the
+\fIidp\fR
+and
+\fIlenp\fR
+arguments are not provided).
+.PP
+The following
+\fIflags\fR
+are supported:
+.RS 6n
+.TP 20n
+\fRZIP_FL_CENTRAL\fR
+Return extra fields from the archive's central directory.
+.TP 20n
+\fRZIP_FL_LOCAL\fR
+Return extra fields from the local file headers.
+.TP 20n
+\fRZIP_FL_UNCHANGED\fR
+Return the original unchanged extra fields, ignoring any changes made.
+.RE
+.PP
+The
+\fBzip_file_extra_field_get_by_id\fR()
+function returns the extra field with ID (two-byte signature)
+\fIextra_field_id\fR
+and index
+\fIextra_field_index\fR
+(in other words, the
+\fIextra_field_index\fR'th
+extra field with ID
+\fIextra_field_id\fR)
+The other arguments are the same as for
+\fBzip_file_extra_field_get\fR().
+.SH "RETURN VALUES"
+Upon successful completion, a pointer to an extra field is returned,
+or
+\fRNULL\fR
+if there is no extra field with that
+\fIextra_field_index\fR
+for the file with index
+\fIindex\fR.
+In case of an error,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_file_extra_field_get\fR()
+and
+\fBzip_file_extra_field_get_by_id\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_NOENT\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR,
+or
+\fIextra_field_index\fR
+is not a valid extra file index (for ID
+\fIextra_field_id\fR).
+.SH "SEE ALSO"
+libzip(3),
+zip_file_extra_field_delete(3),
+zip_file_extra_field_set(3),
+zip_file_extra_fields_count(3)
+.SH "HISTORY"
+\fBzip_file_extra_field_get\fR()
+and
+\fBzip_file_extra_field_get_by_id\fR()
+were added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
+.SH "CAVEATS"
+Please note that the extra field IDs 0x0001 (ZIP64 extension),
+0x6375 (Infozip UTF-8 comment), and
+0x7075 (Infozip UTF-8 file name) can not be read using
+\fBzip_file_extra_field_get\fR()
+since they are used by
+libzip(3)
+internally.
index 5a54119..72b2c87 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_extra_field_get.mdoc -- get extra field for file in zip
-.\" Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 8, 2014
+.Dd December 18, 2017
 .Dt ZIP_FILE_EXTRA_FIELD_GET 3
 .Os
 .Sh NAME
@@ -137,6 +137,11 @@ is not a valid extra file index (for ID
 .Xr zip_file_extra_field_delete 3 ,
 .Xr zip_file_extra_field_set 3 ,
 .Xr zip_file_extra_fields_count 3
+.Sh HISTORY
+.Fn zip_file_extra_field_get
+and
+.Fn zip_file_extra_field_get_by_id
+were added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_extra_field_set.man b/man/zip_file_extra_field_set.man
new file mode 100644 (file)
index 0000000..11089b9
--- /dev/null
@@ -0,0 +1,91 @@
+.TH "ZIP_FILE_EXTRA_FIELD_SET" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_extra_field_set\fR
+\- set extra field for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_extra_field_set\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ extra_field_id\fR, \fIzip_uint16_t\ extra_field_index\fR, \fIconst\ zip_uint8_t\ *extra_field_data\fR, \fIzip_uint16_t\ len\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_extra_field_set\fR()
+function sets the extra field with ID (two-byte signature)
+\fIextra_field_id\fR
+and index
+\fIextra_field_index\fR
+for the file at position
+\fIindex\fR
+in the zip archive.
+The extra field's data will be set to
+\fIextra_field_data\fR
+and length
+\fIlen\fR.
+If a new entry shall be appended, set
+\fIextra_field_index\fR
+to
+\fRZIP_EXTRA_FIELD_NEW\fR.
+.PP
+At least one of the following
+\fIflags\fR
+must be set:
+.RS 6n
+.TP 18n
+\fRZIP_FL_CENTRAL\fR
+Set extra field in the archive's central directory.
+.TP 18n
+\fRZIP_FL_LOCAL\fR
+Set extra field in the local file headers.
+.RE
+.PP
+Please note that the extra field IDs 0x0001 (ZIP64 extension),
+0x6375 (Infozip UTF-8 comment), and
+0x7075 (Infozip UTF-8 file name) can not be set using
+\fBzip_file_extra_field_set\fR()
+since they are set by
+libzip(3)
+automatically when needed.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_file_extra_field_set\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+The extra field size is too large (ID and length need 4 bytes; the
+maximum length of all extra fields for one file combined is 65536
+bytes).
+This error also occurs if
+\fIextra_field_index\fR
+is too large.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_NOENT\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_extra_field_delete(3),
+zip_file_extra_field_get(3),
+zip_file_extra_fields_count(3)
+.SH "HISTORY"
+\fBzip_file_extra_field_set\fR()
+was added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 9652c98..3e6abc1 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_extra_field_set.mdoc -- set extra field for file in zip
-.\" Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 20, 2013
+.Dd December 18, 2017
 .Dt ZIP_FILE_EXTRA_FIELD_SET 3
 .Os
 .Sh NAME
@@ -105,6 +105,9 @@ is not a valid file index in
 .Xr zip_file_extra_field_delete 3 ,
 .Xr zip_file_extra_field_get 3 ,
 .Xr zip_file_extra_fields_count 3
+.Sh HISTORY
+.Fn zip_file_extra_field_set
+was added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_extra_fields_count.man b/man/zip_file_extra_fields_count.man
new file mode 100644 (file)
index 0000000..b6a054c
--- /dev/null
@@ -0,0 +1,92 @@
+.TH "ZIP_FILE_EXTRA_FIELDS_COUNT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_extra_fields_count\fR,
+\fBzip_file_extra_fields_count_by_id\fR
+\- count extra fields for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int16_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_extra_fields_count\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.PP
+\fIzip_int16_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_extra_fields_count_by_id\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ extra_field_id\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_extra_fields_count\fR()
+function counts the extra fields for the file at position
+\fIindex\fR
+in the zip archive.
+.PP
+The following
+\fIflags\fR
+are supported:
+.RS 6n
+.TP 18n
+\fRZIP_FL_CENTRAL\fR
+Count extra fields from the archive's central directory.
+.TP 18n
+\fRZIP_FL_LOCAL\fR
+Count extra fields from the local file headers.
+.TP 18n
+\fRZIP_FL_UNCHANGED\fR
+Count the original unchanged extra fields, ignoring any changes made.
+.RE
+.PP
+The
+\fBzip_file_extra_fields_count_by_id\fR()
+function counts the extra fields with ID (two-byte signature)
+\fIextra_field_id\fR.
+The other arguments are the same as for
+\fBzip_file_extra_fields_count\fR().
+.PP
+Extra fields that are the same in the central directory and the local file
+header are merged into one.
+Therefore, the counts with
+\fRZIP_FL_CENTRAL\fR
+and
+\fRZIP_FL_LOCAL\fR
+do not need to add up to the same value as when given
+\fRZIP_FL_CENTRAL|ZIP_FL_LOCAL\fR
+at the same time.
+.SH "RETURN VALUES"
+Upon successful completion, the requested number of extra fields is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_file_extra_fields_count\fR()
+and
+\fBzip_file_extra_fields_count_by_id\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_NOENT\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_extra_field_delete(3),
+zip_file_extra_field_get(3),
+zip_file_extra_field_set(3)
+.SH "HISTORY"
+\fBzip_file_extra_fields_count\fR()
+and
+\fBzip_file_extra_fields_count_by_id\fR()
+were added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index b7b7d75..47bb9a3 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_extra_fields_count.mdoc -- count extra field for file in zip
-.\" Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 20, 2013
+.Dd December 18, 2017
 .Dt ZIP_FILE_EXTRA_FIELDS_COUNT 3
 .Os
 .Sh NAME
@@ -101,6 +101,11 @@ is not a valid file index in
 .Xr zip_file_extra_field_delete 3 ,
 .Xr zip_file_extra_field_get 3 ,
 .Xr zip_file_extra_field_set 3
+.Sh HISTORY
+.Fn zip_file_extra_fields_count
+and
+.Fn zip_file_extra_fields_count_by_id
+were added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_get_comment.man b/man/zip_file_get_comment.man
new file mode 100644 (file)
index 0000000..b9eebb3
--- /dev/null
@@ -0,0 +1,93 @@
+.TH "ZIP_FILE_GET_COMMENT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_get_comment\fR
+\- get comment for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIconst char *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_get_comment\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint32_t\ *lenp\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_get_comment\fR()
+function returns the comment for the file at position
+\fIindex\fR
+in the zip archive.
+The name is in UTF-8 encoding unless
+\fRZIP_FL_ENC_RAW\fR
+was specified (see below).
+This pointer should not be modified or
+free(3)'d,
+and becomes invalid when
+\fIarchive\fR
+is closed.
+If
+\fIlenp\fR
+is not
+\fRNULL\fR,
+the integer to which it points will be set to the length of the
+comment.
+If
+\fIflags\fR
+is set to
+\fRZIP_FL_UNCHANGED\fR,
+the original unchanged comment is returned.
+.PP
+Additionally, the following
+\fIflags\fR
+are supported:
+.RS 6n
+.TP 21n
+\fRZIP_FL_ENC_RAW\fR
+Return the unmodified comment as it is in the ZIP archive.
+.TP 21n
+\fRZIP_FL_ENC_GUESS\fR
+(Default.)
+Guess the encoding of the comment in the ZIP archive and convert it
+to UTF-8, if necessary.
+.TP 21n
+\fRZIP_FL_ENC_STRICT\fR
+Follow the ZIP specification for file names and extend it to file
+comments, expecting them to be encoded in CP-437 in the ZIP archive
+(except if it is a UTF-8 comment from the special extra field).
+Convert it to UTF-8.
+.RE
+\fINote\fR:
+ASCII is a subset of both CP-437 and UTF-8.
+.SH "RETURN VALUES"
+Upon successful completion, a pointer to the comment is returned,
+or
+\fRNULL\fR
+if there is no comment.
+In case of an error,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_file_get_comment\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_set_comment(3),
+zip_get_archive_comment(3)
+.SH "HISTORY"
+\fBzip_file_get_comment\fR()
+was added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index e41514b..7243282 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_get_comment.mdoc -- get comment for file in zip
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 19, 2013
+.Dd December 18, 2017
 .Dt ZIP_FILE_GET_COMMENT 3
 .Os
 .Sh NAME
@@ -108,6 +108,9 @@ is not a valid file index in
 .Xr libzip 3 ,
 .Xr zip_file_set_comment 3 ,
 .Xr zip_get_archive_comment 3
+.Sh HISTORY
+.Fn zip_file_get_comment
+was added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_get_error.man b/man/zip_file_get_error.man
new file mode 100644 (file)
index 0000000..6d96e8d
--- /dev/null
@@ -0,0 +1,30 @@
+.TH "ZIP_FILE_GET_ERROR" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_get_error\fR
+\- extract zip_error from zip_file
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_error_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_get_error\fR(\fIzip_file_t\ *zf\fR);
+.PD
+.SH "DESCRIPTION"
+\fBzip_file_get_error\fR()
+function returns the zip_error associated with the zip_file
+\fIzf\fR.
+.SH "SEE ALSO"
+libzip(3)
+.SH "HISTORY"
+\fBzip_file_get_error\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index f56693f..56628a1 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_get_error.mdoc -- extract zip_error from zip_file
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 9, 2014
+.Dd December 18, 2017
 .Dt ZIP_FILE_GET_ERROR 3
 .Os
 .Sh NAME
@@ -47,6 +47,9 @@ function returns the zip_error associated with the zip_file
 .Ar zf .
 .Sh SEE ALSO
 .Xr libzip 3
+.Sh HISTORY
+.Fn zip_file_get_error
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_get_external_attributes.man b/man/zip_file_get_external_attributes.man
new file mode 100644 (file)
index 0000000..c2429f8
--- /dev/null
@@ -0,0 +1,141 @@
+.TH "ZIP_FILE_GET_EXTERNAL_ATTRIBUTES" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_get_external_attributes\fR
+\- get external attributes for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.PD 0
+.HP 4n
+\fBzip_file_get_external_attributes\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_flags_t\ flags\fR, \fIzip_uint8_t\ *opsys\fR, \fIzip_uint32_t\ *attributes\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_get_external_attributes\fR()
+function returns the operating system and external attributes for the
+file at position
+\fIindex\fR
+in the zip archive.
+The external attributes usually contain the operating system-specific
+file permissions.
+If
+\fIflags\fR
+is set to
+\fRZIP_FL_UNCHANGED\fR,
+the original unchanged values are returned.
+If
+\fIopsys\fR
+or
+\fIattributes\fR
+are
+\fRNULL\fR,
+they are not filled in.
+.PP
+The following operating systems are defined by the zip specification:
+.RS 6n
+.PD 0
+.PP
+\fRZIP_OPSYS_ACORN_RISC\fR
+.PP
+\fRZIP_OPSYS_ALTERNATE_MVS\fR
+.PP
+\fRZIP_OPSYS_AMIGA\fR
+.PP
+\fRZIP_OPSYS_ATARI_ST\fR
+.PP
+\fRZIP_OPSYS_BEOS\fR
+.PP
+\fRZIP_OPSYS_CPM\fR
+.PP
+\fRZIP_OPSYS_DOS\fR
+.PP
+\fRZIP_OPSYS_MACINTOSH\fR
+.PP
+\fRZIP_OPSYS_MVS\fR
+.PP
+\fRZIP_OPSYS_OPENVMS\fR
+.PP
+\fRZIP_OPSYS_OS_2\fR
+.PP
+\fRZIP_OPSYS_OS_400\fR
+.PP
+\fRZIP_OPSYS_OS_X\fR
+.PP
+\fRZIP_OPSYS_TANDEM\fR
+.PP
+\fRZIP_OPSYS_UNIX\fR
+.PP
+\fRZIP_OPSYS_VFAT\fR
+.PP
+\fRZIP_OPSYS_VM_CMS\fR
+.PP
+\fRZIP_OPSYS_VSE\fR
+.PP
+\fRZIP_OPSYS_WINDOWS_NTFS\fR
+(uncommon, use
+\fRZIP_OPSYS_DOS\fR
+instead)
+.PP
+\fRZIP_OPSYS_Z_SYSTEM\fR
+.RE
+.PD
+.PP
+The defines above follow the PKWARE Inc. Appnote; please note that
+the InfoZIP Appnote has a slightly different mapping.
+.SH "RETURN VALUES"
+Upon successful completion, 0 is returned.
+In case of an error,
+\fR\-1\fR
+is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "EXAMPLES"
+The following code can be used to expand
+\fIattributes\fR
+if the operating system is
+\fRZIP_OPSYS_DOS\fR.
+.nf
+.sp
+.RS 0n
+#include <sys/stat.h>
+
+#define FA_RDONLY       0x01            // FILE_ATTRIBUTE_READONLY
+#define FA_DIREC        0x10            // FILE_ATTRIBUTE_DIRECTORY
+
+static mode_t
+_zip_dos_attr2mode(zip_uint32_t attr)
+{
+   mode_t m = S_IRUSR | S_IRGRP | S_IROTH;
+   if (0 == (attr & FA_RDONLY))
+      m |= S_IWUSR | S_IWGRP | S_IWOTH;
+
+   if (attr & FA_DIREC)
+      m = (S_IFDIR | (m & ~S_IFMT)) | S_IXUSR | S_IXGRP | S_IXOTH;
+
+   return m;
+}
+.RE
+.fi
+.SH "ERRORS"
+\fBzip_file_get_external_attributes\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_set_external_attributes(3)
+.SH "HISTORY"
+\fBzip_file_get_external_attributes\fR()
+was added in libzip 0.11.2.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index bc5eb37..5b3cdcc 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_get_external_attributes.mdoc -- get external attributes for file in zip
-.\" Copyright (C) 2013-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2013-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_FILE_GET_EXTERNAL_ATTRIBUTES 3
 .Os
 .Sh NAME
@@ -155,6 +155,9 @@ is not a valid file index in
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_file_set_external_attributes 3
+.Sh HISTORY
+.Fn zip_file_get_external_attributes
+was added in libzip 0.11.2.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_rename.man b/man/zip_file_rename.man
new file mode 100644 (file)
index 0000000..9f4cd07
--- /dev/null
@@ -0,0 +1,78 @@
+.TH "ZIP_FILE_RENAME" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_rename\fR
+\- rename file in zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_rename\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIconst\ char\ *name\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The file at position
+\fIindex\fR
+in the zip archive
+\fIarchive\fR
+is renamed to
+\fIname\fR.
+The
+\fIflags\fR
+argument can be any of:
+.TP 22n
+\fRZIP_FL_ENC_GUESS\fR
+Guess encoding of
+\fIname\fR
+(default).
+.TP 22n
+\fRZIP_FL_ENC_UTF_8\fR
+Interpret
+\fIname\fR
+as UTF-8.
+.TP 22n
+\fRZIP_FL_ENC_CP437\fR
+Interpret
+\fIname\fR
+as code page 437 (CP-437).
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_rename\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_DELETED\fR]
+The file to be renamed has been deleted from the archive.
+.TP 19n
+[\fRZIP_ER_EXISTS\fR]
+There is already a file called
+\fIname\fR
+in the archive.
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR,
+\fIname is\fR
+\fRNULL\fR,
+the empty string, or not a valid UTF-8 encoded string.
+Also a file cannot be renamed to a directory or vice versa.
+Directories are denoted by a trailing slash.
+.SH "SEE ALSO"
+libzip(3),
+zip_unchange(3)
+.SH "HISTORY"
+\fBzip_file_rename\fR()
+was added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 0f3defc..0694588 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_rename.mdoc -- rename file in zip archive
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 23, 2012
+.Dd December 18, 2017
 .Dt ZIP_FILE_RENAME 3
 .Os
 .Sh NAME
@@ -93,6 +93,9 @@ Directories are denoted by a trailing slash.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_unchange 3
+.Sh HISTORY
+.Fn zip_file_rename
+was added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_set_comment.man b/man/zip_file_set_comment.man
new file mode 100644 (file)
index 0000000..5966e48
--- /dev/null
@@ -0,0 +1,90 @@
+.TH "ZIP_FILE_SET_COMMENT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_set_comment\fR
+\- set comment for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_set_comment\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIconst\ char\ *comment\fR, \fIzip_uint16_t\ len\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_set_comment\fR()
+function sets the comment for the file at position
+\fIindex\fR
+in the zip archive to
+\fIcomment\fR
+of length
+\fIlen\fR.
+If
+\fIcomment\fR
+is
+\fRNULL\fR
+and
+\fIlen\fR
+is 0, the file comment will be removed.
+The
+\fIflags\fR
+argument can be any of:
+.TP 22n
+\fRZIP_FL_ENC_GUESS\fR
+Guess encoding of
+\fIcomment\fR
+(default).
+.TP 22n
+\fRZIP_FL_ENC_UTF_8\fR
+Interpret
+\fIcomment\fR
+as UTF-8.
+.TP 22n
+\fRZIP_FL_ENC_CP437\fR
+Interpret
+\fIcomment\fR
+as code page 437 (CP-437).
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_file_set_comment\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR,
+or
+\fIlen\fR
+is less than 0 or longer than the maximum comment length in a zip file
+(65535), or
+\fIcomment\fR
+is not a valid UTF-8 encoded string.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_RDONLY\fR]
+The
+\fIarchive\fR
+was opened in read-only mode.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_get_comment(3),
+zip_get_archive_comment(3),
+zip_set_archive_comment(3)
+.SH "HISTORY"
+\fBzip_file_set_comment\fR()
+was added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index f893f62..1e596cf 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_set_comment.mdoc -- set comment for file in zip
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 19, 2013
+.Dd December 18, 2017
 .Dt ZIP_FILE_SET_COMMENT 3
 .Os
 .Sh NAME
@@ -105,6 +105,9 @@ was opened in read-only mode.
 .Xr zip_file_get_comment 3 ,
 .Xr zip_get_archive_comment 3 ,
 .Xr zip_set_archive_comment 3
+.Sh HISTORY
+.Fn zip_file_set_comment
+was added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_set_encryption.man b/man/zip_file_set_encryption.man
new file mode 100644 (file)
index 0000000..1372144
--- /dev/null
@@ -0,0 +1,91 @@
+.TH "ZIP_FILE_SET_ENCRYPTION" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_set_encryption\fR
+\- set encryption method for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_set_encryption\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ method\fR, \fIconst\ char\ *password\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_set_encryption\fR()
+function sets the encryption method for the file at position
+\fIindex\fR
+in the zip archive to
+\fImethod\fR
+using the password
+\fIpassword\fR.
+The
+\fImethod\fR
+is the same as returned by
+zip_stat(3).
+For the
+\fImethod\fR
+argument, currently only the following values are supported:
+.TP 19n
+\fRZIP_EM_NONE\fR
+No encryption.
+.TP 19n
+\fRZIP_EM_AES_128\fR
+Winzip AES-128 encryption.
+.TP 19n
+\fRZIP_EM_AES_192\fR
+Winzip AES-192 encryption.
+.TP 19n
+\fRZIP_EM_AES_256\fR
+Winzip AES-256 encryption.
+.PP
+If
+\fIpassword\fR
+is
+\fRNULL\fR,
+the default password provided by
+zip_set_default_password(3)
+is used.
+.PP
+The current encryption method for a file in a zip archive can be
+determined using
+zip_stat(3).
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_file_set_encryption\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_ENCRNOTSUPP\fR]
+Unsupported compression method requested.
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR,
+or the argument combination is invalid.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_RDONLY\fR]
+Read-only zip file, no changes allowed.
+.SH "SEE ALSO"
+libzip(3),
+zip_set_default_password(3),
+zip_stat(3)
+.SH "HISTORY"
+\fBzip_file_set_encryption\fR()
+was added in libzip 1.2.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 89dd358..a09c42a 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_set_encryption.mdoc -- set encryption method for file
-.\" Copyright (C) 2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 16, 2016
+.Dd December 18, 2017
 .Dt ZIP_FILE_SET_ENCRYPTION 3
 .Os
 .Sh NAME
@@ -104,6 +104,9 @@ Read-only zip file, no changes allowed.
 .Xr libzip 3 ,
 .Xr zip_set_default_password 3 ,
 .Xr zip_stat 3
+.Sh HISTORY
+.Fn zip_file_set_encryption
+was added in libzip 1.2.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_set_external_attributes.man b/man/zip_file_set_external_attributes.man
new file mode 100644 (file)
index 0000000..e36b96f
--- /dev/null
@@ -0,0 +1,63 @@
+.TH "ZIP_FILE_SET_EXTERNAL_ATTRIBUTES" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_set_external_attributes\fR
+\- set external attributes for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_set_external_attributes\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_flags_t\ flags\fR, \fIzip_uint8_t\ opsys\fR, \fIzip_uint32_t\ attributes\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_set_external_attributes\fR()
+function sets the operating system and external attributes for the
+file at position
+\fIindex\fR
+in the zip archive.
+Currently, no
+\fIflags\fR
+are supported.
+.PP
+For a list of known
+\fIopsys\fR
+values, see
+zip_file_get_external_attributes(3).
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_file_set_external_attributes\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_RDONLY\fR]
+The
+\fIarchive\fR
+was opened in read-only mode.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_get_external_attributes(3)
+.SH "HISTORY"
+\fBzip_file_set_external_attributes\fR()
+was added in libzip 0.11.2.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index c1a4788..d7fa082 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_set_external_attributes.mdoc -- set external attributes for file in zip
-.\" Copyright (C) 2013-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2013-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_FILE_SET_EXTERNAL_ATTRIBUTES 3
 .Os
 .Sh NAME
@@ -79,6 +79,9 @@ was opened in read-only mode.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_file_get_external_attributes 3
+.Sh HISTORY
+.Fn zip_file_set_external_attributes
+was added in libzip 0.11.2.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_set_mtime.man b/man/zip_file_set_mtime.man
new file mode 100644 (file)
index 0000000..a2e8c81
--- /dev/null
@@ -0,0 +1,59 @@
+.TH "ZIP_FILE_SET_MTIME" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_set_mtime\fR
+\- set last modification time (mtime) for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_set_mtime\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fItime_t\ mtime\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_file_set_mtime\fR()
+function sets the last modification time (mtime) for the file at
+position
+\fIindex\fR
+in the zip archive to
+\fImtime\fR.
+Currently, no support for any
+\fIflags\fR
+is implemented.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_file_set_mtime\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_RDONLY\fR]
+The
+\fIarchive\fR
+was opened in read-only mode.
+.SH "SEE ALSO"
+libzip(3),
+zip_stat(3)
+.SH "HISTORY"
+\fBzip_file_set_mtime\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 4c78217..32057b5 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_set_mtime.mdoc -- set mtime for file in zip
-.\" Copyright (C) 2014-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_FILE_SET_MTIME 3
 .Os
 .Sh NAME
@@ -75,6 +75,9 @@ was opened in read-only mode.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_stat 3
+.Sh HISTORY
+.Fn zip_file_set_mtime
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_file_strerror.man b/man/zip_file_strerror.man
new file mode 100644 (file)
index 0000000..cc595ed
--- /dev/null
@@ -0,0 +1,63 @@
+.TH "ZIP_FILE_STRERROR" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_file_strerror\fR,
+\fBzip_strerror\fR
+\- get string representation for a zip error
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIconst char *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_file_strerror\fR(\fIzip_file_t\ *file\fR);
+.PD
+.PP
+\fIconst char *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_strerror\fR(\fIzip_t\ *archive\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_strerror\fR()
+function returns a string describing the last error for the zip archive
+\fIarchive\fR,
+while the
+\fBzip_file_strerror\fR()
+function does the same for a zip file
+\fIfile\fR
+(one file in an archive).
+The returned string must not be modified or freed, and becomes invalid when
+\fIarchive\fR
+or
+\fIfile\fR,
+respectively,
+is closed or on the next call to
+\fBzip_strerror\fR()
+or
+\fBzip_file_strerror\fR(),
+respectively,
+for the same archive.
+.SH "RETURN VALUES"
+\fBzip_file_strerror\fR()
+and
+\fBzip_strerror\fR()
+return a pointer to the error string.
+.SH "SEE ALSO"
+libzip(3),
+zip_error_to_str(3)
+.SH "HISTORY"
+\fBzip_file_strerror\fR()
+and
+\fBzip_strerror\fR()
+were added in libzip 0.6.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index e5d11be..0efab60 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_file_strerror.mdoc -- get string representation for a zip error
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 27, 2004
+.Dd December 18, 2017
 .Dt ZIP_FILE_STRERROR 3
 .Os
 .Sh NAME
@@ -73,6 +73,11 @@ return a pointer to the error string.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_error_to_str 3
+.Sh HISTORY
+.Fn zip_file_strerror
+and
+.Fn zip_strerror
+were added in libzip 0.6.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_fopen.man b/man/zip_fopen.man
new file mode 100644 (file)
index 0000000..1572068
--- /dev/null
@@ -0,0 +1,134 @@
+.TH "ZIP_FOPEN" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_fopen\fR,
+\fBzip_fopen_index\fR
+\- open file in zip archive for reading
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_file_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_fopen\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *fname\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.PP
+\fIzip_file_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_fopen_index\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_fopen\fR()
+function opens the file name
+\fIfname\fR
+in
+\fIarchive\fR.
+The
+\fIflags\fR
+argument specifies how the name lookup should be done, according to
+the values are described in
+zip_name_locate(3).
+Also, the following values may be
+\fIor\fR'ed
+to it.
+.RS 6n
+.TP 19n
+\fRZIP_FL_COMPRESSED\fR
+Read the compressed data.
+Otherwise the data is uncompressed by
+\fBzip_fread\fR().
+.TP 19n
+\fRZIP_FL_UNCHANGED\fR
+Read the original data from the zip archive, ignoring any changes made
+to the file.
+.RE
+.PP
+The
+\fBzip_fopen_index\fR()
+function opens the file at position
+\fIindex\fR.
+.PP
+If encrypted data is encountered, the functions call
+zip_fopen_encrypted(3)
+or
+zip_fopen_index_encrypted(3)
+respectively, using the default password set with
+zip_set_default_password(3).
+.SH "RETURN VALUES"
+Upon successful completion, a
+\fIstruct zip_file\fR
+pointer is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+.TP 19n
+[\fRZIP_ER_CHANGED\fR]
+The file data has been changed.
+.TP 19n
+[\fRZIP_ER_COMPNOTSUPP\fR]
+The compression method used is not supported.
+.TP 19n
+[\fRZIP_ER_ENCRNOTSUPP\fR]
+The encryption method used is not supported.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_NOPASSWD\fR]
+The file is encrypted, but no password has been provided.
+.TP 19n
+[\fRZIP_ER_READ\fR]
+A file read error occurred.
+.TP 19n
+[\fRZIP_ER_SEEK\fR]
+A file seek error occurred.
+.TP 19n
+[\fRZIP_ER_WRONGPASSWD\fR]
+The provided password does not match the password used for encryption.
+Note that some incorrect passwords are not detected by the check done by
+\fBzip_fopen\fR().
+.TP 19n
+[\fRZIP_ER_ZLIB\fR]
+Initializing the zlib stream failed.
+.PP
+The function
+\fBzip_fopen\fR()
+may also fail and set
+\fIzip_err\fR
+for any of the errors specified for the routine
+zip_name_locate(3).
+.PP
+The function
+\fBzip_fopen_index\fR()
+may also fail with
+\fRZIP_ER_INVAL\fR
+if
+\fIindex\fR
+is invalid.
+.SH "SEE ALSO"
+libzip(3),
+zip_fclose(3),
+zip_fread(3),
+zip_fseek(3),
+zip_get_num_entries(3),
+zip_name_locate(3),
+zip_set_default_password(3)
+.SH "HISTORY"
+\fBzip_fopen\fR()
+and
+\fBzip_fopen_index\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 948acb3..fb54f87 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_fopen.mdoc -- open file in zip archive for reading
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 12, 2016
+.Dd December 18, 2017
 .Dt ZIP_FOPEN 3
 .Os
 .Sh NAME
@@ -135,6 +135,11 @@ is invalid.
 .Xr zip_get_num_entries 3 ,
 .Xr zip_name_locate 3 ,
 .Xr zip_set_default_password 3
+.Sh HISTORY
+.Fn zip_fopen
+and
+.Fn zip_fopen_index
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_fopen_encrypted.man b/man/zip_fopen_encrypted.man
new file mode 100644 (file)
index 0000000..138b595
--- /dev/null
@@ -0,0 +1,94 @@
+.TH "ZIP_FOPEN_ENCRYPTED" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_fopen_encrypted\fR,
+\fBzip_fopen_index_encrypted\fR
+\- open encrypted file in zip archive for reading
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_file_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_fopen_encrypted\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *fname\fR, \fIzip_flags_t\ flags\fR, \fIconst\ char\ *password\fR);
+.PD
+.PP
+\fIzip_file_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_fopen_index_encrypted\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_flags_t\ flags\fR, \fIconst\ char\ *password\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_fopen_encrypted\fR()
+function opens the encrypted file name
+\fIfname\fR
+in
+\fIarchive\fR
+using the password given in the
+\fIpassword\fR
+argument.
+The
+\fIflags\fR
+argument are the same as for
+zip_fopen(3).
+.PP
+The
+\fBzip_fopen_index_encrypted\fR()
+function opens the file at position
+\fIindex\fR,
+see
+zip_fopen_index(3).
+These functions are called automatically by
+zip_fopen(3);
+you only need to call them if you want to specify a non-default password
+(see
+zip_set_default_password(3)).
+.SH "RETURN VALUES"
+Upon successful completion, a
+\fIstruct zip_file\fR
+pointer is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+.TP 22n
+[\fRZIP_ER_NOPASSWD\fR]
+No password was provided.
+.PP
+The function
+\fBzip_fopen_encrypted\fR()
+may also fail and set
+\fIzip_err\fR
+for any of the errors specified for the routine
+zip_fopen(3).
+.PP
+The function
+\fBzip_fopen_index_encrypted\fR()
+may also fail and set
+\fIzip_err\fR
+for any of the errors specified for the routine
+zip_fopen_index(3).
+.SH "SEE ALSO"
+libzip(3),
+zip_fclose(3),
+zip_fopen(3),
+zip_fread(3),
+zip_get_num_entries(3),
+zip_name_locate(3)
+.SH "HISTORY"
+\fBzip_fopen_encrypted\fR()
+and
+\fBzip_fopen_index_encrypted\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 3a930c9..fb159ce 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_fopen_encrypted.mdoc -- open encrypted file in zip archive for reading
-.\" Copyright (C) 2011-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2011-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 22, 2012
+.Dd December 18, 2017
 .Dt ZIP_FOPEN_ENCRYPTED 3
 .Os
 .Sh NAME
@@ -105,6 +105,11 @@ for any of the errors specified for the routine
 .Xr zip_fread 3 ,
 .Xr zip_get_num_entries 3 ,
 .Xr zip_name_locate 3
+.Sh HISTORY
+.Fn zip_fopen_encrypted
+and
+.Fn zip_fopen_index_encrypted
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_fread.man b/man/zip_fread.man
new file mode 100644 (file)
index 0000000..c07f47e
--- /dev/null
@@ -0,0 +1,51 @@
+.TH "ZIP_FREAD" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_fread\fR
+\- read from file
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_fread\fR(\fIzip_file_t\ *file\fR, \fIvoid\ *buf\fR, \fIzip_uint64_t\ nbytes\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_fread\fR()
+function reads at most
+\fInbytes\fR
+bytes from
+\fIfile\fR
+into
+\fIbuf\fR.
+.SH "RETURN VALUES"
+If successful, the number of bytes actually read is returned.
+Otherwise, \-1 is returned.
+.SH "SEE ALSO"
+libzip(3),
+zip_fclose(3),
+zip_fopen(3),
+zip_fseek(3)
+.SH "HISTORY"
+\fBzip_fread\fR()
+was added in libzip 0.6.
+In libzip 0.10 the return type was changed from
+\fIssize_t\fR
+to
+\fIzip_int64_t\fR.
+In libzip 0.10 the type of
+\fInbytes\fR
+was changed from
+\fIsize_t\fR
+to
+\fIzip_uint64_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index d3e0ce4..4d3e8d6 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_fread.mdoc -- read from file
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 12, 2016
+.Dd December 18, 2017
 .Dt ZIP_FREAD 3
 .Os
 .Sh NAME
@@ -58,6 +58,19 @@ Otherwise, \-1 is returned.
 .Xr zip_fclose 3 ,
 .Xr zip_fopen 3 ,
 .Xr zip_fseek 3
+.Sh HISTORY
+.Fn zip_fread
+was added in libzip 0.6.
+In libzip 0.10 the return type was changed from
+.Vt ssize_t
+to
+.Vt zip_int64_t .
+In libzip 0.10 the type of
+.Ar nbytes
+was changed from
+.Vt size_t
+to
+.Vt zip_uint64_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_fseek.man b/man/zip_fseek.man
new file mode 100644 (file)
index 0000000..0aa5d4f
--- /dev/null
@@ -0,0 +1,48 @@
+.TH "ZIP_FSEEK" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_fseek\fR
+\- seek in file
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int8_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_fseek\fR(\fIzip_file_t\ *file\fR, \fIzip_int64_t\ offset\fR, \fIint\ whence\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_fseek\fR()
+function seeks to the specified
+\fIoffset\fR
+relative to
+\fIwhence\fR,
+just like
+fseek(3).
+.PP
+\fBzip_fseek\fR
+only works on uncompressed (stored) data.
+When called on compressed data it will return an error.
+.SH "RETURN VALUES"
+If successful,
+\fBzip_fseek\fR
+returns 0.
+Otherwise, \-1 is returned.
+.SH "SEE ALSO"
+libzip(3),
+zip_fclose(3),
+zip_fopen(3),
+zip_fread(3),
+zip_ftell(3)
+.SH "HISTORY"
+\fBzip_fseek\fR()
+was added in libzip 1.2.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 7bd371e..756ca27 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_fseek.mdoc -- seek in file
-.\" Copyright (C) 2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 1, 2016
+.Dd December 18, 2017
 .Dt ZIP_FSEEK 3
 .Os
 .Sh NAME
@@ -65,6 +65,9 @@ Otherwise, \-1 is returned.
 .Xr zip_fopen 3 ,
 .Xr zip_fread 3 ,
 .Xr zip_ftell 3
+.Sh HISTORY
+.Fn zip_fseek
+was added in libzip 1.2.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_ftell.man b/man/zip_ftell.man
new file mode 100644 (file)
index 0000000..7baa856
--- /dev/null
@@ -0,0 +1,42 @@
+.TH "ZIP_FTELL" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_ftell\fR
+\- tell position in file
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.PD 0
+.HP 4n
+\fBzip_ftell\fR(\fIzip_file_t\ *file\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_ftell\fR()
+function reports the current offset in the file.
+.PP
+\fBzip_ftell\fR
+only works on uncompressed (stored) data.
+When called on compressed data it will return an error.
+.SH "RETURN VALUES"
+If successful,
+\fBzip_ftell\fR
+returns the current file position.
+Otherwise, \-1 is returned.
+.SH "SEE ALSO"
+libzip(3),
+zip_fclose(3),
+zip_fopen(3),
+zip_fread(3),
+zip_fseek(3)
+.SH "HISTORY"
+\fBzip_ftell\fR()
+was added in libzip 1.2.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6aeeabf..2638d5d 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_ftell.mdoc -- tell position in file
-.\" Copyright (C) 2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 1, 2016
+.Dd December 18, 2017
 .Dt ZIP_FTELL 3
 .Os
 .Sh NAME
@@ -60,6 +60,9 @@ Otherwise, \-1 is returned.
 .Xr zip_fopen 3 ,
 .Xr zip_fread 3 ,
 .Xr zip_fseek 3
+.Sh HISTORY
+.Fn zip_ftell
+was added in libzip 1.2.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_get_archive_comment.man b/man/zip_get_archive_comment.man
new file mode 100644 (file)
index 0000000..54b5682
--- /dev/null
@@ -0,0 +1,82 @@
+.TH "ZIP_GET_ARCHIVE_COMMENT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_get_archive_comment\fR
+\- get zip archive comment
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIconst char *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_get_archive_comment\fR(\fIzip_t\ *archive\fR, \fIint\ *lenp\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_get_archive_comment\fR()
+function returns the comment for the entire zip archive.
+The name is in UTF-8 encoding unless
+\fRZIP_FL_ENC_RAW\fR
+was specified (see below).
+This pointer should not be modified or
+free(3)'d,
+and becomes invalid when
+\fIarchive\fR
+is closed.
+If
+\fIlenp\fR
+is not
+\fRNULL\fR,
+the integer to which it points will be set to the length of the
+comment.
+If
+\fIflags\fR
+is set to
+\fRZIP_FL_UNCHANGED\fR,
+the original unchanged comment is returned.
+.PP
+Additionally, the following
+\fIflags\fR
+are supported:
+.RS 6n
+.TP 21n
+\fRZIP_FL_ENC_RAW\fR
+Return the unmodified archive comment as it is in the ZIP archive.
+.TP 21n
+\fRZIP_FL_ENC_GUESS\fR
+(Default.)
+Guess the encoding of the archive comment in the ZIP archive and convert it
+to UTF-8, if necessary.
+.TP 21n
+\fRZIP_FL_ENC_STRICT\fR
+Follow the ZIP specification for file names and extend it to the
+archive comment, thus also expecting it in CP-437 encoding.
+Convert it to UTF-8.
+.RE
+\fINote\fR:
+ASCII is a subset of both CP-437 and UTF-8.
+.SH "RETURN VALUES"
+Upon successful completion, a pointer to the comment is returned,
+or
+\fRNULL\fR
+if there is no comment.
+.SH "SEE ALSO"
+libzip(3),
+zip_get_file_comment(3)
+.SH "HISTORY"
+\fBzip_get_archive_comment\fR()
+was added in libzip 0.7.
+In libzip 0.11 the type of
+\fIflags\fR
+was changed from
+\fIint\fR
+to
+\fIzip_flags_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 9050fb7..f142f39 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_get_archive_comment.mdoc -- get zip archive comment
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 20, 2013
+.Dd December 18, 2017
 .Dt ZIP_GET_ARCHIVE_COMMENT 3
 .Os
 .Sh NAME
@@ -95,6 +95,15 @@ if there is no comment.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_get_file_comment 3
+.Sh HISTORY
+.Fn zip_get_archive_comment
+was added in libzip 0.7.
+In libzip 0.11 the type of
+.Ar flags
+was changed from
+.Vt int
+to
+.Vt zip_flags_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_get_archive_flag.man b/man/zip_get_archive_flag.man
new file mode 100644 (file)
index 0000000..f611a50
--- /dev/null
@@ -0,0 +1,66 @@
+.TH "ZIP_GET_ARCHIVE_FLAG" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_get_archive_flag\fR
+\- get status flags for zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_get_archive_flag\fR(\fIzip_t\ *archive\fR, \fIzip_flags_t\ flag\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_get_archive_flag\fR()
+function returns if the flag
+\fIflag\fR
+is set for the archive
+\fIarchive\fR.
+The archive flags might have been changed with
+\fBzip_set_archive_flag\fR();
+if
+\fIflags\fR
+is set to
+\fRZIP_FL_UNCHANGED\fR,
+the original unchanged flags are tested.
+.PP
+Supported flags are:
+.TP 20n
+\fRZIP_AFL_RDONLY\fR
+The archive is read-only.
+.SH "RETURN VALUES"
+\fBzip_get_archive_flag\fR()
+returns 1 if
+\fIflag\fR
+is set for
+\fIarchive\fR,
+0 if not,
+and \-1 if an error occurred.
+.SH "SEE ALSO"
+libzip(3),
+zip_set_archive_flag(3)
+.SH "HISTORY"
+\fBzip_get_archive_flag\fR()
+was added in libzip 0.9.
+In libzip 0.11 the type of
+\fIflag\fR
+was changed from
+\fIint\fR
+to
+\fIzip_flags_t m\fR
+and the type of
+\fIflags\fR
+was changed from
+\fIint\fR
+to
+\fIzip_flags_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 0177402..baf6b05 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_get_archive_flag.mdoc -- get comment for file in zip
-.\" Copyright (C) 2008-2015 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2008-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 29, 2015
+.Dd December 18, 2017
 .Dt ZIP_GET_ARCHIVE_FLAG 3
 .Os
 .Sh NAME
@@ -72,6 +72,21 @@ and \-1 if an error occurred.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_set_archive_flag 3
+.Sh HISTORY
+.Fn zip_get_archive_flag
+was added in libzip 0.9.
+In libzip 0.11 the type of
+.Ar flag
+was changed from
+.Vt int
+to
+.Vt zip_flags_t m
+and the type of
+.Ar flags
+was changed from
+.Vt int
+to
+.Vt zip_flags_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_get_error.man b/man/zip_get_error.man
new file mode 100644 (file)
index 0000000..2dddb7f
--- /dev/null
@@ -0,0 +1,33 @@
+.TH "ZIP_GET_ERROR" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_get_error\fR
+\- get zip error for archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_error_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_get_error\fR(\fIzip_t\ *archive\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_get_error\fR()
+function returns the zip error for the zip archive
+\fIarchive\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_error_code_system(3),
+zip_error_code_zip(3)
+.SH "HISTORY"
+\fBzip_get_error\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6dd56e3..8ce2ea5 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_get_error.mdoc -- get zip_error for archive
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 30, 2014
+.Dd December 18, 2017
 .Dt ZIP_GET_ERROR 3
 .Os
 .Sh NAME
@@ -50,6 +50,9 @@ function returns the zip error for the zip archive
 .Xr libzip 3 ,
 .Xr zip_error_code_system 3 ,
 .Xr zip_error_code_zip 3
+.Sh HISTORY
+.Fn zip_get_error
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_get_file_comment.man b/man/zip_get_file_comment.man
new file mode 100644 (file)
index 0000000..8a71818
--- /dev/null
@@ -0,0 +1,46 @@
+.TH "ZIP_GET_FILE_COMMENT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_get_file_comment\fR
+\- get comment for file in zip (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIconst char *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_get_file_comment\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIint\ *lenp\fR, \fIint\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_get_file_comment\fR()
+function is the obsolete version of
+zip_file_get_comment(3).
+The only differences are the types of the
+\fIlenp\fR
+and
+\fIflags\fR
+arguments.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_get_comment(3)
+.SH "HISTORY"
+\fBzip_get_file_comment\fR()
+was added in libzip 0.7.
+In libzip 0.10 the type of
+\fIindex\fR
+was changed from
+\fIint\fR
+to
+\fIzip_uint64_t\fR.
+It was deprecated in libzip 0.11, use
+\fBzip_file_get_comment\fR()
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 921f7b5..a22159e 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_get_file_comment.mdoc -- get comment for file in zip
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_GET_FILE_COMMENT 3
 .Os
 .Sh NAME
@@ -54,6 +54,18 @@ arguments.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_file_get_comment 3
+.Sh HISTORY
+.Fn zip_get_file_comment
+was added in libzip 0.7.
+In libzip 0.10 the type of
+.Ar index
+was changed from
+.Vt int
+to
+.Vt zip_uint64_t .
+It was deprecated in libzip 0.11, use
+.Fn zip_file_get_comment
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_get_name.man b/man/zip_get_name.man
new file mode 100644 (file)
index 0000000..8fd6c2d
--- /dev/null
@@ -0,0 +1,108 @@
+.TH "ZIP_GET_NAME" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_get_name\fR
+\- get name of file by index
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIconst char *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_get_name\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_get_name\fR()
+function returns the name of the file at position
+\fIindex\fR
+in
+\fIarchive\fR.
+The name is in UTF-8 encoding unless
+\fRZIP_FL_ENC_RAW\fR
+was specified (see below).
+.PP
+If
+\fIflags\fR
+is set to
+\fRZIP_FL_UNCHANGED\fR,
+the original unchanged filename is returned.
+The returned string must not be modified or freed, and becomes invalid when
+\fIarchive\fR
+is closed.
+.PP
+Additionally, the following
+\fIflags\fR
+are supported:
+.RS 6n
+.TP 21n
+\fRZIP_FL_ENC_RAW\fR
+Return the unmodified names as it is in the ZIP archive.
+.TP 21n
+\fRZIP_FL_ENC_GUESS\fR
+(Default.)
+Guess the encoding of the name in the ZIP archive and convert it
+to UTF-8, if necessary.
+.TP 21n
+\fRZIP_FL_ENC_STRICT\fR
+Follow the ZIP specification and expect CP-437 encoded names in
+the ZIP archive (except if they are explicitly marked as UTF-8).
+Convert it to UTF-8.
+.RE
+\fINote\fR:
+ASCII is a subset of both CP-437 and UTF-8.
+.SH "RETURN VALUES"
+Upon successful completion, a pointer to the name is returned.
+Otherwise,
+\fRNULL\fR
+and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_get_name\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_DELETED\fR]
+\fIindex\fR
+refers to a file that has been deleted
+(see
+zip_delete(3)).
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR,
+or
+\fIindex\fR
+points to an added file and
+\fRZIP_FL_UNCHANGED\fR
+is set.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.SH "SEE ALSO"
+libzip(3),
+zip_name_locate(3)
+.SH "HISTORY"
+\fBzip_get_name\fR()
+was added in libzip 0.6.
+In libzip 0.10 the type of
+\fIindex\fR
+was changed from
+\fIint\fR
+to
+\fIzip_uint64_t\fR.
+In libzip 0.11 the type of
+\fIflags\fR
+was changed from
+\fIint\fR
+to
+\fIzip_flags_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 229c4e6..27084f4 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_get_name.mdoc -- get name of file by index
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 20, 2013
+.Dd December 18, 2017
 .Dt ZIP_GET_NAME 3
 .Os
 .Sh NAME
@@ -109,6 +109,21 @@ Required memory could not be allocated.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_name_locate 3
+.Sh HISTORY
+.Fn zip_get_name
+was added in libzip 0.6.
+In libzip 0.10 the type of
+.Ar index
+was changed from
+.Vt int
+to
+.Vt zip_uint64_t .
+In libzip 0.11 the type of
+.Ar flags
+was changed from
+.Vt int
+to
+.Vt zip_flags_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_get_num_entries.man b/man/zip_get_num_entries.man
new file mode 100644 (file)
index 0000000..b1f5d92
--- /dev/null
@@ -0,0 +1,55 @@
+.TH "ZIP_GET_NUM_ENTRIES" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_get_num_entries\fR
+\- get number of files in archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_get_num_entries\fR(\fIzip_t\ *archive\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_get_num_entries\fR()
+function returns the number of files in
+\fIarchive\fR.
+If
+\fIflags\fR
+is set to
+\fRZIP_FL_UNCHANGED\fR,
+the original number of entries is returned.
+.SH "RETURN VALUES"
+\fBzip_get_num_entries\fR()
+returns the number of files in the zip archive,
+or \-1 if
+\fIarchive\fR
+is
+\fRNULL\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_fopen_index(3),
+zip_stat_index(3)
+.SH "HISTORY"
+\fBzip_get_num_entries\fR()
+was added in libzip 0.10.
+In libzip 0.11 the return type was changed from
+\fIzip_uint64_t\fR
+to
+\fIzip_int64_t\fR.
+In libzip 0.11 the type of
+\fIflags\fR
+was changed from
+\fIint\fR
+to
+\fIzip_flags_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 45ffe9e..bfc7005 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_get_num_entries.mdoc -- get number of files in archive
-.\" Copyright (C) 2011-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2011-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 1, 2012
+.Dd December 18, 2017
 .Dt ZIP_GET_NUM_ENTRIES 3
 .Os
 .Sh NAME
@@ -62,6 +62,19 @@ is
 .Xr libzip 3 ,
 .Xr zip_fopen_index 3 ,
 .Xr zip_stat_index 3
+.Sh HISTORY
+.Fn zip_get_num_entries
+was added in libzip 0.10.
+In libzip 0.11 the return type was changed from
+.Vt zip_uint64_t
+to
+.Vt zip_int64_t .
+In libzip 0.11 the type of
+.Ar flags
+was changed from
+.Vt int
+to
+.Vt zip_flags_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_get_num_files.man b/man/zip_get_num_files.man
new file mode 100644 (file)
index 0000000..e14f1b0
--- /dev/null
@@ -0,0 +1,48 @@
+.TH "ZIP_GET_NUM_FILES" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_get_num_files\fR
+\- get number of files in archive (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_get_num_files\fR(\fIzip_t\ *archive\fR);
+.PD
+.SH "DESCRIPTION"
+\fIThis function is deprecated\fR.
+\fIUse\fR
+zip_get_num_entries(3)
+\fIinstead\fR.
+.PP
+The
+\fBzip_get_num_files\fR()
+function returns the number of files in
+\fIarchive\fR.
+.SH "RETURN VALUES"
+\fBzip_get_num_files\fR()
+returns the number of files in the zip archive,
+or \-1 if
+\fIarchive\fR
+is
+\fRNULL\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_fopen_index(3),
+zip_stat_index(3)
+.SH "HISTORY"
+\fBzip_get_num_files\fR()
+was added in libzip 0.6.
+It was deprecated in libzip 0.11, use
+\fBzip_get_num_entries\fR(\fIinstead\fR)
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 4a5135b..30ebbc3 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_get_num_files.mdoc -- get number of files in archive
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_GET_NUM_FILES 3
 .Os
 .Sh NAME
@@ -62,6 +62,12 @@ is
 .Xr libzip 3 ,
 .Xr zip_fopen_index 3 ,
 .Xr zip_stat_index 3
+.Sh HISTORY
+.Fn zip_get_num_files
+was added in libzip 0.6.
+It was deprecated in libzip 0.11, use
+.Fn zip_get_num_entries instead
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_libzip_version.man b/man/zip_libzip_version.man
new file mode 100644 (file)
index 0000000..864be71
--- /dev/null
@@ -0,0 +1,39 @@
+.TH "ZIP_LIBZIP_VERSION" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_libzip_version\fR
+\- return run-time version of library
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIconst char *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_libzip_version\fR(\fIvoid\fR);
+.PD
+.SH "DESCRIPTION"
+\fBzip_libzip_version\fR
+returns the version number of the library as string in the format
+\(Lq$MAJOR.$MINOR.$MICRO$SUFFIX\(Rq
+where
+\fI$MAJOR\fR
+is the major version,
+\fI$MINOR\fR
+the minor,
+\fI$MICRO\fR
+the micro, and
+\fI$SUFFIX\fR
+a suffix that's only set for development versions.
+.SH "SEE ALSO"
+libzip(3)
+.SH "HISTORY"
+\fBzip_libzip_version\fR()
+was added in libzip 1.3.1.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 77dcb56..8973736 100644 (file)
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 6, 2017
+.Dd December 18, 2017
 .Dt ZIP_LIBZIP_VERSION 3
 .Os
 .Sh NAME
@@ -56,6 +56,9 @@ the micro, and
 a suffix that's only set for development versions.
 .Sh SEE ALSO
 .Xr libzip 3
+.Sh HISTORY
+.Fn zip_libzip_version
+was added in libzip 1.3.1.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_name_locate.man b/man/zip_name_locate.man
new file mode 100644 (file)
index 0000000..5480e87
--- /dev/null
@@ -0,0 +1,104 @@
+.TH "ZIP_NAME_LOCATE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_name_locate\fR
+\- get index of file by name
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_name_locate\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *fname\fR, \fIzip_flags_t\ flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_name_locate\fR()
+function returns the index of the file named
+\fIfname\fR
+in
+\fIarchive\fR.
+If
+\fIarchive\fR
+does not contain a file with that name, \-1 is returned.
+The
+\fIflags\fR
+are specified by
+\fIor\fR'ing
+the following values, or 0 for none of them.
+.RS 6n
+.TP 15n
+\fRZIP_FL_NOCASE\fR
+Ignore case distinctions.
+(Will only work well if the file names are ASCII.)
+With this flag,
+\fBzip_name_locate\fR()
+will be slow for archives with many files.
+.TP 15n
+\fRZIP_FL_NODIR\fR
+Ignore directory part of file name in archive.
+With this flag,
+\fBzip_name_locate\fR()
+will be slow for archives with many files.
+.TP 15n
+\fRZIP_FL_ENC_RAW\fR
+.br
+Compare against the unmodified names as it is in the ZIP archive.
+.TP 15n
+\fRZIP_FL_ENC_GUESS\fR
+(Default.)
+Guess the encoding of the name in the ZIP archive and convert it
+to UTF-8, if necessary, before comparing.
+.TP 15n
+\fRZIP_FL_ENC_STRICT\fR
+Follow the ZIP specification and expect CP-437 encoded names in
+the ZIP archive (except if they are explicitly marked as UTF-8).
+Convert it to UTF-8 before comparing.
+.RE
+\fINote\fR:
+ASCII is a subset of both CP-437 and UTF-8.
+.SH "RETURN VALUES"
+\fBzip_name_locate\fR()
+returns the index of the file named
+\fIfname\fR
+or \-1, if
+\fIarchive\fR
+does not contain an entry of that name.
+.SH "ERRORS"
+\fBzip_name_locate\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+One of the arguments is invalid.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_NOENT\fR]
+No entry of the name
+\fIfname\fR
+is found in the archive.
+.SH "SEE ALSO"
+libzip(3),
+zip_get_name(3)
+.SH "HISTORY"
+\fBzip_name_locate\fR()
+was added in libzip 0.6.
+In libzip 0.11 the return type was changed from
+\fIint\fR
+to
+\fIzip_int64_t\fR.
+In libzip 0.11 the type of
+\fIflags\fR
+was changed from
+\fIint\fR
+to
+\fIzip_flags_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 2e15ae3..d16402d 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_name_locate.mdoc -- get index of file by name
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 25, 2017
+.Dd December 18, 2017
 .Dt ZIP_NAME_LOCATE 3
 .Os
 .Sh NAME
@@ -104,6 +104,19 @@ is found in the archive.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_get_name 3
+.Sh HISTORY
+.Fn zip_name_locate
+was added in libzip 0.6.
+In libzip 0.11 the return type was changed from
+.Vt int
+to
+.Vt zip_int64_t .
+In libzip 0.11 the type of
+.Ar flags
+was changed from
+.Vt int
+to
+.Vt zip_flags_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_open.man b/man/zip_open.man
new file mode 100644 (file)
index 0000000..3a6051f
--- /dev/null
@@ -0,0 +1,160 @@
+.TH "ZIP_OPEN" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_open\fR,
+\fBzip_open_from_source\fR
+\- open zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_open\fR(\fIconst\ char\ *path\fR, \fIint\ flags\fR, \fIint\ *errorp\fR);
+.PD
+.PP
+\fIzip_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_open_from_source\fR(\fIzip_source_t\ *zs\fR, \fIint\ flags\fR, \fIzip_error_t\ *ze\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_open\fR()
+function opens the zip archive specified by
+\fIpath\fR
+and returns a pointer to a
+\fIstruct zip\fR,
+used to manipulate the archive.
+The
+\fIflags\fR
+are specified by
+\fIor\fR'ing
+the following values, or 0 for none of them.
+.RS 6n
+.TP 15n
+\fRZIP_CHECKCONS\fR
+Perform additional stricter consistency checks on the archive, and
+error if they fail.
+.TP 15n
+\fRZIP_CREATE\fR
+Create the archive if it does not exist.
+.TP 15n
+\fRZIP_EXCL\fR
+Error if archive already exists.
+.TP 15n
+\fRZIP_TRUNCATE\fR
+If archive exists, ignore its current contents.
+In other words, handle it the same way as an empty archive.
+.TP 15n
+\fRZIP_RDONLY\fR
+Open archive in read-only mode.
+.RE
+.PP
+If an error occurs and
+\fIerrorp\fR
+is
+non-\fRNULL\fR,
+it will be set to the corresponding error code.
+.PP
+The
+\fBzip_open_from_source\fR()
+function opens a zip archive encapsulated by the zip_source
+\fIzs\fR
+using the provided
+\fIflags\fR.
+In case of error, the zip_error
+\fIze\fR
+is filled in.
+.SH "RETURN VALUES"
+Upon successful completion
+\fBzip_open\fR()
+and
+\fBzip_open_from_source\fR()
+return a
+\fIstruct zip\fR
+pointer.
+Otherwise,
+\fRNULL\fR
+is returned and
+\fBzip_open\fR()
+sets
+\fI*errorp\fR
+to indicate the error, while
+\fBzip_open_from\fR(\fIsource\fR)
+sets
+\fIze\fR
+to indicate the error.
+.SH "ERRORS"
+The archive specified by
+\fIpath\fR
+is opened unless:
+.TP 19n
+[\fRZIP_ER_EXISTS\fR]
+The file specified by
+\fIpath\fR
+exists and
+\fRZIP_EXCL\fR
+is set.
+.TP 19n
+[\fRZIP_ER_INCONS\fR]
+Inconsistencies were found in the file specified by
+\fIpath\fR.
+This error is often caused by specifying
+\fRZIP_CHECKCONS\fR
+but can also happen without it.
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+The
+\fIpath\fR
+argument is
+\fRNULL\fR.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_NOENT\fR]
+The file specified by
+\fIpath\fR
+does not exist and
+\fRZIP_CREATE\fR
+is not set.
+.TP 19n
+[\fRZIP_ER_NOZIP\fR]
+The file specified by
+\fIpath\fR
+is not a zip archive.
+.TP 19n
+[\fRZIP_ER_OPEN\fR]
+The file specified by
+\fIpath\fR
+could not be opened.
+.TP 19n
+[\fRZIP_ER_READ\fR]
+A read error occurred; see
+\fIerrno\fR
+for details.
+.TP 19n
+[\fRZIP_ER_SEEK\fR]
+The file specified by
+\fIpath\fR
+does not allow seeks.
+.SH "SEE ALSO"
+libzip(3),
+zip_close(3),
+zip_error_to_str(3),
+zip_fdopen(3)
+.SH "HISTORY"
+\fBzip_open\fR()
+and
+\fBzip_open_from_source\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index c7df355..5aa2752 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_open.mdoc -- open zip archive
-.\" Copyright (C) 2003-2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 9, 2014
+.Dd December 18, 2017
 .Dt ZIP_OPEN 3
 .Os
 .Sh NAME
@@ -158,6 +158,11 @@ does not allow seeks.
 .Xr zip_close 3 ,
 .Xr zip_error_to_str 3 ,
 .Xr zip_fdopen 3
+.Sh HISTORY
+.Fn zip_open
+and
+.Fn zip_open_from_source
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_register_progress_callback.man b/man/zip_register_progress_callback.man
new file mode 100644 (file)
index 0000000..28d5c9a
--- /dev/null
@@ -0,0 +1,51 @@
+.TH "ZIP_REGISTER_PROGRESS_CALLBACK" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_register_progress_callback\fR
+\- provide updates during zip_close (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fItypedef void (*zip_progress_callback_t)(double);\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_register_progress_callback\fR(\fIzip_t\ *archive\fR, \fIzip_progress_callback_t\ progress_callback\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_register_progress_callback\fR()
+is the obsolete version of
+zip_register_progress_callback_with_state(3).
+.PP
+The
+\fBzip_register_progress_callback\fR()
+function registers a callback function
+\fIprogress_callback\fR
+for the zip archive
+\fIarchive\fR.
+This function is called during
+zip_close(3)
+after every zip archive entry that's completely written to disk.
+The value is a
+\fIdouble\fR
+in the range from 0.0 to 1.0.
+This can be used to provide progress indicators for user interfaces.
+.SH "SEE ALSO"
+libzip(3),
+zip_close(3)
+.SH "HISTORY"
+\fBzip_register_progress_callback\fR()
+was added in libzip 1.2.0.
+It was deprecated in libzip 1.3.0, use
+\fBzip_register_progress_callback_with_state\fR()
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 80bddb2..9fd0cd0 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_register_progress_callback.mdoc -- provide updates during zip_close
-.\" Copyright (C) 2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_REGISTER_PROGRESS_CALLBACK 3
 .Os
 .Sh NAME
@@ -64,6 +64,12 @@ This can be used to provide progress indicators for user interfaces.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_close 3
+.Sh HISTORY
+.Fn zip_register_progress_callback
+was added in libzip 1.2.0.
+It was deprecated in libzip 1.3.0, use
+.Fn zip_register_progress_callback_with_state
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_register_progress_callback_with_state.man b/man/zip_register_progress_callback_with_state.man
new file mode 100644 (file)
index 0000000..b1c95d2
--- /dev/null
@@ -0,0 +1,60 @@
+.TH "ZIP_REGISTER_PROGRESS_CALLBACK_WITH_STATE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_register_progress_callback_with_state\fR
+\- provide updates during zip_close
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fItypedef void (*zip_progress_callback)(zip_t *, double, void *);\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_register_progress_callback_with_state\fR(\fIzip_t\ *archive\fR, \fIdouble\ precision\fR, \fIzip_progress_callback\ callback\fR, \fIvoid\ (*ud_free)(void\ *)\fR, \fIvoid\ *ud\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_register_progress_callback_with_state\fR()
+function registers a callback function
+\fIcallback\fR
+for the zip archive
+\fIarchive\fR.
+The
+\fIprecision\fR
+argument is a double in the range from 0.00 to 1.0 that defines the
+smallest change for which the callback should be called (to avoid too
+frequent calls).
+The
+\fIud_free\fR
+function is called during cleanup for deleting the userdata supplied in
+\fIud\fR.
+.PP
+The callback function is called during
+zip_close(3)
+in regular intervals (after every zip archive entry that's completely
+written to disk, and while writing data for entries) with zip archive
+\fIarchive\fR,
+the current progression state as a
+\fIdouble\fR,
+and the user-provided user-data
+\fIud\fR
+as arguments.
+The progression state is a
+\fIdouble\fR
+in the range from 0.0 to 1.0.
+This can be used to provide progress indicators for user interfaces.
+.SH "SEE ALSO"
+libzip(3),
+zip_close(3)
+.SH "HISTORY"
+\fBzip_register_progress_callback_with_state\fR()
+was added in libzip 1.3.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index f6af7ea..7eea3d6 100644 (file)
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_REGISTER_PROGRESS_CALLBACK_WITH_STATE 3
 .Os
 .Sh NAME
@@ -76,6 +76,9 @@ This can be used to provide progress indicators for user interfaces.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_close 3
+.Sh HISTORY
+.Fn zip_register_progress_callback_with_state
+was added in libzip 1.3.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_rename.man b/man/zip_rename.man
new file mode 100644 (file)
index 0000000..7979dab
--- /dev/null
@@ -0,0 +1,43 @@
+.TH "ZIP_RENAME" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_rename\fR
+\- rename file in zip archive (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_rename\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIconst\ char\ *name\fR);
+.PD
+.SH "DESCRIPTION"
+\fBzip_rename\fR()
+is the obsolete version of
+zip_file_rename(3).
+It is the same as calling
+zip_file_rename(3)
+with an empty flags argument.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_rename(3)
+.SH "HISTORY"
+\fBzip_rename\fR()
+was added in libzip 0.6.
+In libzip 0.10 the type of
+\fIindex\fR
+was changed from
+\fIint\fR
+to
+\fIzip_uint64_t\fR.
+It was deprecated in libzip 0.11, use
+\fBzip_file_rename\fR()
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 9ce953b..ce3a748 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_rename.mdoc -- rename file in zip archive
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_RENAME 3
 .Os
 .Sh NAME
@@ -51,6 +51,18 @@ with an empty flags argument.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_file_rename 3
+.Sh HISTORY
+.Fn zip_rename
+was added in libzip 0.6.
+In libzip 0.10 the type of
+.Ar index
+was changed from
+.Vt int
+to
+.Vt zip_uint64_t .
+It was deprecated in libzip 0.11, use
+.Fn zip_file_rename
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_set_archive_comment.man b/man/zip_set_archive_comment.man
new file mode 100644 (file)
index 0000000..0213535
--- /dev/null
@@ -0,0 +1,66 @@
+.TH "ZIP_SET_ARCHIVE_COMMENT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_set_archive_comment\fR
+\- set zip archive comment
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_set_archive_comment\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *comment\fR, \fIzip_uint16_t\ len\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_set_archive_comment\fR()
+function sets the comment for the entire zip archive.
+If
+\fIcomment\fR
+is
+\fRNULL\fR
+and
+\fIlen\fR
+is 0, the archive comment will be removed.
+\fIcomment\fR
+must be encoded in ASCII or UTF-8.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_set_archive_comment\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIlen\fR
+is less than 0 or longer than the maximum comment length in a zip file
+(65535), or
+\fIcomment\fR
+is not a valid UTF-8 encoded string.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.SH "SEE ALSO"
+libzip(3),
+zip_get_archive_comment(3),
+zip_get_file_comment(3),
+zip_set_file_comment(3)
+.SH "HISTORY"
+\fBzip_set_archive_comment\fR()
+was added in libzip 0.7.
+In libzip 0.11 the type of
+\fIlen\fR
+was changed from
+\fIint\fR
+to
+\fIzip_uint16_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index fc4f6da..900dbbc 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_set_archive_comment.mdoc -- set zip archive comment
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 22, 2012
+.Dd December 18, 2017
 .Dt ZIP_SET_ARCHIVE_COMMENT 3
 .Os
 .Sh NAME
@@ -77,6 +77,15 @@ Required memory could not be allocated.
 .Xr zip_get_archive_comment 3 ,
 .Xr zip_get_file_comment 3 ,
 .Xr zip_set_file_comment 3
+.Sh HISTORY
+.Fn zip_set_archive_comment
+was added in libzip 0.7.
+In libzip 0.11 the type of
+.Ar len
+was changed from
+.Vt int
+to
+.Vt zip_uint16_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_set_archive_flag.man b/man/zip_set_archive_flag.man
new file mode 100644 (file)
index 0000000..7ea03c6
--- /dev/null
@@ -0,0 +1,47 @@
+.TH "ZIP_SET_ARCHIVE_FLAG" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_set_archive_flag\fR
+\- set zip archive flag
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_set_archive_flag\fR(\fIzip_t\ *archive\fR, \fIzip_flags_t\ flag\fR, \fIint\ value\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_set_archive_flag\fR()
+function sets the flag
+\fIflag\fR
+for the archive
+\fIarchive\fR
+to the value
+\fIvalue\fR.
+.PP
+Currently there are no supported flags.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned, and \-1 if an error
+occurred.
+.SH "SEE ALSO"
+libzip(3),
+zip_get_archive_flag(3)
+.SH "HISTORY"
+\fBzip_set_archive_flag\fR()
+was added in libzip 0.9.
+In libzip 0.11 the type of
+\fIflag\fR
+was changed from
+\fIint\fR
+to
+\fIzip_flags_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 20c0cee..116a340 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_set_archive_flag.mdoc -- set zip archive flag
-.\" Copyright (C) 2008-2015 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2008-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 29, 2015
+.Dd December 18, 2017
 .Dt ZIP_SET_ARCHIVE_FLAG 3
 .Os
 .Sh NAME
@@ -58,6 +58,15 @@ occurred.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_get_archive_flag 3
+.Sh HISTORY
+.Fn zip_set_archive_flag
+was added in libzip 0.9.
+In libzip 0.11 the type of
+.Ar flag
+was changed from
+.Vt int
+to
+.Vt zip_flags_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_set_default_password.man b/man/zip_set_default_password.man
new file mode 100644 (file)
index 0000000..94b98b4
--- /dev/null
@@ -0,0 +1,55 @@
+.TH "ZIP_SET_DEFAULT_PASSWORD" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_set_default_password\fR
+\- set default password for encrypted files in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_set_default_password\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *password\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_set_default_password\fR()
+function sets the default password used when accessing encrypted files.
+If
+\fIpassword\fR
+is
+\fRNULL\fR,
+the default password is unset.
+.PP
+If you prefer a different password for single files, use
+zip_fopen_encrypted(3)
+instead of
+zip_fopen(3).
+Usually, however, the same password is used for every file in an
+zip archive.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_set_default_password\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.SH "SEE ALSO"
+libzip(3),
+zip_fopen(3),
+zip_fopen_encrypted(3)
+.SH "HISTORY"
+\fBzip_set_default_password\fR()
+was added in libzip 0.10.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index c6c6b67..792176c 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_set_default_password.mdoc -- set default password for zip
-.\" Copyright (C) 2011-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2011-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 3, 2011
+.Dd December 18, 2017
 .Dt ZIP_SET_DEFAULT_PASSWORD 3
 .Os
 .Sh NAME
@@ -73,6 +73,9 @@ Required memory could not be allocated.
 .Xr libzip 3 ,
 .Xr zip_fopen 3 ,
 .Xr zip_fopen_encrypted 3
+.Sh HISTORY
+.Fn zip_set_default_password
+was added in libzip 0.10.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_set_file_comment.man b/man/zip_set_file_comment.man
new file mode 100644 (file)
index 0000000..41d7748
--- /dev/null
@@ -0,0 +1,52 @@
+.TH "ZIP_SET_FILE_COMMENT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_set_file_comment\fR
+\- set comment for file in zip (obsolete interface)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_set_file_comment\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIconst\ char\ *comment\fR, \fIint\ len\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_set_file_comment\fR()
+function is the obsolete version of
+zip_file_set_comment(3).
+The only differences are the type of the
+\fIlen\fR
+argument and the additional
+\fIflags\fR
+argument.
+\fBzip_set_file_comment\fR()
+is the same as calling
+zip_file_set_comment(3)
+with an empty
+\fIflags\fR
+argument.
+.SH "SEE ALSO"
+libzip(3),
+zip_file_set_comment(3)
+.SH "HISTORY"
+\fBzip_set_file_comment\fR()
+was added in libzip 0.7.
+In libzip 0.10 the type of
+\fIindex\fR
+was changed from
+\fIint\fR
+to
+\fIzip_uint64_t\fR.
+It was deprecated in libzip 0.11, use
+\fBzip_file_set_comment\fR()
+instead.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index a90d3e5..f6e2b37 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_set_file_comment.mdoc -- set comment for file in zip
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP files.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_SET_FILE_COMMENT 3
 .Os
 .Sh NAME
@@ -60,6 +60,18 @@ argument.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_file_set_comment 3
+.Sh HISTORY
+.Fn zip_set_file_comment
+was added in libzip 0.7.
+In libzip 0.10 the type of
+.Ar index
+was changed from
+.Vt int
+to
+.Vt zip_uint64_t .
+It was deprecated in libzip 0.11, use
+.Fn zip_file_set_comment
+instead.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_set_file_compression.man b/man/zip_set_file_compression.man
new file mode 100644 (file)
index 0000000..6265071
--- /dev/null
@@ -0,0 +1,96 @@
+.TH "ZIP_SET_FILE_COMPRESSION" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_set_file_compression\fR
+\- set compression method for file in zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_set_file_compression\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_int32_t\ comp\fR, \fIzip_uint32_t\ comp_flags\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_set_file_compression\fR()
+function sets the compression method for the file at position
+\fIindex\fR
+in the zip archive to
+\fIcomp\fR
+with the compression method specific
+\fIcomp_flags\fR.
+The
+\fIcomp\fR
+is the same as returned by
+zip_stat(3).
+For the
+\fIcomp\fR
+argument, currently only the following values are supported:
+.TP 19n
+\fRZIP_CM_DEFAULT\fR
+default compression; currently the same as
+\fRZIP_CM_DEFLATE\fR.
+.TP 19n
+\fRZIP_CM_STORE\fR
+Store the file uncompressed.
+.TP 19n
+\fRZIP_CM_BZIP2\fR
+Compress the file using the
+bzip2(1)
+algorithm.
+.TP 19n
+\fRZIP_CM_DEFLATE\fR
+Deflate the file with the
+zlib(3)
+algorithm and default options
+.PP
+\fINOTE\fR:
+Only the deflate and store methods can be assumed to be universally
+supported.
+.PP
+The
+\fIcomp_flags\fR
+argument defines the compression level, 1 being fastest compression
+and 9 highest.
+Allowed values are 0 (which uses the default compression for the
+algorithm) and 1-9, other values are undefined.
+Further compression method specific flags might be added over time.
+.PP
+The current compression method for a file in a zip archive can be
+determined using
+zip_stat(3).
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_set_file_compression\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_COMPNOTSUPP\fR]
+Unsupported compression method requested.
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIarchive\fR,
+or the argument combination is invalid.
+.TP 19n
+[\fRZIP_ER_RDONLY\fR]
+Read-only zip file, no changes allowed.
+.SH "SEE ALSO"
+libzip(3),
+zip_stat(3)
+.SH "HISTORY"
+\fBzip_set_file_compression\fR()
+was added in libzip 0.11.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index e76c248..4021898 100644 (file)
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2017
+.Dd December 18, 2017
 .Dt ZIP_SET_FILE_COMPRESSION 3
 .Os
 .Sh NAME
@@ -110,6 +110,9 @@ Read-only zip file, no changes allowed.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_stat 3
+.Sh HISTORY
+.Fn zip_set_file_compression
+was added in libzip 0.11.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source.man b/man/zip_source.man
new file mode 100644 (file)
index 0000000..bf590d7
--- /dev/null
@@ -0,0 +1,57 @@
+.TH "ZIP_SOURCE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source\fR
+\- zip data source structure
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *zs\fR;
+.SH "DESCRIPTION"
+A
+\fIstruct zip_source\fR
+is a data source used by
+libzip(3)
+for adding or replacing file contents for a file in a zip archive.
+If the source supports seeking, it can also be used to open zip archives from.
+It is created by calling one of
+zip_source_buffer(3),
+zip_source_buffer_create(3),
+zip_source_file(3),
+zip_source_file_create(3),
+zip_source_filep(3),
+zip_source_filep_create(3),
+zip_source_function(3),
+zip_source_function_create(3),
+or
+zip_source_zip(3).
+\fIzip_source_t\fR
+is reference counted, and created with a reference count of 1.
+zip_open_from_source(3),
+zip_file_add(3),
+and
+zip_file_replace(3)
+will decrement the reference count of the
+\fIzip_source_t\fR
+when they are done using it, so
+zip_source_free(3)
+only needs to be called when these functions return an error.
+Use
+zip_source_keep(3)
+to increase the reference count, for example if you need the source after
+zip_close(3).
+.SH "SEE ALSO"
+libzip(3),
+zip_source_buffer(3),
+zip_source_file(3),
+zip_source_filep(3),
+zip_source_free(3),
+zip_source_function(3),
+zip_source_zip(3)
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6b3a34d..df863d7 100644 (file)
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 24, 2015
+.Dd December 18, 2017
 .Dt ZIP_SOURCE 3
 .Os
 .Sh NAME
diff --git a/man/zip_source_begin_write.man b/man/zip_source_begin_write.man
new file mode 100644 (file)
index 0000000..a40937c
--- /dev/null
@@ -0,0 +1,67 @@
+.TH "ZIP_SOURCE_BEGIN_WRITE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_begin_write\fR,
+\fBzip_source_begin_write_cloning\fR
+\- prepare zip source for writing
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_begin_write\fR(\fIzip_source_t\ *source\fR);
+.PD
+.PP
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_begin_write_cloning\fR(\fIzip_source_t\ *source\fR, \fIzip_uint64_t\ offset\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_source_begin_write\fR()
+and
+\fBzip_source_begin_write_cloning\fR()
+prepare
+\fIsource\fR
+for writing.
+Usually this involves creating temporary files or allocating buffers.
+.PP
+\fBzip_source_begin_write_cloning\fR()
+preserves the first
+\fIoffset\fR
+bytes of the original file.
+This is done efficiently, and writes to
+\fIsource\fR
+won't overwrite the original data until
+\fBzip_commit_write\fR()
+is called.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_commit_write(3),
+zip_source_rollback_write(3),
+zip_source_seek_write(3),
+zip_source_tell_write(3),
+zip_source_write(3)
+.SH "HISTORY"
+\fBzip_source_begin_write\fR()
+was added in libzip 1.0.
+.PP
+\fBzip_source_begin_write_cloning\fR()
+was added in libzip 1.4.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index ba78e0d..bef77e2 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_begin_write.mdoc -- prepare zip source for writing
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_BEGIN_WRITE 3
 .Os
 .Sh NAME
-.Nm zip_source_begin_write
+.Nm zip_source_begin_write ,
+.Nm zip_source_begin_write_cloning
 .Nd prepare zip source for writing
 .Sh LIBRARY
 libzip (-lzip)
@@ -41,13 +42,27 @@ libzip (-lzip)
 .In zip.h
 .Ft int
 .Fn zip_source_begin_write "zip_source_t *source"
+.Ft int
+.Fn zip_source_begin_write_cloning "zip_source_t *source" "zip_uint64_t offset"
 .Sh DESCRIPTION
-The function
+The functions
 .Fn zip_source_begin_write
-prepares
+and
+.Fn zip_source_begin_write_cloning
+prepare
 .Fa source
 for writing.
 Usually this involves creating temporary files or allocating buffers.
+.Pp
+.Fn zip_source_begin_write_cloning
+preserves the first
+.Ar offset
+bytes of the original file.
+This is done efficiently, and writes to
+.Ar source
+won't overwrite the original data until
+.Fn zip_commit_write
+is called.
 .Sh RETURN VALUES
 Upon successful completion 0 is returned.
 Otherwise, \-1 is returned and the error information in
@@ -61,6 +76,12 @@ is set to indicate the error.
 .Xr zip_source_seek_write 3 ,
 .Xr zip_source_tell_write 3 ,
 .Xr zip_source_write 3
+.Sh HISTORY
+.Fn zip_source_begin_write
+was added in libzip 1.0.
+.Pp
+.Fn zip_source_begin_write_cloning
+was added in libzip 1.4.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_buffer.man b/man/zip_source_buffer.man
new file mode 100644 (file)
index 0000000..be95aa8
--- /dev/null
@@ -0,0 +1,80 @@
+.TH "ZIP_SOURCE_BUFFER" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_buffer\fR,
+\fBzip_source_buffer_create\fR
+\- create zip data source from buffer
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_buffer\fR(\fIzip_t\ *archive\fR, \fIconst\ void\ *data\fR, \fIzip_uint64_t\ len\fR, \fIint\ freep\fR);
+.PD
+.PP
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_buffer_create\fR(\fIconst\ void\ *data\fR, \fIzip_uint64_t\ len\fR, \fIint\ freep\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_source_buffer\fR()
+and
+\fBzip_source_buffer_create\fR()
+create a zip source from the buffer
+\fIdata\fR
+of size
+\fIlen\fR.
+If
+\fIfreep\fR
+is non-zero, the buffer will be freed when it is no longer needed.
+\fIdata\fR
+must remain valid for the lifetime of the created source.
+.PP
+The source can be used to open a zip archive from.
+.SH "RETURN VALUES"
+Upon successful completion, the created source is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+or
+\fIerror\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_source_buffer\fR()
+and
+\fBzip_source_buffer_create\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIlen\fR
+is greater than zero and
+\fIdata\fR
+is
+\fRNULL\fR.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3),
+zip_open_from_source(3),
+zip_replace(3),
+zip_source(3)
+.SH "HISTORY"
+\fBzip_source_buffer\fR()
+and
+\fBzip_source_buffer_create\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index cbda0ad..e2be448 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_buffer.mdoc -- create zip data source from buffer
-.\" Copyright (C) 2004-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 17, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_BUFFER 3
 .Os
 .Sh NAME
-.Nm zip_source_buffer
+.Nm zip_source_buffer ,
+.Nm zip_source_buffer_create
 .Nd create zip data source from buffer
 .Sh LIBRARY
 libzip (-lzip)
@@ -89,6 +90,11 @@ Required memory could not be allocated.
 .Xr zip_open_from_source 3 ,
 .Xr zip_replace 3 ,
 .Xr zip_source 3
+.Sh HISTORY
+.Fn zip_source_buffer
+and
+.Fn zip_source_buffer_create
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_buffer_fragment.man b/man/zip_source_buffer_fragment.man
new file mode 100644 (file)
index 0000000..18fc92d
--- /dev/null
@@ -0,0 +1,93 @@
+.TH "ZIP_SOURCE_BUFFER_FRAGMENT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_buffer_fragment\fR,
+\fBzip_source_buffer_fragment_create\fR
+\- create zip data source from multiple buffer
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_buffer_fragment\fR(\fIzip_t\ *archive\fR, \fIzip_buffer_fragment_t\ *fragments\fR, \fIzip_uint64_t\ nfragments\fR, \fIint\ freep\fR);
+.PD
+.PP
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_buffer_fragment_create\fR(\fIzip_buffer_fragment_t\ *fragments\fR, \fIzip_uint64_t\ nfragments\fR, \fIint\ freep\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_source_buffer_fragment\fR()
+and
+\fBzip_source_buffer_fragment_create\fR()
+create a zip source from the data in
+\fIfragments\fR.
+\fInfragments\fR
+specifies the number of fragments.
+If
+\fIfreep\fR
+is non-zero, the data will be freed when it is no longer needed.
+.nf
+.sp
+.RS 0n
+struct zip_stat {
+    zip_uint8_t *data;    /* pointer to the actual data */
+    zip_uint64_t length;  /* length of this fragment */
+};
+.RE
+.fi
+.PP
+The data
+\fIfragments\fR
+point to must remain valid for the lifetime of the created source.
+\fIfragments\fR
+itself can be discarded once the source is created.
+.PP
+The source can be used to open a zip archive from.
+.SH "RETURN VALUES"
+Upon successful completion, the created source is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+or
+\fIerror\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_source_buffer\fR()
+and
+\fBzip_source_buffer_create\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fInfragments\fR
+is greater than zero and
+\fIfragments\fR
+is
+\fRNULL\fR.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3),
+zip_open_from_source(3),
+zip_replace(3),
+zip_source(3)
+.SH "HISTORY"
+\fBzip_source_buffer_fragment\fR()
+and
+\fBzip_source_buffer_fragment_create\fR()
+were added in libzip 1.4.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
diff --git a/man/zip_source_buffer_fragment.mdoc b/man/zip_source_buffer_fragment.mdoc
new file mode 100644 (file)
index 0000000..c8d2a25
--- /dev/null
@@ -0,0 +1,112 @@
+.\" zip_source_buffer_fragment.mdoc -- create zip data source from multiple buffers
+.\" Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
+.\"
+.\" This file is part of libzip, a library to manipulate ZIP archives.
+.\" The authors can be contacted at <libzip@nih.at>
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in
+.\"    the documentation and/or other materials provided with the
+.\"    distribution.
+.\" 3. The names of the authors may not be used to endorse or promote
+.\"    products derived from this software without specific prior
+.\"    written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd December 18, 2017
+.Dt ZIP_SOURCE_BUFFER_FRAGMENT 3
+.Os
+.Sh NAME
+.Nm zip_source_buffer_fragment ,
+.Nm zip_source_buffer_fragment_create
+.Nd create zip data source from multiple buffer
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft zip_source_t *
+.Fn zip_source_buffer_fragment "zip_t *archive" "zip_buffer_fragment_t *fragments" "zip_uint64_t nfragments" "int freep"
+.Ft zip_source_t *
+.Fn zip_source_buffer_fragment_create "zip_buffer_fragment_t *fragments" "zip_uint64_t nfragments" "int freep" "zip_error_t *error"
+.Sh DESCRIPTION
+The functions
+.Fn zip_source_buffer_fragment
+and
+.Fn zip_source_buffer_fragment_create
+create a zip source from the data in
+.Ar fragments .
+.Ar nfragments
+specifies the number of fragments.
+If
+.Ar freep
+is non-zero, the data will be freed when it is no longer needed.
+.Bd -literal
+struct zip_stat {
+    zip_uint8_t *data;    /* pointer to the actual data */
+    zip_uint64_t length;  /* length of this fragment */
+};
+.Ed
+.Pp
+The data
+.Ar fragments
+point to must remain valid for the lifetime of the created source.
+.Ar fragments
+itself can be discarded once the source is created.
+.Pp
+The source can be used to open a zip archive from.
+.Sh RETURN VALUES
+Upon successful completion, the created source is returned.
+Otherwise,
+.Dv NULL
+is returned and the error code in
+.Ar archive
+or
+.Ar error
+is set to indicate the error.
+.Sh ERRORS
+.Fn zip_source_buffer
+and
+.Fn zip_source_buffer_create
+fail if:
+.Bl -tag -width Er
+.It Bq Er ZIP_ER_INVAL
+.Ar nfragments
+is greater than zero and
+.Ar fragments
+is
+.Dv NULL .
+.It Bq Er ZIP_ER_MEMORY
+Required memory could not be allocated.
+.El
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_add 3 ,
+.Xr zip_open_from_source 3 ,
+.Xr zip_replace 3 ,
+.Xr zip_source 3
+.Sh HISTORY
+.Fn zip_source_buffer_fragment
+and
+.Fn zip_source_buffer_fragment_create
+were added in libzip 1.4.0.
+.Sh AUTHORS
+.An -nosplit
+.An Dieter Baron Aq Mt dillo@nih.at
+and
+.An Thomas Klausner Aq Mt tk@giga.or.at
diff --git a/man/zip_source_close.man b/man/zip_source_close.man
new file mode 100644 (file)
index 0000000..50a2c2b
--- /dev/null
@@ -0,0 +1,40 @@
+.TH "ZIP_SOURCE_CLOSE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_close\fR
+\- open zip_source (which was open for reading)
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_close\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_close\fR()
+closes
+\fIsource\fR,
+indicating that no more data will be read.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_free(3),
+zip_source_open(3)
+.SH "HISTORY"
+\fBzip_source_close\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 0355d3e..4220861 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_close.mdoc -- close zip source (open for reading)
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_CLOSE 3
 .Os
 .Sh NAME
@@ -57,6 +57,9 @@ is set to indicate the error.
 .Xr zip_source 3 ,
 .Xr zip_source_free 3 ,
 .Xr zip_source_open 3
+.Sh HISTORY
+.Fn zip_source_close
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_commit_write.man b/man/zip_source_commit_write.man
new file mode 100644 (file)
index 0000000..d1ebcf6
--- /dev/null
@@ -0,0 +1,43 @@
+.TH "ZIP_SOURCE_COMMIT_WRITE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_commit_write\fR
+\- finalize changes to zip source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_commit_write\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_commit_write\fR()
+finishes writing data to
+\fIsource\fR
+and replaces the original with the newly written data.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_begin_write(3),
+zip_source_rollback_write(3),
+zip_source_seek_write(3),
+zip_source_tell_write(3),
+zip_source_write(3)
+.SH "HISTORY"
+\fBzip_source_commit_write\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 0fe189a..69c4f1b 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_commit_write.mdoc -- finalize changes to zip source
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_COMMIT_WRITE 3
 .Os
 .Sh NAME
@@ -60,6 +60,9 @@ is set to indicate the error.
 .Xr zip_source_seek_write 3 ,
 .Xr zip_source_tell_write 3 ,
 .Xr zip_source_write 3
+.Sh HISTORY
+.Fn zip_source_commit_write
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_error.man b/man/zip_source_error.man
new file mode 100644 (file)
index 0000000..1ffe434
--- /dev/null
@@ -0,0 +1,33 @@
+.TH "ZIP_SOURCE_ERROR" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_error\fR
+\- get zip error for data source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_error_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_error\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_source_error\fR()
+function returns the zip error for the data source
+\fIsource\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_error_code_system(3),
+zip_error_code_zip(3)
+.SH "HISTORY"
+\fBzip_source_error\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 50ec552..af098d1 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_error.mdoc -- get zip_error for data source
-.\" Copyright (C) 2014-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_ERROR 3
 .Os
 .Sh NAME
@@ -50,6 +50,9 @@ function returns the zip error for the data source
 .Xr libzip 3 ,
 .Xr zip_error_code_system 3 ,
 .Xr zip_error_code_zip 3
+.Sh HISTORY
+.Fn zip_source_error
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_file.man b/man/zip_source_file.man
new file mode 100644 (file)
index 0000000..e251140
--- /dev/null
@@ -0,0 +1,93 @@
+.TH "ZIP_SOURCE_FILE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_file\fR,
+\fBzip_source_file_create\fR
+\- create data source from a file
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_file\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *fname\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR);
+.PD
+.PP
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_file_create\fR(\fIconst\ char\ *fname\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_source_file\fR()
+and
+\fBzip_source_file_create\fR()
+create a zip source from a file.
+They open
+\fIfname\fR
+and read
+\fIlen\fR
+bytes from offset
+\fIstart\fR
+from it.
+If
+\fIlen\fR
+is 0 or \-1, the whole file (starting from
+\fIstart\fR)
+is used.
+.PP
+If the file supports seek, the source can be used to open a zip archive from.
+.PP
+The file is opened and read when the data from the source is used, usually by
+\fBzip_close\fR()
+or
+\fBzip_open_from_source\fR().
+.SH "RETURN VALUES"
+Upon successful completion, the created source is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+or
+\fIerror\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_source_file\fR()
+and
+\fBzip_source_file_create\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIfname\fR,
+\fIstart\fR,
+or
+\fIlen\fR
+are invalid.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_OPEN\fR]
+Opening
+\fIfname\fR
+failed.
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3),
+zip_replace(3),
+zip_source(3)
+.SH "HISTORY"
+\fBzip_source_file\fR()
+and
+\fBzip_source_file_create\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 11da5d1..35c9b34 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_file.mdoc -- create data source from a file
-.\" Copyright (C) 2004-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_FILE 3
 .Os
 .Sh NAME
-.Nm zip_source_file
+.Nm zip_source_file ,
+.Nm zip_source_file_create
 .Nd create data source from a file
 .Sh LIBRARY
 libzip (-lzip)
@@ -101,6 +102,11 @@ failed.
 .Xr zip_add 3 ,
 .Xr zip_replace 3 ,
 .Xr zip_source 3
+.Sh HISTORY
+.Fn zip_source_file
+and
+.Fn zip_source_file_create
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_filep.man b/man/zip_source_filep.man
new file mode 100644 (file)
index 0000000..191c7ee
--- /dev/null
@@ -0,0 +1,85 @@
+.TH "ZIP_SOURCE_FILEP" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_filep\fR,
+\fBzip_source_filep_create\fR
+\- create data source from FILE *
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_filep\fR(\fIzip_t\ *archive\fR, \fIFILE\ *file\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR);
+.PD
+.PP
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_filep_create\fR(\fIFILE\ *file\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_source_filep\fR()
+and
+\fBzip_source_filep_create\fR()
+create a zip source from a file stream.
+They read
+\fIlen\fR
+bytes from offset
+\fIstart\fR
+from the open file stream
+\fIfile\fR.
+If
+\fIlen\fR
+is 0 or \-1, the whole file (starting from
+\fIstart\fR)
+is used.
+.PP
+If the file stream supports seeking, the source can be used to open
+a read-only zip archive from.
+.PP
+The file stream is closed when the source is being freed, usually
+by
+zip_close(3).
+.SH "RETURN VALUES"
+Upon successful completion, the created source is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+or
+\fIerror\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_source_filep\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIfile\fR,
+\fIstart\fR,
+or
+\fIlen\fR
+are invalid.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3),
+zip_replace(3),
+zip_source(3)
+.SH "HISTORY"
+\fBzip_source_filep\fR()
+and
+\fBzip_source_filep_create\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6e4e4fb..d8f5b92 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_filep.mdoc -- create data source from a file stream
-.\" Copyright (C) 2004-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_FILEP 3
 .Os
 .Sh NAME
-.Nm zip_source_filep
+.Nm zip_source_filep ,
+.Nm zip_source_filep_create
 .Nd create data source from FILE *
 .Sh LIBRARY
 libzip (-lzip)
@@ -94,6 +95,11 @@ Required memory could not be allocated.
 .Xr zip_add 3 ,
 .Xr zip_replace 3 ,
 .Xr zip_source 3
+.Sh HISTORY
+.Fn zip_source_filep
+and
+.Fn zip_source_filep_create
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_free.man b/man/zip_source_free.man
new file mode 100644 (file)
index 0000000..db3ad44
--- /dev/null
@@ -0,0 +1,49 @@
+.TH "ZIP_SOURCE_FREE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_free\fR
+\- free zip data source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_free\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_free\fR()
+decrements the reference count of
+\fIsource\fR
+and frees it if the reference count drops to 0.
+If
+\fIsource\fR
+is
+\fRNULL\fR,
+it does nothing.
+.PP
+\fINOTE\fR:
+This function should not be called on a
+\fIsource\fR
+after it was used successfully in a
+zip_open_from_source(3),
+zip_file_add(3),
+or
+zip_file_replace(3)
+call.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_keep(3)
+.SH "HISTORY"
+\fBzip_source_free\fR()
+was added in libzip 0.6.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index f38261e..816f7a1 100644 (file)
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 1, 2017
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_FREE 3
 .Os
 .Sh NAME
@@ -66,6 +66,9 @@ call.
 .Xr libzip 3 ,
 .Xr zip_source 3 ,
 .Xr zip_source_keep 3
+.Sh HISTORY
+.Fn zip_source_free
+was added in libzip 0.6.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_function.man b/man/zip_source_function.man
new file mode 100644 (file)
index 0000000..b167e83
--- /dev/null
@@ -0,0 +1,314 @@
+.TH "ZIP_SOURCE_FUNCTION" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_function\fR,
+\fBzip_source_function_create\fR
+\- create data source from function
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_function\fR(\fIzip_t\ *archive\fR, \fIzip_source_callback\ fn\fR, \fIvoid\ *userdata\fR);
+.PD
+.PP
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_function_create\fR(\fIzip_source_callback\ fn\fR, \fIvoid\ *userdata\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_source_function\fR()
+and
+\fBzip_source_function_create\fR()
+creates a zip source from the user-provided function
+\fIfn\fR,
+which must be of the following type:
+.PP
+\fItypedef zip_int64_t\fR
+\fB\fR(*\fPzip_source_callback\fR)\fP\fR(\fIvoid\ *userdata\fR, \fIvoid\ *data\fR, \fIzip_uint64_t\ len\fR, \fIzip_source_cmd_t\ cmd\fR)
+.PP
+\fIarchive\fR
+or
+\fIerror\fR
+are used for reporting errors and can be
+\fRNULL\fR.
+.PP
+When called by the library, the first argument is the
+\fIuserdata\fR
+argument supplied to the function.
+The next two arguments are a buffer
+\fIdata\fR
+of size
+\fIlen\fR
+when data is passed in or expected to be returned, or else
+\fRNULL\fR
+and 0.
+The last argument,
+\fIcmd\fR,
+specifies which action the function should perform.
+.PP
+Depending on the uses, there are three useful sets of commands to be supported by a
+\fBzip_source_callback\fR():
+.TP 24n
+read source
+Providing streamed data (for file data added to archives).
+Must support
+\fRZIP_SOURCE_OPEN\fR,
+\fRZIP_SOURCE_READ\fR,
+\fRZIP_SOURCE_CLOSE\fR,
+\fRZIP_SOURCE_STAT\fR,
+and
+\fRZIP_SOURCE_ERROR\fR.
+.TP 24n
+seekable read source
+Same as previous, but from a source allowing reading from arbitrary
+offsets (also for read-only zip archive).
+Must additionally support
+\fRZIP_SOURCE_SEEK\fR,
+\fRZIP_SOURCE_TELL\fR,
+and
+\fRZIP_SOURCE_SUPPORTS\fR.
+.TP 24n
+read/write source
+Same as previous, but additionally allowing writing (also for writable
+zip archives).
+Must additionally support
+\fRZIP_SOURCE_BEGIN_WRITE\fR,
+\fRZIP_SOURCE_COMMIT_WRITE\fR,
+\fRZIP_SOURCE_ROLLBACK_WRITE\fR,
+\fRZIP_SOURCE_SEEK_WRITE\fR,
+\fRZIP_SOURCE_TELL_WRITE\fR,
+and
+\fRZIP_SOURCE_REMOVE\fR.
+.SS "\fRZIP_SOURCE_BEGIN_WRITE\fR"
+Prepare the source for writing.
+Use this to create any temporary file(s).
+.SS "\fRZIP_SOURCE_BEGIN_WRITE_CLONING\fR"
+Prepare the source for writing, keeping the first
+\fIlen\fR
+bytes of the original file.
+Only implement this command if it is more efficient than copying the
+data, and if it does not destructively overwrite the original file
+(you still have to be able to execute
+\fRZIP_SOURCE_ROLLBACK_WRITE\fR).
+.PP
+The next write should happen at byte
+\fIoffset\fR.
+.SS "\fRZIP_SOURCE_CLOSE\fR"
+Reading is done.
+.SS "\fRZIP_SOURCE_COMMIT_WRITE\fR"
+Finish writing to the source.
+Replace the original data with the newly written data.
+Clean up temporary files or internal buffers.
+Subsequently opening and reading from the source should return the
+newly written data.
+.SS "\fRZIP_SOURCE_ERROR\fR"
+Get error information.
+\fIdata\fR
+points to an array of two ints, which should be filled with the libzip
+error code and the corresponding system error code for the error that
+occurred.
+See
+zip_errors(3)
+for details on the error codes.
+If the source stores error information in a zip_error_t, use
+zip_error_to_data(3)
+and return its return value.
+Otherwise, return 2 * sizeof(int).
+.SS "\fRZIP_SOURCE_FREE\fR"
+Clean up and free all resources, including
+\fIuserdata\fR.
+The callback function will not be called again.
+.SS "\fRZIP_SOURCE_OPEN\fR"
+Prepare for reading.
+.SS "\fRZIP_SOURCE_READ\fR"
+Read data into the buffer
+\fIdata\fR
+of size
+\fIlen\fR.
+Return the number of bytes placed into
+\fIdata\fR
+on success, and zero for end-of-file.
+.SS "\fRZIP_SOURCE_REMOVE\fR"
+Remove the underlying file.
+This is called if a zip archive is empty when closed.
+.SS "\fRZIP_SOURCE_ROLLBACK_WRITE\fR"
+Abort writing to the source.
+Discard written data.
+Clean up temporary files or internal buffers.
+Subsequently opening and reading from the source should return the
+original data.
+.SS "\fRZIP_SOURCE_SEEK\fR"
+Specify position to read next byte from, like
+fseek(3).
+Use
+ZIP_SOURCE_GET_ARGS(3)
+to decode the arguments into the following struct:
+.nf
+.sp
+.RS 0n
+struct zip_source_args_seek {
+    zip_int64_t offset;
+    int whence;
+};
+.RE
+.fi
+.PP
+If the size of the source's data is known, use
+zip_source_seek_compute_offset(3)
+to validate the arguments and compute the new offset.
+.SS "\fRZIP_SOURCE_SEEK_WRITE\fR"
+Specify position to write next byte to, like
+fseek(3).
+See
+\fRZIP_SOURCE_SEEK\fR
+for details.
+.SS "\fRZIP_SOURCE_STAT\fR"
+Get meta information for the input data.
+\fIdata\fR
+points to an allocated
+\fIstruct zip_stat\fR,
+which should be initialized using
+zip_stat_init(3)
+and then filled in.
+.PP
+For uncompressed, unencrypted data, all information is optional.
+However, fill in as much information as is readily available.
+.PP
+If the data is compressed,
+\fRZIP_STAT_COMP_METHOD\fR,
+\fRZIP_STAT_SIZE\fR,
+and
+\fRZIP_STAT_CRC\fR
+must be filled in.
+.PP
+If the data is encrypted,
+\fRZIP_STAT_ENCRYPTION_METHOD\fR,
+\fRZIP_STAT_COMP_METHOD\fR,
+\fRZIP_STAT_SIZE\fR,
+and
+\fRZIP_STAT_CRC\fR
+must be filled in.
+.PP
+Information only available after the source has been read (e.g., size)
+can be omitted in an earlier call.
+\fINOTE\fR:
+\fBzip_source_function\fR()
+may be called with this argument even after being called with
+\fRZIP_SOURCE_CLOSE\fR.
+.PP
+Return sizeof(struct zip_stat) on success.
+.SS "\fRZIP_SOURCE_SUPPORTS\fR"
+Return bitmap specifying which commands are supported.
+Use
+zip_source_make_command_bitmap(3).
+If this command is not implemented, the source is assumed to be a
+read source without seek support.
+.SS "\fRZIP_SOURCE_TELL\fR"
+Return the current read offset in the source, like
+ftell(3).
+.SS "\fRZIP_SOURCE_TELL_WRITE\fR"
+Return the current write offset in the source, like
+ftell(3).
+.SS "\fRZIP_SOURCE_WRITE\fR"
+Write data to the source.
+Return number of bytes written.
+.SS "Return Values"
+Commands should return \-1 on error.
+\fRZIP_SOURCE_ERROR\fR
+will be called to retrieve the error code.
+On success, commands return 0, unless specified otherwise in the
+description above.
+.SS "Calling Conventions"
+The library will always issue
+\fRZIP_SOURCE_OPEN\fR
+before issuing
+\fRZIP_SOURCE_READ\fR,
+\fRZIP_SOURCE_SEEK\fR,
+or
+\fRZIP_SOURCE_TELL\fR.
+When it no longer wishes to read from this source, it will issue
+\fRZIP_SOURCE_CLOSE\fR.
+If the library wishes to read the data again, it will issue
+\fRZIP_SOURCE_OPEN\fR
+a second time.
+If the function is unable to provide the data again, it should
+return \-1.
+.PP
+\fRZIP_SOURCE_BEGIN_WRITE\fR
+or
+\fRZIP_SOURCE_BEGIN_WRITE_CLONING\fR
+will be called before
+\fRZIP_SOURCE_WRITE\fR,
+\fRZIP_SOURCE_SEEK_WRITE\fR,
+or
+\fRZIP_SOURCE_TELL_WRITE\fR.
+When writing is complete, either
+\fRZIP_SOURCE_COMMIT_WRITE\fR
+or
+\fRZIP_SOURCE_ROLLBACK_WRITE\fR
+will be called.
+.PP
+\fRZIP_SOURCE_STAT\fR
+can be issued at any time.
+.PP
+\fRZIP_SOURCE_ERROR\fR
+will only be issued in response to the function
+returning \-1.
+.PP
+\fRZIP_SOURCE_FREE\fR
+will be the last command issued;
+if
+\fRZIP_SOURCE_OPEN\fR
+was called and succeeded,
+\fRZIP_SOURCE_CLOSE\fR
+will be called before
+\fRZIP_SOURCE_FREE\fR,
+and similarly for
+\fRZIP_SOURCE_BEGIN_WRITE\fR
+or
+\fRZIP_SOURCE_BEGIN_WRITE_CLONING\fR
+and
+\fRZIP_SOURCE_COMMIT_WRITE\fR
+or
+\fRZIP_SOURCE_ROLLBACK_WRITE\fR.
+.SH "RETURN VALUES"
+Upon successful completion, the created source is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+or
+\fIerror\fR
+is set to indicate the error (unless
+it is
+\fRNULL\fR).
+.SH "ERRORS"
+\fBzip_source_function\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3),
+zip_replace(3),
+zip_source(3),
+zip_stat_init(3)
+.SH "HISTORY"
+\fBzip_source_function\fR()
+and
+\fBzip_source_function_create\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index d902ca8..6c4683d 100644 (file)
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 6, 2017
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_FUNCTION 3
 .Os
 .Sh NAME
-.Nm zip_source_function
+.Nm zip_source_function ,
+.Nm zip_source_function_create
 .Nd create data source from function
 .Sh LIBRARY
 libzip (-lzip)
@@ -112,6 +113,17 @@ and
 .Ss Dv ZIP_SOURCE_BEGIN_WRITE
 Prepare the source for writing.
 Use this to create any temporary file(s).
+.Ss Dv ZIP_SOURCE_BEGIN_WRITE_CLONING
+Prepare the source for writing, keeping the first
+.Ar len
+bytes of the original file.
+Only implement this command if it is more efficient than copying the
+data, and if it does not destructively overwrite the original file
+(you still have to be able to execute
+.Dv ZIP_SOURCE_ROLLBACK_WRITE ) .
+.Pp
+The next write should happen at byte
+.Ar offset .
 .Ss Dv ZIP_SOURCE_CLOSE
 Reading is done.
 .Ss Dv ZIP_SOURCE_COMMIT_WRITE
@@ -251,6 +263,8 @@ If the function is unable to provide the data again, it should
 return \-1.
 .Pp
 .Dv ZIP_SOURCE_BEGIN_WRITE
+or
+.Dv ZIP_SOURCE_BEGIN_WRITE_CLONING
 will be called before
 .Dv ZIP_SOURCE_WRITE ,
 .Dv ZIP_SOURCE_SEEK_WRITE ,
@@ -279,6 +293,8 @@ will be called before
 .Dv ZIP_SOURCE_FREE ,
 and similarly for
 .Dv ZIP_SOURCE_BEGIN_WRITE
+or
+.Dv ZIP_SOURCE_BEGIN_WRITE_CLONING
 and
 .Dv ZIP_SOURCE_COMMIT_WRITE
 or
@@ -307,6 +323,11 @@ Required memory could not be allocated.
 .Xr zip_replace 3 ,
 .Xr zip_source 3 ,
 .Xr zip_stat_init 3
+.Sh HISTORY
+.Fn zip_source_function
+and
+.Fn zip_source_function_create
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_is_deleted.man b/man/zip_source_is_deleted.man
new file mode 100644 (file)
index 0000000..133f68e
--- /dev/null
@@ -0,0 +1,35 @@
+.TH "ZIP_SOURCE_IS_DELETED" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_is_deleted\fR
+\- check if zip_source is deleted
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_is_deleted\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_is_deleted\fR()
+returns whether the zip_source was deleted.
+This can for example happen when all entries are removed from a zip archive.
+.SH "RETURN VALUES"
+\fBzip_source_is_deleted\fR()
+returns 1 if the zip_source is deleted and 0 otherwise.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3)
+.SH "HISTORY"
+\fBzip_source_is_deleted\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 0399b9a..9903058 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_is_deleted.mdoc -- check if zip source is deleted
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_IS_DELETED 3
 .Os
 .Sh NAME
@@ -52,6 +52,9 @@ returns 1 if the zip_source is deleted and 0 otherwise.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_source 3
+.Sh HISTORY
+.Fn zip_source_is_deleted
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_keep.man b/man/zip_source_keep.man
new file mode 100644 (file)
index 0000000..6a324f8
--- /dev/null
@@ -0,0 +1,33 @@
+.TH "ZIP_SOURCE_KEEP" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_keep\fR
+\- increment reference count of zip data source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_keep\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_keep\fR()
+increments the reference count of
+\fIsource\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_free(3)
+.SH "HISTORY"
+\fBzip_source_keep\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index f7a2a3c..122c4f8 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_keep.mdoc -- increment reference count of zip data source
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_KEEP 3
 .Os
 .Sh NAME
@@ -50,6 +50,9 @@ increments the reference count of
 .Xr libzip 3 ,
 .Xr zip_source 3 ,
 .Xr zip_source_free 3
+.Sh HISTORY
+.Fn zip_source_keep
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_make_command_bitmap.man b/man/zip_source_make_command_bitmap.man
new file mode 100644 (file)
index 0000000..b618e44
--- /dev/null
@@ -0,0 +1,35 @@
+.TH "ZIP_SOURCE_MAKE_COMMAND_BITMAP" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_make_command_bitmap\fR
+\- create bitmap of supported source operations
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_make_command_bitmap\fR(\fIzip_source_cmd_t\ command\fR, \fI...\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_source_make_command_bitmap\fR()
+function returns a bitmap of source commands suitable as return value
+for
+\fRZIP_SOURCE_SUPPORTS\fR.
+It includes all the commands from the argument list, which must be
+terminated by \-1.
+.SH "SEE ALSO"
+libzip(3),
+zip_source_function(3)
+.SH "HISTORY"
+\fBzip_source_make_command_bitmap\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6ec9fd6..28d296f 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_make_command_bitmap -- create bitmap of supported source operations
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_MAKE_COMMAND_BITMAP 3
 .Os
 .Sh NAME
@@ -52,6 +52,9 @@ terminated by \-1.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_source_function 3
+.Sh HISTORY
+.Fn zip_source_make_command_bitmap
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_open.man b/man/zip_source_open.man
new file mode 100644 (file)
index 0000000..57fb326
--- /dev/null
@@ -0,0 +1,43 @@
+.TH "ZIP_SOURCE_OPEN" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_open\fR
+\- open zip_source for reading
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_open\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_open\fR()
+opens
+\fIsource\fR
+for reading.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_begin_write(3),
+zip_source_close(3),
+zip_source_read(3),
+zip_source_seek(3),
+zip_source_tell(3)
+.SH "HISTORY"
+\fBzip_source_open\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 4bd5c60..00371f6 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_open.mdoc -- open zip source for reading
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_OPEN 3
 .Os
 .Sh NAME
@@ -60,6 +60,9 @@ is set to indicate the error.
 .Xr zip_source_read 3 ,
 .Xr zip_source_seek 3 ,
 .Xr zip_source_tell 3
+.Sh HISTORY
+.Fn zip_source_open
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_read.man b/man/zip_source_read.man
new file mode 100644 (file)
index 0000000..e22dea5
--- /dev/null
@@ -0,0 +1,51 @@
+.TH "ZIP_SOURCE_READ" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_read\fR
+\- read data from zip source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_read\fR(\fIzip_source_t\ *source\fR, \fIvoid\ *data\fR, \fIzip_uint64_t\ len\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_read\fR()
+reads up to
+\fIlen\fR
+bytes of data from
+\fIsource\fR
+at the current read offset into the buffer
+\fIdata\fR.
+.PP
+The zip source
+\fIsource\fR
+has to be opened for reading by calling
+zip_source_open(3)
+first.
+.SH "RETURN VALUES"
+Upon successful completion the number of bytes read is returned.
+Upon reading end-of-file, zero is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_seek(3),
+zip_source_tell(3),
+zip_source_write(3)
+.SH "HISTORY"
+\fBzip_source_read\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 7fb5d96..1e7bc02 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_read.mdoc -- read data from zip source
-.\" Copyright (C) 2014-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 16, 2016
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_READ 3
 .Os
 .Sh NAME
@@ -68,6 +68,9 @@ is set to indicate the error.
 .Xr zip_source_seek 3 ,
 .Xr zip_source_tell 3 ,
 .Xr zip_source_write 3
+.Sh HISTORY
+.Fn zip_source_read
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_rollback_write.man b/man/zip_source_rollback_write.man
new file mode 100644 (file)
index 0000000..c1d61ed
--- /dev/null
@@ -0,0 +1,46 @@
+.TH "ZIP_SOURCE_ROLLBACK_WRITE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_rollback_write\fR
+\- undo changes to zip source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_rollback_write\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_rollback_write\fR()
+reverts changes written to
+\fIsource\fR,
+restoring the data before
+zip_source_begin_write(3)
+was called.
+Usually this removes temporary files or frees buffers.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_begin_write(3),
+zip_source_commit_write(3),
+zip_source_seek_write(3),
+zip_source_tell_write(3),
+zip_source_write(3)
+.SH "HISTORY"
+\fBzip_source_rollback_write\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index e313cdf..50a2a60 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_rollback_write.mdoc -- undo changes to zip source
-.\" Copyright (C) 2014-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_ROLLBACK_WRITE 3
 .Os
 .Sh NAME
@@ -63,6 +63,9 @@ is set to indicate the error.
 .Xr zip_source_seek_write 3 ,
 .Xr zip_source_tell_write 3 ,
 .Xr zip_source_write 3
+.Sh HISTORY
+.Fn zip_source_rollback_write
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_seek.man b/man/zip_source_seek.man
new file mode 100644 (file)
index 0000000..965d4f0
--- /dev/null
@@ -0,0 +1,57 @@
+.TH "ZIP_SOURCE_SEEK" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_seek\fR
+\- set read offset in zip source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_seek\fR(\fIzip_source_t\ *source\fR, \fIzip_int64_t\ offset\fR, \fIint\ whence\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_seek\fR()
+sets the current read offset for
+\fIsource\fR.
+Just like in
+fseek(3),
+depending on the
+\fIwhence\fR
+argument, the
+\fIoffset\fR
+is counted relative from:
+.RS 6n
+.TP 12n
+\fRSEEK_SET\fR
+start of file
+.TP 12n
+\fRSEEK_CUR\fR
+current read offset in file
+.TP 12n
+\fRSEEK_END\fR
+end of file
+.RE
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_read(3),
+zip_source_tell(3)
+.SH "HISTORY"
+\fBzip_source_seek\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index f6c3881..6518ba7 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_seek.mdoc -- set read offset in source
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_SEEK 3
 .Os
 .Sh NAME
@@ -71,6 +71,9 @@ is set to indicate the error.
 .Xr zip_source 3 ,
 .Xr zip_source_read 3 ,
 .Xr zip_source_tell 3
+.Sh HISTORY
+.Fn zip_source_seek
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_seek_compute_offset.man b/man/zip_source_seek_compute_offset.man
new file mode 100644 (file)
index 0000000..c7c2704
--- /dev/null
@@ -0,0 +1,53 @@
+.TH "ZIP_SOURCE_SEEK_COMPUTE_OFFSET" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_seek_compute_offset\fR
+\- validate arguments and compute offset
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_seek_compute_offset\fR(\fIzip_uint64_t\ offset\fR, \fIzip_uint64_t\ length\fR, \fIvoid\ *data\fR, \fIzip_uint64_t\ data_length\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+Use this function to compute the offset for a
+\fRZIP_SOURCE_SEEK\fR
+or
+\fRZIP_SOURCE_SEEK_WRITE\fR
+command.
+\fIdata\fR
+and
+\fIdata_length\fR
+are the arguments to the source callback,
+\fIoffset\fR
+is the current offset and
+\fIlength\fR
+is the length of the source data or, for
+\fRZIP_SOURCE_SEEK_WRITE\fR,
+the amount of data written.
+.SH "RETURN VALUES"
+On success, it returns the new offset, on error it returns \-1 and
+sets
+\fIerror\fR.
+.SH "ERRORS"
+\fBzip_source_seek_compute_offset\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+One of the arguments is invalid or the seek would place the offset
+outside the data.
+.SH "SEE ALSO"
+zip_source_function(3)
+.SH "HISTORY"
+\fBzip_source_seek_compute_offset\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 89fb77f..bcf159a 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_seek_compute_offset.mdoc - validate arguments and compute offset
-.\" Copyright (C) 2014-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 13, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_SEEK_COMPUTE_OFFSET 3
 .Os
 .Sh NAME
@@ -71,6 +71,9 @@ outside the data.
 .El
 .Sh SEE ALSO
 .Xr zip_source_function 3
+.Sh HISTORY
+.Fn zip_source_seek_compute_offset
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_seek_write.man b/man/zip_source_seek_write.man
new file mode 100644 (file)
index 0000000..a25d48c
--- /dev/null
@@ -0,0 +1,60 @@
+.TH "ZIP_SOURCE_SEEK_WRITE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_seek_write\fR
+\- set write offset in zip source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_seek_write\fR(\fIzip_source_t\ *source\fR, \fIzip_int64_t\ offset\fR, \fIint\ whence\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_seek_write\fR()
+sets the current write offset for
+\fIsource\fR.
+Just like in
+fseek(3),
+depending on the
+\fIwhence\fR
+argument, the
+\fIoffset\fR
+is counted relative from:
+.RS 6n
+.TP 12n
+\fRSEEK_SET\fR
+start of file
+.TP 12n
+\fRSEEK_CUR\fR
+current write offset in file
+.TP 12n
+\fRSEEK_END\fR
+end of file
+.RE
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_begin_write(3),
+zip_source_commit_write(3),
+zip_source_rollback_write(3),
+zip_source_tell_write(3),
+zip_source_write(3)
+.SH "HISTORY"
+\fBzip_source_seek_write\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 720f75a..fac0159 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_seek_write.mdoc -- set write offset in source
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_SEEK_WRITE 3
 .Os
 .Sh NAME
@@ -74,6 +74,9 @@ is set to indicate the error.
 .Xr zip_source_rollback_write 3 ,
 .Xr zip_source_tell_write 3 ,
 .Xr zip_source_write 3
+.Sh HISTORY
+.Fn zip_source_seek_write
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_stat.man b/man/zip_source_stat.man
new file mode 100644 (file)
index 0000000..e3c9b5f
--- /dev/null
@@ -0,0 +1,112 @@
+.TH "ZIP_SOURCE_STAT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_stat\fR
+\- get information about zip_source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_stat\fR(\fIzip_source_t\ *source\fR, \fIzip_stat_t\ *sb\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_source_stat\fR()
+function obtains information about the zip source
+\fIsource\fR
+.PP
+The
+\fIsb\fR
+argument is a pointer to a
+\fIstruct zip_source_stat\fR
+(shown below), into which information about the zip source is placed.
+.nf
+.sp
+.RS 0n
+struct zip_source_stat {
+    zip_uint64_t valid;                 /* which fields have valid values */
+    const char *name;                   /* name of the file */
+    zip_uint64_t index;                 /* index within archive */
+    zip_uint64_t size;                  /* size of file (uncompressed) */
+    zip_uint64_t comp_size;             /* size of file (compressed) */
+    time_t mtime;                       /* modification time */
+    zip_uint32_t crc;                   /* crc of file data */
+    zip_uint16_t comp_method;           /* compression method used */
+    zip_uint16_t encryption_method;     /* encryption method used */
+    zip_uint32_t flags;                 /* reserved for future use */
+};
+.RE
+.fi
+The structure pointed to by
+\fIsb\fR
+must be initialized with
+\fBzip_stat_init\fR(\fI3\fR)
+before calling
+\fBzip_source_stat\fR().
+.PP
+The
+\fIvalid\fR
+field of the structure specifies which other fields are valid.
+Check if the flag defined by the following defines are in
+\fIvalid\fR
+before accessing the fields:
+.RS 6n
+.PD 0
+.TP 37n
+\fRZIP_SOURCE_STAT_NAME\fR
+\fIname\fR
+.TP 37n
+\fRZIP_SOURCE_STAT_INDEX\fR
+\fIindex\fR
+.TP 37n
+\fRZIP_SOURCE_STAT_SIZE\fR
+\fIsize\fR
+.TP 37n
+\fRZIP_SOURCE_STAT_COMP_SIZE\fR
+\fIcomp_size\fR
+.TP 37n
+\fRZIP_SOURCE_STAT_MTIME\fR
+\fImtime\fR
+.TP 37n
+\fRZIP_SOURCE_STAT_CRC\fR
+\fIcrc\fR
+.TP 37n
+\fRZIP_SOURCE_STAT_COMP_METHOD\fR
+\fIcomp_method\fR
+.TP 37n
+\fRZIP_SOURCE_STAT_ENCRYPTION_METHOD\fR
+\fIencryption_method\fR
+.TP 37n
+\fRZIP_SOURCE_STAT_FLAGS\fR
+\fIflags\fR
+.RE
+.PD
+.PP
+\fINOTE\fR:
+Some fields may only be filled out after all data has been read from
+the source, for example the
+\fIcrc\fR
+or
+\fIsize\fR
+fields.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3)
+.SH "HISTORY"
+\fBzip_source_stat\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index cb68b73..69f4516 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_stat.mdoc -- get information about zip source
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_STAT 3
 .Os
 .Sh NAME
@@ -115,6 +115,9 @@ is set to indicate the error.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_source 3
+.Sh HISTORY
+.Fn zip_source_stat
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_tell.man b/man/zip_source_tell.man
new file mode 100644 (file)
index 0000000..caae69a
--- /dev/null
@@ -0,0 +1,47 @@
+.TH "ZIP_SOURCE_TELL" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_tell\fR
+\- report current read offset in zip source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_tell\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_tell\fR()
+returns the current read offset
+for
+\fIsource\fR.
+The return value can be passed to
+zip_source_seek(3)
+with
+\fIwhence\fR
+set to
+\fRSEEK_SET\fR
+to return to the same location in the source.
+.SH "RETURN VALUES"
+Upon successful completion the current read offset is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_read(3),
+zip_source_tell_write(3)
+.SH "HISTORY"
+\fBzip_source_tell\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index e9f616d..e824918 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_tell.mdoc -- report current read offset in source
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_TELL 3
 .Os
 .Sh NAME
@@ -64,6 +64,9 @@ is set to indicate the error.
 .Xr zip_source 3 ,
 .Xr zip_source_read 3 ,
 .Xr zip_source_tell_write 3
+.Sh HISTORY
+.Fn zip_source_tell
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_tell_write.man b/man/zip_source_tell_write.man
new file mode 100644 (file)
index 0000000..8e72e8f
--- /dev/null
@@ -0,0 +1,50 @@
+.TH "ZIP_SOURCE_TELL_WRITE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_tell_write\fR
+\- report current write offset in zip source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_tell_write\fR(\fIzip_source_t\ *source\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_tell_write\fR()
+returns the current write offset
+for
+\fIsource\fR.
+The return value can be passed to
+zip_source_seek_write(3)
+with
+\fIwhence\fR
+set to
+\fRSEEK_SET\fR
+to return to the same location in the source.
+.SH "RETURN VALUES"
+Upon successful completion the current write offset is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_begin_write(3),
+zip_source_commit_write(3),
+zip_source_rollback_write(3),
+zip_source_tell(3),
+zip_source_write(3)
+.SH "HISTORY"
+\fBzip_source_tell_write\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index be49e5d..00fc3b1 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_tell_write.mdoc -- report current write offset in source
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_TELL_WRITE 3
 .Os
 .Sh NAME
@@ -67,6 +67,9 @@ is set to indicate the error.
 .Xr zip_source_rollback_write 3 ,
 .Xr zip_source_tell 3 ,
 .Xr zip_source_write 3
+.Sh HISTORY
+.Fn zip_source_tell_write
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_win32a.man b/man/zip_source_win32a.man
new file mode 100644 (file)
index 0000000..1188f7c
--- /dev/null
@@ -0,0 +1,95 @@
+.TH "ZIP_SOURCE_WIN32A" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_win32a\fR,
+\fBzip_source_win32a_create\fR
+\- create data source from a Windows ANSI file name
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_win32a\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *fname\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR);
+.PD
+.PP
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_win32a_create\fR(\fIconst\ char\ *fname\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_source_win32a\fR()
+and
+\fBzip_source_win32a_create\fR()
+create a zip source on Windows using a Windows ANSI name.
+They open
+\fIfname\fR
+and read
+\fIlen\fR
+bytes from offset
+\fIstart\fR
+from it.
+If
+\fIlen\fR
+is 0 or \-1, the whole file (starting from
+\fIstart\fR)
+is used.
+.PP
+If the file supports seek, the source can be used to open a zip archive from.
+.PP
+The file is opened and read when the data from the source is used, usually by
+\fBzip_close\fR()
+or
+\fBzip_open_from_source\fR().
+.SH "RETURN VALUES"
+Upon successful completion, the created source is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+or
+\fIerror\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_source_win32a\fR()
+and
+\fBzip_source_win32a_create\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIfname\fR,
+\fIstart\fR,
+or
+\fIlen\fR
+are invalid.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_OPEN\fR]
+Opening
+\fIfname\fR
+failed.
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3),
+zip_replace(3),
+zip_source(3),
+zip_source_win32handle(3),
+zip_source_win32w(3)
+.SH "HISTORY"
+\fBzip_source_win32a\fR()
+and
+\fBzip_source_win32a_create\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index b4e687d..eab4178 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_win32a.mdoc -- create data source using a win32 ANSI name
-.\" Copyright (C) 2015-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2015-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_WIN32A 3
 .Os
 .Sh NAME
@@ -104,6 +104,11 @@ failed.
 .Xr zip_source 3 ,
 .Xr zip_source_win32handle 3 ,
 .Xr zip_source_win32w 3
+.Sh HISTORY
+.Fn zip_source_win32a
+and
+.Fn zip_source_win32a_create
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_win32handle.man b/man/zip_source_win32handle.man
new file mode 100644 (file)
index 0000000..1fb1988
--- /dev/null
@@ -0,0 +1,95 @@
+.TH "ZIP_SOURCE_WIN32HANDLE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_win32handle\fR,
+\fBzip_source_win32handle_create\fR
+\- create data source from a Windows file handle
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_win32handle\fR(\fIzip_t\ *archive\fR, \fIHANDLE\ h\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR);
+.PD
+.PP
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_win32handle_create\fR(\fIHANDLE\ h\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_source_win32handle\fR()
+and
+\fBzip_source_win32handle_create\fR()
+create a zip source from a Windows file handle.
+They open
+\fIfname\fR
+and read
+\fIlen\fR
+bytes from offset
+\fIstart\fR
+from it.
+If
+\fIlen\fR
+is 0 or \-1, the whole file (starting from
+\fIstart\fR)
+is used.
+.PP
+If the file supports seek, the source can be used to open a zip archive from.
+.PP
+The file is opened and read when the data from the source is used, usually by
+\fBzip_close\fR()
+or
+\fBzip_open_from_source\fR().
+.SH "RETURN VALUES"
+Upon successful completion, the created source is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+or
+\fIerror\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_source_w32handle\fR()
+and
+\fBzip_source_w32handle_create\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIfname\fR,
+\fIstart\fR,
+or
+\fIlen\fR
+are invalid.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_OPEN\fR]
+Opening
+\fIfname\fR
+failed.
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3),
+zip_replace(3),
+zip_source(3),
+zip_source_win32a(3),
+zip_source_win32w(3)
+.SH "HISTORY"
+\fBzip_source_win32handle\fR()
+and
+\fBzip_source_win32handle_create\fR()
+were added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 415d994..0b829b5 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_handle.mdoc -- create data source from a Windows file handle
-.\" Copyright (C) 2015-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2015-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_WIN32HANDLE 3
 .Os
 .Sh NAME
@@ -104,6 +104,11 @@ failed.
 .Xr zip_source 3 ,
 .Xr zip_source_win32a 3 ,
 .Xr zip_source_win32w 3
+.Sh HISTORY
+.Fn zip_source_win32handle
+and
+.Fn zip_source_win32handle_create
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_win32w.man b/man/zip_source_win32w.man
new file mode 100644 (file)
index 0000000..c45e439
--- /dev/null
@@ -0,0 +1,93 @@
+.TH "ZIP_SOURCE_WIN32W" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_win32w\fR,
+\fBzip_source_win32w_create\fR
+\- create data source from a Windows Unicode file name
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_win32w\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *fname\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR);
+.PD
+.PP
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_win32w_create\fR(\fIconst\ char\ *fname\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR, \fIzip_error_t\ *error\fR);
+.PD
+.SH "DESCRIPTION"
+The functions
+\fBzip_source_win32w\fR()
+and
+\fBzip_source_win32w_create\fR()
+create a zip source on Windows using a Windows Unicode name.
+They open
+\fIfname\fR
+and read
+\fIlen\fR
+bytes from offset
+\fIstart\fR
+from it.
+If
+\fIlen\fR
+is 0 or \-1, the whole file (starting from
+\fIstart\fR)
+is used.
+.PP
+If the file supports seek, the source can be used to open a zip archive from.
+.PP
+The file is opened and read when the data from the source is used, usually by
+\fBzip_close\fR()
+or
+\fBzip_open_from_source\fR().
+.SH "RETURN VALUES"
+Upon successful completion, the created source is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+or
+\fIerror\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_source_win32w\fR()
+and
+\fBzip_source_win32w_create\fR()
+fail if:
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIfname\fR,
+\fIstart\fR,
+or
+\fIlen\fR
+are invalid.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.TP 19n
+[\fRZIP_ER_OPEN\fR]
+Opening
+\fIfname\fR
+failed.
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3),
+zip_replace(3),
+zip_source(3),
+zip_source_win32a(3),
+zip_source_win32handle(3)
+.SH "HISTORY"
+\fBzip_source_win32w\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index ad8557f..c4b54fc 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_win32w.mdoc -- create data source using a win32 Unicode name
-.\" Copyright (C) 2015-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2015-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_WIN32W 3
 .Os
 .Sh NAME
@@ -104,6 +104,9 @@ failed.
 .Xr zip_source 3 ,
 .Xr zip_source_win32a 3 ,
 .Xr zip_source_win32handle 3
+.Sh HISTORY
+.Fn zip_source_win32w
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_write.man b/man/zip_source_write.man
new file mode 100644 (file)
index 0000000..fd3dc3b
--- /dev/null
@@ -0,0 +1,53 @@
+.TH "ZIP_SOURCE_WRITE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_write\fR
+\- write data to zip source
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_int64_t\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_write\fR(\fIzip_source_t\ *source\fR, \fIconst\ void\ *data\fR, \fIzip_uint64_t\ len\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_write\fR()
+writes
+\fIlen\fR
+bytes from the buffer
+\fIdata\fR
+to the zip source
+\fIsource\fR
+at the current write offset.
+.PP
+The zip source
+\fIsource\fR
+has to be prepared for writing by calling
+zip_source_begin_write(3)
+first.
+.SH "RETURN VALUES"
+Upon successful completion the number of bytes written is returned.
+Otherwise, \-1 is returned and the error information in
+\fIsource\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_source(3),
+zip_source_begin_write(3),
+zip_source_commit_write(3),
+zip_source_rollback_write(3),
+zip_source_seek_write(3),
+zip_source_tell_write(3)
+.SH "HISTORY"
+\fBzip_source_write\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index b7e7962..00836b0 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_write.mdoc -- write data to zip source
-.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 18, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_WRITE 3
 .Os
 .Sh NAME
@@ -70,6 +70,9 @@ is set to indicate the error.
 .Xr zip_source_rollback_write 3 ,
 .Xr zip_source_seek_write 3 ,
 .Xr zip_source_tell_write 3
+.Sh HISTORY
+.Fn zip_source_write
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_source_zip.man b/man/zip_source_zip.man
new file mode 100644 (file)
index 0000000..6a0f0fd
--- /dev/null
@@ -0,0 +1,97 @@
+.TH "ZIP_SOURCE_ZIP" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_source_zip\fR
+\- create data source from zip file
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIzip_source_t *\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_source_zip\fR(\fIzip_t\ *archive\fR, \fIzip_t\ *srcarchive\fR, \fIzip_uint64_t\ srcidx\fR, \fIzip_flags_t\ flags\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR);
+.PD
+.SH "DESCRIPTION"
+The function
+\fBzip_source_zip\fR()
+creates a zip source from a file in a zip archive.
+The
+\fIsrcarchive\fR
+argument is the (open) zip archive containing the source zip file
+at index
+\fIsrcidx\fR.
+\fIlen\fR
+bytes from offset
+\fIstart\fR
+will be used in the zip_source.
+If
+\fIlen\fR
+is 0 or \-1, the rest of the file, starting from
+\fIstart\fR,
+is used.
+If
+\fIstart\fR
+is zero and
+\fIlen\fR
+is \-1, the whole file will be copied without decompressing it.
+.PP
+Supported flags are:
+.TP 23n
+\fRZIP_FL_UNCHANGED\fR
+Try to get the original data without any changes that may have been
+made to
+\fIsrcarchive\fR
+after opening it.
+.TP 23n
+\fRZIP_FL_RECOMPRESS\fR
+When adding the data from
+\fIsrcarchive\fR,
+re-compress it using the current settings instead of copying the
+compressed data.
+.SH "RETURN VALUES"
+Upon successful completion, the created source is returned.
+Otherwise,
+\fRNULL\fR
+is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_source_zip\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_CHANGED\fR]
+Unchanged data was requested, but it is not available.
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIsrcarchive\fR,
+\fIsrcidx\fR,
+\fIstart\fR,
+or
+\fIlen\fR
+are invalid.
+.TP 19n
+[\fRZIP_ER_MEMORY\fR]
+Required memory could not be allocated.
+.PD 0
+.PP
+Additionally, it can return all error codes from
+\fBzip_stat_index\fR()
+and
+\fBzip_fopen_index\fR().
+.PD
+.SH "SEE ALSO"
+libzip(3),
+zip_add(3),
+zip_replace(3),
+zip_source(3)
+.SH "HISTORY"
+\fBzip_source_zip\fR()
+was added in libzip 1.0.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index e332958..9ffd4b7 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_source_zip.mdoc -- create data source from zip file
-.\" Copyright (C) 2004-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 2, 2014
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_ZIP 3
 .Os
 .Sh NAME
@@ -110,6 +110,9 @@ and
 .Xr zip_add 3 ,
 .Xr zip_replace 3 ,
 .Xr zip_source 3
+.Sh HISTORY
+.Fn zip_source_zip
+was added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_stat.man b/man/zip_stat.man
new file mode 100644 (file)
index 0000000..d066e67
--- /dev/null
@@ -0,0 +1,171 @@
+.TH "ZIP_STAT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_stat\fR,
+\fBzip_stat_index\fR
+\- get information about file
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_stat\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *fname\fR, \fIzip_flags_t\ flags\fR, \fIzip_stat_t\ *sb\fR);
+.PD
+.PP
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_stat_index\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_flags_t\ flags\fR, \fIzip_stat_t\ *sb\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_stat\fR()
+function obtains information about the file named
+\fIfname\fR
+in
+\fIarchive\fR.
+The
+\fIflags\fR
+argument specifies how the name lookup should be done.
+Its values are described in
+zip_name_locate(3).
+Also,
+\fRZIP_FL_UNCHANGED\fR
+may be
+\fIor\fR'ed
+to it to request information about the original file in the archive,
+ignoring any changes made.
+.PP
+The
+\fBzip_stat_index\fR()
+function obtains information about the file at position
+\fIindex\fR.
+.PP
+The
+\fIsb\fR
+argument is a pointer to a
+\fIstruct zip_stat\fR
+(shown below), into which information about the file is placed.
+.nf
+.sp
+.RS 0n
+struct zip_stat {
+    zip_uint64_t valid;                 /* which fields have valid values */
+    const char *name;                   /* name of the file */
+    zip_uint64_t index;                 /* index within archive */
+    zip_uint64_t size;                  /* size of file (uncompressed) */
+    zip_uint64_t comp_size;             /* size of file (compressed) */
+    time_t mtime;                       /* modification time */
+    zip_uint32_t crc;                   /* crc of file data */
+    zip_uint16_t comp_method;           /* compression method used */
+    zip_uint16_t encryption_method;     /* encryption method used */
+    zip_uint32_t flags;                 /* reserved for future use */
+};
+.RE
+.fi
+The structure pointed to by
+\fIsb\fR
+must be allocated before calling
+\fBzip_stat\fR()
+or
+\fBzip_stat_index\fR().
+.PP
+The
+\fIvalid\fR
+field of the structure specifies which other fields are valid.
+Check if the flag defined by the following defines are in
+\fIvalid\fR
+before accessing the fields:
+.RS 6n
+.PD 0
+.TP 30n
+\fRZIP_STAT_NAME\fR
+\fIname\fR
+.TP 30n
+\fRZIP_STAT_INDEX\fR
+\fIindex\fR
+.TP 30n
+\fRZIP_STAT_SIZE\fR
+\fIsize\fR
+.TP 30n
+\fRZIP_STAT_COMP_SIZE\fR
+\fIcomp_size\fR
+.TP 30n
+\fRZIP_STAT_MTIME\fR
+\fImtime\fR
+.TP 30n
+\fRZIP_STAT_CRC\fR
+\fIcrc\fR
+.TP 30n
+\fRZIP_STAT_COMP_METHOD\fR
+\fIcomp_method\fR
+.TP 30n
+\fRZIP_STAT_ENCRYPTION_METHOD\fR
+\fIencryption_method\fR
+.TP 30n
+\fRZIP_STAT_FLAGS\fR
+\fIflags\fR
+.RE
+.PD
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error information in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+The function
+\fBzip_stat\fR()
+can fail for any of the errors specified for the routine
+zip_name_locate(3).
+.PP
+The function
+\fBzip_stat_index\fR()
+fails and sets the error information to
+\fRZIP_ER_INVAL\fR
+if
+\fIindex\fR
+is invalid.
+If
+\fRZIP_FL_UNCHANGED\fR
+is not set and no information can be obtained from the source
+callback, the error information is set to
+\fRZIP_ER_CHANGED\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_get_num_entries(3),
+zip_name_locate(3),
+zip_stat_init(3)
+.SH "HISTORY"
+\fBzip_stat\fR()
+was added in libzip 0.6.
+In libzip 0.11 the type of
+\fIflags\fR
+was changed from
+\fIint\fR
+to
+\fIzip_flags_t\fR.
+.PP
+\fBzip_stat_index\fR()
+was added in libzip 0.6.
+In libzip 0.10 the type of
+\fIindex\fR
+was changed from
+\fIint\fR
+to
+\fIzip_uint64_t\fR.
+In libzip 0.11 the type of
+\fIflags\fR
+was changed from
+\fIint\fR
+to
+\fIzip_flags_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 6767816..4d5661e 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_stat.mdoc -- get information about file
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 29, 2016
+.Dd December 18, 2017
 .Dt ZIP_STAT 3
 .Os
 .Sh NAME
@@ -148,6 +148,30 @@ callback, the error information is set to
 .Xr zip_get_num_entries 3 ,
 .Xr zip_name_locate 3 ,
 .Xr zip_stat_init 3
+.Sh HISTORY
+.Fn zip_stat
+was added in libzip 0.6.
+In libzip 0.11 the type of
+.Ar flags
+was changed from
+.Vt int
+to
+.Vt zip_flags_t .
+.Pp
+.Fn zip_stat_index
+was added in libzip 0.6.
+In libzip 0.10 the type of
+.Ar index
+was changed from
+.Vt int
+to
+.Vt zip_uint64_t .
+In libzip 0.11 the type of
+.Ar flags
+was changed from
+.Vt int
+to
+.Vt zip_flags_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_stat_init.man b/man/zip_stat_init.man
new file mode 100644 (file)
index 0000000..463f917
--- /dev/null
@@ -0,0 +1,49 @@
+.TH "ZIP_STAT_INIT" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_stat_init\fR
+\- initialize zip_stat structure
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIvoid\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_stat_init\fR(\fIzip_stat_t\ *sb\fR);
+.PD
+.SH "DESCRIPTION"
+The
+\fBzip_stat_init\fR()
+function initializes the members of a struct zip_stat.
+The current members are described in
+zip_stat(3),
+but this function should be used to initialize it to
+make sure none are missed.
+The structure pointed to by
+\fIsb\fR
+must be allocated before calling
+\fBzip_stat_init\fR().
+.PP
+This function should be used by functions provided to
+zip_source_function(3)
+when returning
+\fRZIP_SOURCE_STAT\fR
+information to make sure all fields are initialized.
+.SH "RETURN VALUES"
+If
+\fIsb\fR
+is valid, the function is always successful.
+.SH "SEE ALSO"
+libzip(3),
+zip_stat(3)
+.SH "HISTORY"
+\fBzip_stat_init\fR()
+was added in libzip 0.8.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 3fe8a93..0d464a6 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_stat_init.mdoc -- init zip_stat structure
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 22, 2013
+.Dd December 18, 2017
 .Dt ZIP_STAT_INIT 3
 .Os
 .Sh NAME
@@ -66,6 +66,9 @@ is valid, the function is always successful.
 .Sh SEE ALSO
 .Xr libzip 3 ,
 .Xr zip_stat 3
+.Sh HISTORY
+.Fn zip_stat_init
+was added in libzip 0.8.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_unchange.man b/man/zip_unchange.man
new file mode 100644 (file)
index 0000000..ee34ffe
--- /dev/null
@@ -0,0 +1,54 @@
+.TH "ZIP_UNCHANGE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_unchange\fR
+\- undo changes to file in zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_unchange\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR);
+.PD
+.SH "DESCRIPTION"
+Changes to the file at position
+\fIindex\fR
+are reverted.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "ERRORS"
+\fBzip_unchange\fR()
+fails if:
+.TP 19n
+[\fRZIP_ER_EXISTS\fR]
+Unchanging the name would result in a duplicate name in the archive.
+.TP 19n
+[\fRZIP_ER_INVAL\fR]
+\fIindex\fR
+is not a valid file index in
+\fIzip\fR.
+.SH "SEE ALSO"
+libzip(3),
+zip_unchange_all(3),
+zip_unchange_archive(3)
+.SH "HISTORY"
+\fBzip_unchange\fR()
+was added in libzip 0.6.
+In libzip 0.10 the type of
+\fIindex\fR
+was changed from
+\fIint\fR
+to
+\fIzip_uint64_t\fR.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index ffa7e1c..6bde36b 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_unchange.mdoc -- undo changes to file in zip archive
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 23, 2006
+.Dd December 18, 2017
 .Dt ZIP_UNCHANGE 3
 .Os
 .Sh NAME
@@ -65,6 +65,15 @@ is not a valid file index in
 .Xr libzip 3 ,
 .Xr zip_unchange_all 3 ,
 .Xr zip_unchange_archive 3
+.Sh HISTORY
+.Fn zip_unchange
+was added in libzip 0.6.
+In libzip 0.10 the type of
+.Ar index
+was changed from
+.Vt int
+to
+.Vt zip_uint64_t .
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_unchange_all.man b/man/zip_unchange_all.man
new file mode 100644 (file)
index 0000000..455c28f
--- /dev/null
@@ -0,0 +1,37 @@
+.TH "ZIP_UNCHANGE_ALL" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_unchange_all\fR
+\- undo all changes in a zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_unchange_all\fR(\fIzip_t\ *archive\fR);
+.PD
+.SH "DESCRIPTION"
+All changes to files and global information in
+\fIarchive\fR
+are reverted.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_unchange(3),
+zip_unchange_archive(3)
+.SH "HISTORY"
+\fBzip_unchange_all\fR()
+was added in libzip 0.6.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 9f6b3f8..b676eb5 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_unchange_all.mdoc -- undo changes to all files in zip archive
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 23, 2006
+.Dd December 18, 2017
 .Dt ZIP_UNCHANGE_ALL 3
 .Os
 .Sh NAME
@@ -54,6 +54,9 @@ is set to indicate the error.
 .Xr libzip 3 ,
 .Xr zip_unchange 3 ,
 .Xr zip_unchange_archive 3
+.Sh HISTORY
+.Fn zip_unchange_all
+was added in libzip 0.6.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zip_unchange_archive.man b/man/zip_unchange_archive.man
new file mode 100644 (file)
index 0000000..bf94723
--- /dev/null
@@ -0,0 +1,37 @@
+.TH "ZIP_UNCHANGE_ARCHIVE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzip_unchange_archive\fR
+\- undo global changes to zip archive
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+\fB#include <zip.h>\fR
+.sp
+\fIint\fR
+.br
+.PD 0
+.HP 4n
+\fBzip_unchange_archive\fR(\fIzip_t\ *archive\fR);
+.PD
+.SH "DESCRIPTION"
+Revert all global changes to the archive
+\fIarchive\fR.
+This reverts changes to the archive comment and global flags.
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Otherwise, \-1 is returned and the error code in
+\fIarchive\fR
+is set to indicate the error.
+.SH "SEE ALSO"
+libzip(3),
+zip_unchange(3),
+zip_unchange_all(3)
+.SH "HISTORY"
+\fBzip_unchange_archive\fR()
+was added in libzip 0.7.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index b306b2c..b3b3d3f 100644 (file)
@@ -1,5 +1,5 @@
 .\" zip_unchange_archive.mdoc -- undo changes to all files in zip archive
-.\" Copyright (C) 2006-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 14, 2008
+.Dd December 18, 2017
 .Dt ZIP_UNCHANGE_ARCHIVE 3
 .Os
 .Sh NAME
@@ -54,6 +54,9 @@ is set to indicate the error.
 .Xr libzip 3 ,
 .Xr zip_unchange 3 ,
 .Xr zip_unchange_all 3
+.Sh HISTORY
+.Fn zip_unchange_archive
+was added in libzip 0.7.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zipcmp.man b/man/zipcmp.man
new file mode 100644 (file)
index 0000000..712132c
--- /dev/null
@@ -0,0 +1,64 @@
+.TH "ZIPCMP" "1" "December 18, 2017" "NiH" "General Commands Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzipcmp\fR
+\- compare contents of zip archives
+.SH "SYNOPSIS"
+.HP 7n
+\fBzipcmp\fR
+[\fB\-hipqtVv\fR]
+\fIarchive1\ archive2\fR
+.SH "DESCRIPTION"
+\fBzipcmp\fR
+compares the zip archives or directories
+\fIarchive1\fR
+and
+\fIarchive2\fR
+and checks if they contain the same files, comparing their names,
+uncompressed sizes, and CRCs.
+File order and compressed size differences are ignored.
+.PP
+Supported options:
+.TP 5n
+\fB\-h\fR
+Display a short help message and exit.
+.TP 5n
+\fB\-i\fR
+Compare names ignoring case distinctions.
+.TP 5n
+\fB\-p\fR
+Enable paranoid checks.
+Compares extra fields and other meta data.
+(Automatically disabled if one of the archives is a directory.)
+.TP 5n
+\fB\-q\fR
+Quiet mode.
+Compare
+\fB\-v\fR.
+.TP 5n
+\fB\-t\fR
+Test zip files by comparing the contents to their checksums.
+.TP 5n
+\fB\-V\fR
+Display version information and exit.
+.TP 5n
+\fB\-v\fR
+Verbose mode.
+Print details about differences to stdout.
+(This is the default.)
+.SH "EXIT STATUS"
+\fBzipcmp\fR
+exits 0 if the two archives contain the same files, 1 if they differ,
+and >1 if an error occurred.
+.SH "SEE ALSO"
+zipmerge(1),
+ziptool(1),
+libzip(3)
+.SH "HISTORY"
+\fBzipcmp\fR
+was added in libzip 0.6.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index c22bff3..464d191 100644 (file)
@@ -1,5 +1,5 @@
 .\" zipcmp.mdoc -- compare zip archives
-.\" Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 19, 2016
+.Dd December 18, 2017
 .Dt ZIPCMP 1
 .Os
 .Sh NAME
@@ -80,6 +80,9 @@ and \*[Gt]1 if an error occurred.
 .Xr zipmerge 1 ,
 .Xr ziptool 1 ,
 .Xr libzip 3
+.Sh HISTORY
+.Nm
+was added in libzip 0.6.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/zipmerge.man b/man/zipmerge.man
new file mode 100644 (file)
index 0000000..b75f1f4
--- /dev/null
@@ -0,0 +1,65 @@
+.TH "ZIPMERGE" "1" "December 18, 2017" "NiH" "General Commands Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBzipmerge\fR
+\- merge zip archives
+.SH "SYNOPSIS"
+.HP 9n
+\fBzipmerge\fR
+[\fB\-DhIiSsV\fR]
+\fItarget-zip\fR
+\fIsource-zip\fR\ [\fIsource-zip\ ...\fR]
+.SH "DESCRIPTION"
+\fBzipmerge\fR
+merges the source zip archives
+\fIsource-zip\fR
+into the target zip archive
+\fItarget-zip\fR.
+By default, files in the source zip archives overwrite
+existing files of the same name in the target zip archive.
+.PP
+Supported options:
+.TP 5n
+\fB\-D\fR
+Ignore directory components in file name comparisons.
+This option is slow for archives with many files.
+.TP 5n
+\fB\-h\fR
+Display a short help message and exit.
+.TP 5n
+\fB\-I\fR
+Ignore case in file name comparisons
+This option is slow for archives with many files.
+.TP 5n
+\fB\-i\fR
+Ask before overwriting files.
+See also
+\fB\-s\fR.
+.TP 5n
+\fB\-S\fR
+Do not overwrite files that have the same size and
+CRC32 in both the source and target archives.
+.TP 5n
+\fB\-s\fR
+When
+\fB\-i\fR
+is given, do not before overwriting files that have the same size
+and CRC32.
+.TP 5n
+\fB\-V\fR
+Display version information and exit.
+.SH "EXIT STATUS"
+\fBzipmerge\fR
+exits 0 on success and >1 if an error occurred.
+.SH "SEE ALSO"
+zipcmp(1),
+ziptool(1),
+libzip(3)
+.SH "HISTORY"
+\fBzipmerge\fR
+was added in libzip 0.6.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 4408655..4c8a1dd 100644 (file)
@@ -1,5 +1,5 @@
 .\" zipmerge.mdoc -- merge zip archives
-.\" Copyright (C) 2004-2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 25, 2017
+.Dd December 18, 2017
 .Dt ZIPMERGE 1
 .Os
 .Sh NAME
@@ -81,6 +81,9 @@ exits 0 on success and \*[Gt]1 if an error occurred.
 .Xr zipcmp 1 ,
 .Xr ziptool 1 ,
 .Xr libzip 3
+.Sh HISTORY
+.Nm
+was added in libzip 0.6.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
diff --git a/man/ziptool.man b/man/ziptool.man
new file mode 100644 (file)
index 0000000..0037dd7
--- /dev/null
@@ -0,0 +1,357 @@
+.TH "ZIPTOOL" "1" "December 18, 2017" "NiH" "General Commands Manual"
+.nh
+.if n .ad l
+.SH "NAME"
+\fBziptool\fR
+\- modify zip archives
+.SH "SYNOPSIS"
+.HP 8n
+\fBziptool\fR
+[\fB\-ceghnrst\fR]
+[\fB\-l\fR\ \fIlength\fR]
+[\fB\-o\fR\ \fIoffset\fR]
+\fIzip-archive\fR
+\fBcommand\fR\ [\fIcommand-args\ ...\fR]
+[\fBcommand\fR\ [\fIcommand-args\ ...\fR]\ ...]
+.SH "DESCRIPTION"
+\fBziptool\fR
+modifies the zip archive
+\fIzip-archive\fR
+according to the
+\fIcommands\fR
+given.
+.PP
+Supported options:
+.TP 13n
+\fB\-c\fR
+Check zip archive consistency when opening it.
+.TP 13n
+\fB\-e\fR
+Error if archive already exists (only useful with
+\fB\-n\fR).
+.TP 13n
+\fB\-g\fR
+Guess file name encoding (for
+\fBstat\fR
+command).
+.TP 13n
+\fB\-h\fR
+Display help.
+.TP 13n
+\fB\-l\fR \fIlength\fR
+Only read
+\fIlength\fR
+bytes of archive.
+See also
+\fB\-o\fR.
+.TP 13n
+\fB\-n\fR
+Create archive if it doesn't exist.
+See also
+\fB\-e\fR.
+.TP 13n
+\fB\-o\fR \fIoffset\fR
+Start reading input archive from
+\fIoffset\fR.
+See also
+\fB\-l\fR.
+.TP 13n
+\fB\-r\fR
+Print raw file name encoding without translation (for
+\fBstat\fR
+command).
+.TP 13n
+\fB\-s\fR
+Follow file name convention strictly (for
+\fBstat\fR
+command).
+.TP 13n
+\fB\-t\fR
+Disregard current file contents, if any.
+\fINote\fR:
+use this with care, it deletes all existing file contents when
+you modify the archive.
+.SS "Commands"
+For all commands below, the index is zero-based.
+In other words, the first entry in the zip archive has index 0.
+.PP
+Supported commands and arguments are:
+.TP 12n
+\fBadd\fR \fIname content\fR
+Add file called
+\fIname\fR
+using the string
+\fIcontent\fR
+from the command line as data.
+.TP 12n
+\fBadd_dir\fR \fIname\fR
+Add directory
+\fIname\fR.
+.TP 12n
+\fBadd_file\fR \fIname file_to_add offset len\fR
+Add file
+\fIname\fR
+to archive, using
+\fIlen\fR
+bytes from the file
+\fIfile_to_add\fR
+as input data, starting at
+\fIoffset\fR.
+.TP 12n
+\fBadd_from_zip\fR \fIname archivename index offset len\fR
+Add file called
+\fIname\fR
+to archive using data from another zip archive
+\fIarchivename\fR
+using the entry with index
+\fIindex\fR
+and reading
+\fIlen\fR
+bytes from
+\fIoffset\fR.
+.TP 12n
+\fBcat\fR \fIindex\fR
+Output file contents for entry
+\fIindex\fR
+to stdout.
+.TP 12n
+\fBcount_extra\fR \fIindex flags\fR
+Print the number of extra fields for archive entry
+\fIindex\fR
+using
+\fIflags\fR.
+.TP 12n
+\fBcount_extra_by_id\fR \fIindex extra_id flags\fR
+Print number of extra fields of type
+\fIextra_id\fR
+for archive entry
+\fIindex\fR
+using
+\fIflags\fR.
+.TP 12n
+\fBdelete\fR \fIindex\fR
+Remove entry at
+\fIindex\fR
+from zip archive.
+.TP 12n
+\fBdelete_extra\fR \fIindex extra_idx flags\fR
+Remove extra field number
+\fIextra_idx\fR
+from archive entry
+\fIindex\fR
+using
+\fIflags\fR.
+.TP 12n
+\fBdelete_extra_by_id\fR \fIindex extra_id extra_index flags\fR
+Remove extra field number
+\fIextra_index\fR
+of type
+\fIextra_id\fR
+from archive entry
+\fIindex\fR
+using
+\fIflags\fR.
+.TP 12n
+\fBget_archive_comment\fR
+Print archive comment.
+.TP 12n
+\fBget_extra\fR \fIindex extra_index flags\fR
+Print extra field
+\fIextra_index\fR
+for archive entry
+\fIindex\fR
+using
+\fIflags\fR.
+.TP 12n
+\fBget_extra_by_id\fR \fIindex extra_id extra_index flags\fR
+Print extra field
+\fIextra_index\fR
+of type
+\fIextra_id\fR
+for archive entry
+\fIindex\fR
+using
+\fIflags\fR.
+.TP 12n
+\fBget_file_comment\fR \fIindex\fR
+Get file comment for archive entry
+\fIindex\fR.
+.TP 12n
+\fBget_num_entries\fR \fIflags\fR
+Print number of entries in archive using
+\fIflags\fR.
+.TP 12n
+\fBname_locate\fR \fIname flags\fR
+Find entry in archive with the filename
+\fIname\fR
+using
+\fIflags\fR
+and print its index.
+.TP 12n
+\fBrename\fR \fIindex name\fR
+Rename archive entry
+\fIindex\fR
+to
+\fIname\fR.
+.TP 12n
+\fBreplace_file_contents\fR \fIindex data\fR
+Replace file contents for archive entry
+\fIindex\fR
+with the string
+\fIdata\fR.
+.TP 12n
+\fBset_archive_comment\fR \fIcomment\fR
+Set archive comment to
+\fIcomment\fR.
+.TP 12n
+\fBset_extra\fR \fIindex extra_id extra_index flags value\fR
+Set extra field number
+\fIextra_index\fR
+of type
+\fIextra_id\fR
+for archive entry
+\fIindex\fR
+using
+\fIflags\fR
+to
+\fIvalue\fR.
+.TP 12n
+\fBset_file_comment\fR \fIindex comment\fR
+Set file comment for archive entry
+\fIindex\fR
+to string
+\fIcomment\fR.
+.TP 12n
+\fBset_file_compression\fR \fIindex method compression_flags\fR
+Set file compression method for archive entry
+\fIindex\fR
+to
+\fImethod\fR
+using
+\fIcompression_flags\fR.
+\fINote\fR:
+Currently,
+\fIcompression_flags\fR
+are ignored.
+.TP 12n
+\fBset_file_encryption\fR \fIindex method password\fR
+Set file encryption method for archive entry
+\fIindex\fR
+to
+\fImethod\fR
+with password
+\fIpassword\fR.
+.TP 12n
+\fBset_file_mtime\fR \fIindex timestamp\fR
+Set file modification time for archive entry
+\fIindex\fR
+to UNIX mtime
+\fItimestamp\fR.
+.TP 12n
+\fBset_file_mtime_all\fR \fItimestamp\fR
+Set file modification time for all archive entries to UNIX mtime
+\fItimestamp\fR.
+.TP 12n
+\fBset_password\fR \fIpassword\fR
+Set default password for encryption/decryption to
+\fIpassword\fR.
+.TP 12n
+\fBstat\fR \fIindex\fR
+Print information about archive entry
+\fIindex\fR.
+.SS "Flags"
+Some commands take flag arguments.
+Supported flags are:
+.RS 6n
+.PD 0
+.TP 5n
+\fIC\fR
+\fRZIP_FL_NOCASE\fR
+.TP 5n
+\fIc\fR
+\fRZIP_FL_CENTRAL\fR
+.TP 5n
+\fId\fR
+\fRZIP_FL_NODIR\fR
+.TP 5n
+\fIl\fR
+\fRZIP_FL_LOCAL\fR
+.TP 5n
+\fIu\fR
+\fRZIP_FL_UNCHANGED\fR
+.RE
+.PD
+.SS "Compression Methods"
+Some commands take compression method arguments.
+Supported methods are:
+.RS 6n
+.PD 0
+.TP 4n
+\fB\(bu\fR
+\fRdefault\fR
+.TP 4n
+\fB\(bu\fR
+\fRdeflate\fR
+.TP 4n
+\fB\(bu\fR
+\fRstore\fR
+.RE
+.PD
+.SS "Encryption Methods"
+Some commands take encryption method arguments.
+Supported methods are:
+.RS 6n
+.PD 0
+.TP 4n
+\fB\(bu\fR
+\fRnone\fR
+.TP 4n
+\fB\(bu\fR
+\fRAES-128\fR
+.TP 4n
+\fB\(bu\fR
+\fRAES-192\fR
+.TP 4n
+\fB\(bu\fR
+\fRAES-256\fR
+.RE
+.PD
+.SH "EXIT STATUS"
+.br
+The \fBziptool\fR utility exits\~0 on success, and\~>0 if an error occurs.
+.SH "EXAMPLES"
+Add a file called
+\fIteststring.txt\fR
+to the zip archive
+\fItestbuffer.zip\fR
+with data
+\(LqThis is a test.\en\(Rq
+where
+\(Lq\en\(Rq
+is replaced with a newline character:
+.nf
+.sp
+.RS 6n
+ziptool testbuffer.zip add teststring.txt \\"This is a test.\en\\"
+.RE
+.fi
+.PP
+Delete the first file from the zip archive
+\fItestfile.zip\fR:
+.nf
+.sp
+.RS 6n
+ziptool testfile.zip delete 0
+.RE
+.fi
+.SH "SEE ALSO"
+zipcmp(1),
+zipmerge(1),
+libzip(3)
+.SH "HISTORY"
+\fBziptool\fR
+was added in libzip 1.1.
+.SH "AUTHORS"
+Dieter Baron <\fIdillo@nih.at\fR>
+and
+Thomas Klausner <\fItk@giga.or.at\fR>
index 4eca252..751eeb0 100644 (file)
@@ -1,5 +1,5 @@
 .\" ziptool.mdoc -- modify zip archives in multiple ways
-.\" Copyright (C) 2016 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner
 .\"
 .\" This file is part of libzip, a library to manipulate ZIP archives.
 .\" The authors can be contacted at <libzip@nih.at>
@@ -29,7 +29,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 16, 2016
+.Dd December 18, 2017
 .Dt ZIPTOOL 1
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd modify zip archives
 .Sh SYNOPSIS
 .Nm
-.Op Fl cegHhmnrst
+.Op Fl ceghnrst
 .Op Fl l Ar length
 .Op Fl o Ar offset
 .Ar zip-archive
@@ -62,16 +62,6 @@ Error if archive already exists (only useful with
 Guess file name encoding (for
 .Cm stat
 command).
-.It Fl H
-Write files with
-.Dq holes
-compactly.
-In other words, when the modified zip archive contains long runs of zeroes,
-write a basic run-length encoded block instead.
-.Em Note :
-This command is for internal testing of
-.Xr libzip 3
-and will usually create invalid zip archives.
 .It Fl h
 Display help.
 .It Fl l Ar length
@@ -80,11 +70,6 @@ Only read
 bytes of archive.
 See also
 .Fl o .
-.It Fl m
-Read archive into memory, and modify there; write out at end.
-.Em Note :
-This command is for internal testing of
-.Xr libzip 3 .
 .It Fl n
 Create archive if it doesn't exist.
 See also
@@ -143,13 +128,6 @@ and reading
 .Ar len
 bytes from
 .Ar offset .
-.It Cm add_nul Ar name length
-Add a file
-.Ar name
-consisting of
-.Ar length
-NUL bytes.
-(Mostly useful for testing.)
 .It Cm cat Ar index
 Output file contents for entry
 .Ar index
@@ -277,13 +255,6 @@ Set default password for encryption/decryption to
 .It Cm stat Ar index
 Print information about archive entry
 .Ar index .
-.It Cm unchange_all
-Revert all changes up to that point.
-Mostly useful for testing.
-.It Cm zin_close Ar index
-Close input zip_source
-.Ar index .
-For internal tests only.
 .El
 .Ss Flags
 Some commands take flag arguments.
@@ -349,6 +320,9 @@ ziptool testfile.zip delete 0
 .Xr zipcmp 1 ,
 .Xr zipmerge 1 ,
 .Xr libzip 3
+.Sh HISTORY
+.Nm
+was added in libzip 1.1.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at
index e0c6858..e2ce232 100644 (file)
@@ -1,11 +1,9 @@
-ENABLE_TESTING()
-
 CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
 IF(NOT HAVE_GETOPT)
   SET(SRC_EXTRA_FILES ../src/getopt.c)
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/../src)
-ENDIF(NOT HAVE_GETOPT)
+ENDIF()
 
 SET(TEST_PROGRAMS
   add_from_filep
@@ -19,6 +17,62 @@ SET(GETOPT_USERS
   tryopen
 )
 
+ADD_EXECUTABLE(can_clone_file can_clone_file.c)
+
+SET(ENV{srcdir} ${CMAKE_CURRENT_SOURCE_DIR})
+FOREACH(PROGRAM ${TEST_PROGRAMS})
+  ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}.c)
+  TARGET_LINK_LIBRARIES(${PROGRAM} zip)
+ENDFOREACH()
+
+ADD_EXECUTABLE(hole hole.c ${SRC_EXTRA_FILES} source_hole.c)
+TARGET_LINK_LIBRARIES(hole zip)
+
+ADD_EXECUTABLE(ziptool_regress ziptool_regress.c ${SRC_EXTRA_FILES} source_hole.c)
+TARGET_LINK_LIBRARIES(ziptool_regress zip)
+
+ADD_LIBRARY(malloc MODULE malloc.c)
+TARGET_LINK_LIBRARIES(malloc ${CMAKE_DL_LIBS})
+ADD_LIBRARY(nonrandomopen MODULE nonrandomopen.c)
+TARGET_LINK_LIBRARIES(nonrandomopen ${CMAKE_DL_LIBS})
+
+FOREACH(PROGRAM ${GETOPT_USERS})
+  ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}.c ${SRC_EXTRA_FILES})
+  TARGET_LINK_LIBRARIES(${PROGRAM} zip)
+ENDFOREACH()
+
+# for appveyor builds
+#SET(CMAKE_MSVCIDE_RUN_PATH C:/projects/libzip/vstudio/zlib/installed/bin;C:/projects/libzip/vstudio/zlib/installed/lib;C:/projects/libzip/build/lib/Release)
+
+ADD_CUSTOM_TARGET(cleanup
+    COMMAND ${CMAKE_COMMAND} -DDIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/cleanup.cmake
+    )
+
+ADD_CUSTOM_TARGET(testinput
+  ALL
+  VERBATIM
+  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 0 > manyfiles.zip
+  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 1 > manyfiles-133000.zip
+  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 2 > manyfiles-65536.zip
+  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 3 > manyfiles-zip64-modulo.zip
+  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 4 > manyfiles-zip64.zip
+  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 5 > manyfiles-fewer.zip
+  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 6 > manyfiles-more.zip
+  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/bigzero-zip.zip cat 0 > bigzero.zip
+  DEPENDS ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip ${CMAKE_CURRENT_SOURCE_DIR}/bigzero-zip.zip
+)
+
+SET_PROPERTY(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
+  bigzero.zip
+  manyfiles-133000.zip
+  manyfiles-65536.zip
+  manyfiles-fewer.zip
+  manyfiles-more.zip
+  manyfiles-zip64-modulo.zip
+  manyfiles-zip64.zip
+  manyfiles.zip
+)
+
 SET(EXTRA_TESTS
        add_dir.test
        add_from_buffer.test
@@ -35,6 +89,14 @@ SET(EXTRA_TESTS
        add_from_zip_stored.test
        add_stored.test
        add_stored_in_memory.test
+       buffer-fragment-read.test
+       buffer-fragment-write.test
+        clone-buffer-add.test
+        clone-buffer-delete.test
+        clone-buffer-replace.test
+        clone-fs-add.test
+        clone-fs-delete.test
+        clone-fs-replace.test
        cm-default.test
        count_entries.test
        decrypt-correct-password-aes128.test
@@ -53,10 +115,9 @@ SET(EXTRA_TESTS
        delete_multiple_partial.test
        delete_renamed_rename.test
        encrypt.test
-# TODO: the tests need nonrandomopen.so, which is not hooked into the CMake build
-#      encryption-nonrandom-aes128.test
-#      encryption-nonrandom-aes192.test
-#      encryption-nonrandom-aes256.test
+       encryption-nonrandom-aes128.test
+       encryption-nonrandom-aes192.test
+       encryption-nonrandom-aes256.test
        encryption-remove.test
        extra_add.test
        extra_add_multiple.test
@@ -143,49 +204,13 @@ SET(EXTRA_TESTS
        zip64_stored_creation.test
 )
 
-SET(ENV{srcdir} ${CMAKE_CURRENT_SOURCE_DIR})
-FOREACH(PROGRAM ${TEST_PROGRAMS})
-  ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}.c)
-  TARGET_LINK_LIBRARIES(${PROGRAM} zip)
-ENDFOREACH(PROGRAM ${STANDALONE_TEST_PROGRAMS})
-
-FOREACH(PROGRAM ${GETOPT_USERS})
-  ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}.c ${SRC_EXTRA_FILES})
-  TARGET_LINK_LIBRARIES(${PROGRAM} zip)
-ENDFOREACH(PROGRAM ${GETOPT_USERS})
-
-# for appveyor builds
-#SET(CMAKE_MSVCIDE_RUN_PATH C:/projects/libzip/vstudio/zlib/installed/bin;C:/projects/libzip/vstudio/zlib/installed/lib;C:/projects/libzip/build/lib/Release)
-
-ADD_CUSTOM_TARGET(
-  testinput
-  # ALL
-  VERBATIM
-  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 0 > manyfiles.zip
-  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 1 > manyfiles-133000.zip
-  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 2 > manyfiles-65536.zip
-  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 3 > manyfiles-zip64-modulo.zip
-  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 4 > manyfiles-zip64.zip
-  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 5 > manyfiles-fewer.zip
-  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip cat 6 > manyfiles-more.zip
-  COMMAND ziptool ${CMAKE_CURRENT_SOURCE_DIR}/bigzero-zip.zip cat 0 > bigzero.zip
-  DEPENDS ziptool ${CMAKE_CURRENT_SOURCE_DIR}/manyfiles-zip.zip ${CMAKE_CURRENT_SOURCE_DIR}/bigzero-zip.zip
-)
-SET_PROPERTY(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
-  bigzero.zip
-  manyfiles-133000.zip
-  manyfiles-65536.zip
-  manyfiles-fewer.zip
-  manyfiles-more.zip
-  manyfiles-zip64-modulo.zip
-  manyfiles-zip64.zip
-  manyfiles.zip
-)
-
 FOREACH(CASE ${EXTRA_TESTS})
   ADD_TEST(${CASE} perl ${CMAKE_BINARY_DIR}/regress/runtest ${CMAKE_CURRENT_SOURCE_DIR}/${CASE})
-ENDFOREACH(CASE ${EXTRA_TESTS})
+  SET_TESTS_PROPERTIES(${CASE} PROPERTIES SKIP_RETURN_CODE 77)
+ENDFOREACH()
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../lib
        ${CMAKE_CURRENT_SOURCE_DIR}/../src
        ${CMAKE_CURRENT_BINARY_DIR}/..)
+
+ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
diff --git a/regress/Makefile.am b/regress/Makefile.am
deleted file mode 100644 (file)
index f3a9861..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-AUTOMAKE_OPTIONS=      parallel-tests
-
-noinst_SCRIPTS=                runtest
-
-noinst_PROGRAMS= \
-       add_from_filep \
-       fopen_unchanged \
-       fread \
-       fseek \
-       nonrandomopentest \
-       tryopen
-
-if !WIN32_HOST
-pkglib_LTLIBRARIES=    malloc.la nonrandomopen.la
-
-malloc_la_SOURCES=     malloc.c
-malloc_la_LDFLAGS=     -module -avoid-version
-malloc_la_LIBADD=      ${DLSYM_LIB}
-
-nonrandomopen_la_SOURCES=      nonrandomopen.c
-nonrandomopen_la_LDFLAGS=      -module -avoid-version
-nonrandomopen_la_LIBADD=       ${DLSYM_LIB}
-
-# we have to do it this way, because if we choose noinst_LTLIBRARIES,
-# only the .a files are built
-install-pkglibLTLIBRARIES:
-       @echo not installing shared objects needed only for testing
-endif
-
-EXTRA_DIST= \
-       CMakeLists.txt \
-       NiHTest.pm \
-       runtest.in \
-       ${TESTS} \
-       bigstored.zh \
-       bigzero-zip.zip \
-       bogus.zip \
-       broken.zip \
-       cm-default.zip \
-       encrypt-aes128-noentropy.zip \
-       encrypt-aes192-noentropy.zip \
-       encrypt-aes256-noentropy.zip \
-       encrypt-aes128.zip \
-       encrypt-aes192.zip \
-       encrypt-aes256.zip \
-       encrypt-none.zip \
-       encrypt.zip \
-       encrypt_plus_extra.zip \
-       encrypt_plus_extra_modified_c.zip \
-       encrypt_plus_extra_modified_l.zip \
-       extra_field_align_1-0.zip \
-       extra_field_align_1-ff.zip \
-       extra_field_align_2-0.zip \
-       extra_field_align_2-ff.zip \
-       extra_field_align_3-0.zip \
-       extra_field_align_3-ff.zip \
-       extra_field_align_4-ff.zip \
-       extra_field_align_1-ef_00.zip \
-       extra_field_align_1-ef_ff.zip \
-       extra_field_align_2-ef_00.zip \
-       extra_field_align_2-ef_ff.zip \
-       extra_field_align_3-ef_00.zip \
-       extra_field_align_3-ef_ff.zip \
-       filename_duplicate.zip \
-       filename_duplicate_empty.zip \
-       filename_empty.zip \
-       fileorder.zip \
-       firstsecond.zip \
-       firstsecond-split-deflated.zip \
-       firstsecond-split-stored.zip \
-       foo-stored.zip \
-       incons-archive-comment-longer.zip \
-       incons-archive-comment-shorter.zip \
-       incons-cdoffset.zip \
-       incons-central-compression-method.zip \
-       incons-central-compsize-larger-toolarge.zip \
-       incons-central-compsize-larger.zip \
-       incons-central-compsize-smaller.zip \
-       incons-central-crc.zip \
-       incons-central-date.zip \
-       incons-central-file-comment-longer.zip \
-       incons-central-file-comment-shorter.zip \
-       incons-central-magic-bad.zip \
-       incons-central-magic-bad2.zip \
-       incons-central-size-larger.zip \
-       incons-data.zip \
-       incons-ef-central-size-wrong.zip \
-       incons-ef-local-id-size.zip \
-       incons-ef-local-id.zip \
-       incons-ef-local-size.zip \
-       incons-eocd-magic-bad.zip \
-       incons-file-count-high.zip \
-       incons-file-count-low.zip \
-       incons-file-count-overflow.zip \
-       incons-local-compression-method.zip \
-       incons-local-compsize-larger.zip \
-       incons-local-compsize-smaller.zip \
-       incons-local-crc.zip \
-       incons-local-filename-long.zip \
-       incons-local-filename-missing.zip \
-       incons-local-filename-short.zip \
-       incons-local-filename.zip \
-       incons-local-magic-bad.zip \
-       incons-local-size-larger.zip \
-       junk-at-end.zip \
-       junk-at-start.zip \
-       large-uncompressable \
-       manyfiles-zip.zip \
-       multidisk.zip \
-       rename_ok.zip \
-       streamed.zip \
-       streamed-zip64.zip \
-       test.zip \
-       test2.zip \
-       test-cp437.zip \
-       test-cp437-comment-utf-8.zip \
-       test-cp437-fc.zip \
-       test-cp437-fc-utf-8-filename.zip \
-       test-utf8.zip \
-       test-utf8-unmarked.zip \
-       testbuffer.zip \
-       testbzip2.zip \
-       testdir.zip \
-       testchanged.zip \
-       testchangedlocal.zip \
-       testcomment.zip \
-       testcomment13.zip \
-       testcommentremoved.zip \
-       testdeflated.zip \
-       testdeflated2.zip \
-       testempty.zip \
-       testextrabytes.zip \
-       testfile.txt \
-       testfile.zip \
-       testfile-cp437.zip \
-       testfile-plus-extra.zip \
-       testfile-UTF8.zip \
-       testfile2014.zip \
-       teststdin.zip \
-       teststored.zip \
-       utf-8-standardization-input.zip \
-       utf-8-standardization-output.zip \
-       zip-in-archive-comment.zip \
-       zip64.zip \
-       zip64-3mf.zip
-
-TESTS_ENVIRONMENT=     ZIPCMP=${top_builddir}/src/zipcmp
-# ${srcdir}/runtest
-#LOG_COMPILER=  ${srcdir}/runtest
-TEST_EXTENSIONS= .test
-TEST_LOG_COMPILER= ${builddir}/runtest
-#AM_TEST_LOG_FLAGS = -s
-
-TESTS= \
-       add_dir.test \
-       add_from_buffer.test \
-       add_from_file.test \
-       add_from_file_duplicate.test \
-       add_from_file_twice_duplicate.test \
-       add_from_filep.test \
-       add_from_stdin.test \
-       add_from_zip_closed.test \
-       add_from_zip_deflated.test \
-       add_from_zip_deflated2.test \
-       add_from_zip_partial_deflated.test \
-       add_from_zip_partial_stored.test \
-       add_from_zip_stored.test \
-       add_stored.test \
-       add_stored_in_memory.test \
-       cm-default.test \
-       count_entries.test \
-       decrypt-correct-password-aes128.test \
-       decrypt-correct-password-aes192.test \
-       decrypt-correct-password-aes256.test \
-       decrypt-correct-password-pkware.test \
-       decrypt-no-password-aes256.test \
-       decrypt-wrong-password-aes128.test \
-       decrypt-wrong-password-aes192.test \
-       decrypt-wrong-password-aes256.test \
-       decrypt-wrong-password-pkware.test \
-       delete_add_same.test \
-       delete_invalid.test \
-       delete_last.test \
-       delete_multiple_last.test \
-       delete_multiple_partial.test \
-       delete_renamed_rename.test \
-       encrypt.test \
-       encryption-nonrandom-aes128.test \
-       encryption-nonrandom-aes192.test \
-       encryption-nonrandom-aes256.test \
-       encryption-remove.test \
-       extra_add.test \
-       extra_add_multiple.test \
-       extra_count.test \
-       extra_count_by_id.test \
-       extra_count_ignore_zip64.test \
-       extra_delete.test \
-       extra_delete_by_id.test \
-       extra_field_align.test \
-       extra_get.test \
-       extra_get_by_id.test \
-       extra_set.test \
-       extra_set_modify_c.test \
-       extra_set_modify_l.test \
-       fdopen_ok.test \
-       file_comment_encmismatch.test \
-       fopen_unchanged.test \
-       fread.test \
-       fseek_deflated.test \
-       fseek_fail.test \
-       fseek_ok.test \
-       get_comment.test \
-       junk_at_end.test \
-       junk_at_start.test \
-       name_locate.test \
-       open_cons_extrabytes.test \
-       open_empty.test \
-       open_empty_2.test \
-       open_extrabytes.test \
-       open_file_count.test \
-       open_filename_duplicate.test \
-       open_filename_duplicate_consistency.test \
-       open_filename_duplicate_empty.test \
-       open_filename_duplicate_empty_consistency.test \
-       open_filename_empty.test \
-       open_incons.test \
-       open_many_fail.test \
-       open_many_ok.test \
-       open_multidisk.test \
-       open_new_but_exists.test \
-       open_new_ok.test \
-       open_nonarchive.test \
-       open_nosuchfile.test \
-       open_ok.test \
-       open_too_short.test \
-       open_truncate.test \
-       open_zip64_3mf.test \
-       open_zip64_ok.test \
-       preload.test \
-       progress.test \
-       rename_ascii.test \
-       rename_cp437.test \
-       rename_deleted.test \
-       rename_fail.test \
-       rename_ok.test \
-       rename_utf8.test \
-       rename_utf8_encmismatch.test \
-       set_comment_all.test \
-       set_comment_localonly.test \
-       set_comment_removeglobal.test \
-       set_comment_revert.test \
-       set_compression_bzip2_to_deflate.test \
-       set_compression_deflate_to_bzip2.test \
-       set_compression_deflate_to_deflate.test \
-       set_compression_deflate_to_store.test \
-       set_compression_store_to_bzip2.test \
-       set_compression_store_to_deflate.test \
-       set_compression_store_to_store.test \
-       set_compression_unknown.test \
-       stat_index_cp437_guess.test \
-       stat_index_cp437_raw.test \
-       stat_index_cp437_strict.test \
-       stat_index_fileorder.test \
-       stat_index_streamed.test \
-       stat_index_streamed_zip64.test \
-       stat_index_utf8_guess.test \
-       stat_index_utf8_raw.test \
-       stat_index_utf8_strict.test \
-       stat_index_utf8_unmarked_strict.test \
-       stat_index_zip64.test \
-       utf-8-standardization.test \
-       zip-in-archive-comment.test \
-       zip64_creation.test \
-       zip64_stored_creation.test
-
-#XFAIL_TESTS=
-
-
-AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib -I${top_srcdir}/src
-LDADD=${top_builddir}/lib/libzip.la
-
-CREATED_FILES= \
-       bigzero.zip \
-       manyfiles-133000.zip \
-       manyfiles-65536.zip \
-       manyfiles-fewer.zip \
-       manyfiles-more.zip \
-       manyfiles-zip64-modulo.zip \
-       manyfiles-zip64.zip \
-       manyfiles.zip \
-       runtest
-
-check-am: ${CREATED_FILES}
-
-bigzero.zip: bigzero-zip.zip
-       ${top_builddir}/src/ziptool ${srcdir}/bigzero-zip.zip cat 0 > ${builddir}/bigzero.zip
-
-manyfiles.zip: manyfiles-zip.zip
-       ${top_builddir}/src/ziptool ${srcdir}/manyfiles-zip.zip cat 0 > ${builddir}/$@
-
-manyfiles-133000.zip: manyfiles-zip.zip
-       ${top_builddir}/src/ziptool ${srcdir}/manyfiles-zip.zip cat 1 > ${builddir}/$@
-
-manyfiles-65536.zip: manyfiles-zip.zip
-       ${top_builddir}/src/ziptool ${srcdir}/manyfiles-zip.zip cat 2 > ${builddir}/$@
-
-manyfiles-fewer.zip: manyfiles-zip.zip
-       ${top_builddir}/src/ziptool ${srcdir}/manyfiles-zip.zip cat 5 > ${builddir}/$@
-
-manyfiles-more.zip: manyfiles-zip.zip
-       ${top_builddir}/src/ziptool ${srcdir}/manyfiles-zip.zip cat 6 > ${builddir}/$@
-
-manyfiles-zip64-modulo.zip: manyfiles-zip.zip
-       ${top_builddir}/src/ziptool ${srcdir}/manyfiles-zip.zip cat 3 > ${builddir}/$@
-
-manyfiles-zip64.zip: manyfiles-zip.zip
-       ${top_builddir}/src/ziptool ${srcdir}/manyfiles-zip.zip cat 4 > ${builddir}/$@
-
-runtest: runtest.in
-       sed -e 's!@[s]rcdir@!${srcdir}!g' -e 's!@[a]bs_srcdir@!${abs_srcdir}!g' -e 's!@[t]op_builddir@!${top_builddir}!g' ${srcdir}/runtest.in > runtest
-       chmod +x runtest
-
-cleanup:
-       rm -rf ${builddir}/sandbox-*.d[0-9]*/
-
-CLEANFILES=${CREATED_FILES}
index 5ab48bc..736ebae 100644 (file)
@@ -84,6 +84,9 @@ use UNIVERSAL;
 #      pipein COMMAND ARGS ...
 #          pipe output of running COMMAND to program's stdin.
 #
+#   precheck COMMAND ARGS ...
+#              if COMMAND exits with non-zero status, skip test.
+#
 #      preload LIBRARY
 #          pre-load LIBRARY before running program.
 #
@@ -159,6 +162,7 @@ sub new {
                mkdir => { type => 'string string' },
                pipefile => { type => 'string', once => 1 },
                pipein => { type => 'string', once => 1 },
+               precheck => { type => 'string...' },
                preload => { type => 'string', once => 1 },
                program => { type => 'string', once => 1 },
                'return' => { type => 'int', once => 1, required => 1 },
@@ -340,7 +344,11 @@ sub runtest_one {
                 $preload_env_var = 'DYLD_INSERT_LIBRARIES';
         }
        if (defined($self->{test}->{'preload'})) {
-               $ENV{$preload_env_var} = cwd() . "/../.libs/$self->{test}->{'preload'}";
+               if (-f cwd() . "/../.libs/$self->{test}->{'preload'}") {
+                       $ENV{$preload_env_var} = cwd() . "/../.libs/$self->{test}->{'preload'}";
+               } else {
+                       $ENV{$preload_env_var} = cwd() . "/../lib$self->{test}->{'preload'}";
+               }
        }
 
        $self->run_program();
@@ -439,6 +447,7 @@ sub setup {
        $self->die("error in test case definition") unless $self->parse_case($testcase_file);
 
        $self->check_features_requirement() if ($self->{test}->{features});
+       $self->run_precheck() if ($self->{test}->{precheck});
 
        $self->end_test('SKIP') if ($self->{test}->{preload} && $^O eq 'darwin');
 }
@@ -1111,6 +1120,20 @@ sub args_decode {
 }
 
 
+sub run_precheck {
+       my ($self) = @_;
+
+       for my $precheck (@{$self->{test}->{precheck}}) {
+               unless (system(@{$precheck}) == 0) {
+                       $self->print_test_result('SKIP', "precheck failed");
+                       $self->end_test('SKIP');
+               }
+       }
+
+       return 1;
+}
+
+
 sub run_program {
        my ($self) = @_;
        goto &pipein_win32 if $^O eq 'MSWin32' && $self->{test}->{pipein};
diff --git a/regress/buffer-fragment-read.test b/regress/buffer-fragment-read.test
new file mode 100644 (file)
index 0000000..1337560
--- /dev/null
@@ -0,0 +1,5 @@
+# test reading from a buffer fragment source
+return 0
+args -mF 1024 test.zip  cat 1
+file test.zip cm-default.zip cm-default.zip
+stdout uncompressable
diff --git a/regress/buffer-fragment-write.test b/regress/buffer-fragment-write.test
new file mode 100644 (file)
index 0000000..f3ebc1e
--- /dev/null
@@ -0,0 +1,4 @@
+# rename file inside zip archive
+return 0
+args -mF 100 rename.zip  rename 1 notfile2
+file rename.zip testcomment.zip rename_ok.zip
diff --git a/regress/can_clone_file.c b/regress/can_clone_file.c
new file mode 100644 (file)
index 0000000..cef16fe
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ can_clone_file.c -- does the current filesystem support cloning
+ Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <libzip@nih.at>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ 3. The names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "config.h"
+
+#ifdef HAVE_CLONEFILE
+#include <sys/attr.h>
+#include <sys/param.h>
+#include <sys/mount.h>
+#include <unistd.h>
+#endif
+
+int
+main(int argc, char *argv[])
+{
+#ifdef HAVE_CLONEFILE
+    struct statfs fs;
+    struct attrlist attribute_list;
+    struct {
+        uint32_t size;
+        vol_capabilities_attr_t capabilities;
+    } volume_attributes;
+
+    if (statfs(".", &fs) < 0) {
+        fprintf(stderr, "%s: can't get mount point of current directory: %s\n", argv[0], strerror(errno));
+        exit(1);
+    }
+
+    /* Not all volumes support clonefile().  A volume can be tested for
+       clonefile() support by using getattrlist(2) to get the volume
+       capabilities attribute ATTR_VOL_CAPABILITIES, and then testing the
+       VOL_CAP_INT_CLONE flag. */
+
+    memset(&attribute_list, 0, sizeof(attribute_list));
+    attribute_list.bitmapcount = ATTR_BIT_MAP_COUNT;
+    attribute_list.volattr = ATTR_VOL_INFO|ATTR_VOL_CAPABILITIES;
+    memset(&volume_attributes, 0, sizeof(volume_attributes));
+
+    if (getattrlist(fs.f_mntonname, &attribute_list, &volume_attributes, sizeof(volume_attributes), 0) < 0) {
+        fprintf(stderr, "%s: can't get volume capabilities of '%s': %s\n", argv[0], fs.f_mntonname, strerror(errno));
+        exit(1);
+    }
+
+    if (volume_attributes.capabilities.capabilities[VOL_CAPABILITIES_INTERFACES] & VOL_CAP_INT_CLONE) {
+        exit(0);
+    }
+#endif
+
+    exit(1);
+}
diff --git a/regress/cleanup.cmake b/regress/cleanup.cmake
new file mode 100644 (file)
index 0000000..94fd13f
--- /dev/null
@@ -0,0 +1,7 @@
+# expect variable DIR
+FILE(GLOB CLEANDIRS "${DIR}/sandbox-*.d[0-9]*")
+IF (CLEANDIRS)
+  MESSAGE(STATUS "Removing ${CLEANDIRS}")
+  FILE(REMOVE_RECURSE ${CLEANDIRS})
+ENDIF()
+
diff --git a/regress/clone-buffer-add.test b/regress/clone-buffer-add.test
new file mode 100644 (file)
index 0000000..c66791b
--- /dev/null
@@ -0,0 +1,4 @@
+# test cloning archive from buffer, add new file
+return 0
+args -mF 100 test.zzip  add new "A new file."  set_file_mtime 3 1512998132
+file test.zzip gap.zip gap-add.zip
diff --git a/regress/clone-buffer-delete.test b/regress/clone-buffer-delete.test
new file mode 100644 (file)
index 0000000..221f8d2
--- /dev/null
@@ -0,0 +1,4 @@
+# test cloning archive from buffer, deleteing a file
+return 0
+args -mF 100 test.zzip  delete 2
+file test.zzip gap.zip gap-delete.zip
diff --git a/regress/clone-buffer-replace.test b/regress/clone-buffer-replace.test
new file mode 100644 (file)
index 0000000..cb21f33
--- /dev/null
@@ -0,0 +1,4 @@
+# test cloning archive from buffer, replacing a file
+return 0
+args -mF 100 test.zzip  replace_file_contents 2 "A changed file."  set_file_mtime 2 1512998082
+file test.zzip gap.zip gap-replace.zip
diff --git a/regress/clone-fs-add.test b/regress/clone-fs-add.test
new file mode 100644 (file)
index 0000000..f187cb7
--- /dev/null
@@ -0,0 +1,5 @@
+# test cloning archive from filesystem, add new file
+precheck ./can_clone_file
+return 0
+args test.zzip  add new "A new file."  set_file_mtime 3 1512998132
+file test.zzip gap.zip gap-add.zip
diff --git a/regress/clone-fs-delete.test b/regress/clone-fs-delete.test
new file mode 100644 (file)
index 0000000..b2e63cc
--- /dev/null
@@ -0,0 +1,5 @@
+# test cloning archive from filesystem, deleteing a file
+precheck ./can_clone_file
+return 0
+args test.zzip  delete 2
+file test.zzip gap.zip gap-delete.zip
diff --git a/regress/clone-fs-replace.test b/regress/clone-fs-replace.test
new file mode 100644 (file)
index 0000000..3d3b8f3
--- /dev/null
@@ -0,0 +1,5 @@
+# test cloning archive from filesystem, replacing a file
+precheck ./can_clone_file
+return 0
+args test.zzip  replace_file_contents 2 "A changed file."  set_file_mtime 2 1512998082
+file test.zzip gap.zip gap-replace.zip
index fe95cec..f266a60 100644 (file)
@@ -1,6 +1,6 @@
 /*
   fseek.c -- test tool for seeking in zip archives
-  Copyright (C) 2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
diff --git a/regress/gap-add.zip b/regress/gap-add.zip
new file mode 100644 (file)
index 0000000..d70bfbd
Binary files /dev/null and b/regress/gap-add.zip differ
diff --git a/regress/gap-delete.zip b/regress/gap-delete.zip
new file mode 100644 (file)
index 0000000..7d73d00
Binary files /dev/null and b/regress/gap-delete.zip differ
diff --git a/regress/gap-replace.zip b/regress/gap-replace.zip
new file mode 100644 (file)
index 0000000..610ca06
Binary files /dev/null and b/regress/gap-replace.zip differ
diff --git a/regress/gap.zip b/regress/gap.zip
new file mode 100644 (file)
index 0000000..85e3bc7
Binary files /dev/null and b/regress/gap.zip differ
similarity index 98%
rename from src/hole.c
rename to regress/hole.c
index b616165..bc40696 100644 (file)
@@ -1,6 +1,6 @@
 /*
  hole.c -- convert huge files with mostly NULs to/from source_hole
- Copyright (C) 2014-2016 Dieter Baron and Thomas Klausner
+ Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
  
  This file is part of libzip, a library to manipulate ZIP archives.
  The authors can be contacted at <libzip@nih.at>
index f82f566..8fbcdf0 100644 (file)
@@ -1,6 +1,6 @@
 /*
   malloc.c -- override *alloc() to allow testing special cases
-  Copyright (C) 2015 Dieter Baron and Thomas Klausner
+  Copyright (C) 2015-2016 Dieter Baron and Thomas Klausner
 
   This file is part of ckmame, a program to check rom sets for MAME.
   The authors can be contacted at <ckmame@nih.at>
index dd90c14..182d6ba 100644 (file)
@@ -1,5 +1,6 @@
 /*
-  nonrandomopen.c -- override open() of /dev/urandom
+  nonrandomopen.c -- override zip_random
+
   Copyright (C) 2017 Dieter Baron and Thomas Klausner
 
   This file is part of ckmame, a program to check rom sets for MAME.
   IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <fcntl.h>
-#include <stdarg.h>
-#include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
-#define __USE_GNU
-#include <dlfcn.h>
-#undef __USE_GNU
-
-#include "config.h"
-
-#if !defined(RTLD_NEXT)
-#define RTLD_NEXT      RTLD_DEFAULT
-#endif
-
-static int inited = 0;
-static int (*real_open)(const char *path, int flags, ...) = NULL;
-static int (*real_open64)(const char *path, int flags, ...) = NULL;
-
-static void
-init(void)
-{
-    real_open = dlsym(RTLD_NEXT, "open");
-    if (!real_open)
-       abort();
-    real_open64 = dlsym(RTLD_NEXT, "open64");
-    if (!real_open64) {
-       /* does not have to exist */
-    }
-    inited = 1;
-}
-
-int
-open(const char *path, int flags, ...)
-{
-    va_list ap;
-    mode_t mode;
-
-    if (!inited) {
-       init();
-    }
-
-    va_start(ap, flags);
-    mode = va_arg(ap, mode_t);
-    va_end(ap);
-
-    if (strcmp(path, "/dev/urandom") == 0) {
-       return real_open("/dev/zero", flags, mode);
-    } else {
-       return real_open(path, flags, mode);
-    }
-}
+#include "compat.h"
+#include "zipint.h"
 
-int
-open64(const char *path, int flags, ...)
+bool
+zip_random(zip_uint8_t *buffer, zip_uint16_t length)
 {
-    va_list ap;
-    mode_t mode;
-
-    if (!inited) {
-       init();
-    }
-
-    if (!real_open64) {
-       abort();
-    }
-
-    va_start(ap, flags);
-    mode = va_arg(ap, mode_t);
-    va_end(ap);
+    memset(buffer, 0, length);
 
-    if (strcmp(path, "/dev/urandom") == 0) {
-       return real_open64("/dev/zero", flags, mode);
-    } else {
-       return real_open64(path, flags, mode);
-    }
+    return true;
 }
index 56f946e..5b7e6a7 100644 (file)
   IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-/* to get the same defines that other tools get, in particular
- * overrides for file offset sizes from config.h */
-#include "compat.h"
+#include "zipint.h"
 
-#include <errno.h>
-#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
 
 int
 main(int argc, const char *argv[])
 {
-    int fd, i;
-    char buf[10];
+    char buf[1024];
+    int i;
 
-    fd = open("/dev/urandom", O_RDONLY);
-    if (fd < 0) {
-       fprintf(stderr, "can't open /dev/urandom: %s\n", strerror(errno));
+    if (!zip_random(buf, sizeof(buf))) {
+       fprintf(stderr, "zip_random returned false\n");
        exit(1);
     }
-    if (read(fd, buf, sizeof(buf)) < sizeof(buf)) {
-       fprintf(stderr, "can't read %d bytes: %s\n", (int)sizeof(buf), strerror(errno));
-       exit(1);
-    }
-    close(fd);
     for (i=0; i<sizeof(buf); i++) {
        if (buf[i] != 0) {
            fprintf(stderr, "non-zero byte found\n");
index c81b542..44c4836 100644 (file)
@@ -1,7 +1,7 @@
 # zip_open: file is not a zip archive
 program tryopen
-file Makefile.am Makefile.am Makefile.am
-args Makefile.am
+file CMakeLists.txt CMakeLists.txt CMakeLists.txt
+args CMakeLists.txt
 return 1
-stdout opening 'Makefile.am' returned error 19
+stdout opening 'CMakeLists.txt' returned error 19
 stderr 1 errors
index 221648a..a6eb140 100644 (file)
@@ -38,7 +38,7 @@ BEGIN { push @INC, '@abs_srcdir@'; }
 
 use NiHTest;
 
-my $test = NiHTest::new({ default_program => '../src/ziptool', srcdir => '@srcdir@', top_builddir => '@top_builddir@', zipcmp => '../../src/zipcmp', zipcmp_flags => '-p' });
+my $test = NiHTest::new({ default_program => 'ziptool_regress', srcdir => '@srcdir@', top_builddir => '@top_builddir@', zipcmp => '../../src/zipcmp', zipcmp_flags => '-p' });
 
 sub mangle_test {
        my ($test, $variant) = @_;
similarity index 66%
rename from regress/set_mtime.test
rename to regress/set_file_mtime.test
index c80fe4b..477fd06 100644 (file)
@@ -1,4 +1,4 @@
 # change mtime in a zip archive
 return 0
-args testfile set_mtime 0 1407272201
+args testfile set_file_mtime 0 1407272201
 file testfile testfile.zip testfile2014.zip
similarity index 99%
rename from src/source_hole.c
rename to regress/source_hole.c
index d2f1a16..d7931f1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  source_hole.c -- source for handling huge files that are mostly NULs
- Copyright (C) 2014-2016 Dieter Baron and Thomas Klausner
+ Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner
 
  This file is part of libzip, a library to manipulate ZIP archives.
  The authors can be contacted at <libzip@nih.at>
index 1d91853..1d75d46 100644 (file)
Binary files a/regress/testfile2014.zip and b/regress/testfile2014.zip differ
index 8a2b9a6..6f2b924 100644 (file)
@@ -1,6 +1,6 @@
 /*
   tryopen.c -- tool for tests that try opening zip archives
-  Copyright (C) 1999-2014 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
diff --git a/regress/ziptool_regress.c b/regress/ziptool_regress.c
new file mode 100644 (file)
index 0000000..ba0bc34
--- /dev/null
@@ -0,0 +1,398 @@
+#include "zip.h"
+
+#define ZIP_MIN(a, b)  ((a) < (b) ? (a) : (b))
+
+#define FOR_REGRESS
+
+typedef enum {
+    SOURCE_TYPE_NONE,
+    SOURCE_TYPE_IN_MEMORY,
+    SOURCE_TYPE_HOLE
+} source_type_t;
+
+source_type_t source_type = SOURCE_TYPE_NONE;
+zip_uint64_t fragment_size = 0;
+
+static int add_nul(int argc, char *argv[]);
+static int unchange_all(int argc, char *argv[]);
+static int zin_close(int argc, char *argv[]);
+
+#define OPTIONS_REGRESS "F:Hm"
+
+#define USAGE_REGRESS " [-Hm] [-F fragment-size]"
+
+#define GETOPT_REGRESS \
+        case 'H': \
+            source_type = SOURCE_TYPE_HOLE; \
+            break; \
+       case 'm': \
+            source_type = SOURCE_TYPE_IN_MEMORY; \
+            break; \
+       case 'F': \
+           fragment_size = strtoull(optarg, NULL, 10); \
+            break;
+
+#define DISPATCH_REGRESS \
+    { "add_nul", 2, "name length", "add NUL bytes", add_nul }, \
+    { "unchange_all", 0, "", "revert all changes", unchange_all }, \
+    { "zin_close", 1, "index", "close input zip_source (for internal tests)", zin_close }
+
+
+zip_t *ziptool_open(const char *archive, int flags, zip_error_t *error, zip_uint64_t offset, zip_uint64_t len);
+
+
+#include "ziptool.c"
+
+
+zip_source_t *memory_src = NULL;
+
+zip_source_t *source_hole_create(const char *, int flags, zip_error_t *);
+
+static zip_t *read_to_memory(const char *archive, int flags, zip_error_t *error, zip_source_t **srcp);
+static zip_source_t *source_nul(zip_t *za, zip_uint64_t length);
+
+
+static int
+add_nul(int argc, char *argv[]) {
+    zip_source_t *zs;
+    zip_uint64_t length = strtoull(argv[1], NULL, 10);
+
+    if ((zs=source_nul(za, length)) == NULL) {
+        fprintf(stderr, "can't create zip_source for length: %s\n", zip_strerror(za));
+        return -1;
+    }
+
+    if (zip_add(za, argv[0], zs) == -1) {
+        zip_source_free(zs);
+        fprintf(stderr, "can't add file '%s': %s\n", argv[0], zip_strerror(za));
+        return -1;
+    }
+    return 0;
+}
+
+static int
+unchange_all(int argc, char *argv[]) {
+    if (zip_unchange_all(za) < 0) {
+       fprintf(stderr, "can't revert changes to archive: %s\n", zip_strerror(za));
+       return -1;
+    }
+    return 0;
+}
+
+static int
+zin_close(int argc, char *argv[]) {
+    zip_uint64_t idx;
+
+    idx = strtoull(argv[0], NULL, 10);
+    if (idx >= z_in_count) {
+       fprintf(stderr, "invalid argument '%" PRIu64 "', only %d zip sources open\n", idx, z_in_count);
+       return -1;
+    }
+    if (zip_close(z_in[idx]) < 0) {
+       fprintf(stderr, "can't close source archive: %s\n", zip_strerror(z_in[idx]));
+       return -1;
+    }
+    z_in[idx] = z_in[z_in_count];
+    z_in_count--;
+
+    return 0;
+}
+
+
+static zip_t *
+read_hole(const char *archive, int flags, zip_error_t *error)
+{
+    zip_source_t *src = NULL;
+    zip_t *zs = NULL;
+
+    if (strcmp(archive, "/dev/stdin") == 0) {
+       zip_error_set(error, ZIP_ER_OPNOTSUPP, 0);
+       return NULL;
+    }
+
+    if ((src = source_hole_create(archive, flags, error)) == NULL
+        || (zs = zip_open_from_source(src, flags, error)) == NULL) {
+        zip_source_free(src);
+    }
+
+    return zs;
+}
+
+
+static zip_t *
+read_to_memory(const char *archive, int flags, zip_error_t *error, zip_source_t **srcp)
+{
+    zip_source_t *src;
+    zip_t *zb;
+    FILE *fp;
+
+    if (strcmp(archive, "/dev/stdin") == 0) {
+       zip_error_set(error, ZIP_ER_OPNOTSUPP, 0);
+       return NULL;
+    }
+
+    if ((fp=fopen(archive, "r")) == NULL) {
+       if (errno == ENOENT) {
+           src = zip_source_buffer_create(NULL, 0, 0, error);
+       }
+       else {
+           zip_error_set(error, ZIP_ER_OPEN, errno);
+           return NULL;
+       }
+    }
+    else {
+        struct stat st;
+
+        if (fstat(fileno(fp), &st) < 0) {
+           fclose(fp);
+            zip_error_set(error, ZIP_ER_OPEN, errno);
+            return NULL;
+        }
+        if (fragment_size == 0) {
+            char *buf;
+            if ((buf=malloc((size_t)st.st_size)) == NULL) {
+                fclose(fp);
+                zip_error_set(error, ZIP_ER_MEMORY, 0);
+                return NULL;
+            }
+            if (fread(buf, (size_t)st.st_size, 1, fp) < 1) {
+                free(buf);
+                fclose(fp);
+                zip_error_set(error, ZIP_ER_READ, errno);
+                return NULL;
+            }
+            src = zip_source_buffer_create(buf, (zip_uint64_t)st.st_size, 1, error);
+            if (src == NULL) {
+                free(buf);
+            }
+        }
+        else {
+            zip_uint64_t nfragments, i, left;
+            zip_buffer_fragment_t *fragments;
+
+            nfragments = ((size_t)st.st_size + fragment_size - 1) / fragment_size;
+            if ((fragments = malloc(sizeof(fragments[0]) * nfragments)) == NULL) {
+                fclose(fp);
+                zip_error_set(error, ZIP_ER_MEMORY, 0);
+                return NULL;
+            }
+            for (i = 0; i < nfragments; i++) {
+                left = ZIP_MIN(fragment_size, (size_t)st.st_size - i * fragment_size);
+                if ((fragments[i].data = malloc(left)) == NULL) {
+                    while (--i > 0) {
+                        free(fragments[i].data);
+                    }
+                    free(fragments);
+                    fclose(fp);
+                    zip_error_set(error, ZIP_ER_MEMORY, 0);
+                    return NULL;
+                }
+                fragments[i].length = left;
+                if (fread(fragments[i].data, left, 1, fp) < 1) {
+                    while (--i > 0) {
+                        free(fragments[i].data);
+                    }
+                    free(fragments);
+                    fclose(fp);
+                    zip_error_set(error, ZIP_ER_READ, errno);
+                    return NULL;
+                }
+            }
+            src = zip_source_buffer_fragment_create(fragments, nfragments, 1, error);
+            if (src == NULL) {
+                for (i = 0; i < nfragments; i++) {
+                    free(fragments[i].data);
+                }
+                free(fragments);
+                fclose(fp);
+                return NULL;
+            }
+        }
+        fclose(fp);
+    }
+    if (src == NULL) {
+       return NULL;
+    }
+    zb = zip_open_from_source(src, flags, error);
+    if (zb == NULL) {
+       zip_source_free(src);
+       return NULL;
+    }
+    zip_source_keep(src);
+    *srcp = src;
+    return zb;
+}
+
+
+typedef struct source_nul {
+    zip_error_t error;
+    zip_uint64_t length;
+    zip_uint64_t offset;
+} source_nul_t;
+
+static zip_int64_t
+source_nul_cb(void *ud, void *data, zip_uint64_t length, zip_source_cmd_t command)
+{
+    source_nul_t *ctx = (source_nul_t *)ud;
+
+    switch (command) {
+        case ZIP_SOURCE_CLOSE:
+            return 0;
+
+        case ZIP_SOURCE_ERROR:
+            return zip_error_to_data(&ctx->error, data, length);
+
+        case ZIP_SOURCE_FREE:
+            free(ctx);
+            return 0;
+
+        case ZIP_SOURCE_OPEN:
+            ctx->offset = 0;
+            return 0;
+
+        case ZIP_SOURCE_READ:
+           if (length > ZIP_INT64_MAX) {
+               zip_error_set(&ctx->error, ZIP_ER_INVAL, 0);
+               return -1;
+           }
+
+            if (length > ctx->length - ctx->offset) {
+                length =ctx->length - ctx->offset;
+            }
+
+            memset(data, 0, length);
+            ctx->offset += length;
+            return (zip_int64_t)length;
+
+        case ZIP_SOURCE_STAT: {
+            zip_stat_t *st = ZIP_SOURCE_GET_ARGS(zip_stat_t, data, length, &ctx->error);
+
+            if (st == NULL) {
+                return -1;
+            }
+
+            st->valid |= ZIP_STAT_SIZE;
+            st->size = ctx->length;
+
+            return 0;
+        }
+
+        case ZIP_SOURCE_SUPPORTS:
+            return zip_source_make_command_bitmap(ZIP_SOURCE_CLOSE, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_STAT, -1);
+
+        default:
+            zip_error_set(&ctx->error, ZIP_ER_OPNOTSUPP, 0);
+            return -1;
+    }
+}
+
+static zip_source_t *
+source_nul(zip_t *zs, zip_uint64_t length)
+{
+    source_nul_t *ctx;
+    zip_source_t *src;
+
+    if ((ctx = (source_nul_t *)malloc(sizeof(*ctx))) == NULL) {
+        zip_error_set(zip_get_error(zs), ZIP_ER_MEMORY, 0);
+        return NULL;
+    }
+
+    zip_error_init(&ctx->error);
+    ctx->length = length;
+    ctx->offset = 0;
+
+    if ((src = zip_source_function(zs, source_nul_cb, ctx)) == NULL) {
+        free(ctx);
+        return NULL;
+    }
+
+    return src;
+}
+
+
+static int
+write_memory_src_to_file(const char *archive, zip_source_t *src)
+{
+    zip_stat_t zst;
+    char *buf;
+    FILE *fp;
+
+    if (zip_source_stat(src, &zst) < 0) {
+       fprintf(stderr, "zip_source_stat on buffer failed: %s\n", zip_error_strerror(zip_source_error(src)));
+       return -1;
+    }
+    if (zip_source_open(src) < 0) {
+       if (zip_error_code_zip(zip_source_error(src)) == ZIP_ER_DELETED) {
+           if (unlink(archive) < 0 && errno != ENOENT) {
+               fprintf(stderr, "unlink failed: %s\n", strerror(errno));
+               return -1;
+           }
+           return 0;
+       }
+       fprintf(stderr, "zip_source_open on buffer failed: %s\n", zip_error_strerror(zip_source_error(src)));
+       return -1;
+    }
+    if ((buf=malloc(zst.size)) == NULL) {
+       fprintf(stderr, "malloc failed: %s\n", strerror(errno));
+       zip_source_close(src);
+       return -1;
+    }
+    if (zip_source_read(src, buf, zst.size) < (zip_int64_t)zst.size) {
+       fprintf(stderr, "zip_source_read on buffer failed: %s\n", zip_error_strerror(zip_source_error(src)));
+       zip_source_close(src);
+       free(buf);
+       return -1;
+    }
+    zip_source_close(src);
+    if ((fp=fopen(archive, "wb")) == NULL) {
+       fprintf(stderr, "fopen failed: %s\n", strerror(errno));
+       free(buf);
+       return -1;
+    }
+    if (fwrite(buf, zst.size, 1, fp) < 1) {
+       fprintf(stderr, "fwrite failed: %s\n", strerror(errno));
+       free(buf);
+       fclose(fp);
+       return -1;
+    }
+    free(buf);
+    if (fclose(fp) != 0) {
+       fprintf(stderr, "fclose failed: %s\n", strerror(errno));
+       return -1;
+    }
+    return 0;
+}
+
+
+zip_t *
+ziptool_open(const char *archive, int flags, zip_error_t *error, zip_uint64_t offset, zip_uint64_t len) {
+    switch (source_type) {
+       case SOURCE_TYPE_NONE:
+           za = read_from_file(archive, flags, error, offset, len);
+           break;
+
+        case SOURCE_TYPE_IN_MEMORY:
+            za = read_to_memory(archive, flags, error, &memory_src);
+            break;
+
+       case SOURCE_TYPE_HOLE:
+           za = read_hole(archive, flags, error);
+            break;
+    }
+
+    return za;
+}
+
+
+int
+ziptool_post_close(const char *archive) {
+    if (source_type == SOURCE_TYPE_IN_MEMORY) {
+       if (write_memory_src_to_file(archive, memory_src) < 0) {
+           return -1;
+       }
+       zip_source_free(memory_src);
+    }
+
+    return 0;
+}
+
index 48ddf3f..2a3f4d2 100644 (file)
@@ -14,10 +14,6 @@ ADD_EXECUTABLE(zipmerge zipmerge.c ${SRC_EXTRA_FILES})
 TARGET_LINK_LIBRARIES(zipmerge zip)
 INSTALL(TARGETS zipmerge RUNTIME DESTINATION bin)
 
-ADD_EXECUTABLE(ziptool ziptool.c ${SRC_EXTRA_FILES} source_hole.c)
+ADD_EXECUTABLE(ziptool ziptool.c ${SRC_EXTRA_FILES})
 TARGET_LINK_LIBRARIES(ziptool zip)
 INSTALL(TARGETS ziptool RUNTIME DESTINATION bin)
-
-ADD_EXECUTABLE(hole hole.c ${SRC_EXTRA_FILES} source_hole.c)
-TARGET_LINK_LIBRARIES(hole zip)
-# do not install hole, just a test helper
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644 (file)
index fa5ba2f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-bin_PROGRAMS=zipcmp zipmerge ziptool
-noinst_PROGRAMS=hole
-
-hole_SOURCES= hole.c source_hole.c
-ziptool_SOURCES= source_hole.c ziptool.c
-
-AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib
-LDADD=${top_builddir}/lib/libzip.la
-
-EXTRA_DIST=    CMakeLists.txt getopt.c getopt.h
index 48c4ed4..ebb23ae 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zipcmp.c -- compare zip files
-  Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -107,7 +107,7 @@ char help[] = "\n\
 Report bugs to <libzip@nih.at>.\n";
 
 char version_string[] = PROGRAM " (" PACKAGE " " VERSION ")\n\
-Copyright (C) 2003-2016 Dieter Baron and Thomas Klausner\n\
+Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner\n\
 " PACKAGE " comes with ABSOLUTELY NO WARRANTY, to the extent permitted by law.\n";
 
 #define OPTIONS "hVipqtv"
index 1d3be4c..181f947 100644 (file)
@@ -1,6 +1,6 @@
 /*
   zipmerge.c -- merge zip archives
-  Copyright (C) 2004-2014 Dieter Baron and Thomas Klausner
+  Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -72,7 +72,7 @@ char help[] = "\n\
 Report bugs to <libzip@nih.at>.\n";
 
 char version_string[] = PROGRAM " (" PACKAGE " " VERSION ")\n\
-Copyright (C) 2004-2014 Dieter Baron and Thomas Klausner\n\
+Copyright (C) 2004-2017 Dieter Baron and Thomas Klausner\n\
 " PACKAGE " comes with ABSOLUTELY NO WARRANTY, to the extent permitted by law.\n";
 
 #define OPTIONS "hVDiIsS"
index 2d68cb9..ba34110 100644 (file)
@@ -1,6 +1,6 @@
 /*
   ziptool.c -- tool for modifying zip archive in multiple ways
-  Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner
+  Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -56,14 +56,6 @@ extern int optopt;
 #include "compat.h"
 #include "zip.h"
 
-zip_source_t *source_hole_create(const char *, int flags, zip_error_t *);
-
-typedef enum {
-    SOURCE_TYPE_NONE,
-    SOURCE_TYPE_IN_MEMORY,
-    SOURCE_TYPE_HOLE
-} source_type_t;
-
 typedef struct dispatch_table_s {
     const char *cmdline_name;
     int argument_count;
@@ -76,8 +68,12 @@ static zip_flags_t get_flags(const char *arg);
 static zip_int32_t get_compression_method(const char *arg);
 static zip_uint16_t get_encryption_method(const char *arg);
 static void hexdump(const zip_uint8_t *data, zip_uint16_t len);
-static zip_t *read_to_memory(const char *archive, int flags, zip_error_t *error, zip_source_t **srcp);
-static zip_source_t *source_nul(zip_t *za, zip_uint64_t length);
+int ziptool_post_close(const char *archive);
+
+#ifndef FOR_REGRESS
+#define OPTIONS_REGRESS ""
+#define USAGE_REGRESS ""
+#endif
 
 zip_t *za, *z_in[16];
 unsigned int z_in_count;
@@ -169,24 +165,6 @@ add_from_zip(int argc, char *argv[]) {
 }
 
 static int
-add_nul(int argc, char *argv[]) {
-    zip_source_t *zs;
-    zip_uint64_t length = strtoull(argv[1], NULL, 10);
-
-    if ((zs=source_nul(za, length)) == NULL) {
-        fprintf(stderr, "can't create zip_source for length: %s\n", zip_strerror(za));
-        return -1;
-    }
-
-    if (zip_add(za, argv[0], zs) == -1) {
-        zip_source_free(zs);
-        fprintf(stderr, "can't add file '%s': %s\n", argv[0], zip_strerror(za));
-        return -1;
-    }
-    return 0;
-}
-
-static int
 cat(int argc, char *argv[]) {
     /* output file contents to stdout */
     zip_uint64_t idx;
@@ -405,7 +383,7 @@ name_locate(int argc, char *argv[]) {
 }
 
 static void
-progress_callback(zip_t *za, double percentage, void *ud) {
+progress_callback(zip_t *archive, double percentage, void *ud) {
     printf("%.1lf%% done\n", percentage*100);
 }
 
@@ -498,7 +476,7 @@ set_file_compression(int argc, char *argv[]) {
 
 static int
 set_file_encryption(int argc, char *argv[]) {
-    zip_int32_t method;
+    zip_uint16_t method;
     zip_uint64_t idx;
     char *password;
     idx = strtoull(argv[0], NULL, 10);
@@ -598,34 +576,6 @@ zstat(int argc, char *argv[]) {
     return 0;
 }
 
-static int
-unchange_all(int argc, char *argv[]) {
-    if (zip_unchange_all(za) < 0) {
-       fprintf(stderr, "can't revert changes to archive: %s\n", zip_strerror(za));
-       return -1;
-    }
-    return 0;
-}
-
-static int
-zin_close(int argc, char *argv[]) {
-    zip_uint64_t idx;
-
-    idx = strtoull(argv[0], NULL, 10);
-    if (idx >= z_in_count) {
-       fprintf(stderr, "invalid argument '%" PRIu64 "', only %d zip sources open\n", idx, z_in_count);
-       return -1;
-    }
-    if (zip_close(z_in[idx]) < 0) {
-       fprintf(stderr, "can't close source archive: %s\n", zip_strerror(z_in[idx]));
-       return -1;
-    }
-    z_in[idx] = z_in[z_in_count];
-    z_in_count--;
-
-    return 0;
-}
-
 static zip_flags_t
 get_flags(const char *arg)
 {
@@ -728,231 +678,11 @@ read_from_file(const char *archive, int flags, zip_error_t *error, zip_uint64_t
     return zaa;
 }
 
-
-static zip_t *
-read_hole(const char *archive, int flags, zip_error_t *error)
-{
-    zip_source_t *src = NULL;
-    zip_t *zs = NULL;
-
-    if (strcmp(archive, "/dev/stdin") == 0) {
-       zip_error_set(error, ZIP_ER_OPNOTSUPP, 0);
-       return NULL;
-    }
-
-    if ((src = source_hole_create(archive, flags, error)) == NULL
-        || (zs = zip_open_from_source(src, flags, error)) == NULL) {
-        zip_source_free(src);
-    }
-
-    return zs;
-}
-
-
-static zip_t *
-read_to_memory(const char *archive, int flags, zip_error_t *error, zip_source_t **srcp)
-{
-    struct stat st;
-    zip_source_t *src;
-    zip_t *zb;
-
-    if (strcmp(archive, "/dev/stdin") == 0) {
-       zip_error_set(error, ZIP_ER_OPNOTSUPP, 0);
-       return NULL;
-    }
-
-    if (stat(archive, &st) < 0) {
-       if (errno == ENOENT) {
-           src = zip_source_buffer_create(NULL, 0, 0, error);
-       }
-       else {
-           zip_error_set(error, ZIP_ER_OPEN, errno);
-           return NULL;
-       }
-    }
-    else {
-       char *buf;
-       FILE *fp;
-       if ((buf=malloc((size_t)st.st_size)) == NULL) {
-           zip_error_set(error, ZIP_ER_MEMORY, 0);
-           return NULL;
-       }
-       if ((fp=fopen(archive, "r")) == NULL) {
-           free(buf);
-           zip_error_set(error, ZIP_ER_READ, errno);
-           return NULL;
-       }
-       if (fread(buf, (size_t)st.st_size, 1, fp) < 1) {
-           free(buf);
-           fclose(fp);
-           zip_error_set(error, ZIP_ER_READ, errno);
-           return NULL;
-       }
-       fclose(fp);
-       src = zip_source_buffer_create(buf, (zip_uint64_t)st.st_size, 1, error);
-       if (src == NULL) {
-           free(buf);
-       }
-    }
-    if (src == NULL) {
-       return NULL;
-    }
-    zb = zip_open_from_source(src, flags, error);
-    if (zb == NULL) {
-       zip_source_free(src);
-       return NULL;
-    }
-    zip_source_keep(src);
-    *srcp = src;
-    return zb;
-}
-
-
-typedef struct source_nul {
-    zip_error_t error;
-    zip_uint64_t length;
-    zip_uint64_t offset;
-} source_nul_t;
-
-static zip_int64_t
-source_nul_cb(void *ud, void *data, zip_uint64_t length, zip_source_cmd_t command)
-{
-    source_nul_t *ctx = (source_nul_t *)ud;
-
-    switch (command) {
-        case ZIP_SOURCE_CLOSE:
-            return 0;
-
-        case ZIP_SOURCE_ERROR:
-            return zip_error_to_data(&ctx->error, data, length);
-
-        case ZIP_SOURCE_FREE:
-            free(ctx);
-            return 0;
-
-        case ZIP_SOURCE_OPEN:
-            ctx->offset = 0;
-            return 0;
-
-        case ZIP_SOURCE_READ:
-           if (length > ZIP_INT64_MAX) {
-               zip_error_set(&ctx->error, ZIP_ER_INVAL, 0);
-               return -1;
-           }
-
-            if (length > ctx->length - ctx->offset) {
-                length =ctx->length - ctx->offset;
-            }
-
-            memset(data, 0, length);
-            ctx->offset += length;
-            return (zip_int64_t)length;
-
-        case ZIP_SOURCE_STAT: {
-            zip_stat_t *st = ZIP_SOURCE_GET_ARGS(zip_stat_t, data, length, &ctx->error);
-
-            if (st == NULL) {
-                return -1;
-            }
-
-            st->valid |= ZIP_STAT_SIZE;
-            st->size = ctx->length;
-
-            return 0;
-        }
-
-        case ZIP_SOURCE_SUPPORTS:
-            return zip_source_make_command_bitmap(ZIP_SOURCE_CLOSE, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_STAT, -1);
-
-        default:
-            zip_error_set(&ctx->error, ZIP_ER_OPNOTSUPP, 0);
-            return -1;
-    }
-}
-
-static zip_source_t *
-source_nul(zip_t *zs, zip_uint64_t length)
-{
-    source_nul_t *ctx;
-    zip_source_t *src;
-
-    if ((ctx = (source_nul_t *)malloc(sizeof(*ctx))) == NULL) {
-        zip_error_set(zip_get_error(zs), ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-
-    zip_error_init(&ctx->error);
-    ctx->length = length;
-    ctx->offset = 0;
-
-    if ((src = zip_source_function(zs, source_nul_cb, ctx)) == NULL) {
-        free(ctx);
-        return NULL;
-    }
-
-    return src;
-}
-
-
-static int
-write_memory_src_to_file(const char *archive, zip_source_t *src)
-{
-    zip_stat_t zst;
-    char *buf;
-    FILE *fp;
-
-    if (zip_source_stat(src, &zst) < 0) {
-       fprintf(stderr, "zip_source_stat on buffer failed: %s\n", zip_error_strerror(zip_source_error(src)));
-       return -1;
-    }
-    if (zip_source_open(src) < 0) {
-       if (zip_error_code_zip(zip_source_error(src)) == ZIP_ER_DELETED) {
-           if (unlink(archive) < 0 && errno != ENOENT) {
-               fprintf(stderr, "unlink failed: %s\n", strerror(errno));
-               return -1;
-           }
-           return 0;
-       }
-       fprintf(stderr, "zip_source_open on buffer failed: %s\n", zip_error_strerror(zip_source_error(src)));
-       return -1;
-    }
-    if ((buf=malloc(zst.size)) == NULL) {
-       fprintf(stderr, "malloc failed: %s\n", strerror(errno));
-       zip_source_close(src);
-       return -1;
-    }
-    if (zip_source_read(src, buf, zst.size) < (zip_int64_t)zst.size) {
-       fprintf(stderr, "zip_source_read on buffer failed: %s\n", zip_error_strerror(zip_source_error(src)));
-       zip_source_close(src);
-       free(buf);
-       return -1;
-    }
-    zip_source_close(src);
-    if ((fp=fopen(archive, "wb")) == NULL) {
-       fprintf(stderr, "fopen failed: %s\n", strerror(errno));
-       free(buf);
-       return -1;
-    }
-    if (fwrite(buf, zst.size, 1, fp) < 1) {
-       fprintf(stderr, "fwrite failed: %s\n", strerror(errno));
-       free(buf);
-       fclose(fp);
-       return -1;
-    }
-    free(buf);
-    if (fclose(fp) != 0) {
-       fprintf(stderr, "fclose failed: %s\n", strerror(errno));
-       return -1;
-    }
-    return 0;
-}
-
 dispatch_table_t dispatch_table[] = {
     { "add", 2, "name content", "add file called name using content", add },
     { "add_dir", 1, "name", "add directory", add_dir },
     { "add_file", 4, "name file_to_add offset len", "add file to archive, len bytes starting from offset", add_file },
     { "add_from_zip", 5, "name archivename index offset len", "add file from another archive, len bytes starting from offset", add_from_zip },
-    { "add_nul", 2, "name length", "add NUL bytes", add_nul },
     { "cat", 1, "index", "output file contents to stdout", cat },
     { "count_extra", 2, "index flags", "show number of extra fields for archive entry", count_extra },
     { "count_extra_by_id", 3, "index extra_id flags", "show number of extra fields of type extra_id for archive entry", count_extra_by_id },
@@ -976,9 +706,10 @@ dispatch_table_t dispatch_table[] = {
     { "set_file_mtime", 2, "index timestamp", "set file modification time", set_file_mtime },
     { "set_file_mtime_all", 1, "timestamp", "set file modification time for all files", set_file_mtime_all },
     { "set_password", 1, "password", "set default password for encryption", set_password },
-    { "stat", 1, "index", "print information about entry", zstat },
-    { "unchange_all", 0, "", "revert all changes", unchange_all },
-    { "zin_close", 1, "index", "close input zip_source (for internal tests)", zin_close }
+    { "stat", 1, "index", "print information about entry", zstat }
+#ifdef DISPATCH_REGRESS
+    , DISPATCH_REGRESS
+#endif
 };
 
 static int
@@ -1014,7 +745,7 @@ usage(const char *progname, const char *reason)
        out = stdout;
     else
        out = stderr;
-    fprintf(out, "usage: %s [-cegHhmnrst] [-l len] [-o offset] archive command1 [args] [command2 [args] ...]\n", progname);
+    fprintf(out, "usage: %s [-ceghnrst]" USAGE_REGRESS " [-l len] [-o offset] archive command1 [args] [command2 [args] ...]\n", progname);
     if (reason != NULL) {
        fprintf(out, "%s\n", reason);
        exit(1);
@@ -1023,11 +754,18 @@ usage(const char *progname, const char *reason)
     fprintf(out, "\nSupported options are:\n"
            "\t-c\t\tcheck consistency\n"
            "\t-e\t\terror if archive already exists (only useful with -n)\n"
+#ifdef FOR_REGRESS
+            "\t-F size\t\tfragment size for in memory archive\n"
+#endif
            "\t-g\t\tguess file name encoding (for stat)\n"
+#ifdef FOR_REGRESS
             "\t-H\t\twrite files with holes compactly\n"
+#endif
             "\t-h\t\tdisplay this usage\n"
            "\t-l len\t\tonly use len bytes of file\n"
+#ifdef FOR_REGRESS
            "\t-m\t\tread archive into memory, and modify there; write out at end\n"
+#endif
            "\t-n\t\tcreate archive if it doesn't exist\n"
            "\t-o offset\tstart reading file at offset\n"
            "\t-r\t\tprint raw file name encoding without translation (for stat)\n"
@@ -1060,22 +798,28 @@ usage(const char *progname, const char *reason)
     exit(0);
 }
 
+#ifndef FOR_REGRESS
+#define ziptool_open read_from_file
+int
+ziptool_post_close(const char *archive) {
+    return 0;
+}
+#endif
+
 int
 main(int argc, char *argv[])
 {
     const char *archive;
-    zip_source_t *memory_src = NULL;
     unsigned int i;
     int c, arg, err, flags;
     const char *prg;
-    source_type_t source_type = SOURCE_TYPE_NONE;
     zip_uint64_t len = 0, offset = 0;
     zip_error_t error;
 
     flags = 0;
     prg = argv[0];
 
-    while ((c=getopt(argc, argv, "cegHhl:mno:rst")) != -1) {
+    while ((c=getopt(argc, argv, "ceghl:no:rst" OPTIONS_REGRESS)) != -1) {
        switch (c) {
        case 'c':
            flags |= ZIP_CHECKCONS;
@@ -1086,18 +830,12 @@ main(int argc, char *argv[])
        case 'g':
            stat_flags = ZIP_FL_ENC_GUESS;
            break;
-        case 'H':
-            source_type = SOURCE_TYPE_HOLE;
-            break;
        case 'h':
            usage(prg, NULL);
            break;
        case 'l':
            len = strtoull(optarg, NULL, 10);
            break;
-       case 'm':
-            source_type = SOURCE_TYPE_IN_MEMORY;
-            break;
        case 'n':
            flags |= ZIP_CREATE;
            break;
@@ -1113,6 +851,9 @@ main(int argc, char *argv[])
        case 't':
            flags |= ZIP_TRUNCATE;
            break;
+#ifdef GETOPT_REGRESS
+       GETOPT_REGRESS
+#endif
 
        default:
        {
@@ -1134,19 +875,7 @@ main(int argc, char *argv[])
        flags = ZIP_CREATE;
 
     zip_error_init(&error);
-    switch (source_type) {
-       case SOURCE_TYPE_NONE:
-           za = read_from_file(archive, flags, &error, offset, len);
-           break;
-
-        case SOURCE_TYPE_IN_MEMORY:
-            za = read_to_memory(archive, flags, &error, &memory_src);
-            break;
-
-       case SOURCE_TYPE_HOLE:
-           za = read_hole(archive, flags, &error);
-            break;
-    }
+    za = ziptool_open(archive, flags, &error, offset, len);
     if (za == NULL) {
        fprintf(stderr, "can't open zip archive '%s': %s\n", archive, zip_error_strerror(&error));
        zip_error_fini(&error);
@@ -1170,11 +899,8 @@ main(int argc, char *argv[])
        fprintf(stderr, "can't close zip archive '%s': %s\n", archive, zip_strerror(za));
        return 1;
     }
-    if (source_type == SOURCE_TYPE_IN_MEMORY) {
-       if (write_memory_src_to_file(archive, memory_src) < 0) {
-           err = 1;
-       }
-       zip_source_free(memory_src);
+    if (ziptool_post_close(archive) < 0) {
+       err = 1;
     }
 
     for (i=0; i<z_in_count; i++) {
diff --git a/vstudio/readme.txt b/vstudio/readme.txt
deleted file mode 100644 (file)
index 72b7546..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-Building libzip with Microsoft Visual C++
-=========================================
-The script vsbuild.cmd can be used to build (and optionally test) libzip using
-Microsoft Visual C++.
-
-Prerequisites
--------------
-Windows Server 2003 or Windows Vista or later (tested with Windows 7 x64)
-Microsoft Visual Studio (tested with VS2013 Premium)
-CMake (tested with version 3.3.1)
-Source code for zlib (tested with version 1.2.8)
-
-To run tests, you will also need:
-Perl interpreter (tested with ActiveState ActivePerl 5.20.2 64-bit)
-CPAN module IPC::Cmd (comes with ActivePerl)
-
-You'll also need to make sure all of the above (specifically: msbuild.exe,
-cmake.exe and perl.exe) are in your PATH at the time of running the script.
-
-Unpacking zlib
---------------
-Because libzip depends on zlib, the vsbuild.cmd script takes care of building
-zlib for you as well. Download the source code from http://zlib.org/ and extract
-all the files and subdirectories from the "zlib-x.y.z" directory into
-vstudio/zlib.
-
-Building libzip with Visual Studio 2013 for the impatient
----------------------------------------------------------
-1. Make sure all the prerequisites (see above) are installed and in your PATH.
-2. Don't forget to unpack zlib (see "Unpacking zlib" above).
-3. Open a Visual Studio Command Prompt in the "vstudio" directory (the directory
-   containing this file).
-4. Enter the following command for a 32-bit x86 build:
-   vsbuild build "Visual Studio 12" v120
-   or for a 64-bit x64 build:
-   vsbuild build "Visual Studio 12 Win64" v120
-
-If you'd like to run the tests as well, use one of the following commands:
-vsbuild build+test "Visual Studio 12" v120
-vsbuild build+test "Visual Studio 12 Win64" v120
-
-Building libzip
----------------
-The script vsbuild.cmd has three modes of operation, with the following syntax:
-vsbuild clean
-vsbuild build <generator> <toolset>
-vsbuild build+test <generator> <toolset>
-
-"vsbuild clean" deletes all output and intermediate files and directories
-generated by the build process.
-
-"vsbuild build" just builds zlib and libzip and leaves the DLL files in the
-following locations:
-vstudio/zlib/installed/bin/zlib.dll
-vstudio/zlib/installed/bin/zlibd.dll
-build/lib/Debug/zip.dll
-build/lib/Release/zip.dll
-
-"vsbuild build+test" builds zlib and libzip as above, then runs the libzip
-regression test suite.
-
-The "build" and "build+test" commands require the following parameters:
-
-<generator>: The CMake generator to use for project files. This identifies the
-version of Visual Studio you're using, and also allows you to specify whether
-the 32-bit or 64-bit of the libraries should be built.
-I've tested "Visual Studio 12" (VS2013 x86) and "Visual Studio 12 Win64"
-(VS2013 x64) but other versions should work as well. Run "cmake --help" for a
-list of generators.
-
-<toolset>: Specifies the platform toolset to use. Normally, this will match the
-version of Visual Studio (e.g. "v120" for Visual Studio 2013 aka Visual Studio
-12). See the Visual Studio documentation for more information about platform
-toolsets.
-
-Andrew Molyneux
-andrew@molyneuxfamily.co.uk
\ No newline at end of file
diff --git a/vstudio/vsbuild.cmd b/vstudio/vsbuild.cmd
deleted file mode 100644 (file)
index 9b7d8bd..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-@echo off
-setlocal enableextensions enabledelayedexpansion
-
-rem ---------------------------------------------------------------------------
-rem Check that required commands are in the PATH.
-rem ---------------------------------------------------------------------------
-set CHECK_CMD=cmake.exe
-set CHECK_DESC=CMake
-call :check_installed
-set CHECK_CMD=msbuild.exe
-set CHECK_DESC=MSBuild
-call :check_installed
-
-rem ---------------------------------------------------------------------------
-rem Parse command-line arguments.
-rem %1: Command ("build" or "clean")
-rem %2: Generator (e.g. "Visual Studio 12" for VS2013)
-rem %3: Platform toolset (e.g. "v120_xp" for VS2013 toolset for Windows XP)
-rem ---------------------------------------------------------------------------
-if "%1"=="clean" (
-       echo Cleaning
-       if exist zlib\installed rmdir /s /q zlib\installed
-       if errorlevel 1 goto exit_failure
-       if exist zlib\build rmdir /s /q zlib\build
-       if errorlevel 1 goto exit_failure
-       if exist ..\build rmdir /s /q ..\build
-       if errorlevel 1 goto exit_failure
-       if exist ..\regress\bigzero.zip del ..\regress\bigzero.zip
-       if errorlevel 1 goto exit_failure
-       if exist ..\regress\manyfiles.zip del ..\regress\manyfiles.zip
-       if errorlevel 1 goto exit_failure
-       if exist ..\regress\manyfiles-133000.zip del ..\regress\manyfiles-133000.zip
-       if errorlevel 1 goto exit_failure
-       if exist ..\regress\manyfiles-65536.zip del ..\regress\manyfiles-65536.zip
-       if errorlevel 1 goto exit_failure
-       if exist ..\regress\manyfiles-zip64-modulo.zip del ..\regress\manyfiles-zip64-modulo.zip
-       if errorlevel 1 goto exit_failure
-       if exist ..\regress\manyfiles-zip64.zip del ..\regress\manyfiles-zip64.zip
-       if errorlevel 1 goto exit_failure
-       if exist ..\regress\manyfiles-fewer.zip del ..\regress\manyfiles-fewer.zip
-       if errorlevel 1 goto exit_failure
-       if exist ..\regress\manyfiles-more.zip del ..\regress\manyfiles-more.zip
-       if errorlevel 1 goto exit_failure
-       echo Done
-       exit /b 0
-) else if "%1"=="build" (
-       set CMAKE_GENERATOR=%2
-       set CMAKE_TOOLSET=%3
-       set LIBZIP_RUN_TESTS=false
-) else if "%1"=="build+test" (
-       set CMAKE_GENERATOR=%2
-       set CMAKE_TOOLSET=%3
-       set LIBZIP_RUN_TESTS=true
-) else (
-       echo Invalid command "%1"
-       exit /b 1
-)
-
-rem ---------------------------------------------------------------------------
-rem If we're running tests, we'll also need a Perl interpreter.
-rem ---------------------------------------------------------------------------
-if "%LIBZIP_RUN_TESTS%"=="true" (
-       set CHECK_CMD=perl.exe
-       set CHECK_DESC=a Perl interpreter (to run tests)
-       call :check_installed
-)
-
-rem ---------------------------------------------------------------------------
-rem Configure and build zlib.
-rem ---------------------------------------------------------------------------
-pushd zlib
-for /f %%p in (".\installed") do set ZLIB_INSTALL_PATH=%%~fp
-echo zlib will be "installed" to %ZLIB_INSTALL_PATH%
-if not exist build (
-       mkdir build
-       if errorlevel 1 popd & goto exit_failure
-)
-cd build
-if errorlevel 1 popd & goto exit_failure
-echo Configuring zlib
-cmake .. -G %CMAKE_GENERATOR% -T %CMAKE_TOOLSET% -DCMAKE_INSTALL_PREFIX="%ZLIB_INSTALL_PATH%"
-if errorlevel 1 popd & goto exit_failure
-echo Building zlib
-msbuild /P:Configuration=Debug INSTALL.vcxproj
-if errorlevel 1 popd & goto exit_failure
-msbuild /P:Configuration=Release INSTALL.vcxproj
-if errorlevel 1 popd & goto exit_failure
-popd
-
-rem ---------------------------------------------------------------------------
-rem Prepare the build directory and run CMake to configure the project.
-rem ---------------------------------------------------------------------------
-pushd ..
-if not exist build (
-       echo Creating build directory
-       mkdir build
-       if errorlevel 1 popd & goto exit_failure
-)
-cd build
-if errorlevel 1 popd & goto exit_failure
-cmake .. -G %CMAKE_GENERATOR% -T %CMAKE_TOOLSET% -DCMAKE_PREFIX_PATH="%ZLIB_INSTALL_PATH%"
-if errorlevel 1 popd & goto exit_failure
-goto :EOF
-
-rem ---------------------------------------------------------------------------
-rem Build libzip.
-rem ---------------------------------------------------------------------------
-msbuild /P:Configuration=Debug ALL_BUILD.vcxproj
-if errorlevel 1 popd & goto exit_failure
-msbuild /P:Configuration=Release ALL_BUILD.vcxproj
-if errorlevel 1 popd & goto exit_failure
-popd
-
-rem ---------------------------------------------------------------------------
-rem Copy DLLs so zipcmp/zipmerge can run.
-rem ---------------------------------------------------------------------------
-echo Copying DLLs
-copy zlib\installed\bin\zlibd.dll ..\build\src\Debug
-if errorlevel 1 goto exit_failure
-copy zlib\installed\bin\zlib.dll ..\build\src\Release
-if errorlevel 1 goto exit_failure
-copy ..\build\lib\Release\zip.dll ..\build\src\Release
-if errorlevel 1 goto exit_failure
-copy ..\build\lib\Debug\zip.dll ..\build\src\Debug
-if errorlevel 1 goto exit_failure
-
-rem ---------------------------------------------------------------------------
-rem Run the tests, if required.
-rem ---------------------------------------------------------------------------
-if "%LIBZIP_RUN_TESTS%"=="true" (
-       echo Copying libraries for tests
-       pushd ..\build\regress
-       copy ..\..\vstudio\zlib\installed\bin\zlib.dll .
-       if errorlevel 1 popd & goto exit_failure
-       copy ..\lib\Release\zip.dll .
-       if errorlevel 1 popd & goto exit_failure
-       copy Release\*.exe .
-       if errorlevel 1 popd & goto exit_failure
-       copy ..\src\Release\*.exe .
-       if errorlevel 1 popd & goto exit_failure
-       echo Extracting test files
-       if not exist ..\..\regress\bigzero.zip ziptool ..\..\regress\bigzero-zip.zip cat 0 > ..\..\regress\bigzero.zip
-       if errorlevel 1 popd & goto exit_failure
-       if not exist ..\..\regress\manyfiles.zip ziptool ..\..\regress\manyfiles-zip.zip cat 0 > ..\..\regress\manyfiles.zip
-       if errorlevel 1 popd & goto exit_failure
-       if not exist ..\..\regress\manyfiles-133000.zip ziptool ..\..\regress\manyfiles-zip.zip cat 1 > ..\..\regress\manyfiles-133000.zip
-       if errorlevel 1 popd & goto exit_failure
-       if not exist ..\..\regress\manyfiles-65536.zip ziptool ..\..\regress\manyfiles-zip.zip cat 2 > ..\..\regress\manyfiles-65536.zip
-       if errorlevel 1 popd & goto exit_failure
-       if not exist ..\..\regress\manyfiles-zip64-modulo.zip ziptool ..\..\regress\manyfiles-zip.zip cat 3 > ..\..\regress\manyfiles-zip64-modulo.zip
-       if errorlevel 1 popd & goto exit_failure
-       if not exist ..\..\regress\manyfiles-zip64.zip ziptool ..\..\regress\manyfiles-zip.zip cat 4 > ..\..\regress\manyfiles-zip64.zip
-       if errorlevel 1 popd & goto exit_failure
-       if not exist ..\..\regress\manyfiles-fewer.zip ziptool ..\..\regress\manyfiles-zip.zip cat 5 > ..\..\regress\manyfiles-fewer.zip
-       if errorlevel 1 popd & goto exit_failure
-       if not exist ..\..\regress\manyfiles-more.zip ziptool ..\..\regress\manyfiles-zip.zip cat 6 > ..\..\regress\manyfiles-more.zip
-       if errorlevel 1 popd & goto exit_failure
-       echo Generating runtest script
-       for /f %%p in ("..\..\regress") do set ABS_SRCDIR=%%~fp
-       set ABS_SRCDIR=!ABS_SRCDIR:\=\\!
-       perl -p -e "s/@[s]rcdir@/..\\..\\regress/g;s/@[a]bs_srcdir@/!ABS_SRCDIR!/g;s|../../src/zipcmp|..\\..\\src\\Release\\zipcmp|g;" ..\..\regress\runtest.in > runtest
-       if errorlevel 1 popd & goto exit_failure
-       echo Running tests
-       ctest
-       popd
-       if errorlevel 1 goto exit_failure
-)
-
-goto :EOF
-
-:check_installed
-where %CHECK_CMD% > nul 2>&1
-if "%errorlevel%"=="9009" (
-  echo This build script requires where.exe. If running on Windows XP or
-  echo earlier, this can be found in the Windows Resource Kit.
-  exit /b 1
-)
-if errorlevel 1 (
-  echo Please make sure that %CHECK_DESC% is installed and in your PATH.
-  exit /b 1
-)
-goto :EOF
-
-:exit_failure
-echo Build failed.
-exit /b 1
diff --git a/vstudio/zlib/unpack_zlib_here.txt b/vstudio/zlib/unpack_zlib_here.txt
deleted file mode 100644 (file)
index f4e51a6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Unpack zlib source archive into this directory.
\ No newline at end of file
diff --git a/xcode/Info.plist b/xcode/Info.plist
deleted file mode 100644 (file)
index 4cc3a77..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>English</string>
-       <key>CFBundleExecutable</key>
-       <string>${EXECUTABLE_NAME}</string>
-       <key>CFBundleIconFile</key>
-       <string></string>
-       <key>CFBundleIdentifier</key>
-       <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundleName</key>
-       <string>${PRODUCT_NAME}</string>
-       <key>CFBundlePackageType</key>
-       <string>BNDL</string>
-       <key>CFBundleShortVersionString</key>
-       <string>PACKAGE_VERSION</string>
-       <key>CFBundleSignature</key>
-       <string>????</string>
-       <key>CFBundleVersion</key>
-       <string>1</string>
-       <key>CFPlugInDynamicRegisterFunction</key>
-       <string></string>
-       <key>CFPlugInDynamicRegistration</key>
-       <string>NO</string>
-       <key>CFPlugInFactories</key>
-       <dict>
-               <key>00000000-0000-0000-0000-000000000000</key>
-               <string>MyFactoryFunction</string>
-       </dict>
-       <key>CFPlugInTypes</key>
-       <dict>
-               <key>00000000-0000-0000-0000-000000000000</key>
-               <array>
-                       <string>00000000-0000-0000-0000-000000000000</string>
-               </array>
-       </dict>
-       <key>CFPlugInUnloadFunction</key>
-       <string></string>
-       <key>NSHumanReadableCopyright</key>
-       <string>Copyright © 2014 Dieter Baron and Thomas Klausner</string>
-</dict>
-</plist>
diff --git a/xcode/config.h b/xcode/config.h
deleted file mode 100644 (file)
index a9fdc39..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-/* config.h.  Generated from config.h.in by configure.  */
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
-   */
-/* #undef HAVE_DECL_TZNAME */
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the `fseeko' function. */
-#define HAVE_FSEEKO 1
-
-/* Define to 1 if you have the `ftello' function. */
-#define HAVE_FTELLO 1
-
-/* Define to 1 if you have the <fts.h> header file. */
-#define HAVE_FTS_H 1
-
-/* Define to 1 if you have the `getopt' function. */
-#define HAVE_GETOPT 1
-
-/* Define to 1 if the system has the type `int16_t'. */
-#define HAVE_INT16_T 1
-
-/* Define to 1 if the system has the type `int32_t'. */
-#define HAVE_INT32_T 1
-
-/* Define to 1 if the system has the type `int64_t'. */
-#define HAVE_INT64_T 1
-
-/* Define to 1 if the system has the type `int8_t'. */
-#define HAVE_INT8_T 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `z' library (-lz). */
-#define HAVE_LIBZ 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `mkstemp' function. */
-#define HAVE_MKSTEMP 1
-
-/* Define to 1 if you have the `open' function. */
-#define HAVE_OPEN 1
-
-/* Define to 1 if you have the `snprintf' function. */
-#define HAVE_SNPRINTF 1
-
-/* Define to 1 if the system has the type `ssize_t'. */
-#define HAVE_SSIZE_T 1
-
-/* Define to 1 if you have the <stdbool.h> header file. */
-#define HAVE_STDBOOL_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#define HAVE_STRCASECMP 1
-
-/* Define to 1 if you have the `strdup' function. */
-#define HAVE_STRDUP 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if `tm_zone' is a member of `struct tm'. */
-#define HAVE_STRUCT_TM_TM_ZONE 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
-   `HAVE_STRUCT_TM_TM_ZONE' instead. */
-#define HAVE_TM_ZONE 1
-
-/* Define to 1 if you don't have `tm_zone' but do have the external array
-   `tzname'. */
-/* #undef HAVE_TZNAME */
-
-/* Define to 1 if the system has the type `uint16_t'. */
-#define HAVE_UINT16_T 1
-
-/* Define to 1 if the system has the type `uint32_t'. */
-#define HAVE_UINT32_T 1
-
-/* Define to 1 if the system has the type `uint64_t'. */
-#define HAVE_UINT64_T 1
-
-/* Define to 1 if the system has the type `uint8_t'. */
-#define HAVE_UINT8_T 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 or 0, depending whether the compiler supports simple visibility
-   declarations. */
-#define HAVE_VISIBILITY 1
-
-/* Define to 1 if you have the `_close' function. */
-/* #undef HAVE__CLOSE */
-
-/* Define to 1 if you have the `_dup' function. */
-/* #undef HAVE__DUP */
-
-/* Define to 1 if you have the `_fdopen' function. */
-/* #undef HAVE__FDOPEN */
-
-/* Define to 1 if you have the `_fileno' function. */
-/* #undef HAVE__FILENO */
-
-/* Define to 1 if you have the `_open' function. */
-/* #undef HAVE__OPEN */
-
-/* Define to 1 if you have the `_snprintf' function. */
-/* #undef HAVE__SNPRINTF */
-
-/* Define to 1 if you have the `_strdup' function. */
-/* #undef HAVE__STRDUP */
-
-/* Define to 1 if you have the `_stricmp' function. */
-/* #undef HAVE__STRICMP */
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#define LT_OBJDIR ".libs/"
-
-/* Name of package */
-#define PACKAGE "libzip"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "libzip@nih.at"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "libzip"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libzip 1.0.1a"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "libzip"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.3.1a"
-
-/* The size of `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of `long', as computed by sizeof. */
-#ifndef __LP64__
-#define SIZEOF_LONG 4
-#else /* __LP64__ */
-#define SIZEOF_LONG 8
-#endif /* __LP64__ */
-
-/* The size of `long long', as computed by sizeof. */
-#define SIZEOF_LONG_LONG 8
-
-/* The size of `off_t', as computed by sizeof. */
-#define SIZEOF_OFF_T 8
-
-/* The size of `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
-
-/* The size of `size_t', as computed by sizeof. */
-#ifndef __LP64__
-#define SIZEOF_SIZE_T 4
-#else /* __LP64__ */
-#define SIZEOF_SIZE_T 8
-#endif /* __LP64__ */
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-/* #undef TM_IN_SYS_TIME */
-
-/* Version number of package */
-#define VERSION "1.3.1a"
-
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-/* #undef _FILE_OFFSET_BITS */
-
-/* Define for large files, on AIX-style hosts. */
-/* #undef _LARGE_FILES */
-
-
-#ifndef HAVE_SSIZE_T
-#  if SIZEOF_SIZE_T == SIZEOF_INT
-typedef int ssize_t;
-#  elif SIZEOF_SIZE_T == SIZEOF_LONG
-typedef long ssize_t;
-#  elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
-typedef long long ssize_t;
-#  else
-#error no suitable type for ssize_t found
-#  endif
-#endif
-
diff --git a/xcode/extract-version.sh b/xcode/extract-version.sh
deleted file mode 100755 (executable)
index 85e83fc..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-# Replace the value for PLIST_KEY with the resolved definition from the header file that was passed in.
-
-SOURCE_HEADER_FILE_PATH=$1
-SOURCE_PLIST_PATH=$2
-
-PLIST_KEY="CFBundleShortVersionString"
-
-VERSION_KEY=`/usr/libexec/PlistBuddy -c "Print :${PLIST_KEY}" "${SOURCE_PLIST_PATH}"`
-
-#echo "Key: ${VERSION_KEY}"
-
-VERSION_NUM=`cat "${SOURCE_HEADER_FILE_PATH}" | sed -n "s|#define ${VERSION_KEY} \"\(.*\)\".*|\1|p"`
-
-#echo "Value: ${VERSION_NUM}"
-
-TARGET_PLIST_PATH="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
-
-/usr/libexec/PlistBuddy -c "Set :${PLIST_KEY} ${VERSION_NUM}" "${TARGET_PLIST_PATH}"
diff --git a/xcode/libzip.xcodeproj/project.pbxproj b/xcode/libzip.xcodeproj/project.pbxproj
deleted file mode 100644 (file)
index e407e7f..0000000
+++ /dev/null
@@ -1,2858 +0,0 @@
-// !$*UTF8*$!
-{
-       archiveVersion = 1;
-       classes = {
-       };
-       objectVersion = 46;
-       objects = {
-
-/* Begin PBXAggregateTarget section */
-               4B01D72815B2F5A2002D5007 /* command line tools */ = {
-                       isa = PBXAggregateTarget;
-                       buildConfigurationList = 4B01D72915B2F5A2002D5007 /* Build configuration list for PBXAggregateTarget "command line tools" */;
-                       buildPhases = (
-                       );
-                       dependencies = (
-                               4B2CADAC1C50D57800291DE6 /* PBXTargetDependency */,
-                               4B01D72D15B2F5AC002D5007 /* PBXTargetDependency */,
-                               4B01D72F15B2F5AC002D5007 /* PBXTargetDependency */,
-                       );
-                       name = "command line tools";
-                       productName = "command line tools";
-               };
-               4B54447915C977A20067BA33 /* all */ = {
-                       isa = PBXAggregateTarget;
-                       buildConfigurationList = 4B54447C15C977A20067BA33 /* Build configuration list for PBXAggregateTarget "all" */;
-                       buildPhases = (
-                       );
-                       dependencies = (
-                               4BCF6A7B1C3BDDFF00F036E9 /* PBXTargetDependency */,
-                               4B54447F15C977AF0067BA33 /* PBXTargetDependency */,
-                               4B54448115C977B10067BA33 /* PBXTargetDependency */,
-                       );
-                       name = all;
-                       productName = all;
-               };
-               4BACD5A715BC2D8200920691 /* test programs */ = {
-                       isa = PBXAggregateTarget;
-                       buildConfigurationList = 4BACD5AE15BC2D8200920691 /* Build configuration list for PBXAggregateTarget "test programs" */;
-                       buildPhases = (
-                       );
-                       dependencies = (
-                               4BD6CB6E19E71D0800710654 /* PBXTargetDependency */,
-                               4BACD65515BC303B00920691 /* PBXTargetDependency */,
-                               4BACD65715BC303B00920691 /* PBXTargetDependency */,
-                               4BACD65915BC303B00920691 /* PBXTargetDependency */,
-                               4BACD66915BC303B00920691 /* PBXTargetDependency */,
-                       );
-                       name = "test programs";
-                       productName = "test programs";
-               };
-               4BCF6A681C3BDDD500F036E9 /* examples */ = {
-                       isa = PBXAggregateTarget;
-                       buildConfigurationList = 4BCF6A751C3BDDD500F036E9 /* Build configuration list for PBXAggregateTarget "examples" */;
-                       buildPhases = (
-                       );
-                       dependencies = (
-                               4BCF6A791C3BDDF900F036E9 /* PBXTargetDependency */,
-                       );
-                       name = examples;
-                       productName = examples;
-               };
-               4BDC72A115B1B6EA00236D3C /* Build iOS Framework */ = {
-                       isa = PBXAggregateTarget;
-                       buildConfigurationList = 4BDC72A215B1B6EA00236D3C /* Build configuration list for PBXAggregateTarget "Build iOS Framework" */;
-                       buildPhases = (
-                               4BDC72A515B1B71500236D3C /* ShellScript */,
-                       );
-                       dependencies = (
-                       );
-                       name = "Build iOS Framework";
-                       productName = "Build iOS Framework";
-               };
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
-               3D7E35431B33063F00022624 /* in-memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D7E35401B33063600022624 /* in-memory.c */; };
-               3D7E35461B33064B00022624 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; };
-               3D7E35481B33076C00022624 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D7E35471B33076C00022624 /* libz.dylib */; };
-               3D7E35491B330AD500022624 /* zip_source_is_deleted.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BE402AC19D94AE400298248 /* zip_source_is_deleted.c */; };
-               3D7E354A1B330BCD00022624 /* zip_source_is_deleted.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BE402AC19D94AE400298248 /* zip_source_is_deleted.c */; };
-               3D9284811C309510001EABA7 /* zip_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D9284801C309510001EABA7 /* zip_hash.c */; };
-               3D9284821C309510001EABA7 /* zip_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D9284801C309510001EABA7 /* zip_hash.c */; };
-               4B01D6A615B2F46B002D5007 /* zip_add_dir.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F115B1B25E00236D3C /* zip_add_dir.c */; };
-               4B01D6A715B2F46B002D5007 /* zip_add_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F215B1B25E00236D3C /* zip_add_entry.c */; };
-               4B01D6A815B2F46B002D5007 /* zip_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F315B1B25E00236D3C /* zip_add.c */; };
-               4B01D6A915B2F46B002D5007 /* zip_close.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F415B1B25E00236D3C /* zip_close.c */; };
-               4B01D6AA15B2F46B002D5007 /* zip_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F515B1B25E00236D3C /* zip_delete.c */; };
-               4B01D6AB15B2F46B002D5007 /* zip_dir_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F615B1B25E00236D3C /* zip_dir_add.c */; };
-               4B01D6AC15B2F46B002D5007 /* zip_dirent.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F715B1B25E00236D3C /* zip_dirent.c */; };
-               4B01D6AD15B2F46B002D5007 /* zip_discard.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F815B1B25E00236D3C /* zip_discard.c */; };
-               4B01D6AE15B2F46B002D5007 /* zip_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F915B1B25E00236D3C /* zip_entry.c */; };
-               4B01D6AF15B2F46B002D5007 /* zip_err_str.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FA15B1B25E00236D3C /* zip_err_str.c */; };
-               4B01D6B015B2F46B002D5007 /* zip_error_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FB15B1B25E00236D3C /* zip_error_clear.c */; };
-               4B01D6B115B2F46B002D5007 /* zip_error_get_sys_type.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FC15B1B25E00236D3C /* zip_error_get_sys_type.c */; };
-               4B01D6B215B2F46B002D5007 /* zip_error_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FD15B1B25E00236D3C /* zip_error_get.c */; };
-               4B01D6B315B2F46B002D5007 /* zip_error_strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FE15B1B25E00236D3C /* zip_error_strerror.c */; };
-               4B01D6B415B2F46B002D5007 /* zip_error_to_str.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FF15B1B25E00236D3C /* zip_error_to_str.c */; };
-               4B01D6B515B2F46B002D5007 /* zip_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720015B1B25E00236D3C /* zip_error.c */; };
-               4B01D6B615B2F46B002D5007 /* zip_extra_field_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720115B1B25E00236D3C /* zip_extra_field_api.c */; };
-               4B01D6B715B2F46B002D5007 /* zip_extra_field.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720215B1B25E00236D3C /* zip_extra_field.c */; };
-               4B01D6B815B2F46B002D5007 /* zip_fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720315B1B25E00236D3C /* zip_fclose.c */; };
-               4B01D6B915B2F46B002D5007 /* zip_fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720415B1B25E00236D3C /* zip_fdopen.c */; };
-               4B01D6BA15B2F46B002D5007 /* zip_file_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720515B1B25E00236D3C /* zip_file_add.c */; };
-               4B01D6BB15B2F46B002D5007 /* zip_file_error_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720615B1B25E00236D3C /* zip_file_error_clear.c */; };
-               4B01D6BC15B2F46B002D5007 /* zip_file_error_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720715B1B25E00236D3C /* zip_file_error_get.c */; };
-               4B01D6BD15B2F46B002D5007 /* zip_file_get_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720815B1B25E00236D3C /* zip_file_get_comment.c */; };
-               4B01D6BE15B2F46B002D5007 /* zip_file_get_offset.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720915B1B25E00236D3C /* zip_file_get_offset.c */; };
-               4B01D6BF15B2F46B002D5007 /* zip_file_rename.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720A15B1B25E00236D3C /* zip_file_rename.c */; };
-               4B01D6C015B2F46B002D5007 /* zip_file_replace.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720B15B1B25E00236D3C /* zip_file_replace.c */; };
-               4B01D6C115B2F46B002D5007 /* zip_file_set_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720C15B1B25E00236D3C /* zip_file_set_comment.c */; };
-               4B01D6C215B2F46B002D5007 /* zip_file_strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720D15B1B25E00236D3C /* zip_file_strerror.c */; };
-               4B01D6C315B2F46B002D5007 /* zip_filerange_crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720E15B1B25E00236D3C /* zip_filerange_crc.c */; };
-               4B01D6C415B2F46B002D5007 /* zip_fopen_encrypted.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720F15B1B25E00236D3C /* zip_fopen_encrypted.c */; };
-               4B01D6C515B2F46B002D5007 /* zip_fopen_index_encrypted.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721015B1B25E00236D3C /* zip_fopen_index_encrypted.c */; };
-               4B01D6C615B2F46B002D5007 /* zip_fopen_index.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721115B1B25E00236D3C /* zip_fopen_index.c */; };
-               4B01D6C715B2F46B002D5007 /* zip_fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721215B1B25E00236D3C /* zip_fopen.c */; };
-               4B01D6C815B2F46B002D5007 /* zip_fread.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721315B1B25E00236D3C /* zip_fread.c */; };
-               4B01D6C915B2F46B002D5007 /* zip_get_archive_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721415B1B25E00236D3C /* zip_get_archive_comment.c */; };
-               4B01D6CA15B2F46B002D5007 /* zip_get_archive_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721515B1B25E00236D3C /* zip_get_archive_flag.c */; };
-               4B01D6CC15B2F46B002D5007 /* zip_get_encryption_implementation.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721715B1B25E00236D3C /* zip_get_encryption_implementation.c */; };
-               4B01D6CD15B2F46B002D5007 /* zip_get_file_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721815B1B25E00236D3C /* zip_get_file_comment.c */; };
-               4B01D6CE15B2F46B002D5007 /* zip_get_name.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721915B1B25E00236D3C /* zip_get_name.c */; };
-               4B01D6CF15B2F46B002D5007 /* zip_get_num_entries.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721A15B1B25E00236D3C /* zip_get_num_entries.c */; };
-               4B01D6D015B2F46B002D5007 /* zip_get_num_files.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721B15B1B25E00236D3C /* zip_get_num_files.c */; };
-               4B01D6D115B2F46B002D5007 /* zip_memdup.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721C15B1B25E00236D3C /* zip_memdup.c */; };
-               4B01D6D215B2F46B002D5007 /* zip_name_locate.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721D15B1B25E00236D3C /* zip_name_locate.c */; };
-               4B01D6D315B2F46B002D5007 /* zip_new.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721E15B1B25E00236D3C /* zip_new.c */; };
-               4B01D6D415B2F46B002D5007 /* zip_open.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721F15B1B25E00236D3C /* zip_open.c */; };
-               4B01D6D515B2F46B002D5007 /* zip_rename.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722015B1B25E00236D3C /* zip_rename.c */; };
-               4B01D6D615B2F46B002D5007 /* zip_replace.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722115B1B25E00236D3C /* zip_replace.c */; };
-               4B01D6D715B2F46B002D5007 /* zip_set_archive_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722215B1B25E00236D3C /* zip_set_archive_comment.c */; };
-               4B01D6D815B2F46B002D5007 /* zip_set_archive_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722315B1B25E00236D3C /* zip_set_archive_flag.c */; };
-               4B01D6D915B2F46B002D5007 /* zip_set_default_password.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722415B1B25E00236D3C /* zip_set_default_password.c */; };
-               4B01D6DA15B2F46B002D5007 /* zip_set_file_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722515B1B25E00236D3C /* zip_set_file_comment.c */; };
-               4B01D6DB15B2F46B002D5007 /* zip_set_file_compression.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722615B1B25E00236D3C /* zip_set_file_compression.c */; };
-               4B01D6DC15B2F46B002D5007 /* zip_set_name.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722715B1B25E00236D3C /* zip_set_name.c */; };
-               4B01D6DD15B2F46B002D5007 /* zip_source_buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722815B1B25E00236D3C /* zip_source_buffer.c */; };
-               4B01D6DE15B2F46B002D5007 /* zip_source_close.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722915B1B25E00236D3C /* zip_source_close.c */; };
-               4B01D6DF15B2F46B002D5007 /* zip_source_crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722A15B1B25E00236D3C /* zip_source_crc.c */; };
-               4B01D6E115B2F46B002D5007 /* zip_source_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722C15B1B25E00236D3C /* zip_source_error.c */; };
-               4B01D6E215B2F46B002D5007 /* zip_source_file.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722D15B1B25E00236D3C /* zip_source_file.c */; };
-               4B01D6E315B2F46B002D5007 /* zip_source_filep.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722E15B1B25E00236D3C /* zip_source_filep.c */; };
-               4B01D6E415B2F46B002D5007 /* zip_source_free.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722F15B1B25E00236D3C /* zip_source_free.c */; };
-               4B01D6E515B2F46B002D5007 /* zip_source_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723015B1B25E00236D3C /* zip_source_function.c */; };
-               4B01D6E615B2F46B002D5007 /* zip_source_layered.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723115B1B25E00236D3C /* zip_source_layered.c */; };
-               4B01D6E715B2F46B002D5007 /* zip_source_open.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723215B1B25E00236D3C /* zip_source_open.c */; };
-               4B01D6E815B2F46B002D5007 /* zip_source_pkware.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723315B1B25E00236D3C /* zip_source_pkware.c */; };
-               4B01D6EA15B2F46B002D5007 /* zip_source_read.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723515B1B25E00236D3C /* zip_source_read.c */; };
-               4B01D6EB15B2F46B002D5007 /* zip_source_stat.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723615B1B25E00236D3C /* zip_source_stat.c */; };
-               4B01D6EC15B2F46B002D5007 /* zip_source_window.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723715B1B25E00236D3C /* zip_source_window.c */; };
-               4B01D6ED15B2F46B002D5007 /* zip_source_zip_new.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723815B1B25E00236D3C /* zip_source_zip_new.c */; };
-               4B01D6EE15B2F46B002D5007 /* zip_source_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723915B1B25E00236D3C /* zip_source_zip.c */; };
-               4B01D6EF15B2F46B002D5007 /* zip_stat_index.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723A15B1B25E00236D3C /* zip_stat_index.c */; };
-               4B01D6F015B2F46B002D5007 /* zip_stat_init.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723B15B1B25E00236D3C /* zip_stat_init.c */; };
-               4B01D6F115B2F46B002D5007 /* zip_stat.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723C15B1B25E00236D3C /* zip_stat.c */; };
-               4B01D6F215B2F46B002D5007 /* zip_strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723D15B1B25E00236D3C /* zip_strerror.c */; };
-               4B01D6F315B2F46B002D5007 /* zip_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723E15B1B25E00236D3C /* zip_string.c */; };
-               4B01D6F415B2F46B002D5007 /* zip_unchange_all.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723F15B1B25E00236D3C /* zip_unchange_all.c */; };
-               4B01D6F515B2F46B002D5007 /* zip_unchange_archive.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724015B1B25E00236D3C /* zip_unchange_archive.c */; };
-               4B01D6F615B2F46B002D5007 /* zip_unchange_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724115B1B25E00236D3C /* zip_unchange_data.c */; };
-               4B01D6F715B2F46B002D5007 /* zip_unchange.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724215B1B25E00236D3C /* zip_unchange.c */; };
-               4B01D6F815B2F46B002D5007 /* zip_utf-8.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724315B1B25E00236D3C /* zip_utf-8.c */; };
-               4B01D70715B2F4C5002D5007 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; };
-               4B01D70915B2F4CF002D5007 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; };
-               4B01D70D15B2F4EB002D5007 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; };
-               4B01D70E15B2F4EB002D5007 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; };
-               4B01D72515B2F57B002D5007 /* zipcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B01D72115B2F572002D5007 /* zipcmp.c */; };
-               4B01D72615B2F57F002D5007 /* zipmerge.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B01D72215B2F572002D5007 /* zipmerge.c */; };
-               4B01D73215B2F5EE002D5007 /* zipconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDC729E15B1B4E900236D3C /* zipconf.h */; settings = {ATTRIBUTES = (Public, ); }; };
-               4B01D73415B2F5F4002D5007 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDC72A015B1B56400236D3C /* config.h */; };
-               4B01D73C15B2F6AF002D5007 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; };
-               4B0454B81E8E3E02002FA1F9 /* zip_source_get_compression_flags.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B71E8E3DF7002FA1F9 /* zip_source_get_compression_flags.c */; };
-               4B0454B91E8E3E03002FA1F9 /* zip_source_get_compression_flags.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B71E8E3DF7002FA1F9 /* zip_source_get_compression_flags.c */; };
-               4B0454BA1E8E3E08002FA1F9 /* zip_source_compress.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B61E8E3DF7002FA1F9 /* zip_source_compress.c */; };
-               4B0454BB1E8E3E09002FA1F9 /* zip_source_compress.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B61E8E3DF7002FA1F9 /* zip_source_compress.c */; };
-               4B0454BC1E8E3E24002FA1F9 /* zip_algorithm_bzip2.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B41E8E3DF7002FA1F9 /* zip_algorithm_bzip2.c */; };
-               4B0454BD1E8E3E24002FA1F9 /* zip_algorithm_deflate.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B51E8E3DF7002FA1F9 /* zip_algorithm_deflate.c */; };
-               4B0454BE1E8E3E25002FA1F9 /* zip_algorithm_bzip2.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B41E8E3DF7002FA1F9 /* zip_algorithm_bzip2.c */; };
-               4B0454BF1E8E3E25002FA1F9 /* zip_algorithm_deflate.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B51E8E3DF7002FA1F9 /* zip_algorithm_deflate.c */; };
-               4B3A5F501DF96EA8005A53A1 /* gladman-fcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3A5F4B1DF96D83005A53A1 /* gladman-fcrypt.c */; };
-               4B3A5F511DF96EA9005A53A1 /* gladman-fcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3A5F4B1DF96D83005A53A1 /* gladman-fcrypt.c */; };
-               4B3A5F521DF96EB4005A53A1 /* zip_fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3A5F4D1DF96D83005A53A1 /* zip_fseek.c */; };
-               4B3A5F531DF96EB4005A53A1 /* zip_ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3A5F4E1DF96D83005A53A1 /* zip_ftell.c */; };
-               4B3A5F541DF96EB5005A53A1 /* zip_fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3A5F4D1DF96D83005A53A1 /* zip_fseek.c */; };
-               4B3A5F551DF96EB5005A53A1 /* zip_ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3A5F4E1DF96D83005A53A1 /* zip_ftell.c */; };
-               4B82CED419915F360097BC18 /* zip_file_set_mtime.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B82CED319915F360097BC18 /* zip_file_set_mtime.c */; };
-               4B82CED519915F360097BC18 /* zip_file_set_mtime.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B82CED319915F360097BC18 /* zip_file_set_mtime.c */; };
-               4B97204F188EBE85002FAFAD /* zip_file_get_external_attributes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B97204D188EBE85002FAFAD /* zip_file_get_external_attributes.c */; };
-               4B972050188EBE85002FAFAD /* zip_file_get_external_attributes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B97204D188EBE85002FAFAD /* zip_file_get_external_attributes.c */; };
-               4B972051188EBE85002FAFAD /* zip_file_set_external_attributes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B97204E188EBE85002FAFAD /* zip_file_set_external_attributes.c */; };
-               4B972052188EBE85002FAFAD /* zip_file_set_external_attributes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B97204E188EBE85002FAFAD /* zip_file_set_external_attributes.c */; };
-               4BACD59315BC2CFA00920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; };
-               4BACD59415BC2D0800920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; };
-               4BACD59515BC2D1C00920691 /* ziptool.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD57C15BC2AEF00920691 /* ziptool.c */; };
-               4BACD5BB15BC2DC900920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; };
-               4BACD5BC15BC2DC900920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; };
-               4BACD5C315BC2DE000920691 /* add_from_filep.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD57715BC2AEF00920691 /* add_from_filep.c */; };
-               4BACD5CA15BC2DF200920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; };
-               4BACD5CB15BC2DF200920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; };
-               4BACD5D215BC2EFE00920691 /* fopen_unchanged.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD57A15BC2AEF00920691 /* fopen_unchanged.c */; };
-               4BACD5D915BC2F3700920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; };
-               4BACD5DA15BC2F3700920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; };
-               4BACD5E115BC2F4500920691 /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD57B15BC2AEF00920691 /* fread.c */; };
-               4BACD64A15BC301300920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; };
-               4BACD64B15BC301300920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; };
-               4BACD65315BC302500920691 /* tryopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD58415BC2AEF00920691 /* tryopen.c */; };
-               4BCB434219E9347E0067FAA3 /* zip_buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCB434119E9347E0067FAA3 /* zip_buffer.c */; };
-               4BCB434319E9347E0067FAA3 /* zip_buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCB434119E9347E0067FAA3 /* zip_buffer.c */; };
-               4BCF3021199A2F820064207B /* zip_io_util.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3019199A2F820064207B /* zip_io_util.c */; };
-               4BCF3022199A2F820064207B /* zip_io_util.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3019199A2F820064207B /* zip_io_util.c */; };
-               4BCF3023199A2F820064207B /* zip_source_begin_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301A199A2F820064207B /* zip_source_begin_write.c */; };
-               4BCF3024199A2F820064207B /* zip_source_begin_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301A199A2F820064207B /* zip_source_begin_write.c */; };
-               4BCF3025199A2F820064207B /* zip_source_commit_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301B199A2F820064207B /* zip_source_commit_write.c */; };
-               4BCF3026199A2F820064207B /* zip_source_commit_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301B199A2F820064207B /* zip_source_commit_write.c */; };
-               4BCF3027199A2F820064207B /* zip_source_rollback_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301C199A2F820064207B /* zip_source_rollback_write.c */; };
-               4BCF3028199A2F820064207B /* zip_source_rollback_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301C199A2F820064207B /* zip_source_rollback_write.c */; };
-               4BCF3029199A2F820064207B /* zip_source_seek.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301D199A2F820064207B /* zip_source_seek.c */; };
-               4BCF302A199A2F820064207B /* zip_source_seek.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301D199A2F820064207B /* zip_source_seek.c */; };
-               4BCF302B199A2F820064207B /* zip_source_supports.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301E199A2F820064207B /* zip_source_supports.c */; };
-               4BCF302C199A2F820064207B /* zip_source_supports.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301E199A2F820064207B /* zip_source_supports.c */; };
-               4BCF302D199A2F820064207B /* zip_source_tell.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301F199A2F820064207B /* zip_source_tell.c */; };
-               4BCF302E199A2F820064207B /* zip_source_tell.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301F199A2F820064207B /* zip_source_tell.c */; };
-               4BCF302F199A2F820064207B /* zip_source_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3020199A2F820064207B /* zip_source_write.c */; };
-               4BCF3030199A2F820064207B /* zip_source_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3020199A2F820064207B /* zip_source_write.c */; };
-               4BCF3032199ABD3A0064207B /* zip_source_remove.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3031199ABD3A0064207B /* zip_source_remove.c */; };
-               4BCF3033199ABD3A0064207B /* zip_source_remove.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3031199ABD3A0064207B /* zip_source_remove.c */; };
-               4BCF3036199ABDDA0064207B /* zip_source_seek_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3034199ABDDA0064207B /* zip_source_seek_write.c */; };
-               4BCF3037199ABDDA0064207B /* zip_source_seek_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3034199ABDDA0064207B /* zip_source_seek_write.c */; };
-               4BCF3038199ABDDA0064207B /* zip_source_tell_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3035199ABDDA0064207B /* zip_source_tell_write.c */; };
-               4BCF3039199ABDDA0064207B /* zip_source_tell_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3035199ABDDA0064207B /* zip_source_tell_write.c */; };
-               4BD5053319A0116D007DD28A /* zip_source_call.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD5053219A0116D007DD28A /* zip_source_call.c */; };
-               4BD5053419A01BB0007DD28A /* zip_source_call.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD5053219A0116D007DD28A /* zip_source_call.c */; };
-               4BD6CB5D19E6A5D900710654 /* source_hole.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD6CB5C19E6A5D900710654 /* source_hole.c */; };
-               4BD6CB6419E71CD100710654 /* source_hole.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD6CB5C19E6A5D900710654 /* source_hole.c */; };
-               4BD6CB6619E71CD100710654 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; };
-               4BD6CB6719E71CD100710654 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; };
-               4BD6CB6F19E71D6900710654 /* hole.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD6CB5E19E71B3B00710654 /* hole.c */; };
-               4BD708791EB1CF73003F351F /* zip_progress.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD708781EB1CF73003F351F /* zip_progress.c */; };
-               4BD7087A1EB1CF73003F351F /* zip_progress.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD708781EB1CF73003F351F /* zip_progress.c */; };
-               4BDC724415B1B25E00236D3C /* zip_add_dir.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F115B1B25E00236D3C /* zip_add_dir.c */; };
-               4BDC724515B1B25E00236D3C /* zip_add_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F215B1B25E00236D3C /* zip_add_entry.c */; };
-               4BDC724615B1B25E00236D3C /* zip_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F315B1B25E00236D3C /* zip_add.c */; };
-               4BDC724715B1B25E00236D3C /* zip_close.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F415B1B25E00236D3C /* zip_close.c */; };
-               4BDC724815B1B25E00236D3C /* zip_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F515B1B25E00236D3C /* zip_delete.c */; };
-               4BDC724915B1B25E00236D3C /* zip_dir_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F615B1B25E00236D3C /* zip_dir_add.c */; };
-               4BDC724A15B1B25E00236D3C /* zip_dirent.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F715B1B25E00236D3C /* zip_dirent.c */; };
-               4BDC724B15B1B25E00236D3C /* zip_discard.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F815B1B25E00236D3C /* zip_discard.c */; };
-               4BDC724C15B1B25E00236D3C /* zip_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F915B1B25E00236D3C /* zip_entry.c */; };
-               4BDC724D15B1B25E00236D3C /* zip_err_str.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FA15B1B25E00236D3C /* zip_err_str.c */; };
-               4BDC724E15B1B25E00236D3C /* zip_error_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FB15B1B25E00236D3C /* zip_error_clear.c */; };
-               4BDC724F15B1B25E00236D3C /* zip_error_get_sys_type.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FC15B1B25E00236D3C /* zip_error_get_sys_type.c */; };
-               4BDC725015B1B25E00236D3C /* zip_error_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FD15B1B25E00236D3C /* zip_error_get.c */; };
-               4BDC725115B1B25E00236D3C /* zip_error_strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FE15B1B25E00236D3C /* zip_error_strerror.c */; };
-               4BDC725215B1B25E00236D3C /* zip_error_to_str.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FF15B1B25E00236D3C /* zip_error_to_str.c */; };
-               4BDC725315B1B25E00236D3C /* zip_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720015B1B25E00236D3C /* zip_error.c */; };
-               4BDC725415B1B25E00236D3C /* zip_extra_field_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720115B1B25E00236D3C /* zip_extra_field_api.c */; };
-               4BDC725515B1B25E00236D3C /* zip_extra_field.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720215B1B25E00236D3C /* zip_extra_field.c */; };
-               4BDC725615B1B25E00236D3C /* zip_fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720315B1B25E00236D3C /* zip_fclose.c */; };
-               4BDC725715B1B25E00236D3C /* zip_fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720415B1B25E00236D3C /* zip_fdopen.c */; };
-               4BDC725815B1B25E00236D3C /* zip_file_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720515B1B25E00236D3C /* zip_file_add.c */; };
-               4BDC725915B1B25E00236D3C /* zip_file_error_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720615B1B25E00236D3C /* zip_file_error_clear.c */; };
-               4BDC725A15B1B25E00236D3C /* zip_file_error_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720715B1B25E00236D3C /* zip_file_error_get.c */; };
-               4BDC725B15B1B25E00236D3C /* zip_file_get_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720815B1B25E00236D3C /* zip_file_get_comment.c */; };
-               4BDC725C15B1B25E00236D3C /* zip_file_get_offset.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720915B1B25E00236D3C /* zip_file_get_offset.c */; };
-               4BDC725D15B1B25E00236D3C /* zip_file_rename.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720A15B1B25E00236D3C /* zip_file_rename.c */; };
-               4BDC725E15B1B25E00236D3C /* zip_file_replace.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720B15B1B25E00236D3C /* zip_file_replace.c */; };
-               4BDC725F15B1B25E00236D3C /* zip_file_set_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720C15B1B25E00236D3C /* zip_file_set_comment.c */; };
-               4BDC726015B1B25E00236D3C /* zip_file_strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720D15B1B25E00236D3C /* zip_file_strerror.c */; };
-               4BDC726115B1B25E00236D3C /* zip_filerange_crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720E15B1B25E00236D3C /* zip_filerange_crc.c */; };
-               4BDC726215B1B25E00236D3C /* zip_fopen_encrypted.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720F15B1B25E00236D3C /* zip_fopen_encrypted.c */; };
-               4BDC726315B1B25E00236D3C /* zip_fopen_index_encrypted.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721015B1B25E00236D3C /* zip_fopen_index_encrypted.c */; };
-               4BDC726415B1B25E00236D3C /* zip_fopen_index.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721115B1B25E00236D3C /* zip_fopen_index.c */; };
-               4BDC726515B1B25E00236D3C /* zip_fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721215B1B25E00236D3C /* zip_fopen.c */; };
-               4BDC726615B1B25E00236D3C /* zip_fread.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721315B1B25E00236D3C /* zip_fread.c */; };
-               4BDC726715B1B25E00236D3C /* zip_get_archive_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721415B1B25E00236D3C /* zip_get_archive_comment.c */; };
-               4BDC726815B1B25E00236D3C /* zip_get_archive_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721515B1B25E00236D3C /* zip_get_archive_flag.c */; };
-               4BDC726A15B1B25E00236D3C /* zip_get_encryption_implementation.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721715B1B25E00236D3C /* zip_get_encryption_implementation.c */; };
-               4BDC726B15B1B25E00236D3C /* zip_get_file_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721815B1B25E00236D3C /* zip_get_file_comment.c */; };
-               4BDC726C15B1B25E00236D3C /* zip_get_name.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721915B1B25E00236D3C /* zip_get_name.c */; };
-               4BDC726D15B1B25E00236D3C /* zip_get_num_entries.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721A15B1B25E00236D3C /* zip_get_num_entries.c */; };
-               4BDC726E15B1B25E00236D3C /* zip_get_num_files.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721B15B1B25E00236D3C /* zip_get_num_files.c */; };
-               4BDC726F15B1B25E00236D3C /* zip_memdup.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721C15B1B25E00236D3C /* zip_memdup.c */; };
-               4BDC727015B1B25E00236D3C /* zip_name_locate.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721D15B1B25E00236D3C /* zip_name_locate.c */; };
-               4BDC727115B1B25E00236D3C /* zip_new.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721E15B1B25E00236D3C /* zip_new.c */; };
-               4BDC727215B1B25E00236D3C /* zip_open.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721F15B1B25E00236D3C /* zip_open.c */; };
-               4BDC727315B1B25E00236D3C /* zip_rename.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722015B1B25E00236D3C /* zip_rename.c */; };
-               4BDC727415B1B25E00236D3C /* zip_replace.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722115B1B25E00236D3C /* zip_replace.c */; };
-               4BDC727515B1B25E00236D3C /* zip_set_archive_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722215B1B25E00236D3C /* zip_set_archive_comment.c */; };
-               4BDC727615B1B25E00236D3C /* zip_set_archive_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722315B1B25E00236D3C /* zip_set_archive_flag.c */; };
-               4BDC727715B1B25E00236D3C /* zip_set_default_password.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722415B1B25E00236D3C /* zip_set_default_password.c */; };
-               4BDC727815B1B25E00236D3C /* zip_set_file_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722515B1B25E00236D3C /* zip_set_file_comment.c */; };
-               4BDC727915B1B25E00236D3C /* zip_set_file_compression.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722615B1B25E00236D3C /* zip_set_file_compression.c */; };
-               4BDC727A15B1B25E00236D3C /* zip_set_name.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722715B1B25E00236D3C /* zip_set_name.c */; };
-               4BDC727B15B1B25E00236D3C /* zip_source_buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722815B1B25E00236D3C /* zip_source_buffer.c */; };
-               4BDC727C15B1B25E00236D3C /* zip_source_close.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722915B1B25E00236D3C /* zip_source_close.c */; };
-               4BDC727D15B1B25E00236D3C /* zip_source_crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722A15B1B25E00236D3C /* zip_source_crc.c */; };
-               4BDC727F15B1B25E00236D3C /* zip_source_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722C15B1B25E00236D3C /* zip_source_error.c */; };
-               4BDC728015B1B25E00236D3C /* zip_source_file.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722D15B1B25E00236D3C /* zip_source_file.c */; };
-               4BDC728115B1B25E00236D3C /* zip_source_filep.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722E15B1B25E00236D3C /* zip_source_filep.c */; };
-               4BDC728215B1B25E00236D3C /* zip_source_free.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722F15B1B25E00236D3C /* zip_source_free.c */; };
-               4BDC728315B1B25E00236D3C /* zip_source_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723015B1B25E00236D3C /* zip_source_function.c */; };
-               4BDC728415B1B25E00236D3C /* zip_source_layered.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723115B1B25E00236D3C /* zip_source_layered.c */; };
-               4BDC728515B1B25E00236D3C /* zip_source_open.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723215B1B25E00236D3C /* zip_source_open.c */; };
-               4BDC728615B1B25E00236D3C /* zip_source_pkware.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723315B1B25E00236D3C /* zip_source_pkware.c */; };
-               4BDC728815B1B25E00236D3C /* zip_source_read.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723515B1B25E00236D3C /* zip_source_read.c */; };
-               4BDC728915B1B25E00236D3C /* zip_source_stat.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723615B1B25E00236D3C /* zip_source_stat.c */; };
-               4BDC728A15B1B25E00236D3C /* zip_source_window.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723715B1B25E00236D3C /* zip_source_window.c */; };
-               4BDC728B15B1B25E00236D3C /* zip_source_zip_new.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723815B1B25E00236D3C /* zip_source_zip_new.c */; };
-               4BDC728C15B1B25E00236D3C /* zip_source_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723915B1B25E00236D3C /* zip_source_zip.c */; };
-               4BDC728D15B1B25E00236D3C /* zip_stat_index.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723A15B1B25E00236D3C /* zip_stat_index.c */; };
-               4BDC728E15B1B25E00236D3C /* zip_stat_init.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723B15B1B25E00236D3C /* zip_stat_init.c */; };
-               4BDC728F15B1B25E00236D3C /* zip_stat.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723C15B1B25E00236D3C /* zip_stat.c */; };
-               4BDC729015B1B25E00236D3C /* zip_strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723D15B1B25E00236D3C /* zip_strerror.c */; };
-               4BDC729115B1B25E00236D3C /* zip_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723E15B1B25E00236D3C /* zip_string.c */; };
-               4BDC729215B1B25E00236D3C /* zip_unchange_all.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723F15B1B25E00236D3C /* zip_unchange_all.c */; };
-               4BDC729315B1B25E00236D3C /* zip_unchange_archive.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724015B1B25E00236D3C /* zip_unchange_archive.c */; };
-               4BDC729415B1B25E00236D3C /* zip_unchange_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724115B1B25E00236D3C /* zip_unchange_data.c */; };
-               4BDC729515B1B25E00236D3C /* zip_unchange.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724215B1B25E00236D3C /* zip_unchange.c */; };
-               4BDC729615B1B25E00236D3C /* zip_utf-8.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724315B1B25E00236D3C /* zip_utf-8.c */; };
-               4BDC729B15B1B2C400236D3C /* zip.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDC729815B1B2A600236D3C /* zip.h */; settings = {ATTRIBUTES = (Public, ); }; };
-               4BDC729F15B1B4E900236D3C /* zipconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDC729E15B1B4E900236D3C /* zipconf.h */; settings = {ATTRIBUTES = (Public, ); }; };
-               736ED9BB1E3D6B6B00C36873 /* zip_source_winzip_aes_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9B91E3D688C00C36873 /* zip_source_winzip_aes_decode.c */; };
-               736ED9BC1E3D6B6F00C36873 /* zip_source_winzip_aes_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9BA1E3D688C00C36873 /* zip_source_winzip_aes_encode.c */; };
-               736ED9BD1E3D6B7200C36873 /* zip_random_unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9B81E3D688C00C36873 /* zip_random_unix.c */; };
-               736ED9BE1E3D6B7C00C36873 /* zip_file_set_encryption.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9B71E3D688C00C36873 /* zip_file_set_encryption.c */; };
-               736ED9BF1E3D6B7C00C36873 /* zip_file_set_encryption.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9B71E3D688C00C36873 /* zip_file_set_encryption.c */; };
-               736ED9C01E3D6B8000C36873 /* zip_random_unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9B81E3D688C00C36873 /* zip_random_unix.c */; };
-               736ED9C11E3D6B8300C36873 /* zip_source_winzip_aes_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9B91E3D688C00C36873 /* zip_source_winzip_aes_decode.c */; };
-               736ED9C21E3D6B8600C36873 /* zip_source_winzip_aes_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9BA1E3D688C00C36873 /* zip_source_winzip_aes_encode.c */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
-               3D7E35441B33064500022624 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D68A15B2F3F1002D5007;
-                       remoteInfo = libzip;
-               };
-               4B01D72C15B2F5AC002D5007 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D6FC15B2F4B1002D5007;
-                       remoteInfo = zipmerge;
-               };
-               4B01D72E15B2F5AC002D5007 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D70A15B2F4EB002D5007;
-                       remoteInfo = zipcmp;
-               };
-               4B01D73515B2F639002D5007 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D68A15B2F3F1002D5007;
-                       remoteInfo = "libzip Mac";
-               };
-               4B01D73715B2F643002D5007 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D68A15B2F3F1002D5007;
-                       remoteInfo = "libzip Mac";
-               };
-               4B2CADAB1C50D57800291DE6 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4BACD58815BC2CEA00920691;
-                       remoteInfo = ziptool;
-               };
-               4B54447E15C977AF0067BA33 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D72815B2F5A2002D5007;
-                       remoteInfo = "command line tools";
-               };
-               4B54448015C977B10067BA33 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4BACD5A715BC2D8200920691;
-                       remoteInfo = "test programs";
-               };
-               4BACD59615BC2D3800920691 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D68A15B2F3F1002D5007;
-                       remoteInfo = "libzip Mac";
-               };
-               4BACD5B715BC2DC900920691 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D68A15B2F3F1002D5007;
-                       remoteInfo = "libzip Mac";
-               };
-               4BACD5C615BC2DF200920691 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D68A15B2F3F1002D5007;
-                       remoteInfo = "libzip Mac";
-               };
-               4BACD5D515BC2F3700920691 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D68A15B2F3F1002D5007;
-                       remoteInfo = "libzip Mac";
-               };
-               4BACD64715BC301300920691 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D68A15B2F3F1002D5007;
-                       remoteInfo = "libzip Mac";
-               };
-               4BACD65415BC303B00920691 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4BACD5B515BC2DC900920691;
-                       remoteInfo = add_from_filep;
-               };
-               4BACD65615BC303B00920691 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4BACD5C415BC2DF200920691;
-                       remoteInfo = fopen_unchanged;
-               };
-               4BACD65815BC303B00920691 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4BACD5D315BC2F3700920691;
-                       remoteInfo = fread;
-               };
-               4BACD66815BC303B00920691 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4BACD64515BC301300920691;
-                       remoteInfo = tryopen;
-               };
-               4BCF6A781C3BDDF900F036E9 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 3D7E35361B3305FB00022624;
-                       remoteInfo = "in-memory";
-               };
-               4BCF6A7A1C3BDDFF00F036E9 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4BCF6A681C3BDDD500F036E9;
-                       remoteInfo = examples;
-               };
-               4BD6CB6119E71CD100710654 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4B01D68A15B2F3F1002D5007;
-                       remoteInfo = "libzip Mac";
-               };
-               4BD6CB6D19E71D0800710654 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 4BD6CB5F19E71CD100710654;
-                       remoteInfo = hole;
-               };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
-               3D7E35351B3305FB00022624 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 2147483647;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 1;
-               };
-               4B01D6FB15B2F4B1002D5007 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 2147483647;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 1;
-               };
-               4B01D70F15B2F4EB002D5007 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 2147483647;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 1;
-               };
-               4BACD58715BC2CEA00920691 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 12;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD5BD15BC2DC900920691 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 12;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD5CC15BC2DF200920691 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 12;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD5DB15BC2F3700920691 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 12;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD64C15BC301300920691 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 12;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BD6CB6819E71CD100710654 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 12;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
-               3D77B86517009AA1000A5794 /* extract-version.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "extract-version.sh"; sourceTree = SOURCE_ROOT; };
-               3D7E35371B3305FB00022624 /* in-memory */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "in-memory"; sourceTree = BUILT_PRODUCTS_DIR; };
-               3D7E35401B33063600022624 /* in-memory.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "in-memory.c"; sourceTree = "<group>"; };
-               3D7E35421B33063600022624 /* windows-open.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "windows-open.c"; sourceTree = "<group>"; };
-               3D7E35471B33076C00022624 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
-               3D9284801C309510001EABA7 /* zip_hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_hash.c; sourceTree = "<group>"; usesTabs = 1; };
-               4B01D68B15B2F3F1002D5007 /* libzip.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = libzip.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-               4B01D6FD15B2F4B1002D5007 /* zipmerge */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = zipmerge; sourceTree = BUILT_PRODUCTS_DIR; };
-               4B01D70815B2F4CF002D5007 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; };
-               4B01D71315B2F4EB002D5007 /* zipcmp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = zipcmp; sourceTree = BUILT_PRODUCTS_DIR; };
-               4B01D72115B2F572002D5007 /* zipcmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zipcmp.c; sourceTree = "<group>"; };
-               4B01D72215B2F572002D5007 /* zipmerge.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zipmerge.c; sourceTree = "<group>"; };
-               4B01D73D15B2FB6B002D5007 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
-               4B0454B41E8E3DF7002FA1F9 /* zip_algorithm_bzip2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_algorithm_bzip2.c; sourceTree = "<group>"; };
-               4B0454B51E8E3DF7002FA1F9 /* zip_algorithm_deflate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_algorithm_deflate.c; sourceTree = "<group>"; };
-               4B0454B61E8E3DF7002FA1F9 /* zip_source_compress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_compress.c; sourceTree = "<group>"; };
-               4B0454B71E8E3DF7002FA1F9 /* zip_source_get_compression_flags.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_get_compression_flags.c; sourceTree = "<group>"; };
-               4B1ABD1A1A2E5DA700C93867 /* links */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = links; sourceTree = "<group>"; };
-               4B1ABD1B1A2E5E4D00C93867 /* handle_links */ = {isa = PBXFileReference; explicitFileType = text.script.perl; fileEncoding = 4; path = handle_links; sourceTree = "<group>"; };
-               4B1E46E51A08CB7600A376D2 /* zip_error_code_system.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_code_system.mdoc; sourceTree = "<group>"; };
-               4B1E46E61A08CB7600A376D2 /* zip_error_code_zip.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_code_zip.mdoc; sourceTree = "<group>"; };
-               4B1E46E71A08CB7600A376D2 /* zip_error_fini.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_fini.mdoc; sourceTree = "<group>"; };
-               4B1E46E81A08CB7600A376D2 /* zip_error_init.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_init.mdoc; sourceTree = "<group>"; };
-               4B1E46E91A08CB7600A376D2 /* zip_error_set.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_set.mdoc; sourceTree = "<group>"; };
-               4B1E46EA1A08CB7600A376D2 /* zip_error_strerror.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_strerror.mdoc; sourceTree = "<group>"; };
-               4B1E46EB1A08CB7600A376D2 /* zip_error_system_type.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_system_type.mdoc; sourceTree = "<group>"; };
-               4B26FF141A07DF1A000E9788 /* Makefile.am */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; indentWidth = 8; path = Makefile.am; sourceTree = "<group>"; usesTabs = 1; };
-               4B26FF151A07DF1A000E9788 /* zip_file_get_external_attributes.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_get_external_attributes.mdoc; sourceTree = "<group>"; };
-               4B26FF161A07DF1A000E9788 /* zip_file_set_external_attributes.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_set_external_attributes.mdoc; sourceTree = "<group>"; };
-               4B26FF171A07DF1A000E9788 /* zip_file_set_mtime.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_set_mtime.mdoc; sourceTree = "<group>"; };
-               4B26FF181A07DFEA000E9788 /* mkdocset.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = mkdocset.pl; sourceTree = "<group>"; };
-               4B28A9EC15BACC3900D0C17D /* libzip.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = libzip.mdoc; sourceTree = "<group>"; };
-               4B28A9ED15BACC3900D0C17D /* zip_add_dir.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_add_dir.mdoc; sourceTree = "<group>"; };
-               4B28A9EE15BACC3900D0C17D /* zip_add.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_add.mdoc; sourceTree = "<group>"; };
-               4B28A9EF15BACC3900D0C17D /* zip_close.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_close.mdoc; sourceTree = "<group>"; };
-               4B28A9F015BACC3900D0C17D /* zip_delete.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_delete.mdoc; sourceTree = "<group>"; };
-               4B28A9F115BACC3900D0C17D /* zip_dir_add.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_dir_add.mdoc; sourceTree = "<group>"; };
-               4B28A9F215BACC3900D0C17D /* zip_discard.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_discard.mdoc; sourceTree = "<group>"; };
-               4B28A9F315BACC3900D0C17D /* zip_error_clear.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_clear.mdoc; sourceTree = "<group>"; };
-               4B28A9F415BACC3900D0C17D /* zip_error_get_sys_type.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_get_sys_type.mdoc; sourceTree = "<group>"; };
-               4B28A9F515BACC3900D0C17D /* zip_error_get.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_get.mdoc; sourceTree = "<group>"; };
-               4B28A9F615BACC3900D0C17D /* zip_error_to_str.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_to_str.mdoc; sourceTree = "<group>"; };
-               4B28A9F715BACC3900D0C17D /* zip_errors.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_errors.mdoc; sourceTree = "<group>"; };
-               4B28A9F815BACC3900D0C17D /* zip_fclose.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fclose.mdoc; sourceTree = "<group>"; };
-               4B28A9F915BACC3900D0C17D /* zip_fdopen.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fdopen.mdoc; sourceTree = "<group>"; };
-               4B28A9FA15BACC3900D0C17D /* zip_file_add.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_add.mdoc; sourceTree = "<group>"; };
-               4B28A9FB15BACC3900D0C17D /* zip_file_extra_field_delete.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_extra_field_delete.mdoc; sourceTree = "<group>"; };
-               4B28A9FC15BACC3900D0C17D /* zip_file_extra_field_get.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_extra_field_get.mdoc; sourceTree = "<group>"; };
-               4B28A9FD15BACC3900D0C17D /* zip_file_extra_field_set.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_extra_field_set.mdoc; sourceTree = "<group>"; };
-               4B28A9FE15BACC3900D0C17D /* zip_file_extra_fields_count.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_extra_fields_count.mdoc; sourceTree = "<group>"; };
-               4B28A9FF15BACC3900D0C17D /* zip_file_get_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_get_comment.mdoc; sourceTree = "<group>"; };
-               4B28AA0015BACC3900D0C17D /* zip_file_rename.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_rename.mdoc; sourceTree = "<group>"; };
-               4B28AA0115BACC3900D0C17D /* zip_file_set_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_set_comment.mdoc; sourceTree = "<group>"; };
-               4B28AA0215BACC3900D0C17D /* zip_file_strerror.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_strerror.mdoc; sourceTree = "<group>"; };
-               4B28AA0315BACC3900D0C17D /* zip_fopen_encrypted.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fopen_encrypted.mdoc; sourceTree = "<group>"; };
-               4B28AA0415BACC3900D0C17D /* zip_fopen.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fopen.mdoc; sourceTree = "<group>"; };
-               4B28AA0515BACC3900D0C17D /* zip_fread.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fread.mdoc; sourceTree = "<group>"; };
-               4B28AA0615BACC3900D0C17D /* zip_get_archive_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_archive_comment.mdoc; sourceTree = "<group>"; };
-               4B28AA0715BACC3900D0C17D /* zip_get_archive_flag.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_archive_flag.mdoc; sourceTree = "<group>"; };
-               4B28AA0815BACC3900D0C17D /* zip_get_file_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_file_comment.mdoc; sourceTree = "<group>"; };
-               4B28AA0915BACC3900D0C17D /* zip_get_name.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_name.mdoc; sourceTree = "<group>"; };
-               4B28AA0A15BACC3900D0C17D /* zip_get_num_entries.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_num_entries.mdoc; sourceTree = "<group>"; };
-               4B28AA0B15BACC3900D0C17D /* zip_get_num_files.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_num_files.mdoc; sourceTree = "<group>"; };
-               4B28AA0C15BACC3900D0C17D /* zip_name_locate.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_name_locate.mdoc; sourceTree = "<group>"; };
-               4B28AA0D15BACC3900D0C17D /* zip_open.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_open.mdoc; sourceTree = "<group>"; };
-               4B28AA0E15BACC3900D0C17D /* zip_rename.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_rename.mdoc; sourceTree = "<group>"; };
-               4B28AA0F15BACC3900D0C17D /* zip_set_archive_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_archive_comment.mdoc; sourceTree = "<group>"; };
-               4B28AA1015BACC3900D0C17D /* zip_set_archive_flag.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_archive_flag.mdoc; sourceTree = "<group>"; };
-               4B28AA1115BACC3900D0C17D /* zip_set_default_password.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_default_password.mdoc; sourceTree = "<group>"; };
-               4B28AA1215BACC3900D0C17D /* zip_set_file_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_file_comment.mdoc; sourceTree = "<group>"; };
-               4B28AA1315BACC3900D0C17D /* zip_set_file_compression.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_file_compression.mdoc; sourceTree = "<group>"; };
-               4B28AA1415BACC3900D0C17D /* zip_source_buffer.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_buffer.mdoc; sourceTree = "<group>"; };
-               4B28AA1515BACC3900D0C17D /* zip_source_file.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_file.mdoc; sourceTree = "<group>"; };
-               4B28AA1615BACC3900D0C17D /* zip_source_filep.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_filep.mdoc; sourceTree = "<group>"; };
-               4B28AA1715BACC3900D0C17D /* zip_source_free.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_free.mdoc; sourceTree = "<group>"; };
-               4B28AA1815BACC3900D0C17D /* zip_source_function.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_function.mdoc; sourceTree = "<group>"; };
-               4B28AA1915BACC3900D0C17D /* zip_source_zip.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_zip.mdoc; sourceTree = "<group>"; };
-               4B28AA1A15BACC3900D0C17D /* zip_stat_init.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_stat_init.mdoc; sourceTree = "<group>"; };
-               4B28AA1B15BACC3900D0C17D /* zip_stat.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_stat.mdoc; sourceTree = "<group>"; };
-               4B28AA1C15BACC3900D0C17D /* zip_unchange_all.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_unchange_all.mdoc; sourceTree = "<group>"; };
-               4B28AA1D15BACC3900D0C17D /* zip_unchange_archive.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_unchange_archive.mdoc; sourceTree = "<group>"; };
-               4B28AA1E15BACC3900D0C17D /* zip_unchange.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_unchange.mdoc; sourceTree = "<group>"; };
-               4B28AA1F15BACC3900D0C17D /* zipcmp.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zipcmp.mdoc; sourceTree = "<group>"; };
-               4B28AA2015BACC3900D0C17D /* zipmerge.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zipmerge.mdoc; sourceTree = "<group>"; };
-               4B28AA2115BACC3900D0C17D /* ziptorrent.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = ziptorrent.mdoc; sourceTree = "<group>"; };
-               4B28AA2215BAD4E200D0C17D /* API-CHANGES */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "API-CHANGES"; sourceTree = "<group>"; };
-               4B28AA2315BAD4E200D0C17D /* AUTHORS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AUTHORS; sourceTree = "<group>"; };
-               4B28AA2415BAD4E200D0C17D /* NEWS.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = NEWS.md; sourceTree = "<group>"; };
-               4B28AA2515BAD4E200D0C17D /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
-               4B28AA2615BAD4E200D0C17D /* THANKS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = THANKS; sourceTree = "<group>"; };
-               4B28AA2715BAD4E200D0C17D /* TODO.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = TODO.md; sourceTree = "<group>"; };
-               4B3A5F4A1DF96D83005A53A1 /* gladman-fcrypt */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "gladman-fcrypt"; sourceTree = "<group>"; };
-               4B3A5F4B1DF96D83005A53A1 /* gladman-fcrypt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "gladman-fcrypt.c"; sourceTree = "<group>"; };
-               4B3A5F4C1DF96D83005A53A1 /* gladman-fcrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gladman-fcrypt.h"; sourceTree = "<group>"; };
-               4B3A5F4D1DF96D83005A53A1 /* zip_fseek.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_fseek.c; sourceTree = "<group>"; };
-               4B3A5F4E1DF96D83005A53A1 /* zip_ftell.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_ftell.c; sourceTree = "<group>"; };
-               4B82CED319915F360097BC18 /* zip_file_set_mtime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_file_set_mtime.c; sourceTree = "<group>"; };
-               4B97204D188EBE85002FAFAD /* zip_file_get_external_attributes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_file_get_external_attributes.c; sourceTree = "<group>"; };
-               4B97204E188EBE85002FAFAD /* zip_file_set_external_attributes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_file_set_external_attributes.c; sourceTree = "<group>"; };
-               4BACD57715BC2AEF00920691 /* add_from_filep.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = add_from_filep.c; path = ../regress/add_from_filep.c; sourceTree = "<group>"; };
-               4BACD57A15BC2AEF00920691 /* fopen_unchanged.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = fopen_unchanged.c; path = ../regress/fopen_unchanged.c; sourceTree = "<group>"; };
-               4BACD57B15BC2AEF00920691 /* fread.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = fread.c; path = ../regress/fread.c; sourceTree = "<group>"; };
-               4BACD57C15BC2AEF00920691 /* ziptool.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ziptool.c; sourceTree = "<group>"; };
-               4BACD58415BC2AEF00920691 /* tryopen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = tryopen.c; path = ../regress/tryopen.c; sourceTree = "<group>"; };
-               4BACD58915BC2CEA00920691 /* ziptool */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ziptool; sourceTree = BUILT_PRODUCTS_DIR; };
-               4BACD5C115BC2DC900920691 /* add_from_filep */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = add_from_filep; sourceTree = BUILT_PRODUCTS_DIR; };
-               4BACD5D015BC2DF200920691 /* fopen_unchanged */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fopen_unchanged; sourceTree = BUILT_PRODUCTS_DIR; };
-               4BACD5DF15BC2F3700920691 /* fread */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fread; sourceTree = BUILT_PRODUCTS_DIR; };
-               4BACD65015BC301300920691 /* tryopen */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = tryopen; sourceTree = BUILT_PRODUCTS_DIR; };
-               4BC3863E1A1BE00E00CDCAAC /* zip_get_error.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_error.mdoc; sourceTree = "<group>"; };
-               4BC3863F1A1BE00E00CDCAAC /* zip_source_begin_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_begin_write.mdoc; sourceTree = "<group>"; };
-               4BC386401A1BE00E00CDCAAC /* zip_source_close.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_close.mdoc; sourceTree = "<group>"; };
-               4BC386411A1BE00E00CDCAAC /* zip_source_commit_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_commit_write.mdoc; sourceTree = "<group>"; };
-               4BC386421A1BE00E00CDCAAC /* zip_source_error.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_error.mdoc; sourceTree = "<group>"; };
-               4BC386431A1BE00E00CDCAAC /* ZIP_SOURCE_GET_ARGS.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = ZIP_SOURCE_GET_ARGS.mdoc; sourceTree = "<group>"; };
-               4BC386441A1BE00E00CDCAAC /* zip_source_is_deleted.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_is_deleted.mdoc; sourceTree = "<group>"; };
-               4BC386451A1BE00E00CDCAAC /* zip_source_keep.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_keep.mdoc; sourceTree = "<group>"; };
-               4BC386461A1BE00E00CDCAAC /* zip_source_make_command_bitmap.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_make_command_bitmap.mdoc; sourceTree = "<group>"; };
-               4BC386471A1BE00E00CDCAAC /* zip_source_open.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_open.mdoc; sourceTree = "<group>"; };
-               4BC386481A1BE00E00CDCAAC /* zip_source_read.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_read.mdoc; sourceTree = "<group>"; };
-               4BC386491A1BE00E00CDCAAC /* zip_source_rollback_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_rollback_write.mdoc; sourceTree = "<group>"; };
-               4BC3864A1A1BE00E00CDCAAC /* zip_source_seek_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_seek_write.mdoc; sourceTree = "<group>"; };
-               4BC3864B1A1BE00E00CDCAAC /* zip_source_seek.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_seek.mdoc; sourceTree = "<group>"; };
-               4BC3864C1A1BE00E00CDCAAC /* zip_source_stat.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_stat.mdoc; sourceTree = "<group>"; };
-               4BC3864D1A1BE00E00CDCAAC /* zip_source_tell_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_tell_write.mdoc; sourceTree = "<group>"; };
-               4BC3864E1A1BE00E00CDCAAC /* zip_source_tell.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_tell.mdoc; sourceTree = "<group>"; };
-               4BC3864F1A1BE00E00CDCAAC /* zip_source_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_write.mdoc; sourceTree = "<group>"; };
-               4BC386501A1BE00E00CDCAAC /* zip_source.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source.mdoc; sourceTree = "<group>"; };
-               4BC386511A1BE04700CDCAAC /* fix-man-links.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "fix-man-links.sh"; sourceTree = "<group>"; };
-               4BC386521A1BE04700CDCAAC /* make_zip_errors.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = make_zip_errors.sh; sourceTree = "<group>"; };
-               4BC386531A1BE04700CDCAAC /* nih-man.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = "nih-man.css"; sourceTree = "<group>"; };
-               4BC972001A0A1D85003A2981 /* zip_error_to_data.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_to_data.mdoc; sourceTree = "<group>"; };
-               4BCB434119E9347E0067FAA3 /* zip_buffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_buffer.c; sourceTree = "<group>"; };
-               4BCD54C41AB05AA90003D379 /* zip_source_win32a.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_source_win32a.c; sourceTree = "<group>"; };
-               4BCD54C61AB05AA90003D379 /* zip_source_win32utf8.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_source_win32utf8.c; sourceTree = "<group>"; };
-               4BCD54C71AB05AA90003D379 /* zip_source_win32w.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_source_win32w.c; sourceTree = "<group>"; };
-               4BCD54C81AB05AA90003D379 /* zipwin32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zipwin32.h; sourceTree = "<group>"; };
-               4BCD77A71A14E404001A9F55 /* zip_file_get_error.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_get_error.mdoc; sourceTree = "<group>"; };
-               4BCD77A81A14E921001A9F55 /* zip_source_seek_compute_offset.mdoc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zip_source_seek_compute_offset.mdoc; sourceTree = "<group>"; };
-               4BCD77A91A14ED5C001A9F55 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
-               4BCF3019199A2F820064207B /* zip_io_util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_io_util.c; sourceTree = "<group>"; };
-               4BCF301A199A2F820064207B /* zip_source_begin_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_begin_write.c; sourceTree = "<group>"; };
-               4BCF301B199A2F820064207B /* zip_source_commit_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_commit_write.c; sourceTree = "<group>"; };
-               4BCF301C199A2F820064207B /* zip_source_rollback_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_rollback_write.c; sourceTree = "<group>"; };
-               4BCF301D199A2F820064207B /* zip_source_seek.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_seek.c; sourceTree = "<group>"; };
-               4BCF301E199A2F820064207B /* zip_source_supports.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_supports.c; sourceTree = "<group>"; };
-               4BCF301F199A2F820064207B /* zip_source_tell.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_tell.c; sourceTree = "<group>"; };
-               4BCF3020199A2F820064207B /* zip_source_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_write.c; sourceTree = "<group>"; };
-               4BCF3031199ABD3A0064207B /* zip_source_remove.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_remove.c; sourceTree = "<group>"; };
-               4BCF3034199ABDDA0064207B /* zip_source_seek_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_seek_write.c; sourceTree = "<group>"; };
-               4BCF3035199ABDDA0064207B /* zip_source_tell_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_tell_write.c; sourceTree = "<group>"; };
-               4BD155CE191CD28D0046F012 /* NiHTest.pm */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.script.perl; path = NiHTest.pm; sourceTree = "<group>"; tabWidth = 4; usesTabs = 1; };
-               4BD155CF191CD28D0046F012 /* runtest.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = runtest.in; sourceTree = "<group>"; };
-               4BD25DA51CF58790005A9EC4 /* compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compat.h; sourceTree = "<group>"; };
-               4BD35E411A33366200256CB7 /* add_dir.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_dir.test; sourceTree = "<group>"; };
-               4BD35E421A33366200256CB7 /* add_from_buffer.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_buffer.test; sourceTree = "<group>"; };
-               4BD35E431A33366200256CB7 /* add_from_file_duplicate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_file_duplicate.test; sourceTree = "<group>"; };
-               4BD35E441A33366200256CB7 /* add_from_file_twice_duplicate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_file_twice_duplicate.test; sourceTree = "<group>"; };
-               4BD35E451A33366200256CB7 /* add_from_file.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_file.test; sourceTree = "<group>"; };
-               4BD35E461A33366200256CB7 /* add_from_filep.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_filep.test; sourceTree = "<group>"; };
-               4BD35E471A33366200256CB7 /* add_from_stdin.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_stdin.test; sourceTree = "<group>"; };
-               4BD35E481A33366200256CB7 /* add_from_zip_closed.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_closed.test; sourceTree = "<group>"; };
-               4BD35E491A33366200256CB7 /* add_from_zip_deflated.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_deflated.test; sourceTree = "<group>"; };
-               4BD35E4A1A33366200256CB7 /* add_from_zip_partial_deflated.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_partial_deflated.test; sourceTree = "<group>"; };
-               4BD35E4B1A33366200256CB7 /* add_from_zip_partial_stored.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_partial_stored.test; sourceTree = "<group>"; };
-               4BD35E4C1A33366200256CB7 /* add_from_zip_stored.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_stored.test; sourceTree = "<group>"; };
-               4BD35E4D1A33366200256CB7 /* add_from_zip.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip.test; sourceTree = "<group>"; };
-               4BD35E4E1A33366200256CB7 /* add_stored_in_memory.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_stored_in_memory.test; sourceTree = "<group>"; };
-               4BD35E4F1A33366200256CB7 /* add_stored.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_stored.test; sourceTree = "<group>"; };
-               4BD35E501A33366200256CB7 /* cm-default.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "cm-default.test"; sourceTree = "<group>"; };
-               4BD35E511A33366200256CB7 /* delete_add_same.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_add_same.test; sourceTree = "<group>"; };
-               4BD35E521A33366200256CB7 /* delete_invalid.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_invalid.test; sourceTree = "<group>"; };
-               4BD35E531A33366200256CB7 /* delete_last.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_last.test; sourceTree = "<group>"; };
-               4BD35E541A33366200256CB7 /* delete_multiple_last.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_multiple_last.test; sourceTree = "<group>"; };
-               4BD35E551A33366200256CB7 /* delete_multiple_partial.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_multiple_partial.test; sourceTree = "<group>"; };
-               4BD35E561A33366200256CB7 /* delete_renamed_rename.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_renamed_rename.test; sourceTree = "<group>"; };
-               4BD35E5B1A33366200256CB7 /* encrypt.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = encrypt.test; sourceTree = "<group>"; };
-               4BD35E5C1A33366200256CB7 /* extra_add_multiple.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_add_multiple.test; sourceTree = "<group>"; };
-               4BD35E5D1A33366200256CB7 /* extra_add.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_add.test; sourceTree = "<group>"; };
-               4BD35E5E1A33366200256CB7 /* extra_count_by_id.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_count_by_id.test; sourceTree = "<group>"; };
-               4BD35E5F1A33366200256CB7 /* extra_count_ignore_zip64.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_count_ignore_zip64.test; sourceTree = "<group>"; };
-               4BD35E601A33366200256CB7 /* extra_count.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_count.test; sourceTree = "<group>"; };
-               4BD35E611A33366200256CB7 /* extra_delete_by_id.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_delete_by_id.test; sourceTree = "<group>"; };
-               4BD35E621A33366200256CB7 /* extra_delete.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_delete.test; sourceTree = "<group>"; };
-               4BD35E631A33366200256CB7 /* extra_get_by_id.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_get_by_id.test; sourceTree = "<group>"; };
-               4BD35E641A33366200256CB7 /* extra_get.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_get.test; sourceTree = "<group>"; };
-               4BD35E651A33366200256CB7 /* extra_set_modify_c.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_set_modify_c.test; sourceTree = "<group>"; };
-               4BD35E661A33366200256CB7 /* extra_set_modify_l.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_set_modify_l.test; sourceTree = "<group>"; };
-               4BD35E671A33366200256CB7 /* extra_set.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_set.test; sourceTree = "<group>"; };
-               4BD35E681A33366200256CB7 /* file_comment_encmismatch.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = file_comment_encmismatch.test; sourceTree = "<group>"; };
-               4BD35E691A33366200256CB7 /* fopen_unchanged.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fopen_unchanged.test; sourceTree = "<group>"; };
-               4BD35E6A1A33366200256CB7 /* fread.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fread.test; sourceTree = "<group>"; };
-               4BD35E6B1A33366200256CB7 /* get_comment.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = get_comment.test; sourceTree = "<group>"; };
-               4BD35E8E1A33366200256CB7 /* name_locate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = name_locate.test; sourceTree = "<group>"; };
-               4BD35E8F1A33366200256CB7 /* open_cons_extrabytes.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_cons_extrabytes.test; sourceTree = "<group>"; };
-               4BD35E901A33366200256CB7 /* open_empty_2.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_empty_2.test; sourceTree = "<group>"; };
-               4BD35E911A33366200256CB7 /* open_empty.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_empty.test; sourceTree = "<group>"; };
-               4BD35E921A33366200256CB7 /* open_extrabytes.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_extrabytes.test; sourceTree = "<group>"; };
-               4BD35E931A33366200256CB7 /* open_filename_duplicate_consistency.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_duplicate_consistency.test; sourceTree = "<group>"; };
-               4BD35E941A33366200256CB7 /* open_filename_duplicate_empty_consistency.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_duplicate_empty_consistency.test; sourceTree = "<group>"; };
-               4BD35E951A33366200256CB7 /* open_filename_duplicate_empty.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_duplicate_empty.test; sourceTree = "<group>"; };
-               4BD35E961A33366200256CB7 /* open_filename_duplicate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_duplicate.test; sourceTree = "<group>"; };
-               4BD35E971A33366200256CB7 /* open_filename_empty.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_empty.test; sourceTree = "<group>"; };
-               4BD35E981A33366200256CB7 /* open_incons.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_incons.test; sourceTree = "<group>"; };
-               4BD35E991A33366200256CB7 /* open_many_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_many_ok.test; sourceTree = "<group>"; };
-               4BD35E9A1A33366200256CB7 /* open_new_but_exists.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_new_but_exists.test; sourceTree = "<group>"; };
-               4BD35E9B1A33366200256CB7 /* open_new_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_new_ok.test; sourceTree = "<group>"; };
-               4BD35E9C1A33366200256CB7 /* open_nonarchive.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_nonarchive.test; sourceTree = "<group>"; };
-               4BD35E9D1A33366200256CB7 /* open_nosuchfile.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_nosuchfile.test; sourceTree = "<group>"; };
-               4BD35E9E1A33366200256CB7 /* open_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_ok.test; sourceTree = "<group>"; };
-               4BD35E9F1A33366200256CB7 /* open_too_short.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_too_short.test; sourceTree = "<group>"; };
-               4BD35EA01A33366200256CB7 /* open_truncate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_truncate.test; sourceTree = "<group>"; };
-               4BD35EA11A33366200256CB7 /* open_zip64_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_zip64_ok.test; sourceTree = "<group>"; };
-               4BD35EA21A33366200256CB7 /* rename_ascii.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_ascii.test; sourceTree = "<group>"; };
-               4BD35EA31A33366200256CB7 /* rename_cp437.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_cp437.test; sourceTree = "<group>"; };
-               4BD35EA41A33366200256CB7 /* rename_deleted.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_deleted.test; sourceTree = "<group>"; };
-               4BD35EA51A33366200256CB7 /* rename_fail.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_fail.test; sourceTree = "<group>"; };
-               4BD35EA61A33366200256CB7 /* rename_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_ok.test; sourceTree = "<group>"; };
-               4BD35EA81A33366200256CB7 /* rename_utf8_encmismatch.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_utf8_encmismatch.test; sourceTree = "<group>"; };
-               4BD35EA91A33366200256CB7 /* rename_utf8.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_utf8.test; sourceTree = "<group>"; };
-               4BD35EAA1A33366200256CB7 /* set_comment_all.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_comment_all.test; sourceTree = "<group>"; };
-               4BD35EAB1A33366200256CB7 /* set_comment_localonly.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_comment_localonly.test; sourceTree = "<group>"; };
-               4BD35EAC1A33366200256CB7 /* set_comment_removeglobal.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_comment_removeglobal.test; sourceTree = "<group>"; };
-               4BD35EAD1A33366200256CB7 /* set_comment_revert.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_comment_revert.test; sourceTree = "<group>"; };
-               4BD35EAE1A33366200256CB7 /* set_compression_deflate_to_deflate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_deflate_to_deflate.test; sourceTree = "<group>"; };
-               4BD35EAF1A33366200256CB7 /* set_compression_deflate_to_store.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_deflate_to_store.test; sourceTree = "<group>"; };
-               4BD35EB01A33366200256CB7 /* set_compression_store_to_deflate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_store_to_deflate.test; sourceTree = "<group>"; };
-               4BD35EB11A33366200256CB7 /* set_compression_store_to_store.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_store_to_store.test; sourceTree = "<group>"; };
-               4BD35EB21A33366200256CB7 /* set_compression_unknown.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_unknown.test; sourceTree = "<group>"; };
-               4BD35EB31A33366200256CB7 /* set_mtime.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_mtime.test; sourceTree = "<group>"; };
-               4BD35EB41A33366200256CB7 /* stat_index_cp437_guess.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_cp437_guess.test; sourceTree = "<group>"; };
-               4BD35EB51A33366200256CB7 /* stat_index_cp437_raw.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_cp437_raw.test; sourceTree = "<group>"; };
-               4BD35EB61A33366200256CB7 /* stat_index_cp437_strict.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_cp437_strict.test; sourceTree = "<group>"; };
-               4BD35EB71A33366200256CB7 /* stat_index_fileorder.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_fileorder.test; sourceTree = "<group>"; };
-               4BD35EB81A33366200256CB7 /* stat_index_streamed_zip64.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_streamed_zip64.test; sourceTree = "<group>"; };
-               4BD35EB91A33366200256CB7 /* stat_index_streamed.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_streamed.test; sourceTree = "<group>"; };
-               4BD35EBA1A33366200256CB7 /* stat_index_utf8_guess.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_utf8_guess.test; sourceTree = "<group>"; };
-               4BD35EBB1A33366200256CB7 /* stat_index_utf8_raw.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_utf8_raw.test; sourceTree = "<group>"; };
-               4BD35EBC1A33366200256CB7 /* stat_index_utf8_strict.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_utf8_strict.test; sourceTree = "<group>"; };
-               4BD35EBD1A33366200256CB7 /* stat_index_utf8_unmarked_strict.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_utf8_unmarked_strict.test; sourceTree = "<group>"; };
-               4BD35EBE1A33366200256CB7 /* stat_index_zip64.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_zip64.test; sourceTree = "<group>"; };
-               4BD35EDD1A33366300256CB7 /* torrent-already.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "torrent-already.test"; sourceTree = "<group>"; };
-               4BD35EDE1A33366300256CB7 /* torrent-new.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "torrent-new.test"; sourceTree = "<group>"; };
-               4BD35EE11A33366300256CB7 /* utf-8-standardization.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "utf-8-standardization.test"; sourceTree = "<group>"; };
-               4BD35EE31A33366300256CB7 /* zip64_creation.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zip64_creation.test; sourceTree = "<group>"; };
-               4BD35EE41A33366300256CB7 /* zip64_stored_creation.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zip64_stored_creation.test; sourceTree = "<group>"; };
-               4BD35EE61A33407200256CB7 /* Makefile.am */ = {isa = PBXFileReference; indentWidth = 8; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; usesTabs = 1; };
-               4BD5053219A0116D007DD28A /* zip_source_call.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_call.c; sourceTree = "<group>"; };
-               4BD6CB5C19E6A5D900710654 /* source_hole.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = source_hole.c; sourceTree = "<group>"; };
-               4BD6CB5E19E71B3B00710654 /* hole.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hole.c; sourceTree = "<group>"; };
-               4BD6CB6C19E71CD100710654 /* hole */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = hole; sourceTree = BUILT_PRODUCTS_DIR; };
-               4BD708781EB1CF73003F351F /* zip_progress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_progress.c; sourceTree = "<group>"; };
-               4BDC71E015B182B200236D3C /* libzip_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = libzip_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-               4BDC71F115B1B25E00236D3C /* zip_add_dir.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_add_dir.c; path = ../lib/zip_add_dir.c; sourceTree = "<group>"; };
-               4BDC71F215B1B25E00236D3C /* zip_add_entry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_add_entry.c; path = ../lib/zip_add_entry.c; sourceTree = "<group>"; };
-               4BDC71F315B1B25E00236D3C /* zip_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_add.c; path = ../lib/zip_add.c; sourceTree = "<group>"; };
-               4BDC71F415B1B25E00236D3C /* zip_close.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_close.c; path = ../lib/zip_close.c; sourceTree = "<group>"; };
-               4BDC71F515B1B25E00236D3C /* zip_delete.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_delete.c; path = ../lib/zip_delete.c; sourceTree = "<group>"; };
-               4BDC71F615B1B25E00236D3C /* zip_dir_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_dir_add.c; path = ../lib/zip_dir_add.c; sourceTree = "<group>"; };
-               4BDC71F715B1B25E00236D3C /* zip_dirent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_dirent.c; path = ../lib/zip_dirent.c; sourceTree = "<group>"; };
-               4BDC71F815B1B25E00236D3C /* zip_discard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_discard.c; path = ../lib/zip_discard.c; sourceTree = "<group>"; };
-               4BDC71F915B1B25E00236D3C /* zip_entry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_entry.c; path = ../lib/zip_entry.c; sourceTree = "<group>"; };
-               4BDC71FA15B1B25E00236D3C /* zip_err_str.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_err_str.c; path = ../lib/zip_err_str.c; sourceTree = "<group>"; };
-               4BDC71FB15B1B25E00236D3C /* zip_error_clear.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_clear.c; path = ../lib/zip_error_clear.c; sourceTree = "<group>"; };
-               4BDC71FC15B1B25E00236D3C /* zip_error_get_sys_type.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_get_sys_type.c; path = ../lib/zip_error_get_sys_type.c; sourceTree = "<group>"; };
-               4BDC71FD15B1B25E00236D3C /* zip_error_get.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_get.c; path = ../lib/zip_error_get.c; sourceTree = "<group>"; };
-               4BDC71FE15B1B25E00236D3C /* zip_error_strerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_strerror.c; path = ../lib/zip_error_strerror.c; sourceTree = "<group>"; };
-               4BDC71FF15B1B25E00236D3C /* zip_error_to_str.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_to_str.c; path = ../lib/zip_error_to_str.c; sourceTree = "<group>"; };
-               4BDC720015B1B25E00236D3C /* zip_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error.c; path = ../lib/zip_error.c; sourceTree = "<group>"; };
-               4BDC720115B1B25E00236D3C /* zip_extra_field_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_extra_field_api.c; path = ../lib/zip_extra_field_api.c; sourceTree = "<group>"; };
-               4BDC720215B1B25E00236D3C /* zip_extra_field.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_extra_field.c; path = ../lib/zip_extra_field.c; sourceTree = "<group>"; };
-               4BDC720315B1B25E00236D3C /* zip_fclose.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fclose.c; path = ../lib/zip_fclose.c; sourceTree = "<group>"; };
-               4BDC720415B1B25E00236D3C /* zip_fdopen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fdopen.c; path = ../lib/zip_fdopen.c; sourceTree = "<group>"; };
-               4BDC720515B1B25E00236D3C /* zip_file_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_add.c; path = ../lib/zip_file_add.c; sourceTree = "<group>"; };
-               4BDC720615B1B25E00236D3C /* zip_file_error_clear.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_error_clear.c; path = ../lib/zip_file_error_clear.c; sourceTree = "<group>"; };
-               4BDC720715B1B25E00236D3C /* zip_file_error_get.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_error_get.c; path = ../lib/zip_file_error_get.c; sourceTree = "<group>"; };
-               4BDC720815B1B25E00236D3C /* zip_file_get_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_get_comment.c; path = ../lib/zip_file_get_comment.c; sourceTree = "<group>"; };
-               4BDC720915B1B25E00236D3C /* zip_file_get_offset.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_get_offset.c; path = ../lib/zip_file_get_offset.c; sourceTree = "<group>"; };
-               4BDC720A15B1B25E00236D3C /* zip_file_rename.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_rename.c; path = ../lib/zip_file_rename.c; sourceTree = "<group>"; };
-               4BDC720B15B1B25E00236D3C /* zip_file_replace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_replace.c; path = ../lib/zip_file_replace.c; sourceTree = "<group>"; };
-               4BDC720C15B1B25E00236D3C /* zip_file_set_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_set_comment.c; path = ../lib/zip_file_set_comment.c; sourceTree = "<group>"; };
-               4BDC720D15B1B25E00236D3C /* zip_file_strerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_strerror.c; path = ../lib/zip_file_strerror.c; sourceTree = "<group>"; };
-               4BDC720E15B1B25E00236D3C /* zip_filerange_crc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_filerange_crc.c; path = ../lib/zip_filerange_crc.c; sourceTree = "<group>"; };
-               4BDC720F15B1B25E00236D3C /* zip_fopen_encrypted.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fopen_encrypted.c; path = ../lib/zip_fopen_encrypted.c; sourceTree = "<group>"; };
-               4BDC721015B1B25E00236D3C /* zip_fopen_index_encrypted.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fopen_index_encrypted.c; path = ../lib/zip_fopen_index_encrypted.c; sourceTree = "<group>"; };
-               4BDC721115B1B25E00236D3C /* zip_fopen_index.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fopen_index.c; path = ../lib/zip_fopen_index.c; sourceTree = "<group>"; };
-               4BDC721215B1B25E00236D3C /* zip_fopen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fopen.c; path = ../lib/zip_fopen.c; sourceTree = "<group>"; };
-               4BDC721315B1B25E00236D3C /* zip_fread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fread.c; path = ../lib/zip_fread.c; sourceTree = "<group>"; };
-               4BDC721415B1B25E00236D3C /* zip_get_archive_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_archive_comment.c; path = ../lib/zip_get_archive_comment.c; sourceTree = "<group>"; };
-               4BDC721515B1B25E00236D3C /* zip_get_archive_flag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_archive_flag.c; path = ../lib/zip_get_archive_flag.c; sourceTree = "<group>"; };
-               4BDC721715B1B25E00236D3C /* zip_get_encryption_implementation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_encryption_implementation.c; path = ../lib/zip_get_encryption_implementation.c; sourceTree = "<group>"; };
-               4BDC721815B1B25E00236D3C /* zip_get_file_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_file_comment.c; path = ../lib/zip_get_file_comment.c; sourceTree = "<group>"; };
-               4BDC721915B1B25E00236D3C /* zip_get_name.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_name.c; path = ../lib/zip_get_name.c; sourceTree = "<group>"; };
-               4BDC721A15B1B25E00236D3C /* zip_get_num_entries.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_num_entries.c; path = ../lib/zip_get_num_entries.c; sourceTree = "<group>"; };
-               4BDC721B15B1B25E00236D3C /* zip_get_num_files.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_num_files.c; path = ../lib/zip_get_num_files.c; sourceTree = "<group>"; };
-               4BDC721C15B1B25E00236D3C /* zip_memdup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_memdup.c; path = ../lib/zip_memdup.c; sourceTree = "<group>"; };
-               4BDC721D15B1B25E00236D3C /* zip_name_locate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_name_locate.c; path = ../lib/zip_name_locate.c; sourceTree = "<group>"; };
-               4BDC721E15B1B25E00236D3C /* zip_new.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_new.c; path = ../lib/zip_new.c; sourceTree = "<group>"; };
-               4BDC721F15B1B25E00236D3C /* zip_open.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_open.c; path = ../lib/zip_open.c; sourceTree = "<group>"; usesTabs = 1; };
-               4BDC722015B1B25E00236D3C /* zip_rename.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_rename.c; path = ../lib/zip_rename.c; sourceTree = "<group>"; };
-               4BDC722115B1B25E00236D3C /* zip_replace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_replace.c; path = ../lib/zip_replace.c; sourceTree = "<group>"; };
-               4BDC722215B1B25E00236D3C /* zip_set_archive_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_archive_comment.c; path = ../lib/zip_set_archive_comment.c; sourceTree = "<group>"; };
-               4BDC722315B1B25E00236D3C /* zip_set_archive_flag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_archive_flag.c; path = ../lib/zip_set_archive_flag.c; sourceTree = "<group>"; };
-               4BDC722415B1B25E00236D3C /* zip_set_default_password.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_default_password.c; path = ../lib/zip_set_default_password.c; sourceTree = "<group>"; };
-               4BDC722515B1B25E00236D3C /* zip_set_file_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_file_comment.c; path = ../lib/zip_set_file_comment.c; sourceTree = "<group>"; };
-               4BDC722615B1B25E00236D3C /* zip_set_file_compression.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_file_compression.c; path = ../lib/zip_set_file_compression.c; sourceTree = "<group>"; };
-               4BDC722715B1B25E00236D3C /* zip_set_name.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_name.c; path = ../lib/zip_set_name.c; sourceTree = "<group>"; };
-               4BDC722815B1B25E00236D3C /* zip_source_buffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_buffer.c; path = ../lib/zip_source_buffer.c; sourceTree = "<group>"; };
-               4BDC722915B1B25E00236D3C /* zip_source_close.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_close.c; path = ../lib/zip_source_close.c; sourceTree = "<group>"; };
-               4BDC722A15B1B25E00236D3C /* zip_source_crc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_crc.c; path = ../lib/zip_source_crc.c; sourceTree = "<group>"; };
-               4BDC722C15B1B25E00236D3C /* zip_source_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_error.c; path = ../lib/zip_source_error.c; sourceTree = "<group>"; };
-               4BDC722D15B1B25E00236D3C /* zip_source_file.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_file.c; path = ../lib/zip_source_file.c; sourceTree = "<group>"; };
-               4BDC722E15B1B25E00236D3C /* zip_source_filep.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_filep.c; path = ../lib/zip_source_filep.c; sourceTree = "<group>"; };
-               4BDC722F15B1B25E00236D3C /* zip_source_free.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_free.c; path = ../lib/zip_source_free.c; sourceTree = "<group>"; };
-               4BDC723015B1B25E00236D3C /* zip_source_function.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_function.c; path = ../lib/zip_source_function.c; sourceTree = "<group>"; };
-               4BDC723115B1B25E00236D3C /* zip_source_layered.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_layered.c; path = ../lib/zip_source_layered.c; sourceTree = "<group>"; };
-               4BDC723215B1B25E00236D3C /* zip_source_open.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_open.c; path = ../lib/zip_source_open.c; sourceTree = "<group>"; };
-               4BDC723315B1B25E00236D3C /* zip_source_pkware.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_pkware.c; path = ../lib/zip_source_pkware.c; sourceTree = "<group>"; };
-               4BDC723515B1B25E00236D3C /* zip_source_read.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_read.c; path = ../lib/zip_source_read.c; sourceTree = "<group>"; };
-               4BDC723615B1B25E00236D3C /* zip_source_stat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_stat.c; path = ../lib/zip_source_stat.c; sourceTree = "<group>"; };
-               4BDC723715B1B25E00236D3C /* zip_source_window.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_window.c; path = ../lib/zip_source_window.c; sourceTree = "<group>"; };
-               4BDC723815B1B25E00236D3C /* zip_source_zip_new.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_zip_new.c; path = ../lib/zip_source_zip_new.c; sourceTree = "<group>"; };
-               4BDC723915B1B25E00236D3C /* zip_source_zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_zip.c; path = ../lib/zip_source_zip.c; sourceTree = "<group>"; };
-               4BDC723A15B1B25E00236D3C /* zip_stat_index.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_stat_index.c; path = ../lib/zip_stat_index.c; sourceTree = "<group>"; };
-               4BDC723B15B1B25E00236D3C /* zip_stat_init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_stat_init.c; path = ../lib/zip_stat_init.c; sourceTree = "<group>"; };
-               4BDC723C15B1B25E00236D3C /* zip_stat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_stat.c; path = ../lib/zip_stat.c; sourceTree = "<group>"; };
-               4BDC723D15B1B25E00236D3C /* zip_strerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_strerror.c; path = ../lib/zip_strerror.c; sourceTree = "<group>"; };
-               4BDC723E15B1B25E00236D3C /* zip_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_string.c; path = ../lib/zip_string.c; sourceTree = "<group>"; };
-               4BDC723F15B1B25E00236D3C /* zip_unchange_all.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_unchange_all.c; path = ../lib/zip_unchange_all.c; sourceTree = "<group>"; };
-               4BDC724015B1B25E00236D3C /* zip_unchange_archive.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_unchange_archive.c; path = ../lib/zip_unchange_archive.c; sourceTree = "<group>"; };
-               4BDC724115B1B25E00236D3C /* zip_unchange_data.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_unchange_data.c; path = ../lib/zip_unchange_data.c; sourceTree = "<group>"; };
-               4BDC724215B1B25E00236D3C /* zip_unchange.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_unchange.c; path = ../lib/zip_unchange.c; sourceTree = "<group>"; };
-               4BDC724315B1B25E00236D3C /* zip_utf-8.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "zip_utf-8.c"; path = "../lib/zip_utf-8.c"; sourceTree = "<group>"; };
-               4BDC729815B1B2A600236D3C /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zip.h; path = ../lib/zip.h; sourceTree = "<group>"; };
-               4BDC729915B1B2A600236D3C /* zipint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zipint.h; path = ../lib/zipint.h; sourceTree = "<group>"; };
-               4BDC729E15B1B4E900236D3C /* zipconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zipconf.h; sourceTree = SOURCE_ROOT; };
-               4BDC72A015B1B56400236D3C /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = SOURCE_ROOT; };
-               4BE402AC19D94AE400298248 /* zip_source_is_deleted.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_is_deleted.c; sourceTree = "<group>"; };
-               4BEF35C31AF4D92D00974F28 /* zip_source_win32handle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_win32handle.c; sourceTree = "<group>"; };
-               736ED9B71E3D688C00C36873 /* zip_file_set_encryption.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_file_set_encryption.c; sourceTree = "<group>"; };
-               736ED9B81E3D688C00C36873 /* zip_random_unix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_random_unix.c; sourceTree = "<group>"; };
-               736ED9B91E3D688C00C36873 /* zip_source_winzip_aes_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_winzip_aes_decode.c; sourceTree = "<group>"; };
-               736ED9BA1E3D688C00C36873 /* zip_source_winzip_aes_encode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_winzip_aes_encode.c; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-               3D7E35341B3305FB00022624 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               3D7E35481B33076C00022624 /* libz.dylib in Frameworks */,
-                               3D7E35461B33064B00022624 /* libzip.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4B01D68715B2F3F1002D5007 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4B01D73C15B2F6AF002D5007 /* libz.dylib in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4B01D6FA15B2F4B1002D5007 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4B01D70915B2F4CF002D5007 /* libz.dylib in Frameworks */,
-                               4B01D70715B2F4C5002D5007 /* libzip.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4B01D70C15B2F4EB002D5007 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4B01D70D15B2F4EB002D5007 /* libz.dylib in Frameworks */,
-                               4B01D70E15B2F4EB002D5007 /* libzip.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD58615BC2CEA00920691 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD59415BC2D0800920691 /* libz.dylib in Frameworks */,
-                               4BACD59315BC2CFA00920691 /* libzip.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD5BA15BC2DC900920691 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD5BB15BC2DC900920691 /* libz.dylib in Frameworks */,
-                               4BACD5BC15BC2DC900920691 /* libzip.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD5C915BC2DF200920691 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD5CA15BC2DF200920691 /* libz.dylib in Frameworks */,
-                               4BACD5CB15BC2DF200920691 /* libzip.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD5D815BC2F3700920691 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD5D915BC2F3700920691 /* libz.dylib in Frameworks */,
-                               4BACD5DA15BC2F3700920691 /* libzip.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD64915BC301300920691 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD64A15BC301300920691 /* libz.dylib in Frameworks */,
-                               4BACD64B15BC301300920691 /* libzip.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BD6CB6519E71CD100710654 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BD6CB6619E71CD100710654 /* libz.dylib in Frameworks */,
-                               4BD6CB6719E71CD100710654 /* libzip.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BDC71DD15B182B200236D3C /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-               3D7E353E1B33063600022624 /* examples */ = {
-                       isa = PBXGroup;
-                       children = (
-                               3D7E35401B33063600022624 /* in-memory.c */,
-                               3D7E35421B33063600022624 /* windows-open.c */,
-                       );
-                       name = examples;
-                       path = ../examples;
-                       sourceTree = "<group>";
-               };
-               4B01D72015B2F54C002D5007 /* src */ = {
-                       isa = PBXGroup;
-                       children = (
-                               4B01D72115B2F572002D5007 /* zipcmp.c */,
-                               4B01D72215B2F572002D5007 /* zipmerge.c */,
-                               4BD6CB5E19E71B3B00710654 /* hole.c */,
-                               4BACD57C15BC2AEF00920691 /* ziptool.c */,
-                               4BD6CB5C19E6A5D900710654 /* source_hole.c */,
-                       );
-                       name = src;
-                       path = ../src;
-                       sourceTree = "<group>";
-               };
-               4B28A9EA15BACBE100D0C17D /* man */ = {
-                       isa = PBXGroup;
-                       children = (
-                               4BCD77A91A14ED5C001A9F55 /* CMakeLists.txt */,
-                               4B1ABD1B1A2E5E4D00C93867 /* handle_links */,
-                               4B1ABD1A1A2E5DA700C93867 /* links */,
-                               4B26FF141A07DF1A000E9788 /* Makefile.am */,
-                               4BC386511A1BE04700CDCAAC /* fix-man-links.sh */,
-                               4BC386521A1BE04700CDCAAC /* make_zip_errors.sh */,
-                               4B26FF181A07DFEA000E9788 /* mkdocset.pl */,
-                               4BC386531A1BE04700CDCAAC /* nih-man.css */,
-                               4B28A9EC15BACC3900D0C17D /* libzip.mdoc */,
-                               4B28A9ED15BACC3900D0C17D /* zip_add_dir.mdoc */,
-                               4B28A9EE15BACC3900D0C17D /* zip_add.mdoc */,
-                               4B28A9EF15BACC3900D0C17D /* zip_close.mdoc */,
-                               4B28A9F015BACC3900D0C17D /* zip_delete.mdoc */,
-                               4B28A9F115BACC3900D0C17D /* zip_dir_add.mdoc */,
-                               4B28A9F215BACC3900D0C17D /* zip_discard.mdoc */,
-                               4B28A9F315BACC3900D0C17D /* zip_error_clear.mdoc */,
-                               4B1E46E51A08CB7600A376D2 /* zip_error_code_system.mdoc */,
-                               4B1E46E61A08CB7600A376D2 /* zip_error_code_zip.mdoc */,
-                               4B1E46E71A08CB7600A376D2 /* zip_error_fini.mdoc */,
-                               4B28A9F415BACC3900D0C17D /* zip_error_get_sys_type.mdoc */,
-                               4B28A9F515BACC3900D0C17D /* zip_error_get.mdoc */,
-                               4B1E46E81A08CB7600A376D2 /* zip_error_init.mdoc */,
-                               4B1E46E91A08CB7600A376D2 /* zip_error_set.mdoc */,
-                               4B1E46EA1A08CB7600A376D2 /* zip_error_strerror.mdoc */,
-                               4B1E46EB1A08CB7600A376D2 /* zip_error_system_type.mdoc */,
-                               4BC972001A0A1D85003A2981 /* zip_error_to_data.mdoc */,
-                               4B28A9F615BACC3900D0C17D /* zip_error_to_str.mdoc */,
-                               4B28A9F715BACC3900D0C17D /* zip_errors.mdoc */,
-                               4B28A9F815BACC3900D0C17D /* zip_fclose.mdoc */,
-                               4B28A9F915BACC3900D0C17D /* zip_fdopen.mdoc */,
-                               4B28A9FA15BACC3900D0C17D /* zip_file_add.mdoc */,
-                               4B28A9FB15BACC3900D0C17D /* zip_file_extra_field_delete.mdoc */,
-                               4B28A9FC15BACC3900D0C17D /* zip_file_extra_field_get.mdoc */,
-                               4B28A9FD15BACC3900D0C17D /* zip_file_extra_field_set.mdoc */,
-                               4B28A9FE15BACC3900D0C17D /* zip_file_extra_fields_count.mdoc */,
-                               4B28A9FF15BACC3900D0C17D /* zip_file_get_comment.mdoc */,
-                               4BCD77A71A14E404001A9F55 /* zip_file_get_error.mdoc */,
-                               4B26FF151A07DF1A000E9788 /* zip_file_get_external_attributes.mdoc */,
-                               4B28AA0015BACC3900D0C17D /* zip_file_rename.mdoc */,
-                               4B28AA0115BACC3900D0C17D /* zip_file_set_comment.mdoc */,
-                               4B26FF161A07DF1A000E9788 /* zip_file_set_external_attributes.mdoc */,
-                               4B26FF171A07DF1A000E9788 /* zip_file_set_mtime.mdoc */,
-                               4B28AA0215BACC3900D0C17D /* zip_file_strerror.mdoc */,
-                               4B28AA0315BACC3900D0C17D /* zip_fopen_encrypted.mdoc */,
-                               4B28AA0415BACC3900D0C17D /* zip_fopen.mdoc */,
-                               4B28AA0515BACC3900D0C17D /* zip_fread.mdoc */,
-                               4B28AA0615BACC3900D0C17D /* zip_get_archive_comment.mdoc */,
-                               4B28AA0715BACC3900D0C17D /* zip_get_archive_flag.mdoc */,
-                               4BC3863E1A1BE00E00CDCAAC /* zip_get_error.mdoc */,
-                               4B28AA0815BACC3900D0C17D /* zip_get_file_comment.mdoc */,
-                               4B28AA0915BACC3900D0C17D /* zip_get_name.mdoc */,
-                               4B28AA0A15BACC3900D0C17D /* zip_get_num_entries.mdoc */,
-                               4B28AA0B15BACC3900D0C17D /* zip_get_num_files.mdoc */,
-                               4B28AA0C15BACC3900D0C17D /* zip_name_locate.mdoc */,
-                               4B28AA0D15BACC3900D0C17D /* zip_open.mdoc */,
-                               4B28AA0E15BACC3900D0C17D /* zip_rename.mdoc */,
-                               4B28AA0F15BACC3900D0C17D /* zip_set_archive_comment.mdoc */,
-                               4B28AA1015BACC3900D0C17D /* zip_set_archive_flag.mdoc */,
-                               4B28AA1115BACC3900D0C17D /* zip_set_default_password.mdoc */,
-                               4B28AA1215BACC3900D0C17D /* zip_set_file_comment.mdoc */,
-                               4B28AA1315BACC3900D0C17D /* zip_set_file_compression.mdoc */,
-                               4BC3863F1A1BE00E00CDCAAC /* zip_source_begin_write.mdoc */,
-                               4B28AA1415BACC3900D0C17D /* zip_source_buffer.mdoc */,
-                               4BC386401A1BE00E00CDCAAC /* zip_source_close.mdoc */,
-                               4BC386411A1BE00E00CDCAAC /* zip_source_commit_write.mdoc */,
-                               4BC386421A1BE00E00CDCAAC /* zip_source_error.mdoc */,
-                               4B28AA1515BACC3900D0C17D /* zip_source_file.mdoc */,
-                               4B28AA1615BACC3900D0C17D /* zip_source_filep.mdoc */,
-                               4B28AA1715BACC3900D0C17D /* zip_source_free.mdoc */,
-                               4B28AA1815BACC3900D0C17D /* zip_source_function.mdoc */,
-                               4BC386431A1BE00E00CDCAAC /* ZIP_SOURCE_GET_ARGS.mdoc */,
-                               4BC386441A1BE00E00CDCAAC /* zip_source_is_deleted.mdoc */,
-                               4BC386451A1BE00E00CDCAAC /* zip_source_keep.mdoc */,
-                               4BC386461A1BE00E00CDCAAC /* zip_source_make_command_bitmap.mdoc */,
-                               4BC386471A1BE00E00CDCAAC /* zip_source_open.mdoc */,
-                               4BC386481A1BE00E00CDCAAC /* zip_source_read.mdoc */,
-                               4BC386491A1BE00E00CDCAAC /* zip_source_rollback_write.mdoc */,
-                               4BCD77A81A14E921001A9F55 /* zip_source_seek_compute_offset.mdoc */,
-                               4BC3864A1A1BE00E00CDCAAC /* zip_source_seek_write.mdoc */,
-                               4BC3864B1A1BE00E00CDCAAC /* zip_source_seek.mdoc */,
-                               4BC3864C1A1BE00E00CDCAAC /* zip_source_stat.mdoc */,
-                               4BC3864D1A1BE00E00CDCAAC /* zip_source_tell_write.mdoc */,
-                               4BC3864E1A1BE00E00CDCAAC /* zip_source_tell.mdoc */,
-                               4BC3864F1A1BE00E00CDCAAC /* zip_source_write.mdoc */,
-                               4B28AA1915BACC3900D0C17D /* zip_source_zip.mdoc */,
-                               4BC386501A1BE00E00CDCAAC /* zip_source.mdoc */,
-                               4B28AA1A15BACC3900D0C17D /* zip_stat_init.mdoc */,
-                               4B28AA1B15BACC3900D0C17D /* zip_stat.mdoc */,
-                               4B28AA1C15BACC3900D0C17D /* zip_unchange_all.mdoc */,
-                               4B28AA1D15BACC3900D0C17D /* zip_unchange_archive.mdoc */,
-                               4B28AA1E15BACC3900D0C17D /* zip_unchange.mdoc */,
-                               4B28AA1F15BACC3900D0C17D /* zipcmp.mdoc */,
-                               4B28AA2015BACC3900D0C17D /* zipmerge.mdoc */,
-                               4B28AA2115BACC3900D0C17D /* ziptorrent.mdoc */,
-                       );
-                       name = man;
-                       path = ../man;
-                       sourceTree = "<group>";
-               };
-               4B28AA2815BAD4F800D0C17D /* info */ = {
-                       isa = PBXGroup;
-                       children = (
-                               4B28AA2215BAD4E200D0C17D /* API-CHANGES */,
-                               4B28AA2315BAD4E200D0C17D /* AUTHORS */,
-                               4B28AA2415BAD4E200D0C17D /* NEWS.md */,
-                               4B28AA2515BAD4E200D0C17D /* README.md */,
-                               4B28AA2615BAD4E200D0C17D /* THANKS */,
-                               4B28AA2715BAD4E200D0C17D /* TODO.md */,
-                       );
-                       name = info;
-                       path = ..;
-                       sourceTree = "<group>";
-               };
-               4BACD57415BC2AA100920691 /* regress */ = {
-                       isa = PBXGroup;
-                       children = (
-                               4BD35EE61A33407200256CB7 /* Makefile.am */,
-                               4BD155CE191CD28D0046F012 /* NiHTest.pm */,
-                               4BD155CF191CD28D0046F012 /* runtest.in */,
-                               4BACD57715BC2AEF00920691 /* add_from_filep.c */,
-                               4BACD57A15BC2AEF00920691 /* fopen_unchanged.c */,
-                               4BACD57B15BC2AEF00920691 /* fread.c */,
-                               4BACD58415BC2AEF00920691 /* tryopen.c */,
-                               4BD35E401A33362A00256CB7 /* test cases */,
-                       );
-                       name = regress;
-                       path = ../regress;
-                       sourceTree = "<group>";
-               };
-               4BD35E401A33362A00256CB7 /* test cases */ = {
-                       isa = PBXGroup;
-                       children = (
-                               4BD35E411A33366200256CB7 /* add_dir.test */,
-                               4BD35E421A33366200256CB7 /* add_from_buffer.test */,
-                               4BD35E431A33366200256CB7 /* add_from_file_duplicate.test */,
-                               4BD35E441A33366200256CB7 /* add_from_file_twice_duplicate.test */,
-                               4BD35E451A33366200256CB7 /* add_from_file.test */,
-                               4BD35E461A33366200256CB7 /* add_from_filep.test */,
-                               4BD35E471A33366200256CB7 /* add_from_stdin.test */,
-                               4BD35E481A33366200256CB7 /* add_from_zip_closed.test */,
-                               4BD35E491A33366200256CB7 /* add_from_zip_deflated.test */,
-                               4BD35E4A1A33366200256CB7 /* add_from_zip_partial_deflated.test */,
-                               4BD35E4B1A33366200256CB7 /* add_from_zip_partial_stored.test */,
-                               4BD35E4C1A33366200256CB7 /* add_from_zip_stored.test */,
-                               4BD35E4D1A33366200256CB7 /* add_from_zip.test */,
-                               4BD35E4E1A33366200256CB7 /* add_stored_in_memory.test */,
-                               4BD35E4F1A33366200256CB7 /* add_stored.test */,
-                               4BD35E501A33366200256CB7 /* cm-default.test */,
-                               4BD35E511A33366200256CB7 /* delete_add_same.test */,
-                               4BD35E521A33366200256CB7 /* delete_invalid.test */,
-                               4BD35E531A33366200256CB7 /* delete_last.test */,
-                               4BD35E541A33366200256CB7 /* delete_multiple_last.test */,
-                               4BD35E551A33366200256CB7 /* delete_multiple_partial.test */,
-                               4BD35E561A33366200256CB7 /* delete_renamed_rename.test */,
-                               4BD35E5B1A33366200256CB7 /* encrypt.test */,
-                               4BD35E5C1A33366200256CB7 /* extra_add_multiple.test */,
-                               4BD35E5D1A33366200256CB7 /* extra_add.test */,
-                               4BD35E5E1A33366200256CB7 /* extra_count_by_id.test */,
-                               4BD35E5F1A33366200256CB7 /* extra_count_ignore_zip64.test */,
-                               4BD35E601A33366200256CB7 /* extra_count.test */,
-                               4BD35E611A33366200256CB7 /* extra_delete_by_id.test */,
-                               4BD35E621A33366200256CB7 /* extra_delete.test */,
-                               4BD35E631A33366200256CB7 /* extra_get_by_id.test */,
-                               4BD35E641A33366200256CB7 /* extra_get.test */,
-                               4BD35E651A33366200256CB7 /* extra_set_modify_c.test */,
-                               4BD35E661A33366200256CB7 /* extra_set_modify_l.test */,
-                               4BD35E671A33366200256CB7 /* extra_set.test */,
-                               4BD35E681A33366200256CB7 /* file_comment_encmismatch.test */,
-                               4BD35E691A33366200256CB7 /* fopen_unchanged.test */,
-                               4BD35E6A1A33366200256CB7 /* fread.test */,
-                               4BD35E6B1A33366200256CB7 /* get_comment.test */,
-                               4BD35E8E1A33366200256CB7 /* name_locate.test */,
-                               4BD35E8F1A33366200256CB7 /* open_cons_extrabytes.test */,
-                               4BD35E901A33366200256CB7 /* open_empty_2.test */,
-                               4BD35E911A33366200256CB7 /* open_empty.test */,
-                               4BD35E921A33366200256CB7 /* open_extrabytes.test */,
-                               4BD35E931A33366200256CB7 /* open_filename_duplicate_consistency.test */,
-                               4BD35E941A33366200256CB7 /* open_filename_duplicate_empty_consistency.test */,
-                               4BD35E951A33366200256CB7 /* open_filename_duplicate_empty.test */,
-                               4BD35E961A33366200256CB7 /* open_filename_duplicate.test */,
-                               4BD35E971A33366200256CB7 /* open_filename_empty.test */,
-                               4BD35E981A33366200256CB7 /* open_incons.test */,
-                               4BD35E991A33366200256CB7 /* open_many_ok.test */,
-                               4BD35E9A1A33366200256CB7 /* open_new_but_exists.test */,
-                               4BD35E9B1A33366200256CB7 /* open_new_ok.test */,
-                               4BD35E9C1A33366200256CB7 /* open_nonarchive.test */,
-                               4BD35E9D1A33366200256CB7 /* open_nosuchfile.test */,
-                               4BD35E9E1A33366200256CB7 /* open_ok.test */,
-                               4BD35E9F1A33366200256CB7 /* open_too_short.test */,
-                               4BD35EA01A33366200256CB7 /* open_truncate.test */,
-                               4BD35EA11A33366200256CB7 /* open_zip64_ok.test */,
-                               4BD35EA21A33366200256CB7 /* rename_ascii.test */,
-                               4BD35EA31A33366200256CB7 /* rename_cp437.test */,
-                               4BD35EA41A33366200256CB7 /* rename_deleted.test */,
-                               4BD35EA51A33366200256CB7 /* rename_fail.test */,
-                               4BD35EA61A33366200256CB7 /* rename_ok.test */,
-                               4BD35EA81A33366200256CB7 /* rename_utf8_encmismatch.test */,
-                               4BD35EA91A33366200256CB7 /* rename_utf8.test */,
-                               4BD35EAA1A33366200256CB7 /* set_comment_all.test */,
-                               4BD35EAB1A33366200256CB7 /* set_comment_localonly.test */,
-                               4BD35EAC1A33366200256CB7 /* set_comment_removeglobal.test */,
-                               4BD35EAD1A33366200256CB7 /* set_comment_revert.test */,
-                               4BD35EAE1A33366200256CB7 /* set_compression_deflate_to_deflate.test */,
-                               4BD35EAF1A33366200256CB7 /* set_compression_deflate_to_store.test */,
-                               4BD35EB01A33366200256CB7 /* set_compression_store_to_deflate.test */,
-                               4BD35EB11A33366200256CB7 /* set_compression_store_to_store.test */,
-                               4BD35EB21A33366200256CB7 /* set_compression_unknown.test */,
-                               4BD35EB31A33366200256CB7 /* set_mtime.test */,
-                               4BD35EB41A33366200256CB7 /* stat_index_cp437_guess.test */,
-                               4BD35EB51A33366200256CB7 /* stat_index_cp437_raw.test */,
-                               4BD35EB61A33366200256CB7 /* stat_index_cp437_strict.test */,
-                               4BD35EB71A33366200256CB7 /* stat_index_fileorder.test */,
-                               4BD35EB81A33366200256CB7 /* stat_index_streamed_zip64.test */,
-                               4BD35EB91A33366200256CB7 /* stat_index_streamed.test */,
-                               4BD35EBA1A33366200256CB7 /* stat_index_utf8_guess.test */,
-                               4BD35EBB1A33366200256CB7 /* stat_index_utf8_raw.test */,
-                               4BD35EBC1A33366200256CB7 /* stat_index_utf8_strict.test */,
-                               4BD35EBD1A33366200256CB7 /* stat_index_utf8_unmarked_strict.test */,
-                               4BD35EBE1A33366200256CB7 /* stat_index_zip64.test */,
-                               4BD35EDD1A33366300256CB7 /* torrent-already.test */,
-                               4BD35EDE1A33366300256CB7 /* torrent-new.test */,
-                               4BD35EE11A33366300256CB7 /* utf-8-standardization.test */,
-                               4BD35EE31A33366300256CB7 /* zip64_creation.test */,
-                               4BD35EE41A33366300256CB7 /* zip64_stored_creation.test */,
-                       );
-                       name = "test cases";
-                       sourceTree = "<group>";
-               };
-               4BDC71BD15B181DA00236D3C = {
-                       isa = PBXGroup;
-                       children = (
-                               4B28AA2815BAD4F800D0C17D /* info */,
-                               4BDC71E415B182B200236D3C /* Supporting Files */,
-                               3D7E353E1B33063600022624 /* examples */,
-                               4BDC71E315B182B200236D3C /* libzip */,
-                               4B01D72015B2F54C002D5007 /* src */,
-                               4BACD57415BC2AA100920691 /* regress */,
-                               4B28A9EA15BACBE100D0C17D /* man */,
-                               4BDC71CA15B181DA00236D3C /* Frameworks */,
-                               4BDC71C915B181DA00236D3C /* Products */,
-                       );
-                       sourceTree = "<group>";
-                       tabWidth = 8;
-               };
-               4BDC71C915B181DA00236D3C /* Products */ = {
-                       isa = PBXGroup;
-                       children = (
-                               4BDC71E015B182B200236D3C /* libzip_iOS.framework */,
-                               4B01D68B15B2F3F1002D5007 /* libzip.framework */,
-                               4B01D6FD15B2F4B1002D5007 /* zipmerge */,
-                               4B01D71315B2F4EB002D5007 /* zipcmp */,
-                               4BACD58915BC2CEA00920691 /* ziptool */,
-                               4BACD5C115BC2DC900920691 /* add_from_filep */,
-                               4BACD5D015BC2DF200920691 /* fopen_unchanged */,
-                               4BACD5DF15BC2F3700920691 /* fread */,
-                               4BACD65015BC301300920691 /* tryopen */,
-                               4BD6CB6C19E71CD100710654 /* hole */,
-                               3D7E35371B3305FB00022624 /* in-memory */,
-                       );
-                       name = Products;
-                       sourceTree = "<group>";
-               };
-               4BDC71CA15B181DA00236D3C /* Frameworks */ = {
-                       isa = PBXGroup;
-                       children = (
-                               3D7E35471B33076C00022624 /* libz.dylib */,
-                               4B01D70815B2F4CF002D5007 /* libz.dylib */,
-                       );
-                       name = Frameworks;
-                       sourceTree = "<group>";
-               };
-               4BDC71E315B182B200236D3C /* libzip */ = {
-                       isa = PBXGroup;
-                       children = (
-                               4BDC72A015B1B56400236D3C /* config.h */,
-                               4BD25DA51CF58790005A9EC4 /* compat.h */,
-                               4BDC729E15B1B4E900236D3C /* zipconf.h */,
-                               4BDC729815B1B2A600236D3C /* zip.h */,
-                               4BDC729915B1B2A600236D3C /* zipint.h */,
-                               4BCD54C81AB05AA90003D379 /* zipwin32.h */,
-                               4B3A5F4A1DF96D83005A53A1 /* gladman-fcrypt */,
-                               4B3A5F4B1DF96D83005A53A1 /* gladman-fcrypt.c */,
-                               4B3A5F4C1DF96D83005A53A1 /* gladman-fcrypt.h */,
-                               4BDC71F115B1B25E00236D3C /* zip_add_dir.c */,
-                               4BDC71F215B1B25E00236D3C /* zip_add_entry.c */,
-                               4BDC71F315B1B25E00236D3C /* zip_add.c */,
-                               4B0454B41E8E3DF7002FA1F9 /* zip_algorithm_bzip2.c */,
-                               4B0454B51E8E3DF7002FA1F9 /* zip_algorithm_deflate.c */,
-                               4BCB434119E9347E0067FAA3 /* zip_buffer.c */,
-                               4BDC71F415B1B25E00236D3C /* zip_close.c */,
-                               4BDC71F515B1B25E00236D3C /* zip_delete.c */,
-                               4BDC71F615B1B25E00236D3C /* zip_dir_add.c */,
-                               4BDC71F715B1B25E00236D3C /* zip_dirent.c */,
-                               4BDC71F815B1B25E00236D3C /* zip_discard.c */,
-                               4BDC71F915B1B25E00236D3C /* zip_entry.c */,
-                               4BDC71FA15B1B25E00236D3C /* zip_err_str.c */,
-                               4BDC71FB15B1B25E00236D3C /* zip_error_clear.c */,
-                               4BDC71FC15B1B25E00236D3C /* zip_error_get_sys_type.c */,
-                               4BDC71FD15B1B25E00236D3C /* zip_error_get.c */,
-                               4BDC71FE15B1B25E00236D3C /* zip_error_strerror.c */,
-                               4BDC71FF15B1B25E00236D3C /* zip_error_to_str.c */,
-                               4BDC720015B1B25E00236D3C /* zip_error.c */,
-                               4BDC720115B1B25E00236D3C /* zip_extra_field_api.c */,
-                               4BDC720215B1B25E00236D3C /* zip_extra_field.c */,
-                               4BDC720315B1B25E00236D3C /* zip_fclose.c */,
-                               4BDC720415B1B25E00236D3C /* zip_fdopen.c */,
-                               4BDC720515B1B25E00236D3C /* zip_file_add.c */,
-                               4BDC720615B1B25E00236D3C /* zip_file_error_clear.c */,
-                               4BDC720715B1B25E00236D3C /* zip_file_error_get.c */,
-                               4BDC720815B1B25E00236D3C /* zip_file_get_comment.c */,
-                               4B97204D188EBE85002FAFAD /* zip_file_get_external_attributes.c */,
-                               4BDC720915B1B25E00236D3C /* zip_file_get_offset.c */,
-                               4BDC720A15B1B25E00236D3C /* zip_file_rename.c */,
-                               4BDC720B15B1B25E00236D3C /* zip_file_replace.c */,
-                               4BDC720C15B1B25E00236D3C /* zip_file_set_comment.c */,
-                               736ED9B71E3D688C00C36873 /* zip_file_set_encryption.c */,
-                               4B97204E188EBE85002FAFAD /* zip_file_set_external_attributes.c */,
-                               4B82CED319915F360097BC18 /* zip_file_set_mtime.c */,
-                               4BDC720D15B1B25E00236D3C /* zip_file_strerror.c */,
-                               4BDC720E15B1B25E00236D3C /* zip_filerange_crc.c */,
-                               4BDC720F15B1B25E00236D3C /* zip_fopen_encrypted.c */,
-                               4BDC721015B1B25E00236D3C /* zip_fopen_index_encrypted.c */,
-                               4BDC721115B1B25E00236D3C /* zip_fopen_index.c */,
-                               4BDC721215B1B25E00236D3C /* zip_fopen.c */,
-                               4BDC721315B1B25E00236D3C /* zip_fread.c */,
-                               4B3A5F4D1DF96D83005A53A1 /* zip_fseek.c */,
-                               4B3A5F4E1DF96D83005A53A1 /* zip_ftell.c */,
-                               4BDC721415B1B25E00236D3C /* zip_get_archive_comment.c */,
-                               4BDC721515B1B25E00236D3C /* zip_get_archive_flag.c */,
-                               4BDC721715B1B25E00236D3C /* zip_get_encryption_implementation.c */,
-                               4BDC721815B1B25E00236D3C /* zip_get_file_comment.c */,
-                               4BDC721915B1B25E00236D3C /* zip_get_name.c */,
-                               4BDC721A15B1B25E00236D3C /* zip_get_num_entries.c */,
-                               4BDC721B15B1B25E00236D3C /* zip_get_num_files.c */,
-                               3D9284801C309510001EABA7 /* zip_hash.c */,
-                               4BCF3019199A2F820064207B /* zip_io_util.c */,
-                               4BDC721C15B1B25E00236D3C /* zip_memdup.c */,
-                               4BDC721D15B1B25E00236D3C /* zip_name_locate.c */,
-                               4BDC721E15B1B25E00236D3C /* zip_new.c */,
-                               4BDC721F15B1B25E00236D3C /* zip_open.c */,
-                               4BD708781EB1CF73003F351F /* zip_progress.c */,
-                               736ED9B81E3D688C00C36873 /* zip_random_unix.c */,
-                               4BDC722015B1B25E00236D3C /* zip_rename.c */,
-                               4BDC722115B1B25E00236D3C /* zip_replace.c */,
-                               4BDC722215B1B25E00236D3C /* zip_set_archive_comment.c */,
-                               4BDC722315B1B25E00236D3C /* zip_set_archive_flag.c */,
-                               4BDC722415B1B25E00236D3C /* zip_set_default_password.c */,
-                               4BDC722515B1B25E00236D3C /* zip_set_file_comment.c */,
-                               4BDC722615B1B25E00236D3C /* zip_set_file_compression.c */,
-                               4BDC722715B1B25E00236D3C /* zip_set_name.c */,
-                               4BCF301A199A2F820064207B /* zip_source_begin_write.c */,
-                               4BDC722815B1B25E00236D3C /* zip_source_buffer.c */,
-                               4BD5053219A0116D007DD28A /* zip_source_call.c */,
-                               4BDC722915B1B25E00236D3C /* zip_source_close.c */,
-                               4BCF301B199A2F820064207B /* zip_source_commit_write.c */,
-                               4B0454B61E8E3DF7002FA1F9 /* zip_source_compress.c */,
-                               4BDC722A15B1B25E00236D3C /* zip_source_crc.c */,
-                               4BDC722C15B1B25E00236D3C /* zip_source_error.c */,
-                               4BDC722D15B1B25E00236D3C /* zip_source_file.c */,
-                               4BDC722E15B1B25E00236D3C /* zip_source_filep.c */,
-                               4BDC722F15B1B25E00236D3C /* zip_source_free.c */,
-                               4BDC723015B1B25E00236D3C /* zip_source_function.c */,
-                               4B0454B71E8E3DF7002FA1F9 /* zip_source_get_compression_flags.c */,
-                               4BE402AC19D94AE400298248 /* zip_source_is_deleted.c */,
-                               4BDC723115B1B25E00236D3C /* zip_source_layered.c */,
-                               4BDC723215B1B25E00236D3C /* zip_source_open.c */,
-                               4BDC723315B1B25E00236D3C /* zip_source_pkware.c */,
-                               4BDC723515B1B25E00236D3C /* zip_source_read.c */,
-                               4BCF3031199ABD3A0064207B /* zip_source_remove.c */,
-                               4BCF301C199A2F820064207B /* zip_source_rollback_write.c */,
-                               4BCF301D199A2F820064207B /* zip_source_seek.c */,
-                               4BCF3034199ABDDA0064207B /* zip_source_seek_write.c */,
-                               4BDC723615B1B25E00236D3C /* zip_source_stat.c */,
-                               4BCF301E199A2F820064207B /* zip_source_supports.c */,
-                               4BCF301F199A2F820064207B /* zip_source_tell.c */,
-                               4BCF3035199ABDDA0064207B /* zip_source_tell_write.c */,
-                               4BDC723715B1B25E00236D3C /* zip_source_window.c */,
-                               736ED9B91E3D688C00C36873 /* zip_source_winzip_aes_decode.c */,
-                               736ED9BA1E3D688C00C36873 /* zip_source_winzip_aes_encode.c */,
-                               4BCF3020199A2F820064207B /* zip_source_write.c */,
-                               4BDC723815B1B25E00236D3C /* zip_source_zip_new.c */,
-                               4BDC723915B1B25E00236D3C /* zip_source_zip.c */,
-                               4BDC723A15B1B25E00236D3C /* zip_stat_index.c */,
-                               4BDC723B15B1B25E00236D3C /* zip_stat_init.c */,
-                               4BDC723C15B1B25E00236D3C /* zip_stat.c */,
-                               4BDC723D15B1B25E00236D3C /* zip_strerror.c */,
-                               4BDC723E15B1B25E00236D3C /* zip_string.c */,
-                               4BDC723F15B1B25E00236D3C /* zip_unchange_all.c */,
-                               4BCD54C41AB05AA90003D379 /* zip_source_win32a.c */,
-                               4BEF35C31AF4D92D00974F28 /* zip_source_win32handle.c */,
-                               4BCD54C61AB05AA90003D379 /* zip_source_win32utf8.c */,
-                               4BCD54C71AB05AA90003D379 /* zip_source_win32w.c */,
-                               4BDC724015B1B25E00236D3C /* zip_unchange_archive.c */,
-                               4BDC724115B1B25E00236D3C /* zip_unchange_data.c */,
-                               4BDC724215B1B25E00236D3C /* zip_unchange.c */,
-                               4BDC724315B1B25E00236D3C /* zip_utf-8.c */,
-                       );
-                       name = libzip;
-                       path = ../lib;
-                       sourceTree = "<group>";
-               };
-               4BDC71E415B182B200236D3C /* Supporting Files */ = {
-                       isa = PBXGroup;
-                       children = (
-                               3D77B86517009AA1000A5794 /* extract-version.sh */,
-                               4B01D73D15B2FB6B002D5007 /* Info.plist */,
-                       );
-                       name = "Supporting Files";
-                       path = libzip;
-                       sourceTree = "<group>";
-               };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
-               4B01D68815B2F3F1002D5007 /* Headers */ = {
-                       isa = PBXHeadersBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4B01D73215B2F5EE002D5007 /* zipconf.h in Headers */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BDC729A15B1B2B100236D3C /* Headers */ = {
-                       isa = PBXHeadersBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BDC729B15B1B2C400236D3C /* zip.h in Headers */,
-                               4BDC729F15B1B4E900236D3C /* zipconf.h in Headers */,
-                               4B01D73415B2F5F4002D5007 /* config.h in Headers */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
-               3D7E35361B3305FB00022624 /* in-memory */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 3D7E353D1B3305FB00022624 /* Build configuration list for PBXNativeTarget "in-memory" */;
-                       buildPhases = (
-                               3D7E35331B3305FB00022624 /* Sources */,
-                               3D7E35341B3305FB00022624 /* Frameworks */,
-                               3D7E35351B3305FB00022624 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               3D7E35451B33064500022624 /* PBXTargetDependency */,
-                       );
-                       name = "in-memory";
-                       productName = "in-memory-example";
-                       productReference = 3D7E35371B3305FB00022624 /* in-memory */;
-                       productType = "com.apple.product-type.tool";
-               };
-               4B01D68A15B2F3F1002D5007 /* libzip */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4B01D69E15B2F3F1002D5007 /* Build configuration list for PBXNativeTarget "libzip" */;
-                       buildPhases = (
-                               4B01D68615B2F3F1002D5007 /* Sources */,
-                               4B01D68715B2F3F1002D5007 /* Frameworks */,
-                               4B01D68815B2F3F1002D5007 /* Headers */,
-                               4B01D68915B2F3F1002D5007 /* Resources */,
-                               3D77B86617009AC5000A5794 /* Copy Version Info from config.h */,
-                               4B972053188EBEB8002FAFAD /* Fix zipconf.h include. */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                       );
-                       name = libzip;
-                       productName = "libzip Mac";
-                       productReference = 4B01D68B15B2F3F1002D5007 /* libzip.framework */;
-                       productType = "com.apple.product-type.framework";
-               };
-               4B01D6FC15B2F4B1002D5007 /* zipmerge */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4B01D70415B2F4B1002D5007 /* Build configuration list for PBXNativeTarget "zipmerge" */;
-                       buildPhases = (
-                               4B01D6F915B2F4B1002D5007 /* Sources */,
-                               4B01D6FA15B2F4B1002D5007 /* Frameworks */,
-                               4B01D6FB15B2F4B1002D5007 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               4B01D73615B2F639002D5007 /* PBXTargetDependency */,
-                       );
-                       name = zipmerge;
-                       productName = zipmerge;
-                       productReference = 4B01D6FD15B2F4B1002D5007 /* zipmerge */;
-                       productType = "com.apple.product-type.tool";
-               };
-               4B01D70A15B2F4EB002D5007 /* zipcmp */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4B01D71015B2F4EB002D5007 /* Build configuration list for PBXNativeTarget "zipcmp" */;
-                       buildPhases = (
-                               4B01D70B15B2F4EB002D5007 /* Sources */,
-                               4B01D70C15B2F4EB002D5007 /* Frameworks */,
-                               4B01D70F15B2F4EB002D5007 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               4B01D73815B2F643002D5007 /* PBXTargetDependency */,
-                       );
-                       name = zipcmp;
-                       productName = zipcmp;
-                       productReference = 4B01D71315B2F4EB002D5007 /* zipcmp */;
-                       productType = "com.apple.product-type.tool";
-               };
-               4BACD58815BC2CEA00920691 /* ziptool */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4BACD59015BC2CEA00920691 /* Build configuration list for PBXNativeTarget "ziptool" */;
-                       buildPhases = (
-                               4BACD58515BC2CEA00920691 /* Sources */,
-                               4BACD58615BC2CEA00920691 /* Frameworks */,
-                               4BACD58715BC2CEA00920691 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               4BACD59715BC2D3800920691 /* PBXTargetDependency */,
-                       );
-                       name = ziptool;
-                       productName = ziptool;
-                       productReference = 4BACD58915BC2CEA00920691 /* ziptool */;
-                       productType = "com.apple.product-type.tool";
-               };
-               4BACD5B515BC2DC900920691 /* add_from_filep */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4BACD5BE15BC2DC900920691 /* Build configuration list for PBXNativeTarget "add_from_filep" */;
-                       buildPhases = (
-                               4BACD5B815BC2DC900920691 /* Sources */,
-                               4BACD5BA15BC2DC900920691 /* Frameworks */,
-                               4BACD5BD15BC2DC900920691 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               4BACD5B615BC2DC900920691 /* PBXTargetDependency */,
-                       );
-                       name = add_from_filep;
-                       productName = add_from_filep;
-                       productReference = 4BACD5C115BC2DC900920691 /* add_from_filep */;
-                       productType = "com.apple.product-type.tool";
-               };
-               4BACD5C415BC2DF200920691 /* fopen_unchanged */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4BACD5CD15BC2DF200920691 /* Build configuration list for PBXNativeTarget "fopen_unchanged" */;
-                       buildPhases = (
-                               4BACD5C715BC2DF200920691 /* Sources */,
-                               4BACD5C915BC2DF200920691 /* Frameworks */,
-                               4BACD5CC15BC2DF200920691 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               4BACD5C515BC2DF200920691 /* PBXTargetDependency */,
-                       );
-                       name = fopen_unchanged;
-                       productName = fopen_unchanged;
-                       productReference = 4BACD5D015BC2DF200920691 /* fopen_unchanged */;
-                       productType = "com.apple.product-type.tool";
-               };
-               4BACD5D315BC2F3700920691 /* fread */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4BACD5DC15BC2F3700920691 /* Build configuration list for PBXNativeTarget "fread" */;
-                       buildPhases = (
-                               4BACD5D615BC2F3700920691 /* Sources */,
-                               4BACD5D815BC2F3700920691 /* Frameworks */,
-                               4BACD5DB15BC2F3700920691 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               4BACD5D415BC2F3700920691 /* PBXTargetDependency */,
-                       );
-                       name = fread;
-                       productName = fread;
-                       productReference = 4BACD5DF15BC2F3700920691 /* fread */;
-                       productType = "com.apple.product-type.tool";
-               };
-               4BACD64515BC301300920691 /* tryopen */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4BACD64D15BC301300920691 /* Build configuration list for PBXNativeTarget "tryopen" */;
-                       buildPhases = (
-                               4BACD64815BC301300920691 /* Sources */,
-                               4BACD64915BC301300920691 /* Frameworks */,
-                               4BACD64C15BC301300920691 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               4BACD64615BC301300920691 /* PBXTargetDependency */,
-                       );
-                       name = tryopen;
-                       productName = tryopen;
-                       productReference = 4BACD65015BC301300920691 /* tryopen */;
-                       productType = "com.apple.product-type.tool";
-               };
-               4BD6CB5F19E71CD100710654 /* hole */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4BD6CB6919E71CD100710654 /* Build configuration list for PBXNativeTarget "hole" */;
-                       buildPhases = (
-                               4BD6CB6219E71CD100710654 /* Sources */,
-                               4BD6CB6519E71CD100710654 /* Frameworks */,
-                               4BD6CB6819E71CD100710654 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               4BD6CB6019E71CD100710654 /* PBXTargetDependency */,
-                       );
-                       name = hole;
-                       productName = hole;
-                       productReference = 4BD6CB6C19E71CD100710654 /* hole */;
-                       productType = "com.apple.product-type.tool";
-               };
-               4BDC71DF15B182B200236D3C /* libzip_iOS */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 4BDC71EA15B182B200236D3C /* Build configuration list for PBXNativeTarget "libzip_iOS" */;
-                       buildPhases = (
-                               4BDC71DC15B182B200236D3C /* Sources */,
-                               4BDC71DD15B182B200236D3C /* Frameworks */,
-                               4BDC71DE15B182B200236D3C /* Resources */,
-                               4BDC729A15B1B2B100236D3C /* Headers */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                       );
-                       name = libzip_iOS;
-                       productName = libzip;
-                       productReference = 4BDC71E015B182B200236D3C /* libzip_iOS.framework */;
-                       productType = "com.apple.product-type.bundle";
-               };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-               4BDC71BF15B181DA00236D3C /* Project object */ = {
-                       isa = PBXProject;
-                       attributes = {
-                               LastUpgradeCheck = 0810;
-                               ORGANIZATIONNAME = NiH;
-                               TargetAttributes = {
-                                       3D7E35361B3305FB00022624 = {
-                                               CreatedOnToolsVersion = 6.3.2;
-                                       };
-                               };
-                       };
-                       buildConfigurationList = 4BDC71C215B181DA00236D3C /* Build configuration list for PBXProject "libzip" */;
-                       compatibilityVersion = "Xcode 3.2";
-                       developmentRegion = English;
-                       hasScannedForEncodings = 0;
-                       knownRegions = (
-                               en,
-                       );
-                       mainGroup = 4BDC71BD15B181DA00236D3C;
-                       productRefGroup = 4BDC71C915B181DA00236D3C /* Products */;
-                       projectDirPath = "";
-                       projectRoot = "";
-                       targets = (
-                               4B54447915C977A20067BA33 /* all */,
-                               4BDC71DF15B182B200236D3C /* libzip_iOS */,
-                               4BDC72A115B1B6EA00236D3C /* Build iOS Framework */,
-                               4B01D68A15B2F3F1002D5007 /* libzip */,
-                               4B01D72815B2F5A2002D5007 /* command line tools */,
-                               4B01D6FC15B2F4B1002D5007 /* zipmerge */,
-                               4B01D70A15B2F4EB002D5007 /* zipcmp */,
-                               4BCF6A681C3BDDD500F036E9 /* examples */,
-                               3D7E35361B3305FB00022624 /* in-memory */,
-                               4BACD5A715BC2D8200920691 /* test programs */,
-                               4BACD5B515BC2DC900920691 /* add_from_filep */,
-                               4BACD5C415BC2DF200920691 /* fopen_unchanged */,
-                               4BACD5D315BC2F3700920691 /* fread */,
-                               4BD6CB5F19E71CD100710654 /* hole */,
-                               4BACD58815BC2CEA00920691 /* ziptool */,
-                               4BACD64515BC301300920691 /* tryopen */,
-                       );
-               };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-               4B01D68915B2F3F1002D5007 /* Resources */ = {
-                       isa = PBXResourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BDC71DE15B182B200236D3C /* Resources */ = {
-                       isa = PBXResourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
-               3D77B86617009AC5000A5794 /* Copy Version Info from config.h */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputPaths = (
-                       );
-                       name = "Copy Version Info from config.h";
-                       outputPaths = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "./extract-version.sh \"config.h\" \"Info.plist\" ";
-               };
-               4B972053188EBEB8002FAFAD /* Fix zipconf.h include. */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputPaths = (
-                       );
-                       name = "Fix zipconf.h include.";
-                       outputPaths = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "sed \"s,<zipconf.h>,<$EXECUTABLE_NAME/zipconf.h>,\" ../lib/zip.h > \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Headers/zip.h\"";
-               };
-               4BDC72A515B1B71500236D3C /* ShellScript */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputPaths = (
-                       );
-                       outputPaths = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "# Sets the target folders and the final framework product.\nFMK_NAME=libzip_iOS\nFMK_VERSION=A\n\n# Install dir will be the final output to the framework.\n# The following line create it in the root folder of the current project.\nINSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}.framework\n\n# Working dir will be deleted after the framework creation.\nWRK_DIR=build\nDEVICE_DIR=${WRK_DIR}/Release-iphoneos/${FMK_NAME}.framework\nSIMULATOR_DIR=${WRK_DIR}/Release-iphonesimulator/${FMK_NAME}.framework\n\n# Building both architectures.\nxcodebuild -configuration \"Release\" -target \"${FMK_NAME}\" -sdk iphoneos\nxcodebuild -configuration \"Release\" -target \"${FMK_NAME}\" -sdk iphonesimulator\n\n# Cleaning the oldest.\nif [ -d \"${INSTALL_DIR}\" ]\nthen\n    rm -rf \"${INSTALL_DIR}\"\nfi\n\n# Creates and renews the final product folder.\nmkdir -p \"${INSTALL_DIR}\"\nmkdir -p \"${INSTALL_DIR}/Versions\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources\"\nmkdir -p \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers\"\n\n# Creates the internal links.\n# It MUST uses relative path, otherwise will not work when the folder is copied/moved.\nln -s \"${FMK_VERSION}\" \"${INSTALL_DIR}/Versions/Current\"\nln -s \"Versions/Current/Headers\" \"${INSTALL_DIR}/Headers\"\nln -s \"Versions/Current/Resources\" \"${INSTALL_DIR}/Resources\"\nln -s \"Versions/Current/${FMK_NAME}\" \"${INSTALL_DIR}/${FMK_NAME}\"\n\n# Copies the headers and resources files to the final product folder.\ncp -R \"${DEVICE_DIR}/Headers/\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers/\"\ncp -R \"${DEVICE_DIR}/\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/\"\n\n# Removes the binary and header from the resources folder.\nrm -r \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/Headers\" \"${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/${FMK_NAME}\"\n\n# Uses the Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.\nlipo -create \"${DEVICE_DIR}/${FMK_NAME}\" \"${SIMULATOR_DIR}/${FMK_NAME}\" -output \"${INSTALL_DIR}/Versions/${FMK_VERSION}/${FMK_NAME}\"\n\nrm -r \"${WRK_DIR}\"\n";
-               };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-               3D7E35331B3305FB00022624 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               3D7E35431B33063F00022624 /* in-memory.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4B01D68615B2F3F1002D5007 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               3D7E35491B330AD500022624 /* zip_source_is_deleted.c in Sources */,
-                               4BCF3039199ABDDA0064207B /* zip_source_tell_write.c in Sources */,
-                               4B01D6A615B2F46B002D5007 /* zip_add_dir.c in Sources */,
-                               4B972052188EBE85002FAFAD /* zip_file_set_external_attributes.c in Sources */,
-                               4B0454BA1E8E3E08002FA1F9 /* zip_source_compress.c in Sources */,
-                               4BCF3024199A2F820064207B /* zip_source_begin_write.c in Sources */,
-                               4B01D6A715B2F46B002D5007 /* zip_add_entry.c in Sources */,
-                               4B01D6A815B2F46B002D5007 /* zip_add.c in Sources */,
-                               4B01D6A915B2F46B002D5007 /* zip_close.c in Sources */,
-                               4B01D6AA15B2F46B002D5007 /* zip_delete.c in Sources */,
-                               4B01D6AB15B2F46B002D5007 /* zip_dir_add.c in Sources */,
-                               4BD7087A1EB1CF73003F351F /* zip_progress.c in Sources */,
-                               4B01D6AC15B2F46B002D5007 /* zip_dirent.c in Sources */,
-                               4B01D6AD15B2F46B002D5007 /* zip_discard.c in Sources */,
-                               4B0454B81E8E3E02002FA1F9 /* zip_source_get_compression_flags.c in Sources */,
-                               4B01D6AE15B2F46B002D5007 /* zip_entry.c in Sources */,
-                               4B01D6AF15B2F46B002D5007 /* zip_err_str.c in Sources */,
-                               4B3A5F521DF96EB4005A53A1 /* zip_fseek.c in Sources */,
-                               4B01D6B015B2F46B002D5007 /* zip_error_clear.c in Sources */,
-                               4B01D6B115B2F46B002D5007 /* zip_error_get_sys_type.c in Sources */,
-                               4B01D6B215B2F46B002D5007 /* zip_error_get.c in Sources */,
-                               4B01D6B315B2F46B002D5007 /* zip_error_strerror.c in Sources */,
-                               4B01D6B415B2F46B002D5007 /* zip_error_to_str.c in Sources */,
-                               4B01D6B515B2F46B002D5007 /* zip_error.c in Sources */,
-                               736ED9BB1E3D6B6B00C36873 /* zip_source_winzip_aes_decode.c in Sources */,
-                               4B01D6B615B2F46B002D5007 /* zip_extra_field_api.c in Sources */,
-                               4B3A5F531DF96EB4005A53A1 /* zip_ftell.c in Sources */,
-                               736ED9BD1E3D6B7200C36873 /* zip_random_unix.c in Sources */,
-                               4B01D6B715B2F46B002D5007 /* zip_extra_field.c in Sources */,
-                               4B01D6B815B2F46B002D5007 /* zip_fclose.c in Sources */,
-                               4B01D6B915B2F46B002D5007 /* zip_fdopen.c in Sources */,
-                               4B01D6BA15B2F46B002D5007 /* zip_file_add.c in Sources */,
-                               4B01D6BB15B2F46B002D5007 /* zip_file_error_clear.c in Sources */,
-                               4BCF3026199A2F820064207B /* zip_source_commit_write.c in Sources */,
-                               4B3A5F501DF96EA8005A53A1 /* gladman-fcrypt.c in Sources */,
-                               4B01D6BC15B2F46B002D5007 /* zip_file_error_get.c in Sources */,
-                               4B01D6BD15B2F46B002D5007 /* zip_file_get_comment.c in Sources */,
-                               4B01D6BE15B2F46B002D5007 /* zip_file_get_offset.c in Sources */,
-                               4B01D6BF15B2F46B002D5007 /* zip_file_rename.c in Sources */,
-                               4B0454BD1E8E3E24002FA1F9 /* zip_algorithm_deflate.c in Sources */,
-                               4B01D6C015B2F46B002D5007 /* zip_file_replace.c in Sources */,
-                               4B01D6C115B2F46B002D5007 /* zip_file_set_comment.c in Sources */,
-                               4BCF3033199ABD3A0064207B /* zip_source_remove.c in Sources */,
-                               4B01D6C215B2F46B002D5007 /* zip_file_strerror.c in Sources */,
-                               4B01D6C315B2F46B002D5007 /* zip_filerange_crc.c in Sources */,
-                               4B01D6C415B2F46B002D5007 /* zip_fopen_encrypted.c in Sources */,
-                               4BCF302A199A2F820064207B /* zip_source_seek.c in Sources */,
-                               4B01D6C515B2F46B002D5007 /* zip_fopen_index_encrypted.c in Sources */,
-                               4B01D6C615B2F46B002D5007 /* zip_fopen_index.c in Sources */,
-                               4B01D6C715B2F46B002D5007 /* zip_fopen.c in Sources */,
-                               3D9284821C309510001EABA7 /* zip_hash.c in Sources */,
-                               4B01D6C815B2F46B002D5007 /* zip_fread.c in Sources */,
-                               736ED9BF1E3D6B7C00C36873 /* zip_file_set_encryption.c in Sources */,
-                               4B01D6C915B2F46B002D5007 /* zip_get_archive_comment.c in Sources */,
-                               4B01D6CA15B2F46B002D5007 /* zip_get_archive_flag.c in Sources */,
-                               4B0454BC1E8E3E24002FA1F9 /* zip_algorithm_bzip2.c in Sources */,
-                               736ED9BC1E3D6B6F00C36873 /* zip_source_winzip_aes_encode.c in Sources */,
-                               4BD5053419A01BB0007DD28A /* zip_source_call.c in Sources */,
-                               4BCF3030199A2F820064207B /* zip_source_write.c in Sources */,
-                               4B01D6CC15B2F46B002D5007 /* zip_get_encryption_implementation.c in Sources */,
-                               4B01D6CD15B2F46B002D5007 /* zip_get_file_comment.c in Sources */,
-                               4B01D6CE15B2F46B002D5007 /* zip_get_name.c in Sources */,
-                               4B01D6CF15B2F46B002D5007 /* zip_get_num_entries.c in Sources */,
-                               4B01D6D015B2F46B002D5007 /* zip_get_num_files.c in Sources */,
-                               4B01D6D115B2F46B002D5007 /* zip_memdup.c in Sources */,
-                               4B01D6D215B2F46B002D5007 /* zip_name_locate.c in Sources */,
-                               4B01D6D315B2F46B002D5007 /* zip_new.c in Sources */,
-                               4B01D6D415B2F46B002D5007 /* zip_open.c in Sources */,
-                               4B01D6D515B2F46B002D5007 /* zip_rename.c in Sources */,
-                               4BCF302E199A2F820064207B /* zip_source_tell.c in Sources */,
-                               4B972050188EBE85002FAFAD /* zip_file_get_external_attributes.c in Sources */,
-                               4B01D6D615B2F46B002D5007 /* zip_replace.c in Sources */,
-                               4B01D6D715B2F46B002D5007 /* zip_set_archive_comment.c in Sources */,
-                               4B01D6D815B2F46B002D5007 /* zip_set_archive_flag.c in Sources */,
-                               4B01D6D915B2F46B002D5007 /* zip_set_default_password.c in Sources */,
-                               4B01D6DA15B2F46B002D5007 /* zip_set_file_comment.c in Sources */,
-                               4B01D6DB15B2F46B002D5007 /* zip_set_file_compression.c in Sources */,
-                               4B01D6DC15B2F46B002D5007 /* zip_set_name.c in Sources */,
-                               4B01D6DD15B2F46B002D5007 /* zip_source_buffer.c in Sources */,
-                               4BCB434319E9347E0067FAA3 /* zip_buffer.c in Sources */,
-                               4B01D6DE15B2F46B002D5007 /* zip_source_close.c in Sources */,
-                               4B01D6DF15B2F46B002D5007 /* zip_source_crc.c in Sources */,
-                               4B01D6E115B2F46B002D5007 /* zip_source_error.c in Sources */,
-                               4B01D6E215B2F46B002D5007 /* zip_source_file.c in Sources */,
-                               4B01D6E315B2F46B002D5007 /* zip_source_filep.c in Sources */,
-                               4B01D6E415B2F46B002D5007 /* zip_source_free.c in Sources */,
-                               4B01D6E515B2F46B002D5007 /* zip_source_function.c in Sources */,
-                               4BCF3022199A2F820064207B /* zip_io_util.c in Sources */,
-                               4B01D6E615B2F46B002D5007 /* zip_source_layered.c in Sources */,
-                               4B01D6E715B2F46B002D5007 /* zip_source_open.c in Sources */,
-                               4B01D6E815B2F46B002D5007 /* zip_source_pkware.c in Sources */,
-                               4B01D6EA15B2F46B002D5007 /* zip_source_read.c in Sources */,
-                               4B01D6EB15B2F46B002D5007 /* zip_source_stat.c in Sources */,
-                               4BCF302C199A2F820064207B /* zip_source_supports.c in Sources */,
-                               4B01D6EC15B2F46B002D5007 /* zip_source_window.c in Sources */,
-                               4B01D6ED15B2F46B002D5007 /* zip_source_zip_new.c in Sources */,
-                               4B01D6EE15B2F46B002D5007 /* zip_source_zip.c in Sources */,
-                               4B01D6EF15B2F46B002D5007 /* zip_stat_index.c in Sources */,
-                               4B01D6F015B2F46B002D5007 /* zip_stat_init.c in Sources */,
-                               4B82CED519915F360097BC18 /* zip_file_set_mtime.c in Sources */,
-                               4B01D6F115B2F46B002D5007 /* zip_stat.c in Sources */,
-                               4B01D6F215B2F46B002D5007 /* zip_strerror.c in Sources */,
-                               4B01D6F315B2F46B002D5007 /* zip_string.c in Sources */,
-                               4B01D6F415B2F46B002D5007 /* zip_unchange_all.c in Sources */,
-                               4B01D6F515B2F46B002D5007 /* zip_unchange_archive.c in Sources */,
-                               4BCF3028199A2F820064207B /* zip_source_rollback_write.c in Sources */,
-                               4BCF3037199ABDDA0064207B /* zip_source_seek_write.c in Sources */,
-                               4B01D6F615B2F46B002D5007 /* zip_unchange_data.c in Sources */,
-                               4B01D6F715B2F46B002D5007 /* zip_unchange.c in Sources */,
-                               4B01D6F815B2F46B002D5007 /* zip_utf-8.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4B01D6F915B2F4B1002D5007 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4B01D72615B2F57F002D5007 /* zipmerge.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4B01D70B15B2F4EB002D5007 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4B01D72515B2F57B002D5007 /* zipcmp.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD58515BC2CEA00920691 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD59515BC2D1C00920691 /* ziptool.c in Sources */,
-                               4BD6CB5D19E6A5D900710654 /* source_hole.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD5B815BC2DC900920691 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD5C315BC2DE000920691 /* add_from_filep.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD5C715BC2DF200920691 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD5D215BC2EFE00920691 /* fopen_unchanged.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD5D615BC2F3700920691 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD5E115BC2F4500920691 /* fread.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BACD64815BC301300920691 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BACD65315BC302500920691 /* tryopen.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BD6CB6219E71CD100710654 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               4BD6CB6F19E71D6900710654 /* hole.c in Sources */,
-                               4BD6CB6419E71CD100710654 /* source_hole.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               4BDC71DC15B182B200236D3C /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               3D7E354A1B330BCD00022624 /* zip_source_is_deleted.c in Sources */,
-                               4BCF3038199ABDDA0064207B /* zip_source_tell_write.c in Sources */,
-                               4BDC724415B1B25E00236D3C /* zip_add_dir.c in Sources */,
-                               4B972051188EBE85002FAFAD /* zip_file_set_external_attributes.c in Sources */,
-                               4B0454BB1E8E3E09002FA1F9 /* zip_source_compress.c in Sources */,
-                               4BCF3023199A2F820064207B /* zip_source_begin_write.c in Sources */,
-                               4BDC724515B1B25E00236D3C /* zip_add_entry.c in Sources */,
-                               4BDC724615B1B25E00236D3C /* zip_add.c in Sources */,
-                               736ED9C11E3D6B8300C36873 /* zip_source_winzip_aes_decode.c in Sources */,
-                               4BDC724715B1B25E00236D3C /* zip_close.c in Sources */,
-                               4BDC724815B1B25E00236D3C /* zip_delete.c in Sources */,
-                               4BD708791EB1CF73003F351F /* zip_progress.c in Sources */,
-                               736ED9C21E3D6B8600C36873 /* zip_source_winzip_aes_encode.c in Sources */,
-                               4BDC724915B1B25E00236D3C /* zip_dir_add.c in Sources */,
-                               4B0454B91E8E3E03002FA1F9 /* zip_source_get_compression_flags.c in Sources */,
-                               4BDC724A15B1B25E00236D3C /* zip_dirent.c in Sources */,
-                               4BDC724B15B1B25E00236D3C /* zip_discard.c in Sources */,
-                               4BDC724C15B1B25E00236D3C /* zip_entry.c in Sources */,
-                               4BDC724D15B1B25E00236D3C /* zip_err_str.c in Sources */,
-                               4B3A5F541DF96EB5005A53A1 /* zip_fseek.c in Sources */,
-                               4BDC724E15B1B25E00236D3C /* zip_error_clear.c in Sources */,
-                               4BDC724F15B1B25E00236D3C /* zip_error_get_sys_type.c in Sources */,
-                               4BDC725015B1B25E00236D3C /* zip_error_get.c in Sources */,
-                               4BDC725115B1B25E00236D3C /* zip_error_strerror.c in Sources */,
-                               4BDC725215B1B25E00236D3C /* zip_error_to_str.c in Sources */,
-                               4BDC725315B1B25E00236D3C /* zip_error.c in Sources */,
-                               4BDC725415B1B25E00236D3C /* zip_extra_field_api.c in Sources */,
-                               4B3A5F551DF96EB5005A53A1 /* zip_ftell.c in Sources */,
-                               4BDC725515B1B25E00236D3C /* zip_extra_field.c in Sources */,
-                               4BDC725615B1B25E00236D3C /* zip_fclose.c in Sources */,
-                               4BDC725715B1B25E00236D3C /* zip_fdopen.c in Sources */,
-                               4BDC725815B1B25E00236D3C /* zip_file_add.c in Sources */,
-                               4BDC725915B1B25E00236D3C /* zip_file_error_clear.c in Sources */,
-                               4BCF3025199A2F820064207B /* zip_source_commit_write.c in Sources */,
-                               4B3A5F511DF96EA9005A53A1 /* gladman-fcrypt.c in Sources */,
-                               4BDC725A15B1B25E00236D3C /* zip_file_error_get.c in Sources */,
-                               4BDC725B15B1B25E00236D3C /* zip_file_get_comment.c in Sources */,
-                               4BDC725C15B1B25E00236D3C /* zip_file_get_offset.c in Sources */,
-                               4BDC725D15B1B25E00236D3C /* zip_file_rename.c in Sources */,
-                               4B0454BF1E8E3E25002FA1F9 /* zip_algorithm_deflate.c in Sources */,
-                               4BDC725E15B1B25E00236D3C /* zip_file_replace.c in Sources */,
-                               4BDC725F15B1B25E00236D3C /* zip_file_set_comment.c in Sources */,
-                               4BCF3032199ABD3A0064207B /* zip_source_remove.c in Sources */,
-                               4BDC726015B1B25E00236D3C /* zip_file_strerror.c in Sources */,
-                               4BDC726115B1B25E00236D3C /* zip_filerange_crc.c in Sources */,
-                               4BDC726215B1B25E00236D3C /* zip_fopen_encrypted.c in Sources */,
-                               4BCF3029199A2F820064207B /* zip_source_seek.c in Sources */,
-                               4BDC726315B1B25E00236D3C /* zip_fopen_index_encrypted.c in Sources */,
-                               4BDC726415B1B25E00236D3C /* zip_fopen_index.c in Sources */,
-                               4BDC726515B1B25E00236D3C /* zip_fopen.c in Sources */,
-                               3D9284811C309510001EABA7 /* zip_hash.c in Sources */,
-                               4BDC726615B1B25E00236D3C /* zip_fread.c in Sources */,
-                               4BDC726715B1B25E00236D3C /* zip_get_archive_comment.c in Sources */,
-                               4BDC726815B1B25E00236D3C /* zip_get_archive_flag.c in Sources */,
-                               736ED9C01E3D6B8000C36873 /* zip_random_unix.c in Sources */,
-                               4B0454BE1E8E3E25002FA1F9 /* zip_algorithm_bzip2.c in Sources */,
-                               4BD5053319A0116D007DD28A /* zip_source_call.c in Sources */,
-                               4BCF302F199A2F820064207B /* zip_source_write.c in Sources */,
-                               4BDC726A15B1B25E00236D3C /* zip_get_encryption_implementation.c in Sources */,
-                               4BDC726B15B1B25E00236D3C /* zip_get_file_comment.c in Sources */,
-                               4BDC726C15B1B25E00236D3C /* zip_get_name.c in Sources */,
-                               4BDC726D15B1B25E00236D3C /* zip_get_num_entries.c in Sources */,
-                               4BDC726E15B1B25E00236D3C /* zip_get_num_files.c in Sources */,
-                               4BDC726F15B1B25E00236D3C /* zip_memdup.c in Sources */,
-                               4BDC727015B1B25E00236D3C /* zip_name_locate.c in Sources */,
-                               4BDC727115B1B25E00236D3C /* zip_new.c in Sources */,
-                               4BDC727215B1B25E00236D3C /* zip_open.c in Sources */,
-                               4BDC727315B1B25E00236D3C /* zip_rename.c in Sources */,
-                               4BCF302D199A2F820064207B /* zip_source_tell.c in Sources */,
-                               4B97204F188EBE85002FAFAD /* zip_file_get_external_attributes.c in Sources */,
-                               4BDC727415B1B25E00236D3C /* zip_replace.c in Sources */,
-                               4BDC727515B1B25E00236D3C /* zip_set_archive_comment.c in Sources */,
-                               736ED9BE1E3D6B7C00C36873 /* zip_file_set_encryption.c in Sources */,
-                               4BDC727615B1B25E00236D3C /* zip_set_archive_flag.c in Sources */,
-                               4BDC727715B1B25E00236D3C /* zip_set_default_password.c in Sources */,
-                               4BDC727815B1B25E00236D3C /* zip_set_file_comment.c in Sources */,
-                               4BDC727915B1B25E00236D3C /* zip_set_file_compression.c in Sources */,
-                               4BDC727A15B1B25E00236D3C /* zip_set_name.c in Sources */,
-                               4BDC727B15B1B25E00236D3C /* zip_source_buffer.c in Sources */,
-                               4BCB434219E9347E0067FAA3 /* zip_buffer.c in Sources */,
-                               4BDC727C15B1B25E00236D3C /* zip_source_close.c in Sources */,
-                               4BDC727D15B1B25E00236D3C /* zip_source_crc.c in Sources */,
-                               4BDC727F15B1B25E00236D3C /* zip_source_error.c in Sources */,
-                               4BDC728015B1B25E00236D3C /* zip_source_file.c in Sources */,
-                               4BDC728115B1B25E00236D3C /* zip_source_filep.c in Sources */,
-                               4BDC728215B1B25E00236D3C /* zip_source_free.c in Sources */,
-                               4BDC728315B1B25E00236D3C /* zip_source_function.c in Sources */,
-                               4BCF3021199A2F820064207B /* zip_io_util.c in Sources */,
-                               4BDC728415B1B25E00236D3C /* zip_source_layered.c in Sources */,
-                               4BDC728515B1B25E00236D3C /* zip_source_open.c in Sources */,
-                               4BDC728615B1B25E00236D3C /* zip_source_pkware.c in Sources */,
-                               4BDC728815B1B25E00236D3C /* zip_source_read.c in Sources */,
-                               4BDC728915B1B25E00236D3C /* zip_source_stat.c in Sources */,
-                               4BCF302B199A2F820064207B /* zip_source_supports.c in Sources */,
-                               4BDC728A15B1B25E00236D3C /* zip_source_window.c in Sources */,
-                               4BDC728B15B1B25E00236D3C /* zip_source_zip_new.c in Sources */,
-                               4BDC728C15B1B25E00236D3C /* zip_source_zip.c in Sources */,
-                               4BDC728D15B1B25E00236D3C /* zip_stat_index.c in Sources */,
-                               4BDC728E15B1B25E00236D3C /* zip_stat_init.c in Sources */,
-                               4B82CED419915F360097BC18 /* zip_file_set_mtime.c in Sources */,
-                               4BDC728F15B1B25E00236D3C /* zip_stat.c in Sources */,
-                               4BDC729015B1B25E00236D3C /* zip_strerror.c in Sources */,
-                               4BDC729115B1B25E00236D3C /* zip_string.c in Sources */,
-                               4BDC729215B1B25E00236D3C /* zip_unchange_all.c in Sources */,
-                               4BDC729315B1B25E00236D3C /* zip_unchange_archive.c in Sources */,
-                               4BCF3027199A2F820064207B /* zip_source_rollback_write.c in Sources */,
-                               4BCF3036199ABDDA0064207B /* zip_source_seek_write.c in Sources */,
-                               4BDC729415B1B25E00236D3C /* zip_unchange_data.c in Sources */,
-                               4BDC729515B1B25E00236D3C /* zip_unchange.c in Sources */,
-                               4BDC729615B1B25E00236D3C /* zip_utf-8.c in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
-               3D7E35451B33064500022624 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D68A15B2F3F1002D5007 /* libzip */;
-                       targetProxy = 3D7E35441B33064500022624 /* PBXContainerItemProxy */;
-               };
-               4B01D72D15B2F5AC002D5007 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D6FC15B2F4B1002D5007 /* zipmerge */;
-                       targetProxy = 4B01D72C15B2F5AC002D5007 /* PBXContainerItemProxy */;
-               };
-               4B01D72F15B2F5AC002D5007 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D70A15B2F4EB002D5007 /* zipcmp */;
-                       targetProxy = 4B01D72E15B2F5AC002D5007 /* PBXContainerItemProxy */;
-               };
-               4B01D73615B2F639002D5007 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D68A15B2F3F1002D5007 /* libzip */;
-                       targetProxy = 4B01D73515B2F639002D5007 /* PBXContainerItemProxy */;
-               };
-               4B01D73815B2F643002D5007 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D68A15B2F3F1002D5007 /* libzip */;
-                       targetProxy = 4B01D73715B2F643002D5007 /* PBXContainerItemProxy */;
-               };
-               4B2CADAC1C50D57800291DE6 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4BACD58815BC2CEA00920691 /* ziptool */;
-                       targetProxy = 4B2CADAB1C50D57800291DE6 /* PBXContainerItemProxy */;
-               };
-               4B54447F15C977AF0067BA33 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D72815B2F5A2002D5007 /* command line tools */;
-                       targetProxy = 4B54447E15C977AF0067BA33 /* PBXContainerItemProxy */;
-               };
-               4B54448115C977B10067BA33 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4BACD5A715BC2D8200920691 /* test programs */;
-                       targetProxy = 4B54448015C977B10067BA33 /* PBXContainerItemProxy */;
-               };
-               4BACD59715BC2D3800920691 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D68A15B2F3F1002D5007 /* libzip */;
-                       targetProxy = 4BACD59615BC2D3800920691 /* PBXContainerItemProxy */;
-               };
-               4BACD5B615BC2DC900920691 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D68A15B2F3F1002D5007 /* libzip */;
-                       targetProxy = 4BACD5B715BC2DC900920691 /* PBXContainerItemProxy */;
-               };
-               4BACD5C515BC2DF200920691 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D68A15B2F3F1002D5007 /* libzip */;
-                       targetProxy = 4BACD5C615BC2DF200920691 /* PBXContainerItemProxy */;
-               };
-               4BACD5D415BC2F3700920691 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D68A15B2F3F1002D5007 /* libzip */;
-                       targetProxy = 4BACD5D515BC2F3700920691 /* PBXContainerItemProxy */;
-               };
-               4BACD64615BC301300920691 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D68A15B2F3F1002D5007 /* libzip */;
-                       targetProxy = 4BACD64715BC301300920691 /* PBXContainerItemProxy */;
-               };
-               4BACD65515BC303B00920691 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4BACD5B515BC2DC900920691 /* add_from_filep */;
-                       targetProxy = 4BACD65415BC303B00920691 /* PBXContainerItemProxy */;
-               };
-               4BACD65715BC303B00920691 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4BACD5C415BC2DF200920691 /* fopen_unchanged */;
-                       targetProxy = 4BACD65615BC303B00920691 /* PBXContainerItemProxy */;
-               };
-               4BACD65915BC303B00920691 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4BACD5D315BC2F3700920691 /* fread */;
-                       targetProxy = 4BACD65815BC303B00920691 /* PBXContainerItemProxy */;
-               };
-               4BACD66915BC303B00920691 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4BACD64515BC301300920691 /* tryopen */;
-                       targetProxy = 4BACD66815BC303B00920691 /* PBXContainerItemProxy */;
-               };
-               4BCF6A791C3BDDF900F036E9 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 3D7E35361B3305FB00022624 /* in-memory */;
-                       targetProxy = 4BCF6A781C3BDDF900F036E9 /* PBXContainerItemProxy */;
-               };
-               4BCF6A7B1C3BDDFF00F036E9 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4BCF6A681C3BDDD500F036E9 /* examples */;
-                       targetProxy = 4BCF6A7A1C3BDDFF00F036E9 /* PBXContainerItemProxy */;
-               };
-               4BD6CB6019E71CD100710654 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4B01D68A15B2F3F1002D5007 /* libzip */;
-                       targetProxy = 4BD6CB6119E71CD100710654 /* PBXContainerItemProxy */;
-               };
-               4BD6CB6E19E71D0800710654 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 4BD6CB5F19E71CD100710654 /* hole */;
-                       targetProxy = 4BD6CB6D19E71D0800710654 /* PBXContainerItemProxy */;
-               };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
-               3D7E353B1B3305FB00022624 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Debug;
-               };
-               3D7E353C1B3305FB00022624 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Release;
-               };
-               4B01D69C15B2F3F1002D5007 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
-                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
-                               COMBINE_HIDPI_IMAGES = YES;
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_VERSION = A;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_PRECOMPILE_PREFIX_HEADER = NO;
-                               GCC_PREFIX_HEADER = "";
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                               GCC_WARN_PEDANTIC = YES;
-                               GCC_WARN_SHADOW = YES;
-                               GCC_WARN_SIGN_COMPARE = YES;
-                               HEADER_SEARCH_PATHS = "../lib/gladman-fcrypt";
-                               INFOPLIST_FILE = Info.plist;
-                               INSTALL_PATH = "@rpath";
-                               PRODUCT_BUNDLE_IDENTIFIER = "at.nih.${PRODUCT_NAME:rfc1034identifier}";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               SKIP_INSTALL = YES;
-                               VERSION_INFO_BUILDER = "";
-                               VERSION_INFO_FILE = "";
-                               WRAPPER_EXTENSION = framework;
-                       };
-                       name = Debug;
-               };
-               4B01D69D15B2F3F1002D5007 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
-                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
-                               COMBINE_HIDPI_IMAGES = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_VERSION = A;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_PRECOMPILE_PREFIX_HEADER = NO;
-                               GCC_PREFIX_HEADER = "";
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                               GCC_WARN_PEDANTIC = YES;
-                               GCC_WARN_SHADOW = YES;
-                               GCC_WARN_SIGN_COMPARE = YES;
-                               HEADER_SEARCH_PATHS = "../lib/gladman-fcrypt";
-                               INFOPLIST_FILE = Info.plist;
-                               INSTALL_PATH = "@rpath";
-                               PRODUCT_BUNDLE_IDENTIFIER = "at.nih.${PRODUCT_NAME:rfc1034identifier}";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               SKIP_INSTALL = YES;
-                               VERSION_INFO_BUILDER = "";
-                               VERSION_INFO_FILE = "";
-                               WRAPPER_EXTENSION = framework;
-                       };
-                       name = Release;
-               };
-               4B01D70515B2F4B1002D5007 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
-                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               GCC_C_LANGUAGE_STANDARD = c99;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                               GCC_WARN_PEDANTIC = YES;
-                               GCC_WARN_SHADOW = YES;
-                               GCC_WARN_SIGN_COMPARE = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Debug;
-               };
-               4B01D70615B2F4B1002D5007 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
-                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_C_LANGUAGE_STANDARD = c99;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                               GCC_WARN_PEDANTIC = YES;
-                               GCC_WARN_SHADOW = YES;
-                               GCC_WARN_SIGN_COMPARE = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Release;
-               };
-               4B01D71115B2F4EB002D5007 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = zipcmp;
-                       };
-                       name = Debug;
-               };
-               4B01D71215B2F4EB002D5007 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = zipcmp;
-                       };
-                       name = Release;
-               };
-               4B01D72A15B2F5A2002D5007 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Debug;
-               };
-               4B01D72B15B2F5A2002D5007 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Release;
-               };
-               4B54447A15C977A20067BA33 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Debug;
-               };
-               4B54447B15C977A20067BA33 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Release;
-               };
-               4BACD59115BC2CEA00920691 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Debug;
-               };
-               4BACD59215BC2CEA00920691 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Release;
-               };
-               4BACD5AF15BC2D8200920691 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "command line tools copy";
-                       };
-                       name = Debug;
-               };
-               4BACD5B015BC2D8200920691 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "command line tools copy";
-                       };
-                       name = Release;
-               };
-               4BACD5BF15BC2DC900920691 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = add_from_filep;
-                       };
-                       name = Debug;
-               };
-               4BACD5C015BC2DC900920691 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = add_from_filep;
-                       };
-                       name = Release;
-               };
-               4BACD5CE15BC2DF200920691 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = fopen_unchanged;
-                       };
-                       name = Debug;
-               };
-               4BACD5CF15BC2DF200920691 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = fopen_unchanged;
-                       };
-                       name = Release;
-               };
-               4BACD5DD15BC2F3700920691 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = fread;
-                       };
-                       name = Debug;
-               };
-               4BACD5DE15BC2F3700920691 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = fread;
-                       };
-                       name = Release;
-               };
-               4BACD64E15BC301300920691 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = tryopen;
-                       };
-                       name = Debug;
-               };
-               4BACD64F15BC301300920691 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = tryopen;
-                       };
-                       name = Release;
-               };
-               4BCF6A761C3BDDD500F036E9 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Debug;
-               };
-               4BCF6A771C3BDDD500F036E9 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Release;
-               };
-               4BD6CB6A19E71CD100710654 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = hole;
-                       };
-                       name = Debug;
-               };
-               4BD6CB6B19E71CD100710654 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/";
-                               PRODUCT_NAME = hole;
-                       };
-                       name = Release;
-               };
-               4BDC71D315B181DA00236D3C /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = NO;
-                               CLANG_ENABLE_OBJC_ARC = YES;
-                               CLANG_WARN_BOOL_CONVERSION = YES;
-                               CLANG_WARN_CONSTANT_CONVERSION = YES;
-                               CLANG_WARN_EMPTY_BODY = YES;
-                               CLANG_WARN_ENUM_CONVERSION = YES;
-                               CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
-                               CLANG_WARN_INFINITE_RECURSION = YES;
-                               CLANG_WARN_INT_CONVERSION = YES;
-                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
-                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
-                               CLANG_WARN_UNREACHABLE_CODE = YES;
-                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-                               COPY_PHASE_STRIP = NO;
-                               ENABLE_STRICT_OBJC_MSGSEND = YES;
-                               ENABLE_TESTABILITY = YES;
-                               GCC_C_LANGUAGE_STANDARD = gnu99;
-                               GCC_DYNAMIC_NO_PIC = NO;
-                               GCC_NO_COMMON_BLOCKS = YES;
-                               GCC_OPTIMIZATION_LEVEL = 0;
-                               GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1";
-                               GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-                               GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                               GCC_WARN_SHADOW = YES;
-                               GCC_WARN_SIGN_COMPARE = YES;
-                               GCC_WARN_UNDECLARED_SELECTOR = YES;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
-                               GCC_WARN_UNUSED_FUNCTION = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               IPHONEOS_DEPLOYMENT_TARGET = 8.0;
-                               MACOSX_DEPLOYMENT_TARGET = 10.6;
-                               ONLY_ACTIVE_ARCH = YES;
-                               SDKROOT = macosx;
-                       };
-                       name = Debug;
-               };
-               4BDC71D415B181DA00236D3C /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = NO;
-                               CLANG_ENABLE_OBJC_ARC = YES;
-                               CLANG_WARN_BOOL_CONVERSION = YES;
-                               CLANG_WARN_CONSTANT_CONVERSION = YES;
-                               CLANG_WARN_EMPTY_BODY = YES;
-                               CLANG_WARN_ENUM_CONVERSION = YES;
-                               CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
-                               CLANG_WARN_INFINITE_RECURSION = YES;
-                               CLANG_WARN_INT_CONVERSION = YES;
-                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
-                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
-                               CLANG_WARN_UNREACHABLE_CODE = YES;
-                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-                               COPY_PHASE_STRIP = YES;
-                               ENABLE_STRICT_OBJC_MSGSEND = YES;
-                               GCC_C_LANGUAGE_STANDARD = gnu99;
-                               GCC_NO_COMMON_BLOCKS = YES;
-                               GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1";
-                               GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
-                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                               GCC_WARN_SHADOW = YES;
-                               GCC_WARN_SIGN_COMPARE = YES;
-                               GCC_WARN_UNDECLARED_SELECTOR = YES;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
-                               GCC_WARN_UNUSED_FUNCTION = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               IPHONEOS_DEPLOYMENT_TARGET = 8.0;
-                               MACOSX_DEPLOYMENT_TARGET = 10.6;
-                               SDKROOT = macosx;
-                               VALIDATE_PRODUCT = YES;
-                       };
-                       name = Release;
-               };
-               4BDC71EB15B182B200236D3C /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
-                               COPY_PHASE_STRIP = YES;
-                               GCC_C_LANGUAGE_STANDARD = c99;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                               GCC_WARN_PEDANTIC = YES;
-                               GCC_WARN_SIGN_COMPARE = YES;
-                               HEADER_SEARCH_PATHS = "../lib/gladman-fcrypt";
-                               INFOPLIST_FILE = Info.plist;
-                               INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
-                               LINK_WITH_STANDARD_LIBRARIES = NO;
-                               MACH_O_TYPE = mh_object;
-                               PRODUCT_BUNDLE_IDENTIFIER = "at.nih.${PRODUCT_NAME:rfc1034identifier}";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               RUN_CLANG_STATIC_ANALYZER = YES;
-                               SDKROOT = iphoneos;
-                               WRAPPER_EXTENSION = framework;
-                       };
-                       name = Debug;
-               };
-               4BDC71EC15B182B200236D3C /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               GCC_C_LANGUAGE_STANDARD = c99;
-                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
-                               GCC_WARN_PEDANTIC = YES;
-                               GCC_WARN_SIGN_COMPARE = YES;
-                               HEADER_SEARCH_PATHS = "../lib/gladman-fcrypt";
-                               INFOPLIST_FILE = Info.plist;
-                               INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
-                               LINK_WITH_STANDARD_LIBRARIES = NO;
-                               MACH_O_TYPE = mh_object;
-                               PRODUCT_BUNDLE_IDENTIFIER = "at.nih.${PRODUCT_NAME:rfc1034identifier}";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               RUN_CLANG_STATIC_ANALYZER = YES;
-                               SDKROOT = iphoneos;
-                               WRAPPER_EXTENSION = framework;
-                       };
-                       name = Release;
-               };
-               4BDC72A315B1B6EA00236D3C /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Debug;
-               };
-               4BDC72A415B1B6EA00236D3C /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COMBINE_HIDPI_IMAGES = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Release;
-               };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-               3D7E353D1B3305FB00022624 /* Build configuration list for PBXNativeTarget "in-memory" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               3D7E353B1B3305FB00022624 /* Debug */,
-                               3D7E353C1B3305FB00022624 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4B01D69E15B2F3F1002D5007 /* Build configuration list for PBXNativeTarget "libzip" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4B01D69C15B2F3F1002D5007 /* Debug */,
-                               4B01D69D15B2F3F1002D5007 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4B01D70415B2F4B1002D5007 /* Build configuration list for PBXNativeTarget "zipmerge" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4B01D70515B2F4B1002D5007 /* Debug */,
-                               4B01D70615B2F4B1002D5007 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4B01D71015B2F4EB002D5007 /* Build configuration list for PBXNativeTarget "zipcmp" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4B01D71115B2F4EB002D5007 /* Debug */,
-                               4B01D71215B2F4EB002D5007 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4B01D72915B2F5A2002D5007 /* Build configuration list for PBXAggregateTarget "command line tools" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4B01D72A15B2F5A2002D5007 /* Debug */,
-                               4B01D72B15B2F5A2002D5007 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4B54447C15C977A20067BA33 /* Build configuration list for PBXAggregateTarget "all" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4B54447A15C977A20067BA33 /* Debug */,
-                               4B54447B15C977A20067BA33 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BACD59015BC2CEA00920691 /* Build configuration list for PBXNativeTarget "ziptool" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BACD59115BC2CEA00920691 /* Debug */,
-                               4BACD59215BC2CEA00920691 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BACD5AE15BC2D8200920691 /* Build configuration list for PBXAggregateTarget "test programs" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BACD5AF15BC2D8200920691 /* Debug */,
-                               4BACD5B015BC2D8200920691 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BACD5BE15BC2DC900920691 /* Build configuration list for PBXNativeTarget "add_from_filep" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BACD5BF15BC2DC900920691 /* Debug */,
-                               4BACD5C015BC2DC900920691 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BACD5CD15BC2DF200920691 /* Build configuration list for PBXNativeTarget "fopen_unchanged" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BACD5CE15BC2DF200920691 /* Debug */,
-                               4BACD5CF15BC2DF200920691 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BACD5DC15BC2F3700920691 /* Build configuration list for PBXNativeTarget "fread" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BACD5DD15BC2F3700920691 /* Debug */,
-                               4BACD5DE15BC2F3700920691 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BACD64D15BC301300920691 /* Build configuration list for PBXNativeTarget "tryopen" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BACD64E15BC301300920691 /* Debug */,
-                               4BACD64F15BC301300920691 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BCF6A751C3BDDD500F036E9 /* Build configuration list for PBXAggregateTarget "examples" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BCF6A761C3BDDD500F036E9 /* Debug */,
-                               4BCF6A771C3BDDD500F036E9 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BD6CB6919E71CD100710654 /* Build configuration list for PBXNativeTarget "hole" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BD6CB6A19E71CD100710654 /* Debug */,
-                               4BD6CB6B19E71CD100710654 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BDC71C215B181DA00236D3C /* Build configuration list for PBXProject "libzip" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BDC71D315B181DA00236D3C /* Debug */,
-                               4BDC71D415B181DA00236D3C /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BDC71EA15B182B200236D3C /* Build configuration list for PBXNativeTarget "libzip_iOS" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BDC71EB15B182B200236D3C /* Debug */,
-                               4BDC71EC15B182B200236D3C /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               4BDC72A215B1B6EA00236D3C /* Build configuration list for PBXAggregateTarget "Build iOS Framework" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               4BDC72A315B1B6EA00236D3C /* Debug */,
-                               4BDC72A415B1B6EA00236D3C /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-/* End XCConfigurationList section */
-       };
-       rootObject = 4BDC71BF15B181DA00236D3C /* Project object */;
-}
diff --git a/xcode/libzip.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/xcode/libzip.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644 (file)
index a302587..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
-   version = "1.0">
-   <FileRef
-      location = "self:libzip.xcodeproj">
-   </FileRef>
-</Workspace>
diff --git a/xcode/mkconfig-h.sh b/xcode/mkconfig-h.sh
deleted file mode 100755 (executable)
index 43199f7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-DIR=tmp.$$
-
-mkdir -p $DIR/32 $DIR/64
-
-(cd $DIR/32; ../../../configure CFLAGS=-m32)
-(cd $DIR/64; ../../../configure CFLAGS=-m64)
-
-diff -D __LP64__ $DIR/32/config.h $DIR/64/config.h > config.h
-
-rm -r $DIR
diff --git a/xcode/zipconf.h b/xcode/zipconf.h
deleted file mode 100644 (file)
index 763f0ec..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _HAD_ZIPCONF_H
-#define _HAD_ZIPCONF_H
-
-/*
-   zipconf.h -- platform specific include file
-
-   This file was generated automatically by ./make_zipconf.sh
-   based on ../config.h.
- */
-
-#define LIBZIP_VERSION "0.11"
-#define LIBZIP_VERSION_MAJOR 0
-#define LIBZIP_VERSION_MINOR 11
-#define LIBZIP_VERSION_MICRO 0
-
-#include <inttypes.h>
-
-typedef int8_t zip_int8_t;
-#define ZIP_INT8_MIN INT8_MIN
-#define ZIP_INT8_MAX INT8_MAX
-
-typedef uint8_t zip_uint8_t;
-#define ZIP_UINT8_MAX UINT8_MAX
-
-typedef int16_t zip_int16_t;
-#define ZIP_INT16_MIN INT16_MIN
-#define ZIP_INT16_MAX INT16_MAX
-
-typedef uint16_t zip_uint16_t;
-#define ZIP_UINT16_MAX UINT16_MAX
-
-typedef int32_t zip_int32_t;
-#define ZIP_INT32_MIN INT32_MIN
-#define ZIP_INT32_MAX INT32_MAX
-
-typedef uint32_t zip_uint32_t;
-#define ZIP_UINT32_MAX UINT32_MAX
-
-typedef int64_t zip_int64_t;
-#define ZIP_INT64_MIN INT64_MIN
-#define ZIP_INT64_MAX INT64_MAX
-
-typedef uint64_t zip_uint64_t;
-#define ZIP_UINT64_MAX UINT64_MAX
-
-
-#endif /* zipconf.h */