diff options
Diffstat (limited to 'src/directory.h')
-rw-r--r-- | src/directory.h | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/src/directory.h b/src/directory.h index 554b77513..90f84f9b6 100644 --- a/src/directory.h +++ b/src/directory.h @@ -23,8 +23,18 @@ #include "list.h" #include <stdbool.h> +#include <stdio.h> #include <sys/stat.h> +#define DIRECTORY_DIR "directory: " +#define DIRECTORY_MTIME "mtime: " /* DEPRECATED, noop-read-only */ +#define DIRECTORY_BEGIN "begin: " +#define DIRECTORY_END "end: " +#define DIRECTORY_INFO_BEGIN "info_begin" +#define DIRECTORY_INFO_END "info_end" +#define DIRECTORY_MPD_VERSION "mpd_version: " +#define DIRECTORY_FS_CHARSET "fs_charset: " + struct client; struct dirvec { @@ -42,10 +52,6 @@ struct directory { unsigned stat; /* not needed if ino_t == dev_t == 0 is impossible */ }; -void directory_init(void); - -void directory_finish(void); - static inline bool isRootDirectory(const char *name) { @@ -53,9 +59,6 @@ isRootDirectory(const char *name) } struct directory * -directory_get_root(void); - -struct directory * newDirectory(const char *dirname, struct directory * parent); void @@ -67,28 +70,28 @@ directory_is_empty(struct directory *directory) return directory->children.nr == 0 && directory->songs.nr == 0; } -struct directory * -getDirectory(const char *name); - void -sortDirectory(struct directory * directory); - -int printDirectoryInfo(struct client *client, const char *dirname); +deleteEmptyDirectoriesInDirectory(struct directory *directory); -int checkDirectoryDB(void); - -int writeDirectoryDB(void); +struct directory * +getSubDirectory(struct directory *directory, const char *name); -int readDirectoryDB(void); +int +directory_print(struct client *client, const struct directory *directory); -struct song * -getSongFromDB(const char *file); +int +writeDirectoryInfo(FILE *fp, struct directory *directory); -time_t getDbModTime(void); +void +readDirectoryInfo(FILE *fp, struct directory *directory); -int traverseAllIn(const char *name, - int (*forEachSong) (struct song *, void *), - int (*forEachDir) (struct directory *, void *), void *data); +void +sortDirectory(struct directory * directory); +int +traverseAllInSubDirectory(struct directory * directory, + int (*forEachSong) (struct song *, void *), + int (*forEachDir) (struct directory *, void *), + void *data); #define getDirectoryPath(dir) ((dir && dir->path) ? dir->path : "") |