123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642 |
- #ifndef ARCHIVE_ENTRY_H_INCLUDED
- #define ARCHIVE_ENTRY_H_INCLUDED
- #define ARCHIVE_VERSION_NUMBER 3002002
- #include <sys/types.h>
- #include <stddef.h> /* for wchar_t */
- #include <time.h>
- #if defined(_WIN32) && !defined(__CYGWIN__)
- #include <windows.h>
- #endif
- #if !defined(__LA_INT64_T_DEFINED)
- # if ARCHIVE_VERSION_NUMBER < 4000000
- #define __LA_INT64_T la_int64_t
- # endif
- #define __LA_INT64_T_DEFINED
- # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
- typedef __int64 la_int64_t;
- # else
- #include <unistd.h>
- # if defined(_SCO_DS) || defined(__osf__)
- typedef long long la_int64_t;
- # else
- typedef int64_t la_int64_t;
- # endif
- # endif
- #endif
- #if ARCHIVE_VERSION_NUMBER >= 3999000
- # define __LA_MODE_T int
- #elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
- # define __LA_MODE_T unsigned short
- #else
- # define __LA_MODE_T mode_t
- #endif
- #ifdef __ANDROID__
- #include "android_lf.h"
- #endif
- #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC)
- # ifdef __LIBARCHIVE_BUILD
- # ifdef __GNUC__
- # define __LA_DECL __attribute__((dllexport)) extern
- # else
- # define __LA_DECL __declspec(dllexport)
- # endif
- # else
- # ifdef __GNUC__
- # define __LA_DECL
- # else
- # define __LA_DECL __declspec(dllimport)
- # endif
- # endif
- #else
- # define __LA_DECL
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- struct archive;
- struct archive_entry;
- #define AE_IFMT ((__LA_MODE_T)0170000)
- #define AE_IFREG ((__LA_MODE_T)0100000)
- #define AE_IFLNK ((__LA_MODE_T)0120000)
- #define AE_IFSOCK ((__LA_MODE_T)0140000)
- #define AE_IFCHR ((__LA_MODE_T)0020000)
- #define AE_IFBLK ((__LA_MODE_T)0060000)
- #define AE_IFDIR ((__LA_MODE_T)0040000)
- #define AE_IFIFO ((__LA_MODE_T)0010000)
- __LA_DECL struct archive_entry *archive_entry_clear(struct archive_entry *);
- __LA_DECL struct archive_entry *archive_entry_clone(struct archive_entry *);
- __LA_DECL void archive_entry_free(struct archive_entry *);
- __LA_DECL struct archive_entry *archive_entry_new(void);
- __LA_DECL struct archive_entry *archive_entry_new2(struct archive *);
- __LA_DECL time_t archive_entry_atime(struct archive_entry *);
- __LA_DECL long archive_entry_atime_nsec(struct archive_entry *);
- __LA_DECL int archive_entry_atime_is_set(struct archive_entry *);
- __LA_DECL time_t archive_entry_birthtime(struct archive_entry *);
- __LA_DECL long archive_entry_birthtime_nsec(struct archive_entry *);
- __LA_DECL int archive_entry_birthtime_is_set(struct archive_entry *);
- __LA_DECL time_t archive_entry_ctime(struct archive_entry *);
- __LA_DECL long archive_entry_ctime_nsec(struct archive_entry *);
- __LA_DECL int archive_entry_ctime_is_set(struct archive_entry *);
- __LA_DECL dev_t archive_entry_dev(struct archive_entry *);
- __LA_DECL int archive_entry_dev_is_set(struct archive_entry *);
- __LA_DECL dev_t archive_entry_devmajor(struct archive_entry *);
- __LA_DECL dev_t archive_entry_devminor(struct archive_entry *);
- __LA_DECL __LA_MODE_T archive_entry_filetype(struct archive_entry *);
- __LA_DECL void archive_entry_fflags(struct archive_entry *,
- unsigned long * ,
- unsigned long * );
- __LA_DECL const char *archive_entry_fflags_text(struct archive_entry *);
- __LA_DECL la_int64_t archive_entry_gid(struct archive_entry *);
- __LA_DECL const char *archive_entry_gname(struct archive_entry *);
- __LA_DECL const char *archive_entry_gname_utf8(struct archive_entry *);
- __LA_DECL const wchar_t *archive_entry_gname_w(struct archive_entry *);
- __LA_DECL const char *archive_entry_hardlink(struct archive_entry *);
- __LA_DECL const char *archive_entry_hardlink_utf8(struct archive_entry *);
- __LA_DECL const wchar_t *archive_entry_hardlink_w(struct archive_entry *);
- __LA_DECL la_int64_t archive_entry_ino(struct archive_entry *);
- __LA_DECL la_int64_t archive_entry_ino64(struct archive_entry *);
- __LA_DECL int archive_entry_ino_is_set(struct archive_entry *);
- __LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *);
- __LA_DECL time_t archive_entry_mtime(struct archive_entry *);
- __LA_DECL long archive_entry_mtime_nsec(struct archive_entry *);
- __LA_DECL int archive_entry_mtime_is_set(struct archive_entry *);
- __LA_DECL unsigned int archive_entry_nlink(struct archive_entry *);
- __LA_DECL const char *archive_entry_pathname(struct archive_entry *);
- __LA_DECL const char *archive_entry_pathname_utf8(struct archive_entry *);
- __LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *);
- __LA_DECL __LA_MODE_T archive_entry_perm(struct archive_entry *);
- __LA_DECL dev_t archive_entry_rdev(struct archive_entry *);
- __LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *);
- __LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *);
- __LA_DECL const char *archive_entry_sourcepath(struct archive_entry *);
- __LA_DECL const wchar_t *archive_entry_sourcepath_w(struct archive_entry *);
- __LA_DECL la_int64_t archive_entry_size(struct archive_entry *);
- __LA_DECL int archive_entry_size_is_set(struct archive_entry *);
- __LA_DECL const char *archive_entry_strmode(struct archive_entry *);
- __LA_DECL const char *archive_entry_symlink(struct archive_entry *);
- __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *);
- __LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *);
- __LA_DECL la_int64_t archive_entry_uid(struct archive_entry *);
- __LA_DECL const char *archive_entry_uname(struct archive_entry *);
- __LA_DECL const char *archive_entry_uname_utf8(struct archive_entry *);
- __LA_DECL const wchar_t *archive_entry_uname_w(struct archive_entry *);
- __LA_DECL int archive_entry_is_data_encrypted(struct archive_entry *);
- __LA_DECL int archive_entry_is_metadata_encrypted(struct archive_entry *);
- __LA_DECL int archive_entry_is_encrypted(struct archive_entry *);
- __LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long);
- __LA_DECL void archive_entry_unset_atime(struct archive_entry *);
- #if defined(_WIN32) && !defined(__CYGWIN__)
- __LA_DECL void archive_entry_copy_bhfi(struct archive_entry *, BY_HANDLE_FILE_INFORMATION *);
- #endif
- __LA_DECL void archive_entry_set_birthtime(struct archive_entry *, time_t, long);
- __LA_DECL void archive_entry_unset_birthtime(struct archive_entry *);
- __LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long);
- __LA_DECL void archive_entry_unset_ctime(struct archive_entry *);
- __LA_DECL void archive_entry_set_dev(struct archive_entry *, dev_t);
- __LA_DECL void archive_entry_set_devmajor(struct archive_entry *, dev_t);
- __LA_DECL void archive_entry_set_devminor(struct archive_entry *, dev_t);
- __LA_DECL void archive_entry_set_filetype(struct archive_entry *, unsigned int);
- __LA_DECL void archive_entry_set_fflags(struct archive_entry *,
- unsigned long , unsigned long );
- __LA_DECL const char *archive_entry_copy_fflags_text(struct archive_entry *,
- const char *);
- __LA_DECL const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *,
- const wchar_t *);
- __LA_DECL void archive_entry_set_gid(struct archive_entry *, la_int64_t);
- __LA_DECL void archive_entry_set_gname(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_gname_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_gname(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *);
- __LA_DECL int archive_entry_update_gname_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_hardlink(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_hardlink_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_hardlink(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *);
- __LA_DECL int archive_entry_update_hardlink_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_ino(struct archive_entry *, la_int64_t);
- __LA_DECL void archive_entry_set_ino64(struct archive_entry *, la_int64_t);
- __LA_DECL void archive_entry_set_link(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_link_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_link(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *);
- __LA_DECL int archive_entry_update_link_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_mode(struct archive_entry *, __LA_MODE_T);
- __LA_DECL void archive_entry_set_mtime(struct archive_entry *, time_t, long);
- __LA_DECL void archive_entry_unset_mtime(struct archive_entry *);
- __LA_DECL void archive_entry_set_nlink(struct archive_entry *, unsigned int);
- __LA_DECL void archive_entry_set_pathname(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_pathname_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_pathname(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *);
- __LA_DECL int archive_entry_update_pathname_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_perm(struct archive_entry *, __LA_MODE_T);
- __LA_DECL void archive_entry_set_rdev(struct archive_entry *, dev_t);
- __LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, dev_t);
- __LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, dev_t);
- __LA_DECL void archive_entry_set_size(struct archive_entry *, la_int64_t);
- __LA_DECL void archive_entry_unset_size(struct archive_entry *);
- __LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_sourcepath_w(struct archive_entry *, const wchar_t *);
- __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_symlink_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *);
- __LA_DECL int archive_entry_update_symlink_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_uid(struct archive_entry *, la_int64_t);
- __LA_DECL void archive_entry_set_uname(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_uname_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_uname(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *);
- __LA_DECL int archive_entry_update_uname_utf8(struct archive_entry *, const char *);
- __LA_DECL void archive_entry_set_is_data_encrypted(struct archive_entry *, char is_encrypted);
- __LA_DECL void archive_entry_set_is_metadata_encrypted(struct archive_entry *, char is_encrypted);
- __LA_DECL const struct stat *archive_entry_stat(struct archive_entry *);
- __LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *);
- __LA_DECL const void * archive_entry_mac_metadata(struct archive_entry *, size_t *);
- __LA_DECL void archive_entry_copy_mac_metadata(struct archive_entry *, const void *, size_t);
- #define ARCHIVE_ENTRY_ACL_EXECUTE 0x00000001
- #define ARCHIVE_ENTRY_ACL_WRITE 0x00000002
- #define ARCHIVE_ENTRY_ACL_READ 0x00000004
- #define ARCHIVE_ENTRY_ACL_READ_DATA 0x00000008
- #define ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 0x00000008
- #define ARCHIVE_ENTRY_ACL_WRITE_DATA 0x00000010
- #define ARCHIVE_ENTRY_ACL_ADD_FILE 0x00000010
- #define ARCHIVE_ENTRY_ACL_APPEND_DATA 0x00000020
- #define ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY 0x00000020
- #define ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS 0x00000040
- #define ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS 0x00000080
- #define ARCHIVE_ENTRY_ACL_DELETE_CHILD 0x00000100
- #define ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES 0x00000200
- #define ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES 0x00000400
- #define ARCHIVE_ENTRY_ACL_DELETE 0x00000800
- #define ARCHIVE_ENTRY_ACL_READ_ACL 0x00001000
- #define ARCHIVE_ENTRY_ACL_WRITE_ACL 0x00002000
- #define ARCHIVE_ENTRY_ACL_WRITE_OWNER 0x00004000
- #define ARCHIVE_ENTRY_ACL_SYNCHRONIZE 0x00008000
- #define ARCHIVE_ENTRY_ACL_PERMS_POSIX1E \
- (ARCHIVE_ENTRY_ACL_EXECUTE \
- | ARCHIVE_ENTRY_ACL_WRITE \
- | ARCHIVE_ENTRY_ACL_READ)
- #define ARCHIVE_ENTRY_ACL_PERMS_NFS4 \
- (ARCHIVE_ENTRY_ACL_EXECUTE \
- | ARCHIVE_ENTRY_ACL_READ_DATA \
- | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY \
- | ARCHIVE_ENTRY_ACL_WRITE_DATA \
- | ARCHIVE_ENTRY_ACL_ADD_FILE \
- | ARCHIVE_ENTRY_ACL_APPEND_DATA \
- | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY \
- | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS \
- | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS \
- | ARCHIVE_ENTRY_ACL_DELETE_CHILD \
- | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES \
- | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES \
- | ARCHIVE_ENTRY_ACL_DELETE \
- | ARCHIVE_ENTRY_ACL_READ_ACL \
- | ARCHIVE_ENTRY_ACL_WRITE_ACL \
- | ARCHIVE_ENTRY_ACL_WRITE_OWNER \
- | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
- #define ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT 0x02000000
- #define ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT 0x04000000
- #define ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT 0x08000000
- #define ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY 0x10000000
- #define ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS 0x20000000
- #define ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS 0x40000000
- #define ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4 \
- (ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT \
- | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT \
- | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT \
- | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY \
- | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS \
- | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS)
- #define ARCHIVE_ENTRY_ACL_TYPE_ACCESS 256 /* POSIX.1e only */
- #define ARCHIVE_ENTRY_ACL_TYPE_DEFAULT 512 /* POSIX.1e only */
- #define ARCHIVE_ENTRY_ACL_TYPE_ALLOW 1024 /* NFS4 only */
- #define ARCHIVE_ENTRY_ACL_TYPE_DENY 2048 /* NFS4 only */
- #define ARCHIVE_ENTRY_ACL_TYPE_AUDIT 4096 /* NFS4 only */
- #define ARCHIVE_ENTRY_ACL_TYPE_ALARM 8192 /* NFS4 only */
- #define ARCHIVE_ENTRY_ACL_TYPE_POSIX1E (ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
- | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
- #define ARCHIVE_ENTRY_ACL_TYPE_NFS4 (ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
- | ARCHIVE_ENTRY_ACL_TYPE_DENY \
- | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
- | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
- #define ARCHIVE_ENTRY_ACL_USER 10001 /* Specified user. */
- #define ARCHIVE_ENTRY_ACL_USER_OBJ 10002 /* User who owns the file. */
- #define ARCHIVE_ENTRY_ACL_GROUP 10003 /* Specified group. */
- #define ARCHIVE_ENTRY_ACL_GROUP_OBJ 10004 /* Group who owns the file. */
- #define ARCHIVE_ENTRY_ACL_MASK 10005 /* Modify group access (POSIX.1e only) */
- #define ARCHIVE_ENTRY_ACL_OTHER 10006 /* Public (POSIX.1e only) */
- #define ARCHIVE_ENTRY_ACL_EVERYONE 10107 /* Everyone (NFS4 only) */
- __LA_DECL void archive_entry_acl_clear(struct archive_entry *);
- __LA_DECL int archive_entry_acl_add_entry(struct archive_entry *,
- int , int , int ,
- int , const char * );
- __LA_DECL int archive_entry_acl_add_entry_w(struct archive_entry *,
- int , int , int ,
- int , const wchar_t * );
- __LA_DECL int archive_entry_acl_reset(struct archive_entry *, int );
- __LA_DECL int archive_entry_acl_next(struct archive_entry *, int ,
- int * , int * , int * ,
- int * , const char ** );
- __LA_DECL int archive_entry_acl_next_w(struct archive_entry *, int ,
- int * , int * , int * ,
- int * , const wchar_t ** );
- #define ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 1024
- #define ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 2048
- __LA_DECL const wchar_t *archive_entry_acl_text_w(struct archive_entry *,
- int );
- __LA_DECL const char *archive_entry_acl_text(struct archive_entry *,
- int );
- __LA_DECL int archive_entry_acl_count(struct archive_entry *, int );
- struct archive_acl;
- __LA_DECL struct archive_acl *archive_entry_acl(struct archive_entry *);
- __LA_DECL void archive_entry_xattr_clear(struct archive_entry *);
- __LA_DECL void archive_entry_xattr_add_entry(struct archive_entry *,
- const char * , const void * ,
- size_t );
- __LA_DECL int archive_entry_xattr_count(struct archive_entry *);
- __LA_DECL int archive_entry_xattr_reset(struct archive_entry *);
- __LA_DECL int archive_entry_xattr_next(struct archive_entry *,
- const char ** , const void ** , size_t *);
- __LA_DECL void archive_entry_sparse_clear(struct archive_entry *);
- __LA_DECL void archive_entry_sparse_add_entry(struct archive_entry *,
- la_int64_t , la_int64_t );
- __LA_DECL int archive_entry_sparse_count(struct archive_entry *);
- __LA_DECL int archive_entry_sparse_reset(struct archive_entry *);
- __LA_DECL int archive_entry_sparse_next(struct archive_entry *,
- la_int64_t * , la_int64_t * );
- struct archive_entry_linkresolver;
- __LA_DECL struct archive_entry_linkresolver *archive_entry_linkresolver_new(void);
- __LA_DECL void archive_entry_linkresolver_set_strategy(
- struct archive_entry_linkresolver *, int );
- __LA_DECL void archive_entry_linkresolver_free(struct archive_entry_linkresolver *);
- __LA_DECL void archive_entry_linkify(struct archive_entry_linkresolver *,
- struct archive_entry **, struct archive_entry **);
- __LA_DECL struct archive_entry *archive_entry_partial_links(
- struct archive_entry_linkresolver *res, unsigned int *links);
- #ifdef __cplusplus
- }
- #endif
- #undef __LA_DECL
- #endif /* !ARCHIVE_ENTRY_H_INCLUDED */
|