]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
maint: make a few funcs and vars static
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 27 Jul 2024 06:42:59 +0000 (23:42 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 27 Jul 2024 06:44:03 +0000 (23:44 -0700)
* 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
src/common.h
src/tar.c
src/xattrs.c

index c423243363634890c9c8fa59ec8cb40f2a35f588..9c36a08979aab5f784fd7688b66e49a2e586264f 100644 (file)
@@ -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);
index 4059c386c96ada1c77b7725dfea8c939d999ad69..12721760af1d5bf0d4d9bb884cd23c1e149878b2 100644 (file)
@@ -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,
index 4662b31ce75171015866ec85e5ba9fab00148ada..d4067d567e8611a39a3c06f23aa402ddef4eb02b 100644 (file)
--- 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)
 {
index d5d9c2e4f33f3cbe9a5ca0891b72f668023a33ea..c72924e7448d158722b69b3c45d6e09717b0fea4 100644 (file)
@@ -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)
 {