2 std_macros.h - MaLa standard module macro definitions
4 Copyright (C) 2004, 2005, Christian Thaeter <chth@gmx.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, contact me.
20 #ifndef MALA_STD_MACROS_H
21 #define MALA_STD_MACROS_H
23 #define MALA_NULL_PARSER(name) \
24 MALA_PARSER(name, mala_null_parser, NULL, NULL, NULL)
25 #define MALA_NULL_PARSER_P(name,parent) \
26 MALA_PARSER(name, mala_null_parser, NULL, NULL, parent)
28 #define MALA_SUBSTITUTE_PARSER(name,subst) \
29 MALA_PARSER(name, mala_substitute_parser, mala_string_factory, subst, NULL)
30 #define MALA_SUBSTITUTE_PARSER_P(name,subst,parent) \
31 MALA_PARSER(name, mala_substitute_parser, mala_string_factory, subst, parent)
33 #define MALA_EXPAND_PARSER(name, expand) \
34 MALA_PARSER(name, mala_expand_parser, mala_stringlist_factory, \
35 MALA_STATIC_STRINGLIST_INIT expand, NULL)
36 #define MALA_EXPAND_PARSER_P(name, expand, parent) \
37 MALA_PARSER(name, mala_expand_parser, mala_stringlist_factory, \
38 MALA_STATIC_STRINGLIST_INIT expand, parent)
40 #define MALA_MACRO_PARSER(name, macro) \
41 MALA_PARSER(name, mala_macro_parser, mala_stringlist_factory, \
42 MALA_STATIC_STRINGLIST_INIT macro, NULL)
43 #define MALA_MACRO_PARSER_P(name, macro, parent) \
44 MALA_PARSER(name, mala_macro_parser, mala_stringlist_factory, \
45 MALA_STATIC_STRINGLIST_INIT macro, parent)
48 // {name, (MalaParserFunc)mala_macro_parser, (MalaDataFactory)mala_stringlist_factory,
49 // MALA_STATIC_STRINGLIST_INIT macro, parent}
51 #define MALA_PARSER_BRIEF(name, brief) \
52 MALA_SUBSTITUTE_PARSER_P("--BRIEF_" name, brief, name)
54 #define MALA_PARSER_HELP(name, args) \
55 MALA_EXPAND_PARSER_P("--HELP_" name, args, name)
57 #define MALA_PARSER_TYPE(name, explain) \
58 MALA_SUBSTITUTE_PARSER("--TYPE_" name, explain)
60 #define MALA_PARSER_RESULT_TYPE(name, args) \
61 MALA_EXPAND_PARSER_P("--RESULT-TYPE_" name, args, name)
63 #define MALA_PARSER_RESULT_USAGE(name, args) \
64 MALA_EXPAND_PARSER_P("--RESULT-USAGE_" name, args, name)
66 #define MALA_PARSER_SIGNATURE_TYPE(name, args) \
67 MALA_EXPAND_PARSER_P("--SIGNATURE-TYPE_" name, args, name)
69 #define MALA_PARSER_SIGNATURE_USAGE(name, args) \
70 MALA_EXPAND_PARSER_P("--SIGNATURE-USAGE_" name, args, name)
72 #define MALA_TRUE_PARSER(name) \
73 MALA_SUBSTITUTE_PARSER(name,"--TRUE")
74 #define MALA_FALSE_PARSER(name) \
75 MALA_SUBSTITUTE_PARSER(name,"--FALSE")
77 #endif /* MALA_STD_MACROS_H */
82 // c-file-style: "gnu"
84 // arch-tag: df02af8a-69d7-4d51-8acc-aa544cb3acbe