xref: /titanic_52/usr/src/cmd/tbl/tf.c (revision b55148877d473978f0b46d593fd6213fa526fcc5)
1*b5514887Smuffin /*
2*b5514887Smuffin  * Copyright 1990 Sun Microsystems, Inc.  All rights reserved.
3*b5514887Smuffin  * Use is subject to license terms.
4*b5514887Smuffin  */
5*b5514887Smuffin 
67c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
77c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate /*
107c478bd9Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
117c478bd9Sstevel@tonic-gate  * All rights reserved. The Berkeley software License Agreement
127c478bd9Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
137c478bd9Sstevel@tonic-gate  */
147c478bd9Sstevel@tonic-gate 
15*b5514887Smuffin #pragma ident	"%Z%%M%	%I%	%E% SMI"
167c478bd9Sstevel@tonic-gate 
177c478bd9Sstevel@tonic-gate  /* tf.c: save and restore fill mode around table */
187c478bd9Sstevel@tonic-gate # include "t..c"
19*b5514887Smuffin 
20*b5514887Smuffin void
21*b5514887Smuffin savefill(void)
227c478bd9Sstevel@tonic-gate {
237c478bd9Sstevel@tonic-gate /* remembers various things: fill mode, vs, ps in mac 35 (SF) */
247c478bd9Sstevel@tonic-gate fprintf(tabout, ".de %d\n",SF);
257c478bd9Sstevel@tonic-gate fprintf(tabout, ".ps \\n(.s\n");
267c478bd9Sstevel@tonic-gate fprintf(tabout, ".vs \\n(.vu\n");
277c478bd9Sstevel@tonic-gate fprintf(tabout, ".in \\n(.iu\n");
287c478bd9Sstevel@tonic-gate fprintf(tabout, ".if \\n(.u .fi\n");
297c478bd9Sstevel@tonic-gate fprintf(tabout, ".if \\n(.j .ad\n");
307c478bd9Sstevel@tonic-gate fprintf(tabout, ".if \\n(.j=0 .na\n");
317c478bd9Sstevel@tonic-gate fprintf(tabout, "..\n");
327c478bd9Sstevel@tonic-gate fprintf(tabout, ".nf\n");
337c478bd9Sstevel@tonic-gate /* set obx offset if useful */
347c478bd9Sstevel@tonic-gate fprintf(tabout, ".nr #~ 0\n");
357c478bd9Sstevel@tonic-gate fprintf(tabout, ".if n .nr #~ 0.6n\n");
367c478bd9Sstevel@tonic-gate }
37*b5514887Smuffin 
38*b5514887Smuffin void
39*b5514887Smuffin rstofill(void)
407c478bd9Sstevel@tonic-gate {
417c478bd9Sstevel@tonic-gate fprintf(tabout, ".%d\n",SF);
427c478bd9Sstevel@tonic-gate }
43*b5514887Smuffin 
44*b5514887Smuffin void
45*b5514887Smuffin endoff(void)
467c478bd9Sstevel@tonic-gate {
477c478bd9Sstevel@tonic-gate int i;
487c478bd9Sstevel@tonic-gate 	for(i=0; i<MAXHEAD; i++)
497c478bd9Sstevel@tonic-gate 		if (linestop[i])
507c478bd9Sstevel@tonic-gate 			fprintf(tabout, ".nr #%c 0\n", 'a'+i);
517c478bd9Sstevel@tonic-gate 	for(i=0; i<texct; i++)
527c478bd9Sstevel@tonic-gate 		fprintf(tabout, ".rm %c+\n",texstr[i]);
537c478bd9Sstevel@tonic-gate fprintf(tabout, "%s\n", last);
547c478bd9Sstevel@tonic-gate }
55*b5514887Smuffin 
56*b5514887Smuffin void
57*b5514887Smuffin ifdivert(void)
587c478bd9Sstevel@tonic-gate {
597c478bd9Sstevel@tonic-gate fprintf(tabout, ".ds #d .d\n");
607c478bd9Sstevel@tonic-gate fprintf(tabout, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
617c478bd9Sstevel@tonic-gate }
62*b5514887Smuffin 
63*b5514887Smuffin void
64*b5514887Smuffin saveline(void)
657c478bd9Sstevel@tonic-gate {
667c478bd9Sstevel@tonic-gate fprintf(tabout, ".if \\n+(b.=1 .nr d. \\n(.c-\\n(c.-1\n");
677c478bd9Sstevel@tonic-gate linstart=iline;
687c478bd9Sstevel@tonic-gate }
69*b5514887Smuffin 
70*b5514887Smuffin void
71*b5514887Smuffin restline(void)
727c478bd9Sstevel@tonic-gate {
737c478bd9Sstevel@tonic-gate fprintf(tabout,".if \\n-(b.=0 .nr c. \\n(.c-\\n(d.-%d\n", iline-linstart);
747c478bd9Sstevel@tonic-gate linstart = 0;
757c478bd9Sstevel@tonic-gate }
76*b5514887Smuffin 
77*b5514887Smuffin void
78*b5514887Smuffin cleanfc(void)
797c478bd9Sstevel@tonic-gate {
807c478bd9Sstevel@tonic-gate fprintf(tabout, ".fc\n");
817c478bd9Sstevel@tonic-gate }
82