1: #ifndef lint 2: static char sccsid[] = "@(#)fromto.c 4.3 8/11/83"; 3: #endif 4: 5: # include "e.h" 6: 7: fromto(p1, p2, p3) int p1, p2, p3; { 8: int b, h1, b1, pss; 9: yyval = oalloc(); 10: lfont[yyval] = rfont[yyval] = 0; 11: h1 = eht[yyval] = eht[p1]; 12: b1 = ebase[p1]; 13: b = 0; 14: pss = EFFPS(ps); 15: ps += 3; 16: nrwid(p1, ps, p1); 17: printf(".nr %d \\n(%d\n", yyval, p1); 18: if( p2>0 ) { 19: nrwid(p2, pss, p2); 20: printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, yyval, yyval, p2); 21: eht[yyval] += eht[p2]; 22: b = eht[p2]; 23: } 24: if( p3>0 ) { 25: nrwid(p3, pss, p3); 26: printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p3, yyval, yyval, p3); 27: eht[yyval] += eht[p3]; 28: } 29: printf(".ds %d ", yyval); /* bottom of middle box */ 30: if( p2>0 ) { 31: printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d", 32: eht[p2]-ebase[p2]+b1, yyval, p2, pss, p2, EFFPS(ps)); 33: printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\\n", 34: yyval, p2, -(eht[p2]-ebase[p2]+b1)); 35: } 36: #ifndef NEQN 37: printf("\\h'\\n(%du-\\n(%du/2u'\\*(%d\\h'\\n(%du-\\n(%du/2u'\\\n", 38: #else NEQN 39: printf("\\h'\\n(%du-\\n(%du/2u'\\*(%d\\h'\\n(%du-\\n(%du+2u/2u'\\\n", 40: #endif NEQN 41: yyval, p1, p1, yyval, p1); 42: if( p3>0 ) { 43: printf("\\v'%du'\\h'-\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d\\h'\\n(%du-\\n(%du/2u'\\v'%du'\\\n", 44: -(h1-b1+ebase[p3]), yyval, p3, pss, p3, EFFPS(ps), yyval, p3, (h1-b1+ebase[p3])); 45: } 46: printf("\n"); 47: ebase[yyval] = b + b1; 48: if(dbg)printf(".\tfrom to: S%d <- %d f %d t %d; h=%d b=%d\n", 49: yyval, p1, p2, p3, eht[yyval], ebase[yyval]); 50: ofree(p1); 51: if( p2>0 ) ofree(p2); 52: if( p3>0 ) ofree(p3); 53: }