+bool parse_subscriber_mask(char *s, subscriber_mask_t *mask)
+{
+ if (streq("all", s)) {
+ *mask = SBSC_MASK_ALL;
+ } else if (streq("window", s)) {
+ *mask = SBSC_MASK_WINDOW;
+ } else if (streq("desktop", s)) {
+ *mask = SBSC_MASK_DESKTOP;
+ } else if (streq("monitor", s)) {
+ *mask = SBSC_MASK_MONITOR;
+ } else if (streq("window_manage", s)) {
+ *mask = SBSC_MASK_WINDOW_MANAGE;
+ } else if (streq("window_unmanage", s)) {
+ *mask = SBSC_MASK_WINDOW_UNMANAGE;
+ } else if (streq("window_urgent", s)) {
+ *mask = SBSC_MASK_WINDOW_URGENT;
+ } else if (streq("window_fullscreen", s)) {
+ *mask = SBSC_MASK_WINDOW_FULLSCREEN;
+ } else if (streq("desktop_add", s)) {
+ *mask = SBSC_MASK_DESKTOP_ADD;
+ } else if (streq("desktop_rename", s)) {
+ *mask = SBSC_MASK_DESKTOP_RENAME;
+ } else if (streq("desktop_remove", s)) {
+ *mask = SBSC_MASK_DESKTOP_REMOVE;
+ } else if (streq("monitor_add", s)) {
+ *mask = SBSC_MASK_MONITOR_ADD;
+ } else if (streq("monitor_rename", s)) {
+ *mask = SBSC_MASK_MONITOR_RENAME;
+ } else if (streq("monitor_remove", s)) {
+ *mask = SBSC_MASK_MONITOR_REMOVE;
+ } else if (streq("report", s)) {
+ *mask = SBSC_MASK_REPORT;
+ } else {
+ return false;
+ }
+ return true;
+}
+