diff options
author | taiyu <[email protected]> | 2015-09-12 02:38:03 -0700 |
---|---|---|
committer | taiyu <[email protected]> | 2015-09-12 02:38:03 -0700 |
commit | e1d18e42a8f3a597b9bf5f1bb2ab6c346e4e7983 (patch) | |
tree | 8a8ac30c539f4a63bb249b8c5e27e724a4241c9f /sway/config.c | |
parent | f5343adae4d631e4cdade7869b4d73fc97b4ac5f (diff) |
new_workspace null behavior + testmap functions + regex
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 25 |
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; +} + |