BSD 3 development
[unix-history] / usr / src / cmd / neqn / over.c
CommitLineData
42d6e430
BJ
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(1);
9 h = eht[p1] + eht[p2];
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(".ds %d \\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d\\\n",
18 yyval, eht[p2]-ebase[p2]-d, treg, p2, p2);
19 printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\*(%d\\\n",
20 p2, p1, -eht[p2]+ebase[p2]-ebase[p1], p1);
21 printf("\\h'-\\n(%du-\\n(%du-2u/2u'\\v'%du'\\l'\\n(%du'\\v'%du'\n",
22 treg, p1, ebase[p1], treg, d);
23 ebase[yyval] = b;
24 eht[yyval] = h;
25 lfont[yyval] = rfont[yyval] = 0;
26 ofree(p2);
27 ofree(treg);
28}