projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fsck.c: Improve log messages.
[paraslash.git]
/
gui_common.c
diff --git
a/gui_common.c
b/gui_common.c
index 87676986719c326340d1612ec85763349d2225be..6bd54081ba1fbd5f45d0249419e9ec752c04041e 100644
(file)
--- a/
gui_common.c
+++ b/
gui_common.c
@@
-1,8
+1,18
@@
-#include "para.h"
-#include "fd.h"
+/*
+ * Copyright (C) 2006-2007 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. */
-extern const char *status_item_list[NUM_STAT_ITEMS];
+#include <sys/types.h>
+#include <dirent.h>
+
+#include "para.h"
+#include "string.h"
+#include "fd.h"
int para_open_audiod_pipe(char *cmd)
{
int para_open_audiod_pipe(char *cmd)
{
@@
-11,16
+21,16
@@
int para_open_audiod_pipe(char *cmd)
int ret = para_exec_cmdline_pid(&pid, cmd, fds);
if (ret < 0)
return ret;
int ret = para_exec_cmdline_pid(&pid, cmd, fds);
if (ret < 0)
return ret;
- ret = mark_fd_nonblock(fds[1]);
+ ret = mark_fd_nonblock
ing
(fds[1]);
if (ret > 0)
return fds[1];
close(fds[1]);
return ret;
}
if (ret > 0)
return fds[1];
close(fds[1]);
return ret;
}
-int read_audiod_pipe(int fd,
void (*line_handler)(char *)
)
+int read_audiod_pipe(int fd,
line_handler_t *line_handler
)
{
{
- static char buf[
STRINGSIZE
];
+ static char buf[
4096
];
const ssize_t bufsize = sizeof(buf) - 1;
static ssize_t loaded;
ssize_t ret;
const ssize_t bufsize = sizeof(buf) - 1;
static ssize_t loaded;
ssize_t ret;
@@
-31,7
+41,7
@@
int read_audiod_pipe(int fd, void (*line_handler)(char *) )
if (ret > 0) {
loaded += ret;
buf[loaded] = '\0';
if (ret > 0) {
loaded += ret;
buf[loaded] = '\0';
- loaded = for_each_line(buf, loaded, line_handler);
+ loaded = for_each_line(buf, loaded, line_handler
, NULL
);
}
return ret;
}
}
return ret;
}