xref: /original-bsd/old/eqn/common_source/move.c (revision ce06cd54)
1 /*-
2  * Copyright (c) 1991 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.proprietary.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)move.c	4.4 (Berkeley) 04/17/91";
10 #endif /* not lint */
11 
12 # include "e.h"
13 # include "e.def"
14 
15 move(dir, amt, p) int dir, amt, p; {
16 	int a;
17 
18 	yyval = p;
19 #ifndef NEQN
20 	a = VERT( (EFFPS(ps) * 6 * amt) / 100);
21 #else NEQN
22 	a = VERT( (amt+49)/50 );	/* nearest number of half-lines */
23 #endif NEQN
24 	printf(".ds %d ", yyval);
25 	if( dir == FWD || dir == BACK )	/* fwd, back */
26 		printf("\\h'%s%du'\\*(%d\n", (dir==BACK) ? "-" : "", a, p);
27 	else if (dir == UP)
28 		printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a);
29 	else if (dir == DOWN)
30 		printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a);
31 	if(dbg)printf(".\tmove %d dir %d amt %d; h=%d b=%d\n",
32 		p, dir, a, eht[yyval], ebase[yyval]);
33 }
34