From ed985164976ccd03ae1cd954a33c775bfc84b0c2 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 1 Dec 2014 08:05:52 +0000 Subject: header cleanup: * add missing forward declarations * remove needless header inclusions * some style unification --- Makefile.depend | 16 ++++++++-------- html.h | 9 ++++++--- libmandoc.h | 7 ++++++- libroff.h | 6 +++--- main.h | 8 ++++---- man_hash.c | 3 +-- man_html.c | 5 ++--- mandoc.h | 6 +++--- mansearch.h | 4 +++- mansearch_const.c | 3 +-- mdoc_html.c | 5 ++--- msec.c | 3 +-- out.h | 8 +++++--- term.h | 13 ++++++++----- term_ps.c | 5 ++--- 15 files changed, 55 insertions(+), 46 deletions(-) diff --git a/Makefile.depend b/Makefile.depend index d3c13e09..a61de19f 100644 --- a/Makefile.depend +++ b/Makefile.depend @@ -15,12 +15,12 @@ demandoc.o: demandoc.c config.h man.h mdoc.h mandoc.h eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h -html.o: html.c config.h mandoc.h mandoc_aux.h libmandoc.h out.h html.h main.h +html.o: html.c config.h mandoc.h mandoc_aux.h out.h html.h main.h lib.o: lib.c config.h mdoc.h libmdoc.h lib.in main.o: main.c config.h mandoc.h mandoc_aux.h main.h mdoc.h man.h manpath.h mansearch.h man.o: man.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h -man_hash.o: man_hash.c config.h man.h mandoc.h libman.h -man_html.o: man_html.c config.h mandoc.h mandoc_aux.h out.h html.h man.h main.h +man_hash.o: man_hash.c config.h man.h libman.h +man_html.o: man_html.c config.h mandoc_aux.h man.h out.h html.h main.h man_macro.o: man_macro.c config.h man.h mandoc.h libmandoc.h libman.h man_term.o: man_term.c config.h mandoc.h mandoc_aux.h out.h man.h term.h main.h man_validate.o: man_validate.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h @@ -30,19 +30,19 @@ mandocdb.o: mandocdb.c config.h compat_fts.h compat_ohash.h mdoc.h man.h mandoc. manpage.o: manpage.c config.h manpath.h mansearch.h manpath.o: manpath.c config.h mandoc_aux.h manpath.h mansearch.o: mansearch.c config.h compat_ohash.h mandoc.h mandoc_aux.h manpath.h mansearch.h -mansearch_const.o: mansearch_const.c config.h manpath.h mansearch.h +mansearch_const.o: mansearch_const.c config.h mansearch.h mdoc.o: mdoc.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h mdoc_argv.o: mdoc_argv.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h mdoc_hash.o: mdoc_hash.c config.h mdoc.h libmdoc.h -mdoc_html.o: mdoc_html.c config.h mandoc.h mandoc_aux.h out.h html.h mdoc.h main.h +mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mdoc.h out.h html.h main.h mdoc_macro.o: mdoc_macro.c config.h mdoc.h mandoc.h libmdoc.h libmandoc.h mdoc_man.o: mdoc_man.c config.h mandoc.h mandoc_aux.h out.h man.h mdoc.h main.h mdoc_term.o: mdoc_term.c config.h mandoc.h mandoc_aux.h out.h term.h mdoc.h main.h mdoc_validate.o: mdoc_validate.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h -msec.o: msec.c config.h mandoc.h libmandoc.h msec.in +msec.o: msec.c config.h libmandoc.h msec.in out.o: out.c config.h mandoc_aux.h mandoc.h out.h preconv.o: preconv.c config.h mandoc.h libmandoc.h -read.o: read.c config.h mandoc.h mandoc_aux.h libmandoc.h mdoc.h man.h main.h +read.o: read.c config.h mandoc.h mandoc_aux.h libmandoc.h mdoc.h man.h roff.o: roff.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h predefs.in st.o: st.c config.h mdoc.h libmdoc.h st.in tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h @@ -53,7 +53,7 @@ tbl_opts.o: tbl_opts.c config.h mandoc.h libmandoc.h libroff.h tbl_term.o: tbl_term.c config.h mandoc.h out.h term.h term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h main.h -term_ps.o: term_ps.c config.h mandoc.h mandoc_aux.h out.h main.h term.h +term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h main.h tree.o: tree.c config.h mandoc.h mdoc.h man.h main.h test-dirent-namlen.o: test-dirent-namlen.c test-fgetln.o: test-fgetln.c diff --git a/html.h b/html.h index fe7839a7..a7ce65dd 100644 --- a/html.h +++ b/html.h @@ -1,4 +1,4 @@ -/* $Id: html.h,v 1.68 2014/12/01 04:05:31 schwarze Exp $ */ +/* $Id: html.h,v 1.69 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * @@ -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/libmandoc.h b/libmandoc.h index 0e554eb8..6aa8b8dc 100644 --- a/libmandoc.h +++ b/libmandoc.h @@ -1,4 +1,4 @@ -/* $Id: libmandoc.h,v 1.50 2014/12/01 04:05:32 schwarze Exp $ */ +/* $Id: libmandoc.h,v 1.51 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -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/libroff.h b/libroff.h index 55d3a42b..dd7ad75a 100644 --- a/libroff.h +++ b/libroff.h @@ -1,4 +1,4 @@ -/* $Id: libroff.h,v 1.32 2014/12/01 04:05:32 schwarze Exp $ */ +/* $Id: libroff.h,v 1.33 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -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/main.h b/main.h index 29fc0c07..147c22f5 100644 --- a/main.h +++ b/main.h @@ -1,4 +1,4 @@ -/* $Id: main.h,v 1.18 2014/12/01 04:05:32 schwarze Exp $ */ +/* $Id: main.h,v 1.19 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * @@ -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/man_hash.c b/man_hash.c index c52add28..1cbfb1b7 100644 --- a/man_hash.c +++ b/man_hash.c @@ -1,4 +1,4 @@ -/* $Id: man_hash.c,v 1.28 2014/08/10 23:54:41 schwarze Exp $ */ +/* $Id: man_hash.c,v 1.29 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -24,7 +24,6 @@ #include #include "man.h" -#include "mandoc.h" #include "libman.h" #define HASH_DEPTH 6 diff --git a/man_html.c b/man_html.c index 6fe40a97..78228d91 100644 --- a/man_html.c +++ b/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.104 2014/09/27 11:17:19 kristaps Exp $ */ +/* $Id: man_html.c,v 1.105 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -25,11 +25,10 @@ #include #include -#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/mandoc.h b/mandoc.h index 29eeb995..e4cdccbc 100644 --- a/mandoc.h +++ b/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.175 2014/12/01 04:14:14 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.176 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -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/mansearch.h b/mansearch.h index b625783e..14ec8cea 100644 --- a/mansearch.h +++ b/mansearch.h @@ -1,4 +1,4 @@ -/* $Id: mansearch.h,v 1.22 2014/12/01 04:05:32 schwarze Exp $ */ +/* $Id: mansearch.h,v 1.23 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -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/mansearch_const.c b/mansearch_const.c index 9ba8bc25..61351c3c 100644 --- a/mansearch_const.c +++ b/mansearch_const.c @@ -1,4 +1,4 @@ -/* $Id: mansearch_const.c,v 1.6 2014/08/10 23:54:41 schwarze Exp $ */ +/* $Id: mansearch_const.c,v 1.7 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2014 Ingo Schwarze * @@ -20,7 +20,6 @@ #include -#include "manpath.h" #include "mansearch.h" const int mansearch_keymax = 40; diff --git a/mdoc_html.c b/mdoc_html.c index dd1d9970..706b0560 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.214 2014/11/30 05:29:00 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.215 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -26,11 +26,10 @@ #include #include -#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/msec.c b/msec.c index 2d0d85bb..ffe5024f 100644 --- a/msec.c +++ b/msec.c @@ -1,4 +1,4 @@ -/* $Id: msec.c,v 1.12 2014/08/10 23:54:41 schwarze Exp $ */ +/* $Id: msec.c,v 1.13 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -20,7 +20,6 @@ #include -#include "mandoc.h" #include "libmandoc.h" #define LINE(x, y) \ diff --git a/out.h b/out.h index bf8016a6..cc218f4f 100644 --- a/out.h +++ b/out.h @@ -1,4 +1,4 @@ -/* $Id: out.h,v 1.25 2014/12/01 04:05:32 schwarze Exp $ */ +/* $Id: out.h,v 1.26 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * @@ -50,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); } \ @@ -62,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/term.h b/term.h index 180d38f4..e9190a2d 100644 --- a/term.h +++ b/term.h @@ -1,4 +1,4 @@ -/* $Id: term.h,v 1.106 2014/12/01 04:05:32 schwarze Exp $ */ +/* $Id: term.h,v 1.107 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -16,10 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -__BEGIN_DECLS - -struct termp; - enum termenc { TERMENC_ASCII, TERMENC_LOCALE, @@ -42,6 +38,8 @@ enum termfont { #define TERM_MAXMARGIN 100000 /* FIXME */ +struct termp; + typedef void (*term_margin)(struct termp *, const void *); struct termp_tbl { @@ -102,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/term_ps.c b/term_ps.c index 2f0b434a..e3299d70 100644 --- a/term_ps.c +++ b/term_ps.c @@ -1,4 +1,4 @@ -/* $Id: term_ps.c,v 1.69 2014/11/20 13:56:20 schwarze Exp $ */ +/* $Id: term_ps.c,v 1.70 2014/12/01 08:05:52 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -27,11 +27,10 @@ #include #include -#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 -- cgit v1.2.3-56-ge451