aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 11:07:35 +0200
committerMax Kellermann <max@duempel.org>2008-10-08 11:07:35 +0200
commit8a50e8a2663b5afd2fb3c80ea3424f3e68e14695 (patch)
treed20a5c381a452386cee06ed5ab16d4b4124f9071 /src/directory.h
parentba5c9b0375b84456553b9b57cb68cb204c1d9418 (diff)
downloadmpd-8a50e8a2663b5afd2fb3c80ea3424f3e68e14695.tar.gz
mpd-8a50e8a2663b5afd2fb3c80ea3424f3e68e14695.tar.xz
mpd-8a50e8a2663b5afd2fb3c80ea3424f3e68e14695.zip
directory: moved code to database.c
Taming the directory.c monster, part II: move the database management stuff to database. directory.c should only contain code which works on directory objects.
Diffstat (limited to '')
-rw-r--r--src/directory.h49
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 : "")