diff options
author | oga | 2008-04-15 20:24:41 +0000 |
---|---|---|
committer | oga | 2008-04-15 20:24:41 +0000 |
commit | b31333397785733587b3bfe3adb27ff2761702b5 (patch) | |
tree | b4fdd1360ef1add5766452793034ef73bec0ebc4 /parse.y | |
parent | 137723ad08c9062a346b29d72b4b2ce55971c217 (diff) | |
download | cwm-b31333397785733587b3bfe3adb27ff2761702b5.tar.gz |
hit it with the knf stick.
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 49 |
1 files changed, 28 insertions, 21 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.3 2008/04/15 18:46:58 oga Exp $ */ +/* $OpenBSD: parse.y,v 1.4 2008/04/15 20:24:41 oga Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -40,16 +40,17 @@ static struct file { int lineno; int errors; } *file; -struct file *pushfile(const char *); -int popfile(void); -int yyparse(void); -int yylex(void); -int yyerror(const char *, ...); -int kw_cmp(const void *, const void *); -int lookup(char *); -int lgetc(int); -int lungetc(int); -int findeol(void); + +struct file *pushfile(const char *); +int popfile(void); +int yyparse(void); +int yylex(void); +int yyerror(const char *, ...); +int kw_cmp(const void *, const void *); +int lookup(char *); +int lgetc(int); +int lungetc(int); +int findeol(void); static struct conf *conf; @@ -97,7 +98,7 @@ string : string STRING { yesno : YES { $$ = 1; } | NO { $$ = 0; } ; - + main : FONTNAME STRING { if (conf->DefaultFontName != NULL && conf->DefaultFontName != DEFAULTFONTNAME) @@ -178,9 +179,9 @@ struct keywords { int yyerror(const char *fmt, ...) { - va_list ap; - - file->errors++; + va_list ap; + + file->errors++; va_start(ap, fmt); fprintf(stderr, "%s:%d: ", file->name, yylval.lineno); vfprintf(stderr, fmt, ap); @@ -548,36 +549,42 @@ parse_config(const char *filename, struct conf *xconf) xconf->flags = conf->flags; - for (cmd = TAILQ_FIRST(&conf->cmdq); cmd != NULL; cmd = cmdnext) { + for (cmd = TAILQ_FIRST(&conf->cmdq); cmd != NULL; + cmd = cmdnext) { cmdnext = TAILQ_NEXT(cmd, entry); TAILQ_REMOVE(&conf->cmdq, cmd, entry); TAILQ_INSERT_TAIL(&xconf->cmdq, cmd, entry); } - for (kb = TAILQ_FIRST(&conf->keybindingq); kb != NULL; kb = kbnext) { + for (kb = TAILQ_FIRST(&conf->keybindingq); kb != NULL; + kb = kbnext) { kbnext = TAILQ_NEXT(kb, entry); TAILQ_REMOVE(&conf->keybindingq, kb, entry); TAILQ_INSERT_TAIL(&xconf->keybindingq, kb, entry); } - for (ag = TAILQ_FIRST(&conf->autogroupq); ag != NULL; ag = agnext) { + for (ag = TAILQ_FIRST(&conf->autogroupq); ag != NULL; + ag = agnext) { agnext = TAILQ_NEXT(ag, entry); TAILQ_REMOVE(&conf->autogroupq, ag, entry); TAILQ_INSERT_TAIL(&xconf->autogroupq, ag, entry); } - for (wm = TAILQ_FIRST(&conf->ignoreq); wm != NULL; wm = wmnext) { + for (wm = TAILQ_FIRST(&conf->ignoreq); wm != NULL; + wm = wmnext) { wmnext = TAILQ_NEXT(wm, entry); TAILQ_REMOVE(&conf->ignoreq, wm, entry); TAILQ_INSERT_TAIL(&xconf->ignoreq, wm, entry); } - strlcpy(xconf->termpath, conf->termpath, sizeof(xconf->termpath)); - strlcpy(xconf->lockpath, conf->lockpath, sizeof(xconf->lockpath)); + strlcpy(xconf->termpath, conf->termpath, + sizeof(xconf->termpath)); + strlcpy(xconf->lockpath, conf->lockpath, + sizeof(xconf->lockpath)); xconf->DefaultFontName = conf->DefaultFontName; |