summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2009-01-23 19:00:59 +0000
committerokan <okan>2009-01-23 19:00:59 +0000
commit7660bf0db0042ea140e5ca6fd0b639583719da28 (patch)
tree5f7addadec53fd3f29c7fd3b908667f9f8ed23f7
parent779177a53d2d0c9a02905a43f250f4ae08cb1dff (diff)
downloadcwm-7660bf0db0042ea140e5ca6fd0b639583719da28.tar.gz
cwm-7660bf0db0042ea140e5ca6fd0b639583719da28.tar.xz
cwm-7660bf0db0042ea140e5ca6fd0b639583719da28.zip
move conf_clear() and add proto.
ok todd@ oga@
-rw-r--r--calmwm.h1
-rw-r--r--conf.c42
-rw-r--r--parse.y43
3 files changed, 43 insertions, 43 deletions
diff --git a/calmwm.h b/calmwm.h
index b1c8b4c..f206c39 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -424,6 +424,7 @@ void			 conf_grab_mouse(struct client_ctx *);
 void			 conf_reload(struct conf *);
 void			 conf_font(struct conf *);
 void			 conf_init(struct conf *);
+void			 conf_clear(struct conf *);
 void			 conf_cmd_add(struct conf *, char *, char *, int);
 
 int			 parse_config(const char *, struct conf *);
diff --git a/conf.c b/conf.c
index 7054431..b8ecc40 100644
--- a/conf.c
+++ b/conf.c
@@ -160,6 +160,48 @@ conf_init(struct conf *c)
 }
 
 void
+conf_clear(struct conf *c)
+{
+	struct autogroupwin	*ag;
+	struct keybinding	*kb;
+	struct winmatch		*wm;
+	struct cmd		*cmd;
+	struct mousebinding	*mb;
+
+	while ((cmd = TAILQ_FIRST(&c->cmdq)) != NULL) {
+		TAILQ_REMOVE(&c->cmdq, cmd, entry);
+		free(cmd);
+	}
+
+	while ((kb = TAILQ_FIRST(&c->keybindingq)) != NULL) {
+		TAILQ_REMOVE(&c->keybindingq, kb, entry);
+		free(kb);
+	}
+
+	while ((ag = TAILQ_FIRST(&c->autogroupq)) != NULL) {
+		TAILQ_REMOVE(&c->autogroupq, ag, entry);
+		free(ag->class);
+		if (ag->name)
+			free(ag->name);
+		free(ag->group);
+		free(ag);
+	}
+
+	while ((wm = TAILQ_FIRST(&c->ignoreq)) != NULL) {
+		TAILQ_REMOVE(&c->ignoreq, wm, entry);
+		free(wm);
+	}
+
+	while ((mb = TAILQ_FIRST(&c->mousebindingq)) != NULL) {
+		TAILQ_REMOVE(&c->mousebindingq, mb, entry);
+		free(mb);
+	}
+
+	if (c->DefaultFontName != NULL)
+		free(c->DefaultFontName);
+}
+
+void
 conf_setup(struct conf *c, const char *conf_file)
 {
 	struct stat	 sb;
diff --git a/parse.y b/parse.y
index 2024e10..6dd1fab 100644
--- a/parse.y
+++ b/parse.y
@@ -464,49 +464,6 @@ popfile(void)
 	return (EOF);
 }
 
-void
-conf_clear(struct conf *c)
-{
-	struct autogroupwin	*ag;
-	struct keybinding	*kb;
-	struct winmatch		*wm;
-	struct cmd		*cmd;
-	struct mousebinding	*mb;
-
-	while ((cmd = TAILQ_FIRST(&c->cmdq)) != NULL) {
-		TAILQ_REMOVE(&c->cmdq, cmd, entry);
-		free(cmd);
-	}
-
-	while ((kb = TAILQ_FIRST(&c->keybindingq)) != NULL) {
-		TAILQ_REMOVE(&c->keybindingq, kb, entry);
-		free(kb);
-	}
-
-	while ((ag = TAILQ_FIRST(&c->autogroupq)) != NULL) {
-		TAILQ_REMOVE(&c->autogroupq, ag, entry);
-		free(ag->class);
-		if (ag->name)
-			free(ag->name);
-		free(ag->group);
-		free(ag);
-	}
-
-	while ((wm = TAILQ_FIRST(&c->ignoreq)) != NULL) {
-		TAILQ_REMOVE(&c->ignoreq, wm, entry);
-		free(wm);
-	}
-
-	while ((mb = TAILQ_FIRST(&c->mousebindingq)) != NULL) {
-		TAILQ_REMOVE(&c->mousebindingq, mb, entry);
-		free(mb);
-	}
-
-	if (c->DefaultFontName != NULL)
-		free(c->DefaultFontName);
-}
-
-
 int
 parse_config(const char *filename, struct conf *xconf)
 {