X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftar;a=blobdiff_plain;f=src%2Fcommon.h;h=14ae2caddfbb8e3db77bceaa6cef3c4a666fdbe3;hp=4f7c19f55ef47abb77c692de4aa7e2e0928dd575;hb=45ccda119355a1087450039a250359c1d0de0d08;hpb=cd7bdd4076ca154575bbef85eb2157e59befcfe2 diff --git a/src/common.h b/src/common.h index 4f7c19f..14ae2ca 100644 --- a/src/common.h +++ b/src/common.h @@ -1,6 +1,6 @@ /* Common declarations for the tar program. - Copyright 1988, 1992-1994, 1996-1997, 1999-2010, 2012-2013 Free + Copyright 1988, 1992-1994, 1996-1997, 1999-2010, 2012-2014 Free Software Foundation, Inc. This file is part of GNU tar. @@ -96,11 +96,6 @@ enum subcommand GLOBAL enum subcommand subcommand_option; -#define READ_LIKE_SUBCOMMAND \ - (subcommand_option == EXTRACT_SUBCOMMAND \ - || subcommand_option == DIFF_SUBCOMMAND \ - || subcommand_option == LIST_SUBCOMMAND) - /* Selected format for output archive. */ GLOBAL enum archive_format archive_format; @@ -195,6 +190,8 @@ enum old_files }; GLOBAL enum old_files old_files_option; +GLOBAL bool keep_directory_symlink_option; + /* Specified file name for incremental list. */ GLOBAL const char *listed_incremental_option; /* Incremental dump level */ @@ -238,6 +235,10 @@ GLOBAL bool numeric_owner_option; GLOBAL bool one_file_system_option; +/* Create a top-level directory for extracting based on the archive name. */ +GLOBAL bool one_top_level_option; +GLOBAL char *one_top_level_dir; + /* Specified value to be put into tar file in place of stat () results, or just null and -1 if such an override should not take place. */ GLOBAL char const *owner_name_option; @@ -430,7 +431,7 @@ size_t available_space_after (union block *pointer); off_t current_block_ordinal (void); void close_archive (void); void closeout_volume_number (void); -void compute_duration (void); +double compute_duration (void); union block *find_next_block (void); void flush_read (void); void flush_write (void); @@ -447,6 +448,12 @@ void archive_read_error (void); off_t seek_archive (off_t size); void set_start_time (void); +#define TF_READ 0 +#define TF_WRITE 1 +#define TF_DELETED 2 +int format_total_stats (FILE *fp, const char **formats, int eor, int eol); +void print_total_stats (void); + void mv_begin_write (const char *file_name, off_t totsize, off_t sizeleft); void mv_begin_read (struct tar_stat_info *st); @@ -529,6 +536,7 @@ void rebase_directory (struct directory *dir, const char *repl, size_t rlen); void append_incremental_renames (struct directory *dir); +void show_snapshot_field_ranges (void); void read_directory_file (void); void write_directory_file (void); void purge_directory (char const *directory_name); @@ -598,14 +606,20 @@ void skip_member (void); void assign_string (char **dest, const char *src); int unquote_string (char *str); char *zap_slashes (char *name); -char *normalize_filename (const char *name); +char *normalize_filename (int cdidx, const char *name); +void normalize_filename_x (char *name); void replace_prefix (char **pname, const char *samp, size_t slen, const char *repl, size_t rlen); +char *tar_savedir (const char *name, int must_exist); typedef struct namebuf *namebuf_t; namebuf_t namebuf_create (const char *dir); void namebuf_free (namebuf_t buf); char *namebuf_name (namebuf_t buf, const char *name); +void namebuf_add_dir (namebuf_t buf, const char *name); +char *namebuf_finish (namebuf_t buf); + +const char *tar_dirname (void); /* Represent N using a signed integer I such that (uintmax_t) I == N. With a good optimizing compiler, this is equivalent to (intmax_t) i @@ -709,6 +723,7 @@ int uname_to_uid (char const *uname, uid_t *puid); void name_init (void); void name_add_name (const char *name, int matching_flags); void name_add_dir (const char *name); +void name_add_file (const char *name, int term); void name_term (void); const char *name_next (int change_dirs); void name_gather (void); @@ -753,6 +768,9 @@ const char *archive_format_string (enum archive_format fmt); const char *subcommand_string (enum subcommand c); void set_exit_status (int val); +void request_stdin (const char *option); +void more_options (int argc, char **argv); + /* Module update.c. */ extern char *output_start; @@ -842,11 +860,14 @@ bool transform_program_p (void); /* Module suffix.c */ void set_compression_program_by_suffix (const char *name, const char *defprog); +char *strip_compression_suffix (const char *name); /* Module checkpoint.c */ void checkpoint_compile_action (const char *str); void checkpoint_finish_compile (void); void checkpoint_run (bool do_write); +void checkpoint_finish (void); +void checkpoint_flush_actions (void); /* Module warning.c */ #define WARN_ALONE_ZERO_BLOCK 0x00000001 @@ -871,11 +892,12 @@ void checkpoint_run (bool do_write); #define WARN_DECOMPRESS_PROGRAM 0x00080000 #define WARN_EXISTING_FILE 0x00100000 #define WARN_XATTR_WRITE 0x00200000 +#define WARN_RECORD_SIZE 0x00400000 -/* The warnings composing WARN_VERBOSE_WARNINGS are enabled by default - in verbose mode */ +/* These warnings are enabled by default in verbose mode: */ #define WARN_VERBOSE_WARNINGS (WARN_RENAME_DIRECTORY|WARN_NEW_DIRECTORY|\ - WARN_DECOMPRESS_PROGRAM|WARN_EXISTING_FILE) + WARN_DECOMPRESS_PROGRAM|WARN_EXISTING_FILE|\ + WARN_RECORD_SIZE) #define WARN_ALL (~WARN_VERBOSE_WARNINGS) void set_warning_option (const char *arg);