play: Convert com_tasks() to lopsub.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 28 Mar 2016 03:51:23 +0000 (03:51 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 09:02:28 +0000 (11:02 +0200)
Nothing to see here: only the usual changes to the command handler,
and no changes to the help text.

m4/lls/play_cmd.suite.m4
play.c
play.cmd

index d0d82f1..1f54f2a 100644 (file)
@@ -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 cab2504..e608c6c 100644 (file)
--- 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)
index 2d1999a..c0e8d7f 100644 (file)
--- 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