]>
git.cameronkatri.com Git - mandoc.git/blob - term.h
db35ed70dce9b707e1706bc30f9d167cb7415cc1
1 /* $Id: term.h,v 1.22 2009/03/14 12:35:02 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,
90 #define TERMP_NOSPACE (1 << 0) /* No space before words. */
91 #define TERMP_NOLPAD (1 << 1) /* No leftpad before flush. */
92 #define TERMP_NOBREAK (1 << 2) /* No break after flush. */
93 #define TERMP_LITERAL (1 << 3) /* Literal words. */
94 #define TERMP_IGNDELIM (1 << 4) /* Delims like regulars. */
95 #define TERMP_NONOSPACE (1 << 5) /* No space (no autounset). */
96 #define TERMP_NONOBREAK (1 << 7) /* Don't newln NOBREAK. */
98 #define TERMP_STYLE 0xff00 /* Style mask. */
99 #define TERMP_BOLD (1 << 8) /* Styles... */
100 #define TERMP_UNDER (1 << 9)
101 #define TERMP_BLUE (1 << 10)
102 #define TERMP_RED (1 << 11)
103 #define TERMP_YELLOW (1 << 12)
104 #define TERMP_MAGENTA (1 << 13)
105 #define TERMP_CYAN (1 << 14)
106 #define TERMP_GREEN (1 << 15)
108 struct termsym
*symtab
; /* Special-symbol table. */
109 enum termenc enc
; /* Encoding. */
113 struct termpair
*ppair
;
115 #define TERMPAIR_FLAG (1 << 0)
122 #define TERMPAIR_SETFLAG(termp, p, fl) \
124 assert(! (TERMPAIR_FLAG & (p)->type)); \
125 (termp)->flags |= (fl); \
127 (p)->type |= TERMPAIR_FLAG; \
131 int (*pre
)(struct termp
*,
133 const struct mdoc_meta
*,
134 const struct mdoc_node
*);
135 void (*post
)(struct termp
*,
137 const struct mdoc_meta
*,
138 const struct mdoc_node
*);
141 void newln(struct termp
*);
142 void vspace(struct termp
*);
143 void word(struct termp
*, const char *);
144 void flushln(struct termp
*);
145 void transcode(struct termp
*,
146 const char *, size_t);
147 void subtree(struct termp
*,
148 const struct mdoc_meta
*,
149 const struct mdoc_node
*);
152 const struct termact
*termacts
;