From 4665f2bf32c59f263d22c2315d60509c9ae8854b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 7 Sep 2008 13:57:58 +0200 Subject: tag: don't pass "fd" to printVisitedInTagTracker() Pass the client struct instead of the raw file descriptor. --- src/dbUtils.c | 2 +- src/tagTracker.c | 11 +++++------ src/tagTracker.h | 4 +++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/dbUtils.c b/src/dbUtils.c index ba60dc485..9eb6aa46b 100644 --- a/src/dbUtils.c +++ b/src/dbUtils.c @@ -335,7 +335,7 @@ int listAllUniqueTags(struct client *client, int type, int numConditionals, &data); if (type >= 0 && type <= TAG_NUM_OF_ITEM_TYPES) { - printVisitedInTagTracker(client_get_fd(client), type); + printVisitedInTagTracker(client, type); } freeListCommandItem(item); diff --git a/src/tagTracker.c b/src/tagTracker.c index 13fba77c9..bc9a43bc7 100644 --- a/src/tagTracker.c +++ b/src/tagTracker.c @@ -20,7 +20,7 @@ #include "tag.h" #include "utils.h" -#include "myfprintf.h" +#include "client.h" #include "directory.h" struct visited { @@ -106,13 +106,12 @@ void visitInTagTracker(int type, const char *str) ++num_visited[type]; } -void printVisitedInTagTracker(int fd, int type) +void printVisitedInTagTracker(struct client *client, int type) { struct visited *v; for (v = visited_heads[type]; v != NULL; v = v->next) - fdprintf(fd, - "%s: %s\n", - mpdTagItemKeys[type], - v->value); + client_printf(client, "%s: %s\n", + mpdTagItemKeys[type], + v->value); } diff --git a/src/tagTracker.h b/src/tagTracker.h index 2edb5aad0..f3c778329 100644 --- a/src/tagTracker.h +++ b/src/tagTracker.h @@ -19,6 +19,8 @@ #ifndef TAG_TRACKER_H #define TAG_TRACKER_H +struct client; + int getNumberOfTagItems(int type); void printMemorySavedByTagTracker(void); @@ -27,6 +29,6 @@ void resetVisitedFlagsInTagTracker(int type); void visitInTagTracker(int type, const char *str); -void printVisitedInTagTracker(int fd, int type); +void printVisitedInTagTracker(struct client *client, int type); #endif -- cgit v1.2.3