aboutsummaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-27 14:33:41 +0100
committerMax Kellermann <max@duempel.org>2008-12-27 14:33:41 +0100
commit0fe0425dee555027c94a39ca0bca5bac947f4702 (patch)
treeb56c3d787c766cda67b29dcd7664dbd516835373 /src/update.c
parent4c13a276c4340752fe955057cbb8cae82163292d (diff)
downloadmpd-0fe0425dee555027c94a39ca0bca5bac947f4702.tar.gz
mpd-0fe0425dee555027c94a39ca0bca5bac947f4702.tar.xz
mpd-0fe0425dee555027c94a39ca0bca5bac947f4702.zip
disable archive API without plugins
When there are no archive plugins, we do not need the archive API at all. Drop all its overhead.
Diffstat (limited to '')
-rw-r--r--src/update.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/update.c b/src/update.c
index c7ad71c7b..307d198f3 100644
--- a/src/update.c
+++ b/src/update.c
@@ -276,6 +276,7 @@ make_subdir(struct directory *parent, const char *name)
return directory;
}
+#ifdef ENABLE_ARCHIVE
static void
update_archive_tree(struct directory *directory, char *name)
{
@@ -308,6 +309,7 @@ update_archive_tree(struct directory *directory, char *name)
}
}
}
+#endif
static bool
updateDirectory(struct directory *directory, const struct stat *st);
@@ -316,7 +318,10 @@ static void
updateInDirectory(struct directory *directory,
const char *name, const struct stat *st)
{
+#ifdef ENABLE_ARCHIVE
const struct archive_plugin *archive;
+#endif
+
assert(strchr(name, '/') == NULL);
if (S_ISREG(st->st_mode) && hasMusicSuffix(name, 0)) {
@@ -351,6 +356,7 @@ updateInDirectory(struct directory *directory,
ret = updateDirectory(subdir, st);
if (!ret)
delete_directory(subdir);
+#ifdef ENABLE_ARCHIVE
} else if (S_ISREG(st->st_mode) && (archive = get_archive_by_suffix(name))) {
struct archive_file *archfile;
char pathname[MPD_PATH_MAX];
@@ -380,6 +386,7 @@ updateInDirectory(struct directory *directory,
} else {
g_warning("unable to open archive %s\n", pathname);
}
+#endif
} else {
g_debug("update: %s is not a directory, archive or music\n", name);
}