BSD 4_4 release
[unix-history] / usr / src / old / eqn / common_source / move.c
/*-
* Copyright (c) 1991 The Regents of the University of California.
* All rights reserved.
*
* This module is believed to contain source code proprietary to AT&T.
* Use and redistribution is subject to the Berkeley Software License
* Agreement and your Software Agreement with AT&T (Western Electric).
*/
#ifndef lint
static char sccsid[] = "@(#)move.c 4.4 (Berkeley) 4/17/91";
#endif /* not lint */
# include "e.h"
# include "e.def"
move(dir, amt, p) int dir, amt, p; {
int a;
yyval = p;
#ifndef NEQN
a = VERT( (EFFPS(ps) * 6 * amt) / 100);
#else NEQN
a = VERT( (amt+49)/50 ); /* nearest number of half-lines */
#endif NEQN
printf(".ds %d ", yyval);
if( dir == FWD || dir == BACK ) /* fwd, back */
printf("\\h'%s%du'\\*(%d\n", (dir==BACK) ? "-" : "", a, p);
else if (dir == UP)
printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a);
else if (dir == DOWN)
printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a);
if(dbg)printf(".\tmove %d dir %d amt %d; h=%d b=%d\n",
p, dir, a, eht[yyval], ebase[yyval]);
}