From 45a86d45b278bcde1476d70dbdea7aa33892ef23 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 26 Jul 2024 23:42:59 -0700 Subject: [PATCH] maint: make a few funcs and vars static * src/buffer.c (last_stat_time, write_fatal_details): * src/tar.c (name_more_files): * src/xattrs.c (xheader_xattr_add): Now static. --- src/buffer.c | 7 +++++-- src/common.h | 12 ------------ src/tar.c | 7 +++++++ src/xattrs.c | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index c4232433..9c36a089 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -55,7 +55,6 @@ static int record_index; int archive; struct timespec start_time; struct timespec volume_start_time; -struct timespec last_stat_time; struct tar_stat_info current_stat_info; struct stat archive_stat; @@ -68,12 +67,16 @@ enum access_mode access_mode; /* how do we handle the archive */ off_t records_read; /* number of records read from this archive */ off_t records_written; /* likewise, for records written */ +/* When file status was last computed. */ +static struct timespec last_stat_time; + static off_t record_start_block; /* block ordinal at record_start */ /* Where we write list messages (not errors, not interactions) to. */ FILE *stdlis; static void backspace_output (void); +static _Noreturn void write_fatal_details (char const *, ssize_t, size_t); /* PID of child program, if compress_option or remote archive access. */ static pid_t child_pid; @@ -1133,7 +1136,7 @@ close_archive (void) bufmap_free (NULL); } -void +static void write_fatal_details (char const *name, ssize_t status, size_t size) { write_error_details (name, status, size); diff --git a/src/common.h b/src/common.h index 4059c386..12721760 100644 --- a/src/common.h +++ b/src/common.h @@ -425,8 +425,6 @@ extern int archive; extern struct timespec start_time; /* when we started execution */ extern struct timespec volume_start_time; /* when the current volume was opened*/ -extern struct timespec last_stat_time; /* when the statistics was last - computed */ extern struct tar_stat_info current_stat_info; @@ -745,7 +743,6 @@ void file_removed_diag (const char *name, bool top_level, void (*diagfn) (char const *name)); void write_error_details (char const *name, size_t status, size_t size); _Noreturn void write_fatal (char const *name); -_Noreturn void write_fatal_details (char const *name, ssize_t status, size_t size); pid_t xfork (void); void xpipe (int fd[2]); @@ -770,13 +767,6 @@ extern enum files_count filename_args; extern struct argp names_argp; #endif -/* Return true if there are file names in the list */ -COMMON_INLINE bool -name_more_files (void) -{ - return filename_args != FILES_NONE; -} - extern struct name *gnu_list_name; void gid_to_gname (gid_t gid, char **gname); @@ -905,8 +895,6 @@ bool xheader_keyword_deleted_p (const char *kw); char *xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n); void xheader_xattr_init (struct tar_stat_info *st); -void xheader_xattr_add (struct tar_stat_info *st, - const char *key, const char *val, size_t len); void xattr_map_init (struct xattr_map *map); void xattr_map_copy (struct xattr_map *dst, diff --git a/src/tar.c b/src/tar.c index 4662b31c..d4067d56 100644 --- a/src/tar.c +++ b/src/tar.c @@ -2350,6 +2350,13 @@ more_options (int argc, char **argv, struct option_locus *loc) NULL, &args); } +/* Are there file names in the list? */ +static bool +name_more_files (void) +{ + return filename_args != FILES_NONE; +} + static void parse_default_options (struct tar_args *args) { diff --git a/src/xattrs.c b/src/xattrs.c index d5d9c2e4..c72924e7 100644 --- a/src/xattrs.c +++ b/src/xattrs.c @@ -80,7 +80,7 @@ xattr_map_add (struct xattr_map *map, map->xm_size++; } -void +static void xheader_xattr_add (struct tar_stat_info *st, const char *key, const char *val, size_t len) { -- 2.47.3