xref: /onnv-gate/usr/src/cmd/eqn/move.c (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
2*0Sstevel@tonic-gate /*	  All Rights Reserved  	*/
3*0Sstevel@tonic-gate 
4*0Sstevel@tonic-gate 
5*0Sstevel@tonic-gate /*
6*0Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
7*0Sstevel@tonic-gate  * All rights reserved. The Berkeley software License Agreement
8*0Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
9*0Sstevel@tonic-gate  */
10*0Sstevel@tonic-gate 
11*0Sstevel@tonic-gate /*
12*0Sstevel@tonic-gate  * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
13*0Sstevel@tonic-gate  * All Rights Reserved.
14*0Sstevel@tonic-gate  */
15*0Sstevel@tonic-gate 
16*0Sstevel@tonic-gate #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1	*/
17*0Sstevel@tonic-gate 
18*0Sstevel@tonic-gate # include "e.h"
19*0Sstevel@tonic-gate # include "e.def"
20*0Sstevel@tonic-gate 
21*0Sstevel@tonic-gate move(dir, amt, p) int dir, amt, p; {
22*0Sstevel@tonic-gate 	int a;
23*0Sstevel@tonic-gate 
24*0Sstevel@tonic-gate 	yyval = p;
25*0Sstevel@tonic-gate #ifndef NEQN
26*0Sstevel@tonic-gate 	a = VERT(EM(amt/100.0, EFFPS(ps)));
27*0Sstevel@tonic-gate #else NEQN
28*0Sstevel@tonic-gate 	a = VERT( (amt+49)/50 );	/* nearest number of half-lines */
29*0Sstevel@tonic-gate #endif NEQN
30*0Sstevel@tonic-gate 	printf(".ds %d ", yyval);
31*0Sstevel@tonic-gate 	if( dir == FWD || dir == BACK )	/* fwd, back */
32*0Sstevel@tonic-gate 		printf("\\h'%s%du'\\*(%d\n", (dir==BACK) ? "-" : "", a, p);
33*0Sstevel@tonic-gate 	else if (dir == UP)
34*0Sstevel@tonic-gate 		printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a);
35*0Sstevel@tonic-gate 	else if (dir == DOWN)
36*0Sstevel@tonic-gate 		printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a);
37*0Sstevel@tonic-gate 	if(dbg)printf(".\tmove %d dir %d amt %d; h=%d b=%d\n",
38*0Sstevel@tonic-gate 		p, dir, a, eht[yyval], ebase[yyval]);
39*0Sstevel@tonic-gate }
40