ap

An audio player suited to my tastes
Log | Files | Refs | README | LICENSE

commit 52fd4d193fb855b4bacc2f68c63f37aa8518c679
parent 0c3ec4fa19388221f7faf0de390586abdca53114
Author: Jacob R. Edwards <n/a>
Date:   Sun, 20 Feb 2022 22:19:39 -0800

Add terminate command to aps

This command tells the server to shutdown.

Diffstat:
Maps/command.c | 7+++++++
Maps/command.h | 1+
Maps/main.c | 1+
3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/aps/command.c b/aps/command.c @@ -256,3 +256,10 @@ com_truncate(struct aps *aps, int fd, int argc, char **argv) queue_remove(aps, aps->queue); return com_add(aps, fd, argc, argv); } + +char * +com_terminate(struct aps *aps, int fd, int argc, char **argv) +{ + aps->close = 1; + return NULL; +} diff --git a/aps/command.h b/aps/command.h @@ -18,3 +18,4 @@ char *com_status(struct aps *, int, int, char **); char *com_log(struct aps *, int, int, char **); char *com_player(struct aps *, int, int, char **); char *com_truncate(struct aps *, int, int, char **); +char *com_terminate(struct aps *, int, int, char **); diff --git a/aps/main.c b/aps/main.c @@ -52,6 +52,7 @@ static struct command commands[] = { { "seek", com_seek }, { "status", com_status }, { "stop", com_stop }, + { "terminate", com_terminate }, { "toggle", com_toggle }, { "truncate", com_truncate } };