die() {
echo "ERROR: $*"
exit 1
}
is_installed() {
type $1 > /dev/null 2>&1 || die "'$1' tool has not been found. Install it and try again"
}
is_installed bindgen
basedir=$(dirname $(readlink -f $0))/..
trap "rm -f $basedir/wrapper.h" EXIT
cat <<EOF > $basedir/wrapper.h
#include <archive.h>
#include <archive_entry.h>
EOF
bindgen \
\
--raw-line "#![allow(dead_code)]" \
--raw-line "#![allow(non_camel_case_types)]" \
--raw-line "#![allow(non_snake_case)]" \
--raw-line "use libc::stat;" \
--allowlist-var "ARCHIVE_OK" \
--allowlist-var "ARCHIVE_EOF" \
--allowlist-var "ARCHIVE_RETRY" \
--allowlist-var "ARCHIVE_WARN" \
--allowlist-var "ARCHIVE_FAILED" \
--allowlist-var "ARCHIVE_FATAL" \
\
--raw-line "pub const AE_IFMT: u32 = 0o170000;" \
--raw-line "pub const AE_IFREG: u32 = 0o100000;" \
--raw-line "pub const AE_IFLNK: u32 = 0o120000;" \
--raw-line "pub const AE_IFSOCK: u32 = 0o140000;" \
--raw-line "pub const AE_IFCHR: u32 = 0o020000;" \
--raw-line "pub const AE_IFBLK: u32 = 0o060000;" \
--raw-line "pub const AE_IFDIR: u32 = 0o040000;" \
--raw-line "pub const AE_IFIFO: u32 = 0o010000;" \
\
--allowlist-var "ARCHIVE_EXTRACT_TIME" \
--allowlist-var "ARCHIVE_EXTRACT_OWNER" \
--allowlist-var "ARCHIVE_EXTRACT_PERM" \
--allowlist-var "ARCHIVE_EXTRACT_TIME" \
--allowlist-var "ARCHIVE_EXTRACT_NO_OVERWRITE" \
--allowlist-var "ARCHIVE_EXTRACT_UNLINK" \
--allowlist-var "ARCHIVE_EXTRACT_ACL" \
--allowlist-var "ARCHIVE_EXTRACT_FFLAGS" \
--allowlist-var "ARCHIVE_EXTRACT_XATTR" \
--allowlist-var "ARCHIVE_EXTRACT_SECURE_SYMLINKS" \
--allowlist-var "ARCHIVE_EXTRACT_SECURE_NODOTDOT" \
--allowlist-var "ARCHIVE_EXTRACT_NO_AUTODIR" \
--allowlist-var "ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER" \
--allowlist-var "ARCHIVE_EXTRACT_MAC_METADATA" \
--allowlist-var "ARCHIVE_EXTRACT_NO_HFS_COMPRESSION" \
--allowlist-var "ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED" \
--allowlist-var "ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS" \
--allowlist-var "ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS" \
--allowlist-var "ARCHIVE_EXTRACT_SAFE_WRITES" \
--allowlist-var "ARCHIVE_EXTRACT_PERM" \
--allowlist-var "ARCHIVE_EXTRACT_ACL" \
--allowlist-var "ARCHIVE_EXTRACT_FFLAGS" \
--allowlist-var "ARCHIVE_FILTER_NONE" \
--allowlist-var "ARCHIVE_FILTER_GZIP" \
--allowlist-var "ARCHIVE_FILTER_BZIP2" \
--allowlist-var "ARCHIVE_FILTER_COMPRESS" \
--allowlist-var "ARCHIVE_FILTER_PROGRAM" \
--allowlist-var "ARCHIVE_FILTER_LZMA" \
--allowlist-var "ARCHIVE_FILTER_XZ" \
--allowlist-var "ARCHIVE_FILTER_UU" \
--allowlist-var "ARCHIVE_FILTER_RPM" \
--allowlist-var "ARCHIVE_FILTER_LZIP" \
--allowlist-var "ARCHIVE_FILTER_LRZIP" \
--allowlist-var "ARCHIVE_FILTER_LZOP" \
--allowlist-var "ARCHIVE_FILTER_GRZIP" \
--allowlist-var "ARCHIVE_FILTER_LZ4" \
--allowlist-var "ARCHIVE_FILTER_ZSTD" \
--allowlist-var "ARCHIVE_FORMAT_BASE_MASK" \
--allowlist-var "ARCHIVE_FORMAT_CPIO" \
--allowlist-var "ARCHIVE_FORMAT_CPIO_POSIX" \
--allowlist-var "ARCHIVE_FORMAT_CPIO_BIN_LE" \
--allowlist-var "ARCHIVE_FORMAT_CPIO_BIN_BE" \
--allowlist-var "ARCHIVE_FORMAT_CPIO_SVR4_NOCRC" \
--allowlist-var "ARCHIVE_FORMAT_CPIO_SVR4_CRC" \
--allowlist-var "ARCHIVE_FORMAT_CPIO_AFIO_LARGE" \
--allowlist-var "ARCHIVE_FORMAT_CPIO_PWB" \
--allowlist-var "ARCHIVE_FORMAT_SHAR" \
--allowlist-var "ARCHIVE_FORMAT_SHAR_BASE" \
--allowlist-var "ARCHIVE_FORMAT_SHAR_DUMP" \
--allowlist-var "ARCHIVE_FORMAT_TAR" \
--allowlist-var "ARCHIVE_FORMAT_TAR_USTAR" \
--allowlist-var "ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE" \
--allowlist-var "ARCHIVE_FORMAT_TAR_PAX_RESTRICTED" \
--allowlist-var "ARCHIVE_FORMAT_TAR_GNUTAR" \
--allowlist-var "ARCHIVE_FORMAT_ISO9660" \
--allowlist-var "ARCHIVE_FORMAT_ISO9660_ROCKRIDGE" \
--allowlist-var "ARCHIVE_FORMAT_ZIP" \
--allowlist-var "ARCHIVE_FORMAT_EMPTY" \
--allowlist-var "ARCHIVE_FORMAT_AR" \
--allowlist-var "ARCHIVE_FORMAT_AR_GNU" \
--allowlist-var "ARCHIVE_FORMAT_AR_BSD" \
--allowlist-var "ARCHIVE_FORMAT_MTREE" \
--allowlist-var "ARCHIVE_FORMAT_RAW" \
--allowlist-var "ARCHIVE_FORMAT_XAR" \
--allowlist-var "ARCHIVE_FORMAT_LHA" \
--allowlist-var "ARCHIVE_FORMAT_CAB" \
--allowlist-var "ARCHIVE_FORMAT_RAR" \
--allowlist-var "ARCHIVE_FORMAT_7ZIP" \
--allowlist-var "ARCHIVE_FORMAT_WARC" \
--allowlist-var "ARCHIVE_FORMAT_RAR_V5" \
--allowlist-var "ARCHIVE_READ_FORMAT_CAPS_NONE" \
--allowlist-var "ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA" \
--allowlist-var "ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA" \
--allowlist-var "ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED" \
--allowlist-var "ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW" \
--allowlist-var "ARCHIVE_READDISK_RESTORE_ATIME" \
--allowlist-var "ARCHIVE_READDISK_HONOR_NODUMP" \
--allowlist-var "ARCHIVE_READDISK_MAC_COPYFILE" \
--allowlist-var "ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS" \
--allowlist-var "ARCHIVE_READDISK_NO_XATTR" \
--allowlist-var "ARCHIVE_READDISK_NO_ACL" \
--allowlist-var "ARCHIVE_READDISK_NO_FFLAGS" \
--allowlist-var "ARCHIVE_READDISK_NO_SPARSE" \
--allowlist-var "ARCHIVE_MATCH_MTIME" \
--allowlist-var "ARCHIVE_MATCH_CTIME" \
--allowlist-var "ARCHIVE_MATCH_NEWER" \
--allowlist-var "ARCHIVE_MATCH_OLDER" \
--allowlist-var "ARCHIVE_MATCH_EQUAL" \
--allowlist-var "AE_SYMLINK_TYPE_UNDEFINED" \
--allowlist-var "AE_SYMLINK_TYPE_FILE" \
--allowlist-var "AE_SYMLINK_TYPE_DIRECTORY" \
--allowlist-var "ARCHIVE_ENTRY_DIGEST_MD5" \
--allowlist-var "ARCHIVE_ENTRY_DIGEST_RMD160" \
--allowlist-var "ARCHIVE_ENTRY_DIGEST_SHA1" \
--allowlist-var "ARCHIVE_ENTRY_DIGEST_SHA256" \
--allowlist-var "ARCHIVE_ENTRY_DIGEST_SHA384" \
--allowlist-var "ARCHIVE_ENTRY_DIGEST_SHA512" \
--allowlist-var "ARCHIVE_ENTRY_ACL_EXECUTE" \
--allowlist-var "ARCHIVE_ENTRY_ACL_WRITE" \
--allowlist-var "ARCHIVE_ENTRY_ACL_READ" \
--allowlist-var "ARCHIVE_ENTRY_ACL_READ_DATA" \
--allowlist-var "ARCHIVE_ENTRY_ACL_LIST_DIRECTORY" \
--allowlist-var "ARCHIVE_ENTRY_ACL_WRITE_DATA" \
--allowlist-var "ARCHIVE_ENTRY_ACL_ADD_FILE" \
--allowlist-var "ARCHIVE_ENTRY_ACL_APPEND_DATA" \
--allowlist-var "ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY" \
--allowlist-var "ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS" \
--allowlist-var "ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS" \
--allowlist-var "ARCHIVE_ENTRY_ACL_DELETE_CHILD" \
--allowlist-var "ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES" \
--allowlist-var "ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES" \
--allowlist-var "ARCHIVE_ENTRY_ACL_DELETE" \
--allowlist-var "ARCHIVE_ENTRY_ACL_READ_ACL" \
--allowlist-var "ARCHIVE_ENTRY_ACL_WRITE_ACL" \
--allowlist-var "ARCHIVE_ENTRY_ACL_WRITE_OWNER" \
--allowlist-var "ARCHIVE_ENTRY_ACL_SYNCHRONIZE" \
--allowlist-var "ARCHIVE_ENTRY_ACL_ENTRY_INHERITED" \
--allowlist-var "ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT" \
--allowlist-var "ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT" \
--allowlist-var "ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT" \
--allowlist-var "ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY" \
--allowlist-var "ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS" \
--allowlist-var "ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS" \
--allowlist-var "ARCHIVE_ENTRY_ACL_TYPE_ACCESS" \
--allowlist-var "ARCHIVE_ENTRY_ACL_TYPE_DEFAULT" \
--allowlist-var "ARCHIVE_ENTRY_ACL_TYPE_ALLOW" \
--allowlist-var "ARCHIVE_ENTRY_ACL_TYPE_DENY" \
--allowlist-var "ARCHIVE_ENTRY_ACL_TYPE_AUDIT" \
--allowlist-var "ARCHIVE_ENTRY_ACL_TYPE_ALARM" \
--allowlist-var "ARCHIVE_ENTRY_ACL_TYPE_POSIX1E" \
--allowlist-var "ARCHIVE_ENTRY_ACL_TYPE_NFS4" \
--allowlist-var "ARCHIVE_ENTRY_ACL_USER" \
--allowlist-var "ARCHIVE_ENTRY_ACL_USER_OBJ" \
--allowlist-var "ARCHIVE_ENTRY_ACL_GROUP" \
--allowlist-var "ARCHIVE_ENTRY_ACL_GROUP_OBJ" \
--allowlist-var "ARCHIVE_ENTRY_ACL_MASK" \
--allowlist-var "ARCHIVE_ENTRY_ACL_OTHER" \
--allowlist-var "ARCHIVE_ENTRY_ACL_EVERYONE" \
--allowlist-var "ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID" \
--allowlist-var "ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT" \
--allowlist-var "ARCHIVE_ENTRY_ACL_STYLE_SOLARIS" \
--allowlist-var "ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA" \
--allowlist-var "ARCHIVE_ENTRY_ACL_STYLE_COMPACT" \
--blocklist-type "stat" \
--blocklist-type "timespec" \
--allowlist-function "archive_version_number" \
--allowlist-function "archive_version_string" \
--allowlist-function "archive_version_details" \
--allowlist-function "archive_zlib_version" \
--allowlist-function "archive_liblzma_version" \
--allowlist-function "archive_bzlib_version" \
--allowlist-function "archive_liblz4_version" \
--allowlist-function "archive_libzstd_version" \
--allowlist-function "archive_read_new" \
--allowlist-function "archive_read_support_filter_all" \
--allowlist-function "archive_read_support_filter_by_code" \
--allowlist-function "archive_read_support_filter_bzip2" \
--allowlist-function "archive_read_support_filter_compress" \
--allowlist-function "archive_read_support_filter_gzip" \
--allowlist-function "archive_read_support_filter_grzip" \
--allowlist-function "archive_read_support_filter_lrzip" \
--allowlist-function "archive_read_support_filter_lz4" \
--allowlist-function "archive_read_support_filter_lzip" \
--allowlist-function "archive_read_support_filter_lzma" \
--allowlist-function "archive_read_support_filter_lzop" \
--allowlist-function "archive_read_support_filter_none" \
--allowlist-function "archive_read_support_filter_program" \
--allowlist-function "archive_read_support_filter_program_signature" \
--allowlist-function "archive_read_support_filter_rpm" \
--allowlist-function "archive_read_support_filter_uu" \
--allowlist-function "archive_read_support_filter_xz" \
--allowlist-function "archive_read_support_filter_zstd" \
--allowlist-function "archive_read_support_format_7zip" \
--allowlist-function "archive_read_support_format_all" \
--allowlist-function "archive_read_support_format_ar" \
--allowlist-function "archive_read_support_format_by_code" \
--allowlist-function "archive_read_support_format_cab" \
--allowlist-function "archive_read_support_format_cpio" \
--allowlist-function "archive_read_support_format_empty" \
--allowlist-function "archive_read_support_format_gnutar" \
--allowlist-function "archive_read_support_format_iso9660" \
--allowlist-function "archive_read_support_format_lha" \
--allowlist-function "archive_read_support_format_mtree" \
--allowlist-function "archive_read_support_format_rar" \
--allowlist-function "archive_read_support_format_rar5" \
--allowlist-function "archive_read_support_format_raw" \
--allowlist-function "archive_read_support_format_tar" \
--allowlist-function "archive_read_support_format_warc" \
--allowlist-function "archive_read_support_format_xar" \
--allowlist-function "archive_read_support_format_zip" \
--allowlist-function "archive_read_support_format_zip_streamable" \
--allowlist-function "archive_read_support_format_zip_seekable" \
--allowlist-function "archive_read_set_format" \
--allowlist-function "archive_read_append_filter" \
--allowlist-function "archive_read_append_filter_program" \
--allowlist-function "archive_read_append_filter_program_signature" \
--allowlist-function "archive_read_set_open_callback" \
--allowlist-function "archive_read_set_read_callback" \
--allowlist-function "archive_read_set_seek_callback" \
--allowlist-function "archive_read_set_skip_callback" \
--allowlist-function "archive_read_set_close_callback" \
--allowlist-function "archive_read_set_switch_callback" \
--allowlist-function "archive_read_set_callback_data" \
--allowlist-function "archive_read_set_callback_data2" \
--allowlist-function "archive_read_add_callback_data" \
--allowlist-function "archive_read_append_callback_data" \
--allowlist-function "archive_read_prepend_callback_data" \
--allowlist-function "archive_read_open1" \
--allowlist-function "archive_read_open" \
--allowlist-function "archive_read_open2" \
--allowlist-function "archive_read_open_filename" \
--allowlist-function "archive_read_open_filenames" \
--allowlist-function "archive_read_open_filename_w" \
--allowlist-function "archive_read_open_file" \
--allowlist-function "archive_read_open_memory" \
--allowlist-function "archive_read_open_memory2" \
--allowlist-function "archive_read_open_fd" \
--allowlist-function "archive_read_open_FILE" \
--allowlist-function "archive_read_next_header" \
--allowlist-function "archive_read_next_header2" \
--allowlist-function "archive_read_header_position" \
--allowlist-function "archive_read_has_encrypted_entries" \
--allowlist-function "archive_read_format_capabilities" \
--allowlist-function "archive_read_data" \
--allowlist-function "archive_seek_data" \
--allowlist-function "archive_read_data_block" \
--allowlist-function "archive_read_data_skip" \
--allowlist-function "archive_read_data_into_fd" \
--allowlist-function "archive_read_set_format_option" \
--allowlist-function "archive_read_set_filter_option" \
--allowlist-function "archive_read_set_option" \
--allowlist-function "archive_read_set_options" \
--allowlist-function "archive_read_add_passphrase" \
--allowlist-function "archive_read_set_passphrase_callback" \
--allowlist-function "archive_read_extract" \
--allowlist-function "archive_read_extract2" \
--allowlist-function "archive_read_extract_set_progress_callback" \
--allowlist-function "archive_read_extract_set_skip_file" \
--allowlist-function "archive_read_close" \
--allowlist-function "archive_read_free" \
--allowlist-function "archive_write_new" \
--allowlist-function "archive_write_set_bytes_per_block" \
--allowlist-function "archive_write_get_bytes_per_block" \
--allowlist-function "archive_write_set_bytes_in_last_block" \
--allowlist-function "archive_write_get_bytes_in_last_block" \
--allowlist-function "archive_write_set_skip_file" \
--allowlist-function "archive_write_add_filter" \
--allowlist-function "archive_write_add_filter_by_name" \
--allowlist-function "archive_write_add_filter_b64encode" \
--allowlist-function "archive_write_add_filter_bzip2" \
--allowlist-function "archive_write_add_filter_compress" \
--allowlist-function "archive_write_add_filter_grzip" \
--allowlist-function "archive_write_add_filter_gzip" \
--allowlist-function "archive_write_add_filter_lrzip" \
--allowlist-function "archive_write_add_filter_lz4" \
--allowlist-function "archive_write_add_filter_lzip" \
--allowlist-function "archive_write_add_filter_lzma" \
--allowlist-function "archive_write_add_filter_lzop" \
--allowlist-function "archive_write_add_filter_none" \
--allowlist-function "archive_write_add_filter_program" \
--allowlist-function "archive_write_add_filter_uuencode" \
--allowlist-function "archive_write_add_filter_xz" \
--allowlist-function "archive_write_add_filter_zstd" \
--allowlist-function "archive_write_set_format" \
--allowlist-function "archive_write_set_format_by_name" \
--allowlist-function "archive_write_set_format_7zip" \
--allowlist-function "archive_write_set_format_ar_bsd" \
--allowlist-function "archive_write_set_format_ar_svr4" \
--allowlist-function "archive_write_set_format_cpio" \
--allowlist-function "archive_write_set_format_cpio_bin" \
--allowlist-function "archive_write_set_format_cpio_newc" \
--allowlist-function "archive_write_set_format_cpio_odc" \
--allowlist-function "archive_write_set_format_cpio_pwb" \
--allowlist-function "archive_write_set_format_gnutar" \
--allowlist-function "archive_write_set_format_iso9660" \
--allowlist-function "archive_write_set_format_mtree" \
--allowlist-function "archive_write_set_format_mtree_classic" \
--allowlist-function "archive_write_set_format_pax" \
--allowlist-function "archive_write_set_format_pax_restricted" \
--allowlist-function "archive_write_set_format_raw" \
--allowlist-function "archive_write_set_format_shar" \
--allowlist-function "archive_write_set_format_shar_dump" \
--allowlist-function "archive_write_set_format_ustar" \
--allowlist-function "archive_write_set_format_v7tar" \
--allowlist-function "archive_write_set_format_warc" \
--allowlist-function "archive_write_set_format_xar" \
--allowlist-function "archive_write_set_format_zip" \
--allowlist-function "archive_write_set_format_filter_by_ext" \
--allowlist-function "archive_write_set_format_filter_by_ext_def" \
--allowlist-function "archive_write_zip_set_compression_deflate" \
--allowlist-function "archive_write_zip_set_compression_store" \
--allowlist-function "archive_write_open" \
--allowlist-function "archive_write_open2" \
--allowlist-function "archive_write_open_fd" \
--allowlist-function "archive_write_open_filename" \
--allowlist-function "archive_write_open_filename_w" \
--allowlist-function "archive_write_open_file" \
--allowlist-function "archive_write_open_FILE" \
--allowlist-function "archive_write_open_memory" \
--allowlist-function "archive_write_header" \
--allowlist-function "archive_write_data" \
--allowlist-function "archive_write_data_block" \
--allowlist-function "archive_write_finish_entry" \
--allowlist-function "archive_write_close" \
--allowlist-function "archive_write_fail" \
--allowlist-function "archive_write_free" \
--allowlist-function "archive_write_set_format_option" \
--allowlist-function "archive_write_set_filter_option" \
--allowlist-function "archive_write_set_option" \
--allowlist-function "archive_write_set_options" \
--allowlist-function "archive_write_set_passphrase" \
--allowlist-function "archive_write_set_passphrase_callback" \
--allowlist-function "archive_write_disk_new" \
--allowlist-function "archive_write_disk_set_skip_file" \
--allowlist-function "archive_write_disk_set_options" \
--allowlist-function "archive_write_disk_set_standard_lookup" \
--allowlist-function "archive_write_disk_set_group_lookup" \
--allowlist-function "archive_write_disk_set_user_lookup" \
--allowlist-function "archive_write_disk_gid" \
--allowlist-function "archive_write_disk_uid" \
--allowlist-function "archive_read_disk_new" \
--allowlist-function "archive_read_disk_set_symlink_logical" \
--allowlist-function "archive_read_disk_set_symlink_physical" \
--allowlist-function "archive_read_disk_set_symlink_hybrid" \
--allowlist-function "archive_read_disk_entry_from_file" \
--allowlist-function "archive_read_disk_gname" \
--allowlist-function "archive_read_disk_uname" \
--allowlist-function "archive_read_disk_set_standard_lookup" \
--allowlist-function "archive_read_disk_set_gname_lookup" \
--allowlist-function "archive_read_disk_set_uname_lookup" \
--allowlist-function "archive_read_disk_open" \
--allowlist-function "archive_read_disk_open_w" \
--allowlist-function "archive_read_disk_descend" \
--allowlist-function "archive_read_disk_can_descend" \
--allowlist-function "archive_read_disk_current_filesystem" \
--allowlist-function "archive_read_disk_current_filesystem_is_synthetic" \
--allowlist-function "archive_read_disk_current_filesystem_is_remote" \
--allowlist-function "archive_read_disk_set_atime_restored" \
--allowlist-function "archive_read_disk_set_behavior" \
--allowlist-function "archive_read_disk_set_matching" \
--allowlist-function "archive_read_disk_set_metadata_filter_callback" \
--allowlist-function "archive_free" \
--allowlist-function "archive_filter_count" \
--allowlist-function "archive_filter_bytes" \
--allowlist-function "archive_filter_code" \
--allowlist-function "archive_filter_name" \
--allowlist-function "archive_errno" \
--allowlist-function "archive_error_string" \
--allowlist-function "archive_format_name" \
--allowlist-function "archive_format" \
--allowlist-function "archive_clear_error" \
--allowlist-function "archive_set_error" \
--allowlist-function "archive_copy_error" \
--allowlist-function "archive_file_count" \
--allowlist-function "archive_match_new" \
--allowlist-function "archive_match_free" \
--allowlist-function "archive_match_excluded" \
--allowlist-function "archive_match_path_excluded" \
--allowlist-function "archive_match_set_inclusion_recursion" \
--allowlist-function "archive_match_exclude_pattern" \
--allowlist-function "archive_match_exclude_pattern_w" \
--allowlist-function "archive_match_exclude_pattern_from_file" \
--allowlist-function "archive_match_exclude_pattern_from_file_w" \
--allowlist-function "archive_match_include_pattern" \
--allowlist-function "archive_match_include_pattern_w" \
--allowlist-function "archive_match_include_pattern_from_file" \
--allowlist-function "archive_match_include_pattern_from_file_w" \
--allowlist-function "archive_match_path_unmatched_inclusions" \
--allowlist-function "archive_match_path_unmatched_inclusions_next" \
--allowlist-function "archive_match_path_unmatched_inclusions_next_w" \
--allowlist-function "archive_match_time_excluded" \
--allowlist-function "archive_match_include_time" \
--allowlist-function "archive_match_include_date" \
--allowlist-function "archive_match_include_date_w" \
--allowlist-function "archive_match_include_file_time" \
--allowlist-function "archive_match_include_file_time_w" \
--allowlist-function "archive_match_exclude_entry" \
--allowlist-function "archive_match_owner_excluded" \
--allowlist-function "archive_match_include_uid" \
--allowlist-function "archive_match_include_gid" \
--allowlist-function "archive_match_include_uname" \
--allowlist-function "archive_match_include_uname_w" \
--allowlist-function "archive_match_include_gname" \
--allowlist-function "archive_match_include_gname_w" \
--allowlist-function "archive_utility_string_sort" \
--allowlist-function "archive_entry_clear" \
--allowlist-function "archive_entry_clone" \
--allowlist-function "archive_entry_free" \
--allowlist-function "archive_entry_new" \
--allowlist-function "archive_entry_new2" \
--allowlist-function "archive_entry_atime" \
--allowlist-function "archive_entry_atime_nsec" \
--allowlist-function "archive_entry_atime_is_set" \
--allowlist-function "archive_entry_birthtime" \
--allowlist-function "archive_entry_birthtime_nsec" \
--allowlist-function "archive_entry_birthtime_is_set" \
--allowlist-function "archive_entry_ctime" \
--allowlist-function "archive_entry_ctime_nsec" \
--allowlist-function "archive_entry_ctime_is_set" \
--allowlist-function "archive_entry_dev" \
--allowlist-function "archive_entry_dev_is_set" \
--allowlist-function "archive_entry_devmajor" \
--allowlist-function "archive_entry_devminor" \
--allowlist-function "archive_entry_filetype" \
--allowlist-function "archive_entry_filetype_is_set" \
--allowlist-function "archive_entry_fflags" \
--allowlist-function "archive_entry_fflags_text" \
--allowlist-function "archive_entry_gid" \
--allowlist-function "archive_entry_gid_is_set" \
--allowlist-function "archive_entry_gname" \
--allowlist-function "archive_entry_gname_utf8" \
--allowlist-function "archive_entry_gname_w" \
--allowlist-function "archive_entry_set_link_to_hardlink" \
--allowlist-function "archive_entry_hardlink" \
--allowlist-function "archive_entry_hardlink_utf8" \
--allowlist-function "archive_entry_hardlink_w" \
--allowlist-function "archive_entry_hardlink_is_set" \
--allowlist-function "archive_entry_ino" \
--allowlist-function "archive_entry_ino64" \
--allowlist-function "archive_entry_ino_is_set" \
--allowlist-function "archive_entry_mode" \
--allowlist-function "archive_entry_mtime" \
--allowlist-function "archive_entry_mtime_nsec" \
--allowlist-function "archive_entry_mtime_is_set" \
--allowlist-function "archive_entry_nlink" \
--allowlist-function "archive_entry_pathname" \
--allowlist-function "archive_entry_pathname_utf8" \
--allowlist-function "archive_entry_pathname_w" \
--allowlist-function "archive_entry_perm" \
--allowlist-function "archive_entry_perm_is_set" \
--allowlist-function "archive_entry_rdev_is_set" \
--allowlist-function "archive_entry_rdev" \
--allowlist-function "archive_entry_rdevmajor" \
--allowlist-function "archive_entry_rdevminor" \
--allowlist-function "archive_entry_sourcepath" \
--allowlist-function "archive_entry_sourcepath_w" \
--allowlist-function "archive_entry_size" \
--allowlist-function "archive_entry_size_is_set" \
--allowlist-function "archive_entry_strmode" \
--allowlist-function "archive_entry_set_link_to_symlink" \
--allowlist-function "archive_entry_symlink" \
--allowlist-function "archive_entry_symlink_utf8" \
--allowlist-function "archive_entry_symlink_type" \
--allowlist-function "archive_entry_symlink_w" \
--allowlist-function "archive_entry_uid" \
--allowlist-function "archive_entry_uid_is_set" \
--allowlist-function "archive_entry_uname" \
--allowlist-function "archive_entry_uname_utf8" \
--allowlist-function "archive_entry_uname_w" \
--allowlist-function "archive_entry_is_data_encrypted" \
--allowlist-function "archive_entry_is_metadata_encrypted" \
--allowlist-function "archive_entry_is_encrypted" \
--allowlist-function "archive_entry_set_atime" \
--allowlist-function "archive_entry_unset_atime" \
--allowlist-function "archive_entry_set_birthtime" \
--allowlist-function "archive_entry_unset_birthtime" \
--allowlist-function "archive_entry_set_ctime" \
--allowlist-function "archive_entry_unset_ctime" \
--allowlist-function "archive_entry_set_dev" \
--allowlist-function "archive_entry_set_devmajor" \
--allowlist-function "archive_entry_set_devminor" \
--allowlist-function "archive_entry_set_filetype" \
--allowlist-function "archive_entry_set_fflags" \
--allowlist-function "archive_entry_copy_fflags_text" \
--allowlist-function "archive_entry_copy_fflags_text_len" \
--allowlist-function "archive_entry_copy_fflags_text_w" \
--allowlist-function "archive_entry_set_gid" \
--allowlist-function "archive_entry_set_gname" \
--allowlist-function "archive_entry_set_gname_utf8" \
--allowlist-function "archive_entry_copy_gname" \
--allowlist-function "archive_entry_copy_gname_w" \
--allowlist-function "archive_entry_update_gname_utf8" \
--allowlist-function "archive_entry_set_hardlink" \
--allowlist-function "archive_entry_set_hardlink_utf8" \
--allowlist-function "archive_entry_copy_hardlink" \
--allowlist-function "archive_entry_copy_hardlink_w" \
--allowlist-function "archive_entry_update_hardlink_utf8" \
--allowlist-function "archive_entry_set_ino" \
--allowlist-function "archive_entry_set_ino64" \
--allowlist-function "archive_entry_set_link" \
--allowlist-function "archive_entry_set_link_utf8" \
--allowlist-function "archive_entry_copy_link" \
--allowlist-function "archive_entry_copy_link_w" \
--allowlist-function "archive_entry_update_link_utf8" \
--allowlist-function "archive_entry_set_mode" \
--allowlist-function "archive_entry_set_mtime" \
--allowlist-function "archive_entry_unset_mtime" \
--allowlist-function "archive_entry_set_nlink" \
--allowlist-function "archive_entry_set_pathname" \
--allowlist-function "archive_entry_set_pathname_utf8" \
--allowlist-function "archive_entry_copy_pathname" \
--allowlist-function "archive_entry_copy_pathname_w" \
--allowlist-function "archive_entry_update_pathname_utf8" \
--allowlist-function "archive_entry_set_perm" \
--allowlist-function "archive_entry_set_rdev" \
--allowlist-function "archive_entry_set_rdevmajor" \
--allowlist-function "archive_entry_set_rdevminor" \
--allowlist-function "archive_entry_set_size" \
--allowlist-function "archive_entry_unset_size" \
--allowlist-function "archive_entry_copy_sourcepath" \
--allowlist-function "archive_entry_copy_sourcepath_w" \
--allowlist-function "archive_entry_set_symlink" \
--allowlist-function "archive_entry_set_symlink_type" \
--allowlist-function "archive_entry_set_symlink_utf8" \
--allowlist-function "archive_entry_copy_symlink" \
--allowlist-function "archive_entry_copy_symlink_w" \
--allowlist-function "archive_entry_update_symlink_utf8" \
--allowlist-function "archive_entry_set_uid" \
--allowlist-function "archive_entry_set_uname" \
--allowlist-function "archive_entry_set_uname_utf8" \
--allowlist-function "archive_entry_copy_uname" \
--allowlist-function "archive_entry_copy_uname_w" \
--allowlist-function "archive_entry_update_uname_utf8" \
--allowlist-function "archive_entry_set_is_data_encrypted" \
--allowlist-function "archive_entry_set_is_metadata_encrypted" \
--allowlist-function "archive_entry_stat" \
--allowlist-function "archive_entry_copy_stat" \
--allowlist-function "archive_entry_mac_metadata" \
--allowlist-function "archive_entry_copy_mac_metadata" \
--allowlist-function "archive_entry_digest" \
--allowlist-function "archive_entry_acl_clear" \
--allowlist-function "archive_entry_acl_add_entry" \
--allowlist-function "archive_entry_acl_add_entry_w" \
--allowlist-function "archive_entry_acl_reset" \
--allowlist-function "archive_entry_acl_next" \
--allowlist-function "archive_entry_acl_to_text_w" \
--allowlist-function "archive_entry_acl_to_text" \
--allowlist-function "archive_entry_acl_from_text_w" \
--allowlist-function "archive_entry_acl_from_text" \
--allowlist-function "archive_entry_acl_types" \
--allowlist-function "archive_entry_acl_count" \
--allowlist-function "archive_entry_acl" \
--allowlist-function "archive_entry_xattr_clear" \
--allowlist-function "archive_entry_xattr_add_entry" \
--allowlist-function "archive_entry_xattr_count" \
--allowlist-function "archive_entry_xattr_reset" \
--allowlist-function "archive_entry_xattr_next" \
--allowlist-function "archive_entry_sparse_clear" \
--allowlist-function "archive_entry_sparse_add_entry" \
--allowlist-function "archive_entry_sparse_count" \
--allowlist-function "archive_entry_sparse_reset" \
--allowlist-function "archive_entry_sparse_next" \
--allowlist-function "archive_entry_linkresolver_new" \
--allowlist-function "archive_entry_linkresolver_set_strategy" \
--allowlist-function "archive_entry_linkresolver_free" \
--allowlist-function "archive_entry_linkify" \
--allowlist-function "archive_entry_partial_links" \
--blocklist-type "stat" \
--blacklist-type "timespec" \
\
--output $basedir/src/carchive/generated.rs \
\
$basedir/wrapper.h
cargo fmt --all