]>
git.cameronkatri.com Git - mandoc.git/blob - term.h
1 /* $Id: term.h,v 1.16 2009/03/03 22:17:19 kristaps Exp $ */
3 * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the
7 * above copyright notice and this permission notice appear in all
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
50 TERMSYM_PLUSMINUS
= 21,
60 TERMSYM_ASTERISK
= 31,
88 #define TERMP_BOLD (1 << 0) /* Embolden words. */
89 #define TERMP_UNDERLINE (1 << 1) /* Underline words. */
90 #define TERMP_NOSPACE (1 << 2) /* No space before words. */
91 #define TERMP_NOLPAD (1 << 3) /* No leftpad before flush. */
92 #define TERMP_NOBREAK (1 << 4) /* No break after flush. */
93 #define TERMP_LITERAL (1 << 5) /* Literal words. */
94 #define TERMP_IGNDELIM (1 << 6) /* Delims like regulars. */
95 #define TERMP_NONOSPACE (1 << 7) /* No space (no autounset). */
96 #define TERMP_NORPAD (1 << 8) /* No rightpad. */
97 #define TERMP_NOINSET (1 << 9) /* If NOBREAK, no inset. */
99 struct termsym
*symtab
; /* Special-symbol table. */
100 struct termsym
*styletab
; /* Style table. */
104 struct termpair
*ppair
;
106 #define TERMPAIR_FLAG (1 << 0)
113 #define TERMPAIR_SETFLAG(termp, p, fl) \
115 assert(! (TERMPAIR_FLAG & (p)->type)); \
116 (termp)->flags |= (fl); \
118 (p)->type |= TERMPAIR_FLAG; \
122 int (*pre
)(struct termp
*,
124 const struct mdoc_meta
*,
125 const struct mdoc_node
*);
126 void (*post
)(struct termp
*,
128 const struct mdoc_meta
*,
129 const struct mdoc_node
*);
132 void newln(struct termp
*);
133 void vspace(struct termp
*);
134 void word(struct termp
*, const char *);
135 void flushln(struct termp
*);
136 void transcode(struct termp
*,
137 const char *, size_t);
138 void subtree(struct termp
*,
139 const struct mdoc_meta
*,
140 const struct mdoc_node
*);
143 const struct termact
*termacts
;