X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhelper%2Fcommand.c;h=8b7be702421338fff62d836d4983f3d4db734df2;hp=ed0a82e6218946c51a6b683a1604f4be20136a42;hb=655e4f88a6b7fd82a570a17cf1219356f4587a37;hpb=71460ba9a59503bdf7780962b93143021d423958 diff --git a/src/helper/command.c b/src/helper/command.c index ed0a82e621..8b7be70242 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -305,6 +305,13 @@ int parse_line(char *line, char *words[], int max_words) return nwords; } +void command_output_text(command_context_t *context, const char *data) +{ + if( context && context->output_handler && data ){ + context->output_handler( context, data ); + } +} + void command_print_n(command_context_t *context, char *format, ...) { char *string; @@ -621,7 +628,7 @@ int command_print_help(command_context_t* context, char* name, char** args, int return command_print_help_match(context, context->commands, name, args, argc); } -void command_set_output_handler(command_context_t* context, int (*output_handler)(struct command_context_s *context, char* line), void *priv) +void command_set_output_handler(command_context_t* context, int (*output_handler)(struct command_context_s *context, const char* line), void *priv) { context->output_handler = output_handler; context->output_handler_priv = priv;