diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-12-01 08:05:03 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-12-01 08:05:03 +0000 |
commit | ac86e73e9650b4db811737e770a15bc7cf4be406 (patch) | |
tree | 58cb1d3af437f2670bcdfae102c356416ad83782 /usr.bin/mandoc | |
parent | caade4c1f10e3d0c5156f58840496c3c654d7db6 (diff) |
header cleanup:
* add missing forward declarations
* remove needless header inclusions
* some style unification
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/html.h | 9 | ||||
-rw-r--r-- | usr.bin/mandoc/libmandoc.h | 7 | ||||
-rw-r--r-- | usr.bin/mandoc/libroff.h | 6 | ||||
-rw-r--r-- | usr.bin/mandoc/main.h | 8 | ||||
-rw-r--r-- | usr.bin/mandoc/man_hash.c | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/man_html.c | 5 | ||||
-rw-r--r-- | usr.bin/mandoc/mandoc.h | 6 | ||||
-rw-r--r-- | usr.bin/mandoc/mansearch.h | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/mansearch_const.c | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 5 | ||||
-rw-r--r-- | usr.bin/mandoc/msec.c | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/out.h | 9 | ||||
-rw-r--r-- | usr.bin/mandoc/term.h | 12 | ||||
-rw-r--r-- | usr.bin/mandoc/term_ps.c | 5 |
14 files changed, 48 insertions, 37 deletions
diff --git a/usr.bin/mandoc/html.h b/usr.bin/mandoc/html.h index 092e05cc31c..90a9da18de3 100644 --- a/usr.bin/mandoc/html.h +++ b/usr.bin/mandoc/html.h @@ -1,4 +1,4 @@ -/* $OpenBSD: html.h,v 1.30 2014/11/27 14:31:29 deraadt Exp $ */ +/* $OpenBSD: html.h,v 1.31 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -15,8 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -__BEGIN_DECLS - enum htmltag { TAG_HTML, TAG_HEAD, @@ -144,6 +142,11 @@ struct html { #define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */ }; +__BEGIN_DECLS + +struct tbl_span; +struct eqn; + void print_gen_decls(struct html *); void print_gen_head(struct html *); struct tag *print_otag(struct html *, enum htmltag, diff --git a/usr.bin/mandoc/libmandoc.h b/usr.bin/mandoc/libmandoc.h index b3f3b550968..01358911568 100644 --- a/usr.bin/mandoc/libmandoc.h +++ b/usr.bin/mandoc/libmandoc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: libmandoc.h,v 1.36 2014/11/28 06:26:46 schwarze Exp $ */ +/* $OpenBSD: libmandoc.h,v 1.37 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -35,6 +35,11 @@ struct buf { __BEGIN_DECLS +struct mparse; +struct mchars; +enum mandocerr; +struct tbl_span; +struct eqn; struct roff; struct mdoc; struct man; diff --git a/usr.bin/mandoc/libroff.h b/usr.bin/mandoc/libroff.h index 94702571b09..4234f8bca08 100644 --- a/usr.bin/mandoc/libroff.h +++ b/usr.bin/mandoc/libroff.h @@ -1,4 +1,4 @@ -/* $OpenBSD: libroff.h,v 1.10 2014/11/27 14:31:29 deraadt Exp $ */ +/* $OpenBSD: libroff.h,v 1.11 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -16,8 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -__BEGIN_DECLS - enum tbl_part { TBL_PART_OPTS, /* in options (first line) */ TBL_PART_LAYOUT, /* describing layout */ @@ -64,6 +62,8 @@ struct eqn_def { size_t valsz; }; +__BEGIN_DECLS + struct tbl_node *tbl_alloc(int, int, struct mparse *); void tbl_restart(int, int, struct tbl_node *); void tbl_free(struct tbl_node *); diff --git a/usr.bin/mandoc/main.h b/usr.bin/mandoc/main.h index d22e7a3112a..1ce65e661e3 100644 --- a/usr.bin/mandoc/main.h +++ b/usr.bin/mandoc/main.h @@ -1,4 +1,4 @@ -/* $OpenBSD: main.h,v 1.13 2014/11/27 14:31:29 deraadt Exp $ */ +/* $OpenBSD: main.h,v 1.14 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -15,14 +15,14 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#define UNCONST(a) ((void *)(uintptr_t)(const void *)(a)) + __BEGIN_DECLS +struct mchars; struct mdoc; struct man; -#define UNCONST(a) ((void *)(uintptr_t)(const void *)(a)) - - /* * Definitions for main.c-visible output device functions, e.g., -Thtml * and -Tascii. Note that ascii_alloc() is named as such in diff --git a/usr.bin/mandoc/man_hash.c b/usr.bin/mandoc/man_hash.c index dbecd5b67de..46f9cdfce92 100644 --- a/usr.bin/mandoc/man_hash.c +++ b/usr.bin/mandoc/man_hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_hash.c,v 1.18 2014/11/28 19:25:03 schwarze Exp $ */ +/* $OpenBSD: man_hash.c,v 1.19 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -22,7 +22,6 @@ #include <string.h> #include "man.h" -#include "mandoc.h" #include "libman.h" #define HASH_DEPTH 6 diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index d2c15b0068a..bba6f68ebc4 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_html.c,v 1.57 2014/11/28 19:25:03 schwarze Exp $ */ +/* $OpenBSD: man_html.c,v 1.58 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -23,11 +23,10 @@ #include <stdlib.h> #include <string.h> -#include "mandoc.h" #include "mandoc_aux.h" +#include "man.h" #include "out.h" #include "html.h" -#include "man.h" #include "main.h" /* TODO: preserve ident widths. */ diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h index b608b68e16a..14428c58643 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mandoc.h,v 1.117 2014/11/30 05:28:00 schwarze Exp $ */ +/* $OpenBSD: mandoc.h,v 1.118 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -414,13 +414,13 @@ enum mandoc_esc { typedef void (*mandocmsg)(enum mandocerr, enum mandoclevel, const char *, int, int, const char *); +__BEGIN_DECLS + struct mparse; struct mchars; struct mdoc; struct man; -__BEGIN_DECLS - enum mandoc_esc mandoc_escape(const char **, const char **, int *); struct mchars *mchars_alloc(void); void mchars_free(struct mchars *); diff --git a/usr.bin/mandoc/mansearch.h b/usr.bin/mandoc/mansearch.h index 97c8465faf6..c68ed76acc2 100644 --- a/usr.bin/mandoc/mansearch.h +++ b/usr.bin/mandoc/mansearch.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mansearch.h,v 1.18 2014/11/27 14:31:29 deraadt Exp $ */ +/* $OpenBSD: mansearch.h,v 1.19 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -97,6 +97,8 @@ struct mansearch { __BEGIN_DECLS +struct manpaths; + int mansearch_setup(int); int mansearch(const struct mansearch *cfg, /* options */ const struct manpaths *paths, /* manpaths */ diff --git a/usr.bin/mandoc/mansearch_const.c b/usr.bin/mandoc/mansearch_const.c index 38f9b43a0a3..80bd759d6f2 100644 --- a/usr.bin/mandoc/mansearch_const.c +++ b/usr.bin/mandoc/mansearch_const.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mansearch_const.c,v 1.5 2014/11/28 19:25:03 schwarze Exp $ */ +/* $OpenBSD: mansearch_const.c,v 1.6 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> * @@ -18,7 +18,6 @@ #include <stdint.h> -#include "manpath.h" #include "mansearch.h" const int mansearch_keymax = 40; diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index b22e2f29e44..037c01d0f69 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_html.c,v 1.89 2014/11/30 05:28:00 schwarze Exp $ */ +/* $OpenBSD: mdoc_html.c,v 1.90 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -24,11 +24,10 @@ #include <string.h> #include <unistd.h> -#include "mandoc.h" #include "mandoc_aux.h" +#include "mdoc.h" #include "out.h" #include "html.h" -#include "mdoc.h" #include "main.h" #define INDENT 5 diff --git a/usr.bin/mandoc/msec.c b/usr.bin/mandoc/msec.c index 34347f25fef..d9503216780 100644 --- a/usr.bin/mandoc/msec.c +++ b/usr.bin/mandoc/msec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msec.c,v 1.9 2014/09/03 23:20:33 schwarze Exp $ */ +/* $OpenBSD: msec.c,v 1.10 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -18,7 +18,6 @@ #include <string.h> -#include "mandoc.h" #include "libmandoc.h" #define LINE(x, y) \ diff --git a/usr.bin/mandoc/out.h b/usr.bin/mandoc/out.h index 1ee4041bc48..67dd9eb2f36 100644 --- a/usr.bin/mandoc/out.h +++ b/usr.bin/mandoc/out.h @@ -1,4 +1,4 @@ -/* $OpenBSD: out.h,v 1.16 2014/11/27 14:31:29 deraadt Exp $ */ +/* $OpenBSD: out.h,v 1.17 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -14,6 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + enum roffscale { SCALE_CM, /* centimeters (c) */ SCALE_IN, /* inches (i) */ @@ -49,8 +50,6 @@ struct rofftbl { void *arg; /* passed to slen and len */ }; -__BEGIN_DECLS - #define SCALE_VS_INIT(p, v) \ do { (p)->unit = SCALE_VS; \ (p)->scale = (v); } \ @@ -61,6 +60,10 @@ __BEGIN_DECLS (p)->scale = (v); } \ while (/* CONSTCOND */ 0) +__BEGIN_DECLS + +struct tbl_span; + int a2roffsu(const char *, struct roffsu *, enum roffscale); void tblcalc(struct rofftbl *tbl, const struct tbl_span *, size_t); diff --git a/usr.bin/mandoc/term.h b/usr.bin/mandoc/term.h index 71b9c3bca96..add887697c3 100644 --- a/usr.bin/mandoc/term.h +++ b/usr.bin/mandoc/term.h @@ -1,4 +1,4 @@ -/* $OpenBSD: term.h,v 1.50 2014/11/27 14:31:29 deraadt Exp $ */ +/* $OpenBSD: term.h,v 1.51 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -15,9 +15,6 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -__BEGIN_DECLS - -struct termp; enum termenc { TERMENC_ASCII, @@ -41,6 +38,8 @@ enum termfont { #define TERM_MAXMARGIN 100000 /* FIXME */ +struct termp; + typedef void (*term_margin)(struct termp *, const void *); struct termp_tbl { @@ -101,6 +100,11 @@ struct termp { struct termp_ps *ps; }; +__BEGIN_DECLS + +struct tbl_span; +struct eqn; + const char *ascii_uc2str(int); void term_eqn(struct termp *, const struct eqn *); diff --git a/usr.bin/mandoc/term_ps.c b/usr.bin/mandoc/term_ps.c index c407e0d63d3..1d803a2f7a9 100644 --- a/usr.bin/mandoc/term_ps.c +++ b/usr.bin/mandoc/term_ps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: term_ps.c,v 1.34 2014/11/20 13:55:23 schwarze Exp $ */ +/* $OpenBSD: term_ps.c,v 1.35 2014/12/01 08:05:02 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -25,11 +25,10 @@ #include <string.h> #include <unistd.h> -#include "mandoc.h" #include "mandoc_aux.h" #include "out.h" -#include "main.h" #include "term.h" +#include "main.h" /* These work the buffer used by the header and footer. */ #define PS_BUFSLOP 128 |