xref: /titanic_52/usr/src/cmd/eqn/move.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 # include "e.h"
19 # include "e.def"
20 
21 move(dir, amt, p) int dir, amt, p; {
22 	int a;
23 
24 	yyval = p;
25 #ifndef NEQN
26 	a = VERT(EM(amt/100.0, EFFPS(ps)));
27 #else NEQN
28 	a = VERT( (amt+49)/50 );	/* nearest number of half-lines */
29 #endif NEQN
30 	printf(".ds %d ", yyval);
31 	if( dir == FWD || dir == BACK )	/* fwd, back */
32 		printf("\\h'%s%du'\\*(%d\n", (dir==BACK) ? "-" : "", a, p);
33 	else if (dir == UP)
34 		printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a);
35 	else if (dir == DOWN)
36 		printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a);
37 	if(dbg)printf(".\tmove %d dir %d amt %d; h=%d b=%d\n",
38 		p, dir, a, eht[yyval], ebase[yyval]);
39 }
40