aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/directory.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/directory.c b/src/directory.c
index 60bcf8ff8..2842ffa78 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -53,7 +53,7 @@ enum update_progress {
UPDATE_PROGRESS_DONE = 2
} progress;
-static Directory *mp3rootDirectory;
+static Directory *music_root;
static time_t directory_dbModTime;
@@ -138,7 +138,7 @@ static void * update_task(void *arg)
}
freeList(path_list);
} else {
- ret = updateDirectory(mp3rootDirectory);
+ ret = updateDirectory(music_root);
}
if (ret == UPDATE_RETURN_UPDATED && writeDirectoryDB() < 0)
@@ -315,7 +315,7 @@ static Directory *addDirectoryPathToDB(const char *utf8path)
parent = parent_path(path_max_tmp, utf8path);
if (strlen(parent) == 0)
- parentDirectory = (void *)mp3rootDirectory;
+ parentDirectory = music_root;
else
parentDirectory = addDirectoryPathToDB(parent);
@@ -351,7 +351,7 @@ static Directory *addParentPathToDB(const char *utf8path)
parent = parent_path(path_max_tmp, utf8path);
if (strlen(parent) == 0)
- parentDirectory = (void *)mp3rootDirectory;
+ parentDirectory = music_root;
else
parentDirectory = addDirectoryPathToDB(parent);
@@ -386,7 +386,7 @@ static enum update_return updatePath(const char *utf8path)
return ret;
}
/* we don't want to delete the root directory */
- else if (directory == mp3rootDirectory) {
+ else if (directory == music_root) {
free(path);
return UPDATE_RETURN_NOUPDATE;
}
@@ -618,9 +618,9 @@ addToDirectory(Directory * directory, const char *name)
return UPDATE_RETURN_ERROR;
}
-void closeMp3Directory(void)
+void directory_finish(void)
{
- freeDirectory(mp3rootDirectory);
+ freeDirectory(music_root);
}
int isRootDirectory(const char *name)
@@ -663,7 +663,7 @@ static Directory *getSubDirectory(Directory * directory, const char *name)
static Directory *getDirectory(const char *name)
{
- return getSubDirectory(mp3rootDirectory, name);
+ return getSubDirectory(music_root, name);
}
static int printDirectoryList(struct client *client, struct dirvec *dv)
@@ -844,11 +844,11 @@ int writeDirectoryDB(void)
struct stat st;
DEBUG("removing empty directories from DB\n");
- deleteEmptyDirectoriesInDirectory(mp3rootDirectory);
+ deleteEmptyDirectoriesInDirectory(music_root);
DEBUG("sorting DB\n");
- sortDirectory(mp3rootDirectory);
+ sortDirectory(music_root);
DEBUG("writing DB\n");
@@ -865,7 +865,7 @@ int writeDirectoryDB(void)
fprintf(fp, "%s%s\n", DIRECTORY_FS_CHARSET, getFsCharset());
fprintf(fp, "%s\n", DIRECTORY_INFO_END);
- writeDirectoryInfo(fp, mp3rootDirectory);
+ writeDirectoryInfo(fp, music_root);
while (fclose(fp) && errno == EINTR);
@@ -881,8 +881,8 @@ int readDirectoryDB(void)
char *dbFile = getDbFile();
struct stat st;
- if (!mp3rootDirectory)
- mp3rootDirectory = newDirectory(NULL, NULL);
+ if (!music_root)
+ music_root = newDirectory(NULL, NULL);
while (!(fp = fopen(dbFile, "r")) && errno == EINTR) ;
if (fp == NULL) {
ERROR("unable to open db file \"%s\": %s\n",
@@ -943,7 +943,7 @@ int readDirectoryDB(void)
DEBUG("reading DB\n");
- readDirectoryInfo(fp, mp3rootDirectory);
+ readDirectoryInfo(fp, music_root);
while (fclose(fp) && errno == EINTR) ;
stats.numberOfSongs = countSongsIn(NULL);
@@ -1007,10 +1007,10 @@ int traverseAllIn(const char *name,
data);
}
-void initMp3Directory(void)
+void directory_init(void)
{
- mp3rootDirectory = newDirectory(NULL, NULL);
- exploreDirectory(mp3rootDirectory);
+ music_root = newDirectory(NULL, NULL);
+ exploreDirectory(music_root);
stats.numberOfSongs = countSongsIn(NULL);
stats.dbPlayTime = sumSongTimesIn(NULL);
}