X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=stat.c;h=4259956f6ed5724d5afac014c170a1426b2e56db;hp=7550f2d6d2f33d684be389417589efe4a75dd71c;hb=63afe815dbecded66415b041a98c5bc1b060dc95;hpb=2ed89c59f0efcd0a2763f47c7d3455663241e623 diff --git a/stat.c b/stat.c index 7550f2d6..4259956f 100644 --- a/stat.c +++ b/stat.c @@ -91,7 +91,7 @@ const char *status_item_list[NUM_STAT_ITEMS] = { [SI_CURRENT_TIME] = "current_time", [SI_AUDIOD_UPTIME] = "audiod_uptime", - [SI_DBTOOL] = "dbtool" + [SI_SELECTOR] = "dbtool" }; #define FOR_EACH_STAT_ITEM(i) for (i = 0; i < NUM_STAT_ITEMS; i++) @@ -234,18 +234,16 @@ int stat_line_valid(const char *line) * \param buf the buffer containing data seperated by newlines * \param n the number of bytes in \a buf * \param line_handler the custom function - * \param num upper bound on calls to \a line_handler * * If \a line_handler is \p NULL, return number of complete lines in buf. - * Otherwise, call \a line_handler for each complete line, but no more than \a num - * times. If \a num is zero, there is no restriction on how often \a line_handler - * may be called. The rest of the buffer (last chunk containing incomplete line - * if \a num is zero) is moved to the beginning of the buffer. + * Otherwise, call \a line_handler for each complete line. The rest of the + * buffer (last chunk containing incomplete line is moved to the beginning of + * the buffer. * * \return If line_handler is not NULL, this function returns the number * of bytes not handled to \a line_handler. */ -unsigned for_each_line(char *buf, int n, void (*line_handler)(char *), int num) +unsigned for_each_line(char *buf, int n, void (*line_handler)(char *)) { char *start = buf, *end; int i, num_lines = 0; @@ -269,8 +267,6 @@ unsigned for_each_line(char *buf, int n, void (*line_handler)(char *), int num) *end = '\0'; line_handler(start); start = ++end; - if (num && num_lines >= num) - break; } else start = ++end; }