@papyrus-sdk/engine-native 0.2.22-beta.9.epub.1 → 0.2.22-beta.9.epub.2

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 (276) hide show
  1. package/android/build.gradle +0 -1
  2. package/android/src/main/cpp/CMakeLists.txt +0 -137
  3. package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.java +35 -305
  4. package/android/src/main/java/com/papyrus/engine/PapyrusPackage.java +1 -3
  5. package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerView.java +5 -195
  6. package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerViewManager.java +1 -20
  7. package/dist/index.d.mts +4 -614
  8. package/dist/index.d.ts +4 -614
  9. package/dist/index.js +8 -484
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +7 -477
  12. package/dist/index.mjs.map +1 -1
  13. package/ios/PapyrusEngineStore.h +0 -3
  14. package/ios/PapyrusEngineStore.m +6 -32
  15. package/ios/PapyrusNativeEngine.m +5 -684
  16. package/ios/PapyrusNativeEngine.podspec +15 -0
  17. package/ios/PapyrusPageView.m +11 -38
  18. package/package.json +8 -10
  19. package/react-native.config.js +1 -1
  20. package/PapyrusNativeEngine.podspec +0 -45
  21. package/android/src/main/cpp/PapyrusComicArchiveJni.cpp +0 -68
  22. package/android/src/main/cpp/PapyrusComicArchiveTest.cpp +0 -55
  23. package/android/src/main/cpp/papyrus_outline_loader_test.cpp +0 -240
  24. package/android/src/main/cpp/papyrus_text_word_test.cpp +0 -72
  25. package/android/src/main/java/com/papyrus/engine/PapyrusComicArchiveNative.java +0 -14
  26. package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentView.java +0 -491
  27. package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentViewManager.java +0 -32
  28. package/android/src/main/java/com/papyrus/engine/PapyrusComicPageLayout.java +0 -38
  29. package/android/src/main/java/com/papyrus/engine/PapyrusNativeTextModel.java +0 -195
  30. package/android/src/main/java/com/papyrus/engine/PapyrusSelectionMenuIcon.java +0 -48
  31. package/android/src/main/java/com/papyrus/engine/PapyrusTextAnnotationModel.java +0 -22
  32. package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentView.java +0 -661
  33. package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentViewManager.java +0 -49
  34. package/android/src/main/java/com/papyrus/engine/PapyrusTextStore.java +0 -43
  35. package/ios/PapyrusComicDocumentView.h +0 -21
  36. package/ios/PapyrusComicDocumentView.m +0 -554
  37. package/ios/PapyrusComicDocumentViewManager.m +0 -23
  38. package/ios/PapyrusPageRotationRegistry.h +0 -29
  39. package/ios/PapyrusPageRotationRegistry.m +0 -179
  40. package/ios/PapyrusPdfDocumentView.h +0 -55
  41. package/ios/PapyrusPdfDocumentView.m +0 -2339
  42. package/ios/PapyrusPdfDocumentViewManager.m +0 -61
  43. package/ios/PapyrusPdfPageTheme.h +0 -15
  44. package/ios/PapyrusPdfPageTheme.m +0 -218
  45. package/ios/PapyrusSelectionMenu.h +0 -27
  46. package/ios/PapyrusTextAnnotationRange.h +0 -2
  47. package/ios/PapyrusTextAnnotationRange.m +0 -29
  48. package/ios/PapyrusTextDocumentView.h +0 -32
  49. package/ios/PapyrusTextDocumentView.m +0 -518
  50. package/ios/PapyrusTextDocumentViewManager.m +0 -34
  51. package/ios/PapyrusTextStore.h +0 -13
  52. package/ios/PapyrusTextStore.m +0 -73
  53. package/third_party_licenses/BLAKE2-NOTICE.txt +0 -11
  54. package/third_party_licenses/libarchive-COPYING +0 -65
  55. package/vendor/libarchive/PapyrusComicArchive.cpp +0 -376
  56. package/vendor/libarchive/PapyrusComicArchive.h +0 -30
  57. package/vendor/libarchive/README.papyrus.md +0 -15
  58. package/vendor/libarchive/android.h +0 -192
  59. package/vendor/libarchive/config/PapyrusArchiveConfig.h +0 -71
  60. package/vendor/libarchive/libarchive/CMakeLists.txt +0 -293
  61. package/vendor/libarchive/libarchive/android_lf.h +0 -36
  62. package/vendor/libarchive/libarchive/archive.h +0 -1266
  63. package/vendor/libarchive/libarchive/archive_acl.c +0 -2025
  64. package/vendor/libarchive/libarchive/archive_acl_private.h +0 -85
  65. package/vendor/libarchive/libarchive/archive_blake2.h +0 -197
  66. package/vendor/libarchive/libarchive/archive_blake2_impl.h +0 -161
  67. package/vendor/libarchive/libarchive/archive_blake2s_ref.c +0 -369
  68. package/vendor/libarchive/libarchive/archive_blake2sp_ref.c +0 -361
  69. package/vendor/libarchive/libarchive/archive_check_magic.c +0 -183
  70. package/vendor/libarchive/libarchive/archive_cmdline.c +0 -211
  71. package/vendor/libarchive/libarchive/archive_cmdline_private.h +0 -45
  72. package/vendor/libarchive/libarchive/archive_crc32.h +0 -123
  73. package/vendor/libarchive/libarchive/archive_cryptor.c +0 -534
  74. package/vendor/libarchive/libarchive/archive_cryptor_private.h +0 -199
  75. package/vendor/libarchive/libarchive/archive_digest.c +0 -1584
  76. package/vendor/libarchive/libarchive/archive_digest_private.h +0 -431
  77. package/vendor/libarchive/libarchive/archive_disk_acl_darwin.c +0 -558
  78. package/vendor/libarchive/libarchive/archive_disk_acl_freebsd.c +0 -712
  79. package/vendor/libarchive/libarchive/archive_disk_acl_linux.c +0 -760
  80. package/vendor/libarchive/libarchive/archive_disk_acl_sunos.c +0 -824
  81. package/vendor/libarchive/libarchive/archive_endian.h +0 -234
  82. package/vendor/libarchive/libarchive/archive_entry.3 +0 -147
  83. package/vendor/libarchive/libarchive/archive_entry.c +0 -2297
  84. package/vendor/libarchive/libarchive/archive_entry.h +0 -763
  85. package/vendor/libarchive/libarchive/archive_entry_acl.3 +0 -458
  86. package/vendor/libarchive/libarchive/archive_entry_copy_bhfi.c +0 -55
  87. package/vendor/libarchive/libarchive/archive_entry_copy_stat.c +0 -82
  88. package/vendor/libarchive/libarchive/archive_entry_link_resolver.c +0 -472
  89. package/vendor/libarchive/libarchive/archive_entry_linkify.3 +0 -224
  90. package/vendor/libarchive/libarchive/archive_entry_locale.h +0 -90
  91. package/vendor/libarchive/libarchive/archive_entry_misc.3 +0 -63
  92. package/vendor/libarchive/libarchive/archive_entry_paths.3 +0 -153
  93. package/vendor/libarchive/libarchive/archive_entry_perms.3 +0 -210
  94. package/vendor/libarchive/libarchive/archive_entry_private.h +0 -205
  95. package/vendor/libarchive/libarchive/archive_entry_sparse.c +0 -156
  96. package/vendor/libarchive/libarchive/archive_entry_stat.3 +0 -274
  97. package/vendor/libarchive/libarchive/archive_entry_stat.c +0 -121
  98. package/vendor/libarchive/libarchive/archive_entry_strmode.c +0 -69
  99. package/vendor/libarchive/libarchive/archive_entry_time.3 +0 -127
  100. package/vendor/libarchive/libarchive/archive_entry_xattr.c +0 -155
  101. package/vendor/libarchive/libarchive/archive_hmac.c +0 -345
  102. package/vendor/libarchive/libarchive/archive_hmac_private.h +0 -119
  103. package/vendor/libarchive/libarchive/archive_integer.h +0 -267
  104. package/vendor/libarchive/libarchive/archive_match.c +0 -1869
  105. package/vendor/libarchive/libarchive/archive_openssl_evp_private.h +0 -54
  106. package/vendor/libarchive/libarchive/archive_openssl_hmac_private.h +0 -54
  107. package/vendor/libarchive/libarchive/archive_options.c +0 -219
  108. package/vendor/libarchive/libarchive/archive_options_private.h +0 -49
  109. package/vendor/libarchive/libarchive/archive_pack_dev.c +0 -330
  110. package/vendor/libarchive/libarchive/archive_pack_dev.h +0 -49
  111. package/vendor/libarchive/libarchive/archive_parse_date.c +0 -1173
  112. package/vendor/libarchive/libarchive/archive_pathmatch.c +0 -480
  113. package/vendor/libarchive/libarchive/archive_pathmatch.h +0 -50
  114. package/vendor/libarchive/libarchive/archive_platform.h +0 -213
  115. package/vendor/libarchive/libarchive/archive_platform_acl.h +0 -53
  116. package/vendor/libarchive/libarchive/archive_platform_stat.h +0 -45
  117. package/vendor/libarchive/libarchive/archive_platform_xattr.h +0 -45
  118. package/vendor/libarchive/libarchive/archive_ppmd7.c +0 -1173
  119. package/vendor/libarchive/libarchive/archive_ppmd7_private.h +0 -119
  120. package/vendor/libarchive/libarchive/archive_ppmd8.c +0 -1293
  121. package/vendor/libarchive/libarchive/archive_ppmd8_private.h +0 -123
  122. package/vendor/libarchive/libarchive/archive_ppmd_private.h +0 -159
  123. package/vendor/libarchive/libarchive/archive_private.h +0 -209
  124. package/vendor/libarchive/libarchive/archive_random.c +0 -274
  125. package/vendor/libarchive/libarchive/archive_random_private.h +0 -36
  126. package/vendor/libarchive/libarchive/archive_rb.c +0 -709
  127. package/vendor/libarchive/libarchive/archive_rb.h +0 -113
  128. package/vendor/libarchive/libarchive/archive_read.3 +0 -250
  129. package/vendor/libarchive/libarchive/archive_read.c +0 -1814
  130. package/vendor/libarchive/libarchive/archive_read_add_passphrase.3 +0 -72
  131. package/vendor/libarchive/libarchive/archive_read_add_passphrase.c +0 -189
  132. package/vendor/libarchive/libarchive/archive_read_append_filter.c +0 -209
  133. package/vendor/libarchive/libarchive/archive_read_data.3 +0 -128
  134. package/vendor/libarchive/libarchive/archive_read_data_into_fd.c +0 -207
  135. package/vendor/libarchive/libarchive/archive_read_disk.3 +0 -422
  136. package/vendor/libarchive/libarchive/archive_read_disk_entry_from_file.c +0 -1086
  137. package/vendor/libarchive/libarchive/archive_read_disk_posix.c +0 -2639
  138. package/vendor/libarchive/libarchive/archive_read_disk_private.h +0 -97
  139. package/vendor/libarchive/libarchive/archive_read_disk_set_standard_lookup.c +0 -315
  140. package/vendor/libarchive/libarchive/archive_read_disk_windows.c +0 -2603
  141. package/vendor/libarchive/libarchive/archive_read_extract.3 +0 -135
  142. package/vendor/libarchive/libarchive/archive_read_extract.c +0 -59
  143. package/vendor/libarchive/libarchive/archive_read_extract2.c +0 -154
  144. package/vendor/libarchive/libarchive/archive_read_filter.3 +0 -163
  145. package/vendor/libarchive/libarchive/archive_read_format.3 +0 -190
  146. package/vendor/libarchive/libarchive/archive_read_free.3 +0 -91
  147. package/vendor/libarchive/libarchive/archive_read_header.3 +0 -89
  148. package/vendor/libarchive/libarchive/archive_read_new.3 +0 -57
  149. package/vendor/libarchive/libarchive/archive_read_open.3 +0 -247
  150. package/vendor/libarchive/libarchive/archive_read_open_fd.c +0 -236
  151. package/vendor/libarchive/libarchive/archive_read_open_file.c +0 -257
  152. package/vendor/libarchive/libarchive/archive_read_open_filename.c +0 -652
  153. package/vendor/libarchive/libarchive/archive_read_open_memory.c +0 -188
  154. package/vendor/libarchive/libarchive/archive_read_private.h +0 -274
  155. package/vendor/libarchive/libarchive/archive_read_set_format.c +0 -116
  156. package/vendor/libarchive/libarchive/archive_read_set_options.3 +0 -290
  157. package/vendor/libarchive/libarchive/archive_read_set_options.c +0 -132
  158. package/vendor/libarchive/libarchive/archive_read_support_filter_all.c +0 -84
  159. package/vendor/libarchive/libarchive/archive_read_support_filter_by_code.c +0 -68
  160. package/vendor/libarchive/libarchive/archive_read_support_filter_bzip2.c +0 -360
  161. package/vendor/libarchive/libarchive/archive_read_support_filter_compress.c +0 -457
  162. package/vendor/libarchive/libarchive/archive_read_support_filter_grzip.c +0 -108
  163. package/vendor/libarchive/libarchive/archive_read_support_filter_gzip.c +0 -538
  164. package/vendor/libarchive/libarchive/archive_read_support_filter_lrzip.c +0 -119
  165. package/vendor/libarchive/libarchive/archive_read_support_filter_lz4.c +0 -829
  166. package/vendor/libarchive/libarchive/archive_read_support_filter_lzop.c +0 -493
  167. package/vendor/libarchive/libarchive/archive_read_support_filter_none.c +0 -51
  168. package/vendor/libarchive/libarchive/archive_read_support_filter_program.c +0 -497
  169. package/vendor/libarchive/libarchive/archive_read_support_filter_rpm.c +0 -249
  170. package/vendor/libarchive/libarchive/archive_read_support_filter_uu.c +0 -739
  171. package/vendor/libarchive/libarchive/archive_read_support_filter_xz.c +0 -792
  172. package/vendor/libarchive/libarchive/archive_read_support_filter_zstd.c +0 -356
  173. package/vendor/libarchive/libarchive/archive_read_support_format_7zip.c +0 -4650
  174. package/vendor/libarchive/libarchive/archive_read_support_format_all.c +0 -88
  175. package/vendor/libarchive/libarchive/archive_read_support_format_ar.c +0 -597
  176. package/vendor/libarchive/libarchive/archive_read_support_format_by_code.c +0 -76
  177. package/vendor/libarchive/libarchive/archive_read_support_format_cab.c +0 -3410
  178. package/vendor/libarchive/libarchive/archive_read_support_format_cpio.c +0 -1152
  179. package/vendor/libarchive/libarchive/archive_read_support_format_empty.c +0 -95
  180. package/vendor/libarchive/libarchive/archive_read_support_format_iso9660.c +0 -3516
  181. package/vendor/libarchive/libarchive/archive_read_support_format_lha.c +0 -2931
  182. package/vendor/libarchive/libarchive/archive_read_support_format_mtree.c +0 -2113
  183. package/vendor/libarchive/libarchive/archive_read_support_format_rar.c +0 -3932
  184. package/vendor/libarchive/libarchive/archive_read_support_format_rar5.c +0 -4501
  185. package/vendor/libarchive/libarchive/archive_read_support_format_raw.c +0 -194
  186. package/vendor/libarchive/libarchive/archive_read_support_format_tar.c +0 -3785
  187. package/vendor/libarchive/libarchive/archive_read_support_format_warc.c +0 -875
  188. package/vendor/libarchive/libarchive/archive_read_support_format_xar.c +0 -3770
  189. package/vendor/libarchive/libarchive/archive_read_support_format_zip.c +0 -4710
  190. package/vendor/libarchive/libarchive/archive_string.c +0 -4391
  191. package/vendor/libarchive/libarchive/archive_string.h +0 -244
  192. package/vendor/libarchive/libarchive/archive_string_composition.h +0 -2289
  193. package/vendor/libarchive/libarchive/archive_string_sprintf.c +0 -200
  194. package/vendor/libarchive/libarchive/archive_time.c +0 -168
  195. package/vendor/libarchive/libarchive/archive_time_private.h +0 -47
  196. package/vendor/libarchive/libarchive/archive_util.3 +0 -239
  197. package/vendor/libarchive/libarchive/archive_util.c +0 -668
  198. package/vendor/libarchive/libarchive/archive_version_details.c +0 -516
  199. package/vendor/libarchive/libarchive/archive_virtual.c +0 -162
  200. package/vendor/libarchive/libarchive/archive_windows.c +0 -1035
  201. package/vendor/libarchive/libarchive/archive_windows.h +0 -332
  202. package/vendor/libarchive/libarchive/archive_write.3 +0 -266
  203. package/vendor/libarchive/libarchive/archive_write.c +0 -896
  204. package/vendor/libarchive/libarchive/archive_write_add_filter.c +0 -71
  205. package/vendor/libarchive/libarchive/archive_write_add_filter_b64encode.c +0 -329
  206. package/vendor/libarchive/libarchive/archive_write_add_filter_by_name.c +0 -76
  207. package/vendor/libarchive/libarchive/archive_write_add_filter_bzip2.c +0 -411
  208. package/vendor/libarchive/libarchive/archive_write_add_filter_compress.c +0 -459
  209. package/vendor/libarchive/libarchive/archive_write_add_filter_grzip.c +0 -143
  210. package/vendor/libarchive/libarchive/archive_write_add_filter_gzip.c +0 -493
  211. package/vendor/libarchive/libarchive/archive_write_add_filter_lrzip.c +0 -214
  212. package/vendor/libarchive/libarchive/archive_write_add_filter_lz4.c +0 -710
  213. package/vendor/libarchive/libarchive/archive_write_add_filter_lzop.c +0 -500
  214. package/vendor/libarchive/libarchive/archive_write_add_filter_none.c +0 -42
  215. package/vendor/libarchive/libarchive/archive_write_add_filter_program.c +0 -398
  216. package/vendor/libarchive/libarchive/archive_write_add_filter_uuencode.c +0 -320
  217. package/vendor/libarchive/libarchive/archive_write_add_filter_xz.c +0 -547
  218. package/vendor/libarchive/libarchive/archive_write_add_filter_zstd.c +0 -608
  219. package/vendor/libarchive/libarchive/archive_write_blocksize.3 +0 -112
  220. package/vendor/libarchive/libarchive/archive_write_data.3 +0 -88
  221. package/vendor/libarchive/libarchive/archive_write_disk.3 +0 -360
  222. package/vendor/libarchive/libarchive/archive_write_disk_posix.c +0 -4789
  223. package/vendor/libarchive/libarchive/archive_write_disk_private.h +0 -43
  224. package/vendor/libarchive/libarchive/archive_write_disk_set_standard_lookup.c +0 -265
  225. package/vendor/libarchive/libarchive/archive_write_disk_windows.c +0 -2952
  226. package/vendor/libarchive/libarchive/archive_write_filter.3 +0 -140
  227. package/vendor/libarchive/libarchive/archive_write_finish_entry.3 +0 -77
  228. package/vendor/libarchive/libarchive/archive_write_format.3 +0 -187
  229. package/vendor/libarchive/libarchive/archive_write_free.3 +0 -94
  230. package/vendor/libarchive/libarchive/archive_write_header.3 +0 -71
  231. package/vendor/libarchive/libarchive/archive_write_new.3 +0 -56
  232. package/vendor/libarchive/libarchive/archive_write_open.3 +0 -270
  233. package/vendor/libarchive/libarchive/archive_write_open_fd.c +0 -141
  234. package/vendor/libarchive/libarchive/archive_write_open_file.c +0 -102
  235. package/vendor/libarchive/libarchive/archive_write_open_filename.c +0 -272
  236. package/vendor/libarchive/libarchive/archive_write_open_memory.c +0 -110
  237. package/vendor/libarchive/libarchive/archive_write_private.h +0 -166
  238. package/vendor/libarchive/libarchive/archive_write_set_format.c +0 -124
  239. package/vendor/libarchive/libarchive/archive_write_set_format_7zip.c +0 -2571
  240. package/vendor/libarchive/libarchive/archive_write_set_format_ar.c +0 -540
  241. package/vendor/libarchive/libarchive/archive_write_set_format_by_name.c +0 -93
  242. package/vendor/libarchive/libarchive/archive_write_set_format_cpio.c +0 -11
  243. package/vendor/libarchive/libarchive/archive_write_set_format_cpio_binary.c +0 -618
  244. package/vendor/libarchive/libarchive/archive_write_set_format_cpio_newc.c +0 -457
  245. package/vendor/libarchive/libarchive/archive_write_set_format_cpio_odc.c +0 -508
  246. package/vendor/libarchive/libarchive/archive_write_set_format_filter_by_ext.c +0 -141
  247. package/vendor/libarchive/libarchive/archive_write_set_format_gnutar.c +0 -790
  248. package/vendor/libarchive/libarchive/archive_write_set_format_iso9660.c +0 -8216
  249. package/vendor/libarchive/libarchive/archive_write_set_format_mtree.c +0 -2307
  250. package/vendor/libarchive/libarchive/archive_write_set_format_pax.c +0 -2249
  251. package/vendor/libarchive/libarchive/archive_write_set_format_private.h +0 -40
  252. package/vendor/libarchive/libarchive/archive_write_set_format_raw.c +0 -123
  253. package/vendor/libarchive/libarchive/archive_write_set_format_shar.c +0 -650
  254. package/vendor/libarchive/libarchive/archive_write_set_format_ustar.c +0 -768
  255. package/vendor/libarchive/libarchive/archive_write_set_format_v7tar.c +0 -648
  256. package/vendor/libarchive/libarchive/archive_write_set_format_warc.c +0 -491
  257. package/vendor/libarchive/libarchive/archive_write_set_format_xar.c +0 -3799
  258. package/vendor/libarchive/libarchive/archive_write_set_format_zip.c +0 -2548
  259. package/vendor/libarchive/libarchive/archive_write_set_options.3 +0 -779
  260. package/vendor/libarchive/libarchive/archive_write_set_options.c +0 -129
  261. package/vendor/libarchive/libarchive/archive_write_set_passphrase.3 +0 -72
  262. package/vendor/libarchive/libarchive/archive_write_set_passphrase.c +0 -95
  263. package/vendor/libarchive/libarchive/archive_xxhash.h +0 -48
  264. package/vendor/libarchive/libarchive/config_freebsd.h +0 -275
  265. package/vendor/libarchive/libarchive/cpio.5 +0 -389
  266. package/vendor/libarchive/libarchive/filter_fork.h +0 -44
  267. package/vendor/libarchive/libarchive/filter_fork_posix.c +0 -269
  268. package/vendor/libarchive/libarchive/filter_fork_windows.c +0 -270
  269. package/vendor/libarchive/libarchive/libarchive-formats.5 +0 -478
  270. package/vendor/libarchive/libarchive/libarchive.3 +0 -297
  271. package/vendor/libarchive/libarchive/libarchive_changes.3 +0 -339
  272. package/vendor/libarchive/libarchive/libarchive_internals.3 +0 -363
  273. package/vendor/libarchive/libarchive/module.modulemap +0 -34
  274. package/vendor/libarchive/libarchive/mtree.5 +0 -323
  275. package/vendor/libarchive/libarchive/tar.5 +0 -947
  276. package/vendor/libarchive/libarchive/xxhash.c +0 -531
@@ -1,363 +0,0 @@
1
- .\" Copyright (c) 2003-2007 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 January 26, 2011
26
- .Dt LIBARCHIVE_INTERNALS 3
27
- .Os
28
- .Sh NAME
29
- .Nm libarchive_internals
30
- .Nd description of libarchive internal interfaces
31
- .Sh OVERVIEW
32
- The
33
- .Nm libarchive
34
- library provides a flexible interface for reading and writing
35
- streaming archive files such as tar and cpio.
36
- Internally, it follows a modular layered design that should
37
- make it easy to add new archive and compression formats.
38
- .Sh GENERAL ARCHITECTURE
39
- Externally, libarchive exposes most operations through an
40
- opaque, object-style interface.
41
- The
42
- .Xr archive_entry 3
43
- objects store information about a single filesystem object.
44
- The rest of the library provides facilities to write
45
- .Xr archive_entry 3
46
- objects to archive files,
47
- read them from archive files,
48
- and write them to disk.
49
- (There are plans to add a facility to read
50
- .Xr archive_entry 3
51
- objects from disk as well.)
52
- .Pp
53
- The read and write APIs each have four layers: a public API
54
- layer, a format layer that understands the archive file format,
55
- a compression layer, and an I/O layer.
56
- The I/O layer is completely exposed to clients who can replace
57
- it entirely with their own functions.
58
- .Pp
59
- In order to provide as much consistency as possible for clients,
60
- some public functions are virtualized.
61
- Eventually, it should be possible for clients to open
62
- an archive or disk writer, and then use a single set of
63
- code to select and write entries, regardless of the target.
64
- .Sh READ ARCHITECTURE
65
- From the outside, clients use the
66
- .Xr archive_read 3
67
- API to manipulate an
68
- .Nm archive
69
- object to read entries and bodies from an archive stream.
70
- Internally, the
71
- .Nm archive
72
- object is cast to an
73
- .Nm archive_read
74
- object, which holds all read-specific data.
75
- The API has four layers:
76
- The lowest layer is the I/O layer.
77
- This layer can be overridden by clients, but most clients use
78
- the packaged I/O callbacks provided, for example, by
79
- .Xr archive_read_open_memory 3 ,
80
- and
81
- .Xr archive_read_open_fd 3 .
82
- The compression layer calls the I/O layer to
83
- read bytes and decompresses them for the format layer.
84
- The format layer unpacks a stream of uncompressed bytes and
85
- creates
86
- .Nm archive_entry
87
- objects from the incoming data.
88
- The API layer tracks overall state
89
- (for example, it prevents clients from reading data before reading a header)
90
- and invokes the format and compression layer operations
91
- through registered function pointers.
92
- In particular, the API layer drives the format-detection process:
93
- When opening the archive, it reads an initial block of data
94
- and offers it to each registered compression handler.
95
- The one with the highest bid is initialized with the first block.
96
- Similarly, the format handlers are polled to see which handler
97
- is the best for each archive.
98
- (Prior to 2.4.0, the format bidders were invoked for each
99
- entry, but this design hindered error recovery.)
100
- .Ss I/O Layer and Client Callbacks
101
- The read API goes to some lengths to be nice to clients.
102
- As a result, there are few restrictions on the behavior of
103
- the client callbacks.
104
- .Pp
105
- The client read callback is expected to provide a block
106
- of data on each call.
107
- A zero-length return does indicate end of file, but otherwise
108
- blocks may be as small as one byte or as large as the entire file.
109
- In particular, blocks may be of different sizes.
110
- .Pp
111
- The client skip callback returns the number of bytes actually
112
- skipped, which may be much smaller than the skip requested.
113
- The only requirement is that the skip not be larger.
114
- In particular, clients are allowed to return zero for any
115
- skip that they don't want to handle.
116
- The skip callback must never be invoked with a negative value.
117
- .Pp
118
- Keep in mind that not all clients are reading from disk:
119
- clients reading from networks may provide different-sized
120
- blocks on every request and cannot skip at all;
121
- advanced clients may use
122
- .Xr mmap 2
123
- to read the entire file into memory at once and return the
124
- entire file to libarchive as a single block;
125
- other clients may begin asynchronous I/O operations for the
126
- next block on each request.
127
- .Ss Decompression Layer
128
- The decompression layer not only handles decompression,
129
- it also buffers data so that the format handlers see a
130
- much nicer I/O model.
131
- The decompression API is a two stage peek/consume model.
132
- A read_ahead request specifies a minimum read amount;
133
- the decompression layer must provide a pointer to at least
134
- that much data.
135
- If more data is immediately available, it should return more:
136
- the format layer handles bulk data reads by asking for a minimum
137
- of one byte and then copying as much data as is available.
138
- .Pp
139
- A subsequent call to the
140
- .Fn consume
141
- function advances the read pointer.
142
- Note that data returned from a
143
- .Fn read_ahead
144
- call is guaranteed to remain in place until
145
- the next call to
146
- .Fn read_ahead .
147
- Intervening calls to
148
- .Fn consume
149
- should not cause the data to move.
150
- .Pp
151
- Skip requests must always be handled exactly.
152
- Decompression handlers that cannot seek forward should
153
- not register a skip handler;
154
- the API layer fills in a generic skip handler that reads and discards data.
155
- .Pp
156
- A decompression handler has a specific lifecycle:
157
- .Bl -tag -compact -width indent
158
- .It Registration/Configuration
159
- When the client invokes the public support function,
160
- the decompression handler invokes the internal
161
- .Fn __archive_read_register_compression
162
- function to provide bid and initialization functions.
163
- This function returns
164
- .Cm NULL
165
- on error or else a pointer to a
166
- .Cm struct decompressor_t .
167
- This structure contains a
168
- .Va void * config
169
- slot that can be used for storing any customization information.
170
- .It Bid
171
- The bid function is invoked with a pointer and size of a block of data.
172
- The decompressor can access its config data
173
- through the
174
- .Va decompressor
175
- element of the
176
- .Cm archive_read
177
- object.
178
- The bid function is otherwise stateless.
179
- In particular, it must not perform any I/O operations.
180
- .Pp
181
- The value returned by the bid function indicates its suitability
182
- for handling this data stream.
183
- A bid of zero will ensure that this decompressor is never invoked.
184
- Return zero if magic number checks fail.
185
- Otherwise, your initial implementation should return the number of bits
186
- actually checked.
187
- For example, if you verify two full bytes and three bits of another
188
- byte, bid 19.
189
- Note that the initial block may be very short;
190
- be careful to only inspect the data you are given.
191
- (The current decompressors require two bytes for correct bidding.)
192
- .It Initialize
193
- The winning bidder will have its init function called.
194
- This function should initialize the remaining slots of the
195
- .Va struct decompressor_t
196
- object pointed to by the
197
- .Va decompressor
198
- element of the
199
- .Va archive_read
200
- object.
201
- In particular, it should allocate any working data it needs
202
- in the
203
- .Va data
204
- slot of that structure.
205
- The init function is called with the block of data that
206
- was used for tasting.
207
- At this point, the decompressor is responsible for all I/O
208
- requests to the client callbacks.
209
- The decompressor is free to read more data as and when
210
- necessary.
211
- .It Satisfy I/O requests
212
- The format handler will invoke the
213
- .Va read_ahead ,
214
- .Va consume ,
215
- and
216
- .Va skip
217
- functions as needed.
218
- .It Finish
219
- The finish method is called only once when the archive is closed.
220
- It should release anything stored in the
221
- .Va data
222
- and
223
- .Va config
224
- slots of the
225
- .Va decompressor
226
- object.
227
- It should not invoke the client close callback.
228
- .El
229
- .Ss Format Layer
230
- The read formats have a similar lifecycle to the decompression handlers:
231
- .Bl -tag -compact -width indent
232
- .It Registration
233
- Allocate your private data and initialize your pointers.
234
- .It Bid
235
- Formats bid by invoking the
236
- .Fn read_ahead
237
- decompression method but not calling the
238
- .Fn consume
239
- method.
240
- This allows each bidder to look ahead in the input stream.
241
- Bidders should not look further ahead than necessary, as long
242
- look aheads put pressure on the decompression layer to buffer
243
- lots of data.
244
- Most formats only require a few hundred bytes of look ahead;
245
- look aheads of a few kilobytes are reasonable.
246
- (The ISO9660 reader sometimes looks ahead by 48k, which
247
- should be considered an upper limit.)
248
- .It Read header
249
- The header read is usually the most complex part of any format.
250
- There are a few strategies worth mentioning:
251
- For formats such as tar or cpio, reading and parsing the header is
252
- straightforward since headers alternate with data.
253
- For formats that store all header data at the beginning of the file,
254
- the first header read request may have to read all headers into
255
- memory and store that data, sorted by the location of the file
256
- data.
257
- Subsequent header read requests will skip forward to the
258
- beginning of the file data and return the corresponding header.
259
- .It Read Data
260
- The read data interface supports sparse files; this requires that
261
- each call return a block of data specifying the file offset and
262
- size.
263
- This may require you to carefully track the location so that you
264
- can return accurate file offsets for each read.
265
- Remember that the decompressor will return as much data as it has.
266
- Generally, you will want to request one byte,
267
- examine the return value to see how much data is available, and
268
- possibly trim that to the amount you can use.
269
- You should invoke consume for each block just before you return it.
270
- .It Skip All Data
271
- The skip data call should skip over all file data and trailing padding.
272
- This is called automatically by the API layer just before each
273
- header read.
274
- It is also called in response to the client calling the public
275
- .Fn data_skip
276
- function.
277
- .It Cleanup
278
- On cleanup, the format should release all of its allocated memory.
279
- .El
280
- .Ss API Layer
281
- XXX to do XXX
282
- .Sh WRITE ARCHITECTURE
283
- The write API has a similar set of four layers:
284
- an API layer, a format layer, a compression layer, and an I/O layer.
285
- The registration here is much simpler because only
286
- one format and one compression can be registered at a time.
287
- .Ss I/O Layer and Client Callbacks
288
- XXX To be written XXX
289
- .Ss Compression Layer
290
- XXX To be written XXX
291
- .Ss Format Layer
292
- XXX To be written XXX
293
- .Ss API Layer
294
- XXX To be written XXX
295
- .Sh WRITE_DISK ARCHITECTURE
296
- The write_disk API is intended to look just like the write API
297
- to clients.
298
- Since it does not handle multiple formats or compression, it
299
- is not layered internally.
300
- .Sh GENERAL SERVICES
301
- The
302
- .Nm archive_read ,
303
- .Nm archive_write ,
304
- and
305
- .Nm archive_write_disk
306
- objects all contain an initial
307
- .Nm archive
308
- object which provides common support for a set of standard services.
309
- (Recall that ANSI/ISO C90 guarantees that you can cast freely between
310
- a pointer to a structure and a pointer to the first element of that
311
- structure.)
312
- The
313
- .Nm archive
314
- object has a magic value that indicates which API this object
315
- is associated with,
316
- slots for storing error information,
317
- and function pointers for virtualized API functions.
318
- .Sh MISCELLANEOUS NOTES
319
- Connecting existing archiving libraries into libarchive is generally
320
- quite difficult.
321
- In particular, many existing libraries strongly assume that you
322
- are reading from a file; they seek forwards and backwards as necessary
323
- to locate various pieces of information.
324
- In contrast, libarchive never seeks backwards in its input, which
325
- sometimes requires very different approaches.
326
- .Pp
327
- For example, libarchive's ISO9660 support operates very differently
328
- from most ISO9660 readers.
329
- The libarchive support utilizes a work-queue design that
330
- keeps a list of known entries sorted by their location in the input.
331
- Whenever libarchive's ISO9660 implementation is asked for the next
332
- header, checks this list to find the next item on the disk.
333
- Directories are parsed when they are encountered and new
334
- items are added to the list.
335
- This design relies heavily on the ISO9660 image being optimized so that
336
- directories always occur earlier on the disk than the files they
337
- describe.
338
- .Pp
339
- Depending on the specific format, such approaches may not be possible.
340
- The ZIP format specification, for example, allows archivers to store
341
- key information only at the end of the file.
342
- In theory, it is possible to create ZIP archives that cannot
343
- be read without seeking.
344
- Fortunately, such archives are very rare, and libarchive can read
345
- most ZIP archives, though it cannot always extract as much information
346
- as a dedicated ZIP program.
347
- .Sh SEE ALSO
348
- .Xr archive_entry 3 ,
349
- .Xr archive_read 3 ,
350
- .Xr archive_write 3 ,
351
- .Xr archive_write_disk 3 ,
352
- .Xr libarchive 3
353
- .Sh HISTORY
354
- The
355
- .Nm libarchive
356
- library first appeared in
357
- .Fx 5.3 .
358
- .Sh AUTHORS
359
- .An -nosplit
360
- The
361
- .Nm libarchive
362
- library was written by
363
- .An Tim Kientzle Aq kientzle@acm.org .
@@ -1,34 +0,0 @@
1
- /*
2
- * Clang Module Map for libarchive
3
- *
4
- * What this is:
5
- * This file tells the Clang compiler how to treat libarchive as a "module" -
6
- * a self-contained unit of code that can be imported all at once instead of
7
- * including individual header files. Think of it like a package definition.
8
- *
9
- * How it works:
10
- * - When you write `@import CArchive` (Objective-C) or `import CArchive` (Swift),
11
- * the compiler uses this file to know which headers belong to libarchive
12
- * - Instead of processing each #include separately, the compiler can load a
13
- * pre-compiled version of the entire library, making builds faster
14
- * - This also provides better dependency tracking and can catch issues like
15
- * conflicting macro definitions between libraries
16
- *
17
- * When to update:
18
- * Update this file whenever:
19
- * - New public header files are added to libarchive's libarchive/ directory
20
- * - Public headers are removed or renamed
21
- * - The library's API structure changes significantly
22
- *
23
- * You typically don't need to update this for:
24
- * - Internal implementation changes
25
- * - Private/internal header modifications
26
- * - Documentation updates
27
- *
28
- * NOTE: This only affects projects using Clang with modules enabled. Traditional
29
- * #include-based builds will continue to work normally with or without this file.
30
- */
31
- module CArchive {
32
- header "archive.h"
33
- header "archive_entry.h"
34
- }