xref: /csrg-svn/old/eqn/common_source/over.c (revision 11023)
1*11023Sshannon /*	over.c	4.2	83/02/12	*/
211013Sshannon 
311013Sshannon # include "e.h"
411013Sshannon 
511013Sshannon boverb(p1, p2) int p1, p2; {
611013Sshannon 	int h, b, treg, d;
711013Sshannon 
811013Sshannon 	treg = oalloc();
911013Sshannon 	yyval = p1;
10*11023Sshannon #ifndef NEQN
1111013Sshannon 	d = VERT((ps*6*3) / 10);	/* 0.3m */
1211013Sshannon 	h = eht[p1] + eht[p2] + d;
13*11023Sshannon #else NEQN
14*11023Sshannon 	d = VERT(1);
15*11023Sshannon 	h = eht[p1] + eht[p2];
16*11023Sshannon #endif NEQN
1711013Sshannon 	b = eht[p2] - d;
1811013Sshannon 	if(dbg)printf(".\tb:bob: S%d <- S%d over S%d; b=%d, h=%d\n",
1911013Sshannon 		yyval, p1, p2, b, h);
2011013Sshannon 	nrwid(p1, ps, p1);
2111013Sshannon 	nrwid(p2, ps, p2);
2211013Sshannon 	printf(".nr %d \\n(%d\n", treg, p1);
2311013Sshannon 	printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2);
24*11023Sshannon #ifndef NEQN
2511013Sshannon 	printf(".nr %d \\n(%d+\\s%d.5m\\s0\n", treg, treg, EFFPS(ps));
26*11023Sshannon #endif NEQN
2711013Sshannon 	printf(".ds %d \\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d\\\n",
2811013Sshannon 		yyval, eht[p2]-ebase[p2]-d, treg, p2, p2);
2911013Sshannon 	printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\*(%d\\\n",
30*11023Sshannon #ifndef NEQN
3111013Sshannon 		p2, p1, -(eht[p2]-ebase[p2]+d+ebase[p1]), p1);
3211013Sshannon 	printf("\\h'-\\n(%du-\\n(%du/2u+.1m'\\v'%du'\\l'\\n(%du-.2m'\\h'.1m'\\v'%du'\n",
3311013Sshannon 		 treg, p1, ebase[p1]+d, treg, d);
34*11023Sshannon #else NEQN
35*11023Sshannon 		p2, p1, -eht[p2]+ebase[p2]-ebase[p1], p1);
36*11023Sshannon 	printf("\\h'-\\n(%du-\\n(%du-2u/2u'\\v'%du'\\l'\\n(%du'\\v'%du'\n",
37*11023Sshannon 		 treg, p1, ebase[p1], treg, d);
38*11023Sshannon #endif NEQN
3911013Sshannon 	ebase[yyval] = b;
4011013Sshannon 	eht[yyval] = h;
4111013Sshannon 	lfont[yyval] = rfont[yyval] = 0;
4211013Sshannon 	ofree(p2);
4311013Sshannon 	ofree(treg);
4411013Sshannon }
45