@papyrus-sdk/engine-native 0.2.22-beta.8 → 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 (274) 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 -608
  8. package/dist/index.d.ts +4 -608
  9. package/dist/index.js +8 -463
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +7 -456
  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 +4 -6
  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/java/com/papyrus/engine/PapyrusComicArchiveNative.java +0 -14
  24. package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentView.java +0 -491
  25. package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentViewManager.java +0 -32
  26. package/android/src/main/java/com/papyrus/engine/PapyrusComicPageLayout.java +0 -38
  27. package/android/src/main/java/com/papyrus/engine/PapyrusNativeTextModel.java +0 -195
  28. package/android/src/main/java/com/papyrus/engine/PapyrusSelectionMenuIcon.java +0 -48
  29. package/android/src/main/java/com/papyrus/engine/PapyrusTextAnnotationModel.java +0 -22
  30. package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentView.java +0 -661
  31. package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentViewManager.java +0 -49
  32. package/android/src/main/java/com/papyrus/engine/PapyrusTextStore.java +0 -43
  33. package/ios/PapyrusComicDocumentView.h +0 -21
  34. package/ios/PapyrusComicDocumentView.m +0 -547
  35. package/ios/PapyrusComicDocumentViewManager.m +0 -23
  36. package/ios/PapyrusPageRotationRegistry.h +0 -29
  37. package/ios/PapyrusPageRotationRegistry.m +0 -179
  38. package/ios/PapyrusPdfDocumentView.h +0 -55
  39. package/ios/PapyrusPdfDocumentView.m +0 -2338
  40. package/ios/PapyrusPdfDocumentViewManager.m +0 -61
  41. package/ios/PapyrusPdfPageTheme.h +0 -15
  42. package/ios/PapyrusPdfPageTheme.m +0 -218
  43. package/ios/PapyrusSelectionMenu.h +0 -27
  44. package/ios/PapyrusTextAnnotationRange.h +0 -2
  45. package/ios/PapyrusTextAnnotationRange.m +0 -29
  46. package/ios/PapyrusTextDocumentView.h +0 -32
  47. package/ios/PapyrusTextDocumentView.m +0 -518
  48. package/ios/PapyrusTextDocumentViewManager.m +0 -34
  49. package/ios/PapyrusTextStore.h +0 -13
  50. package/ios/PapyrusTextStore.m +0 -73
  51. package/third_party_licenses/BLAKE2-NOTICE.txt +0 -11
  52. package/third_party_licenses/libarchive-COPYING +0 -65
  53. package/vendor/libarchive/PapyrusComicArchive.cpp +0 -376
  54. package/vendor/libarchive/PapyrusComicArchive.h +0 -30
  55. package/vendor/libarchive/README.papyrus.md +0 -15
  56. package/vendor/libarchive/android.h +0 -192
  57. package/vendor/libarchive/config/PapyrusArchiveConfig.h +0 -71
  58. package/vendor/libarchive/libarchive/CMakeLists.txt +0 -293
  59. package/vendor/libarchive/libarchive/android_lf.h +0 -36
  60. package/vendor/libarchive/libarchive/archive.h +0 -1266
  61. package/vendor/libarchive/libarchive/archive_acl.c +0 -2025
  62. package/vendor/libarchive/libarchive/archive_acl_private.h +0 -85
  63. package/vendor/libarchive/libarchive/archive_blake2.h +0 -197
  64. package/vendor/libarchive/libarchive/archive_blake2_impl.h +0 -161
  65. package/vendor/libarchive/libarchive/archive_blake2s_ref.c +0 -369
  66. package/vendor/libarchive/libarchive/archive_blake2sp_ref.c +0 -361
  67. package/vendor/libarchive/libarchive/archive_check_magic.c +0 -183
  68. package/vendor/libarchive/libarchive/archive_cmdline.c +0 -211
  69. package/vendor/libarchive/libarchive/archive_cmdline_private.h +0 -45
  70. package/vendor/libarchive/libarchive/archive_crc32.h +0 -123
  71. package/vendor/libarchive/libarchive/archive_cryptor.c +0 -534
  72. package/vendor/libarchive/libarchive/archive_cryptor_private.h +0 -199
  73. package/vendor/libarchive/libarchive/archive_digest.c +0 -1584
  74. package/vendor/libarchive/libarchive/archive_digest_private.h +0 -431
  75. package/vendor/libarchive/libarchive/archive_disk_acl_darwin.c +0 -558
  76. package/vendor/libarchive/libarchive/archive_disk_acl_freebsd.c +0 -712
  77. package/vendor/libarchive/libarchive/archive_disk_acl_linux.c +0 -760
  78. package/vendor/libarchive/libarchive/archive_disk_acl_sunos.c +0 -824
  79. package/vendor/libarchive/libarchive/archive_endian.h +0 -234
  80. package/vendor/libarchive/libarchive/archive_entry.3 +0 -147
  81. package/vendor/libarchive/libarchive/archive_entry.c +0 -2297
  82. package/vendor/libarchive/libarchive/archive_entry.h +0 -763
  83. package/vendor/libarchive/libarchive/archive_entry_acl.3 +0 -458
  84. package/vendor/libarchive/libarchive/archive_entry_copy_bhfi.c +0 -55
  85. package/vendor/libarchive/libarchive/archive_entry_copy_stat.c +0 -82
  86. package/vendor/libarchive/libarchive/archive_entry_link_resolver.c +0 -472
  87. package/vendor/libarchive/libarchive/archive_entry_linkify.3 +0 -224
  88. package/vendor/libarchive/libarchive/archive_entry_locale.h +0 -90
  89. package/vendor/libarchive/libarchive/archive_entry_misc.3 +0 -63
  90. package/vendor/libarchive/libarchive/archive_entry_paths.3 +0 -153
  91. package/vendor/libarchive/libarchive/archive_entry_perms.3 +0 -210
  92. package/vendor/libarchive/libarchive/archive_entry_private.h +0 -205
  93. package/vendor/libarchive/libarchive/archive_entry_sparse.c +0 -156
  94. package/vendor/libarchive/libarchive/archive_entry_stat.3 +0 -274
  95. package/vendor/libarchive/libarchive/archive_entry_stat.c +0 -121
  96. package/vendor/libarchive/libarchive/archive_entry_strmode.c +0 -69
  97. package/vendor/libarchive/libarchive/archive_entry_time.3 +0 -127
  98. package/vendor/libarchive/libarchive/archive_entry_xattr.c +0 -155
  99. package/vendor/libarchive/libarchive/archive_hmac.c +0 -345
  100. package/vendor/libarchive/libarchive/archive_hmac_private.h +0 -119
  101. package/vendor/libarchive/libarchive/archive_integer.h +0 -267
  102. package/vendor/libarchive/libarchive/archive_match.c +0 -1869
  103. package/vendor/libarchive/libarchive/archive_openssl_evp_private.h +0 -54
  104. package/vendor/libarchive/libarchive/archive_openssl_hmac_private.h +0 -54
  105. package/vendor/libarchive/libarchive/archive_options.c +0 -219
  106. package/vendor/libarchive/libarchive/archive_options_private.h +0 -49
  107. package/vendor/libarchive/libarchive/archive_pack_dev.c +0 -330
  108. package/vendor/libarchive/libarchive/archive_pack_dev.h +0 -49
  109. package/vendor/libarchive/libarchive/archive_parse_date.c +0 -1173
  110. package/vendor/libarchive/libarchive/archive_pathmatch.c +0 -480
  111. package/vendor/libarchive/libarchive/archive_pathmatch.h +0 -50
  112. package/vendor/libarchive/libarchive/archive_platform.h +0 -213
  113. package/vendor/libarchive/libarchive/archive_platform_acl.h +0 -53
  114. package/vendor/libarchive/libarchive/archive_platform_stat.h +0 -45
  115. package/vendor/libarchive/libarchive/archive_platform_xattr.h +0 -45
  116. package/vendor/libarchive/libarchive/archive_ppmd7.c +0 -1173
  117. package/vendor/libarchive/libarchive/archive_ppmd7_private.h +0 -119
  118. package/vendor/libarchive/libarchive/archive_ppmd8.c +0 -1293
  119. package/vendor/libarchive/libarchive/archive_ppmd8_private.h +0 -123
  120. package/vendor/libarchive/libarchive/archive_ppmd_private.h +0 -159
  121. package/vendor/libarchive/libarchive/archive_private.h +0 -209
  122. package/vendor/libarchive/libarchive/archive_random.c +0 -274
  123. package/vendor/libarchive/libarchive/archive_random_private.h +0 -36
  124. package/vendor/libarchive/libarchive/archive_rb.c +0 -709
  125. package/vendor/libarchive/libarchive/archive_rb.h +0 -113
  126. package/vendor/libarchive/libarchive/archive_read.3 +0 -250
  127. package/vendor/libarchive/libarchive/archive_read.c +0 -1814
  128. package/vendor/libarchive/libarchive/archive_read_add_passphrase.3 +0 -72
  129. package/vendor/libarchive/libarchive/archive_read_add_passphrase.c +0 -189
  130. package/vendor/libarchive/libarchive/archive_read_append_filter.c +0 -209
  131. package/vendor/libarchive/libarchive/archive_read_data.3 +0 -128
  132. package/vendor/libarchive/libarchive/archive_read_data_into_fd.c +0 -207
  133. package/vendor/libarchive/libarchive/archive_read_disk.3 +0 -422
  134. package/vendor/libarchive/libarchive/archive_read_disk_entry_from_file.c +0 -1086
  135. package/vendor/libarchive/libarchive/archive_read_disk_posix.c +0 -2639
  136. package/vendor/libarchive/libarchive/archive_read_disk_private.h +0 -97
  137. package/vendor/libarchive/libarchive/archive_read_disk_set_standard_lookup.c +0 -315
  138. package/vendor/libarchive/libarchive/archive_read_disk_windows.c +0 -2603
  139. package/vendor/libarchive/libarchive/archive_read_extract.3 +0 -135
  140. package/vendor/libarchive/libarchive/archive_read_extract.c +0 -59
  141. package/vendor/libarchive/libarchive/archive_read_extract2.c +0 -154
  142. package/vendor/libarchive/libarchive/archive_read_filter.3 +0 -163
  143. package/vendor/libarchive/libarchive/archive_read_format.3 +0 -190
  144. package/vendor/libarchive/libarchive/archive_read_free.3 +0 -91
  145. package/vendor/libarchive/libarchive/archive_read_header.3 +0 -89
  146. package/vendor/libarchive/libarchive/archive_read_new.3 +0 -57
  147. package/vendor/libarchive/libarchive/archive_read_open.3 +0 -247
  148. package/vendor/libarchive/libarchive/archive_read_open_fd.c +0 -236
  149. package/vendor/libarchive/libarchive/archive_read_open_file.c +0 -257
  150. package/vendor/libarchive/libarchive/archive_read_open_filename.c +0 -652
  151. package/vendor/libarchive/libarchive/archive_read_open_memory.c +0 -188
  152. package/vendor/libarchive/libarchive/archive_read_private.h +0 -274
  153. package/vendor/libarchive/libarchive/archive_read_set_format.c +0 -116
  154. package/vendor/libarchive/libarchive/archive_read_set_options.3 +0 -290
  155. package/vendor/libarchive/libarchive/archive_read_set_options.c +0 -132
  156. package/vendor/libarchive/libarchive/archive_read_support_filter_all.c +0 -84
  157. package/vendor/libarchive/libarchive/archive_read_support_filter_by_code.c +0 -68
  158. package/vendor/libarchive/libarchive/archive_read_support_filter_bzip2.c +0 -360
  159. package/vendor/libarchive/libarchive/archive_read_support_filter_compress.c +0 -457
  160. package/vendor/libarchive/libarchive/archive_read_support_filter_grzip.c +0 -108
  161. package/vendor/libarchive/libarchive/archive_read_support_filter_gzip.c +0 -538
  162. package/vendor/libarchive/libarchive/archive_read_support_filter_lrzip.c +0 -119
  163. package/vendor/libarchive/libarchive/archive_read_support_filter_lz4.c +0 -829
  164. package/vendor/libarchive/libarchive/archive_read_support_filter_lzop.c +0 -493
  165. package/vendor/libarchive/libarchive/archive_read_support_filter_none.c +0 -51
  166. package/vendor/libarchive/libarchive/archive_read_support_filter_program.c +0 -497
  167. package/vendor/libarchive/libarchive/archive_read_support_filter_rpm.c +0 -249
  168. package/vendor/libarchive/libarchive/archive_read_support_filter_uu.c +0 -739
  169. package/vendor/libarchive/libarchive/archive_read_support_filter_xz.c +0 -792
  170. package/vendor/libarchive/libarchive/archive_read_support_filter_zstd.c +0 -356
  171. package/vendor/libarchive/libarchive/archive_read_support_format_7zip.c +0 -4650
  172. package/vendor/libarchive/libarchive/archive_read_support_format_all.c +0 -88
  173. package/vendor/libarchive/libarchive/archive_read_support_format_ar.c +0 -597
  174. package/vendor/libarchive/libarchive/archive_read_support_format_by_code.c +0 -76
  175. package/vendor/libarchive/libarchive/archive_read_support_format_cab.c +0 -3410
  176. package/vendor/libarchive/libarchive/archive_read_support_format_cpio.c +0 -1152
  177. package/vendor/libarchive/libarchive/archive_read_support_format_empty.c +0 -95
  178. package/vendor/libarchive/libarchive/archive_read_support_format_iso9660.c +0 -3516
  179. package/vendor/libarchive/libarchive/archive_read_support_format_lha.c +0 -2931
  180. package/vendor/libarchive/libarchive/archive_read_support_format_mtree.c +0 -2113
  181. package/vendor/libarchive/libarchive/archive_read_support_format_rar.c +0 -3932
  182. package/vendor/libarchive/libarchive/archive_read_support_format_rar5.c +0 -4501
  183. package/vendor/libarchive/libarchive/archive_read_support_format_raw.c +0 -194
  184. package/vendor/libarchive/libarchive/archive_read_support_format_tar.c +0 -3785
  185. package/vendor/libarchive/libarchive/archive_read_support_format_warc.c +0 -875
  186. package/vendor/libarchive/libarchive/archive_read_support_format_xar.c +0 -3770
  187. package/vendor/libarchive/libarchive/archive_read_support_format_zip.c +0 -4710
  188. package/vendor/libarchive/libarchive/archive_string.c +0 -4391
  189. package/vendor/libarchive/libarchive/archive_string.h +0 -244
  190. package/vendor/libarchive/libarchive/archive_string_composition.h +0 -2289
  191. package/vendor/libarchive/libarchive/archive_string_sprintf.c +0 -200
  192. package/vendor/libarchive/libarchive/archive_time.c +0 -168
  193. package/vendor/libarchive/libarchive/archive_time_private.h +0 -47
  194. package/vendor/libarchive/libarchive/archive_util.3 +0 -239
  195. package/vendor/libarchive/libarchive/archive_util.c +0 -668
  196. package/vendor/libarchive/libarchive/archive_version_details.c +0 -516
  197. package/vendor/libarchive/libarchive/archive_virtual.c +0 -162
  198. package/vendor/libarchive/libarchive/archive_windows.c +0 -1035
  199. package/vendor/libarchive/libarchive/archive_windows.h +0 -332
  200. package/vendor/libarchive/libarchive/archive_write.3 +0 -266
  201. package/vendor/libarchive/libarchive/archive_write.c +0 -896
  202. package/vendor/libarchive/libarchive/archive_write_add_filter.c +0 -71
  203. package/vendor/libarchive/libarchive/archive_write_add_filter_b64encode.c +0 -329
  204. package/vendor/libarchive/libarchive/archive_write_add_filter_by_name.c +0 -76
  205. package/vendor/libarchive/libarchive/archive_write_add_filter_bzip2.c +0 -411
  206. package/vendor/libarchive/libarchive/archive_write_add_filter_compress.c +0 -459
  207. package/vendor/libarchive/libarchive/archive_write_add_filter_grzip.c +0 -143
  208. package/vendor/libarchive/libarchive/archive_write_add_filter_gzip.c +0 -493
  209. package/vendor/libarchive/libarchive/archive_write_add_filter_lrzip.c +0 -214
  210. package/vendor/libarchive/libarchive/archive_write_add_filter_lz4.c +0 -710
  211. package/vendor/libarchive/libarchive/archive_write_add_filter_lzop.c +0 -500
  212. package/vendor/libarchive/libarchive/archive_write_add_filter_none.c +0 -42
  213. package/vendor/libarchive/libarchive/archive_write_add_filter_program.c +0 -398
  214. package/vendor/libarchive/libarchive/archive_write_add_filter_uuencode.c +0 -320
  215. package/vendor/libarchive/libarchive/archive_write_add_filter_xz.c +0 -547
  216. package/vendor/libarchive/libarchive/archive_write_add_filter_zstd.c +0 -608
  217. package/vendor/libarchive/libarchive/archive_write_blocksize.3 +0 -112
  218. package/vendor/libarchive/libarchive/archive_write_data.3 +0 -88
  219. package/vendor/libarchive/libarchive/archive_write_disk.3 +0 -360
  220. package/vendor/libarchive/libarchive/archive_write_disk_posix.c +0 -4789
  221. package/vendor/libarchive/libarchive/archive_write_disk_private.h +0 -43
  222. package/vendor/libarchive/libarchive/archive_write_disk_set_standard_lookup.c +0 -265
  223. package/vendor/libarchive/libarchive/archive_write_disk_windows.c +0 -2952
  224. package/vendor/libarchive/libarchive/archive_write_filter.3 +0 -140
  225. package/vendor/libarchive/libarchive/archive_write_finish_entry.3 +0 -77
  226. package/vendor/libarchive/libarchive/archive_write_format.3 +0 -187
  227. package/vendor/libarchive/libarchive/archive_write_free.3 +0 -94
  228. package/vendor/libarchive/libarchive/archive_write_header.3 +0 -71
  229. package/vendor/libarchive/libarchive/archive_write_new.3 +0 -56
  230. package/vendor/libarchive/libarchive/archive_write_open.3 +0 -270
  231. package/vendor/libarchive/libarchive/archive_write_open_fd.c +0 -141
  232. package/vendor/libarchive/libarchive/archive_write_open_file.c +0 -102
  233. package/vendor/libarchive/libarchive/archive_write_open_filename.c +0 -272
  234. package/vendor/libarchive/libarchive/archive_write_open_memory.c +0 -110
  235. package/vendor/libarchive/libarchive/archive_write_private.h +0 -166
  236. package/vendor/libarchive/libarchive/archive_write_set_format.c +0 -124
  237. package/vendor/libarchive/libarchive/archive_write_set_format_7zip.c +0 -2571
  238. package/vendor/libarchive/libarchive/archive_write_set_format_ar.c +0 -540
  239. package/vendor/libarchive/libarchive/archive_write_set_format_by_name.c +0 -93
  240. package/vendor/libarchive/libarchive/archive_write_set_format_cpio.c +0 -11
  241. package/vendor/libarchive/libarchive/archive_write_set_format_cpio_binary.c +0 -618
  242. package/vendor/libarchive/libarchive/archive_write_set_format_cpio_newc.c +0 -457
  243. package/vendor/libarchive/libarchive/archive_write_set_format_cpio_odc.c +0 -508
  244. package/vendor/libarchive/libarchive/archive_write_set_format_filter_by_ext.c +0 -141
  245. package/vendor/libarchive/libarchive/archive_write_set_format_gnutar.c +0 -790
  246. package/vendor/libarchive/libarchive/archive_write_set_format_iso9660.c +0 -8216
  247. package/vendor/libarchive/libarchive/archive_write_set_format_mtree.c +0 -2307
  248. package/vendor/libarchive/libarchive/archive_write_set_format_pax.c +0 -2249
  249. package/vendor/libarchive/libarchive/archive_write_set_format_private.h +0 -40
  250. package/vendor/libarchive/libarchive/archive_write_set_format_raw.c +0 -123
  251. package/vendor/libarchive/libarchive/archive_write_set_format_shar.c +0 -650
  252. package/vendor/libarchive/libarchive/archive_write_set_format_ustar.c +0 -768
  253. package/vendor/libarchive/libarchive/archive_write_set_format_v7tar.c +0 -648
  254. package/vendor/libarchive/libarchive/archive_write_set_format_warc.c +0 -491
  255. package/vendor/libarchive/libarchive/archive_write_set_format_xar.c +0 -3799
  256. package/vendor/libarchive/libarchive/archive_write_set_format_zip.c +0 -2548
  257. package/vendor/libarchive/libarchive/archive_write_set_options.3 +0 -779
  258. package/vendor/libarchive/libarchive/archive_write_set_options.c +0 -129
  259. package/vendor/libarchive/libarchive/archive_write_set_passphrase.3 +0 -72
  260. package/vendor/libarchive/libarchive/archive_write_set_passphrase.c +0 -95
  261. package/vendor/libarchive/libarchive/archive_xxhash.h +0 -48
  262. package/vendor/libarchive/libarchive/config_freebsd.h +0 -275
  263. package/vendor/libarchive/libarchive/cpio.5 +0 -389
  264. package/vendor/libarchive/libarchive/filter_fork.h +0 -44
  265. package/vendor/libarchive/libarchive/filter_fork_posix.c +0 -269
  266. package/vendor/libarchive/libarchive/filter_fork_windows.c +0 -270
  267. package/vendor/libarchive/libarchive/libarchive-formats.5 +0 -478
  268. package/vendor/libarchive/libarchive/libarchive.3 +0 -297
  269. package/vendor/libarchive/libarchive/libarchive_changes.3 +0 -339
  270. package/vendor/libarchive/libarchive/libarchive_internals.3 +0 -363
  271. package/vendor/libarchive/libarchive/module.modulemap +0 -34
  272. package/vendor/libarchive/libarchive/mtree.5 +0 -323
  273. package/vendor/libarchive/libarchive/tar.5 +0 -947
  274. package/vendor/libarchive/libarchive/xxhash.c +0 -531
@@ -1,652 +0,0 @@
1
- /*-
2
- * Copyright (c) 2003-2010 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
-
28
- #ifdef HAVE_SYS_IOCTL_H
29
- #include <sys/ioctl.h>
30
- #endif
31
- #ifdef HAVE_SYS_STAT_H
32
- #include <sys/stat.h>
33
- #endif
34
- #ifdef HAVE_ERRNO_H
35
- #include <errno.h>
36
- #endif
37
- #ifdef HAVE_FCNTL_H
38
- #include <fcntl.h>
39
- #endif
40
- #ifdef HAVE_IO_H
41
- #include <io.h>
42
- #endif
43
- #ifdef HAVE_LIMITS_H
44
- #include <limits.h>
45
- #endif
46
- #ifdef HAVE_STDLIB_H
47
- #include <stdlib.h>
48
- #endif
49
- #ifdef HAVE_STRING_H
50
- #include <string.h>
51
- #endif
52
- #ifdef HAVE_UNISTD_H
53
- #include <unistd.h>
54
- #endif
55
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
56
- #include <sys/disk.h>
57
- #elif defined(__NetBSD__) || defined(__OpenBSD__)
58
- #include <sys/disklabel.h>
59
- #include <sys/dkio.h>
60
- #elif defined(__DragonFly__)
61
- #include <sys/diskslice.h>
62
- #endif
63
-
64
- #include "archive.h"
65
- #include "archive_platform_stat.h"
66
- #include "archive_private.h"
67
- #include "archive_string.h"
68
-
69
- #ifndef O_BINARY
70
- #define O_BINARY 0
71
- #endif
72
- #ifndef O_CLOEXEC
73
- #define O_CLOEXEC 0
74
- #endif
75
-
76
- struct read_file_data {
77
- int fd;
78
- size_t block_size;
79
- void *buffer;
80
- mode_t st_mode; /* Mode bits for opened file. */
81
- int64_t size;
82
- char use_lseek;
83
- enum fnt_e { FNT_STDIN, FNT_MBS, FNT_WCS } filename_type;
84
- union {
85
- char m[1];/* MBS filename. */
86
- wchar_t w[1];/* WCS filename. */
87
- } filename; /* Must be last! */
88
- };
89
-
90
- static int file_open(struct archive *, void *);
91
- static int file_close(struct archive *, void *);
92
- static int file_close2(struct archive *, void *);
93
- static int file_switch(struct archive *, void *, void *);
94
- static ssize_t file_read(struct archive *, void *, const void **buff);
95
- static int64_t file_seek(struct archive *, void *, int64_t request, int);
96
- static int64_t file_skip(struct archive *, void *, int64_t request);
97
- static int64_t file_skip_lseek(struct archive *, void *, int64_t request);
98
-
99
- int
100
- archive_read_open_file(struct archive *a, const char *filename,
101
- size_t block_size)
102
- {
103
- return (archive_read_open_filename(a, filename, block_size));
104
- }
105
-
106
- int
107
- archive_read_open_filename(struct archive *a, const char *filename,
108
- size_t block_size)
109
- {
110
- const char *filenames[2];
111
- filenames[0] = filename;
112
- filenames[1] = NULL;
113
- return archive_read_open_filenames(a, filenames, block_size);
114
- }
115
-
116
- int
117
- archive_read_open_filenames(struct archive *a, const char **filenames,
118
- size_t block_size)
119
- {
120
- struct read_file_data *mine;
121
- const char *filename = NULL;
122
- if (filenames)
123
- filename = *(filenames++);
124
-
125
- archive_clear_error(a);
126
- do
127
- {
128
- size_t len;
129
- if (filename == NULL)
130
- filename = "";
131
- len = strlen(filename);
132
- mine = calloc(1, sizeof(*mine) + len);
133
- if (mine == NULL)
134
- goto no_memory;
135
- memcpy(mine->filename.m, filename, len + 1);
136
- mine->block_size = block_size;
137
- mine->fd = -1;
138
- mine->buffer = NULL;
139
- mine->st_mode = mine->use_lseek = 0;
140
- if (filename == NULL || filename[0] == '\0') {
141
- mine->filename_type = FNT_STDIN;
142
- } else
143
- mine->filename_type = FNT_MBS;
144
- if (archive_read_append_callback_data(a, mine) != (ARCHIVE_OK)) {
145
- free(mine);
146
- return (ARCHIVE_FATAL);
147
- }
148
- if (filenames == NULL)
149
- break;
150
- filename = *(filenames++);
151
- } while (filename != NULL && filename[0] != '\0');
152
- archive_read_set_open_callback(a, file_open);
153
- archive_read_set_read_callback(a, file_read);
154
- archive_read_set_skip_callback(a, file_skip);
155
- archive_read_set_close_callback(a, file_close);
156
- archive_read_set_switch_callback(a, file_switch);
157
- archive_read_set_seek_callback(a, file_seek);
158
-
159
- return (archive_read_open1(a));
160
- no_memory:
161
- archive_set_error(a, ENOMEM, "No memory");
162
- return (ARCHIVE_FATAL);
163
- }
164
-
165
- /*
166
- * This function is an implementation detail of archive_read_open_filename_w,
167
- * which is exposed as a separate API on Windows.
168
- */
169
- #if !defined(_WIN32) || defined(__CYGWIN__)
170
- static
171
- #endif
172
- int
173
- archive_read_open_filenames_w(struct archive *a, const wchar_t **wfilenames,
174
- size_t block_size)
175
- {
176
- struct read_file_data *mine;
177
- const wchar_t *wfilename = NULL;
178
- if (wfilenames)
179
- wfilename = *(wfilenames++);
180
-
181
- archive_clear_error(a);
182
- do
183
- {
184
- if (wfilename == NULL)
185
- wfilename = L"";
186
- mine = calloc(1,
187
- sizeof(*mine) + wcslen(wfilename) * MB_LEN_MAX);
188
- if (mine == NULL)
189
- goto no_memory;
190
- mine->block_size = block_size;
191
- mine->fd = -1;
192
-
193
- if (wfilename == NULL || wfilename[0] == L'\0') {
194
- mine->filename_type = FNT_STDIN;
195
- } else {
196
- #if defined(_WIN32) && !defined(__CYGWIN__)
197
- mine->filename_type = FNT_WCS;
198
- wcscpy(mine->filename.w, wfilename);
199
- #else
200
- /*
201
- * POSIX system does not support a wchar_t interface for
202
- * open() system call, so we have to translate a wchar_t
203
- * filename to multi-byte one and use it.
204
- */
205
- struct archive_string fn;
206
-
207
- archive_string_init(&fn);
208
- if (archive_string_append_from_wcs(&fn, wfilename,
209
- wcslen(wfilename)) != 0) {
210
- if (errno == ENOMEM)
211
- archive_set_error(a, errno,
212
- "Can't allocate memory");
213
- else
214
- archive_set_error(a, EINVAL,
215
- "Failed to convert a wide-character"
216
- " filename to a multi-byte filename");
217
- archive_string_free(&fn);
218
- free(mine);
219
- return (ARCHIVE_FATAL);
220
- }
221
- mine->filename_type = FNT_MBS;
222
- strcpy(mine->filename.m, fn.s);
223
- archive_string_free(&fn);
224
- #endif
225
- }
226
- if (archive_read_append_callback_data(a, mine) != (ARCHIVE_OK)) {
227
- free(mine);
228
- return (ARCHIVE_FATAL);
229
- }
230
- if (wfilenames == NULL)
231
- break;
232
- wfilename = *(wfilenames++);
233
- } while (wfilename != NULL && wfilename[0] != '\0');
234
- archive_read_set_open_callback(a, file_open);
235
- archive_read_set_read_callback(a, file_read);
236
- archive_read_set_skip_callback(a, file_skip);
237
- archive_read_set_close_callback(a, file_close);
238
- archive_read_set_switch_callback(a, file_switch);
239
- archive_read_set_seek_callback(a, file_seek);
240
-
241
- return (archive_read_open1(a));
242
- no_memory:
243
- archive_set_error(a, ENOMEM, "No memory");
244
- return (ARCHIVE_FATAL);
245
- }
246
-
247
- int
248
- archive_read_open_filename_w(struct archive *a, const wchar_t *wfilename,
249
- size_t block_size)
250
- {
251
- const wchar_t *wfilenames[2];
252
- wfilenames[0] = wfilename;
253
- wfilenames[1] = NULL;
254
- return archive_read_open_filenames_w(a, wfilenames, block_size);
255
- }
256
-
257
- static int
258
- file_open(struct archive *a, void *client_data)
259
- {
260
- la_seek_stat_t st;
261
- struct read_file_data *mine = (struct read_file_data *)client_data;
262
- void *buffer;
263
- const char *filename = NULL;
264
- #if defined(_WIN32) && !defined(__CYGWIN__)
265
- const wchar_t *wfilename = NULL;
266
- #endif
267
- int fd = -1;
268
- int is_disk_like = 0;
269
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
270
- off_t mediasize = 0; /* FreeBSD-specific, so off_t okay here. */
271
- #elif defined(__NetBSD__) || defined(__OpenBSD__)
272
- struct disklabel dl;
273
- #elif defined(__DragonFly__)
274
- struct partinfo pi;
275
- #endif
276
-
277
- archive_clear_error(a);
278
- if (mine->filename_type == FNT_STDIN) {
279
- /* We used to delegate stdin support by
280
- * directly calling archive_read_open_fd(a,0,block_size)
281
- * here, but that doesn't (and shouldn't) handle the
282
- * end-of-file flush when reading stdout from a pipe.
283
- * Basically, read_open_fd() is intended for folks who
284
- * are willing to handle such details themselves. This
285
- * API is intended to be a little smarter for folks who
286
- * want easy handling of the common case.
287
- */
288
- fd = 0;
289
- #if defined(__CYGWIN__) || defined(_WIN32)
290
- setmode(0, O_BINARY);
291
- #endif
292
- filename = "";
293
- } else if (mine->filename_type == FNT_MBS) {
294
- filename = mine->filename.m;
295
- fd = open(filename, O_RDONLY | O_BINARY | O_CLOEXEC);
296
- __archive_ensure_cloexec_flag(fd);
297
- if (fd < 0) {
298
- archive_set_error(a, errno,
299
- "Failed to open '%s'", filename);
300
- return (ARCHIVE_FATAL);
301
- }
302
- } else {
303
- #if defined(_WIN32) && !defined(__CYGWIN__)
304
- wfilename = mine->filename.w;
305
- fd = _wopen(wfilename, O_RDONLY | O_BINARY);
306
- if (fd < 0 && errno == ENOENT) {
307
- wchar_t *fullpath;
308
- fullpath = __la_win_permissive_name_w(wfilename);
309
- if (fullpath != NULL) {
310
- fd = _wopen(fullpath, O_RDONLY | O_BINARY);
311
- free(fullpath);
312
- }
313
- }
314
- if (fd < 0) {
315
- archive_set_error(a, errno,
316
- "Failed to open '%ls'", wfilename);
317
- return (ARCHIVE_FATAL);
318
- }
319
- #else
320
- archive_set_error(a, ARCHIVE_ERRNO_MISC,
321
- "Unexpected operation in archive_read_open_filename");
322
- goto fail;
323
- #endif
324
- }
325
- if (la_seek_fstat(fd, &st) != 0) {
326
- #if defined(_WIN32) && !defined(__CYGWIN__)
327
- if (mine->filename_type == FNT_WCS)
328
- archive_set_error(a, errno, "Can't stat '%ls'",
329
- wfilename);
330
- else
331
- #endif
332
- archive_set_error(a, errno, "Can't stat '%s'",
333
- filename);
334
- goto fail;
335
- }
336
-
337
- /*
338
- * Determine whether the input looks like a disk device or a
339
- * tape device. The results are used below to select an I/O
340
- * strategy:
341
- * = "disk-like" devices support arbitrary lseek() and will
342
- * support I/O requests of any size. So we get easy skipping
343
- * and can cheat on block sizes to get better performance.
344
- * = "tape-like" devices require strict blocking and use
345
- * specialized ioctls for seeking.
346
- * = "socket-like" devices cannot seek at all but can improve
347
- * performance by using nonblocking I/O to read "whatever is
348
- * available right now".
349
- *
350
- * Right now, we only specially recognize disk-like devices,
351
- * but it should be straightforward to add probes and strategy
352
- * here for tape-like and socket-like devices.
353
- */
354
- if (S_ISREG(st.st_mode)) {
355
- /* Safety: Tell the extractor not to overwrite the input. */
356
- archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
357
- /* Regular files act like disks. */
358
- is_disk_like = 1;
359
- }
360
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
361
- /* FreeBSD: if it supports DIOCGMEDIASIZE ioctl, it's disk-like. */
362
- else if (S_ISCHR(st.st_mode) &&
363
- ioctl(fd, DIOCGMEDIASIZE, &mediasize) == 0 &&
364
- mediasize > 0) {
365
- is_disk_like = 1;
366
- }
367
- #elif defined(__NetBSD__) || defined(__OpenBSD__)
368
- /* Net/OpenBSD: if it supports DIOCGDINFO ioctl, it's disk-like. */
369
- else if ((S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) &&
370
- ioctl(fd, DIOCGDINFO, &dl) == 0 &&
371
- dl.d_partitions[DISKPART(st.st_rdev)].p_size > 0) {
372
- is_disk_like = 1;
373
- }
374
- #elif defined(__DragonFly__)
375
- /* DragonFly BSD: if it supports DIOCGPART ioctl, it's disk-like. */
376
- else if (S_ISCHR(st.st_mode) &&
377
- ioctl(fd, DIOCGPART, &pi) == 0 &&
378
- pi.media_size > 0) {
379
- is_disk_like = 1;
380
- }
381
- #elif defined(__linux__)
382
- /* Linux: All block devices are disk-like. */
383
- else if (S_ISBLK(st.st_mode) &&
384
- lseek(fd, 0, SEEK_CUR) == 0 &&
385
- lseek(fd, 0, SEEK_SET) == 0 &&
386
- lseek(fd, 0, SEEK_END) > 0 &&
387
- lseek(fd, 0, SEEK_SET) == 0) {
388
- is_disk_like = 1;
389
- }
390
- #endif
391
- /* TODO: Add an "is_tape_like" variable and appropriate tests. */
392
-
393
- /* Disk-like devices prefer power-of-two block sizes. */
394
- /* Use provided block_size as a guide so users have some control. */
395
- if (is_disk_like) {
396
- size_t new_block_size = 64 * 1024;
397
- while (new_block_size < mine->block_size
398
- && new_block_size < 64 * 1024 * 1024)
399
- new_block_size *= 2;
400
- mine->block_size = new_block_size;
401
- }
402
- buffer = malloc(mine->block_size);
403
- if (buffer == NULL) {
404
- archive_set_error(a, ENOMEM, "No memory");
405
- goto fail;
406
- }
407
- mine->buffer = buffer;
408
- mine->fd = fd;
409
- /* Remember mode so close can decide whether to flush. */
410
- mine->st_mode = st.st_mode;
411
-
412
- /* Disk-like inputs can use lseek(). */
413
- if (is_disk_like) {
414
- mine->use_lseek = 1;
415
- mine->size = st.st_size;
416
- }
417
-
418
- return (ARCHIVE_OK);
419
- fail:
420
- /*
421
- * Don't close file descriptors not opened or ones pointing referring
422
- * to `FNT_STDIN`.
423
- */
424
- if (fd != -1 && fd != 0)
425
- close(fd);
426
- return (ARCHIVE_FATAL);
427
- }
428
-
429
- static ssize_t
430
- file_read(struct archive *a, void *client_data, const void **buff)
431
- {
432
- struct read_file_data *mine = (struct read_file_data *)client_data;
433
- ssize_t bytes_read;
434
-
435
- /* TODO: If a recent lseek() operation has left us
436
- * mis-aligned, read and return a short block to try to get
437
- * us back in alignment. */
438
-
439
- /* TODO: Someday, try mmap() here; if that succeeds, give
440
- * the entire file to libarchive as a single block. That
441
- * could be a lot faster than block-by-block manual I/O. */
442
-
443
- /* TODO: We might be able to improve performance on pipes and
444
- * sockets by setting non-blocking I/O and just accepting
445
- * whatever we get here instead of waiting for a full block
446
- * worth of data. */
447
-
448
- *buff = mine->buffer;
449
- for (;;) {
450
- bytes_read = read(mine->fd, mine->buffer, mine->block_size);
451
- if (bytes_read < 0) {
452
- if (errno == EINTR)
453
- continue;
454
- else if (mine->filename_type == FNT_STDIN)
455
- archive_set_error(a, errno,
456
- "Error reading stdin");
457
- else if (mine->filename_type == FNT_MBS)
458
- archive_set_error(a, errno,
459
- "Error reading '%s'", mine->filename.m);
460
- else
461
- archive_set_error(a, errno,
462
- "Error reading '%ls'", mine->filename.w);
463
- }
464
- return (bytes_read);
465
- }
466
- }
467
-
468
- /*
469
- * Regular files and disk-like block devices can use simple lseek
470
- * without needing to round the request to the block size.
471
- *
472
- * TODO: This can leave future reads mis-aligned. Since we know the
473
- * offset here, we should store it and use it in file_read() above
474
- * to determine whether we should perform a short read to get back
475
- * into alignment. Long series of mis-aligned reads can negatively
476
- * impact disk throughput. (Of course, the performance impact should
477
- * be carefully tested; extra code complexity is only worthwhile if
478
- * it does provide measurable improvement.)
479
- *
480
- * TODO: Be lazy about the actual seek. There are a few pathological
481
- * cases where libarchive makes a bunch of seek requests in a row
482
- * without any intervening reads. This isn't a huge performance
483
- * problem, since the kernel handles seeks lazily already, but
484
- * it would be very slightly faster if we simply remembered the
485
- * seek request here and then actually performed the seek at the
486
- * top of the read callback above.
487
- */
488
- static int64_t
489
- file_skip_lseek(struct archive *a, void *client_data, int64_t request)
490
- {
491
- struct read_file_data *mine = (struct read_file_data *)client_data;
492
- #if defined(_WIN32) && !defined(__CYGWIN__)
493
- /* We use _lseeki64() on Windows. */
494
- int64_t old_offset, new_offset;
495
- #else
496
- off_t old_offset, new_offset;
497
- #endif
498
- la_seek_t skip = (la_seek_t)request;
499
- int skip_bits = sizeof(skip) * 8 - 1;
500
-
501
- /* We use off_t here because lseek() is declared that way. */
502
-
503
- /* Reduce a request that would overflow the 'skip' variable. */
504
- if (sizeof(request) > sizeof(skip)) {
505
- const int64_t max_skip =
506
- (((int64_t)1 << (skip_bits - 1)) - 1) * 2 + 1;
507
- if (request > max_skip)
508
- skip = max_skip;
509
- }
510
-
511
- if ((old_offset = lseek(mine->fd, 0, SEEK_CUR)) >= 0) {
512
- if (old_offset >= mine->size ||
513
- skip > mine->size - old_offset) {
514
- /* Do not seek past end of file. */
515
- errno = ESPIPE;
516
- } else if ((new_offset = lseek(mine->fd, skip, SEEK_CUR)) >= 0)
517
- return (new_offset - old_offset);
518
- }
519
-
520
- /* If lseek() fails, don't bother trying again. */
521
- mine->use_lseek = 0;
522
-
523
- /* Let libarchive recover with read+discard */
524
- if (errno == ESPIPE)
525
- return (0);
526
-
527
- /* If the input is corrupted or truncated, fail. */
528
- if (mine->filename_type == FNT_STDIN)
529
- archive_set_error(a, errno, "Error seeking in stdin");
530
- else if (mine->filename_type == FNT_MBS)
531
- archive_set_error(a, errno, "Error seeking in '%s'",
532
- mine->filename.m);
533
- else
534
- archive_set_error(a, errno, "Error seeking in '%ls'",
535
- mine->filename.w);
536
- return (-1);
537
- }
538
-
539
-
540
- /*
541
- * TODO: Implement another file_skip_XXXX that uses MTIO ioctls to
542
- * accelerate operation on tape drives.
543
- */
544
-
545
- static int64_t
546
- file_skip(struct archive *a, void *client_data, int64_t request)
547
- {
548
- struct read_file_data *mine = (struct read_file_data *)client_data;
549
-
550
- /* Delegate skip requests. */
551
- if (mine->use_lseek)
552
- return (file_skip_lseek(a, client_data, request));
553
-
554
- /* If we can't skip, return 0; libarchive will read+discard instead. */
555
- return (0);
556
- }
557
-
558
- /*
559
- * TODO: Store the offset and use it in the read callback.
560
- */
561
- static int64_t
562
- file_seek(struct archive *a, void *client_data, int64_t request, int whence)
563
- {
564
- struct read_file_data *mine = (struct read_file_data *)client_data;
565
- la_seek_t seek = (la_seek_t)request;
566
- int64_t r;
567
- int seek_bits = sizeof(seek) * 8 - 1;
568
-
569
- /* We use off_t here because lseek() is declared that way. */
570
-
571
- /* Do not perform a seek which cannot be fulfilled. */
572
- if (sizeof(request) > sizeof(seek)) {
573
- const int64_t max_seek =
574
- (((int64_t)1 << (seek_bits - 1)) - 1) * 2 + 1;
575
- const int64_t min_seek = ~max_seek;
576
- if (request < min_seek || request > max_seek) {
577
- errno = EOVERFLOW;
578
- goto err;
579
- }
580
- }
581
-
582
- r = lseek(mine->fd, seek, whence);
583
- if (r >= 0)
584
- return r;
585
-
586
- /* If the input is corrupted or truncated, fail. */
587
- err:
588
- if (mine->filename_type == FNT_STDIN)
589
- archive_set_error(a, errno, "Error seeking in stdin");
590
- else if (mine->filename_type == FNT_MBS)
591
- archive_set_error(a, errno, "Error seeking in '%s'",
592
- mine->filename.m);
593
- else
594
- archive_set_error(a, errno, "Error seeking in '%ls'",
595
- mine->filename.w);
596
- return (ARCHIVE_FATAL);
597
- }
598
-
599
- static int
600
- file_close2(struct archive *a, void *client_data)
601
- {
602
- struct read_file_data *mine = (struct read_file_data *)client_data;
603
-
604
- (void)a; /* UNUSED */
605
-
606
- /* Only flush and close if open succeeded. */
607
- if (mine->fd >= 0) {
608
- /*
609
- * Sometimes, we should flush the input before closing.
610
- * Regular files: faster to just close without flush.
611
- * Disk-like devices: Ditto.
612
- * Tapes: must not flush (user might need to
613
- * read the "next" item on a non-rewind device).
614
- * Pipes and sockets: must flush (otherwise, the
615
- * program feeding the pipe or socket may complain).
616
- * Here, I flush everything except for regular files and
617
- * device nodes.
618
- */
619
- if (!S_ISREG(mine->st_mode)
620
- && !S_ISCHR(mine->st_mode)
621
- && !S_ISBLK(mine->st_mode)) {
622
- ssize_t bytesRead;
623
- do {
624
- bytesRead = read(mine->fd, mine->buffer,
625
- mine->block_size);
626
- } while (bytesRead > 0);
627
- }
628
- /* If a named file was opened, then it needs to be closed. */
629
- if (mine->filename_type != FNT_STDIN)
630
- close(mine->fd);
631
- }
632
- free(mine->buffer);
633
- mine->buffer = NULL;
634
- mine->fd = -1;
635
- return (ARCHIVE_OK);
636
- }
637
-
638
- static int
639
- file_close(struct archive *a, void *client_data)
640
- {
641
- struct read_file_data *mine = (struct read_file_data *)client_data;
642
- file_close2(a, client_data);
643
- free(mine);
644
- return (ARCHIVE_OK);
645
- }
646
-
647
- static int
648
- file_switch(struct archive *a, void *client_data1, void *client_data2)
649
- {
650
- file_close2(a, client_data1);
651
- return file_open(a, client_data2);
652
- }