bool needs_update;
} top, bot, sb, in, sep;
+/** How many lines of output to remember. */
#define RINGBUFFER_SIZE 512
+
struct rb_entry {
char *msg;
size_t len;
static struct gui_args_info conf;
static int loglevel;
+/** Type of the process currently being executed. */
enum exec_status {
- EXEC_IDLE, /* no command running */
- EXEC_DCMD, /* para or display command running */
- EXEC_XCMD, /* external command running */
+ EXEC_IDLE, /**< No process running. */
+ EXEC_DCMD, /**< para or display process running. */
+ EXEC_XCMD, /**< External process running. */
};
/**
int fd;
};
+/** Stdout/stderr of the executing process is read in chunks of this size. */
#define COMMAND_BUF_SIZE 32768
struct exec_task {
vfprintf(stderr, fmt, ap);
va_end(ap);
}
+/** The log function of para_gui, always set to curses_log(). */
__printf_2_3 void (*para_log)(int, const char*, ...) = curses_log;
static void shutdown_curses(void)
return schedule(&sched);
}
+/**
+ * The main function of para_gui.
+ *
+ * \param argc Usual argument count.
+ * \param argv Usual argument vector.
+ *
+ * After initialization para_gui registers the following tasks to the paraslash
+ * scheduler: status, exec, signal, input.
+ *
+ * The status task executes the para_audioc stat command to obtain the status
+ * of para_server and para_audiod, and displays this information in the top
+ * window of para_gui.
+ *
+ * The exec task is responsible for printing the output of the currently
+ * running executable to the bottom window.
+ *
+ * The signal task performs suitable actions according to any signals received.
+ * For example it refreshes all windows on terminal size changes and resets the
+ * terminal on \p SIGTERM.
+ *
+ * The input task reads single key strokes from stdin. For each key pressed, it
+ * executes the command handler associated with this key.
+ *
+ * \return \p EXIT_SUCCESS or \p EXIT_FAILURE.
+ */
int main(int argc, char *argv[])
{
gui_cmdline_parser(argc, argv, &conf); /* exits on errors */