gui_cmdline_objs="gui.cmdline"
gui_errlist_objs="exec close_on_fork signal string stat ringbuffer fd"
-gui_other_objs="gui gui_common gui_theme"
+gui_other_objs="gui gui_theme"
gui_objs="$gui_cmdline_objs $gui_errlist_objs $gui_other_objs"
########################################################################### ssl
* Licensed under the GPL v2. For licencing details see COPYING.
*/
-/** \file gui.c ncurses-based interface for paraslash */
+/** \file gui.c Curses-based interface for paraslash. */
#include <signal.h>
#include <sys/types.h>
#include "gui.cmdline.h"
#include "para.h"
#include "gui.h"
+#include "string.h"
#include <curses.h>
#include "ringbuffer.h"
-#include "gui_common.h"
#include "fd.h"
#include "error.h"
#include "list.h"
static int signal_pipe;
-static void finish(int sig);
-
static struct win_data {
WINDOW *win;
NCURSES_SIZE_T begx;
}
};
+static int para_open_audiod_pipe(char *cmd)
+{
+ int fds[3] = {0, 1, 0};
+ pid_t pid;
+ int ret = para_exec_cmdline_pid(&pid, cmd, fds);
+ if (ret < 0)
+ return ret;
+ ret = mark_fd_nonblocking(fds[1]);
+ if (ret > 0)
+ return fds[1];
+ close(fds[1]);
+ return ret;
+}
+
+static int read_audiod_pipe(int fd, line_handler_t *line_handler)
+{
+ static char buf[4096];
+ const ssize_t bufsize = sizeof(buf) - 1;
+ static ssize_t loaded;
+ ssize_t ret;
+
+ if (loaded >= bufsize)
+ loaded = 0;
+ ret = read(fd, buf + loaded, bufsize - loaded);
+ if (ret > 0) {
+ loaded += ret;
+ buf[loaded] = '\0';
+ loaded = for_each_line(buf, loaded, line_handler, NULL);
+ }
+ return ret;
+}
+
static int find_cmd_byname(char *name)
{
int i;
+++ /dev/null
-/*
- * Copyright (C) 2006-2008 Andre Noll <maan@systemlinux.org>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
-
-/** \file gui_common.c Functions used by the guis of paraslash. */
-
-
-#include <sys/types.h>
-#include <dirent.h>
-
-#include "para.h"
-#include "string.h"
-#include "fd.h"
-
-int para_open_audiod_pipe(char *cmd)
-{
- int fds[3] = {0, 1, 0};
- pid_t pid;
- int ret = para_exec_cmdline_pid(&pid, cmd, fds);
- if (ret < 0)
- return ret;
- ret = mark_fd_nonblocking(fds[1]);
- if (ret > 0)
- return fds[1];
- close(fds[1]);
- return ret;
-}
-
-int read_audiod_pipe(int fd, line_handler_t *line_handler)
-{
- static char buf[4096];
- const ssize_t bufsize = sizeof(buf) - 1;
- static ssize_t loaded;
- ssize_t ret;
-
- if (loaded >= bufsize)
- loaded = 0;
- ret = read(fd, buf + loaded, bufsize - loaded);
- if (ret > 0) {
- loaded += ret;
- buf[loaded] = '\0';
- loaded = for_each_line(buf, loaded, line_handler, NULL);
- }
- return ret;
-}
+++ /dev/null
-#include "string.h"
-int para_open_audiod_pipe(char *);
-int read_audiod_pipe(int fd, line_handler_t *line_handler);
-