I9E_DUMMY_COMPLETER(stop);
I9E_DUMMY_COMPLETER(addatt);
I9E_DUMMY_COMPLETER(init);
+I9E_DUMMY_COMPLETER(tasks);
static struct i9e_completer completers[];
return ret;
}
+static int com_tasks(struct command_context *cc)
+{
+ char *tl = server_get_tasks();
+ int ret = 1;
+
+ if (tl)
+ ret = send_sb(&cc->scc, tl, strlen(tl), SBD_OUTPUT, false);
+ return ret;
+}
+
/*
* check if perms are sufficient to exec a command having perms cmd_perms.
* Returns 0 if perms are sufficient, -E_PERM otherwise.
struct task *task;
};
+/**
+ * Return the list of tasks for the server process.
+ *
+ * This is called from \a com_tasks(). The helper is necessary since command
+ * handlers can not access the scheduler structure directly.
+ *
+ * \return A dynamically allocated string that must be freed by the caller.
+ */
+char *server_get_tasks(void)
+{
+ return get_task_list(&sched);
+}
+
static int want_colors(void)
{
if (conf.color_arg == color_arg_no)
H: Clear the 'P' (playing) bit and set the 'N' (next audio file) bit of the vss
H: status flags, effectively stopping playback.
---
+N: tasks
+P: 0
+D: List server tasks.
+U: tasks
+H: For each task, print ID, status and name.
+---
N: term
P: VSS_READ | VSS_WRITE
D: Ask the server to terminate.
__noreturn void handle_connect(int fd, const char *peername);
void parse_config_or_die(int override);
+char *server_get_tasks(void);