summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2013-04-17 13:30:39 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2013-04-17 13:30:39 +0000
commitc6022341e1c88831dbab2cead62d75cde59663a4 (patch)
tree8f4bc908697ba6a45eaae5f1acb990fb93165e78 /app
parente1c9c0b47408549e1c282bda8af23562cdf2c424 (diff)
add conf_ignore and move group_make_autogroup to conf_autogroup to match.
Diffstat (limited to 'app')
-rw-r--r--app/cwm/calmwm.h5
-rw-r--r--app/cwm/conf.c35
-rw-r--r--app/cwm/group.c23
-rw-r--r--app/cwm/parse.y11
4 files changed, 41 insertions, 33 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index ef1c25648..694ec7d98 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -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: calmwm.h,v 1.188 2013/04/14 16:13:17 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.189 2013/04/17 13:30:38 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -352,7 +352,6 @@ void group_client_delete(struct client_ctx *);
void group_cycle(struct screen_ctx *, int);
void group_hidetoggle(struct screen_ctx *, int);
void group_init(struct screen_ctx *);
-void group_make_autogroup(struct conf *, char *, int);
void group_menu(XButtonEvent *);
void group_movetogroup(struct client_ctx *, int);
void group_only(struct screen_ctx *, int);
@@ -436,6 +435,7 @@ void menuq_clear(struct menu_q *);
int parse_config(const char *, struct conf *);
+void conf_autogroup(struct conf *, int, char *);
void conf_bindname(struct conf *, char *, char *);
void conf_clear(struct conf *);
void conf_client(struct client_ctx *);
@@ -446,6 +446,7 @@ void conf_gap(struct conf *, struct screen_ctx *);
void conf_grab(struct conf *, struct keybinding *);
void conf_grab_mouse(struct client_ctx *);
void conf_init(struct conf *);
+void conf_ignore(struct conf *, char *);
void conf_mousebind(struct conf *, char *, char *);
void conf_ungrab(struct conf *, struct keybinding *);
diff --git a/app/cwm/conf.c b/app/cwm/conf.c
index 24d762339..ece45e55e 100644
--- a/app/cwm/conf.c
+++ b/app/cwm/conf.c
@@ -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.121 2013/01/08 15:16:05 okan Exp $
+ * $OpenBSD: conf.c,v 1.122 2013/04/17 13:30:38 okan Exp $
*/
#include <sys/param.h>
@@ -53,6 +53,39 @@ conf_cmd_add(struct conf *c, char *image, char *label)
}
void
+conf_autogroup(struct conf *c, int no, char *val)
+{
+ struct autogroupwin *aw;
+ char *p;
+
+ aw = xcalloc(1, sizeof(*aw));
+
+ if ((p = strchr(val, ',')) == NULL) {
+ aw->name = NULL;
+ aw->class = xstrdup(val);
+ } else {
+ *(p++) = '\0';
+ aw->name = xstrdup(val);
+ aw->class = xstrdup(p);
+ }
+ aw->num = no;
+
+ TAILQ_INSERT_TAIL(&c->autogroupq, aw, entry);
+}
+
+void
+conf_ignore(struct conf *c, char *val)
+{
+ struct winmatch *wm;
+
+ wm = xcalloc(1, sizeof(*wm));
+
+ (void)strlcpy(wm->title, val, sizeof(wm->title));
+
+ TAILQ_INSERT_TAIL(&c->ignoreq, wm, entry);
+}
+
+void
conf_gap(struct conf *c, struct screen_ctx *sc)
{
sc->gap = c->gap;
diff --git a/app/cwm/group.c b/app/cwm/group.c
index 011ae8f2b..46312f0c6 100644
--- a/app/cwm/group.c
+++ b/app/cwm/group.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: group.c,v 1.73 2013/04/08 13:05:27 okan Exp $
+ * $OpenBSD: group.c,v 1.74 2013/04/17 13:30:38 okan Exp $
*/
#include <sys/param.h>
@@ -163,27 +163,6 @@ group_init(struct screen_ctx *sc)
group_setactive(sc, 1);
}
-void
-group_make_autogroup(struct conf *conf, char *val, int no)
-{
- struct autogroupwin *aw;
- char *p;
-
- aw = xcalloc(1, sizeof(*aw));
-
- if ((p = strchr(val, ',')) == NULL) {
- aw->name = NULL;
- aw->class = xstrdup(val);
- } else {
- *(p++) = '\0';
- aw->name = xstrdup(val);
- aw->class = xstrdup(p);
- }
- aw->num = no;
-
- TAILQ_INSERT_TAIL(&conf->autogroupq, aw, entry);
-}
-
static void
group_setactive(struct screen_ctx *sc, long idx)
{
diff --git a/app/cwm/parse.y b/app/cwm/parse.y
index d93d0803a..8dc1dd00c 100644
--- a/app/cwm/parse.y
+++ b/app/cwm/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.39 2013/01/04 16:27:58 okan Exp $ */
+/* $OpenBSD: parse.y,v 1.40 2013/04/17 13:30:38 okan Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -137,16 +137,11 @@ main : FONTNAME STRING {
YYERROR;
}
- group_make_autogroup(conf, $3, $2);
+ conf_autogroup(conf, $2, $3);
free($3);
}
| IGNORE STRING {
- struct winmatch *wm;
-
- wm = xcalloc(1, sizeof(*wm));
- (void)strlcpy(wm->title, $2, sizeof(wm->title));
- TAILQ_INSERT_TAIL(&conf->ignoreq, wm, entry);
-
+ conf_ignore(conf, $2);
free($2);
}
| BIND STRING string {