1/*
2 * Copyright 1990 Sun Microsystems, Inc.  All rights reserved.
3 * Use is subject to license terms.
4 */
5
6/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
7/*	  All Rights Reserved  	*/
8
9/*
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
13 */
14
15#pragma ident	"%Z%%M%	%I%	%E% SMI"
16
17 /* tf.c: save and restore fill mode around table */
18# include "t..c"
19
20void
21savefill(void)
22{
23/* remembers various things: fill mode, vs, ps in mac 35 (SF) */
24fprintf(tabout, ".de %d\n",SF);
25fprintf(tabout, ".ps \\n(.s\n");
26fprintf(tabout, ".vs \\n(.vu\n");
27fprintf(tabout, ".in \\n(.iu\n");
28fprintf(tabout, ".if \\n(.u .fi\n");
29fprintf(tabout, ".if \\n(.j .ad\n");
30fprintf(tabout, ".if \\n(.j=0 .na\n");
31fprintf(tabout, "..\n");
32fprintf(tabout, ".nf\n");
33/* set obx offset if useful */
34fprintf(tabout, ".nr #~ 0\n");
35fprintf(tabout, ".if n .nr #~ 0.6n\n");
36}
37
38void
39rstofill(void)
40{
41fprintf(tabout, ".%d\n",SF);
42}
43
44void
45endoff(void)
46{
47int i;
48	for(i=0; i<MAXHEAD; i++)
49		if (linestop[i])
50			fprintf(tabout, ".nr #%c 0\n", 'a'+i);
51	for(i=0; i<texct; i++)
52		fprintf(tabout, ".rm %c+\n",texstr[i]);
53fprintf(tabout, "%s\n", last);
54}
55
56void
57ifdivert(void)
58{
59fprintf(tabout, ".ds #d .d\n");
60fprintf(tabout, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
61}
62
63void
64saveline(void)
65{
66fprintf(tabout, ".if \\n+(b.=1 .nr d. \\n(.c-\\n(c.-1\n");
67linstart=iline;
68}
69
70void
71restline(void)
72{
73fprintf(tabout,".if \\n-(b.=0 .nr c. \\n(.c-\\n(d.-%d\n", iline-linstart);
74linstart = 0;
75}
76
77void
78cleanfc(void)
79{
80fprintf(tabout, ".fc\n");
81}
82