tag: don't pass "fd" to printVisitedInTagTracker()
Pass the client struct instead of the raw file descriptor.
This commit is contained in:
@@ -335,7 +335,7 @@ int listAllUniqueTags(struct client *client, int type, int numConditionals,
|
|||||||
&data);
|
&data);
|
||||||
|
|
||||||
if (type >= 0 && type <= TAG_NUM_OF_ITEM_TYPES) {
|
if (type >= 0 && type <= TAG_NUM_OF_ITEM_TYPES) {
|
||||||
printVisitedInTagTracker(client_get_fd(client), type);
|
printVisitedInTagTracker(client, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
freeListCommandItem(item);
|
freeListCommandItem(item);
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "myfprintf.h"
|
#include "client.h"
|
||||||
#include "directory.h"
|
#include "directory.h"
|
||||||
|
|
||||||
struct visited {
|
struct visited {
|
||||||
@@ -106,13 +106,12 @@ void visitInTagTracker(int type, const char *str)
|
|||||||
++num_visited[type];
|
++num_visited[type];
|
||||||
}
|
}
|
||||||
|
|
||||||
void printVisitedInTagTracker(int fd, int type)
|
void printVisitedInTagTracker(struct client *client, int type)
|
||||||
{
|
{
|
||||||
struct visited *v;
|
struct visited *v;
|
||||||
|
|
||||||
for (v = visited_heads[type]; v != NULL; v = v->next)
|
for (v = visited_heads[type]; v != NULL; v = v->next)
|
||||||
fdprintf(fd,
|
client_printf(client, "%s: %s\n",
|
||||||
"%s: %s\n",
|
|
||||||
mpdTagItemKeys[type],
|
mpdTagItemKeys[type],
|
||||||
v->value);
|
v->value);
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
#ifndef TAG_TRACKER_H
|
#ifndef TAG_TRACKER_H
|
||||||
#define TAG_TRACKER_H
|
#define TAG_TRACKER_H
|
||||||
|
|
||||||
|
struct client;
|
||||||
|
|
||||||
int getNumberOfTagItems(int type);
|
int getNumberOfTagItems(int type);
|
||||||
|
|
||||||
void printMemorySavedByTagTracker(void);
|
void printMemorySavedByTagTracker(void);
|
||||||
@@ -27,6 +29,6 @@ void resetVisitedFlagsInTagTracker(int type);
|
|||||||
|
|
||||||
void visitInTagTracker(int type, const char *str);
|
void visitInTagTracker(int type, const char *str);
|
||||||
|
|
||||||
void printVisitedInTagTracker(int fd, int type);
|
void printVisitedInTagTracker(struct client *client, int type);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user