X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fcommon.h;h=59c96844fb9bf2250f0ee82b4c6d34ee02ab48f2;hb=ddb0f96f0004f26f621aba88ae41c70a4c6070fe;hp=be7f35d15dbfa7f52c584c2eae362a1f7855fc20;hpb=2f800ce3fb9c38360e1b6dac70ee0d8ceae72c6a;p=chaz%2Ftar diff --git a/src/common.h b/src/common.h index be7f35d..59c9684 100644 --- a/src/common.h +++ b/src/common.h @@ -189,7 +189,11 @@ GLOBAL struct timespec newer_mtime_option; /* Return true if the struct stat ST's M time is less than newer_mtime_option. */ #define OLDER_STAT_TIME(st, m) \ - (timespec_cmp (get_stat_##m##time (&st), newer_mtime_option) < 0) + (timespec_cmp (get_stat_##m##time (&(st)), newer_mtime_option) < 0) + +/* Likewise, for struct tar_stat_info ST. */ +#define OLDER_TAR_STAT_TIME(st, m) \ + (timespec_cmp ((st).m##time, newer_mtime_option) < 0) /* Zero if there is no recursion, otherwise FNM_LEADING_DIR. */ GLOBAL int recursion_option; @@ -309,6 +313,9 @@ GLOBAL dev_t root_device; /* Unquote filenames */ GLOBAL bool unquote_option; + +GLOBAL bool test_label_option; + /* Declarations for each module. */ @@ -490,6 +497,10 @@ char *quote_copy_string (const char *); int unquote_string (char *); void code_ns_fraction (int, char *); +char const *code_timespec (struct timespec, char *); +enum { BILLION = 1000000000, LOG10_BILLION = 9 }; +enum { TIMESPEC_STRSIZE_BOUND = + UINTMAX_STRSIZE_BOUND + LOG10_BILLION + sizeof "-." - 1 }; size_t dot_dot_prefix_len (char const *);