+/**
+ * the task for handling audiod commands
+ *
+ * \sa struct task, struct sched
+ */
+struct command_task {
+ /** the local listening socket */
+ int fd;
+ /** the associated task structure */
+ struct task task;
+};
+
+/**
+ * the task for audiod's child (para_client stat)
+ *
+ * \sa struct task, struct sched
+ */
+struct status_task {
+ /** the output of the stat command is read from this fd */
+ int fd;
+ /** stat data is stored here */
+ char buf[STRINGSIZE];
+ /** number of bytes loaded in \a buf */
+ unsigned loaded;
+ /** the associated task structure */
+ struct task task;
+};
+static struct status_task status_task_struct, *stat_task = &status_task_struct;
+
+struct signal_task {
+ int fd;
+ int signum;
+ struct task task;
+};
+
+/** defines one command of para_audiod */
+struct audiod_command {
+ /** the name of the command */
+ const char *name;
+ /** pointer to the function that handles the command */
+ int (*handler)(int, int, char**);
+ /**
+ * if the command prefers to handle the full line (rather than the usual
+ * argv[] array), it stores a pointer to the corresponding line handling
+ * function here. In this case, the above \a handler pointer must be NULL.
+ */
+ int (*line_handler)(int, char*);
+ /** one-line description of the command */
+ const char *description;
+ /** summary of the command line options */
+ const char *synopsis;
+ /** the long help text */
+ const char *help;
+};
+static int com_grab(int, char *);
+static int com_cycle(int, int, char **);
+static int com_help(int, int, char **);
+static int com_off(int, int, char **);
+static int com_on(int, int, char **);
+static int com_sb(int, int, char **);
+static int com_stat(int, int, char **);
+static int com_term(int, int, char **);