/* 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.
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;
/* Unquote filenames */
GLOBAL bool unquote_option;
+GLOBAL int savedir_sort_order;
+
/* Show file or archive names after transformation.
In particular, when creating archive in verbose mode, list member names
as stored in the archive */
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);
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);
void extract_finish (void);
bool rename_directory (char *src, char *dst);
+void remove_delayed_set_stat (const char *fname);
+
/* Module delete.c. */
void delete_archive_members (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);
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
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_add_file (const char *name, int term, int matching_flags);
void name_term (void);
const char *name_next (int change_dirs);
void name_gather (void);
size_t stripped_prefix_len (char const *file_name, size_t num);
bool all_names_found (struct tar_stat_info *st);
-bool excluded_name (char const *name);
-
void add_avoided_name (char const *name);
bool is_avoided_name (char const *name);
bool contains_dot_dot (char const *name);
-#define ISFOUND(c) ((occurrence_option == 0) ? (c)->found_count : \
- (c)->found_count == occurrence_option)
-#define WASFOUND(c) ((occurrence_option == 0) ? (c)->found_count : \
- (c)->found_count >= occurrence_option)
+#define ISFOUND(c) (occurrence_option == 0 \
+ ? (c)->found_count != 0 \
+ : (c)->found_count == occurrence_option)
+#define WASFOUND(c) (occurrence_option == 0 \
+ ? (c)->found_count != 0 \
+ : (c)->found_count >= occurrence_option)
/* Module tar.c. */
/* 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
/* Module exit.c */
extern void (*fatal_exit_hook) (void);
+/* Module exclist.c */
+#define EXCL_DEFAULT 0x00
+#define EXCL_RECURSIVE 0x01
+#define EXCL_NON_RECURSIVE 0x02
+
+void excfile_add (const char *name, int flags);
+void info_attach_exclist (struct tar_stat_info *dir);
+void info_cleanup_exclist (struct tar_stat_info *dir);
+void info_free_exclist (struct tar_stat_info *dir);
+bool excluded_name (char const *name, struct tar_stat_info *st);
+void exclude_vcs_ignores (void);
+
_GL_INLINE_HEADER_END