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,53 @@
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
+ * 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
+ #ifndef ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED
27
+ #define ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED
28
+
29
+ #ifndef __LIBARCHIVE_BUILD
30
+ #error This header is only to be used internally to libarchive.
31
+ #endif
32
+
33
+ #include <openssl/evp.h>
34
+ #include <openssl/opensslv.h>
35
+
36
+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
37
+ #include <stdlib.h> /* malloc, free */
38
+ #include <string.h> /* memset */
39
+ static inline EVP_MD_CTX *EVP_MD_CTX_new(void)
40
+ {
41
+ EVP_MD_CTX *ctx = (EVP_MD_CTX *)calloc(1, sizeof(EVP_MD_CTX));
42
+ return ctx;
43
+ }
44
+
45
+ static inline void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
46
+ {
47
+ EVP_MD_CTX_cleanup(ctx);
48
+ memset(ctx, 0, sizeof(*ctx));
49
+ free(ctx);
50
+ }
51
+ #endif
52
+
53
+ #endif
@@ -0,0 +1,54 @@
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
+ * 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
+ #ifndef ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED
27
+ #define ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED
28
+
29
+ #ifndef __LIBARCHIVE_BUILD
30
+ #error This header is only to be used internally to libarchive.
31
+ #endif
32
+
33
+ #include <openssl/hmac.h>
34
+ #include <openssl/opensslv.h>
35
+
36
+ #if OPENSSL_VERSION_NUMBER < 0x10100000L || \
37
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
38
+ #include <stdlib.h> /* malloc, free */
39
+ #include <string.h> /* memset */
40
+ static inline HMAC_CTX *HMAC_CTX_new(void)
41
+ {
42
+ HMAC_CTX *ctx = (HMAC_CTX *)calloc(1, sizeof(HMAC_CTX));
43
+ return ctx;
44
+ }
45
+
46
+ static inline void HMAC_CTX_free(HMAC_CTX *ctx)
47
+ {
48
+ HMAC_CTX_cleanup(ctx);
49
+ memset(ctx, 0, sizeof(*ctx));
50
+ free(ctx);
51
+ }
52
+ #endif
53
+
54
+ #endif
@@ -0,0 +1,218 @@
1
+ /*-
2
+ * Copyright (c) 2011 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
+ * 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
+ __FBSDID("$FreeBSD$");
28
+
29
+ #ifdef HAVE_ERRNO_H
30
+ #include <errno.h>
31
+ #endif
32
+
33
+ #include "archive_options_private.h"
34
+
35
+ static const char *
36
+ parse_option(const char **str,
37
+ const char **mod, const char **opt, const char **val);
38
+
39
+ int
40
+ _archive_set_option(struct archive *a,
41
+ const char *m, const char *o, const char *v,
42
+ int magic, const char *fn, option_handler use_option)
43
+ {
44
+ const char *mp, *op, *vp;
45
+ int r;
46
+
47
+ archive_check_magic(a, magic, ARCHIVE_STATE_NEW, fn);
48
+
49
+ mp = (m != NULL && m[0] != '\0') ? m : NULL;
50
+ op = (o != NULL && o[0] != '\0') ? o : NULL;
51
+ vp = (v != NULL && v[0] != '\0') ? v : NULL;
52
+
53
+ if (op == NULL && vp == NULL)
54
+ return (ARCHIVE_OK);
55
+ if (op == NULL) {
56
+ archive_set_error(a, ARCHIVE_ERRNO_MISC, "Empty option");
57
+ return (ARCHIVE_FAILED);
58
+ }
59
+
60
+ r = use_option(a, mp, op, vp);
61
+ if (r == ARCHIVE_WARN - 1) {
62
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
63
+ "Unknown module name: `%s'", mp);
64
+ return (ARCHIVE_FAILED);
65
+ }
66
+ if (r == ARCHIVE_WARN) {
67
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
68
+ "Undefined option: `%s%s%s%s%s%s'",
69
+ vp?"":"!", mp?mp:"", mp?":":"", op, vp?"=":"", vp?vp:"");
70
+ return (ARCHIVE_FAILED);
71
+ }
72
+ return (r);
73
+ }
74
+
75
+ int
76
+ _archive_set_either_option(struct archive *a, const char *m, const char *o, const char *v,
77
+ option_handler use_format_option, option_handler use_filter_option)
78
+ {
79
+ int r1, r2;
80
+
81
+ if (o == NULL && v == NULL)
82
+ return (ARCHIVE_OK);
83
+ if (o == NULL)
84
+ return (ARCHIVE_FAILED);
85
+
86
+ r1 = use_format_option(a, m, o, v);
87
+ if (r1 == ARCHIVE_FATAL)
88
+ return (ARCHIVE_FATAL);
89
+
90
+ r2 = use_filter_option(a, m, o, v);
91
+ if (r2 == ARCHIVE_FATAL)
92
+ return (ARCHIVE_FATAL);
93
+
94
+ if (r2 == ARCHIVE_WARN - 1)
95
+ return r1;
96
+ return r1 > r2 ? r1 : r2;
97
+ }
98
+
99
+ int
100
+ _archive_set_options(struct archive *a, const char *options,
101
+ int magic, const char *fn, option_handler use_option)
102
+ {
103
+ int allok = 1, anyok = 0, ignore_mod_err = 0, r;
104
+ char *data;
105
+ const char *s, *mod, *opt, *val;
106
+
107
+ archive_check_magic(a, magic, ARCHIVE_STATE_NEW, fn);
108
+
109
+ if (options == NULL || options[0] == '\0')
110
+ return ARCHIVE_OK;
111
+
112
+ if ((data = strdup(options)) == NULL) {
113
+ archive_set_error(a,
114
+ ENOMEM, "Out of memory adding file to list");
115
+ return (ARCHIVE_FATAL);
116
+ }
117
+ s = (const char *)data;
118
+
119
+ do {
120
+ mod = opt = val = NULL;
121
+
122
+ parse_option(&s, &mod, &opt, &val);
123
+ if (mod == NULL && opt != NULL &&
124
+ strcmp("__ignore_wrong_module_name__", opt) == 0) {
125
+ /* Ignore module name error */
126
+ if (val != NULL) {
127
+ ignore_mod_err = 1;
128
+ anyok = 1;
129
+ }
130
+ continue;
131
+ }
132
+
133
+ r = use_option(a, mod, opt, val);
134
+ if (r == ARCHIVE_FATAL) {
135
+ free(data);
136
+ return (ARCHIVE_FATAL);
137
+ }
138
+ if (r == ARCHIVE_FAILED && mod != NULL) {
139
+ free(data);
140
+ return (ARCHIVE_FAILED);
141
+ }
142
+ if (r == ARCHIVE_WARN - 1) {
143
+ if (ignore_mod_err)
144
+ continue;
145
+ /* The module name is wrong. */
146
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
147
+ "Unknown module name: `%s'", mod);
148
+ free(data);
149
+ return (ARCHIVE_FAILED);
150
+ }
151
+ if (r == ARCHIVE_WARN) {
152
+ /* The option name is wrong. No-one used this. */
153
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
154
+ "Undefined option: `%s%s%s'",
155
+ mod?mod:"", mod?":":"", opt);
156
+ free(data);
157
+ return (ARCHIVE_FAILED);
158
+ }
159
+ if (r == ARCHIVE_OK)
160
+ anyok = 1;
161
+ else
162
+ allok = 0;
163
+ } while (s != NULL);
164
+
165
+ free(data);
166
+ return allok ? ARCHIVE_OK : anyok ? ARCHIVE_WARN : ARCHIVE_FAILED;
167
+ }
168
+
169
+ static const char *
170
+ parse_option(const char **s, const char **m, const char **o, const char **v)
171
+ {
172
+ const char *end, *mod, *opt, *val;
173
+ char *p;
174
+
175
+ end = NULL;
176
+ mod = NULL;
177
+ opt = *s;
178
+ val = "1";
179
+
180
+ p = strchr(opt, ',');
181
+
182
+ if (p != NULL) {
183
+ *p = '\0';
184
+ end = ((const char *)p) + 1;
185
+ }
186
+
187
+ if (0 == strlen(opt)) {
188
+ *s = end;
189
+ *m = NULL;
190
+ *o = NULL;
191
+ *v = NULL;
192
+ return end;
193
+ }
194
+
195
+ p = strchr(opt, ':');
196
+ if (p != NULL) {
197
+ *p = '\0';
198
+ mod = opt;
199
+ opt = ++p;
200
+ }
201
+
202
+ p = strchr(opt, '=');
203
+ if (p != NULL) {
204
+ *p = '\0';
205
+ val = ++p;
206
+ } else if (opt[0] == '!') {
207
+ ++opt;
208
+ val = NULL;
209
+ }
210
+
211
+ *s = end;
212
+ *m = mod;
213
+ *o = opt;
214
+ *v = val;
215
+
216
+ return end;
217
+ }
218
+
@@ -0,0 +1,51 @@
1
+ /*-
2
+ * Copyright (c) 2011 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
+ * 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
+ #ifndef ARCHIVE_OPTIONS_PRIVATE_H_INCLUDED
27
+ #define ARCHIVE_OPTIONS_PRIVATE_H_INCLUDED
28
+
29
+ #include "archive_platform.h"
30
+ __FBSDID("$FreeBSD$");
31
+
32
+ #include "archive_private.h"
33
+
34
+ typedef int (*option_handler)(struct archive *a,
35
+ const char *mod, const char *opt, const char *val);
36
+
37
+ int
38
+ _archive_set_option(struct archive *a,
39
+ const char *mod, const char *opt, const char *val,
40
+ int magic, const char *fn, option_handler use_option);
41
+
42
+ int
43
+ _archive_set_options(struct archive *a, const char *options,
44
+ int magic, const char *fn, option_handler use_option);
45
+
46
+ int
47
+ _archive_set_either_option(struct archive *a,
48
+ const char *m, const char *o, const char *v,
49
+ option_handler use_format_option, option_handler use_filter_option);
50
+
51
+ #endif
@@ -0,0 +1,337 @@
1
+ /* $NetBSD: pack_dev.c,v 1.12 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
+ #include "archive_platform.h"
35
+
36
+ #if HAVE_SYS_CDEFS_H
37
+ #include <sys/cdefs.h>
38
+ #endif
39
+ #if !defined(lint)
40
+ __RCSID("$NetBSD$");
41
+ #endif /* not lint */
42
+
43
+ #ifdef HAVE_LIMITS_H
44
+ #include <limits.h>
45
+ #endif
46
+
47
+ #include <stdio.h>
48
+ #ifdef HAVE_STDLIB_H
49
+ #include <stdlib.h>
50
+ #endif
51
+ #ifdef HAVE_STRING_H
52
+ #include <string.h>
53
+ #endif
54
+ #ifdef HAVE_SYS_TYPES_H
55
+ #include <sys/types.h>
56
+ #endif
57
+ #ifdef HAVE_SYS_STAT_H
58
+ #include <sys/stat.h>
59
+ #endif
60
+ #if MAJOR_IN_MKDEV
61
+ #include <sys/mkdev.h>
62
+ #define HAVE_MAJOR
63
+ #elif MAJOR_IN_SYSMACROS
64
+ #include <sys/sysmacros.h>
65
+ #define HAVE_MAJOR
66
+ #endif
67
+ #ifdef HAVE_UNISTD_H
68
+ #include <unistd.h>
69
+ #endif
70
+
71
+ #include "archive_pack_dev.h"
72
+
73
+ static pack_t pack_netbsd;
74
+ static pack_t pack_freebsd;
75
+ static pack_t pack_8_8;
76
+ static pack_t pack_12_20;
77
+ static pack_t pack_14_18;
78
+ static pack_t pack_8_24;
79
+ static pack_t pack_bsdos;
80
+ static int __LA_LIBC_CC compare_format(const void *, const void *);
81
+
82
+ static const char iMajorError[] = "invalid major number";
83
+ static const char iMinorError[] = "invalid minor number";
84
+ static const char tooManyFields[] = "too many fields for format";
85
+
86
+ /* This is blatantly stolen from libarchive/archive_entry.c,
87
+ * in an attempt to get this to play nice on MinGW... */
88
+ #if !defined(HAVE_MAJOR) && !defined(major)
89
+ /* Replacement for major/minor/makedev. */
90
+ #define major(x) ((int)(0x00ff & ((x) >> 8)))
91
+ #define minor(x) ((int)(0xffff00ff & (x)))
92
+ #define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min)))
93
+ #endif
94
+
95
+ /* Play games to come up with a suitable makedev() definition. */
96
+ #ifdef __QNXNTO__
97
+ /* QNX. <sigh> */
98
+ #include <sys/netmgr.h>
99
+ #define apd_makedev(maj, min) makedev(ND_LOCAL_NODE, (maj), (min))
100
+ #elif defined makedev
101
+ /* There's a "makedev" macro. */
102
+ #define apd_makedev(maj, min) makedev((maj), (min))
103
+ #elif defined mkdev || ((defined _WIN32 || defined __WIN32__) && !defined(__CYGWIN__))
104
+ /* Windows. <sigh> */
105
+ #define apd_makedev(maj, min) mkdev((maj), (min))
106
+ #else
107
+ /* There's a "makedev" function. */
108
+ #define apd_makedev(maj, min) makedev((maj), (min))
109
+ #endif
110
+
111
+ /* exported */
112
+ dev_t
113
+ pack_native(int n, unsigned long numbers[], const char **error)
114
+ {
115
+ dev_t dev = 0;
116
+
117
+ if (n == 2) {
118
+ dev = apd_makedev(numbers[0], numbers[1]);
119
+ if ((unsigned long)major(dev) != numbers[0])
120
+ *error = iMajorError;
121
+ else if ((unsigned long)minor(dev) != numbers[1])
122
+ *error = iMinorError;
123
+ } else
124
+ *error = tooManyFields;
125
+ return (dev);
126
+ }
127
+
128
+
129
+ static dev_t
130
+ pack_netbsd(int n, unsigned long numbers[], const char **error)
131
+ {
132
+ dev_t dev = 0;
133
+
134
+ if (n == 2) {
135
+ dev = makedev_netbsd(numbers[0], numbers[1]);
136
+ if ((unsigned long)major_netbsd(dev) != numbers[0])
137
+ *error = iMajorError;
138
+ else if ((unsigned long)minor_netbsd(dev) != numbers[1])
139
+ *error = iMinorError;
140
+ } else
141
+ *error = tooManyFields;
142
+ return (dev);
143
+ }
144
+
145
+
146
+ #define major_freebsd(x) ((int32_t)(((x) & 0x0000ff00) >> 8))
147
+ #define minor_freebsd(x) ((int32_t)(((x) & 0xffff00ff) >> 0))
148
+ #define makedev_freebsd(x,y) ((dev_t)((((x) << 8) & 0x0000ff00) | \
149
+ (((y) << 0) & 0xffff00ff)))
150
+
151
+ static dev_t
152
+ pack_freebsd(int n, unsigned long numbers[], const char **error)
153
+ {
154
+ dev_t dev = 0;
155
+
156
+ if (n == 2) {
157
+ dev = makedev_freebsd(numbers[0], numbers[1]);
158
+ if ((unsigned long)major_freebsd(dev) != numbers[0])
159
+ *error = iMajorError;
160
+ if ((unsigned long)minor_freebsd(dev) != numbers[1])
161
+ *error = iMinorError;
162
+ } else
163
+ *error = tooManyFields;
164
+ return (dev);
165
+ }
166
+
167
+
168
+ #define major_8_8(x) ((int32_t)(((x) & 0x0000ff00) >> 8))
169
+ #define minor_8_8(x) ((int32_t)(((x) & 0x000000ff) >> 0))
170
+ #define makedev_8_8(x,y) ((dev_t)((((x) << 8) & 0x0000ff00) | \
171
+ (((y) << 0) & 0x000000ff)))
172
+
173
+ static dev_t
174
+ pack_8_8(int n, unsigned long numbers[], const char **error)
175
+ {
176
+ dev_t dev = 0;
177
+
178
+ if (n == 2) {
179
+ dev = makedev_8_8(numbers[0], numbers[1]);
180
+ if ((unsigned long)major_8_8(dev) != numbers[0])
181
+ *error = iMajorError;
182
+ if ((unsigned long)minor_8_8(dev) != numbers[1])
183
+ *error = iMinorError;
184
+ } else
185
+ *error = tooManyFields;
186
+ return (dev);
187
+ }
188
+
189
+
190
+ #define major_12_20(x) ((int32_t)(((x) & 0xfff00000) >> 20))
191
+ #define minor_12_20(x) ((int32_t)(((x) & 0x000fffff) >> 0))
192
+ #define makedev_12_20(x,y) ((dev_t)((((x) << 20) & 0xfff00000) | \
193
+ (((y) << 0) & 0x000fffff)))
194
+
195
+ static dev_t
196
+ pack_12_20(int n, unsigned long numbers[], const char **error)
197
+ {
198
+ dev_t dev = 0;
199
+
200
+ if (n == 2) {
201
+ dev = makedev_12_20(numbers[0], numbers[1]);
202
+ if ((unsigned long)major_12_20(dev) != numbers[0])
203
+ *error = iMajorError;
204
+ if ((unsigned long)minor_12_20(dev) != numbers[1])
205
+ *error = iMinorError;
206
+ } else
207
+ *error = tooManyFields;
208
+ return (dev);
209
+ }
210
+
211
+
212
+ #define major_14_18(x) ((int32_t)(((x) & 0xfffc0000) >> 18))
213
+ #define minor_14_18(x) ((int32_t)(((x) & 0x0003ffff) >> 0))
214
+ #define makedev_14_18(x,y) ((dev_t)((((x) << 18) & 0xfffc0000) | \
215
+ (((y) << 0) & 0x0003ffff)))
216
+
217
+ static dev_t
218
+ pack_14_18(int n, unsigned long numbers[], const char **error)
219
+ {
220
+ dev_t dev = 0;
221
+
222
+ if (n == 2) {
223
+ dev = makedev_14_18(numbers[0], numbers[1]);
224
+ if ((unsigned long)major_14_18(dev) != numbers[0])
225
+ *error = iMajorError;
226
+ if ((unsigned long)minor_14_18(dev) != numbers[1])
227
+ *error = iMinorError;
228
+ } else
229
+ *error = tooManyFields;
230
+ return (dev);
231
+ }
232
+
233
+
234
+ #define major_8_24(x) ((int32_t)(((x) & 0xff000000) >> 24))
235
+ #define minor_8_24(x) ((int32_t)(((x) & 0x00ffffff) >> 0))
236
+ #define makedev_8_24(x,y) ((dev_t)((((x) << 24) & 0xff000000) | \
237
+ (((y) << 0) & 0x00ffffff)))
238
+
239
+ static dev_t
240
+ pack_8_24(int n, unsigned long numbers[], const char **error)
241
+ {
242
+ dev_t dev = 0;
243
+
244
+ if (n == 2) {
245
+ dev = makedev_8_24(numbers[0], numbers[1]);
246
+ if ((unsigned long)major_8_24(dev) != numbers[0])
247
+ *error = iMajorError;
248
+ if ((unsigned long)minor_8_24(dev) != numbers[1])
249
+ *error = iMinorError;
250
+ } else
251
+ *error = tooManyFields;
252
+ return (dev);
253
+ }
254
+
255
+
256
+ #define major_12_12_8(x) ((int32_t)(((x) & 0xfff00000) >> 20))
257
+ #define unit_12_12_8(x) ((int32_t)(((x) & 0x000fff00) >> 8))
258
+ #define subunit_12_12_8(x) ((int32_t)(((x) & 0x000000ff) >> 0))
259
+ #define makedev_12_12_8(x,y,z) ((dev_t)((((x) << 20) & 0xfff00000) | \
260
+ (((y) << 8) & 0x000fff00) | \
261
+ (((z) << 0) & 0x000000ff)))
262
+
263
+ static dev_t
264
+ pack_bsdos(int n, unsigned long numbers[], const char **error)
265
+ {
266
+ dev_t dev = 0;
267
+
268
+ if (n == 2) {
269
+ dev = makedev_12_20(numbers[0], numbers[1]);
270
+ if ((unsigned long)major_12_20(dev) != numbers[0])
271
+ *error = iMajorError;
272
+ if ((unsigned long)minor_12_20(dev) != numbers[1])
273
+ *error = iMinorError;
274
+ } else if (n == 3) {
275
+ dev = makedev_12_12_8(numbers[0], numbers[1], numbers[2]);
276
+ if ((unsigned long)major_12_12_8(dev) != numbers[0])
277
+ *error = iMajorError;
278
+ if ((unsigned long)unit_12_12_8(dev) != numbers[1])
279
+ *error = "invalid unit number";
280
+ if ((unsigned long)subunit_12_12_8(dev) != numbers[2])
281
+ *error = "invalid subunit number";
282
+ } else
283
+ *error = tooManyFields;
284
+ return (dev);
285
+ }
286
+
287
+
288
+ /* list of formats and pack functions */
289
+ /* this list must be sorted lexically */
290
+ static const struct format {
291
+ const char *name;
292
+ pack_t *pack;
293
+ } formats[] = {
294
+ {"386bsd", pack_8_8},
295
+ {"4bsd", pack_8_8},
296
+ {"bsdos", pack_bsdos},
297
+ {"freebsd", pack_freebsd},
298
+ {"hpux", pack_8_24},
299
+ {"isc", pack_8_8},
300
+ {"linux", pack_8_8},
301
+ {"native", pack_native},
302
+ {"netbsd", pack_netbsd},
303
+ {"osf1", pack_12_20},
304
+ {"sco", pack_8_8},
305
+ {"solaris", pack_14_18},
306
+ {"sunos", pack_8_8},
307
+ {"svr3", pack_8_8},
308
+ {"svr4", pack_14_18},
309
+ {"ultrix", pack_8_8},
310
+ };
311
+
312
+ static int
313
+ __LA_LIBC_CC
314
+ compare_format(const void *key, const void *element)
315
+ {
316
+ const char *name;
317
+ const struct format *format;
318
+
319
+ name = key;
320
+ format = element;
321
+
322
+ return (strcmp(name, format->name));
323
+ }
324
+
325
+
326
+ pack_t *
327
+ pack_find(const char *name)
328
+ {
329
+ struct format *format;
330
+
331
+ format = bsearch(name, formats,
332
+ sizeof(formats)/sizeof(formats[0]),
333
+ sizeof(formats[0]), compare_format);
334
+ if (format == 0)
335
+ return (NULL);
336
+ return (format->pack);
337
+ }