aboutsummaryrefslogtreecommitdiff
path: root/sway/old/commands/no_focus.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-01-21 12:21:57 -0500
committerDrew DeVault <sir@cmpwn.com>2018-01-21 12:21:57 -0500
commita6bc46eea9d7dec6a2b93f85bac2e3737e0c6725 (patch)
treeebb95fcc4a0709f253f87a0e900adc0fbb51fa32 /sway/old/commands/no_focus.c
parentc933781facbb664fedcd52ab19f35c392cd9e7b4 (diff)
downloadsway-a6bc46eea9d7dec6a2b93f85bac2e3737e0c6725.tar.xz
Remove sway/old/
Diffstat (limited to 'sway/old/commands/no_focus.c')
-rw-r--r--sway/old/commands/no_focus.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/sway/old/commands/no_focus.c b/sway/old/commands/no_focus.c
deleted file mode 100644
index b3b88e5a..00000000
--- a/sway/old/commands/no_focus.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#define _XOPEN_SOURCE 500
-#include <string.h>
-#include "sway/commands.h"
-#include "sway/criteria.h"
-#include "list.h"
-#include "log.h"
-#include "stringop.h"
-
-struct cmd_results *cmd_no_focus(int argc, char **argv) {
- struct cmd_results *error = NULL;
- if ((error = checkarg(argc, "no_focus", EXPECTED_EQUAL_TO, 1))) {
- return error;
- }
- // add command to a criteria/command pair that is run against views when they appear.
- char *criteria = argv[0];
-
- struct criteria *crit = malloc(sizeof(struct criteria));
- if (!crit) {
- return cmd_results_new(CMD_FAILURE, "no_focus", "Unable to allocate criteria");
- }
- crit->crit_raw = strdup(criteria);
- crit->tokens = create_list();
- crit->cmdlist = NULL;
- char *err_str = extract_crit_tokens(crit->tokens, crit->crit_raw);
-
- if (err_str) {
- error = cmd_results_new(CMD_INVALID, "no_focus", err_str);
- free(err_str);
- free_criteria(crit);
- } else if (crit->tokens->length == 0) {
- error = cmd_results_new(CMD_INVALID, "no_focus", "Found no name/value pairs in criteria");
- free_criteria(crit);
- } else if (list_seq_find(config->no_focus, criteria_cmp, crit) != -1) {
- sway_log(L_DEBUG, "no_focus: Duplicate, skipping.");
- free_criteria(crit);
- } else {
- sway_log(L_DEBUG, "no_focus: '%s' added", crit->crit_raw);
- list_add(config->no_focus, crit);
- }
- return error ? error : cmd_results_new(CMD_SUCCESS, NULL, NULL);
-}