mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
move conf_clear() and add proto.
ok todd@ oga@
This commit is contained in:
parent
779177a53d
commit
7660bf0db0
1
calmwm.h
1
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 *);
|
||||
|
42
conf.c
42
conf.c
@ -159,6 +159,48 @@ conf_init(struct conf *c)
|
||||
c->DefaultFontName = xstrdup(DEFAULTFONTNAME);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
43
parse.y
43
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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user