Research V7 development
[unix-history] / usr / src / cmd / eqn / over.c
CommitLineData
f42b14c5
BK
1# include "e.h"
2
3boverb(p1, p2) int p1, p2; {
4 int h, b, treg, d;
5
6 treg = oalloc();
7 yyval = p1;
8 d = VERT((ps*6*3) / 10); /* 0.3m */
9 h = eht[p1] + eht[p2] + d;
10 b = eht[p2] - d;
11 if(dbg)printf(".\tb:bob: S%d <- S%d over S%d; b=%d, h=%d\n",
12 yyval, p1, p2, b, h);
13 nrwid(p1, ps, p1);
14 nrwid(p2, ps, p2);
15 printf(".nr %d \\n(%d\n", treg, p1);
16 printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2);
17 printf(".nr %d \\n(%d+\\s%d.5m\\s0\n", treg, treg, EFFPS(ps));
18 printf(".ds %d \\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d\\\n",
19 yyval, eht[p2]-ebase[p2]-d, treg, p2, p2);
20 printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\*(%d\\\n",
21 p2, p1, -(eht[p2]-ebase[p2]+d+ebase[p1]), p1);
22 printf("\\h'-\\n(%du-\\n(%du/2u+.1m'\\v'%du'\\l'\\n(%du-.2m'\\h'.1m'\\v'%du'\n",
23 treg, p1, ebase[p1]+d, treg, d);
24 ebase[yyval] = b;
25 eht[yyval] = h;
26 lfont[yyval] = rfont[yyval] = 0;
27 ofree(p2);
28 ofree(treg);
29}