]>
git.cameronkatri.com Git - mandoc.git/blob - term.h
95e75d2af55fd7f32d8c5c8f5265529efe4ec864
1 /* $Id: term.h,v 1.12 2009/03/01 13:06:49 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.
33 #define TERMP_BOLD (1 << 0) /* Embolden words. */
34 #define TERMP_UNDERLINE (1 << 1) /* Underline words. */
35 #define TERMP_NOSPACE (1 << 2) /* No space before words. */
36 #define TERMP_NOLPAD (1 << 3) /* No leftpad before flush. */
37 #define TERMP_NOBREAK (1 << 4) /* No break after flush. */
38 #define TERMP_LITERAL (1 << 5) /* Literal words. */
39 #define TERMP_IGNDELIM (1 << 6) /* Delims like regulars. */
40 #define TERMP_NONOSPACE (1 << 7) /* No space (no autounset). */
45 struct termpair
*ppair
;
47 #define TERMPAIR_FLAG (1 << 0)
54 #define TERMPAIR_SETFLAG(termp, p, fl) \
56 assert(! (TERMPAIR_FLAG & (p)->type)); \
57 (termp)->flags |= (fl); \
59 (p)->type |= TERMPAIR_FLAG; \
63 int (*pre
)(struct termp
*,
65 const struct mdoc_meta
*,
66 const struct mdoc_node
*);
67 void (*post
)(struct termp
*,
69 const struct mdoc_meta
*,
70 const struct mdoc_node
*);
73 void newln(struct termp
*);
74 void vspace(struct termp
*);
75 void word(struct termp
*, const char *);
76 void flushln(struct termp
*);
77 void transcode(struct termp
*,
78 const char *, size_t);
80 void subtree(struct termp
*,
81 const struct mdoc_meta
*,
82 const struct mdoc_node
*);
84 const struct termact
*termacts
;