diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2009-01-23 19:01:00 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2009-01-23 19:01:00 +0000 |
commit | db8990d9b1026ac6ca8e4f7df5cc5bc0be098a0f (patch) | |
tree | dd0ce1b0aca160690792606be2b14c9415a0b07c /app/cwm | |
parent | 06dab143e9424fe9b3f43db09d8ee827f0bb7436 (diff) |
move conf_clear() and add proto.
ok todd@ oga@
Diffstat (limited to 'app/cwm')
-rw-r--r-- | app/cwm/calmwm.h | 3 | ||||
-rw-r--r-- | app/cwm/conf.c | 44 | ||||
-rw-r--r-- | app/cwm/parse.y | 45 |
3 files changed, 46 insertions, 46 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 5c98bd60e..a800ca4c6 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. * - * $Id: calmwm.h,v 1.79 2009/01/23 18:58:40 oga Exp $ + * $Id: calmwm.h,v 1.80 2009/01/23 19:00:59 okan Exp $ */ #ifndef _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/app/cwm/conf.c b/app/cwm/conf.c index 7c075c124..22e660587 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. * - * $Id: conf.c,v 1.54 2009/01/23 18:58:40 oga Exp $ + * $Id: conf.c,v 1.55 2009/01/23 19:00:59 okan Exp $ */ #include "headers.h" @@ -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/app/cwm/parse.y b/app/cwm/parse.y index 996664ee7..34db55029 100644 --- a/app/cwm/parse.y +++ b/app/cwm/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.17 2009/01/22 18:16:38 oga Exp $ */ +/* $OpenBSD: parse.y,v 1.18 2009/01/23 19:00:59 okan Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -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) { |