aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann1999-11-28 20:11:56 +0000
committerGerd Moellmann1999-11-28 20:11:56 +0000
commitc53a6701c3e29201082716858a774ed47a2c0343 (patch)
tree8d2321fba3ff3f1f71e287fd820eb5dcb1d82d37 /src
parent83b96b22503a350068a3de0e39c72cd36b7d5982 (diff)
downloademacs-c53a6701c3e29201082716858a774ed47a2c0343.tar.gz
emacs-c53a6701c3e29201082716858a774ed47a2c0343.zip
(EMACS_TIME_CMP, EMACS_TIME_EQ, EMACS_TIME_NE)
(EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT,EMACS_TIME_LE): New macros.
Diffstat (limited to 'src')
-rw-r--r--src/systime.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/systime.h b/src/systime.h
index 44c1f7d4de1..2675dee799d 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -147,3 +147,22 @@ extern long timezone;
147 (EMACS_SET_SECS (time, secs), EMACS_SET_USECS (time, usecs)) 147 (EMACS_SET_SECS (time, secs), EMACS_SET_USECS (time, usecs))
148 148
149extern int set_file_times (); 149extern int set_file_times ();
150
151/* Compare times T1 and T2. Value is 0 if T1 and T2 are the same.
152 Value is < 0 if T1 is less than T2. Value is > 0 otherwise. */
153
154#define EMACS_TIME_CMP(T1, T2) \
155 (EMACS_SECS (T1) - EMACS_SECS (T2) \
156 + (EMACS_SECS (T1) == EMACS_SECS (T2) \
157 ? EMACS_USECS (T1) - EMACS_USECS (T2) \
158 : 0))
159
160/* Compare times T1 and T2 for equality, inequality etc. */
161
162#define EMACS_TIME_EQ(T1,T2) (EMACS_TIME_CMP (T1, T2) == 0)
163#define EMACS_TIME_NE(T1,T2) (EMACS_TIME_CMP (T1, T2) != 0)
164#define EMACS_TIME_GT(T1,T2) (EMACS_TIME_CMP (T1, T2) > 0)
165#define EMACS_TIME_GE(T1,T2) (EMACS_TIME_CMP (T1, T2) >= 0)
166#define EMACS_TIME_LT(T1,T2) (EMACS_TIME_CMP (T1, T2) < 0)
167#define EMACS_TIME_LE(T1,T2) (EMACS_TIME_CMP (T1, T2) <= 0)
168