diff options
author | Martin Matuska <martin@matuska.org> | 2017-02-22 21:39:48 +0100 |
---|---|---|
committer | Martin Matuska <martin@matuska.org> | 2017-02-23 00:28:20 +0100 |
commit | 6a9dcf9fc429e2dc9fb08e669bf7b0bed4d5edf9 (patch) | |
tree | 853551ff1af468256c75dff89049f80ea697172c /tar/bsdtar.h | |
parent | 4b7779df5d812d735a5367b66ccb2395682049e8 (diff) | |
download | libarchive-6a9dcf9fc429e2dc9fb08e669bf7b0bed4d5edf9.tar.gz |
tar: use option_flags bitfield for boolean options
Diffstat (limited to 'tar/bsdtar.h')
-rw-r--r-- | tar/bsdtar.h | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/tar/bsdtar.h b/tar/bsdtar.h index 4b84ba18..89cf2f9a 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -50,6 +50,7 @@ struct bsdtar { int bytes_per_block; /* -b block_size */ int bytes_in_last_block; /* See -b handling. */ int verbose; /* -v */ + int flags; /* Bitfield of boolean options */ int extract_flags; /* Flags for extract operation */ int readdisk_flags; /* Flags for read disk operation */ int strip_components; /* Remove this many leading dirs */ @@ -60,20 +61,7 @@ struct bsdtar { const char *passphrase; /* --passphrase */ char mode; /* Program mode: 'c', 't', 'r', 'u', 'x' */ char symlink_mode; /* H or L, per BSD conventions */ - char option_absolute_paths; /* -P */ - char option_chroot; /* --chroot */ - char option_fast_read; /* --fast-read */ const char *option_options; /* --options */ - char option_ignore_zeros; /* --ignore-zeros */ - char option_interactive; /* -w */ - char option_no_owner; /* -o */ - char option_no_subdirs; /* -n */ - char option_numeric_owner; /* --numeric-owner */ - char option_null; /* --null */ - char option_stdout; /* -O */ - char option_totals; /* --totals */ - char option_unlink_first; /* -U */ - char option_warn_links; /* --check-links */ char day_first; /* show day before month in -tv output */ struct creation_set *cset; @@ -114,6 +102,24 @@ struct bsdtar { char *ppbuff; /* for util.c */ }; +/* Options for flags bitfield */ +#define OPTFLAG_AUTO_COMPRESS (0x00000001) /* -a */ +#define OPTFLAG_ABSOLUTE_PATHS (0x00000002) /* -P */ +#define OPTFLAG_CHROOT (0x00000004) /* --chroot */ +#define OPTFLAG_FAST_READ (0x00000008) /* --fast-read */ +#define OPTFLAG_IGNORE_ZEROS (0x00000010) /* --ignore-zeros */ +#define OPTFLAG_INTERACTIVE (0x00000020) /* -w */ +#define OPTFLAG_NO_OWNER (0x00000040) /* -o */ +#define OPTFLAG_NO_SUBDIRS (0x00000080) /* -n */ +#define OPTFLAG_NULL (0x00000100) /* --null */ +#define OPTFLAG_NUMERIC_OWNER (0x00000200) /* --numeric-owner */ +#define OPTFLAG_O (0x00000400) /* -o */ +#define OPTFLAG_STDOUT (0x00000800) /* -O */ +#define OPTFLAG_TOTALS (0x00001000) /* --totals */ +#define OPTFLAG_UNLINK_FIRST (0x00002000) /* -U */ +#define OPTFLAG_WARN_LINKS (0x00004000) /* --check-links */ +#define OPTFLAG_NO_XATTR (0x00008000) /* --no-xattr */ + /* Fake short equivalents for long options that otherwise lack them. */ enum { OPTION_B64ENCODE = 1, |