diff options
author | Max Kellermann <max@duempel.org> | 2008-10-08 11:07:39 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-11 19:21:48 -0700 |
commit | 0576b8abf8b2fd25105f6e0190a93ddec298e9fb (patch) | |
tree | 0a83a01e7940e813843a18c7cc4fb9d23470e1ab /src | |
parent | 729523ec80f35a683c982054628cd47d2161d3d4 (diff) | |
download | mpd-0576b8abf8b2fd25105f6e0190a93ddec298e9fb.tar.gz mpd-0576b8abf8b2fd25105f6e0190a93ddec298e9fb.tar.xz mpd-0576b8abf8b2fd25105f6e0190a93ddec298e9fb.zip |
database: removed printDirectoryInfo()
The same can be achieved with directory_print(db_get_directory()).
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 5 | ||||
-rw-r--r-- | src/database.c | 9 | ||||
-rw-r--r-- | src/database.h | 2 |
3 files changed, 4 insertions, 12 deletions
diff --git a/src/command.c b/src/command.c index 4923ee5d5..7d1e2f306 100644 --- a/src/command.c +++ b/src/command.c @@ -559,15 +559,18 @@ static int handleLsInfo(int fd, mpd_unused int *permission, int argc, char *argv[]) { const char *path = ""; + const struct directory *directory; if (argc == 2) path = argv[1]; - if (printDirectoryInfo(fd, path) < 0) { + if (!(directory = getDirectory(path))) { commandError(fd, ACK_ERROR_NO_EXIST, "directory not found"); return -1; } + directory_print(fd, directory); + if (isRootDirectory(path)) return lsPlaylists(fd, path); diff --git a/src/database.c b/src/database.c index b4c73db69..c0c03f3e4 100644 --- a/src/database.c +++ b/src/database.c @@ -110,15 +110,6 @@ int traverseAllIn(const char *name, data); } -int printDirectoryInfo(int fd, const char *name) -{ - struct directory *directory; - - if ((directory = getDirectory(name)) == NULL) - return -1; - return directory_print(fd, directory); -} - static char *getDbFile(void) { ConfigParam *param = parseConfigFilePath(CONF_DB_FILE, 1); diff --git a/src/database.h b/src/database.h index e3ed64f0c..f6f320002 100644 --- a/src/database.h +++ b/src/database.h @@ -37,8 +37,6 @@ int traverseAllIn(const char *name, int (*forEachSong) (struct mpd_song *, void *), int (*forEachDir) (struct directory *, void *), void *data); -int printDirectoryInfo(int fd, const char *name); - int checkDirectoryDB(void); int writeDirectoryDB(void); |