summaryrefslogtreecommitdiffstats
path: root/dummy.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-11-27 16:54:58 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-11-27 16:54:58 +0000
commit757654bf3db3f335e31ed99eff0744a5b6d0c5d1 (patch)
treed8b27757ac79941de0a81c2532582da0a5456f07 /dummy.c
parent249f2463dcbfa8d488b51bd70a458dbe79d25724 (diff)
downloadmandoc-757654bf3db3f335e31ed99eff0744a5b6d0c5d1.tar.gz
Considerable fixes.
Diffstat (limited to 'dummy.c')
-rw-r--r--dummy.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/dummy.c b/dummy.c
index 7c639eeb..75ab173a 100644
--- a/dummy.c
+++ b/dummy.c
@@ -36,6 +36,10 @@ static int md_dummy_text_out(int);
static int md_dummy_special(int);
static int md_dummy_head(void);
static int md_dummy_tail(void);
+static void md_dummy_msg(const struct md_args *,
+ enum roffmsg, const char *,
+ const char *, const char *,
+ int, char *);
static void dbg_prologue(const char *);
static void dbg_epilogue(void);
@@ -91,6 +95,7 @@ md_init_dummy(const struct md_args *args,
p->cb.roffblkin = md_dummy_blk_in;
p->cb.roffblkout = md_dummy_blk_out;
p->cb.roffspecial = md_dummy_special;
+ p->cb.roffmsg = md_dummy_msg;
p->tree = roff_alloc(args, mbuf, rbuf, &p->cb);
@@ -210,3 +215,24 @@ md_dummy_text_out(int tok)
return(1);
}
+
+
+static void
+md_dummy_msg(const struct md_args *args, enum roffmsg lvl,
+ const char *buf, const char *pos,
+ const char *name, int line, char *msg)
+{
+ char *p;
+
+ switch (lvl) {
+ case (ROFF_WARN):
+ p = "warning";
+ break;
+ case (ROFF_ERROR):
+ p = "error";
+ break;
+ }
+
+ assert(pos >= buf);
+ (void)fprintf(stderr, "%s:%d: %s: %s\n", name, line, p, msg);
+}