summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mandoc/libmdoc.h7
-rw-r--r--usr.bin/mandoc/mdoc.c9
-rw-r--r--usr.bin/mandoc/mdoc_macro.c4
-rw-r--r--usr.bin/mandoc/mdoc_validate.c4
4 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/mandoc/libmdoc.h b/usr.bin/mandoc/libmdoc.h
index 02abdc6cd48..e452f28474c 100644
--- a/usr.bin/mandoc/libmdoc.h
+++ b/usr.bin/mandoc/libmdoc.h
@@ -1,4 +1,4 @@
-/* $Id: libmdoc.h,v 1.7 2009/06/19 07:20:19 schwarze Exp $ */
+/* $Id: libmdoc.h,v 1.8 2009/07/12 18:35:57 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -64,8 +64,6 @@ __BEGIN_DECLS
* When GCC2 is deprecated, most of these can be reverted to #define
* as mdoc_vXXX using __VA_ARGS__. Until then, use real functions.
*/
-int mdoc_vwarn(struct mdoc *, int, int,
- enum mdoc_warn, const char *, ...);
int mdoc_verr(struct mdoc *, int, int,
const char *, ...);
int mdoc_nerr(struct mdoc *, const struct mdoc_node *,
@@ -75,6 +73,9 @@ int mdoc_err(struct mdoc *, const char *, ...);
int mdoc_pwarn(struct mdoc *, int, int,
enum mdoc_warn,const char *, ...);
int mdoc_perr(struct mdoc *, int, int, const char *, ...);
+
+int mdoc_vwarn(struct mdoc *, int, int, const char *, ...);
+
int mdoc_macro(MACRO_PROT_ARGS);
int mdoc_word_alloc(struct mdoc *,
int, int, const char *);
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index 89892c15350..fc6689b3962 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.11 2009/07/12 18:28:29 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.12 2009/07/12 18:35:57 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -259,13 +259,13 @@ mdoc_verr(struct mdoc *mdoc, int ln, int pos,
va_start(ap, fmt);
(void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
va_end(ap);
+
return((*mdoc->cb.mdoc_err)(mdoc->data, ln, pos, buf));
}
int
-mdoc_vwarn(struct mdoc *mdoc, int ln, int pos,
- enum mdoc_warn type, const char *fmt, ...)
+mdoc_vwarn(struct mdoc *mdoc, int ln, int pos, const char *fmt, ...)
{
char buf[256];
va_list ap;
@@ -651,8 +651,7 @@ macrowarn(struct mdoc *m, int ln, const char *buf)
return(mdoc_perr(m, ln, 1,
"unknown macro: %s%s",
buf, strlen(buf) > 3 ? "..." : ""));
- return(mdoc_pwarn(m, ln, 1, WARN_SYNTAX,
- "unknown macro: %s%s",
+ return(mdoc_vwarn(m, ln, 1, "unknown macro: %s%s",
buf, strlen(buf) > 3 ? "..." : ""));
}
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index fb50bc1b93f..e4ed8315ace 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.4 2009/06/18 23:34:53 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.5 2009/07/12 18:35:57 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -286,7 +286,7 @@ swarn(struct mdoc *mdoc, enum mdoc_type type,
return(mdoc_perr(mdoc, line, pos,
"%s scope breaks %s scope of %s",
tt, t, n));
- return(mdoc_pwarn(mdoc, line, pos, WARN_SYNTAX,
+ return(mdoc_vwarn(mdoc, line, pos,
"%s scope breaks %s scope of %s",
tt, t, n));
}
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index cac5cbe47be..e14dadd8c06 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.15 2009/07/08 00:04:10 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.16 2009/07/12 18:35:57 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -524,7 +524,7 @@ warn_count(struct mdoc *m, const char *k,
int want, const char *v, int has)
{
- return(mdoc_warn(m, WARN_SYNTAX,
+ return(mdoc_vwarn(m, m->last->line, m->last->pos,
"suggests %s %s %d (has %d)", v, k, want, has));
}