diff options
author | okan | 2014-01-30 22:17:22 +0000 |
---|---|---|
committer | okan | 2014-01-30 22:17:22 +0000 |
commit | edcee6832d3520912024707777453cb30f809e6b (patch) | |
tree | a1972a645b81ddc6f50c8adb445f1bef5eb122a8 /conf.c | |
parent | 898be2f9c2c9502ebd3b95e65042473b0ddca25e (diff) | |
download | cwm-edcee6832d3520912024707777453cb30f809e6b.tar.gz |
Switch ignoreq to winname struct since it's basically the same thing;
removes limit on name matching.
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 33 |
1 files changed, 14 insertions, 19 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.169 2014/01/30 15:43:53 okan Exp $ + * $OpenBSD: conf.c,v 1.170 2014/01/30 22:17:22 okan Exp $ */ #include <sys/param.h> @@ -99,18 +99,14 @@ conf_autogroup(struct conf *c, int no, const char *val) TAILQ_INSERT_TAIL(&c->autogroupq, aw, entry); } -int -conf_ignore(struct conf *c, const char *val) +void +conf_ignore(struct conf *c, const char *name) { - struct winmatch *wm; - - wm = xcalloc(1, sizeof(*wm)); + struct winname *wn; - if (strlcpy(wm->title, val, sizeof(wm->title)) >= sizeof(wm->title)) - return (0); - - TAILQ_INSERT_TAIL(&c->ignoreq, wm, entry); - return (1); + wn = xcalloc(1, sizeof(*wn)); + wn->name = xstrdup(name); + TAILQ_INSERT_TAIL(&c->ignoreq, wn, entry); } static const char *color_binds[] = { @@ -289,7 +285,7 @@ conf_clear(struct conf *c) { struct autogroupwin *aw; struct binding *kb, *mb; - struct winmatch *wm; + struct winname *wn; struct cmd *cmd; int i; @@ -310,9 +306,9 @@ conf_clear(struct conf *c) free(aw); } - while ((wm = TAILQ_FIRST(&c->ignoreq)) != NULL) { - TAILQ_REMOVE(&c->ignoreq, wm, entry); - free(wm); + while ((wn = TAILQ_FIRST(&c->ignoreq)) != NULL) { + TAILQ_REMOVE(&c->ignoreq, wn, entry); + free(wn); } while ((mb = TAILQ_FIRST(&c->mousebindingq)) != NULL) { @@ -329,12 +325,11 @@ conf_clear(struct conf *c) void conf_client(struct client_ctx *cc) { - struct winmatch *wm; - char *wname = cc->name; + struct winname *wn; int ignore = 0; - TAILQ_FOREACH(wm, &Conf.ignoreq, entry) { - if (strncasecmp(wm->title, wname, strlen(wm->title)) == 0) { + TAILQ_FOREACH(wn, &Conf.ignoreq, entry) { + if (strncasecmp(wn->name, cc->name, strlen(wn->name)) == 0) { ignore = 1; break; } |