diff options
author | Max Kellermann <max@duempel.org> | 2008-10-08 10:49:05 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-11 19:21:47 -0700 |
commit | c84c73df00e5e1710d84fdb4be6352d849da8f2b (patch) | |
tree | 36cb3f7a94333ccc730e11d9f213761bc630cf23 /src/directory.h | |
parent | b5d3970c075987d7439e2b60ea043606f46a3bab (diff) | |
download | mpd-c84c73df00e5e1710d84fdb4be6352d849da8f2b.tar.gz mpd-c84c73df00e5e1710d84fdb4be6352d849da8f2b.tar.xz mpd-c84c73df00e5e1710d84fdb4be6352d849da8f2b.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.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/directory.h b/src/directory.h index 552bbe28e..d604800e8 100644 --- a/src/directory.h +++ b/src/directory.h @@ -23,19 +23,19 @@ #include "songvec.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); @@ -43,20 +43,20 @@ void directory_finish(void); int isRootDirectory(const char *name); -Directory * directory_get_root(void); +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); +void freeDirectory(struct directory *directory); -static inline int directory_is_empty(Directory *directory) +static inline int directory_is_empty(struct directory *directory) { return directory->children.nr == 0 && directory->songs.nr == 0; } -Directory * getDirectory(const char *name); +struct directory * getDirectory(const char *name); -void sortDirectory(Directory * directory); +void sortDirectory(struct directory * directory); int printDirectoryInfo(int fd, const char *dirname); @@ -72,7 +72,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 : "") |