diff options
Diffstat (limited to 'src/Idle.cxx')
-rw-r--r-- | src/Idle.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Idle.cxx b/src/Idle.cxx index ed16bbecb..713454da5 100644 --- a/src/Idle.cxx +++ b/src/Idle.cxx @@ -25,6 +25,7 @@ #include "config.h" #include "Idle.hxx" #include "GlobalEvents.hxx" +#include "util/ASCII.hxx" #include <atomic> @@ -70,3 +71,15 @@ idle_get_names(void) { return idle_names; } + +unsigned +idle_parse_name(const char *name) +{ + assert(name != nullptr); + + for (unsigned i = 0; idle_names[i] != nullptr; ++i) + if (StringEqualsCaseASCII(name, idle_names[i])) + return 1 << i; + + return 0; +} |