xref: /original-bsd/old/eqn/common_source/move.c (revision a0a7d8f4)
1 #ifndef lint
2 static char sccsid[] = "@(#)move.c	4.3 08/11/83";
3 #endif
4 
5 # include "e.h"
6 # include "e.def"
7 
8 move(dir, amt, p) int dir, amt, p; {
9 	int a;
10 
11 	yyval = p;
12 #ifndef NEQN
13 	a = VERT( (EFFPS(ps) * 6 * amt) / 100);
14 #else NEQN
15 	a = VERT( (amt+49)/50 );	/* nearest number of half-lines */
16 #endif NEQN
17 	printf(".ds %d ", yyval);
18 	if( dir == FWD || dir == BACK )	/* fwd, back */
19 		printf("\\h'%s%du'\\*(%d\n", (dir==BACK) ? "-" : "", a, p);
20 	else if (dir == UP)
21 		printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a);
22 	else if (dir == DOWN)
23 		printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a);
24 	if(dbg)printf(".\tmove %d dir %d amt %d; h=%d b=%d\n",
25 		p, dir, a, eht[yyval], ebase[yyval]);
26 }
27