summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-05-31 04:56:14 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:10 -0400
commitbff42f702accee3ec4b53b1efd254cf3c1237214 (patch)
tree3f96cb898d752c8c6135de199109afb1c520ac30
parent6d7827af5ad53e746a11bbc5443fda1e6a908582 (diff)
downloadfork-ledger-bff42f702accee3ec4b53b1efd254cf3c1237214.tar.gz
fork-ledger-bff42f702accee3ec4b53b1efd254cf3c1237214.tar.bz2
fork-ledger-bff42f702accee3ec4b53b1efd254cf3c1237214.zip
Added `input_format' array, and made `formats' external.
-rw-r--r--datetime.cc4
-rw-r--r--datetime.h8
2 files changed, 7 insertions, 5 deletions
diff --git a/datetime.cc b/datetime.cc
index 0e821da6..d916a2d1 100644
--- a/datetime.cc
+++ b/datetime.cc
@@ -20,7 +20,9 @@ static const int month_days[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
-static const char * formats[] = {
+char input_format[128];
+
+const char * formats[] = {
"%Y/%m/%d",
"%m/%d",
"%Y.%m.%d",
diff --git a/datetime.h b/datetime.h
index 75d554e0..78054ec2 100644
--- a/datetime.h
+++ b/datetime.h
@@ -47,14 +47,14 @@ struct interval_t
void parse(std::istream& in);
};
-extern std::time_t now;
-extern int now_year;
+extern std::time_t now;
+extern int now_year;
+extern char input_format[128];
+extern const char * formats[];
bool parse_date_mask(const char * date_str, struct std::tm * result);
-
bool parse_date(const char * date_str, std::time_t * result,
const int year = -1);
-
bool quick_parse_date(const char * date_str, std::time_t * result);
} // namespace ledger