diff options
Diffstat (limited to 'src/Idle.cxx')
-rw-r--r-- | src/Idle.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Idle.cxx b/src/Idle.cxx index 840a5d4e5..0b66065de 100644 --- a/src/Idle.cxx +++ b/src/Idle.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -25,6 +25,7 @@ #include "config.h" #include "Idle.hxx" #include "GlobalEvents.hxx" +#include "util/ASCII.hxx" #include <atomic> @@ -44,6 +45,8 @@ static const char *const idle_names[] = { "update", "subscription", "message", + "neighbor", + "mount", nullptr }; @@ -69,3 +72,18 @@ idle_get_names(void) { return idle_names; } + +unsigned +idle_parse_name(const char *name) +{ +#if !CLANG_CHECK_VERSION(3,6) + /* disabled on clang due to -Wtautological-pointer-compare */ + assert(name != nullptr); +#endif + + for (unsigned i = 0; idle_names[i] != nullptr; ++i) + if (StringEqualsCaseASCII(name, idle_names[i])) + return 1 << i; + + return 0; +} |