Print this page
9718 update mandoc to 1.14.4
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/mandoc/html.h
+++ new/usr/src/cmd/mandoc/html.h
1 -/* $Id: html.h,v 1.87 2017/07/08 14:51:04 schwarze Exp $ */
1 +/* $Id: html.h,v 1.92 2018/06/25 16:54:59 schwarze Exp $ */
2 2 /*
3 3 * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
4 - * Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
4 + * Copyright (c) 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
5 5 *
6 6 * Permission to use, copy, modify, and distribute this software for any
7 7 * purpose with or without fee is hereby granted, provided that the above
8 8 * copyright notice and this permission notice appear in all copies.
9 9 *
10 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
16 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17 */
18 18
19 19 enum htmltag {
20 20 TAG_HTML,
21 21 TAG_HEAD,
22 22 TAG_BODY,
23 23 TAG_META,
24 24 TAG_TITLE,
25 25 TAG_DIV,
26 + TAG_IDIV,
26 27 TAG_H1,
27 28 TAG_H2,
28 29 TAG_SPAN,
29 30 TAG_LINK,
30 31 TAG_BR,
31 32 TAG_A,
32 33 TAG_TABLE,
33 - TAG_COLGROUP,
34 - TAG_COL,
35 34 TAG_TR,
36 35 TAG_TD,
37 36 TAG_LI,
38 37 TAG_UL,
39 38 TAG_OL,
40 39 TAG_DL,
41 40 TAG_DT,
42 41 TAG_DD,
43 42 TAG_PRE,
44 43 TAG_VAR,
45 44 TAG_CITE,
46 45 TAG_B,
47 46 TAG_I,
48 47 TAG_CODE,
49 48 TAG_SMALL,
50 49 TAG_STYLE,
51 50 TAG_MATH,
52 51 TAG_MROW,
53 52 TAG_MI,
54 53 TAG_MN,
55 54 TAG_MO,
56 55 TAG_MSUP,
57 56 TAG_MSUB,
58 57 TAG_MSUBSUP,
59 58 TAG_MFRAC,
60 59 TAG_MSQRT,
61 60 TAG_MFENCED,
62 61 TAG_MTABLE,
63 62 TAG_MTR,
64 63 TAG_MTD,
65 64 TAG_MUNDEROVER,
66 65 TAG_MUNDER,
67 66 TAG_MOVER,
68 67 TAG_MAX
69 68 };
70 69
71 70 enum htmlfont {
72 71 HTMLFONT_NONE = 0,
73 72 HTMLFONT_BOLD,
74 73 HTMLFONT_ITALIC,
75 74 HTMLFONT_BI,
76 75 HTMLFONT_MAX
77 76 };
78 77
79 78 struct tag {
80 79 struct tag *next;
81 80 enum htmltag tag;
82 81 };
83 82
84 83 struct html {
85 84 int flags;
86 85 #define HTML_NOSPACE (1 << 0) /* suppress next space */
87 86 #define HTML_IGNDELIM (1 << 1)
88 87 #define HTML_KEEP (1 << 2)
89 88 #define HTML_PREKEEP (1 << 3)
90 89 #define HTML_NONOSPACE (1 << 4) /* never add spaces */
91 90 #define HTML_LITERAL (1 << 5) /* literal (e.g., <PRE>) context */
92 91 #define HTML_SKIPCHAR (1 << 6) /* skip the next character */
93 92 #define HTML_NOSPLIT (1 << 7) /* do not break line before .An */
94 93 #define HTML_SPLIT (1 << 8) /* break line before .An */
95 94 #define HTML_NONEWLINE (1 << 9) /* No line break in nofill mode. */
96 95 #define HTML_BUFFER (1 << 10) /* Collect a word to see if it fits. */
97 96 size_t indent; /* current output indentation level */
98 97 int noindent; /* indent disabled by <pre> */
99 98 size_t col; /* current output byte position */
100 99 size_t bufcol; /* current buf byte position */
101 100 char buf[80]; /* output buffer */
102 101 struct tag *tag; /* last open tag */
103 102 struct rofftbl tbl; /* current table */
104 103 struct tag *tblt; /* current open table scope */
105 104 char *base_man; /* base for manpage href */
106 105 char *base_includes; /* base for include href */
107 106 char *style; /* style-sheet URI */
108 107 struct tag *metaf; /* current open font scope */
109 108 enum htmlfont metal; /* last used font */
110 109 enum htmlfont metac; /* current font mode */
111 110 int oflags; /* output options */
↓ open down ↓ |
67 lines elided |
↑ open up ↑ |
112 111 #define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */
113 112 };
114 113
115 114
116 115 struct roff_node;
117 116 struct tbl_span;
118 117 struct eqn_box;
119 118
120 119 void roff_html_pre(struct html *, const struct roff_node *);
121 120
121 +void print_gen_comment(struct html *, struct roff_node *);
122 122 void print_gen_decls(struct html *);
123 123 void print_gen_head(struct html *);
124 124 struct tag *print_otag(struct html *, enum htmltag, const char *, ...);
125 125 void print_tagq(struct html *, const struct tag *);
126 126 void print_stagq(struct html *, const struct tag *);
127 127 void print_text(struct html *, const char *);
128 128 void print_tblclose(struct html *);
129 129 void print_tbl(struct html *, const struct tbl_span *);
130 130 void print_eqn(struct html *, const struct eqn_box *);
131 131 void print_paragraph(struct html *);
132 132 void print_endline(struct html *);
133 133
134 -char *html_make_id(const struct roff_node *);
135 -int html_strlen(const char *);
134 +char *html_make_id(const struct roff_node *, int);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX