summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-18 22:16:57 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-18 22:16:57 +0000
commit2500042f84c58f73521b7dcc81191feb1c9d674a (patch)
treeb2dd955eaea309d36c5e14ee2dd2e14a5f9c8522
parentba1a8126d4bf61eebb86af6b68f19a291825e9da (diff)
complete sync to 1.7.17: garbage collect unused functions
mdoc_msg, mdoc_pmsg, mdoc_vmsg, and mdoc_nwarn
-rw-r--r--usr.bin/mandoc/Makefile4
-rw-r--r--usr.bin/mandoc/libmdoc.h12
-rw-r--r--usr.bin/mandoc/main.c3
-rw-r--r--usr.bin/mandoc/mdoc.c68
-rw-r--r--usr.bin/mandoc/mdoc.h3
5 files changed, 10 insertions, 80 deletions
diff --git a/usr.bin/mandoc/Makefile b/usr.bin/mandoc/Makefile
index e33d66041a8..c619121a9f7 100644
--- a/usr.bin/mandoc/Makefile
+++ b/usr.bin/mandoc/Makefile
@@ -1,8 +1,8 @@
-# $OpenBSD: Makefile,v 1.3 2009/06/14 23:39:43 schwarze Exp $
+# $OpenBSD: Makefile,v 1.4 2009/06/18 22:16:56 schwarze Exp $
.include <bsd.own.mk>
-VERSION=1.7.16
+VERSION=1.7.17
CFLAGS+=-DVERSION=\"${VERSION}\"
CFLAGS+=-W -Wall -Wstrict-prototypes
.if ${USE_GCC3:L} != "no"
diff --git a/usr.bin/mandoc/libmdoc.h b/usr.bin/mandoc/libmdoc.h
index ec9646b7aa7..f9acd9eb29e 100644
--- a/usr.bin/mandoc/libmdoc.h
+++ b/usr.bin/mandoc/libmdoc.h
@@ -1,4 +1,4 @@
-/* $Id: libmdoc.h,v 1.5 2009/06/15 18:41:13 schwarze Exp $ */
+/* $Id: libmdoc.h,v 1.6 2009/06/18 22:16:56 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -59,20 +59,18 @@ extern const struct mdoc_macro *const mdoc_macros;
__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 *, ...);
-void mdoc_vmsg(struct mdoc *, int, int,
- const char *, ...);
int mdoc_verr(struct mdoc *, int, int,
const char *, ...);
-int mdoc_nwarn(struct mdoc *, const struct mdoc_node *,
- enum mdoc_warn, const char *, ...);
int mdoc_nerr(struct mdoc *, const struct mdoc_node *,
const char *, ...);
int mdoc_warn(struct mdoc *, enum mdoc_warn, const char *, ...);
int mdoc_err(struct mdoc *, const char *, ...);
-void mdoc_msg(struct mdoc *, const char *, ...);
-void mdoc_pmsg(struct mdoc *, int, int, const char *, ...);
int mdoc_pwarn(struct mdoc *, int, int,
enum mdoc_warn,const char *, ...);
int mdoc_perr(struct mdoc *, int, int, const char *, ...);
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 682a5ff2e00..d534f636a2a 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.3 2009/06/14 23:39:43 schwarze Exp $ */
+/* $Id: main.c,v 1.4 2009/06/18 22:16:56 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -246,7 +246,6 @@ mdoc_init(struct curparse *curp)
struct mdoc *mdoc;
struct mdoc_cb mdoccb;
- mdoccb.mdoc_msg = NULL;
mdoccb.mdoc_err = merr;
mdoccb.mdoc_warn = mdocwarn;
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index 313fa7407aa..71a0631c085 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.5 2009/06/15 18:41:13 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.6 2009/06/18 22:16:56 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -242,22 +242,6 @@ mdoc_parseln(struct mdoc *m, int ln, char *buf)
}
-void
-mdoc_vmsg(struct mdoc *mdoc, int ln, int pos, const char *fmt, ...)
-{
- char buf[256];
- va_list ap;
-
- if (NULL == mdoc->cb.mdoc_msg)
- return;
-
- va_start(ap, fmt);
- (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
- va_end(ap);
- (*mdoc->cb.mdoc_msg)(mdoc->data, ln, pos, buf);
-}
-
-
int
mdoc_verr(struct mdoc *mdoc, int ln, int pos,
const char *fmt, ...)
@@ -293,23 +277,6 @@ mdoc_vwarn(struct mdoc *mdoc, int ln, int pos,
int
-mdoc_nwarn(struct mdoc *mdoc, const struct mdoc_node *node, enum mdoc_warn type,
- const char *fmt, ...)
-{
- char buf[256];
- va_list ap;
-
- if (NULL == mdoc->cb.mdoc_warn)
- return(0);
-
- va_start(ap, fmt);
- (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
- va_end(ap);
- return((*mdoc->cb.mdoc_warn)(mdoc->data, node->line, node->pos, type,
- buf));
-}
-
-int
mdoc_nerr(struct mdoc *mdoc, const struct mdoc_node *node, const char *fmt, ...)
{
char buf[256];
@@ -359,39 +326,6 @@ mdoc_err(struct mdoc *mdoc, const char *fmt, ...)
}
-void
-mdoc_msg(struct mdoc *mdoc, const char *fmt, ...)
-{
- char buf[256];
- va_list ap;
-
- if (NULL == mdoc->cb.mdoc_msg)
- return;
-
- va_start(ap, fmt);
- (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
- va_end(ap);
- (*mdoc->cb.mdoc_msg)(mdoc->data, mdoc->last->line, mdoc->last->pos,
- buf);
-}
-
-
-void
-mdoc_pmsg(struct mdoc *mdoc, int line, int pos, const char *fmt, ...)
-{
- char buf[256];
- va_list ap;
-
- if (NULL == mdoc->cb.mdoc_msg)
- return;
-
- va_start(ap, fmt);
- (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
- va_end(ap);
- (*mdoc->cb.mdoc_msg)(mdoc->data, line, pos, buf);
-}
-
-
int
mdoc_pwarn(struct mdoc *mdoc, int line, int pos, enum mdoc_warn type,
const char *fmt, ...)
diff --git a/usr.bin/mandoc/mdoc.h b/usr.bin/mandoc/mdoc.h
index 241288284c9..edaa9efc4e3 100644
--- a/usr.bin/mandoc/mdoc.h
+++ b/usr.bin/mandoc/mdoc.h
@@ -1,4 +1,4 @@
-/* $Id: mdoc.h,v 1.2 2009/06/14 23:00:57 schwarze Exp $ */
+/* $Id: mdoc.h,v 1.3 2009/06/18 22:16:56 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -278,7 +278,6 @@ struct mdoc_node {
/* Call-backs for parse messages. */
struct mdoc_cb {
- void (*mdoc_msg)(void *, int, int, const char *);
int (*mdoc_err)(void *, int, int, const char *);
int (*mdoc_warn)(void *, int, int,
enum mdoc_warn, const char *);