diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-09 23:56:52 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-13 10:51:45 -0800 |
commit | cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e (patch) | |
tree | f129c414d90f81a2caf6054ab7bbcd1306ac1f26 /src/helper | |
parent | ddb6138ed428f666064d26bb08036de3afe44bc8 (diff) | |
download | openocd+libswd-cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e.tar.gz openocd+libswd-cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e.tar.bz2 openocd+libswd-cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e.tar.xz openocd+libswd-cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e.zip |
use COMMAND_HANDLER macro to define all commands
Diffstat (limited to 'src/helper')
-rw-r--r-- | src/helper/command.c | 5 | ||||
-rw-r--r-- | src/helper/ioutil.c | 20 | ||||
-rw-r--r-- | src/helper/log.c | 4 |
3 files changed, 11 insertions, 18 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index e467be0b..4ce50855 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -716,8 +716,7 @@ static int jim_capture(Jim_Interp *interp, int argc, Jim_Obj *const *argv) /* sleep command sleeps for <n> miliseconds * this is useful in target startup scripts */ -static int handle_sleep_command(struct command_context_s *cmd_ctx, - char *cmd, char **args, int argc) +COMMAND_HANDLER(handle_sleep_command) { bool busy = false; if (argc == 2) @@ -750,7 +749,7 @@ static int handle_sleep_command(struct command_context_s *cmd_ctx, return ERROR_OK; } -static int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +COMMAND_HANDLER(handle_fast_command) { if (argc != 1) return ERROR_COMMAND_SYNTAX_ERROR; diff --git a/src/helper/ioutil.c b/src/helper/ioutil.c index b3171bc0..1423462c 100644 --- a/src/helper/ioutil.c +++ b/src/helper/ioutil.c @@ -57,8 +57,7 @@ #endif -int handle_rm_command(struct command_context_s *cmd_ctx, char *cmd, - char **args, int argc) +COMMAND_HANDLER(handle_rm_command) { if (argc != 1) { @@ -134,10 +133,7 @@ int loadFile(const char *fileName, void **data, size_t *len) return ERROR_OK; } - - -int handle_cat_command(struct command_context_s *cmd_ctx, char *cmd, - char **args, int argc) +COMMAND_HANDLER(handle_cat_command) { if (argc != 1) { @@ -162,8 +158,8 @@ int handle_cat_command(struct command_context_s *cmd_ctx, char *cmd, return ERROR_OK; } -int handle_trunc_command(struct command_context_s *cmd_ctx, char *cmd, - char **args, int argc) + +COMMAND_HANDLER(handle_trunc_command) { if (argc != 1) { @@ -179,8 +175,7 @@ int handle_trunc_command(struct command_context_s *cmd_ctx, char *cmd, return ERROR_OK; } - -int handle_meminfo_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +COMMAND_HANDLER(handle_meminfo_command) { static int prev = 0; struct mallinfo info; @@ -205,8 +200,7 @@ int handle_meminfo_command(struct command_context_s *cmd_ctx, char *cmd, char ** } -int handle_append_command(struct command_context_s *cmd_ctx, char *cmd, - char **args, int argc) +COMMAND_HANDLER(handle_append_command) { if (argc < 1) { @@ -245,7 +239,7 @@ int handle_append_command(struct command_context_s *cmd_ctx, char *cmd, -int handle_cp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +COMMAND_HANDLER(handle_cp_command) { if (argc != 2) { diff --git a/src/helper/log.c b/src/helper/log.c index a8b519af..ccc0c01b 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -274,7 +274,7 @@ void log_printf_lf(enum log_levels level, const char *file, int line, const char * 2: + INFORMATIONAL MSGS * 3: + DEBUG MSGS */ -int handle_debug_level_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +COMMAND_HANDLER(handle_debug_level_command) { if (argc == 1) { @@ -302,7 +302,7 @@ int handle_debug_level_command(struct command_context_s *cmd_ctx, char *cmd, cha return ERROR_OK; } -int handle_log_output_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +COMMAND_HANDLER(handle_log_output_command) { if (argc == 1) { |