aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 10:49:05 +0200
committerMax Kellermann <max@duempel.org>2008-10-08 10:49:05 +0200
commit25f67da58c671885c86ecfd991f28ec82b6ce1e2 (patch)
tree7da9638ff323573d2aa53e70337866f8935114a0 /src/directory.h
parent3c1142cbcbd428ac5784ef098ac5e7a393647aa6 (diff)
downloadmpd-25f67da58c671885c86ecfd991f28ec82b6ce1e2.tar.gz
mpd-25f67da58c671885c86ecfd991f28ec82b6ce1e2.tar.xz
mpd-25f67da58c671885c86ecfd991f28ec82b6ce1e2.zip
directory: converted typedef Directory to struct directory
The struct can be forward-declared by other headers, which relaxes the header dependencies.
Diffstat (limited to '')
-rw-r--r--src/directory.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/directory.h b/src/directory.h
index e197600d1..f33d854c6 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -26,19 +26,19 @@
#include <stdbool.h>
struct dirvec {
- struct _Directory **base;
+ struct directory **base;
size_t nr;
};
-typedef struct _Directory {
+struct directory {
char *path;
struct dirvec children;
struct songvec songs;
- struct _Directory *parent;
+ struct directory *parent;
ino_t inode;
dev_t device;
unsigned stat; /* not needed if ino_t == dev_t == 0 is impossible */
-} Directory;
+};
void directory_init(void);
@@ -46,26 +46,26 @@ void directory_finish(void);
int isRootDirectory(const char *name);
-Directory *
+struct directory *
directory_get_root(void);
-Directory *
-newDirectory(const char *dirname, Directory * parent);
+struct directory *
+newDirectory(const char *dirname, struct directory * parent);
void
-freeDirectory(Directory * directory);
+freeDirectory(struct directory * directory);
static inline bool
-directory_is_empty(Directory *directory)
+directory_is_empty(struct directory *directory)
{
return directory->children.nr == 0 && directory->songs.nr == 0;
}
-Directory *
+struct directory *
getDirectory(const char *name);
void
-sortDirectory(Directory * directory);
+sortDirectory(struct directory * directory);
int printDirectoryInfo(struct client *client, const char *dirname);
@@ -81,7 +81,7 @@ time_t getDbModTime(void);
int traverseAllIn(const char *name,
int (*forEachSong) (Song *, void *),
- int (*forEachDir) (Directory *, void *), void *data);
+ int (*forEachDir) (struct directory *, void *), void *data);
#define getDirectoryPath(dir) ((dir && dir->path) ? dir->path : "")