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