use COMMAND_HANDLER macro to define all commands
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user