aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-04 19:08:52 +0100
committerMax Kellermann <max@duempel.org>2009-01-04 19:08:52 +0100
commitea8ae68e6f1a686fd96530fdaf7b428e33f58ec4 (patch)
tree78752b26afcbc4807164c35721a6f99a540e93cd /src/directory.h
parent923d2c966f2b8a3582156467ad46ea8d200b30f1 (diff)
downloadmpd-ea8ae68e6f1a686fd96530fdaf7b428e33f58ec4.tar.gz
mpd-ea8ae68e6f1a686fd96530fdaf7b428e33f58ec4.tar.xz
mpd-ea8ae68e6f1a686fd96530fdaf7b428e33f58ec4.zip
directory: added directory_is_root()
directory_is_root() is cheaper than isRootDirectory(directory_get_path()).
Diffstat (limited to 'src/directory.h')
-rw-r--r--src/directory.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/directory.h b/src/directory.h
index afe81faad..36f0deb18 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -71,6 +71,15 @@ directory_get_path(const struct directory *directory)
}
/**
+ * Is this the root directory of the music database?
+ */
+static inline bool
+directory_is_root(const struct directory *directory)
+{
+ return directory->parent == NULL;
+}
+
+/**
* Returns the base name of the directory.
*/
const char *