version 1.8, 2013/04/22 07:21:52 |
version 1.9, 2013/04/23 14:32:53 |
|
|
/* This module handles time stamps on files in a relatively high-level way. |
/* This module handles time stamps on files in a relatively high-level way. |
* Most of the interface is achieved through inlineable code. |
* Most of the interface is achieved through inlineable code. |
* |
* |
* TIMESTAMP: opaque data type to store a date. |
|
* ts_set_out_of_date(t): set up t so that it is out-of-date. |
* ts_set_out_of_date(t): set up t so that it is out-of-date. |
* b = is_out_of_date(t): check whether t is out-of-date. |
* b = is_out_of_date(t): check whether t is out-of-date. |
* ts_set_from_stat(s, t): grab date out of stat(2) buffer. |
* ts_set_from_stat(s, t): grab date out of stat(2) buffer. |
|
|
|
|
#define Init_Timestamp() ts_set_from_now(now) |
#define Init_Timestamp() ts_set_from_now(now) |
|
|
#ifndef TIMESTAMP_TYPE |
#define TMIN (sizeof(time_t) == sizeof(int32_t) ? INT32_MIN : INT64_MIN) |
#include "timestamp_t.h" |
#define ts_set_out_of_date(t) (t).tv_sec = TMIN, (t).tv_nsec = 0 |
#endif |
#define is_out_of_date(t) ((t).tv_sec == TMIN && (t).tv_nsec == 0) |
#define ts_set_out_of_date(t) (t).tv_sec = INT_MIN, (t).tv_nsec = 0 |
|
#define is_out_of_date(t) ((t).tv_sec == INT_MIN && (t).tv_nsec == 0) |
|
#define ts_set_from_stat(s, t) \ |
#define ts_set_from_stat(s, t) \ |
do { \ |
do { \ |
(t).tv_sec = (s).st_mtime; \ |
(t).tv_sec = (s).st_mtime; \ |
|
|
|
|
extern int set_times(const char *); |
extern int set_times(const char *); |
|
|
extern TIMESTAMP now; /* The time at the start of this whole |
extern struct timespec now; /* The time at the start of this whole |
* process */ |
* process */ |
extern char *time_to_string(TIMESTAMP t); |
extern char *time_to_string(struct timespec t); |
|
|
|
|
#endif |
#endif |