diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2020-08-03 23:03:46 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-04-18 15:35:18 +0100 |
commit | d3a687432f96d90fdaa7c1264cf2c17df3ad58c1 (patch) | |
tree | e7551a6fce0b5a96266c18b23386c840ddce3095 /src | |
parent | 6b5e77ada6520398f9a2135e43e60067bc072e27 (diff) | |
download | riscv-openocd-d3a687432f96d90fdaa7c1264cf2c17df3ad58c1.zip riscv-openocd-d3a687432f96d90fdaa7c1264cf2c17df3ad58c1.tar.gz riscv-openocd-d3a687432f96d90fdaa7c1264cf2c17df3ad58c1.tar.bz2 |
helper/command: rename s/command_unknown/jim_command_dispatch/
The function's name was consistent with its purpose to handle
commands that were not at root level, thus not directly 'known'
by jimtcl.
Rename it as jim_command_dispatch() to highlight that now it is
a jim_handler and its purpose is to dispatch the call to the
proper command handler.
Change-Id: I9491a6d6459b8eb37a6c402abcae08388c693764
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5791
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/helper/command.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index a7990d4..80e297b 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -51,7 +51,7 @@ struct log_capture_state { static int unregister_command(struct command_context *context, const char *cmd_prefix, const char *name); -static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj * const *argv); +static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj * const *argv); static int help_add_command(struct command_context *cmd_ctx, const char *cmd_name, const char *help_text, const char *usage_text); static int help_del_command(struct command_context *cmd_ctx, const char *cmd_name); @@ -64,7 +64,7 @@ static inline bool jimcmd_is_proc(Jim_Cmd *cmd) static inline bool jimcmd_is_ocd_command(Jim_Cmd *cmd) { - return !cmd->isproc && cmd->u.native.cmdProc == command_unknown; + return !cmd->isproc && cmd->u.native.cmdProc == jim_command_dispatch; } static inline void *jimcmd_privdata(Jim_Cmd *cmd) @@ -340,7 +340,7 @@ static struct command *register_command(struct command_context *context, LOG_DEBUG("registering '%s'...", full_name); int retval = Jim_CreateCommand(context->interp, full_name, - command_unknown, c, command_free); + jim_command_dispatch, c, command_free); if (retval != JIM_OK) { command_run_linef(context, "del_help_text {%s}", full_name); command_run_linef(context, "del_usage_text {%s}", full_name); @@ -942,7 +942,7 @@ static int exec_command(Jim_Interp *interp, struct command_context *cmd_ctx, return command_retval_set(interp, retval); } -static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj * const *argv) { script_debug(interp, argc, argv); @@ -982,7 +982,7 @@ static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv) * current_target_override is used also for event handlers * therefore we prevent touching it if command has no prefix. * Previous override is saved and restored back to ensure - * correct work when command_unknown() is re-entered. + * correct work when jim_command_dispatch() is re-entered. */ struct target *saved_target_override = cmd_ctx->current_target_override; if (c->jim_override_target) |