audio_format_name(): Add an assert().
[paraslash.git] / gui_common.c
index 87676986719c326340d1612ec85763349d2225be..6ca226e6e0d468e953f3e1aac6cab52364f94ffb 100644 (file)
@@ -1,9 +1,9 @@
 #include "para.h"
+#include "string.h"
 #include "fd.h"
 
 extern const char *status_item_list[NUM_STAT_ITEMS];
 
-
 int para_open_audiod_pipe(char *cmd)
 {
        int fds[3] = {0, 1, 0};
@@ -18,9 +18,9 @@ int para_open_audiod_pipe(char *cmd)
        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;
@@ -31,7 +31,7 @@ int read_audiod_pipe(int fd, void (*line_handler)(char *) )
        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;
 }