xref: /csrg-svn/old/eqn/common_source/move.c (revision 48252)
1*48252Sbostic /*-
2*48252Sbostic  * Copyright (c) 1991 The Regents of the University of California.
3*48252Sbostic  * All rights reserved.
4*48252Sbostic  *
5*48252Sbostic  * %sccs.include.proprietary.c%
6*48252Sbostic  */
7*48252Sbostic 
814486Ssam #ifndef lint
9*48252Sbostic static char sccsid[] = "@(#)move.c	4.4 (Berkeley) 04/17/91";
10*48252Sbostic #endif /* not lint */
1111012Sshannon 
1211012Sshannon # include "e.h"
1311012Sshannon # include "e.def"
1411012Sshannon 
move(dir,amt,p)1511012Sshannon move(dir, amt, p) int dir, amt, p; {
1611012Sshannon 	int a;
1711012Sshannon 
1811012Sshannon 	yyval = p;
1911023Sshannon #ifndef NEQN
2011012Sshannon 	a = VERT( (EFFPS(ps) * 6 * amt) / 100);
2111023Sshannon #else NEQN
2211023Sshannon 	a = VERT( (amt+49)/50 );	/* nearest number of half-lines */
2311023Sshannon #endif NEQN
2411012Sshannon 	printf(".ds %d ", yyval);
2511012Sshannon 	if( dir == FWD || dir == BACK )	/* fwd, back */
2611012Sshannon 		printf("\\h'%s%du'\\*(%d\n", (dir==BACK) ? "-" : "", a, p);
2711012Sshannon 	else if (dir == UP)
2811012Sshannon 		printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a);
2911012Sshannon 	else if (dir == DOWN)
3011012Sshannon 		printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a);
3111012Sshannon 	if(dbg)printf(".\tmove %d dir %d amt %d; h=%d b=%d\n",
3211012Sshannon 		p, dir, a, eht[yyval], ebase[yyval]);
3311012Sshannon }
34