@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.
- package/android/build.gradle +0 -1
- package/android/src/main/cpp/CMakeLists.txt +0 -137
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeEngineModule.java +35 -305
- package/android/src/main/java/com/papyrus/engine/PapyrusPackage.java +1 -3
- package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerView.java +5 -195
- package/android/src/main/java/com/papyrus/engine/PapyrusPdfViewerViewManager.java +1 -20
- package/dist/index.d.mts +4 -614
- package/dist/index.d.ts +4 -614
- package/dist/index.js +8 -484
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -477
- package/dist/index.mjs.map +1 -1
- package/ios/PapyrusEngineStore.h +0 -3
- package/ios/PapyrusEngineStore.m +6 -32
- package/ios/PapyrusNativeEngine.m +5 -684
- package/ios/PapyrusNativeEngine.podspec +15 -0
- package/ios/PapyrusPageView.m +11 -38
- package/package.json +8 -10
- package/react-native.config.js +1 -1
- package/PapyrusNativeEngine.podspec +0 -45
- package/android/src/main/cpp/PapyrusComicArchiveJni.cpp +0 -68
- package/android/src/main/cpp/PapyrusComicArchiveTest.cpp +0 -55
- package/android/src/main/cpp/papyrus_outline_loader_test.cpp +0 -240
- package/android/src/main/cpp/papyrus_text_word_test.cpp +0 -72
- package/android/src/main/java/com/papyrus/engine/PapyrusComicArchiveNative.java +0 -14
- package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentView.java +0 -491
- package/android/src/main/java/com/papyrus/engine/PapyrusComicDocumentViewManager.java +0 -32
- package/android/src/main/java/com/papyrus/engine/PapyrusComicPageLayout.java +0 -38
- package/android/src/main/java/com/papyrus/engine/PapyrusNativeTextModel.java +0 -195
- package/android/src/main/java/com/papyrus/engine/PapyrusSelectionMenuIcon.java +0 -48
- package/android/src/main/java/com/papyrus/engine/PapyrusTextAnnotationModel.java +0 -22
- package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentView.java +0 -661
- package/android/src/main/java/com/papyrus/engine/PapyrusTextDocumentViewManager.java +0 -49
- package/android/src/main/java/com/papyrus/engine/PapyrusTextStore.java +0 -43
- package/ios/PapyrusComicDocumentView.h +0 -21
- package/ios/PapyrusComicDocumentView.m +0 -554
- package/ios/PapyrusComicDocumentViewManager.m +0 -23
- package/ios/PapyrusPageRotationRegistry.h +0 -29
- package/ios/PapyrusPageRotationRegistry.m +0 -179
- package/ios/PapyrusPdfDocumentView.h +0 -55
- package/ios/PapyrusPdfDocumentView.m +0 -2339
- package/ios/PapyrusPdfDocumentViewManager.m +0 -61
- package/ios/PapyrusPdfPageTheme.h +0 -15
- package/ios/PapyrusPdfPageTheme.m +0 -218
- package/ios/PapyrusSelectionMenu.h +0 -27
- package/ios/PapyrusTextAnnotationRange.h +0 -2
- package/ios/PapyrusTextAnnotationRange.m +0 -29
- package/ios/PapyrusTextDocumentView.h +0 -32
- package/ios/PapyrusTextDocumentView.m +0 -518
- package/ios/PapyrusTextDocumentViewManager.m +0 -34
- package/ios/PapyrusTextStore.h +0 -13
- package/ios/PapyrusTextStore.m +0 -73
- package/third_party_licenses/BLAKE2-NOTICE.txt +0 -11
- package/third_party_licenses/libarchive-COPYING +0 -65
- package/vendor/libarchive/PapyrusComicArchive.cpp +0 -376
- package/vendor/libarchive/PapyrusComicArchive.h +0 -30
- package/vendor/libarchive/README.papyrus.md +0 -15
- package/vendor/libarchive/android.h +0 -192
- package/vendor/libarchive/config/PapyrusArchiveConfig.h +0 -71
- package/vendor/libarchive/libarchive/CMakeLists.txt +0 -293
- package/vendor/libarchive/libarchive/android_lf.h +0 -36
- package/vendor/libarchive/libarchive/archive.h +0 -1266
- package/vendor/libarchive/libarchive/archive_acl.c +0 -2025
- package/vendor/libarchive/libarchive/archive_acl_private.h +0 -85
- package/vendor/libarchive/libarchive/archive_blake2.h +0 -197
- package/vendor/libarchive/libarchive/archive_blake2_impl.h +0 -161
- package/vendor/libarchive/libarchive/archive_blake2s_ref.c +0 -369
- package/vendor/libarchive/libarchive/archive_blake2sp_ref.c +0 -361
- package/vendor/libarchive/libarchive/archive_check_magic.c +0 -183
- package/vendor/libarchive/libarchive/archive_cmdline.c +0 -211
- package/vendor/libarchive/libarchive/archive_cmdline_private.h +0 -45
- package/vendor/libarchive/libarchive/archive_crc32.h +0 -123
- package/vendor/libarchive/libarchive/archive_cryptor.c +0 -534
- package/vendor/libarchive/libarchive/archive_cryptor_private.h +0 -199
- package/vendor/libarchive/libarchive/archive_digest.c +0 -1584
- package/vendor/libarchive/libarchive/archive_digest_private.h +0 -431
- package/vendor/libarchive/libarchive/archive_disk_acl_darwin.c +0 -558
- package/vendor/libarchive/libarchive/archive_disk_acl_freebsd.c +0 -712
- package/vendor/libarchive/libarchive/archive_disk_acl_linux.c +0 -760
- package/vendor/libarchive/libarchive/archive_disk_acl_sunos.c +0 -824
- package/vendor/libarchive/libarchive/archive_endian.h +0 -234
- package/vendor/libarchive/libarchive/archive_entry.3 +0 -147
- package/vendor/libarchive/libarchive/archive_entry.c +0 -2297
- package/vendor/libarchive/libarchive/archive_entry.h +0 -763
- package/vendor/libarchive/libarchive/archive_entry_acl.3 +0 -458
- package/vendor/libarchive/libarchive/archive_entry_copy_bhfi.c +0 -55
- package/vendor/libarchive/libarchive/archive_entry_copy_stat.c +0 -82
- package/vendor/libarchive/libarchive/archive_entry_link_resolver.c +0 -472
- package/vendor/libarchive/libarchive/archive_entry_linkify.3 +0 -224
- package/vendor/libarchive/libarchive/archive_entry_locale.h +0 -90
- package/vendor/libarchive/libarchive/archive_entry_misc.3 +0 -63
- package/vendor/libarchive/libarchive/archive_entry_paths.3 +0 -153
- package/vendor/libarchive/libarchive/archive_entry_perms.3 +0 -210
- package/vendor/libarchive/libarchive/archive_entry_private.h +0 -205
- package/vendor/libarchive/libarchive/archive_entry_sparse.c +0 -156
- package/vendor/libarchive/libarchive/archive_entry_stat.3 +0 -274
- package/vendor/libarchive/libarchive/archive_entry_stat.c +0 -121
- package/vendor/libarchive/libarchive/archive_entry_strmode.c +0 -69
- package/vendor/libarchive/libarchive/archive_entry_time.3 +0 -127
- package/vendor/libarchive/libarchive/archive_entry_xattr.c +0 -155
- package/vendor/libarchive/libarchive/archive_hmac.c +0 -345
- package/vendor/libarchive/libarchive/archive_hmac_private.h +0 -119
- package/vendor/libarchive/libarchive/archive_integer.h +0 -267
- package/vendor/libarchive/libarchive/archive_match.c +0 -1869
- package/vendor/libarchive/libarchive/archive_openssl_evp_private.h +0 -54
- package/vendor/libarchive/libarchive/archive_openssl_hmac_private.h +0 -54
- package/vendor/libarchive/libarchive/archive_options.c +0 -219
- package/vendor/libarchive/libarchive/archive_options_private.h +0 -49
- package/vendor/libarchive/libarchive/archive_pack_dev.c +0 -330
- package/vendor/libarchive/libarchive/archive_pack_dev.h +0 -49
- package/vendor/libarchive/libarchive/archive_parse_date.c +0 -1173
- package/vendor/libarchive/libarchive/archive_pathmatch.c +0 -480
- package/vendor/libarchive/libarchive/archive_pathmatch.h +0 -50
- package/vendor/libarchive/libarchive/archive_platform.h +0 -213
- package/vendor/libarchive/libarchive/archive_platform_acl.h +0 -53
- package/vendor/libarchive/libarchive/archive_platform_stat.h +0 -45
- package/vendor/libarchive/libarchive/archive_platform_xattr.h +0 -45
- package/vendor/libarchive/libarchive/archive_ppmd7.c +0 -1173
- package/vendor/libarchive/libarchive/archive_ppmd7_private.h +0 -119
- package/vendor/libarchive/libarchive/archive_ppmd8.c +0 -1293
- package/vendor/libarchive/libarchive/archive_ppmd8_private.h +0 -123
- package/vendor/libarchive/libarchive/archive_ppmd_private.h +0 -159
- package/vendor/libarchive/libarchive/archive_private.h +0 -209
- package/vendor/libarchive/libarchive/archive_random.c +0 -274
- package/vendor/libarchive/libarchive/archive_random_private.h +0 -36
- package/vendor/libarchive/libarchive/archive_rb.c +0 -709
- package/vendor/libarchive/libarchive/archive_rb.h +0 -113
- package/vendor/libarchive/libarchive/archive_read.3 +0 -250
- package/vendor/libarchive/libarchive/archive_read.c +0 -1814
- package/vendor/libarchive/libarchive/archive_read_add_passphrase.3 +0 -72
- package/vendor/libarchive/libarchive/archive_read_add_passphrase.c +0 -189
- package/vendor/libarchive/libarchive/archive_read_append_filter.c +0 -209
- package/vendor/libarchive/libarchive/archive_read_data.3 +0 -128
- package/vendor/libarchive/libarchive/archive_read_data_into_fd.c +0 -207
- package/vendor/libarchive/libarchive/archive_read_disk.3 +0 -422
- package/vendor/libarchive/libarchive/archive_read_disk_entry_from_file.c +0 -1086
- package/vendor/libarchive/libarchive/archive_read_disk_posix.c +0 -2639
- package/vendor/libarchive/libarchive/archive_read_disk_private.h +0 -97
- package/vendor/libarchive/libarchive/archive_read_disk_set_standard_lookup.c +0 -315
- package/vendor/libarchive/libarchive/archive_read_disk_windows.c +0 -2603
- package/vendor/libarchive/libarchive/archive_read_extract.3 +0 -135
- package/vendor/libarchive/libarchive/archive_read_extract.c +0 -59
- package/vendor/libarchive/libarchive/archive_read_extract2.c +0 -154
- package/vendor/libarchive/libarchive/archive_read_filter.3 +0 -163
- package/vendor/libarchive/libarchive/archive_read_format.3 +0 -190
- package/vendor/libarchive/libarchive/archive_read_free.3 +0 -91
- package/vendor/libarchive/libarchive/archive_read_header.3 +0 -89
- package/vendor/libarchive/libarchive/archive_read_new.3 +0 -57
- package/vendor/libarchive/libarchive/archive_read_open.3 +0 -247
- package/vendor/libarchive/libarchive/archive_read_open_fd.c +0 -236
- package/vendor/libarchive/libarchive/archive_read_open_file.c +0 -257
- package/vendor/libarchive/libarchive/archive_read_open_filename.c +0 -652
- package/vendor/libarchive/libarchive/archive_read_open_memory.c +0 -188
- package/vendor/libarchive/libarchive/archive_read_private.h +0 -274
- package/vendor/libarchive/libarchive/archive_read_set_format.c +0 -116
- package/vendor/libarchive/libarchive/archive_read_set_options.3 +0 -290
- package/vendor/libarchive/libarchive/archive_read_set_options.c +0 -132
- package/vendor/libarchive/libarchive/archive_read_support_filter_all.c +0 -84
- package/vendor/libarchive/libarchive/archive_read_support_filter_by_code.c +0 -68
- package/vendor/libarchive/libarchive/archive_read_support_filter_bzip2.c +0 -360
- package/vendor/libarchive/libarchive/archive_read_support_filter_compress.c +0 -457
- package/vendor/libarchive/libarchive/archive_read_support_filter_grzip.c +0 -108
- package/vendor/libarchive/libarchive/archive_read_support_filter_gzip.c +0 -538
- package/vendor/libarchive/libarchive/archive_read_support_filter_lrzip.c +0 -119
- package/vendor/libarchive/libarchive/archive_read_support_filter_lz4.c +0 -829
- package/vendor/libarchive/libarchive/archive_read_support_filter_lzop.c +0 -493
- package/vendor/libarchive/libarchive/archive_read_support_filter_none.c +0 -51
- package/vendor/libarchive/libarchive/archive_read_support_filter_program.c +0 -497
- package/vendor/libarchive/libarchive/archive_read_support_filter_rpm.c +0 -249
- package/vendor/libarchive/libarchive/archive_read_support_filter_uu.c +0 -739
- package/vendor/libarchive/libarchive/archive_read_support_filter_xz.c +0 -792
- package/vendor/libarchive/libarchive/archive_read_support_filter_zstd.c +0 -356
- package/vendor/libarchive/libarchive/archive_read_support_format_7zip.c +0 -4650
- package/vendor/libarchive/libarchive/archive_read_support_format_all.c +0 -88
- package/vendor/libarchive/libarchive/archive_read_support_format_ar.c +0 -597
- package/vendor/libarchive/libarchive/archive_read_support_format_by_code.c +0 -76
- package/vendor/libarchive/libarchive/archive_read_support_format_cab.c +0 -3410
- package/vendor/libarchive/libarchive/archive_read_support_format_cpio.c +0 -1152
- package/vendor/libarchive/libarchive/archive_read_support_format_empty.c +0 -95
- package/vendor/libarchive/libarchive/archive_read_support_format_iso9660.c +0 -3516
- package/vendor/libarchive/libarchive/archive_read_support_format_lha.c +0 -2931
- package/vendor/libarchive/libarchive/archive_read_support_format_mtree.c +0 -2113
- package/vendor/libarchive/libarchive/archive_read_support_format_rar.c +0 -3932
- package/vendor/libarchive/libarchive/archive_read_support_format_rar5.c +0 -4501
- package/vendor/libarchive/libarchive/archive_read_support_format_raw.c +0 -194
- package/vendor/libarchive/libarchive/archive_read_support_format_tar.c +0 -3785
- package/vendor/libarchive/libarchive/archive_read_support_format_warc.c +0 -875
- package/vendor/libarchive/libarchive/archive_read_support_format_xar.c +0 -3770
- package/vendor/libarchive/libarchive/archive_read_support_format_zip.c +0 -4710
- package/vendor/libarchive/libarchive/archive_string.c +0 -4391
- package/vendor/libarchive/libarchive/archive_string.h +0 -244
- package/vendor/libarchive/libarchive/archive_string_composition.h +0 -2289
- package/vendor/libarchive/libarchive/archive_string_sprintf.c +0 -200
- package/vendor/libarchive/libarchive/archive_time.c +0 -168
- package/vendor/libarchive/libarchive/archive_time_private.h +0 -47
- package/vendor/libarchive/libarchive/archive_util.3 +0 -239
- package/vendor/libarchive/libarchive/archive_util.c +0 -668
- package/vendor/libarchive/libarchive/archive_version_details.c +0 -516
- package/vendor/libarchive/libarchive/archive_virtual.c +0 -162
- package/vendor/libarchive/libarchive/archive_windows.c +0 -1035
- package/vendor/libarchive/libarchive/archive_windows.h +0 -332
- package/vendor/libarchive/libarchive/archive_write.3 +0 -266
- package/vendor/libarchive/libarchive/archive_write.c +0 -896
- package/vendor/libarchive/libarchive/archive_write_add_filter.c +0 -71
- package/vendor/libarchive/libarchive/archive_write_add_filter_b64encode.c +0 -329
- package/vendor/libarchive/libarchive/archive_write_add_filter_by_name.c +0 -76
- package/vendor/libarchive/libarchive/archive_write_add_filter_bzip2.c +0 -411
- package/vendor/libarchive/libarchive/archive_write_add_filter_compress.c +0 -459
- package/vendor/libarchive/libarchive/archive_write_add_filter_grzip.c +0 -143
- package/vendor/libarchive/libarchive/archive_write_add_filter_gzip.c +0 -493
- package/vendor/libarchive/libarchive/archive_write_add_filter_lrzip.c +0 -214
- package/vendor/libarchive/libarchive/archive_write_add_filter_lz4.c +0 -710
- package/vendor/libarchive/libarchive/archive_write_add_filter_lzop.c +0 -500
- package/vendor/libarchive/libarchive/archive_write_add_filter_none.c +0 -42
- package/vendor/libarchive/libarchive/archive_write_add_filter_program.c +0 -398
- package/vendor/libarchive/libarchive/archive_write_add_filter_uuencode.c +0 -320
- package/vendor/libarchive/libarchive/archive_write_add_filter_xz.c +0 -547
- package/vendor/libarchive/libarchive/archive_write_add_filter_zstd.c +0 -608
- package/vendor/libarchive/libarchive/archive_write_blocksize.3 +0 -112
- package/vendor/libarchive/libarchive/archive_write_data.3 +0 -88
- package/vendor/libarchive/libarchive/archive_write_disk.3 +0 -360
- package/vendor/libarchive/libarchive/archive_write_disk_posix.c +0 -4789
- package/vendor/libarchive/libarchive/archive_write_disk_private.h +0 -43
- package/vendor/libarchive/libarchive/archive_write_disk_set_standard_lookup.c +0 -265
- package/vendor/libarchive/libarchive/archive_write_disk_windows.c +0 -2952
- package/vendor/libarchive/libarchive/archive_write_filter.3 +0 -140
- package/vendor/libarchive/libarchive/archive_write_finish_entry.3 +0 -77
- package/vendor/libarchive/libarchive/archive_write_format.3 +0 -187
- package/vendor/libarchive/libarchive/archive_write_free.3 +0 -94
- package/vendor/libarchive/libarchive/archive_write_header.3 +0 -71
- package/vendor/libarchive/libarchive/archive_write_new.3 +0 -56
- package/vendor/libarchive/libarchive/archive_write_open.3 +0 -270
- package/vendor/libarchive/libarchive/archive_write_open_fd.c +0 -141
- package/vendor/libarchive/libarchive/archive_write_open_file.c +0 -102
- package/vendor/libarchive/libarchive/archive_write_open_filename.c +0 -272
- package/vendor/libarchive/libarchive/archive_write_open_memory.c +0 -110
- package/vendor/libarchive/libarchive/archive_write_private.h +0 -166
- package/vendor/libarchive/libarchive/archive_write_set_format.c +0 -124
- package/vendor/libarchive/libarchive/archive_write_set_format_7zip.c +0 -2571
- package/vendor/libarchive/libarchive/archive_write_set_format_ar.c +0 -540
- package/vendor/libarchive/libarchive/archive_write_set_format_by_name.c +0 -93
- package/vendor/libarchive/libarchive/archive_write_set_format_cpio.c +0 -11
- package/vendor/libarchive/libarchive/archive_write_set_format_cpio_binary.c +0 -618
- package/vendor/libarchive/libarchive/archive_write_set_format_cpio_newc.c +0 -457
- package/vendor/libarchive/libarchive/archive_write_set_format_cpio_odc.c +0 -508
- package/vendor/libarchive/libarchive/archive_write_set_format_filter_by_ext.c +0 -141
- package/vendor/libarchive/libarchive/archive_write_set_format_gnutar.c +0 -790
- package/vendor/libarchive/libarchive/archive_write_set_format_iso9660.c +0 -8216
- package/vendor/libarchive/libarchive/archive_write_set_format_mtree.c +0 -2307
- package/vendor/libarchive/libarchive/archive_write_set_format_pax.c +0 -2249
- package/vendor/libarchive/libarchive/archive_write_set_format_private.h +0 -40
- package/vendor/libarchive/libarchive/archive_write_set_format_raw.c +0 -123
- package/vendor/libarchive/libarchive/archive_write_set_format_shar.c +0 -650
- package/vendor/libarchive/libarchive/archive_write_set_format_ustar.c +0 -768
- package/vendor/libarchive/libarchive/archive_write_set_format_v7tar.c +0 -648
- package/vendor/libarchive/libarchive/archive_write_set_format_warc.c +0 -491
- package/vendor/libarchive/libarchive/archive_write_set_format_xar.c +0 -3799
- package/vendor/libarchive/libarchive/archive_write_set_format_zip.c +0 -2548
- package/vendor/libarchive/libarchive/archive_write_set_options.3 +0 -779
- package/vendor/libarchive/libarchive/archive_write_set_options.c +0 -129
- package/vendor/libarchive/libarchive/archive_write_set_passphrase.3 +0 -72
- package/vendor/libarchive/libarchive/archive_write_set_passphrase.c +0 -95
- package/vendor/libarchive/libarchive/archive_xxhash.h +0 -48
- package/vendor/libarchive/libarchive/config_freebsd.h +0 -275
- package/vendor/libarchive/libarchive/cpio.5 +0 -389
- package/vendor/libarchive/libarchive/filter_fork.h +0 -44
- package/vendor/libarchive/libarchive/filter_fork_posix.c +0 -269
- package/vendor/libarchive/libarchive/filter_fork_windows.c +0 -270
- package/vendor/libarchive/libarchive/libarchive-formats.5 +0 -478
- package/vendor/libarchive/libarchive/libarchive.3 +0 -297
- package/vendor/libarchive/libarchive/libarchive_changes.3 +0 -339
- package/vendor/libarchive/libarchive/libarchive_internals.3 +0 -363
- package/vendor/libarchive/libarchive/module.modulemap +0 -34
- package/vendor/libarchive/libarchive/mtree.5 +0 -323
- package/vendor/libarchive/libarchive/tar.5 +0 -947
- package/vendor/libarchive/libarchive/xxhash.c +0 -531
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/*-
|
|
2
|
-
* Copyright (c) 2003-2007 Tim Kientzle
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* Redistribution and use in source and binary forms, with or without
|
|
6
|
-
* modification, are permitted provided that the following conditions
|
|
7
|
-
* are met:
|
|
8
|
-
* 1. Redistributions of source code must retain the above copyright
|
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
|
10
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
|
11
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
12
|
-
* documentation and/or other materials provided with the distribution.
|
|
13
|
-
*
|
|
14
|
-
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
|
15
|
-
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
16
|
-
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
17
|
-
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
18
|
-
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
19
|
-
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
20
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
21
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
22
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
23
|
-
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
#include "archive_platform.h"
|
|
27
|
-
|
|
28
|
-
#ifdef HAVE_SYS_STAT_H
|
|
29
|
-
#include <sys/stat.h>
|
|
30
|
-
#endif
|
|
31
|
-
#ifdef HAVE_STDLIB_H
|
|
32
|
-
#include <stdlib.h>
|
|
33
|
-
#endif
|
|
34
|
-
|
|
35
|
-
#include "archive_entry.h"
|
|
36
|
-
#include "archive_entry_private.h"
|
|
37
|
-
|
|
38
|
-
const struct stat *
|
|
39
|
-
archive_entry_stat(struct archive_entry *entry)
|
|
40
|
-
{
|
|
41
|
-
int64_t size;
|
|
42
|
-
struct stat *st;
|
|
43
|
-
if (entry->stat == NULL) {
|
|
44
|
-
entry->stat = calloc(1, sizeof(*st));
|
|
45
|
-
if (entry->stat == NULL)
|
|
46
|
-
return (NULL);
|
|
47
|
-
entry->stat_valid = 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/*
|
|
51
|
-
* If none of the underlying fields have been changed, we
|
|
52
|
-
* don't need to regenerate. In theory, we could use a bitmap
|
|
53
|
-
* here to flag only those items that have changed, but the
|
|
54
|
-
* extra complexity probably isn't worth it. It will be very
|
|
55
|
-
* rare for anyone to change just one field then request a new
|
|
56
|
-
* stat structure.
|
|
57
|
-
*/
|
|
58
|
-
if (entry->stat_valid)
|
|
59
|
-
return (entry->stat);
|
|
60
|
-
|
|
61
|
-
st = entry->stat;
|
|
62
|
-
/*
|
|
63
|
-
* Use the public interfaces to extract items, so that
|
|
64
|
-
* the appropriate conversions get invoked.
|
|
65
|
-
*/
|
|
66
|
-
st->st_atime = archive_entry_atime(entry);
|
|
67
|
-
#if HAVE_STRUCT_STAT_ST_BIRTHTIME
|
|
68
|
-
st->st_birthtime = archive_entry_birthtime(entry);
|
|
69
|
-
#endif
|
|
70
|
-
st->st_ctime = archive_entry_ctime(entry);
|
|
71
|
-
st->st_mtime = archive_entry_mtime(entry);
|
|
72
|
-
st->st_dev = archive_entry_dev(entry);
|
|
73
|
-
st->st_gid = (gid_t)archive_entry_gid(entry);
|
|
74
|
-
st->st_uid = (uid_t)archive_entry_uid(entry);
|
|
75
|
-
st->st_ino = (ino_t)archive_entry_ino64(entry);
|
|
76
|
-
st->st_nlink = archive_entry_nlink(entry);
|
|
77
|
-
st->st_rdev = archive_entry_rdev(entry);
|
|
78
|
-
size = archive_entry_size(entry);
|
|
79
|
-
st->st_size = (off_t)size;
|
|
80
|
-
if (st->st_size < 0 || (int64_t)st->st_size != size)
|
|
81
|
-
st->st_size = 0;
|
|
82
|
-
st->st_mode = archive_entry_mode(entry);
|
|
83
|
-
|
|
84
|
-
/*
|
|
85
|
-
* On systems that support high-res timestamps, copy that
|
|
86
|
-
* information into struct stat.
|
|
87
|
-
*/
|
|
88
|
-
#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
|
|
89
|
-
st->st_atimespec.tv_nsec = archive_entry_atime_nsec(entry);
|
|
90
|
-
st->st_ctimespec.tv_nsec = archive_entry_ctime_nsec(entry);
|
|
91
|
-
st->st_mtimespec.tv_nsec = archive_entry_mtime_nsec(entry);
|
|
92
|
-
#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
|
|
93
|
-
st->st_atim.tv_nsec = archive_entry_atime_nsec(entry);
|
|
94
|
-
st->st_ctim.tv_nsec = archive_entry_ctime_nsec(entry);
|
|
95
|
-
st->st_mtim.tv_nsec = archive_entry_mtime_nsec(entry);
|
|
96
|
-
#elif HAVE_STRUCT_STAT_ST_MTIME_N
|
|
97
|
-
st->st_atime_n = archive_entry_atime_nsec(entry);
|
|
98
|
-
st->st_ctime_n = archive_entry_ctime_nsec(entry);
|
|
99
|
-
st->st_mtime_n = archive_entry_mtime_nsec(entry);
|
|
100
|
-
#elif HAVE_STRUCT_STAT_ST_UMTIME
|
|
101
|
-
st->st_uatime = archive_entry_atime_nsec(entry) / 1000;
|
|
102
|
-
st->st_uctime = archive_entry_ctime_nsec(entry) / 1000;
|
|
103
|
-
st->st_umtime = archive_entry_mtime_nsec(entry) / 1000;
|
|
104
|
-
#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
|
|
105
|
-
st->st_atime_usec = archive_entry_atime_nsec(entry) / 1000;
|
|
106
|
-
st->st_ctime_usec = archive_entry_ctime_nsec(entry) / 1000;
|
|
107
|
-
st->st_mtime_usec = archive_entry_mtime_nsec(entry) / 1000;
|
|
108
|
-
#endif
|
|
109
|
-
#if HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
|
|
110
|
-
st->st_birthtimespec.tv_nsec = archive_entry_birthtime_nsec(entry);
|
|
111
|
-
#endif
|
|
112
|
-
|
|
113
|
-
/*
|
|
114
|
-
* TODO: On Linux, store 32 or 64 here depending on whether
|
|
115
|
-
* the cached stat structure is a stat32 or a stat64. This
|
|
116
|
-
* will allow us to support both variants interchangeably.
|
|
117
|
-
*/
|
|
118
|
-
entry->stat_valid = 1;
|
|
119
|
-
|
|
120
|
-
return (st);
|
|
121
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/*-
|
|
2
|
-
* Copyright (c) 2003-2007 Tim Kientzle
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* Redistribution and use in source and binary forms, with or without
|
|
6
|
-
* modification, are permitted provided that the following conditions
|
|
7
|
-
* are met:
|
|
8
|
-
* 1. Redistributions of source code must retain the above copyright
|
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
|
10
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
|
11
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
12
|
-
* documentation and/or other materials provided with the distribution.
|
|
13
|
-
*
|
|
14
|
-
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
|
15
|
-
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
16
|
-
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
17
|
-
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
18
|
-
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
19
|
-
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
20
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
21
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
22
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
23
|
-
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
#include "archive_platform.h"
|
|
27
|
-
|
|
28
|
-
#ifdef HAVE_SYS_STAT_H
|
|
29
|
-
#include <sys/stat.h>
|
|
30
|
-
#endif
|
|
31
|
-
|
|
32
|
-
#include "archive_entry.h"
|
|
33
|
-
#include "archive_entry_private.h"
|
|
34
|
-
|
|
35
|
-
const char *
|
|
36
|
-
archive_entry_strmode(struct archive_entry *entry)
|
|
37
|
-
{
|
|
38
|
-
char *bp = entry->strmode;
|
|
39
|
-
mode_t mask, mode;
|
|
40
|
-
int i;
|
|
41
|
-
|
|
42
|
-
switch (archive_entry_filetype(entry)) {
|
|
43
|
-
case AE_IFREG: bp[0] = '-'; break;
|
|
44
|
-
case AE_IFBLK: bp[0] = 'b'; break;
|
|
45
|
-
case AE_IFCHR: bp[0] = 'c'; break;
|
|
46
|
-
case AE_IFDIR: bp[0] = 'd'; break;
|
|
47
|
-
case AE_IFLNK: bp[0] = 'l'; break;
|
|
48
|
-
case AE_IFSOCK: bp[0] = 's'; break;
|
|
49
|
-
case AE_IFIFO: bp[0] = 'p'; break;
|
|
50
|
-
default:
|
|
51
|
-
bp[0] = (archive_entry_hardlink(entry) != NULL) ? 'h' : '?';
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
mode = archive_entry_mode(entry);
|
|
56
|
-
for (i = 0, mask = 0400; i < 9; i++, mask >>= 1)
|
|
57
|
-
bp[i + 1] = (mode & mask) ? "rwx"[i % 3] : '-';
|
|
58
|
-
|
|
59
|
-
if (mode & S_ISUID)
|
|
60
|
-
bp[3] = (mode & 0100) ? 's' : 'S';
|
|
61
|
-
if (mode & S_ISGID)
|
|
62
|
-
bp[6] = (mode & 0010) ? 's' : 'S';
|
|
63
|
-
if (mode & S_ISVTX)
|
|
64
|
-
bp[9] = (mode & 0001) ? 't' : 'T';
|
|
65
|
-
bp[10] = (archive_entry_acl_types(entry) != 0) ? '+' : ' ';
|
|
66
|
-
bp[11] = '\0';
|
|
67
|
-
|
|
68
|
-
return (bp);
|
|
69
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
.\" Copyright (c) 2003-2007 Tim Kientzle
|
|
2
|
-
.\" Copyright (c) 2010 Joerg Sonnenberger
|
|
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 AND CONTRIBUTORS ``AS IS'' AND
|
|
15
|
-
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
16
|
-
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
17
|
-
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
18
|
-
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
19
|
-
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
20
|
-
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
21
|
-
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
22
|
-
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
23
|
-
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
24
|
-
.\" SUCH DAMAGE.
|
|
25
|
-
.\"
|
|
26
|
-
.Dd February 2, 2012
|
|
27
|
-
.Dt ARCHIVE_ENTRY_TIME 3
|
|
28
|
-
.Os
|
|
29
|
-
.Sh NAME
|
|
30
|
-
.Nm archive_entry_atime ,
|
|
31
|
-
.Nm archive_entry_atime_nsec ,
|
|
32
|
-
.Nm archive_entry_atime_is_set ,
|
|
33
|
-
.Nm archive_entry_set_atime ,
|
|
34
|
-
.Nm archive_entry_unset_atime ,
|
|
35
|
-
.Nm archive_entry_birthtime ,
|
|
36
|
-
.Nm archive_entry_birthtime_nsec ,
|
|
37
|
-
.Nm archive_entry_birthtime_is_set ,
|
|
38
|
-
.Nm archive_entry_set_birthtime ,
|
|
39
|
-
.Nm archive_entry_unset_birthtime ,
|
|
40
|
-
.Nm archive_entry_ctime ,
|
|
41
|
-
.Nm archive_entry_ctime_nsec ,
|
|
42
|
-
.Nm archive_entry_ctime_is_set ,
|
|
43
|
-
.Nm archive_entry_set_ctime ,
|
|
44
|
-
.Nm archive_entry_unset_ctime ,
|
|
45
|
-
.Nm archive_entry_mtime ,
|
|
46
|
-
.Nm archive_entry_mtime_nsec ,
|
|
47
|
-
.Nm archive_entry_mtime_is_set ,
|
|
48
|
-
.Nm archive_entry_set_mtime ,
|
|
49
|
-
.Nm archive_entry_unset_mtime
|
|
50
|
-
.Nd functions for manipulating times in archive entry descriptions
|
|
51
|
-
.Sh LIBRARY
|
|
52
|
-
Streaming Archive Library (libarchive, -larchive)
|
|
53
|
-
.Sh SYNOPSIS
|
|
54
|
-
.In archive_entry.h
|
|
55
|
-
.Ft time_t
|
|
56
|
-
.Fn archive_entry_atime "struct archive_entry *a"
|
|
57
|
-
.Ft long
|
|
58
|
-
.Fn archive_entry_atime_nsec "struct archive_entry *a"
|
|
59
|
-
.Ft int
|
|
60
|
-
.Fn archive_entry_atime_is_set "struct archive_entry *a"
|
|
61
|
-
.Ft void
|
|
62
|
-
.Fn archive_entry_set_atime "struct archive_entry *a" "time_t sec" "long nanosec"
|
|
63
|
-
.Ft void
|
|
64
|
-
.Fn archive_entry_unset_atime "struct archive_entry *a"
|
|
65
|
-
.Ft time_t
|
|
66
|
-
.Fn archive_entry_birthtime "struct archive_entry *a"
|
|
67
|
-
.Ft long
|
|
68
|
-
.Fn archive_entry_birthtime_nsec "struct archive_entry *a"
|
|
69
|
-
.Ft int
|
|
70
|
-
.Fn archive_entry_birthtime_is_set "struct archive_entry *a"
|
|
71
|
-
.Ft void
|
|
72
|
-
.Fn archive_entry_set_birthtime "struct archive_entry *a" "time_t sec" "long nanosec"
|
|
73
|
-
.Ft void
|
|
74
|
-
.Fn archive_entry_unset_birthtime "struct archive_entry *a"
|
|
75
|
-
.Ft time_t
|
|
76
|
-
.Fn archive_entry_ctime "struct archive_entry *a"
|
|
77
|
-
.Ft long
|
|
78
|
-
.Fn archive_entry_ctime_nsec "struct archive_entry *a"
|
|
79
|
-
.Ft int
|
|
80
|
-
.Fn archive_entry_ctime_is_set "struct archive_entry *a"
|
|
81
|
-
.Ft void
|
|
82
|
-
.Fn archive_entry_set_ctime "struct archive_entry *a" "time_t sec" "long nanosec"
|
|
83
|
-
.Ft void
|
|
84
|
-
.Fn archive_entry_unset_ctime "struct archive_entry *a"
|
|
85
|
-
.Ft time_t
|
|
86
|
-
.Fn archive_entry_mtime "struct archive_entry *a"
|
|
87
|
-
.Ft long
|
|
88
|
-
.Fn archive_entry_mtime_nsec "struct archive_entry *a"
|
|
89
|
-
.Ft int
|
|
90
|
-
.Fn archive_entry_mtime_is_set "struct archive_entry *a"
|
|
91
|
-
.Ft void
|
|
92
|
-
.Fn archive_entry_set_mtime "struct archive_entry *a" "time_t sec" "long nanosec"
|
|
93
|
-
.Ft void
|
|
94
|
-
.Fn archive_entry_unset_mtime "struct archive_entry *a"
|
|
95
|
-
.Sh DESCRIPTION
|
|
96
|
-
These functions create and manipulate the time fields in an
|
|
97
|
-
.Vt archive_entry .
|
|
98
|
-
Supported time fields are atime (access time), birthtime (creation time),
|
|
99
|
-
ctime (last time an inode property was changed) and mtime (modification time).
|
|
100
|
-
.Pp
|
|
101
|
-
.Xr libarchive 3
|
|
102
|
-
provides a high-resolution interface.
|
|
103
|
-
The timestamps are truncated automatically depending on the archive format
|
|
104
|
-
(for archiving) or the filesystem capabilities (for restoring).
|
|
105
|
-
.Pp
|
|
106
|
-
All timestamp fields are optional.
|
|
107
|
-
The
|
|
108
|
-
.Fn XXX_unset
|
|
109
|
-
functions can be used to mark the corresponding field as missing.
|
|
110
|
-
The current state can be queried using
|
|
111
|
-
.Fn XXX_is_set .
|
|
112
|
-
Unset time fields have a second and nanosecond field of 0.
|
|
113
|
-
.Sh SEE ALSO
|
|
114
|
-
.Xr archive_entry 3 ,
|
|
115
|
-
.Xr libarchive 3
|
|
116
|
-
.Sh HISTORY
|
|
117
|
-
The
|
|
118
|
-
.Nm libarchive
|
|
119
|
-
library first appeared in
|
|
120
|
-
.Fx 5.3 .
|
|
121
|
-
.Sh AUTHORS
|
|
122
|
-
.An -nosplit
|
|
123
|
-
The
|
|
124
|
-
.Nm libarchive
|
|
125
|
-
library was written by
|
|
126
|
-
.An Tim Kientzle Aq kientzle@acm.org .
|
|
127
|
-
.\" .Sh BUGS
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/*-
|
|
2
|
-
* Copyright (c) 2003-2007 Tim Kientzle
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* Redistribution and use in source and binary forms, with or without
|
|
6
|
-
* modification, are permitted provided that the following conditions
|
|
7
|
-
* are met:
|
|
8
|
-
* 1. Redistributions of source code must retain the above copyright
|
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
|
10
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
|
11
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
12
|
-
* documentation and/or other materials provided with the distribution.
|
|
13
|
-
*
|
|
14
|
-
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
|
15
|
-
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
16
|
-
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
17
|
-
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
18
|
-
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
19
|
-
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
20
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
21
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
22
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
23
|
-
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
#include "archive_platform.h"
|
|
27
|
-
|
|
28
|
-
#ifdef HAVE_SYS_STAT_H
|
|
29
|
-
#include <sys/stat.h>
|
|
30
|
-
#endif
|
|
31
|
-
#ifdef HAVE_SYS_TYPES_H
|
|
32
|
-
#include <sys/types.h>
|
|
33
|
-
#endif
|
|
34
|
-
#ifdef HAVE_LIMITS_H
|
|
35
|
-
#include <limits.h>
|
|
36
|
-
#endif
|
|
37
|
-
#ifdef HAVE_LINUX_FS_H
|
|
38
|
-
#include <linux/fs.h> /* for Linux file flags */
|
|
39
|
-
#endif
|
|
40
|
-
/*
|
|
41
|
-
* Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
|
|
42
|
-
* As the include guards don't agree, the order of include is important.
|
|
43
|
-
*/
|
|
44
|
-
#ifdef HAVE_LINUX_EXT2_FS_H
|
|
45
|
-
#include <linux/ext2_fs.h> /* for Linux file flags */
|
|
46
|
-
#endif
|
|
47
|
-
#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
|
|
48
|
-
#include <ext2fs/ext2_fs.h> /* for Linux file flags */
|
|
49
|
-
#endif
|
|
50
|
-
#include <stddef.h>
|
|
51
|
-
#include <stdio.h>
|
|
52
|
-
#ifdef HAVE_STDLIB_H
|
|
53
|
-
#include <stdlib.h>
|
|
54
|
-
#endif
|
|
55
|
-
#ifdef HAVE_STRING_H
|
|
56
|
-
#include <string.h>
|
|
57
|
-
#endif
|
|
58
|
-
#ifdef HAVE_WCHAR_H
|
|
59
|
-
#include <wchar.h>
|
|
60
|
-
#endif
|
|
61
|
-
|
|
62
|
-
#include "archive.h"
|
|
63
|
-
#include "archive_entry.h"
|
|
64
|
-
#include "archive_private.h"
|
|
65
|
-
#include "archive_entry_private.h"
|
|
66
|
-
|
|
67
|
-
/*
|
|
68
|
-
* extended attribute handling
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
void
|
|
72
|
-
archive_entry_xattr_clear(struct archive_entry *entry)
|
|
73
|
-
{
|
|
74
|
-
struct ae_xattr *xp;
|
|
75
|
-
|
|
76
|
-
while (entry->xattr_head != NULL) {
|
|
77
|
-
xp = entry->xattr_head->next;
|
|
78
|
-
free(entry->xattr_head->name);
|
|
79
|
-
free(entry->xattr_head->value);
|
|
80
|
-
free(entry->xattr_head);
|
|
81
|
-
entry->xattr_head = xp;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
entry->xattr_head = NULL;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
void
|
|
88
|
-
archive_entry_xattr_add_entry(struct archive_entry *entry,
|
|
89
|
-
const char *name, const void *value, size_t size)
|
|
90
|
-
{
|
|
91
|
-
struct ae_xattr *xp;
|
|
92
|
-
|
|
93
|
-
if ((xp = malloc(sizeof(struct ae_xattr))) == NULL)
|
|
94
|
-
__archive_errx(1, "Out of memory");
|
|
95
|
-
|
|
96
|
-
if ((xp->name = strdup(name)) == NULL)
|
|
97
|
-
__archive_errx(1, "Out of memory");
|
|
98
|
-
|
|
99
|
-
if ((xp->value = malloc(size)) == NULL)
|
|
100
|
-
__archive_errx(1, "Out of memory");
|
|
101
|
-
|
|
102
|
-
memcpy(xp->value, value, size);
|
|
103
|
-
xp->size = size;
|
|
104
|
-
|
|
105
|
-
xp->next = entry->xattr_head;
|
|
106
|
-
entry->xattr_head = xp;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
/*
|
|
111
|
-
* returns number of the extended attribute entries
|
|
112
|
-
*/
|
|
113
|
-
int
|
|
114
|
-
archive_entry_xattr_count(struct archive_entry *entry)
|
|
115
|
-
{
|
|
116
|
-
struct ae_xattr *xp;
|
|
117
|
-
int count = 0;
|
|
118
|
-
|
|
119
|
-
for (xp = entry->xattr_head; xp != NULL; xp = xp->next)
|
|
120
|
-
count++;
|
|
121
|
-
|
|
122
|
-
return count;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
int
|
|
126
|
-
archive_entry_xattr_reset(struct archive_entry * entry)
|
|
127
|
-
{
|
|
128
|
-
entry->xattr_p = entry->xattr_head;
|
|
129
|
-
|
|
130
|
-
return archive_entry_xattr_count(entry);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
int
|
|
134
|
-
archive_entry_xattr_next(struct archive_entry * entry,
|
|
135
|
-
const char **name, const void **value, size_t *size)
|
|
136
|
-
{
|
|
137
|
-
if (entry->xattr_p) {
|
|
138
|
-
*name = entry->xattr_p->name;
|
|
139
|
-
*value = entry->xattr_p->value;
|
|
140
|
-
*size = entry->xattr_p->size;
|
|
141
|
-
|
|
142
|
-
entry->xattr_p = entry->xattr_p->next;
|
|
143
|
-
|
|
144
|
-
return (ARCHIVE_OK);
|
|
145
|
-
} else {
|
|
146
|
-
*name = NULL;
|
|
147
|
-
*value = NULL;
|
|
148
|
-
*size = (size_t)0;
|
|
149
|
-
return (ARCHIVE_WARN);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/*
|
|
154
|
-
* end of xattr handling
|
|
155
|
-
*/
|