libarchive-static 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/extconf.rb +2 -9
- data/ext/libarchive-0.1.1/ext/archive_read_support_compression.c +6 -6
- data/ext/libarchive-0.1.1/ext/archive_read_support_compression.o +0 -0
- data/ext/libarchive-0.1.1/ext/archive_read_support_format.o +0 -0
- data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.c +1 -1
- data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.o +0 -0
- data/ext/libarchive-0.1.1/ext/archive_write_set_compression.c +5 -5
- data/ext/libarchive-0.1.1/ext/archive_write_set_compression.o +0 -0
- data/ext/libarchive-0.1.1/ext/config.h +23 -0
- data/ext/libarchive-0.1.1/ext/config.log +230 -0
- data/ext/libarchive-0.1.1/ext/config.status +671 -0
- data/ext/libarchive-0.1.1/ext/libarchive.c +1 -1
- data/ext/libarchive-0.1.1/ext/libarchive.o +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_archive.c +7 -7
- data/ext/libarchive-0.1.1/ext/libarchive_archive.o +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_entry.c +6 -0
- data/ext/libarchive-0.1.1/ext/libarchive_entry.o +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_reader.c +6 -4
- data/ext/libarchive-0.1.1/ext/libarchive_reader.o +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_ruby.so +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_win32.h +1 -1
- data/ext/libarchive-0.1.1/ext/libarchive_writer.c +2 -2
- data/ext/libarchive-0.1.1/ext/libarchive_writer.o +0 -0
- data/ext/libarchive-3.6.2/Makefile.in +16892 -0
- data/ext/libarchive-3.6.2/build/autoconf/ax_append_compile_flags.m4 +67 -0
- data/ext/libarchive-3.6.2/build/autoconf/ax_append_flag.m4 +71 -0
- data/ext/libarchive-3.6.2/build/autoconf/ax_check_compile_flag.m4 +74 -0
- data/ext/libarchive-3.6.2/build/autoconf/ax_require_defined.m4 +37 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/check_stdcall_func.m4 +0 -0
- data/ext/libarchive-3.6.2/build/autoconf/compile +348 -0
- data/ext/libarchive-3.6.2/build/autoconf/config.guess +1754 -0
- data/ext/libarchive-3.6.2/build/autoconf/config.rpath +696 -0
- data/ext/libarchive-3.6.2/build/autoconf/config.sub +1890 -0
- data/ext/libarchive-3.6.2/build/autoconf/depcomp +791 -0
- data/ext/libarchive-3.6.2/build/autoconf/iconv.m4 +271 -0
- data/ext/libarchive-3.6.2/build/autoconf/install-sh +541 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/la_uid_t.m4 +0 -0
- data/ext/libarchive-3.6.2/build/autoconf/lib-ld.m4 +109 -0
- data/ext/libarchive-3.6.2/build/autoconf/lib-link.m4 +777 -0
- data/ext/libarchive-3.6.2/build/autoconf/lib-prefix.m4 +224 -0
- data/ext/libarchive-3.6.2/build/autoconf/ltmain.sh +11251 -0
- data/ext/libarchive-3.6.2/build/autoconf/m4_ax_compile_check_sizeof.m4 +115 -0
- data/ext/libarchive-3.6.2/build/autoconf/missing +215 -0
- data/ext/libarchive-3.6.2/build/autoconf/test-driver +153 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/pkgconfig/libarchive.pc.in +4 -1
- data/ext/libarchive-3.6.2/config.h.in +1504 -0
- data/ext/libarchive-3.6.2/configure +25558 -0
- data/ext/libarchive-3.6.2/libarchive/archive.h +1212 -0
- data/ext/libarchive-3.6.2/libarchive/archive_acl.c +2097 -0
- data/ext/libarchive-3.6.2/libarchive/archive_acl_private.h +83 -0
- data/ext/libarchive-3.6.2/libarchive/archive_blake2.h +197 -0
- data/ext/libarchive-3.6.2/libarchive/archive_blake2_impl.h +161 -0
- data/ext/libarchive-3.6.2/libarchive/archive_blake2s_ref.c +369 -0
- data/ext/libarchive-3.6.2/libarchive/archive_blake2sp_ref.c +361 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_check_magic.c +63 -22
- data/ext/libarchive-3.6.2/libarchive/archive_cmdline.c +227 -0
- data/ext/libarchive-3.6.2/libarchive/archive_cmdline_private.h +47 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_crc32.h +17 -0
- data/ext/libarchive-3.6.2/libarchive/archive_cryptor.c +534 -0
- data/ext/libarchive-3.6.2/libarchive/archive_cryptor_private.h +188 -0
- data/ext/libarchive-3.6.2/libarchive/archive_digest.c +1505 -0
- data/ext/libarchive-3.6.2/libarchive/archive_digest_private.h +416 -0
- data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_darwin.c +559 -0
- data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_freebsd.c +712 -0
- data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_linux.c +760 -0
- data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_sunos.c +824 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_endian.h +48 -15
- data/ext/libarchive-3.6.2/libarchive/archive_entry.c +2149 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry.h +305 -106
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_bhfi.c +5 -4
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_stat.c +9 -3
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_link_resolver.c +104 -62
- data/ext/libarchive-3.6.2/libarchive/archive_entry_locale.h +92 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_private.h +65 -49
- data/ext/libarchive-3.6.2/libarchive/archive_entry_sparse.c +156 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_stat.c +6 -6
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_strmode.c +1 -1
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_xattr.c +4 -6
- data/ext/libarchive-3.6.2/libarchive/archive_getdate.c +1165 -0
- data/ext/libarchive-3.6.2/libarchive/archive_getdate.h +39 -0
- data/ext/libarchive-3.6.2/libarchive/archive_hmac.c +334 -0
- data/ext/libarchive-3.6.2/libarchive/archive_hmac_private.h +117 -0
- data/ext/libarchive-3.6.2/libarchive/archive_match.c +1875 -0
- data/ext/libarchive-3.6.2/libarchive/archive_openssl_evp_private.h +53 -0
- data/ext/libarchive-3.6.2/libarchive/archive_openssl_hmac_private.h +54 -0
- data/ext/libarchive-3.6.2/libarchive/archive_options.c +218 -0
- data/ext/libarchive-3.6.2/libarchive/archive_options_private.h +51 -0
- data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.c +337 -0
- data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.h +49 -0
- data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.c +463 -0
- data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.h +52 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_platform.h +77 -9
- data/ext/libarchive-3.6.2/libarchive/archive_platform_acl.h +55 -0
- data/ext/libarchive-3.6.2/libarchive/archive_platform_xattr.h +47 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd7.c +1168 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd7_private.h +119 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd8.c +1287 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd8_private.h +148 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd_private.h +151 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_private.h +74 -18
- data/ext/libarchive-3.6.2/libarchive/archive_random.c +272 -0
- data/ext/libarchive-3.6.2/libarchive/archive_random_private.h +36 -0
- data/ext/libarchive-3.6.2/libarchive/archive_rb.c +709 -0
- data/ext/libarchive-3.6.2/libarchive/archive_rb.h +113 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read.c +1756 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_add_passphrase.c +190 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_append_filter.c +204 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_data_into_fd.c +64 -18
- data/ext/libarchive-3.6.2/libarchive/archive_read_disk_entry_from_file.c +1086 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_disk_posix.c +2732 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_private.h +40 -4
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_set_standard_lookup.c +21 -11
- data/ext/libarchive-3.6.2/libarchive/archive_read_disk_windows.c +2479 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_extract.c +60 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_extract.c → libarchive-3.6.2/libarchive/archive_read_extract2.c} +34 -61
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_fd.c +70 -49
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_file.c +38 -23
- data/ext/libarchive-3.6.2/libarchive/archive_read_open_filename.c +586 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_memory.c +58 -28
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_private.h +127 -59
- data/ext/libarchive-3.6.2/libarchive/archive_read_set_format.c +117 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_set_options.c +133 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_all.c → libarchive-3.6.2/libarchive/archive_read_support_filter_all.c} +35 -10
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_by_code.c +83 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_bzip2.c → libarchive-3.6.2/libarchive/archive_read_support_filter_bzip2.c} +38 -26
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_compress.c → libarchive-3.6.2/libarchive/archive_read_support_filter_compress.c} +52 -44
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_grzip.c +112 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_gzip.c → libarchive-3.6.2/libarchive/archive_read_support_filter_gzip.c} +108 -37
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lrzip.c +122 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lz4.c +742 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lzop.c +499 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_none.c → libarchive-3.6.2/libarchive/archive_read_support_filter_none.c} +15 -3
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_program.c → libarchive-3.6.2/libarchive/archive_read_support_filter_program.c} +114 -77
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_rpm.c → libarchive-3.6.2/libarchive/archive_read_support_filter_rpm.c} +31 -31
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_uu.c → libarchive-3.6.2/libarchive/archive_read_support_filter_uu.c} +141 -85
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_xz.c → libarchive-3.6.2/libarchive/archive_read_support_filter_xz.c} +369 -284
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_zstd.c +297 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_7zip.c +3900 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_all.c +89 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_ar.c +126 -72
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_by_code.c +92 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cab.c +3228 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cpio.c +1104 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_empty.c +14 -11
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_iso9660.c +990 -541
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_lha.c +2916 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_mtree.c +2150 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar.c +3797 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar5.c +4251 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_raw.c +38 -31
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_tar.c +1157 -629
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_warc.c +848 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_xar.c +439 -258
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_zip.c +4270 -0
- data/ext/libarchive-3.6.2/libarchive/archive_string.c +4240 -0
- data/ext/libarchive-3.6.2/libarchive/archive_string.h +243 -0
- data/ext/libarchive-3.6.2/libarchive/archive_string_composition.h +2292 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_string_sprintf.c +44 -16
- data/ext/libarchive-3.6.2/libarchive/archive_util.c +655 -0
- data/ext/libarchive-3.6.2/libarchive/archive_version_details.c +151 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_virtual.c +85 -16
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.c +214 -541
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.h +74 -106
- data/ext/libarchive-3.6.2/libarchive/archive_write.c +828 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter.c +72 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_b64encode.c +304 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_by_name.c +77 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_bzip2.c +401 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_write_set_compression_compress.c → libarchive-3.6.2/libarchive/archive_write_add_filter_compress.c} +86 -131
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_grzip.c +135 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_gzip.c +442 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lrzip.c +197 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lz4.c +700 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lzop.c +478 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_format_all.c → libarchive-3.6.2/libarchive/archive_write_add_filter_none.c} +11 -11
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_program.c +391 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_uuencode.c +295 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_xz.c +545 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_zstd.c +418 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_disk_posix.c +4711 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_private.h +9 -2
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_set_standard_lookup.c +30 -29
- data/ext/libarchive-3.6.2/libarchive/archive_write_disk_windows.c +2842 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_fd.c +15 -10
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_file.c +15 -9
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_filename.c +128 -20
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_memory.c +7 -18
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_private.h +72 -29
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format.c +56 -3
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_7zip.c +2322 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ar.c +54 -34
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_by_name.c +20 -2
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio.c +11 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_binary.c +610 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_newc.c +457 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_odc.c +500 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_filter_by_ext.c +142 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_gnutar.c +755 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_iso9660.c +8165 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_mtree.c +2217 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_pax.c +1049 -387
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_private.h +42 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_raw.c +125 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_shar.c +62 -47
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ustar.c +279 -108
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_v7tar.c +638 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_warc.c +453 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_xar.c +3259 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_zip.c +1704 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_options.c +130 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_passphrase.c +95 -0
- data/ext/libarchive-3.6.2/libarchive/archive_xxhash.h +48 -0
- data/ext/libarchive-3.6.2/libarchive/config_freebsd.h +271 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/filter_fork.h +10 -5
- data/ext/{libarchive-2.8.4/libarchive/filter_fork.c → libarchive-3.6.2/libarchive/filter_fork_posix.c} +98 -19
- data/ext/libarchive-3.6.2/libarchive/filter_fork_windows.c +236 -0
- data/ext/libarchive-3.6.2/libarchive/xxhash.c +525 -0
- data/ext/libarchive-static-makefile +144 -80
- data/ext/libarchive-static-wrapper-makefile +1 -1
- data/ext/zlib-1.2.13/Makefile.in +404 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/adler32.c +51 -34
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/compress.c +27 -21
- data/ext/zlib-1.2.13/configure +922 -0
- data/ext/zlib-1.2.13/crc32.c +1125 -0
- data/ext/zlib-1.2.13/crc32.h +9446 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.c +842 -459
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.h +37 -33
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzclose.c +0 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzguts.h +103 -16
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzlib.c +155 -53
- data/ext/zlib-1.2.13/gzread.c +650 -0
- data/ext/zlib-1.2.13/gzwrite.c +677 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/infback.c +24 -12
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.c +49 -66
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.h +0 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffixed.h +3 -3
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.c +209 -94
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.h +9 -5
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.c +24 -50
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.h +1 -1
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.c +135 -198
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.h +0 -0
- data/ext/zlib-1.2.13/uncompr.c +93 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/zconf.h +182 -63
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/zlib.h +617 -295
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.c +50 -41
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.h +83 -82
- metadata +241 -133
- data/ext/libarchive-0.1.1/libarchive.c +0 -1762
- data/ext/libarchive-2.8.4/Makefile.in +0 -7076
- data/ext/libarchive-2.8.4/build/autoconf/compile +0 -143
- data/ext/libarchive-2.8.4/build/autoconf/config.guess +0 -1502
- data/ext/libarchive-2.8.4/build/autoconf/config.sub +0 -1708
- data/ext/libarchive-2.8.4/build/autoconf/depcomp +0 -630
- data/ext/libarchive-2.8.4/build/autoconf/install-sh +0 -291
- data/ext/libarchive-2.8.4/build/autoconf/ltmain.sh +0 -8406
- data/ext/libarchive-2.8.4/build/autoconf/missing +0 -376
- data/ext/libarchive-2.8.4/config.h.in +0 -772
- data/ext/libarchive-2.8.4/configure +0 -17916
- data/ext/libarchive-2.8.4/libarchive/archive.h +0 -741
- data/ext/libarchive-2.8.4/libarchive/archive_entry.c +0 -2202
- data/ext/libarchive-2.8.4/libarchive/archive_hash.h +0 -281
- data/ext/libarchive-2.8.4/libarchive/archive_read.c +0 -1249
- data/ext/libarchive-2.8.4/libarchive/archive_read_disk.c +0 -198
- data/ext/libarchive-2.8.4/libarchive/archive_read_disk_entry_from_file.c +0 -570
- data/ext/libarchive-2.8.4/libarchive/archive_read_open_filename.c +0 -272
- data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_cpio.c +0 -777
- data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_mtree.c +0 -1304
- data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_zip.c +0 -903
- data/ext/libarchive-2.8.4/libarchive/archive_string.c +0 -453
- data/ext/libarchive-2.8.4/libarchive/archive_string.h +0 -148
- data/ext/libarchive-2.8.4/libarchive/archive_util.c +0 -391
- data/ext/libarchive-2.8.4/libarchive/archive_write.c +0 -466
- data/ext/libarchive-2.8.4/libarchive/archive_write_disk.c +0 -2628
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_bzip2.c +0 -408
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_gzip.c +0 -477
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_none.c +0 -257
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_program.c +0 -347
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_xz.c +0 -438
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio.c +0 -344
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio_newc.c +0 -295
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_mtree.c +0 -1050
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_zip.c +0 -667
- data/ext/libarchive-2.8.4/libarchive/config_freebsd.h +0 -154
- data/ext/libarchive-2.8.4/libarchive/filter_fork_windows.c +0 -113
- data/ext/zlib-1.2.5/Makefile.in +0 -257
- data/ext/zlib-1.2.5/configure +0 -596
- data/ext/zlib-1.2.5/crc32.c +0 -442
- data/ext/zlib-1.2.5/crc32.h +0 -441
- data/ext/zlib-1.2.5/example.c +0 -565
- data/ext/zlib-1.2.5/gzread.c +0 -653
- data/ext/zlib-1.2.5/gzwrite.c +0 -531
- data/ext/zlib-1.2.5/minigzip.c +0 -440
- data/ext/zlib-1.2.5/uncompr.c +0 -59
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
|
2
|
-
version 1.2.
|
|
2
|
+
version 1.2.13, October 13th, 2022
|
|
3
3
|
|
|
4
|
-
Copyright (C) 1995-
|
|
4
|
+
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
|
5
5
|
|
|
6
6
|
This software is provided 'as-is', without any express or implied
|
|
7
7
|
warranty. In no event will the authors be held liable for any damages
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
The data format used by the zlib library is described by RFCs (Request for
|
|
27
|
-
Comments) 1950 to 1952 in the files http://
|
|
28
|
-
(zlib format), rfc1951
|
|
27
|
+
Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
|
|
28
|
+
(zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
#ifndef ZLIB_H
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
extern "C" {
|
|
38
38
|
#endif
|
|
39
39
|
|
|
40
|
-
#define ZLIB_VERSION "1.2.
|
|
41
|
-
#define ZLIB_VERNUM
|
|
40
|
+
#define ZLIB_VERSION "1.2.13"
|
|
41
|
+
#define ZLIB_VERNUM 0x12d0
|
|
42
42
|
#define ZLIB_VER_MAJOR 1
|
|
43
43
|
#define ZLIB_VER_MINOR 2
|
|
44
|
-
#define ZLIB_VER_REVISION
|
|
44
|
+
#define ZLIB_VER_REVISION 13
|
|
45
45
|
#define ZLIB_VER_SUBREVISION 0
|
|
46
46
|
|
|
47
47
|
/*
|
|
@@ -65,7 +65,8 @@ extern "C" {
|
|
|
65
65
|
with "gz". The gzip format is different from the zlib format. gzip is a
|
|
66
66
|
gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
|
|
67
67
|
|
|
68
|
-
This library can optionally read and write gzip
|
|
68
|
+
This library can optionally read and write gzip and raw deflate streams in
|
|
69
|
+
memory as well.
|
|
69
70
|
|
|
70
71
|
The zlib format was designed to be compact and fast for use in memory
|
|
71
72
|
and on communications channels. The gzip format was designed for single-
|
|
@@ -74,7 +75,7 @@ extern "C" {
|
|
|
74
75
|
|
|
75
76
|
The library does not install any signal handler. The decoder checks
|
|
76
77
|
the consistency of the compressed data, so the library should never crash
|
|
77
|
-
even in case of corrupted input.
|
|
78
|
+
even in the case of corrupted input.
|
|
78
79
|
*/
|
|
79
80
|
|
|
80
81
|
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
|
|
@@ -83,23 +84,24 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address));
|
|
|
83
84
|
struct internal_state;
|
|
84
85
|
|
|
85
86
|
typedef struct z_stream_s {
|
|
86
|
-
Bytef
|
|
87
|
+
z_const Bytef *next_in; /* next input byte */
|
|
87
88
|
uInt avail_in; /* number of bytes available at next_in */
|
|
88
|
-
uLong total_in; /* total
|
|
89
|
+
uLong total_in; /* total number of input bytes read so far */
|
|
89
90
|
|
|
90
|
-
Bytef *next_out; /* next output byte
|
|
91
|
+
Bytef *next_out; /* next output byte will go here */
|
|
91
92
|
uInt avail_out; /* remaining free space at next_out */
|
|
92
|
-
uLong total_out; /* total
|
|
93
|
+
uLong total_out; /* total number of bytes output so far */
|
|
93
94
|
|
|
94
|
-
char
|
|
95
|
+
z_const char *msg; /* last error message, NULL if no error */
|
|
95
96
|
struct internal_state FAR *state; /* not visible by applications */
|
|
96
97
|
|
|
97
98
|
alloc_func zalloc; /* used to allocate the internal state */
|
|
98
99
|
free_func zfree; /* used to free the internal state */
|
|
99
100
|
voidpf opaque; /* private data object passed to zalloc and zfree */
|
|
100
101
|
|
|
101
|
-
int data_type; /* best guess about the data type: binary or text
|
|
102
|
-
|
|
102
|
+
int data_type; /* best guess about the data type: binary or text
|
|
103
|
+
for deflate, or the decoding state for inflate */
|
|
104
|
+
uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */
|
|
103
105
|
uLong reserved; /* reserved for future use */
|
|
104
106
|
} z_stream;
|
|
105
107
|
|
|
@@ -142,7 +144,9 @@ typedef gz_header FAR *gz_headerp;
|
|
|
142
144
|
|
|
143
145
|
zalloc must return Z_NULL if there is not enough memory for the object.
|
|
144
146
|
If zlib is used in a multi-threaded application, zalloc and zfree must be
|
|
145
|
-
thread safe.
|
|
147
|
+
thread safe. In that case, zlib is thread-safe. When zalloc and zfree are
|
|
148
|
+
Z_NULL on entry to the initialization function, they are set to internal
|
|
149
|
+
routines that use the standard library functions malloc() and free().
|
|
146
150
|
|
|
147
151
|
On 16-bit systems, the functions zalloc and zfree must be able to allocate
|
|
148
152
|
exactly 65536 bytes, but will not be required to allocate more than this if
|
|
@@ -155,7 +159,7 @@ typedef gz_header FAR *gz_headerp;
|
|
|
155
159
|
|
|
156
160
|
The fields total_in and total_out can be used for statistics or progress
|
|
157
161
|
reports. After compression, total_in holds the total size of the
|
|
158
|
-
uncompressed data and may be saved for use
|
|
162
|
+
uncompressed data and may be saved for use by the decompressor (particularly
|
|
159
163
|
if the decompressor wants to decompress everything in a single step).
|
|
160
164
|
*/
|
|
161
165
|
|
|
@@ -200,7 +204,7 @@ typedef gz_header FAR *gz_headerp;
|
|
|
200
204
|
#define Z_TEXT 1
|
|
201
205
|
#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
|
|
202
206
|
#define Z_UNKNOWN 2
|
|
203
|
-
/* Possible values of the data_type field
|
|
207
|
+
/* Possible values of the data_type field for deflate() */
|
|
204
208
|
|
|
205
209
|
#define Z_DEFLATED 8
|
|
206
210
|
/* The deflate compression method (the only one supported in this version) */
|
|
@@ -258,11 +262,11 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
|
|
|
258
262
|
enough room in the output buffer), next_in and avail_in are updated and
|
|
259
263
|
processing will resume at this point for the next call of deflate().
|
|
260
264
|
|
|
261
|
-
-
|
|
265
|
+
- Generate more output starting at next_out and update next_out and avail_out
|
|
262
266
|
accordingly. This action is forced if the parameter flush is non zero.
|
|
263
267
|
Forcing flush frequently degrades the compression ratio, so this parameter
|
|
264
|
-
should be set only when necessary
|
|
265
|
-
|
|
268
|
+
should be set only when necessary. Some output may be provided even if
|
|
269
|
+
flush is zero.
|
|
266
270
|
|
|
267
271
|
Before the call of deflate(), the application should ensure that at least
|
|
268
272
|
one of the actions is possible, by providing more input and/or consuming more
|
|
@@ -271,7 +275,9 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
|
|
|
271
275
|
output when it wants, for example when the output buffer is full (avail_out
|
|
272
276
|
== 0), or after each call of deflate(). If deflate returns Z_OK and with
|
|
273
277
|
zero avail_out, it must be called again after making room in the output
|
|
274
|
-
buffer because there might be more output pending.
|
|
278
|
+
buffer because there might be more output pending. See deflatePending(),
|
|
279
|
+
which can be used if desired to determine whether or not there is more output
|
|
280
|
+
in that case.
|
|
275
281
|
|
|
276
282
|
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
|
|
277
283
|
decide how much data to accumulate before producing output, in order to
|
|
@@ -292,8 +298,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
|
|
|
292
298
|
input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
|
|
293
299
|
This completes the current deflate block and follows it with an empty fixed
|
|
294
300
|
codes block that is 10 bits long. This assures that enough bytes are output
|
|
295
|
-
in order for the decompressor to finish the block before the empty fixed
|
|
296
|
-
block.
|
|
301
|
+
in order for the decompressor to finish the block before the empty fixed
|
|
302
|
+
codes block.
|
|
297
303
|
|
|
298
304
|
If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
|
|
299
305
|
for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
|
|
@@ -319,33 +325,38 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
|
|
|
319
325
|
|
|
320
326
|
If the parameter flush is set to Z_FINISH, pending input is processed,
|
|
321
327
|
pending output is flushed and deflate returns with Z_STREAM_END if there was
|
|
322
|
-
enough output space
|
|
323
|
-
called again with Z_FINISH and more output space (updated
|
|
324
|
-
more input data, until it returns with Z_STREAM_END or an
|
|
325
|
-
deflate has returned Z_STREAM_END, the only possible operations
|
|
326
|
-
are deflateReset or deflateEnd.
|
|
327
|
-
|
|
328
|
-
Z_FINISH can be used
|
|
329
|
-
is to be done in a single step. In
|
|
330
|
-
value returned by deflateBound (see
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
328
|
+
enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this
|
|
329
|
+
function must be called again with Z_FINISH and more output space (updated
|
|
330
|
+
avail_out) but no more input data, until it returns with Z_STREAM_END or an
|
|
331
|
+
error. After deflate has returned Z_STREAM_END, the only possible operations
|
|
332
|
+
on the stream are deflateReset or deflateEnd.
|
|
333
|
+
|
|
334
|
+
Z_FINISH can be used in the first deflate call after deflateInit if all the
|
|
335
|
+
compression is to be done in a single step. In order to complete in one
|
|
336
|
+
call, avail_out must be at least the value returned by deflateBound (see
|
|
337
|
+
below). Then deflate is guaranteed to return Z_STREAM_END. If not enough
|
|
338
|
+
output space is provided, deflate will not return Z_STREAM_END, and it must
|
|
339
|
+
be called again as described above.
|
|
340
|
+
|
|
341
|
+
deflate() sets strm->adler to the Adler-32 checksum of all input read
|
|
342
|
+
so far (that is, total_in bytes). If a gzip stream is being generated, then
|
|
343
|
+
strm->adler will be the CRC-32 checksum of the input read so far. (See
|
|
344
|
+
deflateInit2 below.)
|
|
335
345
|
|
|
336
346
|
deflate() may update strm->data_type if it can make a good guess about
|
|
337
|
-
the input data type (Z_BINARY or Z_TEXT).
|
|
338
|
-
binary. This field is only for information purposes and does not
|
|
339
|
-
compression algorithm in any manner.
|
|
347
|
+
the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is
|
|
348
|
+
considered binary. This field is only for information purposes and does not
|
|
349
|
+
affect the compression algorithm in any manner.
|
|
340
350
|
|
|
341
351
|
deflate() returns Z_OK if some progress has been made (more input
|
|
342
352
|
processed or more output produced), Z_STREAM_END if all input has been
|
|
343
353
|
consumed and all output has been produced (only when flush is set to
|
|
344
354
|
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
|
|
345
|
-
if next_in or next_out was Z_NULL
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
space to
|
|
355
|
+
if next_in or next_out was Z_NULL or the state was inadvertently written over
|
|
356
|
+
by the application), or Z_BUF_ERROR if no progress is possible (for example
|
|
357
|
+
avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and
|
|
358
|
+
deflate() can be called again with more input and more output space to
|
|
359
|
+
continue compressing.
|
|
349
360
|
*/
|
|
350
361
|
|
|
351
362
|
|
|
@@ -368,23 +379,21 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
|
|
|
368
379
|
|
|
369
380
|
Initializes the internal stream state for decompression. The fields
|
|
370
381
|
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
|
|
371
|
-
the caller.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
use default allocation functions.
|
|
382
|
+
the caller. In the current version of inflate, the provided input is not
|
|
383
|
+
read or consumed. The allocation of a sliding window will be deferred to
|
|
384
|
+
the first call of inflate (if the decompression does not complete on the
|
|
385
|
+
first call). If zalloc and zfree are set to Z_NULL, inflateInit updates
|
|
386
|
+
them to use default allocation functions.
|
|
377
387
|
|
|
378
388
|
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
|
379
389
|
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
|
380
390
|
version assumed by the caller, or Z_STREAM_ERROR if the parameters are
|
|
381
391
|
invalid, such as a null pointer to the structure. msg is set to null if
|
|
382
|
-
there is no error message. inflateInit does not perform any decompression
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
until inflate() is called.
|
|
392
|
+
there is no error message. inflateInit does not perform any decompression.
|
|
393
|
+
Actual decompression will be done by inflate(). So next_in, and avail_in,
|
|
394
|
+
next_out, and avail_out are unused and unchanged. The current
|
|
395
|
+
implementation of inflateInit() does not process any header information --
|
|
396
|
+
that is deferred until inflate() is called.
|
|
388
397
|
*/
|
|
389
398
|
|
|
390
399
|
|
|
@@ -400,17 +409,20 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
|
|
|
400
409
|
|
|
401
410
|
- Decompress more input starting at next_in and update next_in and avail_in
|
|
402
411
|
accordingly. If not all input can be processed (because there is not
|
|
403
|
-
enough room in the output buffer), next_in
|
|
404
|
-
resume at this point for the next call of
|
|
412
|
+
enough room in the output buffer), then next_in and avail_in are updated
|
|
413
|
+
accordingly, and processing will resume at this point for the next call of
|
|
414
|
+
inflate().
|
|
405
415
|
|
|
406
|
-
-
|
|
416
|
+
- Generate more output starting at next_out and update next_out and avail_out
|
|
407
417
|
accordingly. inflate() provides as much output as possible, until there is
|
|
408
418
|
no more input data or no more space in the output buffer (see below about
|
|
409
419
|
the flush parameter).
|
|
410
420
|
|
|
411
421
|
Before the call of inflate(), the application should ensure that at least
|
|
412
422
|
one of the actions is possible, by providing more input and/or consuming more
|
|
413
|
-
output, and updating the next_* and avail_* values accordingly.
|
|
423
|
+
output, and updating the next_* and avail_* values accordingly. If the
|
|
424
|
+
caller of inflate() does not provide both available input and available
|
|
425
|
+
output space, it is possible that there will be no progress made. The
|
|
414
426
|
application can consume the uncompressed output when it wants, for example
|
|
415
427
|
when the output buffer is full (avail_out == 0), or after each call of
|
|
416
428
|
inflate(). If inflate returns Z_OK and with zero avail_out, it must be
|
|
@@ -427,7 +439,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
|
|
|
427
439
|
gets to the end of that block, or when it runs out of data.
|
|
428
440
|
|
|
429
441
|
The Z_BLOCK option assists in appending to or combining deflate streams.
|
|
430
|
-
|
|
442
|
+
To assist in this, on return inflate() always sets strm->data_type to the
|
|
431
443
|
number of unused bits in the last byte taken from strm->next_in, plus 64 if
|
|
432
444
|
inflate() is currently decoding the last block in the deflate stream, plus
|
|
433
445
|
128 if inflate() returned immediately after decoding an end-of-block code or
|
|
@@ -451,48 +463,57 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
|
|
|
451
463
|
error. However if all decompression is to be performed in a single step (a
|
|
452
464
|
single call of inflate), the parameter flush should be set to Z_FINISH. In
|
|
453
465
|
this case all pending input is processed and all pending output is flushed;
|
|
454
|
-
avail_out must be large enough to hold all the uncompressed data
|
|
455
|
-
of the uncompressed data may have been
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
inflate
|
|
466
|
+
avail_out must be large enough to hold all of the uncompressed data for the
|
|
467
|
+
operation to complete. (The size of the uncompressed data may have been
|
|
468
|
+
saved by the compressor for this purpose.) The use of Z_FINISH is not
|
|
469
|
+
required to perform an inflation in one step. However it may be used to
|
|
470
|
+
inform inflate that a faster approach can be used for the single inflate()
|
|
471
|
+
call. Z_FINISH also informs inflate to not maintain a sliding window if the
|
|
472
|
+
stream completes, which reduces inflate's memory footprint. If the stream
|
|
473
|
+
does not complete, either because not all of the stream is provided or not
|
|
474
|
+
enough output space is provided, then a sliding window will be allocated and
|
|
475
|
+
inflate() can be called again to continue the operation as if Z_NO_FLUSH had
|
|
476
|
+
been used.
|
|
460
477
|
|
|
461
478
|
In this implementation, inflate() always flushes as much output as
|
|
462
479
|
possible to the output buffer, and always uses the faster approach on the
|
|
463
|
-
first call. So the
|
|
464
|
-
|
|
465
|
-
|
|
480
|
+
first call. So the effects of the flush parameter in this implementation are
|
|
481
|
+
on the return value of inflate() as noted below, when inflate() returns early
|
|
482
|
+
when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
|
|
483
|
+
memory for a sliding window when Z_FINISH is used.
|
|
466
484
|
|
|
467
485
|
If a preset dictionary is needed after this call (see inflateSetDictionary
|
|
468
|
-
below), inflate sets strm->adler to the
|
|
486
|
+
below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
|
|
469
487
|
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
|
|
470
|
-
strm->adler to the
|
|
488
|
+
strm->adler to the Adler-32 checksum of all output produced so far (that is,
|
|
471
489
|
total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
|
|
472
|
-
below. At the end of the stream, inflate() checks that its computed
|
|
490
|
+
below. At the end of the stream, inflate() checks that its computed Adler-32
|
|
473
491
|
checksum is equal to that saved by the compressor and returns Z_STREAM_END
|
|
474
492
|
only if the checksum is correct.
|
|
475
493
|
|
|
476
494
|
inflate() can decompress and check either zlib-wrapped or gzip-wrapped
|
|
477
495
|
deflate data. The header type is detected automatically, if requested when
|
|
478
496
|
initializing with inflateInit2(). Any information contained in the gzip
|
|
479
|
-
header is not retained
|
|
480
|
-
|
|
481
|
-
|
|
497
|
+
header is not retained unless inflateGetHeader() is used. When processing
|
|
498
|
+
gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
|
|
499
|
+
produced so far. The CRC-32 is checked against the gzip trailer, as is the
|
|
500
|
+
uncompressed length, modulo 2^32.
|
|
482
501
|
|
|
483
502
|
inflate() returns Z_OK if some progress has been made (more input processed
|
|
484
503
|
or more output produced), Z_STREAM_END if the end of the compressed data has
|
|
485
504
|
been reached and all uncompressed output has been produced, Z_NEED_DICT if a
|
|
486
505
|
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
|
|
487
506
|
corrupted (input stream not conforming to the zlib format or incorrect check
|
|
488
|
-
value
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
507
|
+
value, in which case strm->msg points to a string with a more specific
|
|
508
|
+
error), Z_STREAM_ERROR if the stream structure was inconsistent (for example
|
|
509
|
+
next_in or next_out was Z_NULL, or the state was inadvertently written over
|
|
510
|
+
by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR
|
|
511
|
+
if no progress was possible or if there was not enough room in the output
|
|
512
|
+
buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
|
|
492
513
|
inflate() can be called again with more input and more output space to
|
|
493
514
|
continue decompressing. If Z_DATA_ERROR is returned, the application may
|
|
494
515
|
then call inflateSync() to look for a good compression block if a partial
|
|
495
|
-
recovery of the data is
|
|
516
|
+
recovery of the data is to be attempted.
|
|
496
517
|
*/
|
|
497
518
|
|
|
498
519
|
|
|
@@ -502,9 +523,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
|
|
|
502
523
|
This function discards any unprocessed input and does not flush any pending
|
|
503
524
|
output.
|
|
504
525
|
|
|
505
|
-
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
|
|
506
|
-
was inconsistent.
|
|
507
|
-
static string (which must not be deallocated).
|
|
526
|
+
inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state
|
|
527
|
+
was inconsistent.
|
|
508
528
|
*/
|
|
509
529
|
|
|
510
530
|
|
|
@@ -523,8 +543,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
|
|
523
543
|
int strategy));
|
|
524
544
|
|
|
525
545
|
This is another version of deflateInit with more compression options. The
|
|
526
|
-
fields
|
|
527
|
-
caller.
|
|
546
|
+
fields zalloc, zfree and opaque must be initialized before by the caller.
|
|
528
547
|
|
|
529
548
|
The method parameter is the compression method. It must be Z_DEFLATED in
|
|
530
549
|
this version of the library.
|
|
@@ -535,16 +554,29 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
|
|
535
554
|
compression at the expense of memory usage. The default value is 15 if
|
|
536
555
|
deflateInit is used instead.
|
|
537
556
|
|
|
557
|
+
For the current implementation of deflate(), a windowBits value of 8 (a
|
|
558
|
+
window size of 256 bytes) is not supported. As a result, a request for 8
|
|
559
|
+
will result in 9 (a 512-byte window). In that case, providing 8 to
|
|
560
|
+
inflateInit2() will result in an error when the zlib header with 9 is
|
|
561
|
+
checked against the initialization of inflate(). The remedy is to not use 8
|
|
562
|
+
with deflateInit2() with this initialization, or at least in that case use 9
|
|
563
|
+
with inflateInit2().
|
|
564
|
+
|
|
538
565
|
windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
|
|
539
566
|
determines the window size. deflate() will then generate raw deflate data
|
|
540
|
-
with no zlib header or trailer, and will not compute
|
|
567
|
+
with no zlib header or trailer, and will not compute a check value.
|
|
541
568
|
|
|
542
569
|
windowBits can also be greater than 15 for optional gzip encoding. Add
|
|
543
570
|
16 to windowBits to write a simple gzip header and trailer around the
|
|
544
571
|
compressed data instead of a zlib wrapper. The gzip header will have no
|
|
545
572
|
file name, no extra data, no comment, no modification time (set to zero), no
|
|
546
|
-
header crc, and the operating system will be set to
|
|
547
|
-
|
|
573
|
+
header crc, and the operating system will be set to the appropriate value,
|
|
574
|
+
if the operating system was determined at compile time. If a gzip stream is
|
|
575
|
+
being written, strm->adler is a CRC-32 instead of an Adler-32.
|
|
576
|
+
|
|
577
|
+
For raw deflate or gzip encoding, a request for a 256-byte window is
|
|
578
|
+
rejected as invalid, since only the zlib header provides a means of
|
|
579
|
+
transmitting the window size to the decompressor.
|
|
548
580
|
|
|
549
581
|
The memLevel parameter specifies how much memory should be allocated
|
|
550
582
|
for the internal compression state. memLevel=1 uses minimum memory but is
|
|
@@ -580,10 +612,15 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
|
|
|
580
612
|
uInt dictLength));
|
|
581
613
|
/*
|
|
582
614
|
Initializes the compression dictionary from the given byte sequence
|
|
583
|
-
without producing any compressed output.
|
|
584
|
-
immediately after deflateInit, deflateInit2 or
|
|
585
|
-
of deflate.
|
|
586
|
-
|
|
615
|
+
without producing any compressed output. When using the zlib format, this
|
|
616
|
+
function must be called immediately after deflateInit, deflateInit2 or
|
|
617
|
+
deflateReset, and before any call of deflate. When doing raw deflate, this
|
|
618
|
+
function must be called either before any call of deflate, or immediately
|
|
619
|
+
after the completion of a deflate block, i.e. after all input has been
|
|
620
|
+
consumed and all output has been delivered when using any of the flush
|
|
621
|
+
options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The
|
|
622
|
+
compressor and decompressor must use exactly the same dictionary (see
|
|
623
|
+
inflateSetDictionary).
|
|
587
624
|
|
|
588
625
|
The dictionary should consist of strings (byte sequences) that are likely
|
|
589
626
|
to be encountered later in the data to be compressed, with the most commonly
|
|
@@ -600,18 +637,40 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
|
|
|
600
637
|
addition, the current implementation of deflate will use at most the window
|
|
601
638
|
size minus 262 bytes of the provided dictionary.
|
|
602
639
|
|
|
603
|
-
Upon return of this function, strm->adler is set to the
|
|
640
|
+
Upon return of this function, strm->adler is set to the Adler-32 value
|
|
604
641
|
of the dictionary; the decompressor may later use this value to determine
|
|
605
|
-
which dictionary has been used by the compressor. (The
|
|
642
|
+
which dictionary has been used by the compressor. (The Adler-32 value
|
|
606
643
|
applies to the whole dictionary even if only a subset of the dictionary is
|
|
607
644
|
actually used by the compressor.) If a raw deflate was requested, then the
|
|
608
|
-
|
|
645
|
+
Adler-32 value is not computed and strm->adler is not set.
|
|
609
646
|
|
|
610
647
|
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
|
|
611
648
|
parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
|
|
612
649
|
inconsistent (for example if deflate has already been called for this stream
|
|
613
|
-
or if
|
|
614
|
-
perform any compression: this will be done by deflate().
|
|
650
|
+
or if not at a block boundary for raw deflate). deflateSetDictionary does
|
|
651
|
+
not perform any compression: this will be done by deflate().
|
|
652
|
+
*/
|
|
653
|
+
|
|
654
|
+
ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
|
|
655
|
+
Bytef *dictionary,
|
|
656
|
+
uInt *dictLength));
|
|
657
|
+
/*
|
|
658
|
+
Returns the sliding dictionary being maintained by deflate. dictLength is
|
|
659
|
+
set to the number of bytes in the dictionary, and that many bytes are copied
|
|
660
|
+
to dictionary. dictionary must have enough space, where 32768 bytes is
|
|
661
|
+
always enough. If deflateGetDictionary() is called with dictionary equal to
|
|
662
|
+
Z_NULL, then only the dictionary length is returned, and nothing is copied.
|
|
663
|
+
Similarly, if dictLength is Z_NULL, then it is not set.
|
|
664
|
+
|
|
665
|
+
deflateGetDictionary() may return a length less than the window size, even
|
|
666
|
+
when more than the window size in input has been provided. It may return up
|
|
667
|
+
to 258 bytes less in that case, due to how zlib's implementation of deflate
|
|
668
|
+
manages the sliding window and lookahead for matches, where matches can be
|
|
669
|
+
up to 258 bytes long. If the application needs the last window-size bytes of
|
|
670
|
+
input, then that would need to be saved by the application outside of zlib.
|
|
671
|
+
|
|
672
|
+
deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
|
|
673
|
+
stream state is inconsistent.
|
|
615
674
|
*/
|
|
616
675
|
|
|
617
676
|
ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
|
|
@@ -634,10 +693,10 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
|
|
|
634
693
|
|
|
635
694
|
ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
|
|
636
695
|
/*
|
|
637
|
-
This function is equivalent to deflateEnd followed by deflateInit,
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
696
|
+
This function is equivalent to deflateEnd followed by deflateInit, but
|
|
697
|
+
does not free and reallocate the internal compression state. The stream
|
|
698
|
+
will leave the compression level and any other attributes that may have been
|
|
699
|
+
set unchanged.
|
|
641
700
|
|
|
642
701
|
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
|
|
643
702
|
stream state was inconsistent (such as zalloc or state being Z_NULL).
|
|
@@ -648,20 +707,37 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
|
|
|
648
707
|
int strategy));
|
|
649
708
|
/*
|
|
650
709
|
Dynamically update the compression level and compression strategy. The
|
|
651
|
-
interpretation of level and strategy is as in deflateInit2. This can be
|
|
710
|
+
interpretation of level and strategy is as in deflateInit2(). This can be
|
|
652
711
|
used to switch between compression and straight copy of the input data, or
|
|
653
712
|
to switch to a different kind of input data requiring a different strategy.
|
|
654
|
-
If the compression
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
713
|
+
If the compression approach (which is a function of the level) or the
|
|
714
|
+
strategy is changed, and if there have been any deflate() calls since the
|
|
715
|
+
state was initialized or reset, then the input available so far is
|
|
716
|
+
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
|
|
717
|
+
There are three approaches for the compression levels 0, 1..3, and 4..9
|
|
718
|
+
respectively. The new level and strategy will take effect at the next call
|
|
719
|
+
of deflate().
|
|
720
|
+
|
|
721
|
+
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
|
722
|
+
not have enough output space to complete, then the parameter change will not
|
|
723
|
+
take effect. In this case, deflateParams() can be called again with the
|
|
724
|
+
same parameters and more output space to try again.
|
|
725
|
+
|
|
726
|
+
In order to assure a change in the parameters on the first try, the
|
|
727
|
+
deflate stream should be flushed using deflate() with Z_BLOCK or other flush
|
|
728
|
+
request until strm.avail_out is not zero, before calling deflateParams().
|
|
729
|
+
Then no more input data should be provided before the deflateParams() call.
|
|
730
|
+
If this is done, the old level and strategy will be applied to the data
|
|
731
|
+
compressed before deflateParams(), and the new level and strategy will be
|
|
732
|
+
applied to the the data compressed after deflateParams().
|
|
733
|
+
|
|
734
|
+
deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream
|
|
735
|
+
state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if
|
|
736
|
+
there was not enough output space to complete the compression of the
|
|
737
|
+
available input data before a change in the strategy or approach. Note that
|
|
738
|
+
in the case of a Z_BUF_ERROR, the parameters are not changed. A return
|
|
739
|
+
value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be
|
|
740
|
+
retried with more output space.
|
|
665
741
|
*/
|
|
666
742
|
|
|
667
743
|
ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
|
|
@@ -688,8 +764,28 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
|
|
|
688
764
|
deflation of sourceLen bytes. It must be called after deflateInit() or
|
|
689
765
|
deflateInit2(), and after deflateSetHeader(), if used. This would be used
|
|
690
766
|
to allocate an output buffer for deflation in a single pass, and so would be
|
|
691
|
-
called before deflate().
|
|
692
|
-
|
|
767
|
+
called before deflate(). If that first deflate() call is provided the
|
|
768
|
+
sourceLen input bytes, an output buffer allocated to the size returned by
|
|
769
|
+
deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
|
|
770
|
+
to return Z_STREAM_END. Note that it is possible for the compressed size to
|
|
771
|
+
be larger than the value returned by deflateBound() if flush options other
|
|
772
|
+
than Z_FINISH or Z_NO_FLUSH are used.
|
|
773
|
+
*/
|
|
774
|
+
|
|
775
|
+
ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
|
|
776
|
+
unsigned *pending,
|
|
777
|
+
int *bits));
|
|
778
|
+
/*
|
|
779
|
+
deflatePending() returns the number of bytes and bits of output that have
|
|
780
|
+
been generated, but not yet provided in the available output. The bytes not
|
|
781
|
+
provided would be due to the available output space having being consumed.
|
|
782
|
+
The number of bits of output not provided are between 0 and 7, where they
|
|
783
|
+
await more bits to join them in order to fill out a full byte. If pending
|
|
784
|
+
or bits are Z_NULL, then those values are not set.
|
|
785
|
+
|
|
786
|
+
deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
|
|
787
|
+
stream state was inconsistent.
|
|
788
|
+
*/
|
|
693
789
|
|
|
694
790
|
ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
|
|
695
791
|
int bits,
|
|
@@ -703,8 +799,9 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
|
|
|
703
799
|
than or equal to 16, and that many of the least significant bits of value
|
|
704
800
|
will be inserted in the output.
|
|
705
801
|
|
|
706
|
-
deflatePrime returns Z_OK if success,
|
|
707
|
-
|
|
802
|
+
deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
|
|
803
|
+
room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
|
|
804
|
+
source stream state was inconsistent.
|
|
708
805
|
*/
|
|
709
806
|
|
|
710
807
|
ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
|
|
@@ -758,7 +855,7 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
|
|
758
855
|
is for use with other formats that use the deflate compressed data format
|
|
759
856
|
such as zip. Those formats provide their own check values. If a custom
|
|
760
857
|
format is developed using the raw deflate format for compressed data, it is
|
|
761
|
-
recommended that a check value such as an
|
|
858
|
+
recommended that a check value such as an Adler-32 or a CRC-32 be applied to
|
|
762
859
|
the uncompressed data as is done in the zlib, gzip, and zip formats. For
|
|
763
860
|
most applications, the zlib format should be used as is. Note that comments
|
|
764
861
|
above on the use in deflateInit2() applies to the magnitude of windowBits.
|
|
@@ -767,7 +864,12 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
|
|
767
864
|
32 to windowBits to enable zlib and gzip decoding with automatic header
|
|
768
865
|
detection, or add 16 to decode only the gzip format (the zlib format will
|
|
769
866
|
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
|
770
|
-
|
|
867
|
+
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
|
868
|
+
below), inflate() will *not* automatically decode concatenated gzip members.
|
|
869
|
+
inflate() will return Z_STREAM_END at the end of the gzip member. The state
|
|
870
|
+
would need to be reset to continue decoding a subsequent gzip member. This
|
|
871
|
+
*must* be done if there is more data after a gzip member, in order for the
|
|
872
|
+
decompression to be compliant with the gzip standard (RFC 1952).
|
|
771
873
|
|
|
772
874
|
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
|
773
875
|
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
|
@@ -788,34 +890,54 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
|
|
|
788
890
|
Initializes the decompression dictionary from the given uncompressed byte
|
|
789
891
|
sequence. This function must be called immediately after a call of inflate,
|
|
790
892
|
if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
|
|
791
|
-
can be determined from the
|
|
893
|
+
can be determined from the Adler-32 value returned by that call of inflate.
|
|
792
894
|
The compressor and decompressor must use exactly the same dictionary (see
|
|
793
|
-
deflateSetDictionary). For raw inflate, this function can be called
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
895
|
+
deflateSetDictionary). For raw inflate, this function can be called at any
|
|
896
|
+
time to set the dictionary. If the provided dictionary is smaller than the
|
|
897
|
+
window and there is already data in the window, then the provided dictionary
|
|
898
|
+
will amend what's there. The application must insure that the dictionary
|
|
899
|
+
that was used for compression is provided.
|
|
797
900
|
|
|
798
901
|
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
|
|
799
902
|
parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
|
|
800
903
|
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
|
|
801
|
-
expected one (incorrect
|
|
904
|
+
expected one (incorrect Adler-32 value). inflateSetDictionary does not
|
|
802
905
|
perform any decompression: this will be done by subsequent calls of
|
|
803
906
|
inflate().
|
|
804
907
|
*/
|
|
805
908
|
|
|
909
|
+
ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
|
|
910
|
+
Bytef *dictionary,
|
|
911
|
+
uInt *dictLength));
|
|
912
|
+
/*
|
|
913
|
+
Returns the sliding dictionary being maintained by inflate. dictLength is
|
|
914
|
+
set to the number of bytes in the dictionary, and that many bytes are copied
|
|
915
|
+
to dictionary. dictionary must have enough space, where 32768 bytes is
|
|
916
|
+
always enough. If inflateGetDictionary() is called with dictionary equal to
|
|
917
|
+
Z_NULL, then only the dictionary length is returned, and nothing is copied.
|
|
918
|
+
Similarly, if dictLength is Z_NULL, then it is not set.
|
|
919
|
+
|
|
920
|
+
inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
|
|
921
|
+
stream state is inconsistent.
|
|
922
|
+
*/
|
|
923
|
+
|
|
806
924
|
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
|
|
807
925
|
/*
|
|
808
|
-
Skips invalid compressed data until a full flush point (see above
|
|
809
|
-
description of deflate with Z_FULL_FLUSH) can be found, or until all
|
|
926
|
+
Skips invalid compressed data until a possible full flush point (see above
|
|
927
|
+
for the description of deflate with Z_FULL_FLUSH) can be found, or until all
|
|
810
928
|
available input is skipped. No output is provided.
|
|
811
929
|
|
|
812
|
-
inflateSync
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
930
|
+
inflateSync searches for a 00 00 FF FF pattern in the compressed data.
|
|
931
|
+
All full flush points have this pattern, but not all occurrences of this
|
|
932
|
+
pattern are full flush points.
|
|
933
|
+
|
|
934
|
+
inflateSync returns Z_OK if a possible full flush point has been found,
|
|
935
|
+
Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
|
|
936
|
+
has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
|
|
937
|
+
In the success case, the application may save the current current value of
|
|
938
|
+
total_in which indicates where valid compressed data was found. In the
|
|
939
|
+
error case, the application may repeatedly call inflateSync, providing more
|
|
940
|
+
input each time, until success or end of the input data.
|
|
819
941
|
*/
|
|
820
942
|
|
|
821
943
|
ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
|
|
@@ -837,7 +959,7 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
|
|
|
837
959
|
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
|
|
838
960
|
/*
|
|
839
961
|
This function is equivalent to inflateEnd followed by inflateInit,
|
|
840
|
-
but does not free and reallocate
|
|
962
|
+
but does not free and reallocate the internal decompression state. The
|
|
841
963
|
stream will keep attributes that may have been set by inflateInit2.
|
|
842
964
|
|
|
843
965
|
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
|
|
@@ -849,7 +971,9 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
|
|
|
849
971
|
/*
|
|
850
972
|
This function is the same as inflateReset, but it also permits changing
|
|
851
973
|
the wrap and window size requests. The windowBits parameter is interpreted
|
|
852
|
-
the same as it is for inflateInit2.
|
|
974
|
+
the same as it is for inflateInit2. If the window size is changed, then the
|
|
975
|
+
memory allocated for the window is freed, and the window will be reallocated
|
|
976
|
+
by inflate() if needed.
|
|
853
977
|
|
|
854
978
|
inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
|
|
855
979
|
stream state was inconsistent (such as zalloc or state being Z_NULL), or if
|
|
@@ -901,7 +1025,7 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
|
|
|
901
1025
|
location in the input stream can be determined from avail_in and data_type
|
|
902
1026
|
as noted in the description for the Z_BLOCK flush parameter for inflate.
|
|
903
1027
|
|
|
904
|
-
inflateMark returns the value noted above or -
|
|
1028
|
+
inflateMark returns the value noted above, or -65536 if the provided
|
|
905
1029
|
source stream state was inconsistent.
|
|
906
1030
|
*/
|
|
907
1031
|
|
|
@@ -962,12 +1086,13 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
|
|
|
962
1086
|
See inflateBack() for the usage of these routines.
|
|
963
1087
|
|
|
964
1088
|
inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
|
|
965
|
-
the
|
|
1089
|
+
the parameters are invalid, Z_MEM_ERROR if the internal state could not be
|
|
966
1090
|
allocated, or Z_VERSION_ERROR if the version of the library does not match
|
|
967
1091
|
the version of the header file.
|
|
968
1092
|
*/
|
|
969
1093
|
|
|
970
|
-
typedef unsigned (*in_func) OF((void FAR *,
|
|
1094
|
+
typedef unsigned (*in_func) OF((void FAR *,
|
|
1095
|
+
z_const unsigned char FAR * FAR *));
|
|
971
1096
|
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
|
|
972
1097
|
|
|
973
1098
|
ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
|
|
@@ -975,11 +1100,12 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
|
|
|
975
1100
|
out_func out, void FAR *out_desc));
|
|
976
1101
|
/*
|
|
977
1102
|
inflateBack() does a raw inflate with a single call using a call-back
|
|
978
|
-
interface for input and output. This is more efficient than
|
|
979
|
-
file i/o applications in that it avoids copying between the
|
|
980
|
-
sliding window by simply making the window itself the output
|
|
981
|
-
|
|
982
|
-
the
|
|
1103
|
+
interface for input and output. This is potentially more efficient than
|
|
1104
|
+
inflate() for file i/o applications, in that it avoids copying between the
|
|
1105
|
+
output and the sliding window by simply making the window itself the output
|
|
1106
|
+
buffer. inflate() can be faster on modern CPUs when used with large
|
|
1107
|
+
buffers. inflateBack() trusts the application to not change the output
|
|
1108
|
+
buffer passed by the output function, at least until inflateBack() returns.
|
|
983
1109
|
|
|
984
1110
|
inflateBackInit() must be called first to allocate the internal state
|
|
985
1111
|
and to initialize the state with the user-provided window buffer.
|
|
@@ -991,9 +1117,9 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
|
|
|
991
1117
|
This routine would normally be used in a utility that reads zip or gzip
|
|
992
1118
|
files and writes out uncompressed files. The utility would decode the
|
|
993
1119
|
header and process the trailer on its own, hence this routine expects only
|
|
994
|
-
the raw deflate stream to decompress. This is different from the
|
|
995
|
-
behavior of inflate(), which expects
|
|
996
|
-
|
|
1120
|
+
the raw deflate stream to decompress. This is different from the default
|
|
1121
|
+
behavior of inflate(), which expects a zlib header and trailer around the
|
|
1122
|
+
deflate stream.
|
|
997
1123
|
|
|
998
1124
|
inflateBack() uses two subroutines supplied by the caller that are then
|
|
999
1125
|
called by inflateBack() for input and output. inflateBack() calls those
|
|
@@ -1002,12 +1128,12 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
|
|
|
1002
1128
|
parameters and return types are defined above in the in_func and out_func
|
|
1003
1129
|
typedefs. inflateBack() will call in(in_desc, &buf) which should return the
|
|
1004
1130
|
number of bytes of provided input, and a pointer to that input in buf. If
|
|
1005
|
-
there is no input available, in() must return zero--buf is ignored in that
|
|
1006
|
-
case--and inflateBack() will return a buffer error. inflateBack() will
|
|
1007
|
-
out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].
|
|
1008
|
-
should return zero on success, or non-zero on failure. If out()
|
|
1009
|
-
non-zero, inflateBack() will return with an error. Neither in() nor
|
|
1010
|
-
are permitted to change the contents of the window provided to
|
|
1131
|
+
there is no input available, in() must return zero -- buf is ignored in that
|
|
1132
|
+
case -- and inflateBack() will return a buffer error. inflateBack() will
|
|
1133
|
+
call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].
|
|
1134
|
+
out() should return zero on success, or non-zero on failure. If out()
|
|
1135
|
+
returns non-zero, inflateBack() will return with an error. Neither in() nor
|
|
1136
|
+
out() are permitted to change the contents of the window provided to
|
|
1011
1137
|
inflateBackInit(), which is also the buffer that out() uses to write from.
|
|
1012
1138
|
The length written by out() will be at most the window size. Any non-zero
|
|
1013
1139
|
amount of input may be provided by in().
|
|
@@ -1035,7 +1161,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
|
|
|
1035
1161
|
using strm->next_in which will be Z_NULL only if in() returned an error. If
|
|
1036
1162
|
strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
|
|
1037
1163
|
non-zero. (in() will always be called before out(), so strm->next_in is
|
|
1038
|
-
assured to be defined if out() returns non-zero.)
|
|
1164
|
+
assured to be defined if out() returns non-zero.) Note that inflateBack()
|
|
1039
1165
|
cannot return Z_OK.
|
|
1040
1166
|
*/
|
|
1041
1167
|
|
|
@@ -1057,7 +1183,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
|
|
|
1057
1183
|
7.6: size of z_off_t
|
|
1058
1184
|
|
|
1059
1185
|
Compiler, assembler, and debug options:
|
|
1060
|
-
8:
|
|
1186
|
+
8: ZLIB_DEBUG
|
|
1061
1187
|
9: ASMV or ASMINF -- use ASM code
|
|
1062
1188
|
10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
|
|
1063
1189
|
11: 0 (reserved)
|
|
@@ -1088,6 +1214,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
|
|
|
1088
1214
|
27-31: 0 (reserved)
|
|
1089
1215
|
*/
|
|
1090
1216
|
|
|
1217
|
+
#ifndef Z_SOLO
|
|
1091
1218
|
|
|
1092
1219
|
/* utility functions */
|
|
1093
1220
|
|
|
@@ -1106,7 +1233,8 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
|
|
|
1106
1233
|
the byte length of the source buffer. Upon entry, destLen is the total size
|
|
1107
1234
|
of the destination buffer, which must be at least the value returned by
|
|
1108
1235
|
compressBound(sourceLen). Upon exit, destLen is the actual size of the
|
|
1109
|
-
compressed
|
|
1236
|
+
compressed data. compress() is equivalent to compress2() with a level
|
|
1237
|
+
parameter of Z_DEFAULT_COMPRESSION.
|
|
1110
1238
|
|
|
1111
1239
|
compress returns Z_OK if success, Z_MEM_ERROR if there was not
|
|
1112
1240
|
enough memory, Z_BUF_ERROR if there was not enough room in the output
|
|
@@ -1122,7 +1250,7 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
|
|
|
1122
1250
|
length of the source buffer. Upon entry, destLen is the total size of the
|
|
1123
1251
|
destination buffer, which must be at least the value returned by
|
|
1124
1252
|
compressBound(sourceLen). Upon exit, destLen is the actual size of the
|
|
1125
|
-
compressed
|
|
1253
|
+
compressed data.
|
|
1126
1254
|
|
|
1127
1255
|
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
|
1128
1256
|
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
|
|
@@ -1145,13 +1273,22 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
|
|
|
1145
1273
|
uncompressed data. (The size of the uncompressed data must have been saved
|
|
1146
1274
|
previously by the compressor and transmitted to the decompressor by some
|
|
1147
1275
|
mechanism outside the scope of this compression library.) Upon exit, destLen
|
|
1148
|
-
is the actual size of the uncompressed
|
|
1276
|
+
is the actual size of the uncompressed data.
|
|
1149
1277
|
|
|
1150
1278
|
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
|
|
1151
1279
|
enough memory, Z_BUF_ERROR if there was not enough room in the output
|
|
1152
|
-
buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
|
|
1280
|
+
buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In
|
|
1281
|
+
the case where there is not enough room, uncompress() will fill the output
|
|
1282
|
+
buffer with the uncompressed data up to that point.
|
|
1153
1283
|
*/
|
|
1154
1284
|
|
|
1285
|
+
ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen,
|
|
1286
|
+
const Bytef *source, uLong *sourceLen));
|
|
1287
|
+
/*
|
|
1288
|
+
Same as uncompress, except that sourceLen is a pointer, where the
|
|
1289
|
+
length of the source is *sourceLen. On return, *sourceLen is the number of
|
|
1290
|
+
source bytes consumed.
|
|
1291
|
+
*/
|
|
1155
1292
|
|
|
1156
1293
|
/* gzip file access functions */
|
|
1157
1294
|
|
|
@@ -1162,23 +1299,38 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
|
|
|
1162
1299
|
wrapper, documented in RFC 1952, wrapped around a deflate stream.
|
|
1163
1300
|
*/
|
|
1164
1301
|
|
|
1165
|
-
typedef
|
|
1302
|
+
typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
|
|
1166
1303
|
|
|
1167
1304
|
/*
|
|
1168
1305
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
|
1169
1306
|
|
|
1170
|
-
|
|
1171
|
-
in fopen ("rb" or "wb")
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
for
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1307
|
+
Open the gzip (.gz) file at path for reading and decompressing, or
|
|
1308
|
+
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
|
|
1309
|
+
but can also include a compression level ("wb9") or a strategy: 'f' for
|
|
1310
|
+
filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
|
|
1311
|
+
'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
|
|
1312
|
+
as in "wb9F". (See the description of deflateInit2 for more information
|
|
1313
|
+
about the strategy parameter.) 'T' will request transparent writing or
|
|
1314
|
+
appending with no compression and not using the gzip format.
|
|
1315
|
+
|
|
1316
|
+
"a" can be used instead of "w" to request that the gzip stream that will
|
|
1317
|
+
be written be appended to the file. "+" will result in an error, since
|
|
1318
|
+
reading and writing to the same gzip file is not supported. The addition of
|
|
1319
|
+
"x" when writing will create the file exclusively, which fails if the file
|
|
1320
|
+
already exists. On systems that support it, the addition of "e" when
|
|
1321
|
+
reading or writing will set the flag to close the file on an execve() call.
|
|
1322
|
+
|
|
1323
|
+
These functions, as well as gzip, will read and decode a sequence of gzip
|
|
1324
|
+
streams in a file. The append function of gzopen() can be used to create
|
|
1325
|
+
such a file. (Also see gzflush() for another way to do this.) When
|
|
1326
|
+
appending, gzopen does not test whether the file begins with a gzip stream,
|
|
1327
|
+
nor does it look for the end of the gzip streams to begin appending. gzopen
|
|
1328
|
+
will simply append a gzip stream to the existing file.
|
|
1179
1329
|
|
|
1180
1330
|
gzopen can be used to read a file which is not in gzip format; in this
|
|
1181
|
-
case gzread will directly read from the file without decompression.
|
|
1331
|
+
case gzread will directly read from the file without decompression. When
|
|
1332
|
+
reading, this will be detected automatically by looking for the magic two-
|
|
1333
|
+
byte gzip header.
|
|
1182
1334
|
|
|
1183
1335
|
gzopen returns NULL if the file could not be opened, if there was
|
|
1184
1336
|
insufficient memory to allocate the gzFile state, or if an invalid mode was
|
|
@@ -1189,15 +1341,19 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
|
|
1189
1341
|
|
|
1190
1342
|
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
|
1191
1343
|
/*
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1344
|
+
Associate a gzFile with the file descriptor fd. File descriptors are
|
|
1345
|
+
obtained from calls like open, dup, creat, pipe or fileno (if the file has
|
|
1346
|
+
been previously opened with fopen). The mode parameter is as in gzopen.
|
|
1195
1347
|
|
|
1196
1348
|
The next call of gzclose on the returned gzFile will also close the file
|
|
1197
1349
|
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
|
1198
1350
|
fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
|
|
1199
1351
|
mode);. The duplicated descriptor should be saved to avoid a leak, since
|
|
1200
|
-
gzdopen does not close fd if it fails.
|
|
1352
|
+
gzdopen does not close fd if it fails. If you are using fileno() to get the
|
|
1353
|
+
file descriptor from a FILE *, then you will have to use dup() to avoid
|
|
1354
|
+
double-close()ing the file descriptor. Both gzclose() and fclose() will
|
|
1355
|
+
close the associated file descriptor, so they need to have different file
|
|
1356
|
+
descriptors.
|
|
1201
1357
|
|
|
1202
1358
|
gzdopen returns NULL if there was insufficient memory to allocate the
|
|
1203
1359
|
gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
|
|
@@ -1208,14 +1364,13 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
|
|
1208
1364
|
|
|
1209
1365
|
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
|
1210
1366
|
/*
|
|
1211
|
-
Set the internal buffer size used by this library's functions
|
|
1212
|
-
default buffer size is 8192 bytes. This function must be called
|
|
1213
|
-
gzopen() or gzdopen(), and before any other calls that read or write
|
|
1214
|
-
file. The buffer memory allocation is always deferred to the first read
|
|
1215
|
-
write.
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
noticeably increase the speed of decompression (reading).
|
|
1367
|
+
Set the internal buffer size used by this library's functions for file to
|
|
1368
|
+
size. The default buffer size is 8192 bytes. This function must be called
|
|
1369
|
+
after gzopen() or gzdopen(), and before any other calls that read or write
|
|
1370
|
+
the file. The buffer memory allocation is always deferred to the first read
|
|
1371
|
+
or write. Three times that size in buffer space is allocated. A larger
|
|
1372
|
+
buffer size of, for example, 64K or 128K bytes will noticeably increase the
|
|
1373
|
+
speed of decompression (reading).
|
|
1219
1374
|
|
|
1220
1375
|
The new buffer size also affects the maximum length for gzprintf().
|
|
1221
1376
|
|
|
@@ -1225,55 +1380,109 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
|
|
1225
1380
|
|
|
1226
1381
|
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
|
1227
1382
|
/*
|
|
1228
|
-
Dynamically update the compression level
|
|
1229
|
-
of deflateInit2 for the meaning of these parameters.
|
|
1383
|
+
Dynamically update the compression level and strategy for file. See the
|
|
1384
|
+
description of deflateInit2 for the meaning of these parameters. Previously
|
|
1385
|
+
provided data is flushed before applying the parameter changes.
|
|
1230
1386
|
|
|
1231
|
-
gzsetparams returns Z_OK if success,
|
|
1232
|
-
opened for writing
|
|
1387
|
+
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
|
1388
|
+
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
|
1389
|
+
or Z_MEM_ERROR if there is a memory allocation error.
|
|
1233
1390
|
*/
|
|
1234
1391
|
|
|
1235
1392
|
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
|
1236
1393
|
/*
|
|
1237
|
-
|
|
1238
|
-
the input file
|
|
1239
|
-
bytes into the buffer.
|
|
1394
|
+
Read and decompress up to len uncompressed bytes from file into buf. If
|
|
1395
|
+
the input file is not in gzip format, gzread copies the given number of
|
|
1396
|
+
bytes into the buffer directly from the file.
|
|
1240
1397
|
|
|
1241
1398
|
After reaching the end of a gzip stream in the input, gzread will continue
|
|
1242
|
-
to read, looking for another gzip stream
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1399
|
+
to read, looking for another gzip stream. Any number of gzip streams may be
|
|
1400
|
+
concatenated in the input file, and will all be decompressed by gzread().
|
|
1401
|
+
If something other than a gzip stream is encountered after a gzip stream,
|
|
1402
|
+
that remaining trailing garbage is ignored (and no error is returned).
|
|
1403
|
+
|
|
1404
|
+
gzread can be used to read a gzip file that is being concurrently written.
|
|
1405
|
+
Upon reaching the end of the input, gzread will return with the available
|
|
1406
|
+
data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
|
|
1407
|
+
gzclearerr can be used to clear the end of file indicator in order to permit
|
|
1408
|
+
gzread to be tried again. Z_OK indicates that a gzip stream was completed
|
|
1409
|
+
on the last gzread. Z_BUF_ERROR indicates that the input file ended in the
|
|
1410
|
+
middle of a gzip stream. Note that gzread does not return -1 in the event
|
|
1411
|
+
of an incomplete gzip stream. This error is deferred until gzclose(), which
|
|
1412
|
+
will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
|
|
1413
|
+
stream. Alternatively, gzerror can be used before gzclose to detect this
|
|
1414
|
+
case.
|
|
1246
1415
|
|
|
1247
1416
|
gzread returns the number of uncompressed bytes actually read, less than
|
|
1248
|
-
len for end of file, or -1 for error.
|
|
1417
|
+
len for end of file, or -1 for error. If len is too large to fit in an int,
|
|
1418
|
+
then nothing is read, -1 is returned, and the error state is set to
|
|
1419
|
+
Z_STREAM_ERROR.
|
|
1420
|
+
*/
|
|
1421
|
+
|
|
1422
|
+
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
|
1423
|
+
gzFile file));
|
|
1424
|
+
/*
|
|
1425
|
+
Read and decompress up to nitems items of size size from file into buf,
|
|
1426
|
+
otherwise operating as gzread() does. This duplicates the interface of
|
|
1427
|
+
stdio's fread(), with size_t request and return types. If the library
|
|
1428
|
+
defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
|
|
1429
|
+
is an unsigned integer type that can contain a pointer.
|
|
1430
|
+
|
|
1431
|
+
gzfread() returns the number of full items read of size size, or zero if
|
|
1432
|
+
the end of the file was reached and a full item could not be read, or if
|
|
1433
|
+
there was an error. gzerror() must be consulted if zero is returned in
|
|
1434
|
+
order to determine if there was an error. If the multiplication of size and
|
|
1435
|
+
nitems overflows, i.e. the product does not fit in a z_size_t, then nothing
|
|
1436
|
+
is read, zero is returned, and the error state is set to Z_STREAM_ERROR.
|
|
1437
|
+
|
|
1438
|
+
In the event that the end of file is reached and only a partial item is
|
|
1439
|
+
available at the end, i.e. the remaining uncompressed data length is not a
|
|
1440
|
+
multiple of size, then the final partial item is nevertheless read into buf
|
|
1441
|
+
and the end-of-file flag is set. The length of the partial item read is not
|
|
1442
|
+
provided, but could be inferred from the result of gztell(). This behavior
|
|
1443
|
+
is the same as the behavior of fread() implementations in common libraries,
|
|
1444
|
+
but it prevents the direct use of gzfread() to read a concurrently written
|
|
1445
|
+
file, resetting and retrying on end-of-file, when size is not 1.
|
|
1249
1446
|
*/
|
|
1250
1447
|
|
|
1251
|
-
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
|
1252
|
-
voidpc buf, unsigned len));
|
|
1448
|
+
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
|
|
1253
1449
|
/*
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
error.
|
|
1450
|
+
Compress and write the len uncompressed bytes at buf to file. gzwrite
|
|
1451
|
+
returns the number of uncompressed bytes written or 0 in case of error.
|
|
1257
1452
|
*/
|
|
1258
1453
|
|
|
1259
|
-
ZEXTERN
|
|
1454
|
+
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
|
1455
|
+
z_size_t nitems, gzFile file));
|
|
1260
1456
|
/*
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1457
|
+
Compress and write nitems items of size size from buf to file, duplicating
|
|
1458
|
+
the interface of stdio's fwrite(), with size_t request and return types. If
|
|
1459
|
+
the library defines size_t, then z_size_t is identical to size_t. If not,
|
|
1460
|
+
then z_size_t is an unsigned integer type that can contain a pointer.
|
|
1461
|
+
|
|
1462
|
+
gzfwrite() returns the number of full items written of size size, or zero
|
|
1463
|
+
if there was an error. If the multiplication of size and nitems overflows,
|
|
1464
|
+
i.e. the product does not fit in a z_size_t, then nothing is written, zero
|
|
1465
|
+
is returned, and the error state is set to Z_STREAM_ERROR.
|
|
1466
|
+
*/
|
|
1467
|
+
|
|
1468
|
+
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
|
1469
|
+
/*
|
|
1470
|
+
Convert, format, compress, and write the arguments (...) to file under
|
|
1471
|
+
control of the string format, as in fprintf. gzprintf returns the number of
|
|
1472
|
+
uncompressed bytes actually written, or a negative zlib error code in case
|
|
1473
|
+
of error. The number of uncompressed bytes written is limited to 8191, or
|
|
1474
|
+
one less than the buffer size given to gzbuffer(). The caller should assure
|
|
1475
|
+
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
|
1476
|
+
return an error (0) with nothing written. In this case, there may also be a
|
|
1477
|
+
buffer overflow with unpredictable consequences, which is possible only if
|
|
1478
|
+
zlib was compiled with the insecure functions sprintf() or vsprintf(),
|
|
1479
|
+
because the secure snprintf() or vsnprintf() functions were not available.
|
|
1480
|
+
This can be determined using zlibCompileFlags().
|
|
1272
1481
|
*/
|
|
1273
1482
|
|
|
1274
1483
|
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
|
1275
1484
|
/*
|
|
1276
|
-
|
|
1485
|
+
Compress and write the given null-terminated string s to file, excluding
|
|
1277
1486
|
the terminating null character.
|
|
1278
1487
|
|
|
1279
1488
|
gzputs returns the number of characters written, or -1 in case of error.
|
|
@@ -1281,11 +1490,12 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
|
|
1281
1490
|
|
|
1282
1491
|
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
|
1283
1492
|
/*
|
|
1284
|
-
|
|
1285
|
-
newline character is read and transferred to buf, or an
|
|
1286
|
-
condition is encountered. If any characters are read or if len
|
|
1287
|
-
string is terminated with a null character. If no characters
|
|
1288
|
-
to an end-of-file or len
|
|
1493
|
+
Read and decompress bytes from file into buf, until len-1 characters are
|
|
1494
|
+
read, or until a newline character is read and transferred to buf, or an
|
|
1495
|
+
end-of-file condition is encountered. If any characters are read or if len
|
|
1496
|
+
is one, the string is terminated with a null character. If no characters
|
|
1497
|
+
are read due to an end-of-file or len is less than one, then the buffer is
|
|
1498
|
+
left untouched.
|
|
1289
1499
|
|
|
1290
1500
|
gzgets returns buf which is a null-terminated string, or it returns NULL
|
|
1291
1501
|
for end-of-file or in case of error. If there was an error, the contents at
|
|
@@ -1294,20 +1504,23 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
|
|
1294
1504
|
|
|
1295
1505
|
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
|
1296
1506
|
/*
|
|
1297
|
-
|
|
1507
|
+
Compress and write c, converted to an unsigned char, into file. gzputc
|
|
1298
1508
|
returns the value that was written, or -1 in case of error.
|
|
1299
1509
|
*/
|
|
1300
1510
|
|
|
1301
1511
|
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
|
1302
1512
|
/*
|
|
1303
|
-
|
|
1304
|
-
in case of end of file or error.
|
|
1513
|
+
Read and decompress one byte from file. gzgetc returns this byte or -1
|
|
1514
|
+
in case of end of file or error. This is implemented as a macro for speed.
|
|
1515
|
+
As such, it does not do all of the checking the other functions do. I.e.
|
|
1516
|
+
it does not check to see if file is NULL, nor whether the structure file
|
|
1517
|
+
points to has been clobbered or not.
|
|
1305
1518
|
*/
|
|
1306
1519
|
|
|
1307
1520
|
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
|
1308
1521
|
/*
|
|
1309
|
-
Push
|
|
1310
|
-
|
|
1522
|
+
Push c back onto the stream for file to be read as the first character on
|
|
1523
|
+
the next read. At least one character of push-back is always allowed.
|
|
1311
1524
|
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
|
1312
1525
|
fail if c is -1, and may fail if a character has been pushed but not read
|
|
1313
1526
|
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
|
@@ -1318,14 +1531,14 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
|
|
1318
1531
|
|
|
1319
1532
|
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
|
1320
1533
|
/*
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1534
|
+
Flush all pending output to file. The parameter flush is as in the
|
|
1535
|
+
deflate() function. The return value is the zlib error number (see function
|
|
1536
|
+
gzerror below). gzflush is only permitted when writing.
|
|
1324
1537
|
|
|
1325
1538
|
If the flush parameter is Z_FINISH, the remaining data is written and the
|
|
1326
1539
|
gzip stream is completed in the output. If gzwrite() is called again, a new
|
|
1327
1540
|
gzip stream will be started in the output. gzread() is able to read such
|
|
1328
|
-
|
|
1541
|
+
concatenated gzip streams.
|
|
1329
1542
|
|
|
1330
1543
|
gzflush should be called only when strictly necessary because it will
|
|
1331
1544
|
degrade compression if called too often.
|
|
@@ -1335,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
|
|
1335
1548
|
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
|
1336
1549
|
z_off_t offset, int whence));
|
|
1337
1550
|
|
|
1338
|
-
|
|
1339
|
-
|
|
1551
|
+
Set the starting position to offset relative to whence for the next gzread
|
|
1552
|
+
or gzwrite on file. The offset represents a number of bytes in the
|
|
1340
1553
|
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
|
1341
1554
|
the value SEEK_END is not supported.
|
|
1342
1555
|
|
|
@@ -1353,18 +1566,18 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
|
|
1353
1566
|
|
|
1354
1567
|
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
|
1355
1568
|
/*
|
|
1356
|
-
|
|
1569
|
+
Rewind file. This function is supported only for reading.
|
|
1357
1570
|
|
|
1358
|
-
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
|
|
1571
|
+
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
|
|
1359
1572
|
*/
|
|
1360
1573
|
|
|
1361
1574
|
/*
|
|
1362
1575
|
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
|
1363
1576
|
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1577
|
+
Return the starting position for the next gzread or gzwrite on file.
|
|
1578
|
+
This position represents a number of bytes in the uncompressed data stream,
|
|
1579
|
+
and is zero when starting, even if appending or reading a gzip stream from
|
|
1580
|
+
the middle of a file using gzdopen().
|
|
1368
1581
|
|
|
1369
1582
|
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
|
1370
1583
|
*/
|
|
@@ -1372,22 +1585,22 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
|
|
1372
1585
|
/*
|
|
1373
1586
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
|
1374
1587
|
|
|
1375
|
-
|
|
1376
|
-
includes the count of bytes that precede the gzip stream, for example
|
|
1377
|
-
appending or when using gzdopen() for reading. When reading, the
|
|
1378
|
-
does not include as yet unused buffered input. This information can
|
|
1379
|
-
for a progress indicator. On error, gzoffset() returns -1.
|
|
1588
|
+
Return the current compressed (actual) read or write offset of file. This
|
|
1589
|
+
offset includes the count of bytes that precede the gzip stream, for example
|
|
1590
|
+
when appending or when using gzdopen() for reading. When reading, the
|
|
1591
|
+
offset does not include as yet unused buffered input. This information can
|
|
1592
|
+
be used for a progress indicator. On error, gzoffset() returns -1.
|
|
1380
1593
|
*/
|
|
1381
1594
|
|
|
1382
1595
|
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
|
1383
1596
|
/*
|
|
1384
|
-
|
|
1385
|
-
false (0) otherwise. Note that the end-of-file indicator is set
|
|
1386
|
-
read tried to go past the end of the input, but came up short.
|
|
1387
|
-
just like feof(), gzeof() may return false even if there is no
|
|
1388
|
-
read, in the event that the last read request was for the exact
|
|
1389
|
-
bytes remaining in the input file. This will happen if the input
|
|
1390
|
-
is an exact multiple of the buffer size.
|
|
1597
|
+
Return true (1) if the end-of-file indicator for file has been set while
|
|
1598
|
+
reading, false (0) otherwise. Note that the end-of-file indicator is set
|
|
1599
|
+
only if the read tried to go past the end of the input, but came up short.
|
|
1600
|
+
Therefore, just like feof(), gzeof() may return false even if there is no
|
|
1601
|
+
more data to read, in the event that the last read request was for the exact
|
|
1602
|
+
number of bytes remaining in the input file. This will happen if the input
|
|
1603
|
+
file size is an exact multiple of the buffer size.
|
|
1391
1604
|
|
|
1392
1605
|
If gzeof() returns true, then the read functions will return no more data,
|
|
1393
1606
|
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
|
@@ -1396,10 +1609,8 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
|
|
1396
1609
|
|
|
1397
1610
|
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
|
1398
1611
|
/*
|
|
1399
|
-
|
|
1400
|
-
(0) if file is a gzip stream being decompressed.
|
|
1401
|
-
false to true while reading the input file if the end of a gzip stream is
|
|
1402
|
-
reached, but is followed by data that is not another gzip stream.
|
|
1612
|
+
Return true (1) if file is being copied directly while reading, or false
|
|
1613
|
+
(0) if file is a gzip stream being decompressed.
|
|
1403
1614
|
|
|
1404
1615
|
If the input file is empty, gzdirect() will return true, since the input
|
|
1405
1616
|
does not contain a gzip stream.
|
|
@@ -1408,18 +1619,26 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
|
|
1408
1619
|
cause buffers to be allocated to allow reading the file to determine if it
|
|
1409
1620
|
is a gzip file. Therefore if gzbuffer() is used, it should be called before
|
|
1410
1621
|
gzdirect().
|
|
1622
|
+
|
|
1623
|
+
When writing, gzdirect() returns true (1) if transparent writing was
|
|
1624
|
+
requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note:
|
|
1625
|
+
gzdirect() is not needed when writing. Transparent writing must be
|
|
1626
|
+
explicitly requested, so the application already knows the answer. When
|
|
1627
|
+
linking statically, using gzdirect() will include all of the zlib code for
|
|
1628
|
+
gzip file reading and decompression, which may not be desired.)
|
|
1411
1629
|
*/
|
|
1412
1630
|
|
|
1413
1631
|
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
|
1414
1632
|
/*
|
|
1415
|
-
|
|
1416
|
-
|
|
1633
|
+
Flush all pending output for file, if necessary, close file and
|
|
1634
|
+
deallocate the (de)compression state. Note that once file is closed, you
|
|
1417
1635
|
cannot call gzerror with file, since its structures have been deallocated.
|
|
1418
1636
|
gzclose must not be called more than once on the same file, just as free
|
|
1419
1637
|
must not be called more than once on the same allocation.
|
|
1420
1638
|
|
|
1421
1639
|
gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
|
|
1422
|
-
file operation error,
|
|
1640
|
+
file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
|
|
1641
|
+
last read ended in the middle of a gzip stream, or Z_OK on success.
|
|
1423
1642
|
*/
|
|
1424
1643
|
|
|
1425
1644
|
ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
|
|
@@ -1436,10 +1655,10 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
|
|
1436
1655
|
|
|
1437
1656
|
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
|
1438
1657
|
/*
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1658
|
+
Return the error message for the last error which occurred on file.
|
|
1659
|
+
errnum is set to zlib error number. If an error occurred in the file system
|
|
1660
|
+
and not in the compression library, errnum is set to Z_ERRNO and the
|
|
1661
|
+
application may consult errno to get the exact error code.
|
|
1443
1662
|
|
|
1444
1663
|
The application must not modify the returned string. Future calls to
|
|
1445
1664
|
this function may invalidate the previously returned string. If file is
|
|
@@ -1452,11 +1671,12 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
|
|
1452
1671
|
|
|
1453
1672
|
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
|
1454
1673
|
/*
|
|
1455
|
-
|
|
1674
|
+
Clear the error and end-of-file flags for file. This is analogous to the
|
|
1456
1675
|
clearerr() function in stdio. This is useful for continuing to read a gzip
|
|
1457
1676
|
file that is being written concurrently.
|
|
1458
1677
|
*/
|
|
1459
1678
|
|
|
1679
|
+
#endif /* !Z_SOLO */
|
|
1460
1680
|
|
|
1461
1681
|
/* checksum functions */
|
|
1462
1682
|
|
|
@@ -1469,10 +1689,11 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
|
|
1469
1689
|
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
|
1470
1690
|
/*
|
|
1471
1691
|
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
|
1472
|
-
return the updated checksum.
|
|
1473
|
-
|
|
1692
|
+
return the updated checksum. An Adler-32 value is in the range of a 32-bit
|
|
1693
|
+
unsigned integer. If buf is Z_NULL, this function returns the required
|
|
1694
|
+
initial value for the checksum.
|
|
1474
1695
|
|
|
1475
|
-
An Adler-32 checksum is almost as reliable as a
|
|
1696
|
+
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
|
1476
1697
|
much faster.
|
|
1477
1698
|
|
|
1478
1699
|
Usage example:
|
|
@@ -1485,6 +1706,12 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
|
|
1485
1706
|
if (adler != original_adler) error();
|
|
1486
1707
|
*/
|
|
1487
1708
|
|
|
1709
|
+
ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf,
|
|
1710
|
+
z_size_t len));
|
|
1711
|
+
/*
|
|
1712
|
+
Same as adler32(), but with a size_t length.
|
|
1713
|
+
*/
|
|
1714
|
+
|
|
1488
1715
|
/*
|
|
1489
1716
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
|
1490
1717
|
z_off_t len2));
|
|
@@ -1492,16 +1719,18 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
|
|
1492
1719
|
Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
|
|
1493
1720
|
and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
|
|
1494
1721
|
each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
|
|
1495
|
-
seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
|
|
1722
|
+
seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note
|
|
1723
|
+
that the z_off_t type (like off_t) is a signed integer. If len2 is
|
|
1724
|
+
negative, the result has no meaning or utility.
|
|
1496
1725
|
*/
|
|
1497
1726
|
|
|
1498
|
-
ZEXTERN uLong ZEXPORT crc32
|
|
1727
|
+
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
|
1499
1728
|
/*
|
|
1500
1729
|
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
|
1501
|
-
updated CRC-32.
|
|
1502
|
-
|
|
1503
|
-
complement) is performed within this
|
|
1504
|
-
application.
|
|
1730
|
+
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
|
|
1731
|
+
If buf is Z_NULL, this function returns the required initial value for the
|
|
1732
|
+
crc. Pre- and post-conditioning (one's complement) is performed within this
|
|
1733
|
+
function so it shouldn't be done by the application.
|
|
1505
1734
|
|
|
1506
1735
|
Usage example:
|
|
1507
1736
|
|
|
@@ -1513,6 +1742,12 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
|
|
1513
1742
|
if (crc != original_crc) error();
|
|
1514
1743
|
*/
|
|
1515
1744
|
|
|
1745
|
+
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
|
1746
|
+
z_size_t len));
|
|
1747
|
+
/*
|
|
1748
|
+
Same as crc32(), but with a size_t length.
|
|
1749
|
+
*/
|
|
1750
|
+
|
|
1516
1751
|
/*
|
|
1517
1752
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
|
1518
1753
|
|
|
@@ -1523,6 +1758,20 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
|
|
1523
1758
|
len2.
|
|
1524
1759
|
*/
|
|
1525
1760
|
|
|
1761
|
+
/*
|
|
1762
|
+
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
|
|
1763
|
+
|
|
1764
|
+
Return the operator corresponding to length len2, to be used with
|
|
1765
|
+
crc32_combine_op().
|
|
1766
|
+
*/
|
|
1767
|
+
|
|
1768
|
+
ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
|
|
1769
|
+
/*
|
|
1770
|
+
Give the same result as crc32_combine(), using op in place of len2. op is
|
|
1771
|
+
is generated from len2 by crc32_combine_gen(). This will be faster than
|
|
1772
|
+
crc32_combine() if the generated op is used more than once.
|
|
1773
|
+
*/
|
|
1774
|
+
|
|
1526
1775
|
|
|
1527
1776
|
/* various hacks, don't look :) */
|
|
1528
1777
|
|
|
@@ -1543,18 +1792,59 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
|
|
|
1543
1792
|
unsigned char FAR *window,
|
|
1544
1793
|
const char *version,
|
|
1545
1794
|
int stream_size));
|
|
1546
|
-
#
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1795
|
+
#ifdef Z_PREFIX_SET
|
|
1796
|
+
# define z_deflateInit(strm, level) \
|
|
1797
|
+
deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
|
|
1798
|
+
# define z_inflateInit(strm) \
|
|
1799
|
+
inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
|
|
1800
|
+
# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
|
|
1801
|
+
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
|
|
1802
|
+
(strategy), ZLIB_VERSION, (int)sizeof(z_stream))
|
|
1803
|
+
# define z_inflateInit2(strm, windowBits) \
|
|
1804
|
+
inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
|
|
1805
|
+
(int)sizeof(z_stream))
|
|
1806
|
+
# define z_inflateBackInit(strm, windowBits, window) \
|
|
1807
|
+
inflateBackInit_((strm), (windowBits), (window), \
|
|
1808
|
+
ZLIB_VERSION, (int)sizeof(z_stream))
|
|
1809
|
+
#else
|
|
1810
|
+
# define deflateInit(strm, level) \
|
|
1811
|
+
deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
|
|
1812
|
+
# define inflateInit(strm) \
|
|
1813
|
+
inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
|
|
1814
|
+
# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
|
|
1815
|
+
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
|
|
1816
|
+
(strategy), ZLIB_VERSION, (int)sizeof(z_stream))
|
|
1817
|
+
# define inflateInit2(strm, windowBits) \
|
|
1818
|
+
inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
|
|
1819
|
+
(int)sizeof(z_stream))
|
|
1820
|
+
# define inflateBackInit(strm, windowBits, window) \
|
|
1821
|
+
inflateBackInit_((strm), (windowBits), (window), \
|
|
1822
|
+
ZLIB_VERSION, (int)sizeof(z_stream))
|
|
1823
|
+
#endif
|
|
1824
|
+
|
|
1825
|
+
#ifndef Z_SOLO
|
|
1826
|
+
|
|
1827
|
+
/* gzgetc() macro and its supporting function and exposed data structure. Note
|
|
1828
|
+
* that the real internal state is much larger than the exposed structure.
|
|
1829
|
+
* This abbreviated structure exposes just enough for the gzgetc() macro. The
|
|
1830
|
+
* user should not mess with these exposed elements, since their names or
|
|
1831
|
+
* behavior could change in the future, perhaps even capriciously. They can
|
|
1832
|
+
* only be used by the gzgetc() macro. You have been warned.
|
|
1833
|
+
*/
|
|
1834
|
+
struct gzFile_s {
|
|
1835
|
+
unsigned have;
|
|
1836
|
+
unsigned char *next;
|
|
1837
|
+
z_off64_t pos;
|
|
1838
|
+
};
|
|
1839
|
+
ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
|
1840
|
+
#ifdef Z_PREFIX_SET
|
|
1841
|
+
# undef z_gzgetc
|
|
1842
|
+
# define z_gzgetc(g) \
|
|
1843
|
+
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
|
|
1844
|
+
#else
|
|
1845
|
+
# define gzgetc(g) \
|
|
1846
|
+
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
|
|
1847
|
+
#endif
|
|
1558
1848
|
|
|
1559
1849
|
/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
|
|
1560
1850
|
* change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
|
|
@@ -1562,29 +1852,42 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
|
|
|
1562
1852
|
* functions are changed to 64 bits) -- in case these are set on systems
|
|
1563
1853
|
* without large file support, _LFS64_LARGEFILE must also be true
|
|
1564
1854
|
*/
|
|
1565
|
-
#
|
|
1855
|
+
#ifdef Z_LARGE64
|
|
1566
1856
|
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
|
1567
1857
|
ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
|
|
1568
1858
|
ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
|
|
1569
1859
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
|
1570
1860
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
|
1571
1861
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
|
1862
|
+
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
|
|
1572
1863
|
#endif
|
|
1573
1864
|
|
|
1574
|
-
#if !defined(ZLIB_INTERNAL) &&
|
|
1575
|
-
#
|
|
1576
|
-
#
|
|
1577
|
-
#
|
|
1578
|
-
#
|
|
1579
|
-
#
|
|
1580
|
-
#
|
|
1581
|
-
#
|
|
1865
|
+
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
|
1866
|
+
# ifdef Z_PREFIX_SET
|
|
1867
|
+
# define z_gzopen z_gzopen64
|
|
1868
|
+
# define z_gzseek z_gzseek64
|
|
1869
|
+
# define z_gztell z_gztell64
|
|
1870
|
+
# define z_gzoffset z_gzoffset64
|
|
1871
|
+
# define z_adler32_combine z_adler32_combine64
|
|
1872
|
+
# define z_crc32_combine z_crc32_combine64
|
|
1873
|
+
# define z_crc32_combine_gen z_crc32_combine_gen64
|
|
1874
|
+
# else
|
|
1875
|
+
# define gzopen gzopen64
|
|
1876
|
+
# define gzseek gzseek64
|
|
1877
|
+
# define gztell gztell64
|
|
1878
|
+
# define gzoffset gzoffset64
|
|
1879
|
+
# define adler32_combine adler32_combine64
|
|
1880
|
+
# define crc32_combine crc32_combine64
|
|
1881
|
+
# define crc32_combine_gen crc32_combine_gen64
|
|
1882
|
+
# endif
|
|
1883
|
+
# ifndef Z_LARGE64
|
|
1582
1884
|
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
|
1583
1885
|
ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
|
|
1584
1886
|
ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
|
|
1585
1887
|
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
|
1586
1888
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
|
1587
1889
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
|
1890
|
+
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
|
1588
1891
|
# endif
|
|
1589
1892
|
#else
|
|
1590
1893
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
|
@@ -1593,18 +1896,37 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
|
|
|
1593
1896
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
|
1594
1897
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
|
1595
1898
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
|
1899
|
+
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
|
1596
1900
|
#endif
|
|
1597
1901
|
|
|
1598
|
-
/*
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1902
|
+
#else /* Z_SOLO */
|
|
1903
|
+
|
|
1904
|
+
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
|
1905
|
+
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
|
1906
|
+
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
|
1907
|
+
|
|
1908
|
+
#endif /* !Z_SOLO */
|
|
1602
1909
|
|
|
1603
1910
|
/* undocumented functions */
|
|
1604
1911
|
ZEXTERN const char * ZEXPORT zError OF((int));
|
|
1605
1912
|
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
|
|
1606
|
-
ZEXTERN const
|
|
1913
|
+
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
|
|
1607
1914
|
ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
|
|
1915
|
+
ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
|
|
1916
|
+
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp));
|
|
1917
|
+
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
|
1918
|
+
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
|
1919
|
+
#if defined(_WIN32) && !defined(Z_SOLO)
|
|
1920
|
+
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
|
1921
|
+
const char *mode));
|
|
1922
|
+
#endif
|
|
1923
|
+
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
|
|
1924
|
+
# ifndef Z_SOLO
|
|
1925
|
+
ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
|
|
1926
|
+
const char *format,
|
|
1927
|
+
va_list va));
|
|
1928
|
+
# endif
|
|
1929
|
+
#endif
|
|
1608
1930
|
|
|
1609
1931
|
#ifdef __cplusplus
|
|
1610
1932
|
}
|