X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui_common.c;h=607a88e81c62e80c880bd54258a0f3084c9dc1d8;hp=87676986719c326340d1612ec85763349d2225be;hb=f491dc59b5eee838165b60e7815a06139fed7f74;hpb=75529c7cb29903302931db92f04cb3b510eb6317 diff --git a/gui_common.c b/gui_common.c index 87676986..607a88e8 100644 --- a/gui_common.c +++ b/gui_common.c @@ -1,8 +1,18 @@ -#include "para.h" -#include "fd.h" +/* + * Copyright (C) 2006-2007 Andre Noll + * + * 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 +#include + +#include "para.h" +#include "string.h" +#include "fd.h" int para_open_audiod_pipe(char *cmd) { @@ -18,9 +28,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 +41,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; }