mdoc.h (ae2efdd8) mdoc.h (d1982c71)
1/* $OpenBSD: mdoc.h,v 1.61 2015/02/12 12:20:47 schwarze Exp $ */
1/* $OpenBSD: mdoc.h,v 1.62 2015/04/02 21:03:18 schwarze Exp $ */
2/*
3 * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4 * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
5 *
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.
9 *
2/*
3 * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4 * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
5 *
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.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
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.
17 */
18
19enum mdoct {
20 MDOC_Ap = 0,

--- 148 unchanged lines hidden (view full) ---

169 MDOC_Words, /* -words */
170 MDOC_Emphasis, /* -emphasis */
171 MDOC_Symbolic, /* -symbolic */
172 MDOC_Nested, /* -nested */
173 MDOC_Centred, /* -centered */
174 MDOC_ARG_MAX
175};
176
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.
17 */
18
19enum mdoct {
20 MDOC_Ap = 0,

--- 148 unchanged lines hidden (view full) ---

169 MDOC_Words, /* -words */
170 MDOC_Emphasis, /* -emphasis */
171 MDOC_Symbolic, /* -symbolic */
172 MDOC_Nested, /* -nested */
173 MDOC_Centred, /* -centered */
174 MDOC_ARG_MAX
175};
176
177enum mdoc_type {
178 MDOC_TEXT,
179 MDOC_ELEM,
180 MDOC_HEAD,
181 MDOC_TAIL,
182 MDOC_BODY,
183 MDOC_BLOCK,
184 MDOC_TBL,
185 MDOC_EQN,
186 MDOC_ROOT
187};
188
189/*
190 * Section (named/unnamed) of `Sh'. Note that these appear in the
191 * conventional order imposed by mdoc.7. In the case of SEC_NONE, no
192 * section has been invoked (this shouldn't happen). SEC_CUSTOM refers
193 * to other sections.
194 */
195enum mdoc_sec {
196 SEC_NONE = 0,

--- 161 unchanged lines hidden (view full) ---

358#define MDOC_VALID (1 << 0) /* has been validated */
359#define MDOC_ENDED (1 << 1) /* gone past body end mark */
360#define MDOC_EOS (1 << 2) /* at sentence boundary */
361#define MDOC_LINE (1 << 3) /* first macro/text on line */
362#define MDOC_SYNPRETTY (1 << 4) /* SYNOPSIS-style formatting */
363#define MDOC_BROKEN (1 << 5) /* must validate parent when ending */
364#define MDOC_DELIMO (1 << 6)
365#define MDOC_DELIMC (1 << 7)
177/*
178 * Section (named/unnamed) of `Sh'. Note that these appear in the
179 * conventional order imposed by mdoc.7. In the case of SEC_NONE, no
180 * section has been invoked (this shouldn't happen). SEC_CUSTOM refers
181 * to other sections.
182 */
183enum mdoc_sec {
184 SEC_NONE = 0,

--- 161 unchanged lines hidden (view full) ---

346#define MDOC_VALID (1 << 0) /* has been validated */
347#define MDOC_ENDED (1 << 1) /* gone past body end mark */
348#define MDOC_EOS (1 << 2) /* at sentence boundary */
349#define MDOC_LINE (1 << 3) /* first macro/text on line */
350#define MDOC_SYNPRETTY (1 << 4) /* SYNOPSIS-style formatting */
351#define MDOC_BROKEN (1 << 5) /* must validate parent when ending */
352#define MDOC_DELIMO (1 << 6)
353#define MDOC_DELIMC (1 << 7)
366 enum mdoc_type type; /* AST node type */
354 enum roff_type type; /* AST node type */
367 enum mdoc_sec sec; /* current named section */
368 union mdoc_data *norm; /* normalised args */
369 int prev_font; /* before entering this node */
370 /* FIXME: these can be union'd to shave a few bytes. */
371 struct mdoc_arg *args; /* BLOCK/ELEM */
372 struct mdoc_node *head; /* BLOCK */
373 struct mdoc_node *body; /* BLOCK/ENDBODY */
374 struct mdoc_node *tail; /* BLOCK */

--- 21 unchanged lines hidden ---
355 enum mdoc_sec sec; /* current named section */
356 union mdoc_data *norm; /* normalised args */
357 int prev_font; /* before entering this node */
358 /* FIXME: these can be union'd to shave a few bytes. */
359 struct mdoc_arg *args; /* BLOCK/ELEM */
360 struct mdoc_node *head; /* BLOCK */
361 struct mdoc_node *body; /* BLOCK/ENDBODY */
362 struct mdoc_node *tail; /* BLOCK */

--- 21 unchanged lines hidden ---