From: lottaviano Date: Fri, 26 Nov 2010 11:09:18 +0000 (+0000) Subject: Change configuration options name for parser module. X-Git-Tag: 2.7.0~364 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d6aafcb0363974688e68f2325cf18f8087e07448;p=bertos.git Change configuration options name for parser module. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4573 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cfg/cfg_parser.h b/bertos/cfg/cfg_parser.h index 49ab0b51..67e091a5 100644 --- a/bertos/cfg/cfg_parser.h +++ b/bertos/cfg/cfg_parser.h @@ -43,14 +43,14 @@ * $WIZ$ type = "int" * $WIZ$ min = 0 */ -#define PARSER_MAX_ARGS 4 +#define CONFIG_PARSER_MAX_ARGS 4 /** * Max number of commands * $WIZ$ type = "int" * $WIZ$ min = 8 */ -#define MAX_COMMANDS_NUMBER 16 +#define CONFIG_MAX_COMMANDS_NUMBER 16 /** * Enable compatibility behaviour. diff --git a/bertos/mware/parser.c b/bertos/mware/parser.c index e63e55e8..2d47a537 100644 --- a/bertos/mware/parser.c +++ b/bertos/mware/parser.c @@ -65,7 +65,7 @@ static const void* get_key_from_command(const void* cmd, uint8_t* length); /// Hashtable that handles the commands that can be executed -DECLARE_HASHTABLE_STATIC(commands, MAX_COMMANDS_NUMBER, get_key_from_command); +DECLARE_HASHTABLE_STATIC(commands, CONFIG_MAX_COMMANDS_NUMBER, get_key_from_command); /** @@ -230,7 +230,7 @@ static const char *skip_to_params(const char *input, const struct CmdTemplate *c return end; } -bool parser_get_cmd_arguments(const char* input, const struct CmdTemplate* cmdp, parms args[PARSER_MAX_ARGS]) +bool parser_get_cmd_arguments(const char* input, const struct CmdTemplate* cmdp, parms args[CONFIG_PARSER_MAX_ARGS]) { input = skip_to_params(input, cmdp); if (!input) @@ -253,7 +253,7 @@ static const void* get_key_from_command(const void* cmd, uint8_t* length) bool parser_process_line(const char* input) { const struct CmdTemplate *cmdp; - parms args[PARSER_MAX_ARGS]; + parms args[CONFIG_PARSER_MAX_ARGS]; cmdp = parser_get_cmd_template(input); if (!cmdp) diff --git a/bertos/mware/parser.h b/bertos/mware/parser.h index 12d358c4..3c2f2a5f 100644 --- a/bertos/mware/parser.h +++ b/bertos/mware/parser.h @@ -135,7 +135,7 @@ bool parser_process_line(const char* line); * * \return False if the command returned an error, true otherwise */ -INLINE bool parser_execute_cmd(const struct CmdTemplate* templ, parms args[PARSER_MAX_ARGS]) +INLINE bool parser_execute_cmd(const struct CmdTemplate* templ, parms args[CONFIG_PARSER_MAX_ARGS]) { return (templ->func(args) == 0); } @@ -167,7 +167,7 @@ const struct CmdTemplate* parser_get_cmd_template(const char* line); * * \return True if everything OK, false in case of parsing error. */ -bool parser_get_cmd_arguments(const char* line, const struct CmdTemplate* templ, parms args[PARSER_MAX_ARGS]); +bool parser_get_cmd_arguments(const char* line, const struct CmdTemplate* templ, parms args[CONFIG_PARSER_MAX_ARGS]); #if CONFIG_ENABLE_COMPAT_BEHAVIOUR