1 /* $Id: mdoc.h,v 1.144 2015/11/07 14:01:16 schwarze Exp $ */
3 * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4 * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
145 MDOC_Split
, /* -split */
146 MDOC_Nosplit
, /* -nospli */
147 MDOC_Ragged
, /* -ragged */
148 MDOC_Unfilled
, /* -unfilled */
149 MDOC_Literal
, /* -literal */
150 MDOC_File
, /* -file */
151 MDOC_Offset
, /* -offset */
152 MDOC_Bullet
, /* -bullet */
153 MDOC_Dash
, /* -dash */
154 MDOC_Hyphen
, /* -hyphen */
155 MDOC_Item
, /* -item */
156 MDOC_Enum
, /* -enum */
158 MDOC_Diag
, /* -diag */
159 MDOC_Hang
, /* -hang */
160 MDOC_Ohang
, /* -ohang */
161 MDOC_Inset
, /* -inset */
162 MDOC_Column
, /* -column */
163 MDOC_Width
, /* -width */
164 MDOC_Compact
, /* -compact */
166 MDOC_Filled
, /* -filled */
167 MDOC_Words
, /* -words */
168 MDOC_Emphasis
, /* -emphasis */
169 MDOC_Symbolic
, /* -symbolic */
170 MDOC_Nested
, /* -nested */
171 MDOC_Centred
, /* -centered */
176 * An argument to a macro (multiple values = `-column xxx yyy').
179 enum mdocargt arg
; /* type of argument */
182 size_t sz
; /* elements in "value" */
183 char **value
; /* argument strings */
187 * Reference-counted macro arguments. These are refcounted because
188 * blocks have multiple instances of the same arguments spread across
189 * the HEAD, BODY, TAIL, and BLOCK node types.
193 struct mdoc_argv
*argv
;
199 LIST_bullet
, /* -bullet */
200 LIST_column
, /* -column */
201 LIST_dash
, /* -dash */
202 LIST_diag
, /* -diag */
203 LIST_enum
, /* -enum */
204 LIST_hang
, /* -hang */
205 LIST_hyphen
, /* -hyphen */
206 LIST_inset
, /* -inset */
207 LIST_item
, /* -item */
208 LIST_ohang
, /* -ohang */
215 DISP_centered
, /* -centered */
216 DISP_ragged
, /* -ragged */
217 DISP_unfilled
, /* -unfilled */
218 DISP_filled
, /* -filled */
219 DISP_literal
/* -literal */
224 AUTH_split
, /* -split */
225 AUTH_nosplit
/* -nosplit */
230 FONT_Em
, /* Em, -emphasis */
231 FONT_Li
, /* Li, -literal */
232 FONT_Sy
/* Sy, -symbolic */
236 const char *offs
; /* -offset */
237 enum mdoc_disp type
; /* -ragged, etc. */
238 int comp
; /* -compact */
242 const char *width
; /* -width */
243 const char *offs
; /* -offset */
244 enum mdoc_list type
; /* -tag, -enum, etc. */
245 int comp
; /* -compact */
246 size_t ncols
; /* -column arg count */
247 const char **cols
; /* -column val ptr */
248 int count
; /* -enum counter */
252 enum mdoc_font font
; /* font */
256 enum mdoc_auth auth
; /* -split, etc. */
260 int quote_T
; /* whether to quote %T */
264 * Consists of normalised node arguments. These should be used instead
265 * of iterating through the mdoc_arg pointers of a node: defaults are
273 struct roff_node
*Es
;
277 /* Names of macros. */
278 extern const char *const *mdoc_macronames
;
280 /* Names of macro args. Index is enum mdocargt. */
281 extern const char *const *mdoc_argnames
;
284 void mdoc_validate(struct roff_man
*);