diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-02-11 22:20:57 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-02-11 22:20:57 -0500 |
commit | 60a33ca726518a3325e56d77f65bfdcbecf91444 (patch) | |
tree | 99fadc2fe4b13f0da18162a6cfc971fd42b98b0e /util.h | |
parent | 31d4d9ea8bb2678ea4a3742a7d34e76c0ed86956 (diff) |
Implement explicit reference times (-newerXt)
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |