xref: /original-bsd/old/tbl/tf.c (revision a1c2194a)
1 /*-
2  * %sccs.include.proprietary.c%
3  */
4 
5 #ifndef lint
6 static char sccsid[] = "@(#)tf.c	4.3 (Berkeley) 04/18/91";
7 #endif /* not lint */
8 
9  /* tf.c: save and restore fill mode around table */
10 # include "t..c"
11 savefill()
12 {
13 /* remembers various things: fill mode, vs, ps in mac 35 (SF) */
14 fprintf(tabout, ".de %d\n",SF);
15 fprintf(tabout, ".ps \\n(.s\n");
16 fprintf(tabout, ".vs \\n(.vu\n");
17 fprintf(tabout, ".in \\n(.iu\n");
18 fprintf(tabout, ".if \\n(.u .fi\n");
19 fprintf(tabout, ".if \\n(.j .ad\n");
20 fprintf(tabout, ".if \\n(.j=0 .na\n");
21 fprintf(tabout, "..\n");
22 fprintf(tabout, ".nf\n");
23 /* set obx offset if useful */
24 fprintf(tabout, ".nr #~ 0\n");
25 fprintf(tabout, ".if n .nr #~ 0.6n\n");
26 }
27 rstofill()
28 {
29 fprintf(tabout, ".%d\n",SF);
30 }
31 endoff()
32 {
33 int i;
34 	for(i=0; i<MAXHEAD; i++)
35 		if (linestop[i])
36 			fprintf(tabout, ".nr #%c 0\n", 'a'+i);
37 	for(i=0; i<texct; i++)
38 		fprintf(tabout, ".rm %c+\n",texstr[i]);
39 fprintf(tabout, "%s\n", last);
40 }
41 ifdivert()
42 {
43 fprintf(tabout, ".ds #d .d\n");
44 fprintf(tabout, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
45 }
46 saveline()
47 {
48 fprintf(tabout, ".if \\n+(b.=1 .nr d. \\n(.c-\\n(c.-1\n");
49 linstart=iline;
50 }
51 restline()
52 {
53 fprintf(tabout,".if \\n-(b.=0 .nr c. \\n(.c-\\n(d.-%d\n", iline-linstart);
54 linstart = 0;
55 }
56 cleanfc()
57 {
58 fprintf(tabout, ".fc\n");
59 }
60