#ifndef lint static char sccsid[] = "@(#)pile.c 4.3 8/11/83"; #endif # include "e.h" lpile(type, p1, p2) int type, p1, p2; { int bi, hi, i, gap, h, b, nlist, nlist2, mid; yyval = oalloc(); #ifndef NEQN gap = VERT( (ps*6*4)/10 ); /* 4/10 m between blocks */ #else NEQN gap = VERT(1); #endif NEQN if( type=='-' ) gap = 0; nlist = p2 - p1; nlist2 = (nlist+1)/2; mid = p1 + nlist2 -1; h = 0; for( i=p1; imid; i-- ) b += eht[lp[i]] + gap; ebase[yyval] = (nlist%2) ? b + ebase[lp[mid]] #ifndef NEQN : b - VERT( (ps*6*5)/10 ) - gap; #else NEQN : b - VERT(1) - gap; #endif NEQN if(dbg) { printf(".\tS%d <- %c pile of:", yyval, type); for( i=p1; i\\n(%d .nr %d \\n(%d\n", lp[i], yyval, yyval, lp[i]); } printf(".ds %d \\v'%du'\\h'%du*\\n(%du'\\\n", yyval, ebase[yyval], type=='R' ? 1 : 0, yyval); for(i = p2-1; i >=p1; i--) { hi = eht[lp[i]]; bi = ebase[lp[i]]; switch(type) { case 'L': printf("\\v'%du'\\*(%d\\h'-\\n(%du'\\v'0-%du'\\\n", -bi, lp[i], lp[i], hi-bi+gap); continue; case 'R': printf("\\v'%du'\\h'-\\n(%du'\\*(%d\\v'0-%du'\\\n", -bi, lp[i], lp[i], hi-bi+gap); continue; case 'C': case '-': printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d", -bi, yyval, lp[i], lp[i]); printf("\\h'-\\n(%du-\\n(%du/2u'\\v'0-%du'\\\n", yyval, lp[i], hi-bi+gap); continue; } } printf("\\v'%du'\\h'%du*\\n(%du'\n", eht[yyval]-ebase[yyval]+gap, type!='R' ? 1 : 0, yyval); for( i=p1; i