summaryrefslogtreecommitdiffstatshomepage
path: root/dummy.c
diff options
context:
space:
mode:
Diffstat (limited to 'dummy.c')
-rw-r--r--dummy.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/dummy.c b/dummy.c
index 6991ae0c..51ae1f29 100644
--- a/dummy.c
+++ b/dummy.c
@@ -1,4 +1,4 @@
-/* $Id: dummy.c,v 1.8 2008/11/27 14:02:41 kristaps Exp $ */
+/* $Id: dummy.c,v 1.9 2008/11/27 16:54:58 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);
+}