From 78e6770c4c276db3647952f21a6bf3ea465edb88 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 4 Nov 2009 20:40:07 -0500 Subject: Segregated symbols into 5 separate namespaces The different namespaces are: Function Value expression functions, which receive a "context" Option Command-line options Precommand Commands which are invoked before reading the journal Command Commands which are invoked after reading the journal Directive Directives that occur at column 0 in a data file This greatly eases the ability for Python uses to add intercept hooks to change how the basic Ledger module functions. An example of what should be possible soon: import ledger def my_foo_handler(value): print "--foo received:", value ledger.add_handler(ledger.Option, "foo=", my_foo_handler) --- src/option.h | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'src/option.h') diff --git a/src/option.h b/src/option.h index 7e2e0629..c9903c03 100644 --- a/src/option.h +++ b/src/option.h @@ -283,30 +283,6 @@ inline bool is_eq(const char * p, const char * n) { } \ END(name) -#define OPT_PREFIX "opt_" -#define OPT_PREFIX_LEN 4 - -#define WANT_OPT() \ - (std::strncmp(p, OPT_PREFIX, OPT_PREFIX_LEN) == 0) - -#define PRECMD_PREFIX "precmd_" -#define PRECMD_PREFIX_LEN 7 - -#define WANT_PRECMD() \ - (std::strncmp(p, PRECMD_PREFIX, PRECMD_PREFIX_LEN) == 0) - -#define CMD_PREFIX "cmd_" -#define CMD_PREFIX_LEN 4 - -#define WANT_CMD() \ - (std::strncmp(p, CMD_PREFIX, CMD_PREFIX_LEN) == 0) - -#define DIR_PREFIX "dir_" -#define DIR_PREFIX_LEN 4 - -#define WANT_DIR() \ - (std::strncmp(p, DIR_PREFIX, DIR_PREFIX_LEN) == 0) - bool process_option(const string& whence, const string& name, scope_t& scope, const char * arg, const string& varname); -- cgit v1.2.3