aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-11 20:41:55 -0700
committerEric Wong <normalperson@yhbt.net>2008-10-12 05:27:32 -0700
commite28fb29349a811f0f306e9ac4bedf6013417d043 (patch)
treec28a33e1361a4a507dc2c401f4cce26eda7cd9aa /src/directory.h
parentc6ee14dca5d7336dad20a6057aa2a8006d4447b8 (diff)
downloadmpd-e28fb29349a811f0f306e9ac4bedf6013417d043.tar.gz
mpd-e28fb29349a811f0f306e9ac4bedf6013417d043.tar.xz
mpd-e28fb29349a811f0f306e9ac4bedf6013417d043.zip
directory: make music_root global and avoid runtime initialization
mpd can't function without music_root; so don't bother allocating it on the heap nor checking to see if it's initialized. Don't allow directory_new() to create a directory w/o a parent or with an empty path, either: root is root and there can be only one</highlander>.
Diffstat (limited to 'src/directory.h')
-rw-r--r--src/directory.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/directory.h b/src/directory.h
index 546e55183..9c3063d75 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -43,6 +43,8 @@ struct directory {
char path[mpd_sizeof_str_flex_array];
} mpd_packed;
+extern struct directory music_root;
+
static inline int isRootDirectory(const char *name)
{
/* TODO: verify and remove !name check */