summaryrefslogtreecommitdiff
path: root/src/calcurse.h
diff options
context:
space:
mode:
authorBaptiste Jonglez <baptiste--git@jonglez.org>2012-05-28 04:50:39 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-31 20:42:15 +0200
commit9e1185f526e4a6636a64b026c6617898a6a1c8aa (patch)
treeed64a6606bf4c619b0e75bd381ce15f0566d58f7 /src/calcurse.h
parent7eb3abb08a0b20bef49a9bf717ea30fad27c5606 (diff)
downloadcalcurse-9e1185f526e4a6636a64b026c6617898a6a1c8aa.zip
Give a meaning to DATE_FORMATS
It's a bit weird to consider DATE_FORMATS as part of the date input format enum, all the more so as it does not even represent the number of available formats (since those are numbered from 1). Turn DATE_FORMATS into the number of available date input formats. Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calcurse.h')
-rw-r--r--src/calcurse.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/calcurse.h b/src/calcurse.h
index 9efb4fd..5fdfe4c 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -247,14 +247,17 @@ struct dmon_conf {
unsigned log; /* log daemon activity */
};
+/* Input date formats. */
enum datefmt {
DATEFMT_MMDDYYYY = 1,
DATEFMT_DDMMYYYY,
DATEFMT_YYYYMMDD,
DATEFMT_ISO,
- DATE_FORMATS
+ DATEFMT_MAX
};
+#define DATE_FORMATS (DATEFMT_MAX - 1)
+
#define DATEFMT(datefmt) (datefmt == DATEFMT_MMDDYYYY ? "%m/%d/%Y" : \
(datefmt == DATEFMT_DDMMYYYY ? "%d/%m/%Y" : \
(datefmt == DATEFMT_YYYYMMDD ? "%Y/%m/%d" : "%Y-%m-%d")))