-/* $Id: main.c,v 1.36 2009/07/06 09:34:29 kristaps Exp $ */
+/* $Id: main.c,v 1.38 2009/07/07 09:52:08 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
static int moptions(enum intt *, char *);
static int woptions(int *, char *);
static int merr(void *, int, int, const char *);
-static int manwarn(void *, int, int, const char *);
-static int mdocwarn(void *, int, int, const char *);
+static int mwarn(void *, int, int, const char *);
static int ffile(struct buf *, struct buf *,
const char *, struct curparse *);
static int fdesc(struct buf *, struct buf *,
struct man_cb mancb;
mancb.man_err = merr;
- mancb.man_warn = manwarn;
+ mancb.man_warn = mwarn;
/* Defaults from mandoc.1. */
struct mdoc_cb mdoccb;
mdoccb.mdoc_err = merr;
- mdoccb.mdoc_warn = mdocwarn;
+ mdoccb.mdoc_warn = mwarn;
/* Defaults from mandoc.1. */
static int
-mdocwarn(void *arg, int line, int col, const char *msg)
+mwarn(void *arg, int line, int col, const char *msg)
{
struct curparse *curp;
if ( ! (curp->wflags & WARN_WALL))
return(1);
- warnx("%s:%d: syntax warning: %s (column %d)",
+ warnx("%s:%d: warning: %s (column %d)",
curp->file, line, msg, col);
if ( ! (curp->wflags & WARN_WERR))
return(0);
}
-
-static int
-manwarn(void *arg, int line, int col, const char *msg)
-{
- struct curparse *curp;
-
- curp = (struct curparse *)arg;
-
- if ( ! (curp->wflags & WARN_WALL))
- return(1);
-
- warnx("%s:%d: syntax warning: %s (column %d)",
- curp->file, line, msg, col);
-
- if ( ! (curp->wflags & WARN_WERR))
- return(1);
-
- warnx("considering warnings as errors");
- return(0);
-}