aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-09-12 10:29:11 -0400
committerDrew DeVault <sir@cmpwn.com>2015-09-12 10:29:11 -0400
commit9c8f1fb9649c5673cd6b42230c0784f099a62db7 (patch)
treebb5eccfddb8b8d56e387327908490daeca2c42a7 /sway/config.c
parentf5343adae4d631e4cdade7869b4d73fc97b4ac5f (diff)
parentf76f9e2eea15ee4606c23139e9a4c8ce41a4ab18 (diff)
Merge pull request #179 from taiyu-len/master
new_workspace null behavior + testmap functions + regex
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c
index 23d6ac0d..da92030e 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -286,3 +286,28 @@ char *do_var_replacement(char *str) {
}
return str;
}
+
+struct workspace_output *wsop_find_workspace(const char *name) {
+ int i, len = config->workspace_outputs->length;
+ struct workspace_output *wsop;
+ for (i = 0; i < len; ++i) {
+ wsop = config->workspace_outputs->items[i];
+ if (strcasecmp(wsop->workspace, name) == 0) {
+ return wsop;
+ }
+ }
+ return NULL;
+}
+
+struct workspace_output *wsop_find_output(const char *name) {
+ int i, len = config->workspace_outputs->length;
+ struct workspace_output *wsop;
+ for (i = 0; i < len; ++i) {
+ wsop = config->workspace_outputs->items[i];
+ if (strcasecmp(wsop->output, name) == 0) {
+ return wsop;
+ }
+ }
+ return NULL;
+}
+