summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-02-11 22:20:57 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-02-11 22:20:57 -0500
commit60a33ca726518a3325e56d77f65bfdcbecf91444 (patch)
tree99fadc2fe4b13f0da18162a6cfc971fd42b98b0e /util.h
parent31d4d9ea8bb2678ea4a3742a7d34e76c0ed86956 (diff)
downloadbfs-60a33ca726518a3325e56d77f65bfdcbecf91444.tar.xz
Implement explicit reference times (-newerXt)
Diffstat (limited to 'util.h')
-rw-r--r--util.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/util.h b/util.h
index e7b844e..ef546d4 100644
--- a/util.h
+++ b/util.h
@@ -171,6 +171,27 @@ char *xregerror(int err, const regex_t *regex);
int xlocaltime(const time_t *timep, struct tm *result);
/**
+ * gmtime_r() wrapper that calls tzset() first.
+ *
+ * @param timep
+ * The time_t to convert.
+ * @param result
+ * Buffer to hold the result.
+ * @return 0 on success, -1 on failure.
+ */
+int xgmtime(const time_t *timep, struct tm *result);
+
+/**
+ * A portable timegm(), the inverse of gmtime().
+ *
+ * @param tm
+ * The struct tm to convert.
+ * @return
+ * The converted time on success, or -1 on failure.
+ */
+time_t xtimegm(struct tm *tm);
+
+/**
* Format a mode like ls -l (e.g. -rw-r--r--).
*
* @param mode