xref: /onnv-gate/usr/src/cmd/tbl/tf.c (revision 381:1a7f0e46092a)
1*381Smuffin /*
2*381Smuffin  * Copyright 1990 Sun Microsystems, Inc.  All rights reserved.
3*381Smuffin  * Use is subject to license terms.
4*381Smuffin  */
5*381Smuffin 
60Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
70Sstevel@tonic-gate /*	  All Rights Reserved  	*/
80Sstevel@tonic-gate 
90Sstevel@tonic-gate /*
100Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
110Sstevel@tonic-gate  * All rights reserved. The Berkeley software License Agreement
120Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
130Sstevel@tonic-gate  */
140Sstevel@tonic-gate 
15*381Smuffin #pragma ident	"%Z%%M%	%I%	%E% SMI"
160Sstevel@tonic-gate 
170Sstevel@tonic-gate  /* tf.c: save and restore fill mode around table */
180Sstevel@tonic-gate # include "t..c"
19*381Smuffin 
20*381Smuffin void
savefill(void)21*381Smuffin savefill(void)
220Sstevel@tonic-gate {
230Sstevel@tonic-gate /* remembers various things: fill mode, vs, ps in mac 35 (SF) */
240Sstevel@tonic-gate fprintf(tabout, ".de %d\n",SF);
250Sstevel@tonic-gate fprintf(tabout, ".ps \\n(.s\n");
260Sstevel@tonic-gate fprintf(tabout, ".vs \\n(.vu\n");
270Sstevel@tonic-gate fprintf(tabout, ".in \\n(.iu\n");
280Sstevel@tonic-gate fprintf(tabout, ".if \\n(.u .fi\n");
290Sstevel@tonic-gate fprintf(tabout, ".if \\n(.j .ad\n");
300Sstevel@tonic-gate fprintf(tabout, ".if \\n(.j=0 .na\n");
310Sstevel@tonic-gate fprintf(tabout, "..\n");
320Sstevel@tonic-gate fprintf(tabout, ".nf\n");
330Sstevel@tonic-gate /* set obx offset if useful */
340Sstevel@tonic-gate fprintf(tabout, ".nr #~ 0\n");
350Sstevel@tonic-gate fprintf(tabout, ".if n .nr #~ 0.6n\n");
360Sstevel@tonic-gate }
37*381Smuffin 
38*381Smuffin void
rstofill(void)39*381Smuffin rstofill(void)
400Sstevel@tonic-gate {
410Sstevel@tonic-gate fprintf(tabout, ".%d\n",SF);
420Sstevel@tonic-gate }
43*381Smuffin 
44*381Smuffin void
endoff(void)45*381Smuffin endoff(void)
460Sstevel@tonic-gate {
470Sstevel@tonic-gate int i;
480Sstevel@tonic-gate 	for(i=0; i<MAXHEAD; i++)
490Sstevel@tonic-gate 		if (linestop[i])
500Sstevel@tonic-gate 			fprintf(tabout, ".nr #%c 0\n", 'a'+i);
510Sstevel@tonic-gate 	for(i=0; i<texct; i++)
520Sstevel@tonic-gate 		fprintf(tabout, ".rm %c+\n",texstr[i]);
530Sstevel@tonic-gate fprintf(tabout, "%s\n", last);
540Sstevel@tonic-gate }
55*381Smuffin 
56*381Smuffin void
ifdivert(void)57*381Smuffin ifdivert(void)
580Sstevel@tonic-gate {
590Sstevel@tonic-gate fprintf(tabout, ".ds #d .d\n");
600Sstevel@tonic-gate fprintf(tabout, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
610Sstevel@tonic-gate }
62*381Smuffin 
63*381Smuffin void
saveline(void)64*381Smuffin saveline(void)
650Sstevel@tonic-gate {
660Sstevel@tonic-gate fprintf(tabout, ".if \\n+(b.=1 .nr d. \\n(.c-\\n(c.-1\n");
670Sstevel@tonic-gate linstart=iline;
680Sstevel@tonic-gate }
69*381Smuffin 
70*381Smuffin void
restline(void)71*381Smuffin restline(void)
720Sstevel@tonic-gate {
730Sstevel@tonic-gate fprintf(tabout,".if \\n-(b.=0 .nr c. \\n(.c-\\n(d.-%d\n", iline-linstart);
740Sstevel@tonic-gate linstart = 0;
750Sstevel@tonic-gate }
76*381Smuffin 
77*381Smuffin void
cleanfc(void)78*381Smuffin cleanfc(void)
790Sstevel@tonic-gate {
800Sstevel@tonic-gate fprintf(tabout, ".fc\n");
810Sstevel@tonic-gate }
82