From: Andre Noll Date: Mon, 28 Mar 2016 03:51:23 +0000 (+0000) Subject: play: Convert com_tasks() to lopsub. X-Git-Tag: v0.6.0~2^2~40 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=f3dc51fae7365722ccbefd737eac293e12feb94a;p=paraslash.git play: Convert com_tasks() to lopsub. Nothing to see here: only the usual changes to the command handler, and no changes to the help text. --- diff --git a/m4/lls/play_cmd.suite.m4 b/m4/lls/play_cmd.suite.m4 index d0d82f15..1f54f2af 100644 --- a/m4/lls/play_cmd.suite.m4 +++ b/m4/lls/play_cmd.suite.m4 @@ -77,3 +77,9 @@ caption = list of commands When paused, it is still possible to jump around in the file via the jmp and ff commands. [/description] + +[subcommand tasks] + purpose = print list of active tasks + [description] + Mainly useful for debugging. + [/description] diff --git a/play.c b/play.c index cab2504d..e608c6cb 100644 --- a/play.c +++ b/play.c @@ -819,15 +819,13 @@ static void list_file(struct play_task *pt, int num) btr_add_output(buf, sz, pt->btrn); } -static int com_tasks(struct play_task *pt, int argc, __a_unused char **argv) +static int com_tasks(struct play_task *pt, + __a_unused struct lls_parse_result *lpr) { static char state; char *buf; size_t sz; - if (argc != 1) - return -E_PLAY_SYNTAX; - buf = get_task_list(&sched); btr_add_output(buf, strlen(buf), pt->btrn); state = get_playback_state(pt); @@ -835,6 +833,7 @@ static int com_tasks(struct play_task *pt, int argc, __a_unused char **argv) btr_add_output(buf, sz, pt->btrn); return 0; } +EXPORT_PLAY_CMD_HANDLER(tasks); static int com_ls(struct play_task *pt, __a_unused struct lls_parse_result *lpr) diff --git a/play.cmd b/play.cmd index 2d1999aa..c0e8d7f1 100644 --- a/play.cmd +++ b/play.cmd @@ -2,11 +2,6 @@ BN: play SF: play.c SN: list of commands --- -N: tasks -D: Print list of active tasks. -U: tasks -H: Mainly useful for debugging. ---- N: quit D: Exit para_play. U: quit