aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 11:07:58 +0200
committerEric Wong <normalperson@yhbt.net>2008-10-11 19:21:48 -0700
commita76121ea81f452c0d5e21d6a2fb6f200a80faf7b (patch)
treee59b04f16d56532284747f99fb5631cfd6b24c70 /src/database.c
parent4629f646077109f7c6185aab92560da52c237412 (diff)
downloadmpd-a76121ea81f452c0d5e21d6a2fb6f200a80faf7b.tar.gz
mpd-a76121ea81f452c0d5e21d6a2fb6f200a80faf7b.tar.xz
mpd-a76121ea81f452c0d5e21d6a2fb6f200a80faf7b.zip
directory: eliminate CamelCase
CamelCase is ugly, rename the functions. [ew: "directory_get_directory" was too confusing, using "directory_get_subdir" instead (old function was named "getSubDirectory")]
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/database.c b/src/database.c
index bb6cfcd52..98e50ad87 100644
--- a/src/database.c
+++ b/src/database.c
@@ -37,7 +37,7 @@ static time_t directory_dbModTime;
void db_init(void)
{
- music_root = newDirectory(NULL, NULL);
+ music_root = directory_new(NULL, NULL);
updateDirectory(music_root);
stats.numberOfSongs = countSongsIn(NULL);
stats.dbPlayTime = sumSongTimesIn(NULL);
@@ -45,7 +45,7 @@ void db_init(void)
void db_finish(void)
{
- freeDirectory(music_root);
+ directory_free(music_root);
}
struct directory * db_get_root(void)
@@ -60,7 +60,7 @@ struct directory * db_get_directory(const char *name)
if (name == NULL)
return music_root;
- return getSubDirectory(music_root, name);
+ return directory_get_subdir(music_root, name);
}
struct mpd_song *db_get_song(const char *file)
@@ -106,7 +106,7 @@ int db_walk(const char *name,
return -1;
}
- return traverseAllInSubDirectory(directory, forEachSong, forEachDir,
+ return directory_walk(directory, forEachSong, forEachDir,
data);
}
@@ -187,11 +187,11 @@ int db_save(void)
struct stat st;
DEBUG("removing empty directories from DB\n");
- deleteEmptyDirectoriesInDirectory(music_root);
+ directory_prune_empty(music_root);
DEBUG("sorting DB\n");
- sortDirectory(music_root);
+ directory_sort(music_root);
DEBUG("writing DB\n");
@@ -212,7 +212,7 @@ int db_save(void)
DIRECTORY_FS_CHARSET "%s\n"
DIRECTORY_INFO_END "\n", getFsCharset());
- if (writeDirectoryInfo(fd, music_root) < 0) {
+ if (directory_save(fd, music_root) < 0) {
ERROR("Failed to write to database file: %s\n",
strerror(errno));
xclose(fd);
@@ -233,7 +233,7 @@ int db_load(void)
struct stat st;
if (!music_root)
- music_root = newDirectory(NULL, NULL);
+ music_root = directory_new(NULL, NULL);
while (!(fp = fopen(dbFile, "r")) && errno == EINTR) ;
if (fp == NULL) {
ERROR("unable to open db file \"%s\": %s\n",
@@ -294,7 +294,7 @@ int db_load(void)
DEBUG("reading DB\n");
- readDirectoryInfo(fp, music_root);
+ directory_load(fp, music_root);
while (fclose(fp) && errno == EINTR) ;
stats.numberOfSongs = countSongsIn(NULL);