mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-02 11:01:35 +08:00
2002-07-03 Martin M. Hunt <hunt@redhat.com>
* top.c (execute_command): Use cmd_func() and cmd_func_p(). * cli/cli-decode.c (cmd_func_p): New function. (cmd_func): New function. * command.h: Add cmd_func() and cmd_func_p().
This commit is contained in:
@ -1505,3 +1505,23 @@ complete_on_enum (const char *enumlist[],
|
||||
return matchlist;
|
||||
}
|
||||
|
||||
|
||||
/* check function pointer */
|
||||
int
|
||||
cmd_func_p (struct cmd_list_element *cmd)
|
||||
{
|
||||
return (cmd->func != NULL);
|
||||
}
|
||||
|
||||
|
||||
/* call the command function */
|
||||
void
|
||||
cmd_func (struct cmd_list_element *cmd, char *args, int from_tty)
|
||||
{
|
||||
if (cmd_func_p (cmd))
|
||||
(*cmd->func) (cmd, args, from_tty);
|
||||
else
|
||||
error ("Invalid command");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user