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.
Files changed (295) hide show
  1. checksums.yaml +4 -4
  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_reader.c +6 -4
  20. data/ext/libarchive-0.1.1/ext/libarchive_reader.o +0 -0
  21. data/ext/libarchive-0.1.1/ext/libarchive_ruby.so +0 -0
  22. data/ext/libarchive-0.1.1/ext/libarchive_win32.h +1 -1
  23. data/ext/libarchive-0.1.1/ext/libarchive_writer.c +2 -2
  24. data/ext/libarchive-0.1.1/ext/libarchive_writer.o +0 -0
  25. data/ext/libarchive-3.6.2/Makefile.in +16892 -0
  26. data/ext/libarchive-3.6.2/build/autoconf/ax_append_compile_flags.m4 +67 -0
  27. data/ext/libarchive-3.6.2/build/autoconf/ax_append_flag.m4 +71 -0
  28. data/ext/libarchive-3.6.2/build/autoconf/ax_check_compile_flag.m4 +74 -0
  29. data/ext/libarchive-3.6.2/build/autoconf/ax_require_defined.m4 +37 -0
  30. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/check_stdcall_func.m4 +0 -0
  31. data/ext/libarchive-3.6.2/build/autoconf/compile +348 -0
  32. data/ext/libarchive-3.6.2/build/autoconf/config.guess +1754 -0
  33. data/ext/libarchive-3.6.2/build/autoconf/config.rpath +696 -0
  34. data/ext/libarchive-3.6.2/build/autoconf/config.sub +1890 -0
  35. data/ext/libarchive-3.6.2/build/autoconf/depcomp +791 -0
  36. data/ext/libarchive-3.6.2/build/autoconf/iconv.m4 +271 -0
  37. data/ext/libarchive-3.6.2/build/autoconf/install-sh +541 -0
  38. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/la_uid_t.m4 +0 -0
  39. data/ext/libarchive-3.6.2/build/autoconf/lib-ld.m4 +109 -0
  40. data/ext/libarchive-3.6.2/build/autoconf/lib-link.m4 +777 -0
  41. data/ext/libarchive-3.6.2/build/autoconf/lib-prefix.m4 +224 -0
  42. data/ext/libarchive-3.6.2/build/autoconf/ltmain.sh +11251 -0
  43. data/ext/libarchive-3.6.2/build/autoconf/m4_ax_compile_check_sizeof.m4 +115 -0
  44. data/ext/libarchive-3.6.2/build/autoconf/missing +215 -0
  45. data/ext/libarchive-3.6.2/build/autoconf/test-driver +153 -0
  46. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/pkgconfig/libarchive.pc.in +4 -1
  47. data/ext/libarchive-3.6.2/config.h.in +1504 -0
  48. data/ext/libarchive-3.6.2/configure +25558 -0
  49. data/ext/libarchive-3.6.2/libarchive/archive.h +1212 -0
  50. data/ext/libarchive-3.6.2/libarchive/archive_acl.c +2097 -0
  51. data/ext/libarchive-3.6.2/libarchive/archive_acl_private.h +83 -0
  52. data/ext/libarchive-3.6.2/libarchive/archive_blake2.h +197 -0
  53. data/ext/libarchive-3.6.2/libarchive/archive_blake2_impl.h +161 -0
  54. data/ext/libarchive-3.6.2/libarchive/archive_blake2s_ref.c +369 -0
  55. data/ext/libarchive-3.6.2/libarchive/archive_blake2sp_ref.c +361 -0
  56. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_check_magic.c +63 -22
  57. data/ext/libarchive-3.6.2/libarchive/archive_cmdline.c +227 -0
  58. data/ext/libarchive-3.6.2/libarchive/archive_cmdline_private.h +47 -0
  59. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_crc32.h +17 -0
  60. data/ext/libarchive-3.6.2/libarchive/archive_cryptor.c +534 -0
  61. data/ext/libarchive-3.6.2/libarchive/archive_cryptor_private.h +188 -0
  62. data/ext/libarchive-3.6.2/libarchive/archive_digest.c +1505 -0
  63. data/ext/libarchive-3.6.2/libarchive/archive_digest_private.h +416 -0
  64. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_darwin.c +559 -0
  65. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_freebsd.c +712 -0
  66. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_linux.c +760 -0
  67. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_sunos.c +824 -0
  68. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_endian.h +48 -15
  69. data/ext/libarchive-3.6.2/libarchive/archive_entry.c +2149 -0
  70. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry.h +305 -106
  71. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_bhfi.c +5 -4
  72. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_stat.c +9 -3
  73. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_link_resolver.c +104 -62
  74. data/ext/libarchive-3.6.2/libarchive/archive_entry_locale.h +92 -0
  75. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_private.h +65 -49
  76. data/ext/libarchive-3.6.2/libarchive/archive_entry_sparse.c +156 -0
  77. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_stat.c +6 -6
  78. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_strmode.c +1 -1
  79. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_xattr.c +4 -6
  80. data/ext/libarchive-3.6.2/libarchive/archive_getdate.c +1165 -0
  81. data/ext/libarchive-3.6.2/libarchive/archive_getdate.h +39 -0
  82. data/ext/libarchive-3.6.2/libarchive/archive_hmac.c +334 -0
  83. data/ext/libarchive-3.6.2/libarchive/archive_hmac_private.h +117 -0
  84. data/ext/libarchive-3.6.2/libarchive/archive_match.c +1875 -0
  85. data/ext/libarchive-3.6.2/libarchive/archive_openssl_evp_private.h +53 -0
  86. data/ext/libarchive-3.6.2/libarchive/archive_openssl_hmac_private.h +54 -0
  87. data/ext/libarchive-3.6.2/libarchive/archive_options.c +218 -0
  88. data/ext/libarchive-3.6.2/libarchive/archive_options_private.h +51 -0
  89. data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.c +337 -0
  90. data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.h +49 -0
  91. data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.c +463 -0
  92. data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.h +52 -0
  93. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_platform.h +77 -9
  94. data/ext/libarchive-3.6.2/libarchive/archive_platform_acl.h +55 -0
  95. data/ext/libarchive-3.6.2/libarchive/archive_platform_xattr.h +47 -0
  96. data/ext/libarchive-3.6.2/libarchive/archive_ppmd7.c +1168 -0
  97. data/ext/libarchive-3.6.2/libarchive/archive_ppmd7_private.h +119 -0
  98. data/ext/libarchive-3.6.2/libarchive/archive_ppmd8.c +1287 -0
  99. data/ext/libarchive-3.6.2/libarchive/archive_ppmd8_private.h +148 -0
  100. data/ext/libarchive-3.6.2/libarchive/archive_ppmd_private.h +151 -0
  101. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_private.h +74 -18
  102. data/ext/libarchive-3.6.2/libarchive/archive_random.c +272 -0
  103. data/ext/libarchive-3.6.2/libarchive/archive_random_private.h +36 -0
  104. data/ext/libarchive-3.6.2/libarchive/archive_rb.c +709 -0
  105. data/ext/libarchive-3.6.2/libarchive/archive_rb.h +113 -0
  106. data/ext/libarchive-3.6.2/libarchive/archive_read.c +1756 -0
  107. data/ext/libarchive-3.6.2/libarchive/archive_read_add_passphrase.c +190 -0
  108. data/ext/libarchive-3.6.2/libarchive/archive_read_append_filter.c +204 -0
  109. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_data_into_fd.c +64 -18
  110. data/ext/libarchive-3.6.2/libarchive/archive_read_disk_entry_from_file.c +1086 -0
  111. data/ext/libarchive-3.6.2/libarchive/archive_read_disk_posix.c +2732 -0
  112. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_private.h +40 -4
  113. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_set_standard_lookup.c +21 -11
  114. data/ext/libarchive-3.6.2/libarchive/archive_read_disk_windows.c +2479 -0
  115. data/ext/libarchive-3.6.2/libarchive/archive_read_extract.c +60 -0
  116. data/ext/{libarchive-2.8.4/libarchive/archive_read_extract.c → libarchive-3.6.2/libarchive/archive_read_extract2.c} +34 -61
  117. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_fd.c +70 -49
  118. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_file.c +38 -23
  119. data/ext/libarchive-3.6.2/libarchive/archive_read_open_filename.c +586 -0
  120. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_memory.c +58 -28
  121. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_private.h +127 -59
  122. data/ext/libarchive-3.6.2/libarchive/archive_read_set_format.c +117 -0
  123. data/ext/libarchive-3.6.2/libarchive/archive_read_set_options.c +133 -0
  124. 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
  125. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_by_code.c +83 -0
  126. 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
  127. 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
  128. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_grzip.c +112 -0
  129. 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
  130. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lrzip.c +122 -0
  131. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lz4.c +742 -0
  132. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lzop.c +499 -0
  133. 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
  134. 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
  135. 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
  136. 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
  137. 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
  138. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_zstd.c +297 -0
  139. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_7zip.c +3900 -0
  140. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_all.c +89 -0
  141. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_ar.c +126 -72
  142. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_by_code.c +92 -0
  143. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cab.c +3228 -0
  144. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cpio.c +1104 -0
  145. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_empty.c +14 -11
  146. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_iso9660.c +990 -541
  147. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_lha.c +2916 -0
  148. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_mtree.c +2150 -0
  149. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar.c +3797 -0
  150. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar5.c +4251 -0
  151. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_raw.c +38 -31
  152. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_tar.c +1157 -629
  153. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_warc.c +848 -0
  154. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_xar.c +439 -258
  155. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_zip.c +4270 -0
  156. data/ext/libarchive-3.6.2/libarchive/archive_string.c +4240 -0
  157. data/ext/libarchive-3.6.2/libarchive/archive_string.h +243 -0
  158. data/ext/libarchive-3.6.2/libarchive/archive_string_composition.h +2292 -0
  159. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_string_sprintf.c +44 -16
  160. data/ext/libarchive-3.6.2/libarchive/archive_util.c +655 -0
  161. data/ext/libarchive-3.6.2/libarchive/archive_version_details.c +151 -0
  162. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_virtual.c +85 -16
  163. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.c +214 -541
  164. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.h +74 -106
  165. data/ext/libarchive-3.6.2/libarchive/archive_write.c +828 -0
  166. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter.c +72 -0
  167. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_b64encode.c +304 -0
  168. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_by_name.c +77 -0
  169. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_bzip2.c +401 -0
  170. 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
  171. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_grzip.c +135 -0
  172. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_gzip.c +442 -0
  173. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lrzip.c +197 -0
  174. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lz4.c +700 -0
  175. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lzop.c +478 -0
  176. 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
  177. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_program.c +391 -0
  178. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_uuencode.c +295 -0
  179. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_xz.c +545 -0
  180. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_zstd.c +418 -0
  181. data/ext/libarchive-3.6.2/libarchive/archive_write_disk_posix.c +4711 -0
  182. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_private.h +9 -2
  183. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_set_standard_lookup.c +30 -29
  184. data/ext/libarchive-3.6.2/libarchive/archive_write_disk_windows.c +2842 -0
  185. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_fd.c +15 -10
  186. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_file.c +15 -9
  187. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_filename.c +128 -20
  188. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_memory.c +7 -18
  189. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_private.h +72 -29
  190. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format.c +56 -3
  191. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_7zip.c +2322 -0
  192. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ar.c +54 -34
  193. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_by_name.c +20 -2
  194. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio.c +11 -0
  195. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_binary.c +610 -0
  196. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_newc.c +457 -0
  197. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_odc.c +500 -0
  198. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_filter_by_ext.c +142 -0
  199. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_gnutar.c +755 -0
  200. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_iso9660.c +8165 -0
  201. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_mtree.c +2217 -0
  202. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_pax.c +1049 -387
  203. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_private.h +42 -0
  204. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_raw.c +125 -0
  205. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_shar.c +62 -47
  206. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ustar.c +279 -108
  207. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_v7tar.c +638 -0
  208. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_warc.c +453 -0
  209. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_xar.c +3259 -0
  210. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_zip.c +1704 -0
  211. data/ext/libarchive-3.6.2/libarchive/archive_write_set_options.c +130 -0
  212. data/ext/libarchive-3.6.2/libarchive/archive_write_set_passphrase.c +95 -0
  213. data/ext/libarchive-3.6.2/libarchive/archive_xxhash.h +48 -0
  214. data/ext/libarchive-3.6.2/libarchive/config_freebsd.h +271 -0
  215. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/filter_fork.h +10 -5
  216. data/ext/{libarchive-2.8.4/libarchive/filter_fork.c → libarchive-3.6.2/libarchive/filter_fork_posix.c} +98 -19
  217. data/ext/libarchive-3.6.2/libarchive/filter_fork_windows.c +236 -0
  218. data/ext/libarchive-3.6.2/libarchive/xxhash.c +525 -0
  219. data/ext/libarchive-static-makefile +144 -80
  220. data/ext/libarchive-static-wrapper-makefile +1 -1
  221. data/ext/zlib-1.2.13/Makefile.in +404 -0
  222. data/ext/{zlib-1.2.5 → zlib-1.2.13}/adler32.c +51 -34
  223. data/ext/{zlib-1.2.5 → zlib-1.2.13}/compress.c +27 -21
  224. data/ext/zlib-1.2.13/configure +922 -0
  225. data/ext/zlib-1.2.13/crc32.c +1125 -0
  226. data/ext/zlib-1.2.13/crc32.h +9446 -0
  227. data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.c +842 -459
  228. data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.h +37 -33
  229. data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzclose.c +0 -0
  230. data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzguts.h +103 -16
  231. data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzlib.c +155 -53
  232. data/ext/zlib-1.2.13/gzread.c +650 -0
  233. data/ext/zlib-1.2.13/gzwrite.c +677 -0
  234. data/ext/{zlib-1.2.5 → zlib-1.2.13}/infback.c +24 -12
  235. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.c +49 -66
  236. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.h +0 -0
  237. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffixed.h +3 -3
  238. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.c +209 -94
  239. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.h +9 -5
  240. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.c +24 -50
  241. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.h +1 -1
  242. data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.c +135 -198
  243. data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.h +0 -0
  244. data/ext/zlib-1.2.13/uncompr.c +93 -0
  245. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zconf.h +182 -63
  246. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zlib.h +617 -295
  247. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.c +50 -41
  248. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.h +83 -82
  249. metadata +241 -133
  250. data/ext/libarchive-0.1.1/libarchive.c +0 -1762
  251. data/ext/libarchive-2.8.4/Makefile.in +0 -7076
  252. data/ext/libarchive-2.8.4/build/autoconf/compile +0 -143
  253. data/ext/libarchive-2.8.4/build/autoconf/config.guess +0 -1502
  254. data/ext/libarchive-2.8.4/build/autoconf/config.sub +0 -1708
  255. data/ext/libarchive-2.8.4/build/autoconf/depcomp +0 -630
  256. data/ext/libarchive-2.8.4/build/autoconf/install-sh +0 -291
  257. data/ext/libarchive-2.8.4/build/autoconf/ltmain.sh +0 -8406
  258. data/ext/libarchive-2.8.4/build/autoconf/missing +0 -376
  259. data/ext/libarchive-2.8.4/config.h.in +0 -772
  260. data/ext/libarchive-2.8.4/configure +0 -17916
  261. data/ext/libarchive-2.8.4/libarchive/archive.h +0 -741
  262. data/ext/libarchive-2.8.4/libarchive/archive_entry.c +0 -2202
  263. data/ext/libarchive-2.8.4/libarchive/archive_hash.h +0 -281
  264. data/ext/libarchive-2.8.4/libarchive/archive_read.c +0 -1249
  265. data/ext/libarchive-2.8.4/libarchive/archive_read_disk.c +0 -198
  266. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_entry_from_file.c +0 -570
  267. data/ext/libarchive-2.8.4/libarchive/archive_read_open_filename.c +0 -272
  268. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_cpio.c +0 -777
  269. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_mtree.c +0 -1304
  270. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_zip.c +0 -903
  271. data/ext/libarchive-2.8.4/libarchive/archive_string.c +0 -453
  272. data/ext/libarchive-2.8.4/libarchive/archive_string.h +0 -148
  273. data/ext/libarchive-2.8.4/libarchive/archive_util.c +0 -391
  274. data/ext/libarchive-2.8.4/libarchive/archive_write.c +0 -466
  275. data/ext/libarchive-2.8.4/libarchive/archive_write_disk.c +0 -2628
  276. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_bzip2.c +0 -408
  277. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_gzip.c +0 -477
  278. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_none.c +0 -257
  279. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_program.c +0 -347
  280. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_xz.c +0 -438
  281. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio.c +0 -344
  282. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio_newc.c +0 -295
  283. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_mtree.c +0 -1050
  284. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_zip.c +0 -667
  285. data/ext/libarchive-2.8.4/libarchive/config_freebsd.h +0 -154
  286. data/ext/libarchive-2.8.4/libarchive/filter_fork_windows.c +0 -113
  287. data/ext/zlib-1.2.5/Makefile.in +0 -257
  288. data/ext/zlib-1.2.5/configure +0 -596
  289. data/ext/zlib-1.2.5/crc32.c +0 -442
  290. data/ext/zlib-1.2.5/crc32.h +0 -441
  291. data/ext/zlib-1.2.5/example.c +0 -565
  292. data/ext/zlib-1.2.5/gzread.c +0 -653
  293. data/ext/zlib-1.2.5/gzwrite.c +0 -531
  294. data/ext/zlib-1.2.5/minigzip.c +0 -440
  295. data/ext/zlib-1.2.5/uncompr.c +0 -59
@@ -0,0 +1,49 @@
1
+ /* $NetBSD: pack_dev.h,v 1.8 2013/06/14 16:28:20 tsutsui Exp $ */
2
+
3
+ /*-
4
+ * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
5
+ * All rights reserved.
6
+ *
7
+ * This code is derived from software contributed to The NetBSD Foundation
8
+ * by Charles M. Hannum.
9
+ *
10
+ * Redistribution and use in source and binary forms, with or without
11
+ * modification, are permitted provided that the following conditions
12
+ * are met:
13
+ * 1. Redistributions of source code must retain the above copyright
14
+ * notice, this list of conditions and the following disclaimer.
15
+ * 2. Redistributions in binary form must reproduce the above copyright
16
+ * notice, this list of conditions and the following disclaimer in the
17
+ * documentation and/or other materials provided with the distribution.
18
+ *
19
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
+ * POSSIBILITY OF SUCH DAMAGE.
30
+ */
31
+
32
+ /* Originally from NetBSD's mknod(8) source. */
33
+
34
+ #ifndef ARCHIVE_PACK_DEV_H
35
+ #define ARCHIVE_PACK_DEV_H
36
+
37
+ typedef dev_t pack_t(int, unsigned long [], const char **);
38
+
39
+ pack_t *pack_find(const char *);
40
+ pack_t pack_native;
41
+
42
+ #define major_netbsd(x) ((int32_t)((((x) & 0x000fff00) >> 8)))
43
+ #define minor_netbsd(x) ((int32_t)((((x) & 0xfff00000) >> 12) | \
44
+ (((x) & 0x000000ff) >> 0)))
45
+ #define makedev_netbsd(x,y) ((dev_t)((((x) << 8) & 0x000fff00) | \
46
+ (((y) << 12) & 0xfff00000) | \
47
+ (((y) << 0) & 0x000000ff)))
48
+
49
+ #endif /* ARCHIVE_PACK_DEV_H */
@@ -0,0 +1,463 @@
1
+ /*-
2
+ * Copyright (c) 2003-2007 Tim Kientzle
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
+ * in this position and unchanged.
11
+ * 2. Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ *
15
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
16
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
19
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+ */
26
+
27
+ #include "archive_platform.h"
28
+ __FBSDID("$FreeBSD$");
29
+
30
+ #ifdef HAVE_STRING_H
31
+ #include <string.h>
32
+ #endif
33
+ #ifdef HAVE_WCHAR_H
34
+ #include <wchar.h>
35
+ #endif
36
+
37
+ #include "archive_pathmatch.h"
38
+
39
+ /*
40
+ * Check whether a character 'c' is matched by a list specification [...]:
41
+ * * Leading '!' or '^' negates the class.
42
+ * * <char>-<char> is a range of characters
43
+ * * \<char> removes any special meaning for <char>
44
+ *
45
+ * Some interesting boundary cases:
46
+ * a-d-e is one range (a-d) followed by two single characters - and e.
47
+ * \a-\d is same as a-d
48
+ * a\-d is three single characters: a, d, -
49
+ * Trailing - is not special (so [a-] is two characters a and -).
50
+ * Initial - is not special ([a-] is same as [-a] is same as [\\-a])
51
+ * This function never sees a trailing \.
52
+ * [] always fails
53
+ * [!] always succeeds
54
+ */
55
+ static int
56
+ pm_list(const char *start, const char *end, const char c, int flags)
57
+ {
58
+ const char *p = start;
59
+ char rangeStart = '\0', nextRangeStart;
60
+ int match = 1, nomatch = 0;
61
+
62
+ /* This will be used soon... */
63
+ (void)flags; /* UNUSED */
64
+
65
+ /* If this is a negated class, return success for nomatch. */
66
+ if ((*p == '!' || *p == '^') && p < end) {
67
+ match = 0;
68
+ nomatch = 1;
69
+ ++p;
70
+ }
71
+
72
+ while (p < end) {
73
+ nextRangeStart = '\0';
74
+ switch (*p) {
75
+ case '-':
76
+ /* Trailing or initial '-' is not special. */
77
+ if ((rangeStart == '\0') || (p == end - 1)) {
78
+ if (*p == c)
79
+ return (match);
80
+ } else {
81
+ char rangeEnd = *++p;
82
+ if (rangeEnd == '\\')
83
+ rangeEnd = *++p;
84
+ if ((rangeStart <= c) && (c <= rangeEnd))
85
+ return (match);
86
+ }
87
+ break;
88
+ case '\\':
89
+ ++p;
90
+ /* Fall through */
91
+ default:
92
+ if (*p == c)
93
+ return (match);
94
+ nextRangeStart = *p; /* Possible start of range. */
95
+ }
96
+ rangeStart = nextRangeStart;
97
+ ++p;
98
+ }
99
+ return (nomatch);
100
+ }
101
+
102
+ static int
103
+ pm_list_w(const wchar_t *start, const wchar_t *end, const wchar_t c, int flags)
104
+ {
105
+ const wchar_t *p = start;
106
+ wchar_t rangeStart = L'\0', nextRangeStart;
107
+ int match = 1, nomatch = 0;
108
+
109
+ /* This will be used soon... */
110
+ (void)flags; /* UNUSED */
111
+
112
+ /* If this is a negated class, return success for nomatch. */
113
+ if ((*p == L'!' || *p == L'^') && p < end) {
114
+ match = 0;
115
+ nomatch = 1;
116
+ ++p;
117
+ }
118
+
119
+ while (p < end) {
120
+ nextRangeStart = L'\0';
121
+ switch (*p) {
122
+ case L'-':
123
+ /* Trailing or initial '-' is not special. */
124
+ if ((rangeStart == L'\0') || (p == end - 1)) {
125
+ if (*p == c)
126
+ return (match);
127
+ } else {
128
+ wchar_t rangeEnd = *++p;
129
+ if (rangeEnd == L'\\')
130
+ rangeEnd = *++p;
131
+ if ((rangeStart <= c) && (c <= rangeEnd))
132
+ return (match);
133
+ }
134
+ break;
135
+ case L'\\':
136
+ ++p;
137
+ /* Fall through */
138
+ default:
139
+ if (*p == c)
140
+ return (match);
141
+ nextRangeStart = *p; /* Possible start of range. */
142
+ }
143
+ rangeStart = nextRangeStart;
144
+ ++p;
145
+ }
146
+ return (nomatch);
147
+ }
148
+
149
+ /*
150
+ * If s is pointing to "./", ".//", "./././" or the like, skip it.
151
+ */
152
+ static const char *
153
+ pm_slashskip(const char *s) {
154
+ while ((*s == '/')
155
+ || (s[0] == '.' && s[1] == '/')
156
+ || (s[0] == '.' && s[1] == '\0'))
157
+ ++s;
158
+ return (s);
159
+ }
160
+
161
+ static const wchar_t *
162
+ pm_slashskip_w(const wchar_t *s) {
163
+ while ((*s == L'/')
164
+ || (s[0] == L'.' && s[1] == L'/')
165
+ || (s[0] == L'.' && s[1] == L'\0'))
166
+ ++s;
167
+ return (s);
168
+ }
169
+
170
+ static int
171
+ pm(const char *p, const char *s, int flags)
172
+ {
173
+ const char *end;
174
+
175
+ /*
176
+ * Ignore leading './', './/', '././', etc.
177
+ */
178
+ if (s[0] == '.' && s[1] == '/')
179
+ s = pm_slashskip(s + 1);
180
+ if (p[0] == '.' && p[1] == '/')
181
+ p = pm_slashskip(p + 1);
182
+
183
+ for (;;) {
184
+ switch (*p) {
185
+ case '\0':
186
+ if (s[0] == '/') {
187
+ if (flags & PATHMATCH_NO_ANCHOR_END)
188
+ return (1);
189
+ /* "dir" == "dir/" == "dir/." */
190
+ s = pm_slashskip(s);
191
+ }
192
+ return (*s == '\0');
193
+ case '?':
194
+ /* ? always succeeds, unless we hit end of 's' */
195
+ if (*s == '\0')
196
+ return (0);
197
+ break;
198
+ case '*':
199
+ /* "*" == "**" == "***" ... */
200
+ while (*p == '*')
201
+ ++p;
202
+ /* Trailing '*' always succeeds. */
203
+ if (*p == '\0')
204
+ return (1);
205
+ while (*s) {
206
+ if (archive_pathmatch(p, s, flags))
207
+ return (1);
208
+ ++s;
209
+ }
210
+ return (0);
211
+ case '[':
212
+ /*
213
+ * Find the end of the [...] character class,
214
+ * ignoring \] that might occur within the class.
215
+ */
216
+ end = p + 1;
217
+ while (*end != '\0' && *end != ']') {
218
+ if (*end == '\\' && end[1] != '\0')
219
+ ++end;
220
+ ++end;
221
+ }
222
+ if (*end == ']') {
223
+ /* We found [...], try to match it. */
224
+ if (!pm_list(p + 1, end, *s, flags))
225
+ return (0);
226
+ p = end; /* Jump to trailing ']' char. */
227
+ break;
228
+ } else
229
+ /* No final ']', so just match '['. */
230
+ if (*p != *s)
231
+ return (0);
232
+ break;
233
+ case '\\':
234
+ /* Trailing '\\' matches itself. */
235
+ if (p[1] == '\0') {
236
+ if (*s != '\\')
237
+ return (0);
238
+ } else {
239
+ ++p;
240
+ if (*p != *s)
241
+ return (0);
242
+ }
243
+ break;
244
+ case '/':
245
+ if (*s != '/' && *s != '\0')
246
+ return (0);
247
+ /* Note: pattern "/\./" won't match "/";
248
+ * pm_slashskip() correctly stops at backslash. */
249
+ p = pm_slashskip(p);
250
+ s = pm_slashskip(s);
251
+ if (*p == '\0' && (flags & PATHMATCH_NO_ANCHOR_END))
252
+ return (1);
253
+ --p; /* Counteract the increment below. */
254
+ --s;
255
+ break;
256
+ case '$':
257
+ /* '$' is special only at end of pattern and only
258
+ * if PATHMATCH_NO_ANCHOR_END is specified. */
259
+ if (p[1] == '\0' && (flags & PATHMATCH_NO_ANCHOR_END)){
260
+ /* "dir" == "dir/" == "dir/." */
261
+ return (*pm_slashskip(s) == '\0');
262
+ }
263
+ /* Otherwise, '$' is not special. */
264
+ /* FALL THROUGH */
265
+ default:
266
+ if (*p != *s)
267
+ return (0);
268
+ break;
269
+ }
270
+ ++p;
271
+ ++s;
272
+ }
273
+ }
274
+
275
+ static int
276
+ pm_w(const wchar_t *p, const wchar_t *s, int flags)
277
+ {
278
+ const wchar_t *end;
279
+
280
+ /*
281
+ * Ignore leading './', './/', '././', etc.
282
+ */
283
+ if (s[0] == L'.' && s[1] == L'/')
284
+ s = pm_slashskip_w(s + 1);
285
+ if (p[0] == L'.' && p[1] == L'/')
286
+ p = pm_slashskip_w(p + 1);
287
+
288
+ for (;;) {
289
+ switch (*p) {
290
+ case L'\0':
291
+ if (s[0] == L'/') {
292
+ if (flags & PATHMATCH_NO_ANCHOR_END)
293
+ return (1);
294
+ /* "dir" == "dir/" == "dir/." */
295
+ s = pm_slashskip_w(s);
296
+ }
297
+ return (*s == L'\0');
298
+ case L'?':
299
+ /* ? always succeeds, unless we hit end of 's' */
300
+ if (*s == L'\0')
301
+ return (0);
302
+ break;
303
+ case L'*':
304
+ /* "*" == "**" == "***" ... */
305
+ while (*p == L'*')
306
+ ++p;
307
+ /* Trailing '*' always succeeds. */
308
+ if (*p == L'\0')
309
+ return (1);
310
+ while (*s) {
311
+ if (archive_pathmatch_w(p, s, flags))
312
+ return (1);
313
+ ++s;
314
+ }
315
+ return (0);
316
+ case L'[':
317
+ /*
318
+ * Find the end of the [...] character class,
319
+ * ignoring \] that might occur within the class.
320
+ */
321
+ end = p + 1;
322
+ while (*end != L'\0' && *end != L']') {
323
+ if (*end == L'\\' && end[1] != L'\0')
324
+ ++end;
325
+ ++end;
326
+ }
327
+ if (*end == L']') {
328
+ /* We found [...], try to match it. */
329
+ if (!pm_list_w(p + 1, end, *s, flags))
330
+ return (0);
331
+ p = end; /* Jump to trailing ']' char. */
332
+ break;
333
+ } else
334
+ /* No final ']', so just match '['. */
335
+ if (*p != *s)
336
+ return (0);
337
+ break;
338
+ case L'\\':
339
+ /* Trailing '\\' matches itself. */
340
+ if (p[1] == L'\0') {
341
+ if (*s != L'\\')
342
+ return (0);
343
+ } else {
344
+ ++p;
345
+ if (*p != *s)
346
+ return (0);
347
+ }
348
+ break;
349
+ case L'/':
350
+ if (*s != L'/' && *s != L'\0')
351
+ return (0);
352
+ /* Note: pattern "/\./" won't match "/";
353
+ * pm_slashskip() correctly stops at backslash. */
354
+ p = pm_slashskip_w(p);
355
+ s = pm_slashskip_w(s);
356
+ if (*p == L'\0' && (flags & PATHMATCH_NO_ANCHOR_END))
357
+ return (1);
358
+ --p; /* Counteract the increment below. */
359
+ --s;
360
+ break;
361
+ case L'$':
362
+ /* '$' is special only at end of pattern and only
363
+ * if PATHMATCH_NO_ANCHOR_END is specified. */
364
+ if (p[1] == L'\0' && (flags & PATHMATCH_NO_ANCHOR_END)){
365
+ /* "dir" == "dir/" == "dir/." */
366
+ return (*pm_slashskip_w(s) == L'\0');
367
+ }
368
+ /* Otherwise, '$' is not special. */
369
+ /* FALL THROUGH */
370
+ default:
371
+ if (*p != *s)
372
+ return (0);
373
+ break;
374
+ }
375
+ ++p;
376
+ ++s;
377
+ }
378
+ }
379
+
380
+ /* Main entry point. */
381
+ int
382
+ __archive_pathmatch(const char *p, const char *s, int flags)
383
+ {
384
+ /* Empty pattern only matches the empty string. */
385
+ if (p == NULL || *p == '\0')
386
+ return (s == NULL || *s == '\0');
387
+ else if (s == NULL)
388
+ return (0);
389
+
390
+ /* Leading '^' anchors the start of the pattern. */
391
+ if (*p == '^') {
392
+ ++p;
393
+ flags &= ~PATHMATCH_NO_ANCHOR_START;
394
+ }
395
+
396
+ if (*p == '/' && *s != '/')
397
+ return (0);
398
+
399
+ /* Certain patterns anchor implicitly. */
400
+ if (*p == '*' || *p == '/') {
401
+ while (*p == '/')
402
+ ++p;
403
+ while (*s == '/')
404
+ ++s;
405
+ return (pm(p, s, flags));
406
+ }
407
+
408
+ /* If start is unanchored, try to match start of each path element. */
409
+ if (flags & PATHMATCH_NO_ANCHOR_START) {
410
+ for ( ; s != NULL; s = strchr(s, '/')) {
411
+ if (*s == '/')
412
+ s++;
413
+ if (pm(p, s, flags))
414
+ return (1);
415
+ }
416
+ return (0);
417
+ }
418
+
419
+ /* Default: Match from beginning. */
420
+ return (pm(p, s, flags));
421
+ }
422
+
423
+ int
424
+ __archive_pathmatch_w(const wchar_t *p, const wchar_t *s, int flags)
425
+ {
426
+ /* Empty pattern only matches the empty string. */
427
+ if (p == NULL || *p == L'\0')
428
+ return (s == NULL || *s == L'\0');
429
+ else if (s == NULL)
430
+ return (0);
431
+
432
+ /* Leading '^' anchors the start of the pattern. */
433
+ if (*p == L'^') {
434
+ ++p;
435
+ flags &= ~PATHMATCH_NO_ANCHOR_START;
436
+ }
437
+
438
+ if (*p == L'/' && *s != L'/')
439
+ return (0);
440
+
441
+ /* Certain patterns anchor implicitly. */
442
+ if (*p == L'*' || *p == L'/') {
443
+ while (*p == L'/')
444
+ ++p;
445
+ while (*s == L'/')
446
+ ++s;
447
+ return (pm_w(p, s, flags));
448
+ }
449
+
450
+ /* If start is unanchored, try to match start of each path element. */
451
+ if (flags & PATHMATCH_NO_ANCHOR_START) {
452
+ for ( ; s != NULL; s = wcschr(s, L'/')) {
453
+ if (*s == L'/')
454
+ s++;
455
+ if (pm_w(p, s, flags))
456
+ return (1);
457
+ }
458
+ return (0);
459
+ }
460
+
461
+ /* Default: Match from beginning. */
462
+ return (pm_w(p, s, flags));
463
+ }
@@ -0,0 +1,52 @@
1
+ /*-
2
+ * Copyright (c) 2003-2007 Tim Kientzle
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
+ * in this position and unchanged.
11
+ * 2. Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ *
15
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
16
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
19
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+ *
26
+ * $FreeBSD$
27
+ */
28
+
29
+ #ifndef ARCHIVE_PATHMATCH_H
30
+ #define ARCHIVE_PATHMATCH_H
31
+
32
+ #ifndef __LIBARCHIVE_BUILD
33
+ #ifndef __LIBARCHIVE_TEST
34
+ #error This header is only to be used internally to libarchive.
35
+ #endif
36
+ #endif
37
+
38
+ /* Don't anchor at beginning unless the pattern starts with "^" */
39
+ #define PATHMATCH_NO_ANCHOR_START 1
40
+ /* Don't anchor at end unless the pattern ends with "$" */
41
+ #define PATHMATCH_NO_ANCHOR_END 2
42
+
43
+ /* Note that "^" and "$" are not special unless you set the corresponding
44
+ * flag above. */
45
+
46
+ int __archive_pathmatch(const char *p, const char *s, int flags);
47
+ int __archive_pathmatch_w(const wchar_t *p, const wchar_t *s, int flags);
48
+
49
+ #define archive_pathmatch(p, s, f) __archive_pathmatch(p, s, f)
50
+ #define archive_pathmatch_w(p, s, f) __archive_pathmatch_w(p, s, f)
51
+
52
+ #endif
@@ -52,12 +52,33 @@
52
52
  #error Oops: No config.h and no pre-built configuration in archive_platform.h.
53
53
  #endif
54
54
 
55
+ /* On macOS check for some symbols based on the deployment target version. */
56
+ #if defined(__APPLE__)
57
+ # undef HAVE_FUTIMENS
58
+ # undef HAVE_UTIMENSAT
59
+ # include <AvailabilityMacros.h>
60
+ # if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
61
+ # define HAVE_FUTIMENS 1
62
+ # define HAVE_UTIMENSAT 1
63
+ # endif
64
+ #endif
65
+
55
66
  /* It should be possible to get rid of this by extending the feature-test
56
67
  * macros to cover Windows API functions, probably along with non-trivial
57
68
  * refactoring of code to find structures that sit more cleanly on top of
58
69
  * either Windows or Posix APIs. */
59
70
  #if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__)
60
71
  #include "archive_windows.h"
72
+ /* The C library on Windows specifies a calling convention for callback
73
+ * functions and exports; when we interact with them (capture pointers,
74
+ * call and pass function pointers) we need to match their calling
75
+ * convention.
76
+ * This only matters when libarchive is built with /Gr, /Gz or /Gv
77
+ * (which change the default calling convention.) */
78
+ #define __LA_LIBC_CC __cdecl
79
+ #else
80
+ #define la_stat(path,stref) stat(path,stref)
81
+ #define __LA_LIBC_CC
61
82
  #endif
62
83
 
63
84
  /*
@@ -66,15 +87,18 @@
66
87
  * headers as required.
67
88
  */
68
89
 
69
- /* Get a real definition for __FBSDID if we can */
90
+ /* Get a real definition for __FBSDID or __RCSID if we can */
70
91
  #if HAVE_SYS_CDEFS_H
71
92
  #include <sys/cdefs.h>
72
93
  #endif
73
94
 
74
- /* If not, define it so as to avoid dangling semicolons. */
95
+ /* If not, define them so as to avoid dangling semicolons. */
75
96
  #ifndef __FBSDID
76
97
  #define __FBSDID(a) struct _undefined_hack
77
98
  #endif
99
+ #ifndef __RCSID
100
+ #define __RCSID(a) struct _undefined_hack
101
+ #endif
78
102
 
79
103
  /* Try to get standard C99-style integer type definitions. */
80
104
  #if HAVE_INTTYPES_H
@@ -114,6 +138,12 @@
114
138
  #if !HAVE_DECL_UINT32_MAX
115
139
  #define UINT32_MAX (~(uint32_t)0)
116
140
  #endif
141
+ #if !HAVE_DECL_INT32_MAX
142
+ #define INT32_MAX ((int32_t)(UINT32_MAX >> 1))
143
+ #endif
144
+ #if !HAVE_DECL_INT32_MIN
145
+ #define INT32_MIN ((int32_t)(~INT32_MAX))
146
+ #endif
117
147
  #if !HAVE_DECL_UINT64_MAX
118
148
  #define UINT64_MAX (~(uint64_t)0)
119
149
  #endif
@@ -123,15 +153,37 @@
123
153
  #if !HAVE_DECL_INT64_MIN
124
154
  #define INT64_MIN ((int64_t)(~INT64_MAX))
125
155
  #endif
156
+ #if !HAVE_DECL_UINTMAX_MAX
157
+ #define UINTMAX_MAX (~(uintmax_t)0)
158
+ #endif
159
+ #if !HAVE_DECL_INTMAX_MAX
160
+ #define INTMAX_MAX ((intmax_t)(UINTMAX_MAX >> 1))
161
+ #endif
162
+ #if !HAVE_DECL_INTMAX_MIN
163
+ #define INTMAX_MIN ((intmax_t)(~INTMAX_MAX))
164
+ #endif
126
165
 
127
- /*
128
- * If this platform has <sys/acl.h>, acl_create(), acl_init(),
129
- * acl_set_file(), and ACL_USER, we assume it has the rest of the
130
- * POSIX.1e draft functions used in archive_read_extract.c.
131
- */
132
- #if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE && HAVE_ACL_USER
133
- #define HAVE_POSIX_ACL 1
166
+ /* Some platforms lack the standard PRIxN/PRIdN definitions. */
167
+ #if !HAVE_INTTYPES_H || !defined(PRIx32) || !defined(PRId32)
168
+ #ifndef PRIx32
169
+ #if SIZEOF_INT == 4
170
+ #define PRIx32 "x"
171
+ #elif SIZEOF_LONG == 4
172
+ #define PRIx32 "lx"
173
+ #else
174
+ #error No suitable 32-bit unsigned integer type found for this platform
175
+ #endif
176
+ #endif // PRIx32
177
+ #ifndef PRId32
178
+ #if SIZEOF_INT == 4
179
+ #define PRId32 "d"
180
+ #elif SIZEOF_LONG == 4
181
+ #define PRId32 "ld"
182
+ #else
183
+ #error No suitable 32-bit signed integer type found for this platform
134
184
  #endif
185
+ #endif // PRId32
186
+ #endif // !HAVE_INTTYPES_H || !defined(PRIx32) || !defined(PRId32)
135
187
 
136
188
  /*
137
189
  * If we can't restore metadata using a file descriptor, then
@@ -141,6 +193,16 @@
141
193
  #define CAN_RESTORE_METADATA_FD
142
194
  #endif
143
195
 
196
+ /*
197
+ * glibc 2.24 deprecates readdir_r
198
+ * bionic c deprecates readdir_r too
199
+ */
200
+ #if defined(HAVE_READDIR_R) && (!defined(__GLIBC__) || !defined(__GLIBC_MINOR__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24)) && (!defined(__ANDROID__))
201
+ #define USE_READDIR_R 1
202
+ #else
203
+ #undef USE_READDIR_R
204
+ #endif
205
+
144
206
  /* Set up defaults for internal error codes. */
145
207
  #ifndef ARCHIVE_ERRNO_FILE_FORMAT
146
208
  #if HAVE_EFTYPE
@@ -162,4 +224,10 @@
162
224
  #define ARCHIVE_ERRNO_MISC (-1)
163
225
  #endif
164
226
 
227
+ #if defined(__GNUC__) && (__GNUC__ >= 7)
228
+ #define __LA_FALLTHROUGH __attribute__((fallthrough))
229
+ #else
230
+ #define __LA_FALLTHROUGH
231
+ #endif
232
+
165
233
  #endif /* !ARCHIVE_PLATFORM_H_INCLUDED */