summaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/parse.c b/src/parse.c
index df6cce3..18ed6b0 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -82,7 +82,7 @@ static unsigned char overflowbuff[20]; /* really only need one */
static int overflowlen;
static unsigned char **stringListSource, *currentString;
-static int doparse(int (*ifunc)(void), const char *srctypename,
+static int doparse(int (*ifunc) (void), const char *srctypename,
const char *srcname);
static int twmFileInput(void);
static int twmStringListInput(void);
@@ -93,14 +93,14 @@ extern int yylineno;
int ConstrainedMoveTime = 400; /* milliseconds, event times */
-int (*twmInputFunc)(void);
+int (*twmInputFunc) (void);
/**
* parse the .twmrc file
* \param filename the filename to parse. NULL indicates $HOME/.twmrc
*/
static int
-doparse(int (*ifunc)(void), const char *srctypename, const char *srcname)
+doparse(int (*ifunc) (void), const char *srctypename, const char *srcname)
{
mods = 0;
ptr = 0;
@@ -146,11 +146,12 @@ doparse(int (*ifunc)(void), const char *srctypename, const char *srcname)
&Scr->PointerForeground, &Scr->PointerBackground);
}
if (ParseError) {
- fprintf(stderr, "%s: errors found in twm %s",
- ProgramName, srctypename);
- if (srcname)
- fprintf(stderr, " \"%s\"", srcname);
- fprintf(stderr, "\n");
+ if (srcname) {
+ twmWarning("errors found in twm %s \"%s\"", srctypename, srcname);
+ }
+ else {
+ twmWarning("errors found in twm %s", srctypename);
+ }
}
return (ParseError ? 0 : 1);
}
@@ -206,9 +207,8 @@ ParseTwmrc(char *filename)
int status;
if (filename && cp != filename) {
- fprintf(stderr,
- "%s: unable to open twmrc file %s, using %s instead\n",
- ProgramName, filename, cp);
+ twmWarning("unable to open twmrc file %s, using %s instead",
+ filename, cp);
}
status = doparse(twmFileInput, "file", cp);
fclose(twmrc);
@@ -216,9 +216,8 @@ ParseTwmrc(char *filename)
}
else {
if (filename) {
- fprintf(stderr,
- "%s: unable to open twmrc file %s, using built-in defaults instead\n",
- ProgramName, filename);
+ twmWarning("unable to open twmrc file %s,"
+ " using built-in defaults instead", filename);
}
return ParseStringList(defTwmrc);
}