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.
Files changed (296) hide show
  1. checksums.yaml +5 -5
  2. data/ext/extconf.rb +2 -9
  3. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.c +6 -6
  4. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.o +0 -0
  5. data/ext/libarchive-0.1.1/ext/archive_read_support_format.o +0 -0
  6. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.c +1 -1
  7. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.o +0 -0
  8. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.c +5 -5
  9. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.o +0 -0
  10. data/ext/libarchive-0.1.1/ext/config.h +23 -0
  11. data/ext/libarchive-0.1.1/ext/config.log +230 -0
  12. data/ext/libarchive-0.1.1/ext/config.status +671 -0
  13. data/ext/libarchive-0.1.1/ext/libarchive.c +1 -1
  14. data/ext/libarchive-0.1.1/ext/libarchive.o +0 -0
  15. data/ext/libarchive-0.1.1/ext/libarchive_archive.c +7 -7
  16. data/ext/libarchive-0.1.1/ext/libarchive_archive.o +0 -0
  17. data/ext/libarchive-0.1.1/ext/libarchive_entry.c +6 -0
  18. data/ext/libarchive-0.1.1/ext/libarchive_entry.o +0 -0
  19. data/ext/libarchive-0.1.1/ext/libarchive_internal.h +0 -1
  20. data/ext/libarchive-0.1.1/ext/libarchive_reader.c +6 -4
  21. data/ext/libarchive-0.1.1/ext/libarchive_reader.o +0 -0
  22. data/ext/libarchive-0.1.1/ext/libarchive_ruby.so +0 -0
  23. data/ext/libarchive-0.1.1/ext/libarchive_win32.h +1 -1
  24. data/ext/libarchive-0.1.1/ext/libarchive_writer.c +2 -2
  25. data/ext/libarchive-0.1.1/ext/libarchive_writer.o +0 -0
  26. data/ext/libarchive-3.6.2/Makefile.in +16892 -0
  27. data/ext/libarchive-3.6.2/build/autoconf/ax_append_compile_flags.m4 +67 -0
  28. data/ext/libarchive-3.6.2/build/autoconf/ax_append_flag.m4 +71 -0
  29. data/ext/libarchive-3.6.2/build/autoconf/ax_check_compile_flag.m4 +74 -0
  30. data/ext/libarchive-3.6.2/build/autoconf/ax_require_defined.m4 +37 -0
  31. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/check_stdcall_func.m4 +0 -0
  32. data/ext/libarchive-3.6.2/build/autoconf/compile +348 -0
  33. data/ext/libarchive-3.6.2/build/autoconf/config.guess +1754 -0
  34. data/ext/libarchive-3.6.2/build/autoconf/config.rpath +696 -0
  35. data/ext/libarchive-3.6.2/build/autoconf/config.sub +1890 -0
  36. data/ext/libarchive-3.6.2/build/autoconf/depcomp +791 -0
  37. data/ext/libarchive-3.6.2/build/autoconf/iconv.m4 +271 -0
  38. data/ext/libarchive-3.6.2/build/autoconf/install-sh +541 -0
  39. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/la_uid_t.m4 +0 -0
  40. data/ext/libarchive-3.6.2/build/autoconf/lib-ld.m4 +109 -0
  41. data/ext/libarchive-3.6.2/build/autoconf/lib-link.m4 +777 -0
  42. data/ext/libarchive-3.6.2/build/autoconf/lib-prefix.m4 +224 -0
  43. data/ext/libarchive-3.6.2/build/autoconf/ltmain.sh +11251 -0
  44. data/ext/libarchive-3.6.2/build/autoconf/m4_ax_compile_check_sizeof.m4 +115 -0
  45. data/ext/libarchive-3.6.2/build/autoconf/missing +215 -0
  46. data/ext/libarchive-3.6.2/build/autoconf/test-driver +153 -0
  47. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/pkgconfig/libarchive.pc.in +4 -1
  48. data/ext/libarchive-3.6.2/config.h.in +1504 -0
  49. data/ext/libarchive-3.6.2/configure +25558 -0
  50. data/ext/libarchive-3.6.2/libarchive/archive.h +1212 -0
  51. data/ext/libarchive-3.6.2/libarchive/archive_acl.c +2097 -0
  52. data/ext/libarchive-3.6.2/libarchive/archive_acl_private.h +83 -0
  53. data/ext/libarchive-3.6.2/libarchive/archive_blake2.h +197 -0
  54. data/ext/libarchive-3.6.2/libarchive/archive_blake2_impl.h +161 -0
  55. data/ext/libarchive-3.6.2/libarchive/archive_blake2s_ref.c +369 -0
  56. data/ext/libarchive-3.6.2/libarchive/archive_blake2sp_ref.c +361 -0
  57. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_check_magic.c +63 -22
  58. data/ext/libarchive-3.6.2/libarchive/archive_cmdline.c +227 -0
  59. data/ext/libarchive-3.6.2/libarchive/archive_cmdline_private.h +47 -0
  60. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_crc32.h +17 -0
  61. data/ext/libarchive-3.6.2/libarchive/archive_cryptor.c +534 -0
  62. data/ext/libarchive-3.6.2/libarchive/archive_cryptor_private.h +188 -0
  63. data/ext/libarchive-3.6.2/libarchive/archive_digest.c +1505 -0
  64. data/ext/libarchive-3.6.2/libarchive/archive_digest_private.h +416 -0
  65. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_darwin.c +559 -0
  66. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_freebsd.c +712 -0
  67. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_linux.c +760 -0
  68. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_sunos.c +824 -0
  69. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_endian.h +48 -15
  70. data/ext/libarchive-3.6.2/libarchive/archive_entry.c +2149 -0
  71. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry.h +305 -106
  72. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_bhfi.c +5 -4
  73. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_stat.c +9 -3
  74. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_link_resolver.c +104 -62
  75. data/ext/libarchive-3.6.2/libarchive/archive_entry_locale.h +92 -0
  76. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_private.h +65 -49
  77. data/ext/libarchive-3.6.2/libarchive/archive_entry_sparse.c +156 -0
  78. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_stat.c +6 -6
  79. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_strmode.c +1 -1
  80. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_xattr.c +4 -6
  81. data/ext/libarchive-3.6.2/libarchive/archive_getdate.c +1165 -0
  82. data/ext/libarchive-3.6.2/libarchive/archive_getdate.h +39 -0
  83. data/ext/libarchive-3.6.2/libarchive/archive_hmac.c +334 -0
  84. data/ext/libarchive-3.6.2/libarchive/archive_hmac_private.h +117 -0
  85. data/ext/libarchive-3.6.2/libarchive/archive_match.c +1875 -0
  86. data/ext/libarchive-3.6.2/libarchive/archive_openssl_evp_private.h +53 -0
  87. data/ext/libarchive-3.6.2/libarchive/archive_openssl_hmac_private.h +54 -0
  88. data/ext/libarchive-3.6.2/libarchive/archive_options.c +218 -0
  89. data/ext/libarchive-3.6.2/libarchive/archive_options_private.h +51 -0
  90. data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.c +337 -0
  91. data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.h +49 -0
  92. data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.c +463 -0
  93. data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.h +52 -0
  94. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_platform.h +77 -9
  95. data/ext/libarchive-3.6.2/libarchive/archive_platform_acl.h +55 -0
  96. data/ext/libarchive-3.6.2/libarchive/archive_platform_xattr.h +47 -0
  97. data/ext/libarchive-3.6.2/libarchive/archive_ppmd7.c +1168 -0
  98. data/ext/libarchive-3.6.2/libarchive/archive_ppmd7_private.h +119 -0
  99. data/ext/libarchive-3.6.2/libarchive/archive_ppmd8.c +1287 -0
  100. data/ext/libarchive-3.6.2/libarchive/archive_ppmd8_private.h +148 -0
  101. data/ext/libarchive-3.6.2/libarchive/archive_ppmd_private.h +151 -0
  102. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_private.h +74 -18
  103. data/ext/libarchive-3.6.2/libarchive/archive_random.c +272 -0
  104. data/ext/libarchive-3.6.2/libarchive/archive_random_private.h +36 -0
  105. data/ext/libarchive-3.6.2/libarchive/archive_rb.c +709 -0
  106. data/ext/libarchive-3.6.2/libarchive/archive_rb.h +113 -0
  107. data/ext/libarchive-3.6.2/libarchive/archive_read.c +1756 -0
  108. data/ext/libarchive-3.6.2/libarchive/archive_read_add_passphrase.c +190 -0
  109. data/ext/libarchive-3.6.2/libarchive/archive_read_append_filter.c +204 -0
  110. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_data_into_fd.c +64 -18
  111. data/ext/libarchive-3.6.2/libarchive/archive_read_disk_entry_from_file.c +1086 -0
  112. data/ext/libarchive-3.6.2/libarchive/archive_read_disk_posix.c +2732 -0
  113. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_private.h +40 -4
  114. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_set_standard_lookup.c +21 -11
  115. data/ext/libarchive-3.6.2/libarchive/archive_read_disk_windows.c +2479 -0
  116. data/ext/libarchive-3.6.2/libarchive/archive_read_extract.c +60 -0
  117. data/ext/{libarchive-2.8.4/libarchive/archive_read_extract.c → libarchive-3.6.2/libarchive/archive_read_extract2.c} +34 -61
  118. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_fd.c +70 -49
  119. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_file.c +38 -23
  120. data/ext/libarchive-3.6.2/libarchive/archive_read_open_filename.c +586 -0
  121. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_memory.c +58 -28
  122. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_private.h +127 -59
  123. data/ext/libarchive-3.6.2/libarchive/archive_read_set_format.c +117 -0
  124. data/ext/libarchive-3.6.2/libarchive/archive_read_set_options.c +133 -0
  125. 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
  126. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_by_code.c +83 -0
  127. 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
  128. 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
  129. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_grzip.c +112 -0
  130. 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
  131. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lrzip.c +122 -0
  132. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lz4.c +742 -0
  133. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lzop.c +499 -0
  134. 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
  135. 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
  136. 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
  137. 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
  138. 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
  139. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_zstd.c +297 -0
  140. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_7zip.c +3900 -0
  141. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_all.c +89 -0
  142. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_ar.c +126 -72
  143. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_by_code.c +92 -0
  144. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cab.c +3228 -0
  145. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cpio.c +1104 -0
  146. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_empty.c +14 -11
  147. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_iso9660.c +990 -541
  148. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_lha.c +2916 -0
  149. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_mtree.c +2150 -0
  150. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar.c +3797 -0
  151. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar5.c +4251 -0
  152. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_raw.c +38 -31
  153. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_tar.c +1157 -629
  154. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_warc.c +848 -0
  155. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_xar.c +439 -258
  156. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_zip.c +4270 -0
  157. data/ext/libarchive-3.6.2/libarchive/archive_string.c +4240 -0
  158. data/ext/libarchive-3.6.2/libarchive/archive_string.h +243 -0
  159. data/ext/libarchive-3.6.2/libarchive/archive_string_composition.h +2292 -0
  160. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_string_sprintf.c +44 -16
  161. data/ext/libarchive-3.6.2/libarchive/archive_util.c +655 -0
  162. data/ext/libarchive-3.6.2/libarchive/archive_version_details.c +151 -0
  163. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_virtual.c +85 -16
  164. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.c +214 -541
  165. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.h +74 -106
  166. data/ext/libarchive-3.6.2/libarchive/archive_write.c +828 -0
  167. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter.c +72 -0
  168. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_b64encode.c +304 -0
  169. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_by_name.c +77 -0
  170. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_bzip2.c +401 -0
  171. 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
  172. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_grzip.c +135 -0
  173. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_gzip.c +442 -0
  174. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lrzip.c +197 -0
  175. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lz4.c +700 -0
  176. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lzop.c +478 -0
  177. 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
  178. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_program.c +391 -0
  179. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_uuencode.c +295 -0
  180. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_xz.c +545 -0
  181. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_zstd.c +418 -0
  182. data/ext/libarchive-3.6.2/libarchive/archive_write_disk_posix.c +4711 -0
  183. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_private.h +9 -2
  184. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_set_standard_lookup.c +30 -29
  185. data/ext/libarchive-3.6.2/libarchive/archive_write_disk_windows.c +2842 -0
  186. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_fd.c +15 -10
  187. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_file.c +15 -9
  188. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_filename.c +128 -20
  189. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_memory.c +7 -18
  190. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_private.h +72 -29
  191. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format.c +56 -3
  192. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_7zip.c +2322 -0
  193. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ar.c +54 -34
  194. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_by_name.c +20 -2
  195. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio.c +11 -0
  196. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_binary.c +610 -0
  197. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_newc.c +457 -0
  198. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_odc.c +500 -0
  199. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_filter_by_ext.c +142 -0
  200. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_gnutar.c +755 -0
  201. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_iso9660.c +8165 -0
  202. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_mtree.c +2217 -0
  203. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_pax.c +1049 -387
  204. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_private.h +42 -0
  205. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_raw.c +125 -0
  206. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_shar.c +62 -47
  207. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ustar.c +279 -108
  208. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_v7tar.c +638 -0
  209. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_warc.c +453 -0
  210. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_xar.c +3259 -0
  211. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_zip.c +1704 -0
  212. data/ext/libarchive-3.6.2/libarchive/archive_write_set_options.c +130 -0
  213. data/ext/libarchive-3.6.2/libarchive/archive_write_set_passphrase.c +95 -0
  214. data/ext/libarchive-3.6.2/libarchive/archive_xxhash.h +48 -0
  215. data/ext/libarchive-3.6.2/libarchive/config_freebsd.h +271 -0
  216. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/filter_fork.h +10 -5
  217. data/ext/{libarchive-2.8.4/libarchive/filter_fork.c → libarchive-3.6.2/libarchive/filter_fork_posix.c} +98 -19
  218. data/ext/libarchive-3.6.2/libarchive/filter_fork_windows.c +236 -0
  219. data/ext/libarchive-3.6.2/libarchive/xxhash.c +525 -0
  220. data/ext/libarchive-static-makefile +144 -80
  221. data/ext/libarchive-static-wrapper-makefile +1 -1
  222. data/ext/zlib-1.2.13/Makefile.in +404 -0
  223. data/ext/{zlib-1.2.5 → zlib-1.2.13}/adler32.c +51 -34
  224. data/ext/{zlib-1.2.5 → zlib-1.2.13}/compress.c +27 -21
  225. data/ext/zlib-1.2.13/configure +922 -0
  226. data/ext/zlib-1.2.13/crc32.c +1125 -0
  227. data/ext/zlib-1.2.13/crc32.h +9446 -0
  228. data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.c +842 -459
  229. data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.h +37 -33
  230. data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzclose.c +0 -0
  231. data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzguts.h +103 -16
  232. data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzlib.c +155 -53
  233. data/ext/zlib-1.2.13/gzread.c +650 -0
  234. data/ext/zlib-1.2.13/gzwrite.c +677 -0
  235. data/ext/{zlib-1.2.5 → zlib-1.2.13}/infback.c +24 -12
  236. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.c +49 -66
  237. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.h +0 -0
  238. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffixed.h +3 -3
  239. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.c +209 -94
  240. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.h +9 -5
  241. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.c +24 -50
  242. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.h +1 -1
  243. data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.c +135 -198
  244. data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.h +0 -0
  245. data/ext/zlib-1.2.13/uncompr.c +93 -0
  246. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zconf.h +182 -63
  247. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zlib.h +617 -295
  248. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.c +50 -41
  249. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.h +83 -82
  250. metadata +244 -137
  251. data/ext/libarchive-0.1.1/libarchive.c +0 -1762
  252. data/ext/libarchive-2.8.4/Makefile.in +0 -7076
  253. data/ext/libarchive-2.8.4/build/autoconf/compile +0 -143
  254. data/ext/libarchive-2.8.4/build/autoconf/config.guess +0 -1502
  255. data/ext/libarchive-2.8.4/build/autoconf/config.sub +0 -1708
  256. data/ext/libarchive-2.8.4/build/autoconf/depcomp +0 -630
  257. data/ext/libarchive-2.8.4/build/autoconf/install-sh +0 -291
  258. data/ext/libarchive-2.8.4/build/autoconf/ltmain.sh +0 -8406
  259. data/ext/libarchive-2.8.4/build/autoconf/missing +0 -376
  260. data/ext/libarchive-2.8.4/config.h.in +0 -772
  261. data/ext/libarchive-2.8.4/configure +0 -17916
  262. data/ext/libarchive-2.8.4/libarchive/archive.h +0 -741
  263. data/ext/libarchive-2.8.4/libarchive/archive_entry.c +0 -2202
  264. data/ext/libarchive-2.8.4/libarchive/archive_hash.h +0 -281
  265. data/ext/libarchive-2.8.4/libarchive/archive_read.c +0 -1249
  266. data/ext/libarchive-2.8.4/libarchive/archive_read_disk.c +0 -198
  267. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_entry_from_file.c +0 -570
  268. data/ext/libarchive-2.8.4/libarchive/archive_read_open_filename.c +0 -272
  269. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_cpio.c +0 -777
  270. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_mtree.c +0 -1304
  271. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_zip.c +0 -903
  272. data/ext/libarchive-2.8.4/libarchive/archive_string.c +0 -453
  273. data/ext/libarchive-2.8.4/libarchive/archive_string.h +0 -148
  274. data/ext/libarchive-2.8.4/libarchive/archive_util.c +0 -391
  275. data/ext/libarchive-2.8.4/libarchive/archive_write.c +0 -466
  276. data/ext/libarchive-2.8.4/libarchive/archive_write_disk.c +0 -2628
  277. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_bzip2.c +0 -408
  278. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_gzip.c +0 -477
  279. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_none.c +0 -257
  280. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_program.c +0 -347
  281. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_xz.c +0 -438
  282. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio.c +0 -344
  283. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio_newc.c +0 -295
  284. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_mtree.c +0 -1050
  285. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_zip.c +0 -667
  286. data/ext/libarchive-2.8.4/libarchive/config_freebsd.h +0 -154
  287. data/ext/libarchive-2.8.4/libarchive/filter_fork_windows.c +0 -113
  288. data/ext/zlib-1.2.5/Makefile.in +0 -257
  289. data/ext/zlib-1.2.5/configure +0 -596
  290. data/ext/zlib-1.2.5/crc32.c +0 -442
  291. data/ext/zlib-1.2.5/crc32.h +0 -441
  292. data/ext/zlib-1.2.5/example.c +0 -565
  293. data/ext/zlib-1.2.5/gzread.c +0 -653
  294. data/ext/zlib-1.2.5/gzwrite.c +0 -531
  295. data/ext/zlib-1.2.5/minigzip.c +0 -440
  296. data/ext/zlib-1.2.5/uncompr.c +0 -59
@@ -0,0 +1,478 @@
1
+ /*-
2
+ * Copyright (c) 2012 Michihiro NAKAJIMA
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions
7
+ * are met:
8
+ * 1. Redistributions of source code must retain the above copyright
9
+ * notice, this list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright
11
+ * notice, this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
15
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
18
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+ */
25
+
26
+ #include "archive_platform.h"
27
+
28
+ __FBSDID("$FreeBSD$");
29
+ //#undef HAVE_LZO_LZOCONF_H
30
+ //#undef HAVE_LZO_LZO1X_H
31
+
32
+ #ifdef HAVE_ERRNO_H
33
+ #include <errno.h>
34
+ #endif
35
+ #ifdef HAVE_STDLIB_H
36
+ #include <stdlib.h>
37
+ #endif
38
+ #ifdef HAVE_STRING_H
39
+ #include <string.h>
40
+ #endif
41
+ #include <time.h>
42
+ #ifdef HAVE_LZO_LZOCONF_H
43
+ #include <lzo/lzoconf.h>
44
+ #endif
45
+ #ifdef HAVE_LZO_LZO1X_H
46
+ #include <lzo/lzo1x.h>
47
+ #endif
48
+
49
+ #include "archive.h"
50
+ #include "archive_string.h"
51
+ #include "archive_endian.h"
52
+ #include "archive_write_private.h"
53
+
54
+ enum lzo_method {
55
+ METHOD_LZO1X_1 = 1,
56
+ METHOD_LZO1X_1_15 = 2,
57
+ METHOD_LZO1X_999 = 3
58
+ };
59
+ struct write_lzop {
60
+ int compression_level;
61
+ #if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H)
62
+ unsigned char *uncompressed;
63
+ size_t uncompressed_buffer_size;
64
+ size_t uncompressed_avail_bytes;
65
+ unsigned char *compressed;
66
+ size_t compressed_buffer_size;
67
+ enum lzo_method method;
68
+ unsigned char level;
69
+ lzo_voidp work_buffer;
70
+ lzo_uint32 work_buffer_size;
71
+ char header_written;
72
+ #else
73
+ struct archive_write_program_data *pdata;
74
+ #endif
75
+ };
76
+
77
+ static int archive_write_lzop_open(struct archive_write_filter *);
78
+ static int archive_write_lzop_options(struct archive_write_filter *,
79
+ const char *, const char *);
80
+ static int archive_write_lzop_write(struct archive_write_filter *,
81
+ const void *, size_t);
82
+ static int archive_write_lzop_close(struct archive_write_filter *);
83
+ static int archive_write_lzop_free(struct archive_write_filter *);
84
+
85
+ #if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H)
86
+ /* Maximum block size. */
87
+ #define BLOCK_SIZE (256 * 1024)
88
+ /* Block information is composed of uncompressed size(4 bytes),
89
+ * compressed size(4 bytes) and the checksum of uncompressed data(4 bytes)
90
+ * in this lzop writer. */
91
+ #define BLOCK_INfO_SIZE 12
92
+
93
+ #define HEADER_VERSION 9
94
+ #define HEADER_LIBVERSION 11
95
+ #define HEADER_METHOD 15
96
+ #define HEADER_LEVEL 16
97
+ #define HEADER_MTIME_LOW 25
98
+ #define HEADER_MTIME_HIGH 29
99
+ #define HEADER_H_CHECKSUM 34
100
+
101
+ /*
102
+ * Header template.
103
+ */
104
+ static const unsigned char header[] = {
105
+ /* LZOP Magic code 9 bytes */
106
+ 0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a,
107
+ /* LZOP utility version(fake data) 2 bytes */
108
+ 0x10, 0x30,
109
+ /* LZO library version 2 bytes */
110
+ 0x09, 0x40,
111
+ /* Minimum required LZO library version 2 bytes */
112
+ 0x09, 0x40,
113
+ /* Method */
114
+ 1,
115
+ /* Level */
116
+ 5,
117
+ /* Flags 4 bytes
118
+ * -OS Unix
119
+ * -Stdout
120
+ * -Stdin
121
+ * -Adler32 used for uncompressed data 4 bytes */
122
+ 0x03, 0x00, 0x00, 0x0d,
123
+ /* Mode (AE_IFREG | 0644) 4 bytes */
124
+ 0x00, 0x00, 0x81, 0xa4,
125
+ /* Mtime low 4 bytes */
126
+ 0x00, 0x00, 0x00, 0x00,
127
+ /* Mtime high 4 bytes */
128
+ 0x00, 0x00, 0x00, 0x00,
129
+ /* Filename length */
130
+ 0x00,
131
+ /* Header checksum 4 bytes */
132
+ 0x00, 0x00, 0x00, 0x00,
133
+ };
134
+ #endif
135
+
136
+ int
137
+ archive_write_add_filter_lzop(struct archive *_a)
138
+ {
139
+ struct archive_write_filter *f = __archive_write_allocate_filter(_a);
140
+ struct write_lzop *data;
141
+
142
+ archive_check_magic(_a, ARCHIVE_WRITE_MAGIC,
143
+ ARCHIVE_STATE_NEW, "archive_write_add_filter_lzop");
144
+
145
+ data = calloc(1, sizeof(*data));
146
+ if (data == NULL) {
147
+ archive_set_error(_a, ENOMEM, "Can't allocate memory");
148
+ return (ARCHIVE_FATAL);
149
+ }
150
+
151
+ f->name = "lzop";
152
+ f->code = ARCHIVE_FILTER_LZOP;
153
+ f->data = data;
154
+ f->open = archive_write_lzop_open;
155
+ f->options = archive_write_lzop_options;
156
+ f->write = archive_write_lzop_write;
157
+ f->close = archive_write_lzop_close;
158
+ f->free = archive_write_lzop_free;
159
+ #if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H)
160
+ if (lzo_init() != LZO_E_OK) {
161
+ free(data);
162
+ archive_set_error(_a, ARCHIVE_ERRNO_MISC,
163
+ "lzo_init(type check) failed");
164
+ return (ARCHIVE_FATAL);
165
+ }
166
+ if (lzo_version() < 0x940) {
167
+ free(data);
168
+ archive_set_error(_a, ARCHIVE_ERRNO_MISC,
169
+ "liblzo library is too old(%s < 0.940)",
170
+ lzo_version_string());
171
+ return (ARCHIVE_FATAL);
172
+ }
173
+ data->compression_level = 5;
174
+ return (ARCHIVE_OK);
175
+ #else
176
+ data->pdata = __archive_write_program_allocate("lzop");
177
+ if (data->pdata == NULL) {
178
+ free(data);
179
+ archive_set_error(_a, ENOMEM, "Can't allocate memory");
180
+ return (ARCHIVE_FATAL);
181
+ }
182
+ data->compression_level = 0;
183
+ /* Note: We return "warn" to inform of using an external lzop
184
+ * program. */
185
+ archive_set_error(_a, ARCHIVE_ERRNO_MISC,
186
+ "Using external lzop program for lzop compression");
187
+ return (ARCHIVE_WARN);
188
+ #endif
189
+ }
190
+
191
+ static int
192
+ archive_write_lzop_free(struct archive_write_filter *f)
193
+ {
194
+ struct write_lzop *data = (struct write_lzop *)f->data;
195
+
196
+ #if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H)
197
+ free(data->uncompressed);
198
+ free(data->compressed);
199
+ free(data->work_buffer);
200
+ #else
201
+ __archive_write_program_free(data->pdata);
202
+ #endif
203
+ free(data);
204
+ return (ARCHIVE_OK);
205
+ }
206
+
207
+ static int
208
+ archive_write_lzop_options(struct archive_write_filter *f, const char *key,
209
+ const char *value)
210
+ {
211
+ struct write_lzop *data = (struct write_lzop *)f->data;
212
+
213
+ if (strcmp(key, "compression-level") == 0) {
214
+ if (value == NULL || !(value[0] >= '1' && value[0] <= '9') ||
215
+ value[1] != '\0')
216
+ return (ARCHIVE_WARN);
217
+ data->compression_level = value[0] - '0';
218
+ return (ARCHIVE_OK);
219
+ }
220
+ /* Note: The "warn" return is just to inform the options
221
+ * supervisor that we didn't handle it. It will generate
222
+ * a suitable error if no one used this option. */
223
+ return (ARCHIVE_WARN);
224
+ }
225
+
226
+ #if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H)
227
+ static int
228
+ archive_write_lzop_open(struct archive_write_filter *f)
229
+ {
230
+ struct write_lzop *data = (struct write_lzop *)f->data;
231
+
232
+ switch (data->compression_level) {
233
+ case 1:
234
+ data->method = METHOD_LZO1X_1_15; data->level = 1; break;
235
+ default:
236
+ case 2: case 3: case 4: case 5: case 6:
237
+ data->method = METHOD_LZO1X_1; data->level = 5; break;
238
+ case 7:
239
+ data->method = METHOD_LZO1X_999; data->level = 7; break;
240
+ case 8:
241
+ data->method = METHOD_LZO1X_999; data->level = 8; break;
242
+ case 9:
243
+ data->method = METHOD_LZO1X_999; data->level = 9; break;
244
+ }
245
+ switch (data->method) {
246
+ case METHOD_LZO1X_1:
247
+ data->work_buffer_size = LZO1X_1_MEM_COMPRESS; break;
248
+ case METHOD_LZO1X_1_15:
249
+ data->work_buffer_size = LZO1X_1_15_MEM_COMPRESS; break;
250
+ case METHOD_LZO1X_999:
251
+ data->work_buffer_size = LZO1X_999_MEM_COMPRESS; break;
252
+ }
253
+ if (data->work_buffer == NULL) {
254
+ data->work_buffer = (lzo_voidp)malloc(data->work_buffer_size);
255
+ if (data->work_buffer == NULL) {
256
+ archive_set_error(f->archive, ENOMEM,
257
+ "Can't allocate data for compression buffer");
258
+ return (ARCHIVE_FATAL);
259
+ }
260
+ }
261
+ if (data->compressed == NULL) {
262
+ data->compressed_buffer_size = sizeof(header) +
263
+ BLOCK_SIZE + (BLOCK_SIZE >> 4) + 64 + 3;
264
+ data->compressed = (unsigned char *)
265
+ malloc(data->compressed_buffer_size);
266
+ if (data->compressed == NULL) {
267
+ archive_set_error(f->archive, ENOMEM,
268
+ "Can't allocate data for compression buffer");
269
+ return (ARCHIVE_FATAL);
270
+ }
271
+ }
272
+ if (data->uncompressed == NULL) {
273
+ data->uncompressed_buffer_size = BLOCK_SIZE;
274
+ data->uncompressed = (unsigned char *)
275
+ malloc(data->uncompressed_buffer_size);
276
+ if (data->uncompressed == NULL) {
277
+ archive_set_error(f->archive, ENOMEM,
278
+ "Can't allocate data for compression buffer");
279
+ return (ARCHIVE_FATAL);
280
+ }
281
+ data->uncompressed_avail_bytes = BLOCK_SIZE;
282
+ }
283
+ return (ARCHIVE_OK);
284
+ }
285
+
286
+ static int
287
+ make_header(struct archive_write_filter *f)
288
+ {
289
+ struct write_lzop *data = (struct write_lzop *)f->data;
290
+ int64_t t;
291
+ uint32_t checksum;
292
+
293
+ memcpy(data->compressed, header, sizeof(header));
294
+ /* Overwrite library version. */
295
+ data->compressed[HEADER_LIBVERSION] = (unsigned char )
296
+ (lzo_version() >> 8) & 0xff;
297
+ data->compressed[HEADER_LIBVERSION + 1] = (unsigned char )
298
+ lzo_version() & 0xff;
299
+ /* Overwrite method and level. */
300
+ data->compressed[HEADER_METHOD] = (unsigned char)data->method;
301
+ data->compressed[HEADER_LEVEL] = data->level;
302
+ /* Overwrite mtime with current time. */
303
+ t = (int64_t)time(NULL);
304
+ archive_be32enc(&data->compressed[HEADER_MTIME_LOW],
305
+ (uint32_t)(t & 0xffffffff));
306
+ archive_be32enc(&data->compressed[HEADER_MTIME_HIGH],
307
+ (uint32_t)((t >> 32) & 0xffffffff));
308
+ /* Overwrite header checksum with calculated value. */
309
+ checksum = lzo_adler32(1, data->compressed + HEADER_VERSION,
310
+ (lzo_uint)(HEADER_H_CHECKSUM - HEADER_VERSION));
311
+ archive_be32enc(&data->compressed[HEADER_H_CHECKSUM], checksum);
312
+ return (sizeof(header));
313
+ }
314
+
315
+ static int
316
+ drive_compressor(struct archive_write_filter *f)
317
+ {
318
+ struct write_lzop *data = (struct write_lzop *)f->data;
319
+ unsigned char *p;
320
+ const int block_info_bytes = 12;
321
+ int header_bytes, r;
322
+ lzo_uint usize, csize;
323
+ uint32_t checksum;
324
+
325
+ if (!data->header_written) {
326
+ header_bytes = make_header(f);
327
+ data->header_written = 1;
328
+ } else
329
+ header_bytes = 0;
330
+ p = data->compressed;
331
+
332
+ usize = (lzo_uint)
333
+ (data->uncompressed_buffer_size - data->uncompressed_avail_bytes);
334
+ csize = 0;
335
+ switch (data->method) {
336
+ default:
337
+ case METHOD_LZO1X_1:
338
+ r = lzo1x_1_compress(data->uncompressed, usize,
339
+ p + header_bytes + block_info_bytes, &csize,
340
+ data->work_buffer);
341
+ break;
342
+ case METHOD_LZO1X_1_15:
343
+ r = lzo1x_1_15_compress(data->uncompressed, usize,
344
+ p + header_bytes + block_info_bytes, &csize,
345
+ data->work_buffer);
346
+ break;
347
+ case METHOD_LZO1X_999:
348
+ r = lzo1x_999_compress_level(data->uncompressed, usize,
349
+ p + header_bytes + block_info_bytes, &csize,
350
+ data->work_buffer, NULL, 0, 0, data->level);
351
+ break;
352
+ }
353
+ if (r != LZO_E_OK) {
354
+ archive_set_error(f->archive, ARCHIVE_ERRNO_MISC,
355
+ "Lzop compression failed: returned status %d", r);
356
+ return (ARCHIVE_FATAL);
357
+ }
358
+
359
+ /* Store uncompressed size. */
360
+ archive_be32enc(p + header_bytes, (uint32_t)usize);
361
+ /* Store the checksum of the uncompressed data. */
362
+ checksum = lzo_adler32(1, data->uncompressed, usize);
363
+ archive_be32enc(p + header_bytes + 8, checksum);
364
+
365
+ if (csize < usize) {
366
+ /* Store compressed size. */
367
+ archive_be32enc(p + header_bytes + 4, (uint32_t)csize);
368
+ r = __archive_write_filter(f->next_filter, data->compressed,
369
+ header_bytes + block_info_bytes + csize);
370
+ } else {
371
+ /*
372
+ * This case, we output uncompressed data instead.
373
+ */
374
+ /* Store uncompressed size as compressed size. */
375
+ archive_be32enc(p + header_bytes + 4, (uint32_t)usize);
376
+ r = __archive_write_filter(f->next_filter, data->compressed,
377
+ header_bytes + block_info_bytes);
378
+ if (r != ARCHIVE_OK)
379
+ return (ARCHIVE_FATAL);
380
+ r = __archive_write_filter(f->next_filter, data->uncompressed,
381
+ usize);
382
+ }
383
+
384
+ if (r != ARCHIVE_OK)
385
+ return (ARCHIVE_FATAL);
386
+ return (ARCHIVE_OK);
387
+ }
388
+
389
+ static int
390
+ archive_write_lzop_write(struct archive_write_filter *f,
391
+ const void *buff, size_t length)
392
+ {
393
+ struct write_lzop *data = (struct write_lzop *)f->data;
394
+ const char *p = buff;
395
+ int r;
396
+
397
+ do {
398
+ if (data->uncompressed_avail_bytes > length) {
399
+ memcpy(data->uncompressed
400
+ + data->uncompressed_buffer_size
401
+ - data->uncompressed_avail_bytes,
402
+ p, length);
403
+ data->uncompressed_avail_bytes -= length;
404
+ return (ARCHIVE_OK);
405
+ }
406
+
407
+ memcpy(data->uncompressed + data->uncompressed_buffer_size
408
+ - data->uncompressed_avail_bytes,
409
+ p, data->uncompressed_avail_bytes);
410
+ length -= data->uncompressed_avail_bytes;
411
+ p += data->uncompressed_avail_bytes;
412
+ data->uncompressed_avail_bytes = 0;
413
+
414
+ r = drive_compressor(f);
415
+ if (r != ARCHIVE_OK) return (r);
416
+ data->uncompressed_avail_bytes = BLOCK_SIZE;
417
+ } while (length);
418
+
419
+ return (ARCHIVE_OK);
420
+ }
421
+
422
+ static int
423
+ archive_write_lzop_close(struct archive_write_filter *f)
424
+ {
425
+ struct write_lzop *data = (struct write_lzop *)f->data;
426
+ const uint32_t endmark = 0;
427
+ int r;
428
+
429
+ if (data->uncompressed_avail_bytes < BLOCK_SIZE) {
430
+ /* Compress and output remaining data. */
431
+ r = drive_compressor(f);
432
+ if (r != ARCHIVE_OK)
433
+ return (r);
434
+ }
435
+ /* Write a zero uncompressed size as the end mark of the series of
436
+ * compressed block. */
437
+ return __archive_write_filter(f->next_filter, &endmark, sizeof(endmark));
438
+ }
439
+
440
+ #else
441
+ static int
442
+ archive_write_lzop_open(struct archive_write_filter *f)
443
+ {
444
+ struct write_lzop *data = (struct write_lzop *)f->data;
445
+ struct archive_string as;
446
+ int r;
447
+
448
+ archive_string_init(&as);
449
+ archive_strcpy(&as, "lzop");
450
+ /* Specify compression level. */
451
+ if (data->compression_level > 0) {
452
+ archive_strappend_char(&as, ' ');
453
+ archive_strappend_char(&as, '-');
454
+ archive_strappend_char(&as, '0' + data->compression_level);
455
+ }
456
+
457
+ r = __archive_write_program_open(f, data->pdata, as.s);
458
+ archive_string_free(&as);
459
+ return (r);
460
+ }
461
+
462
+ static int
463
+ archive_write_lzop_write(struct archive_write_filter *f,
464
+ const void *buff, size_t length)
465
+ {
466
+ struct write_lzop *data = (struct write_lzop *)f->data;
467
+
468
+ return __archive_write_program_write(f, data->pdata, buff, length);
469
+ }
470
+
471
+ static int
472
+ archive_write_lzop_close(struct archive_write_filter *f)
473
+ {
474
+ struct write_lzop *data = (struct write_lzop *)f->data;
475
+
476
+ return __archive_write_program_close(f, data->pdata);
477
+ }
478
+ #endif
@@ -1,5 +1,5 @@
1
1
  /*-
2
- * Copyright (c) 2003-2007 Tim Kientzle
2
+ * Copyright (c) 2003-2010 Tim Kientzle
3
3
  * All rights reserved.
4
4
  *
5
5
  * Redistribution and use in source and binary forms, with or without
@@ -24,20 +24,20 @@
24
24
  */
25
25
 
26
26
  #include "archive_platform.h"
27
- __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_all.c 174991 2007-12-30 04:58:22Z kientzle $");
27
+ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_none.c 201080 2009-12-28 02:03:54Z kientzle $");
28
28
 
29
29
  #include "archive.h"
30
30
 
31
31
  int
32
- archive_read_support_format_all(struct archive *a)
32
+ archive_write_set_compression_none(struct archive *a)
33
33
  {
34
- archive_read_support_format_ar(a);
35
- archive_read_support_format_cpio(a);
36
- archive_read_support_format_empty(a);
37
- archive_read_support_format_iso9660(a);
38
- archive_read_support_format_mtree(a);
39
- archive_read_support_format_tar(a);
40
- archive_read_support_format_xar(a);
41
- archive_read_support_format_zip(a);
34
+ (void)a; /* UNUSED */
35
+ return (ARCHIVE_OK);
36
+ }
37
+
38
+ int
39
+ archive_write_add_filter_none(struct archive *a)
40
+ {
41
+ (void)a; /* UNUSED */
42
42
  return (ARCHIVE_OK);
43
43
  }