]>
git.cameronkatri.com Git - mandoc.git/blob - term.c
1 /* $Id: term.c,v 1.11 2009/02/23 09:46:59 kristaps Exp $ */
3 * Copyright (c) 2009 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.
28 * Performs actions on nodes of the abstract syntax tree. Both pre- and
29 * post-fix operations are defined here.
32 /* FIXME: indent/tab. */
35 #define TTYPE_CMD_FLAG 1
36 #define TTYPE_CMD_ARG 2
37 #define TTYPE_SECTION 3
38 #define TTYPE_FUNC_DECL 4
39 #define TTYPE_VAR_DECL 5
40 #define TTYPE_FUNC_TYPE 6
41 #define TTYPE_FUNC_NAME 7
42 #define TTYPE_FUNC_ARG 8
44 #define TTYPE_SSECTION 10
50 * These define "styles" for element types, like command arguments or
51 * executable names. This is useful when multiple macros must decorate
52 * the same thing (like .Ex -std cmd and .Nm cmd).
55 const int ttypes
[TTYPE_NMAX
] = {
56 TERMP_BOLD
, /* TTYPE_PROG */
57 TERMP_BOLD
, /* TTYPE_CMD_FLAG */
58 TERMP_UNDERLINE
, /* TTYPE_CMD_ARG */
59 TERMP_BOLD
, /* TTYPE_SECTION */
60 TERMP_BOLD
, /* TTYPE_FUNC_DECL */
61 TERMP_UNDERLINE
, /* TTYPE_VAR_DECL */
62 TERMP_UNDERLINE
, /* TTYPE_FUNC_TYPE */
63 TERMP_BOLD
, /* TTYPE_FUNC_NAME */
64 TERMP_UNDERLINE
, /* TTYPE_FUNC_ARG */
65 TERMP_UNDERLINE
, /* TTYPE_LINK */
66 TERMP_BOLD
, /* TTYPE_SSECTION */
67 TERMP_UNDERLINE
, /* TTYPE_FILE */
68 TERMP_UNDERLINE
/* TTYPE_EMPH */
71 static int arg_hasattr(int, size_t,
72 const struct mdoc_arg
*);
73 static int arg_getattr(int, size_t,
74 const struct mdoc_arg
*);
75 static size_t arg_offset(const char *);
78 * What follows describes prefix and postfix operations for the abstract
79 * syntax tree descent.
84 const struct mdoc_meta *meta, \
85 const struct mdoc_node *node
87 #define DECL_PRE(name) \
88 static int name##_pre(DECL_ARGS)
89 #define DECL_POST(name) \
90 static void name##_post(DECL_ARGS)
91 #define DECL_PREPOST(name) \
95 DECL_PREPOST(termp_aq
);
96 DECL_PREPOST(termp_ar
);
97 DECL_PREPOST(termp_d1
);
98 DECL_PREPOST(termp_dq
);
99 DECL_PREPOST(termp_em
);
100 DECL_PREPOST(termp_fa
);
101 DECL_PREPOST(termp_fd
);
102 DECL_PREPOST(termp_fl
);
103 DECL_PREPOST(termp_fn
);
104 DECL_PREPOST(termp_ft
);
105 DECL_PREPOST(termp_it
);
106 DECL_PREPOST(termp_nm
);
107 DECL_PREPOST(termp_op
);
108 DECL_PREPOST(termp_pa
);
109 DECL_PREPOST(termp_pf
);
110 DECL_PREPOST(termp_qo
);
111 DECL_PREPOST(termp_qq
);
112 DECL_PREPOST(termp_sh
);
113 DECL_PREPOST(termp_ss
);
114 DECL_PREPOST(termp_sq
);
115 DECL_PREPOST(termp_sx
);
116 DECL_PREPOST(termp_va
);
117 DECL_PREPOST(termp_vt
);
132 const struct termact __termacts
[MDOC_MAX
] = {
133 { NULL
, NULL
}, /* \" */
134 { NULL
, NULL
}, /* Dd */
135 { NULL
, NULL
}, /* Dt */
136 { NULL
, NULL
}, /* Os */
137 { termp_sh_pre
, termp_sh_post
}, /* Sh */
138 { termp_ss_pre
, termp_ss_post
}, /* Ss */
139 { termp_pp_pre
, NULL
}, /* Pp */
140 { termp_d1_pre
, termp_d1_post
}, /* D1 */
141 { NULL
, NULL
}, /* Dl */
142 { termp_bd_pre
, NULL
}, /* Bd */
143 { NULL
, NULL
}, /* Ed */
144 { NULL
, termp_bl_post
}, /* Bl */
145 { NULL
, NULL
}, /* El */
146 { termp_it_pre
, termp_it_post
}, /* It */
147 { NULL
, NULL
}, /* Ad */
148 { NULL
, NULL
}, /* An */
149 { termp_ar_pre
, termp_ar_post
}, /* Ar */
150 { NULL
, NULL
}, /* Cd */
151 { NULL
, NULL
}, /* Cm */
152 { NULL
, NULL
}, /* Dv */
153 { NULL
, NULL
}, /* Er */
154 { NULL
, NULL
}, /* Ev */
155 { termp_ex_pre
, NULL
}, /* Ex */
156 { termp_fa_pre
, termp_fa_post
}, /* Fa */
157 { termp_fd_pre
, termp_fd_post
}, /* Fd */
158 { termp_fl_pre
, termp_fl_post
}, /* Fl */
159 { termp_fn_pre
, termp_fn_post
}, /* Fn */
160 { termp_ft_pre
, termp_ft_post
}, /* Ft */
161 { NULL
, NULL
}, /* Ic */
162 { NULL
, NULL
}, /* In */
163 { NULL
, NULL
}, /* Li */
164 { termp_nd_pre
, NULL
}, /* Nd */
165 { termp_nm_pre
, termp_nm_post
}, /* Nm */
166 { termp_op_pre
, termp_op_post
}, /* Op */
167 { NULL
, NULL
}, /* Ot */
168 { termp_pa_pre
, termp_pa_post
}, /* Pa */
169 { NULL
, NULL
}, /* Rv */
170 { NULL
, NULL
}, /* St */
171 { termp_va_pre
, termp_va_post
}, /* Va */
172 { termp_vt_pre
, termp_vt_post
}, /* Vt */
173 { termp_xr_pre
, NULL
}, /* Xr */
174 { NULL
, NULL
}, /* %A */
175 { NULL
, NULL
}, /* %B */
176 { NULL
, NULL
}, /* %D */
177 { NULL
, NULL
}, /* %I */
178 { NULL
, NULL
}, /* %J */
179 { NULL
, NULL
}, /* %N */
180 { NULL
, NULL
}, /* %O */
181 { NULL
, NULL
}, /* %P */
182 { NULL
, NULL
}, /* %R */
183 { NULL
, NULL
}, /* %T */
184 { NULL
, NULL
}, /* %V */
185 { NULL
, NULL
}, /* Ac */
186 { NULL
, NULL
}, /* Ao */
187 { termp_aq_pre
, termp_aq_post
}, /* Aq */
188 { NULL
, NULL
}, /* At */
189 { NULL
, NULL
}, /* Bc */
190 { NULL
, NULL
}, /* Bf */
191 { NULL
, NULL
}, /* Bo */
192 { NULL
, NULL
}, /* Bq */
193 { NULL
, NULL
}, /* Bsx */
194 { termp_bx_pre
, NULL
}, /* Bx */
195 { NULL
, NULL
}, /* Db */
196 { NULL
, NULL
}, /* Dc */
197 { NULL
, NULL
}, /* Do */
198 { termp_dq_pre
, termp_dq_post
}, /* Dq */
199 { NULL
, NULL
}, /* Ec */
200 { NULL
, NULL
}, /* Ef */
201 { termp_em_pre
, termp_em_post
}, /* Em */
202 { NULL
, NULL
}, /* Eo */
203 { NULL
, NULL
}, /* Fx */
204 { NULL
, NULL
}, /* Ms */
205 { NULL
, NULL
}, /* No */
206 { termp_ns_pre
, NULL
}, /* Ns */
207 { termp_nx_pre
, NULL
}, /* Nx */
208 { termp_ox_pre
, NULL
}, /* Ox */
209 { NULL
, NULL
}, /* Pc */
210 { termp_pf_pre
, termp_pf_post
}, /* Pf */
211 { NULL
, NULL
}, /* Po */
212 { NULL
, NULL
}, /* Pq */
213 { NULL
, NULL
}, /* Qc */
214 { NULL
, NULL
}, /* Ql */
215 { termp_qo_pre
, termp_qo_post
}, /* Qo */
216 { termp_qq_pre
, termp_qq_post
}, /* Qq */
217 { NULL
, NULL
}, /* Re */
218 { NULL
, NULL
}, /* Rs */
219 { NULL
, NULL
}, /* Sc */
220 { NULL
, NULL
}, /* So */
221 { termp_sq_pre
, termp_sq_post
}, /* Sq */
222 { NULL
, NULL
}, /* Sm */
223 { termp_sx_pre
, termp_sx_post
}, /* Sx */
224 { NULL
, NULL
}, /* Sy */
225 { NULL
, NULL
}, /* Tn */
226 { NULL
, NULL
}, /* Ux */
227 { NULL
, NULL
}, /* Xc */
228 { NULL
, NULL
}, /* Xo */
229 { NULL
, NULL
}, /* Fo */
230 { NULL
, NULL
}, /* Fc */
231 { NULL
, NULL
}, /* Oo */
232 { NULL
, NULL
}, /* Oc */
233 { NULL
, NULL
}, /* Bk */
234 { NULL
, NULL
}, /* Ek */
235 { NULL
, NULL
}, /* Bt */
236 { NULL
, NULL
}, /* Hf */
237 { NULL
, NULL
}, /* Fr */
238 { termp_ud_pre
, NULL
}, /* Ud */
241 const struct termact
*termacts
= __termacts
;
245 arg_offset(const char *v
)
247 if (0 == strcmp(v
, "indent"))
249 if (0 == strcmp(v
, "indent-two"))
258 arg_hasattr(int arg
, size_t argc
, const struct mdoc_arg
*argv
)
261 return(-1 != arg_getattr(arg
, argc
, argv
));
266 arg_getattr(int arg
, size_t argc
, const struct mdoc_arg
*argv
)
270 for (i
= 0; i
< (int)argc
; i
++)
271 if (argv
[i
].arg
== arg
)
279 termp_dq_pre(DECL_ARGS
)
282 if (MDOC_BODY
!= node
->type
)
286 p
->flags
|= TERMP_NOSPACE
;
293 termp_dq_post(DECL_ARGS
)
296 if (MDOC_BODY
!= node
->type
)
299 p
->flags
|= TERMP_NOSPACE
;
306 termp_it_post(DECL_ARGS
)
308 const struct mdoc_node
*n
, *it
;
309 const struct mdoc_block
*bl
;
314 * This (and termp_it_pre()) are the most complicated functions
315 * here. They must account for a considerable number of
316 * switches that completely change the output behaviour, like
317 * -tag versus -column. Yech.
320 switch (node
->type
) {
330 assert(MDOC_BLOCK
== it
->type
);
331 assert(MDOC_It
== it
->tok
);
334 assert(MDOC_BODY
== n
->type
);
335 assert(MDOC_Bl
== n
->tok
);
339 /* If `-tag', adjust our margins accordingly. */
341 if (arg_hasattr(MDOC_Tag
, bl
->argc
, bl
->argv
)) {
342 i
= arg_getattr(MDOC_Width
, bl
->argc
, bl
->argv
);
344 assert(1 == bl
->argv
[i
].sz
);
345 width
= strlen(*bl
->argv
[i
].value
); /* XXX */
347 if (MDOC_HEAD
== node
->type
) {
349 /* FIXME: nested lists. */
350 p
->rmargin
= p
->maxrmargin
;
351 p
->flags
&= ~TERMP_NOBREAK
;
354 p
->offset
-= width
+ 1;
355 p
->flags
&= ~TERMP_NOLPAD
;
360 if (arg_hasattr(MDOC_Ohang
, bl
->argc
, bl
->argv
)) {
361 i
= arg_getattr(MDOC_Offset
, bl
->argc
, bl
->argv
);
364 assert(1 == bl
->argv
[i
].sz
);
365 width
= arg_offset(*bl
->argv
[i
].value
);
377 termp_it_pre(DECL_ARGS
)
379 const struct mdoc_node
*n
, *it
;
380 const struct mdoc_block
*bl
;
385 * Also see termp_it_post() for general comments.
388 switch (node
->type
) {
401 assert(MDOC_BLOCK
== it
->type
);
402 assert(MDOC_It
== it
->tok
);
405 assert(MDOC_BODY
== n
->type
);
406 assert(MDOC_Bl
== n
->tok
);
410 /* If `-compact', don't assert vertical space. */
412 if (MDOC_BLOCK
== node
->type
) {
413 if (arg_hasattr(MDOC_Compact
, bl
->argc
, bl
->argv
))
420 assert(MDOC_HEAD
== node
->type
421 || MDOC_BODY
== node
->type
);
423 /* If `-tag', adjust our margins accordingly. */
425 if (arg_hasattr(MDOC_Tag
, bl
->argc
, bl
->argv
)) {
426 i
= arg_getattr(MDOC_Width
, bl
->argc
, bl
->argv
);
427 assert(i
>= 0); /* XXX */
428 assert(1 == bl
->argv
[i
].sz
);
429 width
= strlen(*bl
->argv
[i
].value
); /* XXX */
431 /* FIXME: nested lists. */
433 if (MDOC_HEAD
== node
->type
) {
434 p
->flags
|= TERMP_NOBREAK
;
435 p
->flags
|= TERMP_NOSPACE
;
436 p
->rmargin
= p
->offset
+ width
;
438 p
->flags
|= TERMP_NOSPACE
;
439 p
->flags
|= TERMP_NOLPAD
;
440 p
->offset
+= width
+ 1;
445 /* If `-ohang', adjust left-margin. */
447 if (arg_hasattr(MDOC_Ohang
, bl
->argc
, bl
->argv
)) {
449 i
= arg_getattr(MDOC_Offset
, bl
->argc
, bl
->argv
);
451 assert(1 == bl
->argv
[i
].sz
);
452 width
= arg_offset(*bl
->argv
[i
].value
);
455 p
->flags
|= TERMP_NOSPACE
;
466 termp_nm_post(DECL_ARGS
)
469 p
->flags
&= ~ttypes
[TTYPE_PROG
];
475 termp_fl_post(DECL_ARGS
)
478 p
->flags
&= ~ttypes
[TTYPE_CMD_FLAG
];
484 termp_ar_pre(DECL_ARGS
)
487 p
->flags
|= ttypes
[TTYPE_CMD_ARG
];
488 if (NULL
== node
->child
)
496 termp_nm_pre(DECL_ARGS
)
499 p
->flags
|= ttypes
[TTYPE_PROG
];
500 if (NULL
== node
->child
)
508 termp_ns_pre(DECL_ARGS
)
511 p
->flags
|= TERMP_NOSPACE
;
518 termp_pp_pre(DECL_ARGS
)
528 termp_ar_post(DECL_ARGS
)
531 p
->flags
&= ~ttypes
[TTYPE_CMD_ARG
];
537 termp_ex_pre(DECL_ARGS
)
541 i
= arg_getattr(MDOC_Std
, node
->data
.elem
.argc
,
542 node
->data
.elem
.argv
);
546 p
->flags
|= ttypes
[TTYPE_PROG
];
547 word(p
, *node
->data
.elem
.argv
[i
].value
);
548 p
->flags
&= ~ttypes
[TTYPE_PROG
];
549 word(p
, "utility exits 0 on success, and >0 if an error occurs.");
557 termp_nd_pre(DECL_ARGS
)
567 termp_bl_post(DECL_ARGS
)
570 if (MDOC_BLOCK
== node
->type
)
577 termp_op_post(DECL_ARGS
)
580 if (MDOC_BODY
!= node
->type
)
582 p
->flags
|= TERMP_NOSPACE
;
589 termp_sh_post(DECL_ARGS
)
592 switch (node
->type
) {
594 p
->flags
&= ~ttypes
[TTYPE_SECTION
];
609 termp_xr_pre(DECL_ARGS
)
611 const struct mdoc_node
*n
;
616 assert(MDOC_TEXT
== n
->type
);
617 word(p
, n
->data
.text
.string
);
619 if (NULL
== (n
= n
->next
))
622 assert(MDOC_TEXT
== n
->type
);
623 p
->flags
|= TERMP_NOSPACE
;
625 p
->flags
|= TERMP_NOSPACE
;
626 word(p
, n
->data
.text
.string
);
627 p
->flags
|= TERMP_NOSPACE
;
636 termp_vt_pre(DECL_ARGS
)
639 /* FIXME: this can be "type name". */
640 p
->flags
|= ttypes
[TTYPE_VAR_DECL
];
647 termp_vt_post(DECL_ARGS
)
650 p
->flags
&= ~ttypes
[TTYPE_VAR_DECL
];
651 if (node
->sec
== SEC_SYNOPSIS
)
658 termp_fd_pre(DECL_ARGS
)
662 * FIXME: this naming is bad. This value is used, in general,
663 * for the #include header or other preprocessor statement.
665 p
->flags
|= ttypes
[TTYPE_FUNC_DECL
];
672 termp_fd_post(DECL_ARGS
)
675 p
->flags
&= ~ttypes
[TTYPE_FUNC_DECL
];
676 if (node
->sec
== SEC_SYNOPSIS
)
684 termp_sh_pre(DECL_ARGS
)
687 switch (node
->type
) {
690 p
->flags
|= ttypes
[TTYPE_SECTION
];
704 termp_op_pre(DECL_ARGS
)
707 switch (node
->type
) {
710 p
->flags
|= TERMP_NOSPACE
;
721 termp_ud_pre(DECL_ARGS
)
724 word(p
, "currently under development.");
731 termp_fl_pre(DECL_ARGS
)
734 p
->flags
|= ttypes
[TTYPE_CMD_FLAG
];
736 p
->flags
|= TERMP_NOSPACE
;
743 termp_d1_pre(DECL_ARGS
)
746 if (MDOC_BODY
!= node
->type
)
756 termp_d1_post(DECL_ARGS
)
759 if (MDOC_BODY
!= node
->type
)
768 termp_aq_pre(DECL_ARGS
)
771 if (MDOC_BODY
!= node
->type
)
774 p
->flags
|= TERMP_NOSPACE
;
781 termp_aq_post(DECL_ARGS
)
784 if (MDOC_BODY
!= node
->type
)
786 p
->flags
|= TERMP_NOSPACE
;
793 termp_ft_pre(DECL_ARGS
)
796 p
->flags
|= ttypes
[TTYPE_FUNC_TYPE
];
803 termp_ft_post(DECL_ARGS
)
806 p
->flags
&= ~ttypes
[TTYPE_FUNC_TYPE
];
807 if (node
->sec
== SEC_SYNOPSIS
)
815 termp_fn_pre(DECL_ARGS
)
817 const struct mdoc_node
*n
;
820 assert(MDOC_TEXT
== node
->child
->type
);
822 /* FIXME: can be "type funcname" "type varname"... */
824 p
->flags
|= ttypes
[TTYPE_FUNC_NAME
];
825 word(p
, node
->child
->data
.text
.string
);
826 p
->flags
&= ~ttypes
[TTYPE_FUNC_NAME
];
828 p
->flags
|= TERMP_NOSPACE
;
831 p
->flags
|= TERMP_NOSPACE
;
832 for (n
= node
->child
->next
; n
; n
= n
->next
) {
833 assert(MDOC_TEXT
== n
->type
);
834 p
->flags
|= ttypes
[TTYPE_FUNC_ARG
];
835 word(p
, n
->data
.text
.string
);
836 p
->flags
&= ~ttypes
[TTYPE_FUNC_ARG
];
841 p
->flags
|= TERMP_NOSPACE
;
844 if (SEC_SYNOPSIS
== node
->sec
)
853 termp_fn_post(DECL_ARGS
)
856 if (node
->sec
== SEC_SYNOPSIS
)
864 termp_sx_pre(DECL_ARGS
)
867 p
->flags
|= ttypes
[TTYPE_LINK
];
874 termp_sx_post(DECL_ARGS
)
877 p
->flags
&= ~ttypes
[TTYPE_LINK
];
883 termp_fa_pre(DECL_ARGS
)
886 p
->flags
|= ttypes
[TTYPE_FUNC_ARG
];
893 termp_fa_post(DECL_ARGS
)
896 p
->flags
&= ~ttypes
[TTYPE_FUNC_ARG
];
902 termp_va_pre(DECL_ARGS
)
905 p
->flags
|= ttypes
[TTYPE_VAR_DECL
];
912 termp_va_post(DECL_ARGS
)
915 p
->flags
&= ~ttypes
[TTYPE_VAR_DECL
];
921 termp_bd_pre(DECL_ARGS
)
923 const struct mdoc_block
*bl
;
924 const struct mdoc_node
*n
;
926 if (MDOC_BLOCK
== node
->type
) {
929 } else if (MDOC_BODY
!= node
->type
)
932 assert(MDOC_BLOCK
== node
->parent
->type
);
934 bl
= &node
->parent
->data
.block
;
935 if ( ! arg_hasattr(MDOC_Literal
, bl
->argc
, bl
->argv
))
938 p
->flags
|= TERMP_LITERAL
;
940 for (n
= node
->child
; n
; n
= n
->next
) {
941 assert(MDOC_TEXT
== n
->type
); /* FIXME */
942 if ((*n
->data
.text
.string
)) {
943 word(p
, n
->data
.text
.string
);
950 p
->flags
&= ~TERMP_LITERAL
;
957 termp_qq_pre(DECL_ARGS
)
960 if (MDOC_BODY
!= node
->type
)
963 p
->flags
|= TERMP_NOSPACE
;
970 termp_qq_post(DECL_ARGS
)
973 if (MDOC_BODY
!= node
->type
)
975 p
->flags
|= TERMP_NOSPACE
;
982 termp_bx_pre(DECL_ARGS
)
992 termp_ox_pre(DECL_ARGS
)
1002 termp_nx_pre(DECL_ARGS
)
1012 termp_sq_pre(DECL_ARGS
)
1015 if (MDOC_BODY
!= node
->type
)
1018 p
->flags
|= TERMP_NOSPACE
;
1025 termp_sq_post(DECL_ARGS
)
1028 if (MDOC_BODY
!= node
->type
)
1030 p
->flags
|= TERMP_NOSPACE
;
1037 termp_pf_pre(DECL_ARGS
)
1040 p
->flags
|= TERMP_IGNDELIM
;
1047 termp_pf_post(DECL_ARGS
)
1050 p
->flags
&= ~TERMP_IGNDELIM
;
1051 p
->flags
|= TERMP_NOSPACE
;
1057 termp_ss_pre(DECL_ARGS
)
1060 switch (node
->type
) {
1063 p
->flags
|= ttypes
[TTYPE_SSECTION
];
1064 p
->offset
= INDENT
/ 2;
1076 termp_ss_post(DECL_ARGS
)
1079 switch (node
->type
) {
1081 p
->flags
&= ~ttypes
[TTYPE_SSECTION
];
1093 termp_pa_pre(DECL_ARGS
)
1096 p
->flags
|= ttypes
[TTYPE_FILE
];
1103 termp_pa_post(DECL_ARGS
)
1106 p
->flags
&= ~ttypes
[TTYPE_FILE
];
1112 termp_qo_pre(DECL_ARGS
)
1115 if (MDOC_BODY
!= node
->type
)
1118 p
->flags
|= TERMP_NOSPACE
;
1125 termp_qo_post(DECL_ARGS
)
1128 if (MDOC_BODY
!= node
->type
)
1130 p
->flags
|= TERMP_NOSPACE
;
1137 termp_em_pre(DECL_ARGS
)
1140 p
->flags
|= ttypes
[TTYPE_EMPH
];
1147 termp_em_post(DECL_ARGS
)
1150 p
->flags
&= ~ttypes
[TTYPE_EMPH
];