libarchive-static 1.0.5 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- 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_internal.h +0 -1
- 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 +244 -137
- 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
data/ext/zlib-1.2.5/gzwrite.c
DELETED
@@ -1,531 +0,0 @@
|
|
1
|
-
/* gzwrite.c -- zlib functions for writing gzip files
|
2
|
-
* Copyright (C) 2004, 2005, 2010 Mark Adler
|
3
|
-
* For conditions of distribution and use, see copyright notice in zlib.h
|
4
|
-
*/
|
5
|
-
|
6
|
-
#include "gzguts.h"
|
7
|
-
|
8
|
-
/* Local functions */
|
9
|
-
local int gz_init OF((gz_statep));
|
10
|
-
local int gz_comp OF((gz_statep, int));
|
11
|
-
local int gz_zero OF((gz_statep, z_off64_t));
|
12
|
-
|
13
|
-
/* Initialize state for writing a gzip file. Mark initialization by setting
|
14
|
-
state->size to non-zero. Return -1 on failure or 0 on success. */
|
15
|
-
local int gz_init(state)
|
16
|
-
gz_statep state;
|
17
|
-
{
|
18
|
-
int ret;
|
19
|
-
z_streamp strm = &(state->strm);
|
20
|
-
|
21
|
-
/* allocate input and output buffers */
|
22
|
-
state->in = malloc(state->want);
|
23
|
-
state->out = malloc(state->want);
|
24
|
-
if (state->in == NULL || state->out == NULL) {
|
25
|
-
if (state->out != NULL)
|
26
|
-
free(state->out);
|
27
|
-
if (state->in != NULL)
|
28
|
-
free(state->in);
|
29
|
-
gz_error(state, Z_MEM_ERROR, "out of memory");
|
30
|
-
return -1;
|
31
|
-
}
|
32
|
-
|
33
|
-
/* allocate deflate memory, set up for gzip compression */
|
34
|
-
strm->zalloc = Z_NULL;
|
35
|
-
strm->zfree = Z_NULL;
|
36
|
-
strm->opaque = Z_NULL;
|
37
|
-
ret = deflateInit2(strm, state->level, Z_DEFLATED,
|
38
|
-
15 + 16, 8, state->strategy);
|
39
|
-
if (ret != Z_OK) {
|
40
|
-
free(state->in);
|
41
|
-
gz_error(state, Z_MEM_ERROR, "out of memory");
|
42
|
-
return -1;
|
43
|
-
}
|
44
|
-
|
45
|
-
/* mark state as initialized */
|
46
|
-
state->size = state->want;
|
47
|
-
|
48
|
-
/* initialize write buffer */
|
49
|
-
strm->avail_out = state->size;
|
50
|
-
strm->next_out = state->out;
|
51
|
-
state->next = strm->next_out;
|
52
|
-
return 0;
|
53
|
-
}
|
54
|
-
|
55
|
-
/* Compress whatever is at avail_in and next_in and write to the output file.
|
56
|
-
Return -1 if there is an error writing to the output file, otherwise 0.
|
57
|
-
flush is assumed to be a valid deflate() flush value. If flush is Z_FINISH,
|
58
|
-
then the deflate() state is reset to start a new gzip stream. */
|
59
|
-
local int gz_comp(state, flush)
|
60
|
-
gz_statep state;
|
61
|
-
int flush;
|
62
|
-
{
|
63
|
-
int ret, got;
|
64
|
-
unsigned have;
|
65
|
-
z_streamp strm = &(state->strm);
|
66
|
-
|
67
|
-
/* allocate memory if this is the first time through */
|
68
|
-
if (state->size == 0 && gz_init(state) == -1)
|
69
|
-
return -1;
|
70
|
-
|
71
|
-
/* run deflate() on provided input until it produces no more output */
|
72
|
-
ret = Z_OK;
|
73
|
-
do {
|
74
|
-
/* write out current buffer contents if full, or if flushing, but if
|
75
|
-
doing Z_FINISH then don't write until we get to Z_STREAM_END */
|
76
|
-
if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
|
77
|
-
(flush != Z_FINISH || ret == Z_STREAM_END))) {
|
78
|
-
have = (unsigned)(strm->next_out - state->next);
|
79
|
-
if (have && ((got = write(state->fd, state->next, have)) < 0 ||
|
80
|
-
(unsigned)got != have)) {
|
81
|
-
gz_error(state, Z_ERRNO, zstrerror());
|
82
|
-
return -1;
|
83
|
-
}
|
84
|
-
if (strm->avail_out == 0) {
|
85
|
-
strm->avail_out = state->size;
|
86
|
-
strm->next_out = state->out;
|
87
|
-
}
|
88
|
-
state->next = strm->next_out;
|
89
|
-
}
|
90
|
-
|
91
|
-
/* compress */
|
92
|
-
have = strm->avail_out;
|
93
|
-
ret = deflate(strm, flush);
|
94
|
-
if (ret == Z_STREAM_ERROR) {
|
95
|
-
gz_error(state, Z_STREAM_ERROR,
|
96
|
-
"internal error: deflate stream corrupt");
|
97
|
-
return -1;
|
98
|
-
}
|
99
|
-
have -= strm->avail_out;
|
100
|
-
} while (have);
|
101
|
-
|
102
|
-
/* if that completed a deflate stream, allow another to start */
|
103
|
-
if (flush == Z_FINISH)
|
104
|
-
deflateReset(strm);
|
105
|
-
|
106
|
-
/* all done, no errors */
|
107
|
-
return 0;
|
108
|
-
}
|
109
|
-
|
110
|
-
/* Compress len zeros to output. Return -1 on error, 0 on success. */
|
111
|
-
local int gz_zero(state, len)
|
112
|
-
gz_statep state;
|
113
|
-
z_off64_t len;
|
114
|
-
{
|
115
|
-
int first;
|
116
|
-
unsigned n;
|
117
|
-
z_streamp strm = &(state->strm);
|
118
|
-
|
119
|
-
/* consume whatever's left in the input buffer */
|
120
|
-
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
|
121
|
-
return -1;
|
122
|
-
|
123
|
-
/* compress len zeros (len guaranteed > 0) */
|
124
|
-
first = 1;
|
125
|
-
while (len) {
|
126
|
-
n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
|
127
|
-
(unsigned)len : state->size;
|
128
|
-
if (first) {
|
129
|
-
memset(state->in, 0, n);
|
130
|
-
first = 0;
|
131
|
-
}
|
132
|
-
strm->avail_in = n;
|
133
|
-
strm->next_in = state->in;
|
134
|
-
state->pos += n;
|
135
|
-
if (gz_comp(state, Z_NO_FLUSH) == -1)
|
136
|
-
return -1;
|
137
|
-
len -= n;
|
138
|
-
}
|
139
|
-
return 0;
|
140
|
-
}
|
141
|
-
|
142
|
-
/* -- see zlib.h -- */
|
143
|
-
int ZEXPORT gzwrite(file, buf, len)
|
144
|
-
gzFile file;
|
145
|
-
voidpc buf;
|
146
|
-
unsigned len;
|
147
|
-
{
|
148
|
-
unsigned put = len;
|
149
|
-
unsigned n;
|
150
|
-
gz_statep state;
|
151
|
-
z_streamp strm;
|
152
|
-
|
153
|
-
/* get internal structure */
|
154
|
-
if (file == NULL)
|
155
|
-
return 0;
|
156
|
-
state = (gz_statep)file;
|
157
|
-
strm = &(state->strm);
|
158
|
-
|
159
|
-
/* check that we're writing and that there's no error */
|
160
|
-
if (state->mode != GZ_WRITE || state->err != Z_OK)
|
161
|
-
return 0;
|
162
|
-
|
163
|
-
/* since an int is returned, make sure len fits in one, otherwise return
|
164
|
-
with an error (this avoids the flaw in the interface) */
|
165
|
-
if ((int)len < 0) {
|
166
|
-
gz_error(state, Z_BUF_ERROR, "requested length does not fit in int");
|
167
|
-
return 0;
|
168
|
-
}
|
169
|
-
|
170
|
-
/* if len is zero, avoid unnecessary operations */
|
171
|
-
if (len == 0)
|
172
|
-
return 0;
|
173
|
-
|
174
|
-
/* allocate memory if this is the first time through */
|
175
|
-
if (state->size == 0 && gz_init(state) == -1)
|
176
|
-
return 0;
|
177
|
-
|
178
|
-
/* check for seek request */
|
179
|
-
if (state->seek) {
|
180
|
-
state->seek = 0;
|
181
|
-
if (gz_zero(state, state->skip) == -1)
|
182
|
-
return 0;
|
183
|
-
}
|
184
|
-
|
185
|
-
/* for small len, copy to input buffer, otherwise compress directly */
|
186
|
-
if (len < state->size) {
|
187
|
-
/* copy to input buffer, compress when full */
|
188
|
-
do {
|
189
|
-
if (strm->avail_in == 0)
|
190
|
-
strm->next_in = state->in;
|
191
|
-
n = state->size - strm->avail_in;
|
192
|
-
if (n > len)
|
193
|
-
n = len;
|
194
|
-
memcpy(strm->next_in + strm->avail_in, buf, n);
|
195
|
-
strm->avail_in += n;
|
196
|
-
state->pos += n;
|
197
|
-
buf = (char *)buf + n;
|
198
|
-
len -= n;
|
199
|
-
if (len && gz_comp(state, Z_NO_FLUSH) == -1)
|
200
|
-
return 0;
|
201
|
-
} while (len);
|
202
|
-
}
|
203
|
-
else {
|
204
|
-
/* consume whatever's left in the input buffer */
|
205
|
-
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
|
206
|
-
return 0;
|
207
|
-
|
208
|
-
/* directly compress user buffer to file */
|
209
|
-
strm->avail_in = len;
|
210
|
-
strm->next_in = (voidp)buf;
|
211
|
-
state->pos += len;
|
212
|
-
if (gz_comp(state, Z_NO_FLUSH) == -1)
|
213
|
-
return 0;
|
214
|
-
}
|
215
|
-
|
216
|
-
/* input was all buffered or compressed (put will fit in int) */
|
217
|
-
return (int)put;
|
218
|
-
}
|
219
|
-
|
220
|
-
/* -- see zlib.h -- */
|
221
|
-
int ZEXPORT gzputc(file, c)
|
222
|
-
gzFile file;
|
223
|
-
int c;
|
224
|
-
{
|
225
|
-
unsigned char buf[1];
|
226
|
-
gz_statep state;
|
227
|
-
z_streamp strm;
|
228
|
-
|
229
|
-
/* get internal structure */
|
230
|
-
if (file == NULL)
|
231
|
-
return -1;
|
232
|
-
state = (gz_statep)file;
|
233
|
-
strm = &(state->strm);
|
234
|
-
|
235
|
-
/* check that we're writing and that there's no error */
|
236
|
-
if (state->mode != GZ_WRITE || state->err != Z_OK)
|
237
|
-
return -1;
|
238
|
-
|
239
|
-
/* check for seek request */
|
240
|
-
if (state->seek) {
|
241
|
-
state->seek = 0;
|
242
|
-
if (gz_zero(state, state->skip) == -1)
|
243
|
-
return -1;
|
244
|
-
}
|
245
|
-
|
246
|
-
/* try writing to input buffer for speed (state->size == 0 if buffer not
|
247
|
-
initialized) */
|
248
|
-
if (strm->avail_in < state->size) {
|
249
|
-
if (strm->avail_in == 0)
|
250
|
-
strm->next_in = state->in;
|
251
|
-
strm->next_in[strm->avail_in++] = c;
|
252
|
-
state->pos++;
|
253
|
-
return c;
|
254
|
-
}
|
255
|
-
|
256
|
-
/* no room in buffer or not initialized, use gz_write() */
|
257
|
-
buf[0] = c;
|
258
|
-
if (gzwrite(file, buf, 1) != 1)
|
259
|
-
return -1;
|
260
|
-
return c;
|
261
|
-
}
|
262
|
-
|
263
|
-
/* -- see zlib.h -- */
|
264
|
-
int ZEXPORT gzputs(file, str)
|
265
|
-
gzFile file;
|
266
|
-
const char *str;
|
267
|
-
{
|
268
|
-
int ret;
|
269
|
-
unsigned len;
|
270
|
-
|
271
|
-
/* write string */
|
272
|
-
len = (unsigned)strlen(str);
|
273
|
-
ret = gzwrite(file, str, len);
|
274
|
-
return ret == 0 && len != 0 ? -1 : ret;
|
275
|
-
}
|
276
|
-
|
277
|
-
#ifdef STDC
|
278
|
-
#include <stdarg.h>
|
279
|
-
|
280
|
-
/* -- see zlib.h -- */
|
281
|
-
int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
|
282
|
-
{
|
283
|
-
int size, len;
|
284
|
-
gz_statep state;
|
285
|
-
z_streamp strm;
|
286
|
-
va_list va;
|
287
|
-
|
288
|
-
/* get internal structure */
|
289
|
-
if (file == NULL)
|
290
|
-
return -1;
|
291
|
-
state = (gz_statep)file;
|
292
|
-
strm = &(state->strm);
|
293
|
-
|
294
|
-
/* check that we're writing and that there's no error */
|
295
|
-
if (state->mode != GZ_WRITE || state->err != Z_OK)
|
296
|
-
return 0;
|
297
|
-
|
298
|
-
/* make sure we have some buffer space */
|
299
|
-
if (state->size == 0 && gz_init(state) == -1)
|
300
|
-
return 0;
|
301
|
-
|
302
|
-
/* check for seek request */
|
303
|
-
if (state->seek) {
|
304
|
-
state->seek = 0;
|
305
|
-
if (gz_zero(state, state->skip) == -1)
|
306
|
-
return 0;
|
307
|
-
}
|
308
|
-
|
309
|
-
/* consume whatever's left in the input buffer */
|
310
|
-
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
|
311
|
-
return 0;
|
312
|
-
|
313
|
-
/* do the printf() into the input buffer, put length in len */
|
314
|
-
size = (int)(state->size);
|
315
|
-
state->in[size - 1] = 0;
|
316
|
-
va_start(va, format);
|
317
|
-
#ifdef NO_vsnprintf
|
318
|
-
# ifdef HAS_vsprintf_void
|
319
|
-
(void)vsprintf(state->in, format, va);
|
320
|
-
va_end(va);
|
321
|
-
for (len = 0; len < size; len++)
|
322
|
-
if (state->in[len] == 0) break;
|
323
|
-
# else
|
324
|
-
len = vsprintf(state->in, format, va);
|
325
|
-
va_end(va);
|
326
|
-
# endif
|
327
|
-
#else
|
328
|
-
# ifdef HAS_vsnprintf_void
|
329
|
-
(void)vsnprintf(state->in, size, format, va);
|
330
|
-
va_end(va);
|
331
|
-
len = strlen(state->in);
|
332
|
-
# else
|
333
|
-
len = vsnprintf((char *)(state->in), size, format, va);
|
334
|
-
va_end(va);
|
335
|
-
# endif
|
336
|
-
#endif
|
337
|
-
|
338
|
-
/* check that printf() results fit in buffer */
|
339
|
-
if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
|
340
|
-
return 0;
|
341
|
-
|
342
|
-
/* update buffer and position, defer compression until needed */
|
343
|
-
strm->avail_in = (unsigned)len;
|
344
|
-
strm->next_in = state->in;
|
345
|
-
state->pos += len;
|
346
|
-
return len;
|
347
|
-
}
|
348
|
-
|
349
|
-
#else /* !STDC */
|
350
|
-
|
351
|
-
/* -- see zlib.h -- */
|
352
|
-
int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
|
353
|
-
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
|
354
|
-
gzFile file;
|
355
|
-
const char *format;
|
356
|
-
int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
|
357
|
-
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
|
358
|
-
{
|
359
|
-
int size, len;
|
360
|
-
gz_statep state;
|
361
|
-
z_streamp strm;
|
362
|
-
|
363
|
-
/* get internal structure */
|
364
|
-
if (file == NULL)
|
365
|
-
return -1;
|
366
|
-
state = (gz_statep)file;
|
367
|
-
strm = &(state->strm);
|
368
|
-
|
369
|
-
/* check that we're writing and that there's no error */
|
370
|
-
if (state->mode != GZ_WRITE || state->err != Z_OK)
|
371
|
-
return 0;
|
372
|
-
|
373
|
-
/* make sure we have some buffer space */
|
374
|
-
if (state->size == 0 && gz_init(state) == -1)
|
375
|
-
return 0;
|
376
|
-
|
377
|
-
/* check for seek request */
|
378
|
-
if (state->seek) {
|
379
|
-
state->seek = 0;
|
380
|
-
if (gz_zero(state, state->skip) == -1)
|
381
|
-
return 0;
|
382
|
-
}
|
383
|
-
|
384
|
-
/* consume whatever's left in the input buffer */
|
385
|
-
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
|
386
|
-
return 0;
|
387
|
-
|
388
|
-
/* do the printf() into the input buffer, put length in len */
|
389
|
-
size = (int)(state->size);
|
390
|
-
state->in[size - 1] = 0;
|
391
|
-
#ifdef NO_snprintf
|
392
|
-
# ifdef HAS_sprintf_void
|
393
|
-
sprintf(state->in, format, a1, a2, a3, a4, a5, a6, a7, a8,
|
394
|
-
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
|
395
|
-
for (len = 0; len < size; len++)
|
396
|
-
if (state->in[len] == 0) break;
|
397
|
-
# else
|
398
|
-
len = sprintf(state->in, format, a1, a2, a3, a4, a5, a6, a7, a8,
|
399
|
-
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
|
400
|
-
# endif
|
401
|
-
#else
|
402
|
-
# ifdef HAS_snprintf_void
|
403
|
-
snprintf(state->in, size, format, a1, a2, a3, a4, a5, a6, a7, a8,
|
404
|
-
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
|
405
|
-
len = strlen(state->in);
|
406
|
-
# else
|
407
|
-
len = snprintf(state->in, size, format, a1, a2, a3, a4, a5, a6, a7, a8,
|
408
|
-
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
|
409
|
-
# endif
|
410
|
-
#endif
|
411
|
-
|
412
|
-
/* check that printf() results fit in buffer */
|
413
|
-
if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
|
414
|
-
return 0;
|
415
|
-
|
416
|
-
/* update buffer and position, defer compression until needed */
|
417
|
-
strm->avail_in = (unsigned)len;
|
418
|
-
strm->next_in = state->in;
|
419
|
-
state->pos += len;
|
420
|
-
return len;
|
421
|
-
}
|
422
|
-
|
423
|
-
#endif
|
424
|
-
|
425
|
-
/* -- see zlib.h -- */
|
426
|
-
int ZEXPORT gzflush(file, flush)
|
427
|
-
gzFile file;
|
428
|
-
int flush;
|
429
|
-
{
|
430
|
-
gz_statep state;
|
431
|
-
|
432
|
-
/* get internal structure */
|
433
|
-
if (file == NULL)
|
434
|
-
return -1;
|
435
|
-
state = (gz_statep)file;
|
436
|
-
|
437
|
-
/* check that we're writing and that there's no error */
|
438
|
-
if (state->mode != GZ_WRITE || state->err != Z_OK)
|
439
|
-
return Z_STREAM_ERROR;
|
440
|
-
|
441
|
-
/* check flush parameter */
|
442
|
-
if (flush < 0 || flush > Z_FINISH)
|
443
|
-
return Z_STREAM_ERROR;
|
444
|
-
|
445
|
-
/* check for seek request */
|
446
|
-
if (state->seek) {
|
447
|
-
state->seek = 0;
|
448
|
-
if (gz_zero(state, state->skip) == -1)
|
449
|
-
return -1;
|
450
|
-
}
|
451
|
-
|
452
|
-
/* compress remaining data with requested flush */
|
453
|
-
gz_comp(state, flush);
|
454
|
-
return state->err;
|
455
|
-
}
|
456
|
-
|
457
|
-
/* -- see zlib.h -- */
|
458
|
-
int ZEXPORT gzsetparams(file, level, strategy)
|
459
|
-
gzFile file;
|
460
|
-
int level;
|
461
|
-
int strategy;
|
462
|
-
{
|
463
|
-
gz_statep state;
|
464
|
-
z_streamp strm;
|
465
|
-
|
466
|
-
/* get internal structure */
|
467
|
-
if (file == NULL)
|
468
|
-
return Z_STREAM_ERROR;
|
469
|
-
state = (gz_statep)file;
|
470
|
-
strm = &(state->strm);
|
471
|
-
|
472
|
-
/* check that we're writing and that there's no error */
|
473
|
-
if (state->mode != GZ_WRITE || state->err != Z_OK)
|
474
|
-
return Z_STREAM_ERROR;
|
475
|
-
|
476
|
-
/* if no change is requested, then do nothing */
|
477
|
-
if (level == state->level && strategy == state->strategy)
|
478
|
-
return Z_OK;
|
479
|
-
|
480
|
-
/* check for seek request */
|
481
|
-
if (state->seek) {
|
482
|
-
state->seek = 0;
|
483
|
-
if (gz_zero(state, state->skip) == -1)
|
484
|
-
return -1;
|
485
|
-
}
|
486
|
-
|
487
|
-
/* change compression parameters for subsequent input */
|
488
|
-
if (state->size) {
|
489
|
-
/* flush previous input with previous parameters before changing */
|
490
|
-
if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)
|
491
|
-
return state->err;
|
492
|
-
deflateParams(strm, level, strategy);
|
493
|
-
}
|
494
|
-
state->level = level;
|
495
|
-
state->strategy = strategy;
|
496
|
-
return Z_OK;
|
497
|
-
}
|
498
|
-
|
499
|
-
/* -- see zlib.h -- */
|
500
|
-
int ZEXPORT gzclose_w(file)
|
501
|
-
gzFile file;
|
502
|
-
{
|
503
|
-
int ret = 0;
|
504
|
-
gz_statep state;
|
505
|
-
|
506
|
-
/* get internal structure */
|
507
|
-
if (file == NULL)
|
508
|
-
return Z_STREAM_ERROR;
|
509
|
-
state = (gz_statep)file;
|
510
|
-
|
511
|
-
/* check that we're writing */
|
512
|
-
if (state->mode != GZ_WRITE)
|
513
|
-
return Z_STREAM_ERROR;
|
514
|
-
|
515
|
-
/* check for seek request */
|
516
|
-
if (state->seek) {
|
517
|
-
state->seek = 0;
|
518
|
-
ret += gz_zero(state, state->skip);
|
519
|
-
}
|
520
|
-
|
521
|
-
/* flush, free memory, and close file */
|
522
|
-
ret += gz_comp(state, Z_FINISH);
|
523
|
-
(void)deflateEnd(&(state->strm));
|
524
|
-
free(state->out);
|
525
|
-
free(state->in);
|
526
|
-
gz_error(state, Z_OK, NULL);
|
527
|
-
free(state->path);
|
528
|
-
ret += close(state->fd);
|
529
|
-
free(state);
|
530
|
-
return ret ? Z_ERRNO : Z_OK;
|
531
|
-
}
|