]> git.tue.mpg.de Git - paraslash.git/commitdiff
play: Convert com_quit() to lopsub.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 28 Mar 2016 03:52:25 +0000 (03:52 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 09:02:28 +0000 (11:02 +0200)
This converts the last subcommand of para_play. Cleanups are done in
subsequent patches although the declarations of the command handlers
are removed here because they have become unused and triggered
compiler warnings.

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

diff --git a/error.h b/error.h
index a4038d5c127c177cd2a7a3622e4b84cd942f4da3..a4d79aba5573e348d88d7bf6bd11ee961555afa1 100644 (file)
--- a/error.h
+++ b/error.h
        PARA_ERROR(PERM, "permission denied"), \
        PARA_ERROR(PLAYLIST_EMPTY, "attempted to load empty playlist"), \
        PARA_ERROR(PLAYLIST_LOADED, ""), /* not really an error */ \
-       PARA_ERROR(PLAY_SYNTAX, "para_play: syntax error"), \
        PARA_ERROR(PREBUFFER_SUCCESS, "prebuffering complete"), \
        PARA_ERROR(PRIVATE_KEY, "can not read private key"), \
        PARA_ERROR(PUBLIC_KEY, "can not read public key"), \
index 1f54f2af0c3abb702d03bacb1175f12311b0077a..195b47b967bb7685b03ed00230358b164c6fcace 100644 (file)
@@ -83,3 +83,10 @@ caption = list of commands
        [description]
                Mainly useful for debugging.
        [/description]
+
+[subcommand quit]
+       purpose = exit para_play
+       [description]
+               Pressing CTRL+D causes EOF on stdin which also exits
+               para_play.
+       [/description]
diff --git a/play.c b/play.c
index e608c6cb4364d9da3135fa08b0f6d95d39314cc3..c6a785980e93be6cd9fa558ee70dc0b5dfb4e65f 100644 (file)
--- a/play.c
+++ b/play.c
@@ -668,7 +668,6 @@ static char **get_mapped_keyseqs(void)
 #include "play.command_list.h"
 
 typedef int play_command_handler_t(struct play_task *, int, char**);
-static play_command_handler_t PLAY_COMMAND_HANDLERS;
 
 /* defines one command of para_play */
 struct pp_command {
@@ -727,13 +726,13 @@ static void detach_stdout(struct play_task *pt)
        btr_remove_node(&pt->btrn);
 }
 
-static int com_quit(struct play_task *pt, int argc, __a_unused char **argv)
+static int com_quit(struct play_task *pt,
+               __a_unused struct lls_parse_result *lpr)
 {
-       if (argc != 1)
-               return -E_PLAY_SYNTAX;
        pt->rq = CRT_TERM_RQ;
        return 0;
 }
+EXPORT_PLAY_CMD_HANDLER(quit);
 
 static int com_help(struct play_task *pt, struct lls_parse_result *lpr)
 {
index c0e8d7f13637ea3d100efbbe07dfb4cb3366df38..8cdc9b0891a436ea6cc5dcce42379eb0922d66bb 100644 (file)
--- a/play.cmd
+++ b/play.cmd
@@ -1,8 +1,3 @@
 BN: play
 SF: play.c
 SN: list of commands
----
-N: quit
-D: Exit para_play.
-U: quit
-H: Pressing CTRL+D causes EOF on stdin which also exits para_play.