summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-03-06 03:53:36 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:29 -0400
commitb737cd8e6dd185beeae902caa4eee6c4cee8bc36 (patch)
tree967b198e0d52c8d0f2ae2215c90224a6ff48194d /config.h
parentd02f74efea3e6b631810bfd3c3d8adcaa4299902 (diff)
downloadfork-ledger-b737cd8e6dd185beeae902caa4eee6c4cee8bc36.tar.gz
fork-ledger-b737cd8e6dd185beeae902caa4eee6c4cee8bc36.tar.bz2
fork-ledger-b737cd8e6dd185beeae902caa4eee6c4cee8bc36.zip
Added a DATETIME value type.
Diffstat (limited to 'config.h')
-rw-r--r--config.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/config.h b/config.h
index bad96c77..f347288c 100644
--- a/config.h
+++ b/config.h
@@ -2,6 +2,7 @@
#define _CONFIG_H
#include "ledger.h"
+#include "timing.h"
#include <iostream>
#include <memory>
@@ -22,6 +23,7 @@ class config_t
std::string output_file;
std::string account;
std::string predicate;
+ std::string secondary_predicate;
std::string display_predicate;
std::string report_period;
std::string report_period_sort;
@@ -66,6 +68,8 @@ class config_t
bool use_cache;
bool cache_dirty;
bool debug_mode;
+ bool verbose_mode;
+ bool trace_mode;
bool keep_price;
bool keep_date;
bool keep_tag;
@@ -102,7 +106,7 @@ class config_t
std::list<item_handler<transaction_t> *>& ptrs);
};
-#define CONFIG_OPTIONS_SIZE 81
+#define CONFIG_OPTIONS_SIZE 84
extern option_t config_options[CONFIG_OPTIONS_SIZE];
void option_help(std::ostream& out);
@@ -112,6 +116,29 @@ void option_help(std::ostream& out);
#define OPT_END(tag)
+//////////////////////////////////////////////////////////////////////
+
+void trace(const std::string& cat, const std::string& str);
+void trace_push(const std::string& cat, const std::string& str,
+ timing_t& timer);
+void trace_pop(const std::string& cat, const std::string& str,
+ timing_t& timer);
+
+#define TRACE(cat, msg) if (config.trace_mode) trace(#cat, msg)
+#define TRACE_(cat, msg) if (trace_mode) trace(#cat, msg)
+
+#define TRACE_PUSH(cat, msg) \
+ timing_t timer_ ## cat(#cat); \
+ if (config.trace_mode) trace_push(#cat, msg, timer_ ## cat)
+#define TRACE_PUSH_(cat, msg) \
+ timing_t timer_ ## cat(#cat); \
+ if (trace_mode) trace_push(#cat, msg, timer_ ## cat)
+
+#define TRACE_POP(cat, msg) \
+ if (config.trace_mode) trace_pop(#cat, msg, timer_ ## cat)
+#define TRACE_POP_(cat, msg) \
+ if (trace_mode) trace_pop(#cat, msg, timer_ ## cat)
+
} // namespace ledger
#endif // _CONFIG_H