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.
This commit is contained in:
Paul Eggert
2024-07-26 23:42:59 -07:00
parent afd073399a
commit 45a86d45b2
4 changed files with 13 additions and 15 deletions

View 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);

View 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,

View File

@@ -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)
{

View 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)
{