@papyrus-sdk/engine-native 0.2.22-beta.1 → 0.2.22-beta.3

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 (266) hide show
  1. package/android/build.gradle +1 -0
  2. package/android/src/main/cpp/CMakeLists.txt +137 -0
  3. package/android/src/main/cpp/PapyrusComicArchiveJni.cpp +68 -0
  4. package/android/src/main/cpp/PapyrusComicArchiveTest.cpp +55 -0
  5. package/android/src/main/java/com/papyrus/engine/PapyrusComicArchiveNative.java +14 -0
  6. package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentView.java +353 -0
  7. package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentViewManager.java +32 -0
  8. package/android/src/main/java/com/papyrus/engine/PapyrusComicPageLayout.java +17 -0
  9. package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.java +298 -34
  10. package/android/src/main/java/com/papyrus/engine/PapyrusNativeTextModel.java +195 -0
  11. package/android/src/main/java/com/papyrus/engine/PapyrusPackage.java +3 -1
  12. package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerView.java +24 -0
  13. package/android/src/main/java/com/papyrus/engine/PapyrusRenderMath.java +9 -0
  14. package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentView.java +439 -0
  15. package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentViewManager.java +43 -0
  16. package/android/src/main/java/com/papyrus/engine/PapyrusTextStore.java +43 -0
  17. package/dist/index.d.mts +439 -3
  18. package/dist/index.d.ts +439 -3
  19. package/dist/index.js +412 -4
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +404 -3
  22. package/dist/index.mjs.map +1 -1
  23. package/ios/PapyrusComicDocumentView.h +21 -0
  24. package/ios/PapyrusComicDocumentView.m +374 -0
  25. package/ios/PapyrusComicDocumentViewManager.m +23 -0
  26. package/ios/PapyrusEngineStore.m +4 -0
  27. package/ios/PapyrusNativeEngine.m +664 -0
  28. package/ios/PapyrusNativeEngine.podspec +26 -1
  29. package/ios/PapyrusPageRotationRegistry.h +29 -0
  30. package/ios/PapyrusPageRotationRegistry.m +179 -0
  31. package/ios/PapyrusPageView.m +38 -11
  32. package/ios/PapyrusPdfDocumentView.h +2 -0
  33. package/ios/PapyrusPdfDocumentView.m +121 -15
  34. package/ios/PapyrusPdfDocumentViewManager.m +2 -0
  35. package/ios/PapyrusPdfPageTheme.h +15 -0
  36. package/ios/PapyrusPdfPageTheme.m +218 -0
  37. package/ios/PapyrusTextDocumentView.h +27 -0
  38. package/ios/PapyrusTextDocumentView.m +300 -0
  39. package/ios/PapyrusTextDocumentViewManager.m +29 -0
  40. package/ios/PapyrusTextStore.h +13 -0
  41. package/ios/PapyrusTextStore.m +73 -0
  42. package/package.json +5 -3
  43. package/third_party_licenses/BLAKE2-NOTICE.txt +11 -0
  44. package/third_party_licenses/libarchive-COPYING +65 -0
  45. package/vendor/libarchive/PapyrusComicArchive.cpp +376 -0
  46. package/vendor/libarchive/PapyrusComicArchive.h +30 -0
  47. package/vendor/libarchive/README.papyrus.md +15 -0
  48. package/vendor/libarchive/android.h +192 -0
  49. package/vendor/libarchive/config/PapyrusArchiveConfig.h +65 -0
  50. package/vendor/libarchive/libarchive/CMakeLists.txt +293 -0
  51. package/vendor/libarchive/libarchive/android_lf.h +36 -0
  52. package/vendor/libarchive/libarchive/archive.h +1266 -0
  53. package/vendor/libarchive/libarchive/archive_acl.c +2025 -0
  54. package/vendor/libarchive/libarchive/archive_acl_private.h +85 -0
  55. package/vendor/libarchive/libarchive/archive_blake2.h +197 -0
  56. package/vendor/libarchive/libarchive/archive_blake2_impl.h +161 -0
  57. package/vendor/libarchive/libarchive/archive_blake2s_ref.c +369 -0
  58. package/vendor/libarchive/libarchive/archive_blake2sp_ref.c +361 -0
  59. package/vendor/libarchive/libarchive/archive_check_magic.c +183 -0
  60. package/vendor/libarchive/libarchive/archive_cmdline.c +211 -0
  61. package/vendor/libarchive/libarchive/archive_cmdline_private.h +45 -0
  62. package/vendor/libarchive/libarchive/archive_crc32.h +123 -0
  63. package/vendor/libarchive/libarchive/archive_cryptor.c +534 -0
  64. package/vendor/libarchive/libarchive/archive_cryptor_private.h +199 -0
  65. package/vendor/libarchive/libarchive/archive_digest.c +1584 -0
  66. package/vendor/libarchive/libarchive/archive_digest_private.h +431 -0
  67. package/vendor/libarchive/libarchive/archive_disk_acl_darwin.c +558 -0
  68. package/vendor/libarchive/libarchive/archive_disk_acl_freebsd.c +712 -0
  69. package/vendor/libarchive/libarchive/archive_disk_acl_linux.c +760 -0
  70. package/vendor/libarchive/libarchive/archive_disk_acl_sunos.c +824 -0
  71. package/vendor/libarchive/libarchive/archive_endian.h +234 -0
  72. package/vendor/libarchive/libarchive/archive_entry.3 +147 -0
  73. package/vendor/libarchive/libarchive/archive_entry.c +2297 -0
  74. package/vendor/libarchive/libarchive/archive_entry.h +763 -0
  75. package/vendor/libarchive/libarchive/archive_entry_acl.3 +458 -0
  76. package/vendor/libarchive/libarchive/archive_entry_copy_bhfi.c +55 -0
  77. package/vendor/libarchive/libarchive/archive_entry_copy_stat.c +82 -0
  78. package/vendor/libarchive/libarchive/archive_entry_link_resolver.c +472 -0
  79. package/vendor/libarchive/libarchive/archive_entry_linkify.3 +224 -0
  80. package/vendor/libarchive/libarchive/archive_entry_locale.h +90 -0
  81. package/vendor/libarchive/libarchive/archive_entry_misc.3 +63 -0
  82. package/vendor/libarchive/libarchive/archive_entry_paths.3 +153 -0
  83. package/vendor/libarchive/libarchive/archive_entry_perms.3 +210 -0
  84. package/vendor/libarchive/libarchive/archive_entry_private.h +205 -0
  85. package/vendor/libarchive/libarchive/archive_entry_sparse.c +156 -0
  86. package/vendor/libarchive/libarchive/archive_entry_stat.3 +274 -0
  87. package/vendor/libarchive/libarchive/archive_entry_stat.c +121 -0
  88. package/vendor/libarchive/libarchive/archive_entry_strmode.c +69 -0
  89. package/vendor/libarchive/libarchive/archive_entry_time.3 +127 -0
  90. package/vendor/libarchive/libarchive/archive_entry_xattr.c +155 -0
  91. package/vendor/libarchive/libarchive/archive_hmac.c +345 -0
  92. package/vendor/libarchive/libarchive/archive_hmac_private.h +119 -0
  93. package/vendor/libarchive/libarchive/archive_integer.h +267 -0
  94. package/vendor/libarchive/libarchive/archive_match.c +1869 -0
  95. package/vendor/libarchive/libarchive/archive_openssl_evp_private.h +54 -0
  96. package/vendor/libarchive/libarchive/archive_openssl_hmac_private.h +54 -0
  97. package/vendor/libarchive/libarchive/archive_options.c +219 -0
  98. package/vendor/libarchive/libarchive/archive_options_private.h +49 -0
  99. package/vendor/libarchive/libarchive/archive_pack_dev.c +330 -0
  100. package/vendor/libarchive/libarchive/archive_pack_dev.h +49 -0
  101. package/vendor/libarchive/libarchive/archive_parse_date.c +1173 -0
  102. package/vendor/libarchive/libarchive/archive_pathmatch.c +480 -0
  103. package/vendor/libarchive/libarchive/archive_pathmatch.h +50 -0
  104. package/vendor/libarchive/libarchive/archive_platform.h +213 -0
  105. package/vendor/libarchive/libarchive/archive_platform_acl.h +53 -0
  106. package/vendor/libarchive/libarchive/archive_platform_stat.h +45 -0
  107. package/vendor/libarchive/libarchive/archive_platform_xattr.h +45 -0
  108. package/vendor/libarchive/libarchive/archive_ppmd7.c +1173 -0
  109. package/vendor/libarchive/libarchive/archive_ppmd7_private.h +119 -0
  110. package/vendor/libarchive/libarchive/archive_ppmd8.c +1293 -0
  111. package/vendor/libarchive/libarchive/archive_ppmd8_private.h +123 -0
  112. package/vendor/libarchive/libarchive/archive_ppmd_private.h +159 -0
  113. package/vendor/libarchive/libarchive/archive_private.h +209 -0
  114. package/vendor/libarchive/libarchive/archive_random.c +274 -0
  115. package/vendor/libarchive/libarchive/archive_random_private.h +36 -0
  116. package/vendor/libarchive/libarchive/archive_rb.c +709 -0
  117. package/vendor/libarchive/libarchive/archive_rb.h +113 -0
  118. package/vendor/libarchive/libarchive/archive_read.3 +250 -0
  119. package/vendor/libarchive/libarchive/archive_read.c +1814 -0
  120. package/vendor/libarchive/libarchive/archive_read_add_passphrase.3 +72 -0
  121. package/vendor/libarchive/libarchive/archive_read_add_passphrase.c +189 -0
  122. package/vendor/libarchive/libarchive/archive_read_append_filter.c +209 -0
  123. package/vendor/libarchive/libarchive/archive_read_data.3 +128 -0
  124. package/vendor/libarchive/libarchive/archive_read_data_into_fd.c +207 -0
  125. package/vendor/libarchive/libarchive/archive_read_disk.3 +422 -0
  126. package/vendor/libarchive/libarchive/archive_read_disk_entry_from_file.c +1086 -0
  127. package/vendor/libarchive/libarchive/archive_read_disk_posix.c +2639 -0
  128. package/vendor/libarchive/libarchive/archive_read_disk_private.h +97 -0
  129. package/vendor/libarchive/libarchive/archive_read_disk_set_standard_lookup.c +315 -0
  130. package/vendor/libarchive/libarchive/archive_read_disk_windows.c +2603 -0
  131. package/vendor/libarchive/libarchive/archive_read_extract.3 +135 -0
  132. package/vendor/libarchive/libarchive/archive_read_extract.c +59 -0
  133. package/vendor/libarchive/libarchive/archive_read_extract2.c +154 -0
  134. package/vendor/libarchive/libarchive/archive_read_filter.3 +163 -0
  135. package/vendor/libarchive/libarchive/archive_read_format.3 +190 -0
  136. package/vendor/libarchive/libarchive/archive_read_free.3 +91 -0
  137. package/vendor/libarchive/libarchive/archive_read_header.3 +89 -0
  138. package/vendor/libarchive/libarchive/archive_read_new.3 +57 -0
  139. package/vendor/libarchive/libarchive/archive_read_open.3 +247 -0
  140. package/vendor/libarchive/libarchive/archive_read_open_fd.c +236 -0
  141. package/vendor/libarchive/libarchive/archive_read_open_file.c +257 -0
  142. package/vendor/libarchive/libarchive/archive_read_open_filename.c +652 -0
  143. package/vendor/libarchive/libarchive/archive_read_open_memory.c +188 -0
  144. package/vendor/libarchive/libarchive/archive_read_private.h +274 -0
  145. package/vendor/libarchive/libarchive/archive_read_set_format.c +116 -0
  146. package/vendor/libarchive/libarchive/archive_read_set_options.3 +290 -0
  147. package/vendor/libarchive/libarchive/archive_read_set_options.c +132 -0
  148. package/vendor/libarchive/libarchive/archive_read_support_filter_all.c +84 -0
  149. package/vendor/libarchive/libarchive/archive_read_support_filter_by_code.c +68 -0
  150. package/vendor/libarchive/libarchive/archive_read_support_filter_bzip2.c +360 -0
  151. package/vendor/libarchive/libarchive/archive_read_support_filter_compress.c +457 -0
  152. package/vendor/libarchive/libarchive/archive_read_support_filter_grzip.c +108 -0
  153. package/vendor/libarchive/libarchive/archive_read_support_filter_gzip.c +538 -0
  154. package/vendor/libarchive/libarchive/archive_read_support_filter_lrzip.c +119 -0
  155. package/vendor/libarchive/libarchive/archive_read_support_filter_lz4.c +829 -0
  156. package/vendor/libarchive/libarchive/archive_read_support_filter_lzop.c +493 -0
  157. package/vendor/libarchive/libarchive/archive_read_support_filter_none.c +51 -0
  158. package/vendor/libarchive/libarchive/archive_read_support_filter_program.c +497 -0
  159. package/vendor/libarchive/libarchive/archive_read_support_filter_rpm.c +249 -0
  160. package/vendor/libarchive/libarchive/archive_read_support_filter_uu.c +739 -0
  161. package/vendor/libarchive/libarchive/archive_read_support_filter_xz.c +792 -0
  162. package/vendor/libarchive/libarchive/archive_read_support_filter_zstd.c +356 -0
  163. package/vendor/libarchive/libarchive/archive_read_support_format_7zip.c +4650 -0
  164. package/vendor/libarchive/libarchive/archive_read_support_format_all.c +88 -0
  165. package/vendor/libarchive/libarchive/archive_read_support_format_ar.c +597 -0
  166. package/vendor/libarchive/libarchive/archive_read_support_format_by_code.c +76 -0
  167. package/vendor/libarchive/libarchive/archive_read_support_format_cab.c +3410 -0
  168. package/vendor/libarchive/libarchive/archive_read_support_format_cpio.c +1152 -0
  169. package/vendor/libarchive/libarchive/archive_read_support_format_empty.c +95 -0
  170. package/vendor/libarchive/libarchive/archive_read_support_format_iso9660.c +3516 -0
  171. package/vendor/libarchive/libarchive/archive_read_support_format_lha.c +2931 -0
  172. package/vendor/libarchive/libarchive/archive_read_support_format_mtree.c +2113 -0
  173. package/vendor/libarchive/libarchive/archive_read_support_format_rar.c +3932 -0
  174. package/vendor/libarchive/libarchive/archive_read_support_format_rar5.c +4501 -0
  175. package/vendor/libarchive/libarchive/archive_read_support_format_raw.c +194 -0
  176. package/vendor/libarchive/libarchive/archive_read_support_format_tar.c +3785 -0
  177. package/vendor/libarchive/libarchive/archive_read_support_format_warc.c +875 -0
  178. package/vendor/libarchive/libarchive/archive_read_support_format_xar.c +3770 -0
  179. package/vendor/libarchive/libarchive/archive_read_support_format_zip.c +4710 -0
  180. package/vendor/libarchive/libarchive/archive_string.c +4391 -0
  181. package/vendor/libarchive/libarchive/archive_string.h +244 -0
  182. package/vendor/libarchive/libarchive/archive_string_composition.h +2289 -0
  183. package/vendor/libarchive/libarchive/archive_string_sprintf.c +200 -0
  184. package/vendor/libarchive/libarchive/archive_time.c +168 -0
  185. package/vendor/libarchive/libarchive/archive_time_private.h +47 -0
  186. package/vendor/libarchive/libarchive/archive_util.3 +239 -0
  187. package/vendor/libarchive/libarchive/archive_util.c +668 -0
  188. package/vendor/libarchive/libarchive/archive_version_details.c +516 -0
  189. package/vendor/libarchive/libarchive/archive_virtual.c +162 -0
  190. package/vendor/libarchive/libarchive/archive_windows.c +1035 -0
  191. package/vendor/libarchive/libarchive/archive_windows.h +332 -0
  192. package/vendor/libarchive/libarchive/archive_write.3 +266 -0
  193. package/vendor/libarchive/libarchive/archive_write.c +896 -0
  194. package/vendor/libarchive/libarchive/archive_write_add_filter.c +71 -0
  195. package/vendor/libarchive/libarchive/archive_write_add_filter_b64encode.c +329 -0
  196. package/vendor/libarchive/libarchive/archive_write_add_filter_by_name.c +76 -0
  197. package/vendor/libarchive/libarchive/archive_write_add_filter_bzip2.c +411 -0
  198. package/vendor/libarchive/libarchive/archive_write_add_filter_compress.c +459 -0
  199. package/vendor/libarchive/libarchive/archive_write_add_filter_grzip.c +143 -0
  200. package/vendor/libarchive/libarchive/archive_write_add_filter_gzip.c +493 -0
  201. package/vendor/libarchive/libarchive/archive_write_add_filter_lrzip.c +214 -0
  202. package/vendor/libarchive/libarchive/archive_write_add_filter_lz4.c +710 -0
  203. package/vendor/libarchive/libarchive/archive_write_add_filter_lzop.c +500 -0
  204. package/vendor/libarchive/libarchive/archive_write_add_filter_none.c +42 -0
  205. package/vendor/libarchive/libarchive/archive_write_add_filter_program.c +398 -0
  206. package/vendor/libarchive/libarchive/archive_write_add_filter_uuencode.c +320 -0
  207. package/vendor/libarchive/libarchive/archive_write_add_filter_xz.c +547 -0
  208. package/vendor/libarchive/libarchive/archive_write_add_filter_zstd.c +608 -0
  209. package/vendor/libarchive/libarchive/archive_write_blocksize.3 +112 -0
  210. package/vendor/libarchive/libarchive/archive_write_data.3 +88 -0
  211. package/vendor/libarchive/libarchive/archive_write_disk.3 +360 -0
  212. package/vendor/libarchive/libarchive/archive_write_disk_posix.c +4789 -0
  213. package/vendor/libarchive/libarchive/archive_write_disk_private.h +43 -0
  214. package/vendor/libarchive/libarchive/archive_write_disk_set_standard_lookup.c +265 -0
  215. package/vendor/libarchive/libarchive/archive_write_disk_windows.c +2952 -0
  216. package/vendor/libarchive/libarchive/archive_write_filter.3 +140 -0
  217. package/vendor/libarchive/libarchive/archive_write_finish_entry.3 +77 -0
  218. package/vendor/libarchive/libarchive/archive_write_format.3 +187 -0
  219. package/vendor/libarchive/libarchive/archive_write_free.3 +94 -0
  220. package/vendor/libarchive/libarchive/archive_write_header.3 +71 -0
  221. package/vendor/libarchive/libarchive/archive_write_new.3 +56 -0
  222. package/vendor/libarchive/libarchive/archive_write_open.3 +270 -0
  223. package/vendor/libarchive/libarchive/archive_write_open_fd.c +141 -0
  224. package/vendor/libarchive/libarchive/archive_write_open_file.c +102 -0
  225. package/vendor/libarchive/libarchive/archive_write_open_filename.c +272 -0
  226. package/vendor/libarchive/libarchive/archive_write_open_memory.c +110 -0
  227. package/vendor/libarchive/libarchive/archive_write_private.h +166 -0
  228. package/vendor/libarchive/libarchive/archive_write_set_format.c +124 -0
  229. package/vendor/libarchive/libarchive/archive_write_set_format_7zip.c +2571 -0
  230. package/vendor/libarchive/libarchive/archive_write_set_format_ar.c +540 -0
  231. package/vendor/libarchive/libarchive/archive_write_set_format_by_name.c +93 -0
  232. package/vendor/libarchive/libarchive/archive_write_set_format_cpio.c +11 -0
  233. package/vendor/libarchive/libarchive/archive_write_set_format_cpio_binary.c +618 -0
  234. package/vendor/libarchive/libarchive/archive_write_set_format_cpio_newc.c +457 -0
  235. package/vendor/libarchive/libarchive/archive_write_set_format_cpio_odc.c +508 -0
  236. package/vendor/libarchive/libarchive/archive_write_set_format_filter_by_ext.c +141 -0
  237. package/vendor/libarchive/libarchive/archive_write_set_format_gnutar.c +790 -0
  238. package/vendor/libarchive/libarchive/archive_write_set_format_iso9660.c +8216 -0
  239. package/vendor/libarchive/libarchive/archive_write_set_format_mtree.c +2307 -0
  240. package/vendor/libarchive/libarchive/archive_write_set_format_pax.c +2249 -0
  241. package/vendor/libarchive/libarchive/archive_write_set_format_private.h +40 -0
  242. package/vendor/libarchive/libarchive/archive_write_set_format_raw.c +123 -0
  243. package/vendor/libarchive/libarchive/archive_write_set_format_shar.c +650 -0
  244. package/vendor/libarchive/libarchive/archive_write_set_format_ustar.c +768 -0
  245. package/vendor/libarchive/libarchive/archive_write_set_format_v7tar.c +648 -0
  246. package/vendor/libarchive/libarchive/archive_write_set_format_warc.c +491 -0
  247. package/vendor/libarchive/libarchive/archive_write_set_format_xar.c +3799 -0
  248. package/vendor/libarchive/libarchive/archive_write_set_format_zip.c +2548 -0
  249. package/vendor/libarchive/libarchive/archive_write_set_options.3 +779 -0
  250. package/vendor/libarchive/libarchive/archive_write_set_options.c +129 -0
  251. package/vendor/libarchive/libarchive/archive_write_set_passphrase.3 +72 -0
  252. package/vendor/libarchive/libarchive/archive_write_set_passphrase.c +95 -0
  253. package/vendor/libarchive/libarchive/archive_xxhash.h +48 -0
  254. package/vendor/libarchive/libarchive/config_freebsd.h +275 -0
  255. package/vendor/libarchive/libarchive/cpio.5 +389 -0
  256. package/vendor/libarchive/libarchive/filter_fork.h +44 -0
  257. package/vendor/libarchive/libarchive/filter_fork_posix.c +269 -0
  258. package/vendor/libarchive/libarchive/filter_fork_windows.c +270 -0
  259. package/vendor/libarchive/libarchive/libarchive-formats.5 +478 -0
  260. package/vendor/libarchive/libarchive/libarchive.3 +297 -0
  261. package/vendor/libarchive/libarchive/libarchive_changes.3 +339 -0
  262. package/vendor/libarchive/libarchive/libarchive_internals.3 +363 -0
  263. package/vendor/libarchive/libarchive/module.modulemap +34 -0
  264. package/vendor/libarchive/libarchive/mtree.5 +323 -0
  265. package/vendor/libarchive/libarchive/tar.5 +947 -0
  266. package/vendor/libarchive/libarchive/xxhash.c +531 -0
@@ -0,0 +1,478 @@
1
+ .\" Copyright (c) 2003-2009 Tim Kientzle
2
+ .\" All rights reserved.
3
+ .\"
4
+ .\" Redistribution and use in source and binary forms, with or without
5
+ .\" modification, are permitted provided that the following conditions
6
+ .\" are met:
7
+ .\" 1. Redistributions of source code must retain the above copyright
8
+ .\" notice, this list of conditions and the following disclaimer.
9
+ .\" 2. Redistributions in binary form must reproduce the above copyright
10
+ .\" notice, this list of conditions and the following disclaimer in the
11
+ .\" documentation and/or other materials provided with the distribution.
12
+ .\"
13
+ .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14
+ .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
+ .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16
+ .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17
+ .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18
+ .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19
+ .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20
+ .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21
+ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22
+ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23
+ .\" SUCH DAMAGE.
24
+ .\"
25
+ .Dd December 27, 2016
26
+ .Dt LIBARCHIVE-FORMATS 5
27
+ .Os
28
+ .Sh NAME
29
+ .Nm libarchive-formats
30
+ .Nd archive formats supported by the libarchive library
31
+ .Sh DESCRIPTION
32
+ The
33
+ .Xr libarchive 3
34
+ library reads and writes a variety of streaming archive formats.
35
+ Generally speaking, all of these archive formats consist of a series of
36
+ .Dq entries .
37
+ Each entry stores a single file system object, such as a file, directory,
38
+ or symbolic link.
39
+ .Pp
40
+ The following provides a brief description of each format supported
41
+ by libarchive, with some information about recognized extensions or
42
+ limitations of the current library support.
43
+ Note that just because a format is supported by libarchive does not
44
+ imply that a program that uses libarchive will support that format.
45
+ Applications that use libarchive specify which formats they wish
46
+ to support, though many programs do use libarchive convenience
47
+ functions to enable all supported formats.
48
+ .Ss Tar Formats
49
+ The
50
+ .Xr libarchive 3
51
+ library can read most tar archives.
52
+ It can write POSIX-standard
53
+ .Dq ustar
54
+ and
55
+ .Dq pax interchange
56
+ formats as well as v7 tar format and a subset of the legacy GNU tar format.
57
+ .Pp
58
+ All tar formats store each entry in one or more 512-byte records.
59
+ The first record is used for file metadata, including filename,
60
+ timestamp, and mode information, and the file data is stored in
61
+ subsequent records.
62
+ Later variants have extended this by either appropriating undefined
63
+ areas of the header record, extending the header to multiple records,
64
+ or by storing special entries that modify the interpretation of
65
+ subsequent entries.
66
+ .Bl -tag -width indent
67
+ .It Cm gnutar
68
+ The
69
+ .Xr libarchive 3
70
+ library can read most GNU-format tar archives.
71
+ It currently supports the most popular GNU extensions, including
72
+ modern long filename and linkname support, as well as atime and ctime data.
73
+ The libarchive library does not support multi-volume
74
+ archives, nor the old GNU long filename format.
75
+ It can read GNU sparse file entries, including the new POSIX-based
76
+ formats.
77
+ .Pp
78
+ The
79
+ .Xr libarchive 3
80
+ library can write GNU tar format, including long filename
81
+ and linkname support, as well as atime and ctime data.
82
+ .It Cm pax
83
+ The
84
+ .Xr libarchive 3
85
+ library can read and write POSIX-compliant pax interchange format
86
+ archives.
87
+ Pax interchange format archives are an extension of the older ustar
88
+ format that adds a separate entry with additional attributes stored
89
+ as key/value pairs immediately before each regular entry.
90
+ The presence of these additional entries is the only difference between
91
+ pax interchange format and the older ustar format.
92
+ The extended attributes are of unlimited length and are stored
93
+ as UTF-8 Unicode strings.
94
+ Keywords defined in the standard are in all lowercase; vendors are allowed
95
+ to define custom keys by preceding them with the vendor name in all uppercase.
96
+ When writing pax archives, libarchive uses many of the SCHILY keys
97
+ defined by Joerg Schilling's
98
+ .Dq star
99
+ archiver and a few LIBARCHIVE keys.
100
+ The libarchive library can read most of the SCHILY keys
101
+ and most of the GNU keys introduced by GNU tar.
102
+ It silently ignores any keywords that it does not understand.
103
+ .Pp
104
+ The pax interchange format converts filenames to Unicode
105
+ and stores them using the UTF-8 encoding.
106
+ Prior to libarchive 3.0, libarchive erroneously assumed
107
+ that the system wide-character routines natively supported
108
+ Unicode.
109
+ This caused it to mis-handle non-ASCII filenames on systems
110
+ that did not satisfy this assumption.
111
+ .It Cm restricted pax
112
+ The libarchive library can also write pax archives in which it
113
+ attempts to suppress the extended attributes entry whenever
114
+ possible.
115
+ The result will be identical to a ustar archive unless the
116
+ extended attributes entry is required to store a long file
117
+ name, long linkname, extended ACL, file flags, or if any of the standard
118
+ ustar data (user name, group name, UID, GID, etc) cannot be fully
119
+ represented in the ustar header.
120
+ In all cases, the result can be dearchived by any program that
121
+ can read POSIX-compliant pax interchange format archives.
122
+ Programs that correctly read ustar format (see below) will also be
123
+ able to read this format; any extended attributes will be extracted as
124
+ separate files stored in
125
+ .Pa PaxHeader
126
+ directories.
127
+ .It Cm ustar
128
+ The libarchive library can both read and write this format.
129
+ This format has the following limitations:
130
+ .Bl -bullet -compact
131
+ .It
132
+ Device major and minor numbers are limited to 21 bits.
133
+ Nodes with larger numbers will not be added to the archive.
134
+ .It
135
+ Path names in the archive are limited to 255 bytes.
136
+ (Shorter if there is no / character in exactly the right place.)
137
+ .It
138
+ Symbolic links and hard links are stored in the archive with
139
+ the name of the referenced file.
140
+ This name is limited to 100 bytes.
141
+ .It
142
+ Extended attributes, file flags, and other extended
143
+ security information cannot be stored.
144
+ .It
145
+ Archive entries are limited to 8 gigabytes in size.
146
+ .El
147
+ Note that the pax interchange format has none of these restrictions.
148
+ The ustar format is old and widely supported.
149
+ It is recommended when compatibility is the primary concern.
150
+ .It Cm v7
151
+ The libarchive library can read and write the legacy v7 tar format.
152
+ This format has the following limitations:
153
+ .Bl -bullet -compact
154
+ .It
155
+ Only regular files, directories, and symbolic links can be archived.
156
+ Block and character device nodes, FIFOs, and sockets cannot be archived.
157
+ .It
158
+ Path names in the archive are limited to 100 bytes.
159
+ .It
160
+ Symbolic links and hard links are stored in the archive with
161
+ the name of the referenced file.
162
+ This name is limited to 100 bytes.
163
+ .It
164
+ User and group information are stored as numeric IDs; there
165
+ is no provision for storing user or group names.
166
+ .It
167
+ Extended attributes, file flags, and other extended
168
+ security information cannot be stored.
169
+ .It
170
+ Archive entries are limited to 8 gigabytes in size.
171
+ .El
172
+ Generally, users should prefer the ustar format for portability
173
+ as the v7 tar format is both less useful and less portable.
174
+ .El
175
+ .Pp
176
+ The libarchive library also reads a variety of commonly-used extensions to
177
+ the basic tar format.
178
+ These extensions are recognized automatically whenever they appear.
179
+ .Bl -tag -width indent
180
+ .It Numeric extensions.
181
+ The POSIX standards require fixed-length numeric fields to be written with
182
+ some character position reserved for terminators.
183
+ Libarchive allows these fields to be written without terminator characters.
184
+ This extends the allowable range; in particular, ustar archives with this
185
+ extension can support entries up to 64 gigabytes in size.
186
+ Libarchive also recognizes base-256 values in most numeric fields.
187
+ This essentially removes all limitations on file size, modification time,
188
+ and device numbers.
189
+ .It Solaris extensions
190
+ Libarchive recognizes ACL and extended attribute records written
191
+ by Solaris tar.
192
+ .El
193
+ .Pp
194
+ The first tar program appeared in Seventh Edition Unix in 1979.
195
+ The first official standard for the tar file format was the
196
+ .Dq ustar
197
+ (Unix Standard Tar) format defined by POSIX in 1988.
198
+ POSIX.1-2001 extended the ustar format to create the
199
+ .Dq pax interchange
200
+ format.
201
+ .Ss Cpio Formats
202
+ The libarchive library can read and write a number of common cpio
203
+ variants. A cpio archive stores each entry as a fixed-size header
204
+ followed by a variable-length filename and variable-length data.
205
+ Unlike the tar format, the cpio format does only minimal padding of
206
+ the header or file data. There are several cpio variants, which
207
+ differ primarily in how they store the initial header: some store the
208
+ values as octal or hexadecimal numbers in ASCII, others as binary
209
+ values of varying byte order and length.
210
+ .Bl -tag -width indent
211
+ .It Cm binary
212
+ The libarchive library transparently reads both big-endian and
213
+ little-endian variants of the two binary cpio formats; the
214
+ original one from PWB/UNIX, and the later, more widely used, variant.
215
+ This format used 32-bit binary values for file size and mtime, and
216
+ 16-bit binary values for the other fields. The formats support only
217
+ the file types present in UNIX at the time of their creation. File
218
+ sizes are limited to 24 bits in the PWB format, because of the limits
219
+ of the file system, and to 31 bits in the newer binary format, where
220
+ signed 32 bit longs were used.
221
+ .It Cm odc
222
+ This is the POSIX standardized format, which is officially known as the
223
+ .Dq cpio interchange format
224
+ or the
225
+ .Dq octet-oriented cpio archive format
226
+ and sometimes unofficially referred to as the
227
+ .Dq old character format .
228
+ This format stores the header contents as octal values in ASCII.
229
+ It is standard, portable, and immune from byte-order confusion.
230
+ File sizes and mtime are limited to 33 bits (8GB file size),
231
+ other fields are limited to 18 bits.
232
+ .It Cm SVR4/newc
233
+ The libarchive library can read both CRC and non-CRC variants of
234
+ this format.
235
+ The SVR4 format uses eight-digit hexadecimal values for
236
+ all header fields.
237
+ This limits file size to 4GB, and also limits the mtime and
238
+ other fields to 32 bits.
239
+ The SVR4 format can optionally include a CRC of the file
240
+ contents, although libarchive does not currently verify this CRC.
241
+ .El
242
+ .Pp
243
+ Cpio first appeared in PWB/UNIX 1.0, which was released within
244
+ AT&T in 1977.
245
+ PWB/UNIX 1.0 formed the basis of System III Unix, released outside
246
+ of AT&T in 1981.
247
+ This makes cpio older than tar, although cpio was not included
248
+ in Version 7 AT&T Unix.
249
+ As a result, the tar command became much better known in universities
250
+ and research groups that used Version 7.
251
+ The combination of the
252
+ .Nm find
253
+ and
254
+ .Nm cpio
255
+ utilities provided very precise control over file selection.
256
+ Unfortunately, the format has many limitations that make it unsuitable
257
+ for widespread use.
258
+ Only the POSIX format permits files over 4GB, and its 18-bit
259
+ limit for most other fields makes it unsuitable for modern systems.
260
+ In addition, cpio formats only store numeric UID/GID values (not
261
+ usernames and group names), which can make it very difficult to correctly
262
+ transfer archives across systems with dissimilar user numbering.
263
+ .Ss Shar Formats
264
+ A
265
+ .Dq shell archive
266
+ is a shell script that, when executed on a POSIX-compliant
267
+ system, will recreate a collection of file system objects.
268
+ The libarchive library can write two different kinds of shar archives:
269
+ .Bl -tag -width indent
270
+ .It Cm shar
271
+ The traditional shar format uses a limited set of POSIX
272
+ commands, including
273
+ .Xr echo 1 ,
274
+ .Xr mkdir 1 ,
275
+ and
276
+ .Xr sed 1 .
277
+ It is suitable for portably archiving small collections of plain text files.
278
+ However, it is not generally well-suited for large archives
279
+ (many implementations of
280
+ .Xr sh 1
281
+ have limits on the size of a script) nor should it be used with non-text files.
282
+ .It Cm shardump
283
+ This format is similar to shar but encodes files using
284
+ .Xr uuencode 1
285
+ so that the result will be a plain text file regardless of the file contents.
286
+ It also includes additional shell commands that attempt to reproduce as
287
+ many file attributes as possible, including owner, mode, and flags.
288
+ The additional commands used to restore file attributes make
289
+ shardump archives less portable than plain shar archives.
290
+ .El
291
+ .Ss ISO9660 format
292
+ Libarchive can read and extract from files containing ISO9660-compliant
293
+ CDROM images.
294
+ In many cases, this can remove the need to burn a physical CDROM
295
+ just in order to read the files contained in an ISO9660 image.
296
+ It also avoids security and complexity issues that come with
297
+ virtual mounts and loopback devices.
298
+ Libarchive supports the most common Rockridge extensions and has partial
299
+ support for Joliet extensions.
300
+ If both extensions are present, the Joliet extensions will be
301
+ used and the Rockridge extensions will be ignored.
302
+ In particular, this can create problems with hardlinks and symlinks,
303
+ which are supported by Rockridge but not by Joliet.
304
+ .Pp
305
+ Libarchive reads ISO9660 images using a streaming strategy.
306
+ This allows it to read compressed images directly
307
+ (decompressing on the fly) and allows it to read images
308
+ directly from network sockets, pipes, and other non-seekable
309
+ data sources.
310
+ This strategy works well for optimized ISO9660 images created
311
+ by many popular programs.
312
+ Such programs collect all directory information at the beginning
313
+ of the ISO9660 image so it can be read from a physical disk
314
+ with a minimum of seeking.
315
+ However, not all ISO9660 images can be read in this fashion.
316
+ .Pp
317
+ Libarchive can also write ISO9660 images.
318
+ Such images are fully optimized with the directory information
319
+ preceding all file data.
320
+ This is done by storing all file data to a temporary file
321
+ while collecting directory information in memory.
322
+ When the image is finished, libarchive writes out the
323
+ directory structure followed by the file data.
324
+ The location used for the temporary file can be changed
325
+ by the usual environment variables.
326
+ .Ss Zip format
327
+ Libarchive can read and write zip format archives that have
328
+ uncompressed entries and entries compressed with the
329
+ .Dq deflate
330
+ ,
331
+ .Dq LZMA
332
+ ,
333
+ .Dq XZ
334
+ ,
335
+ .Dq BZIP2
336
+ and
337
+ .Dq ZSTD
338
+ algorithms.
339
+ Libarchive can also read, but not write, zip format archives that
340
+ have entries compressed with the
341
+ .Dq PPMd
342
+ algorithm.
343
+ Other zip compression algorithms are not supported.
344
+ The extensions supported by libarchive are Zip64, Libarchive's
345
+ extensions to better support streaming, PKZIP's traditional
346
+ ZIP encryption, Info-ZIP's Unix extra fields, extra time, and
347
+ Unicode path, as well as WinZIP's AES encryption.
348
+ It can extract jar archives, __MACOSX resource forks extension
349
+ for OS X, and self-extracting zip archives.
350
+ Libarchive can use either of two different strategies for
351
+ reading Zip archives:
352
+ a streaming strategy which is fast and can handle extremely
353
+ large archives, and a seeking strategy which can correctly
354
+ process self-extracting Zip archives and archives with
355
+ deleted members or other in-place modifications.
356
+ .Pp
357
+ The streaming reader processes Zip archives as they are read.
358
+ It can read archives of arbitrary size from tape or
359
+ network sockets, and can decode Zip archives that have
360
+ been separately compressed or encoded.
361
+ However, self-extracting Zip archives and archives with
362
+ certain types of modifications cannot be correctly
363
+ handled.
364
+ Such archives require that the reader first process the
365
+ Central Directory, which is ordinarily located
366
+ at the end of a Zip archive and is thus inaccessible
367
+ to the streaming reader.
368
+ If the program using libarchive has enabled seek support, then
369
+ libarchive will use this to processes the central directory first.
370
+ .Pp
371
+ In particular, the seeking reader must be used to
372
+ correctly handle self-extracting archives.
373
+ Such archives consist of a program followed by a regular
374
+ Zip archive.
375
+ The streaming reader cannot parse the initial program
376
+ portion, but the seeking reader starts by reading the
377
+ Central Directory from the end of the archive.
378
+ Similarly, Zip archives that have been modified in-place
379
+ can have deleted entries or other garbage data that
380
+ can only be accurately detected by first reading the
381
+ Central Directory.
382
+ .Ss Archive (library) file format
383
+ The Unix archive format (commonly created by the
384
+ .Xr ar 1
385
+ archiver) is a general-purpose format which is
386
+ used almost exclusively for object files to be
387
+ read by the link editor
388
+ .Xr ld 1 .
389
+ The ar format has never been standardised.
390
+ There are two common variants:
391
+ the GNU format derived from SVR4,
392
+ and the BSD format, which first appeared in 4.4BSD.
393
+ The two differ primarily in their handling of filenames
394
+ longer than 15 characters:
395
+ the GNU/SVR4 variant writes a filename table at the beginning of the archive;
396
+ the BSD format stores each long filename in an extension
397
+ area adjacent to the entry.
398
+ Libarchive can read both extensions,
399
+ including archives that may include both types of long filenames.
400
+ Programs using libarchive can write GNU/SVR4 format
401
+ if they provide an entry called
402
+ .Pa //
403
+ containing a filename table to be written into the archive
404
+ before any of the entries.
405
+ Any entries whose names are not in the filename table
406
+ will be written using BSD-style long filenames.
407
+ This can cause problems for programs such as
408
+ GNU ld that do not support the BSD-style long filenames.
409
+ .Ss mtree
410
+ Libarchive can read and write files in
411
+ .Xr mtree 5
412
+ format.
413
+ This format is not a true archive format, but rather a textual description
414
+ of a file hierarchy in which each line specifies the name of a file and
415
+ provides specific metadata about that file.
416
+ Libarchive can read all of the keywords supported by both
417
+ the NetBSD and FreeBSD versions of
418
+ .Xr mtree 8 ,
419
+ although many of the keywords cannot currently be stored in an
420
+ .Tn archive_entry
421
+ object.
422
+ When writing, libarchive supports use of the
423
+ .Xr archive_write_set_options 3
424
+ interface to specify which keywords should be included in the
425
+ output.
426
+ If libarchive was compiled with access to suitable
427
+ cryptographic libraries (such as the OpenSSL libraries),
428
+ it can compute hash entries such as
429
+ .Cm sha512
430
+ or
431
+ .Cm md5
432
+ from file data being written to the mtree writer.
433
+ .Pp
434
+ When reading an mtree file, libarchive will locate the corresponding
435
+ files on disk using the
436
+ .Cm contents
437
+ keyword if present or the regular filename.
438
+ If it can locate and open the file on disk, it will use that
439
+ to fill in any metadata that is missing from the mtree file
440
+ and will read the file contents and return those to the program
441
+ using libarchive.
442
+ If it cannot locate and open the file on disk, libarchive
443
+ will return an error for any attempt to read the entry
444
+ body.
445
+ .Ss 7-Zip
446
+ Libarchive can read and write 7-Zip format archives.
447
+ TODO: Need more information
448
+ .Ss CAB
449
+ Libarchive can read Microsoft Cabinet (
450
+ .Dq CAB )
451
+ format archives.
452
+ TODO: Need more information.
453
+ .Ss LHA
454
+ TODO: Information about libarchive's LHA support
455
+ .Ss RAR
456
+ Libarchive has limited support for reading RAR format archives.
457
+ Currently, libarchive can read RARv3 format archives
458
+ which have been either created uncompressed, or compressed using
459
+ any of the compression methods supported by the RARv3 format.
460
+ Libarchive can also read self-extracting RAR archives.
461
+ .Ss Warc
462
+ Libarchive can read and write
463
+ .Dq web archives .
464
+ TODO: Need more information
465
+ .Ss XAR
466
+ Libarchive can read and write the XAR format used by many Apple tools.
467
+ TODO: Need more information
468
+ .Sh SEE ALSO
469
+ .Xr ar 1 ,
470
+ .Xr cpio 1 ,
471
+ .Xr mkisofs 1 ,
472
+ .Xr shar 1 ,
473
+ .Xr tar 1 ,
474
+ .Xr zip 1 ,
475
+ .Xr zlib 3 ,
476
+ .Xr cpio 5 ,
477
+ .Xr mtree 5 ,
478
+ .Xr tar 5