From b737cd8e6dd185beeae902caa4eee6c4cee8bc36 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 6 Mar 2006 03:53:36 +0000 Subject: Added a DATETIME value type. --- config.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'config.h') 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 #include @@ -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 *>& 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 -- cgit v1.2.3