home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari FTP
/
ATARI_FTP_0693.zip
/
ATARI_FTP_0693
/
Tex
/
texsrc.arc
/
TEX4.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-09-14
|
54KB
|
2,176 lines
overlay "tex4"
#define EXTERN extern
#include "texd.h"
startinput () { /* 30 */ r_startinput
scanfilename () ;
if ( curext == 206 )
curext = 644 ;
packfilename ( curname , curarea , curext ) ;
while ( true ) {
beginfilerea () ;
if ( aopenin ( inputfile [ curinput .indexfield ] , inputpathspec ) )
goto lab30 ;
endfilereadi () ;
promptfilena ( 640 , 644 ) ;
}
lab30: curinput .namefield = amakenamestr ( inputfile [ curinput .indexfield
] ) ;
if ( jobname == 0 )
{
jobname = curname ;
openlogfile () ;
}
if ( termoffset + ( strstart [ curinput .namefield + 1 ] - strstart [
curinput .namefield ] ) > maxprintline - 2 )
println () ;
else if ( ( termoffset > 0 ) || ( fileoffset > 0 ) )
printchar ( 32 ) ;
printchar ( 40 ) ;
print ( curinput .namefield ) ;
termflush ( output ) ;
curinput .statefield = 33 ;
{
if ( ! inputln ( inputfile [ curinput .indexfield ] , false ) )
;
firmupthelin () ;
if ( ( eqtb [ 5315 ] .cint < 0 ) || ( eqtb [ 5315 ] .cint > 127 ) )
decr ( curinput .limitfield ) ;
else buffer [ curinput .limitfield ] = eqtb [ 5315 ] .cint ;
first = curinput .limitfield + 1 ;
curinput .locfield = curinput .startfield ;
line = 1 ;
}
}
internalfont zreadfontinfo ( u , nom , aire , s )
halfword u ;
strnumber nom , aire ;
scaled s ;
{/* 30 11 45 */ register internalfont Result;
r_readfontinfo
integer k ;
boolean fileopened ;
halfword lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np ;
internalfont f ;
internalfont g ;
eightbits a, b, c, d ;
fourquarters qw ;
scaled sw ;
scaled z ;
integer alpha ;
quarterword beta ;
g = 0 ;
fileopened = false ;
packfilename ( nom , aire , 664 ) ;
if ( ! bopenin ( tfmfile ) )
goto lab11 ;
fileopened = true ;
{
{
lf = tfmtemp ;
if ( lf > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
lf = lf * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
lh = tfmtemp ;
if ( lh > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
lh = lh * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
bc = tfmtemp ;
if ( bc > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
bc = bc * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
ec = tfmtemp ;
if ( ec > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
ec = ec * 256 + tfmtemp ;
}
if ( ( bc > ec + 1 ) || ( ec > 255 ) )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
{
nw = tfmtemp ;
if ( nw > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nw = nw * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
nh = tfmtemp ;
if ( nh > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nh = nh * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
nd = tfmtemp ;
if ( nd > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nd = nd * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
ni = tfmtemp ;
if ( ni > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
ni = ni * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
nl = tfmtemp ;
if ( nl > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nl = nl * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
nk = tfmtemp ;
if ( nk > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nk = nk * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
ne = tfmtemp ;
if ( ne > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
ne = ne * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
np = tfmtemp ;
if ( np > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
np = np * 256 + tfmtemp ;
}
if ( lf != 6 + lh + ( ec - bc + 1 ) + nw + nh + nd + ni + nl + nk + ne +
np )
goto lab11 ;
}
lf = lf - 6 - lh ;
if ( np < 7 )
lf = lf + 7 - np ;
if ( ( fontptr == fontmax ) || ( fmemptr + lf > fontmemsize ) )
{
{
if ( interaction == 3 )
wakeuptermin () ;
printnl ( 133 ) ;
print ( 655 ) ;
}
sprintcs ( u ) ;
printchar ( 61 ) ;
printfilenam ( nom , aire , 206 ) ;
if ( s >= 0 )
{
print ( 598 ) ;
printscaled ( s ) ;
print ( 262 ) ;
}
else if ( s != - 1000 )
{
print ( 656 ) ;
printint ( - s ) ;
}
print ( 665 ) ;
{
helpptr = 4 ;
helpline [ 3 ] = 666 ;
helpline [ 2 ] = 667 ;
helpline [ 1 ] = 668 ;
helpline [ 0 ] = 669 ;
}
error () ;
goto lab30 ;
}
f = fontptr + 1 ;
charbase [ f ] = fmemptr - bc ;
widthbase [ f ] = charbase [ f ] + ec + 1 ;
heightbase [ f ] = widthbase [ f ] + nw ;
depthbase [ f ] = heightbase [ f ] + nh ;
italicbase [ f ] = depthbase [ f ] + nd ;
ligkernbase [ f ] = italicbase [ f ] + ni ;
kernbase [ f ] = ligkernbase [ f ] + nl ;
extenbase [ f ] = kernbase [ f ] + nk ;
parambase [ f ] = extenbase [ f ] + ne ;
{
if ( lh < 2 )
goto lab11 ;
{
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
qw .b0 = a ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;
qw .b1 = b ;
tfmtemp = getc ( tfmfile ) ;
c = tfmtemp ;
qw .b2 = c ;
tfmtemp = getc ( tfmfile ) ;
d = tfmtemp ;
qw .b3 = d ;
fontcheck [ f ] = qw ;
}
tfmtemp = getc ( tfmfile ) ;
{
z = tfmtemp ;
if ( z > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
z = z * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
z = z * 256 + tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
z = ( z * 16 ) + ( tfmtemp / 16 ) ;
if ( z < 65536 )
goto lab11 ;
while ( lh > 2 ) {
tfmtemp = getc ( tfmfile ) ;
tfmtemp = getc ( tfmfile ) ;
tfmtemp = getc ( tfmfile ) ;
tfmtemp = getc ( tfmfile ) ;
decr ( lh ) ;
}
fontdsize [ f ] = z ;
if ( s != - 1000 )
if ( s >= 0 )
z = s ;
else z = xnoverd ( z , - s , 1000 ) ;
fontsize [ f ] = z ;
}
for ( k = fmemptr ; k <= widthbase [ f ] - 1 ; k ++ )
{
{
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
qw .b0 = a ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;
qw .b1 = b ;
tfmtemp = getc ( tfmfile ) ;
c = tfmtemp ;
qw .b2 = c ;
tfmtemp = getc ( tfmfile ) ;
d = tfmtemp ;
qw .b3 = d ;
fontinfo [ k ] .qqqq = qw ;
}
if ( ( a >= nw ) || ( b / 16 >= nh ) || ( b % 16 >= nd ) || ( c / 4 >= ni
) )
goto lab11 ;
switch ( c % 4 )
{case 1 :
if ( d >= nl )
goto lab11 ;
break ;
case 3 :
if ( d >= ne )
goto lab11 ;
break ;
case 2 :
{
{
if ( ( d < bc ) || ( d > ec ) )
goto lab11 ;
}
while ( d < k + bc - fmemptr ) {
qw = fontinfo [ charbase [ f ] + d ] .qqqq ;
if ( ( ( qw .b2 ) % 4 ) != 2 )
goto lab45 ;
d = qw .b3 ;
}
if ( d == k + bc - fmemptr )
goto lab11 ;
lab45: ;
}
break ;
default :
;
break ;
}
}
{
{
alpha = 16 ;
while ( z >= 8388608 ) {
z = z / 2 ;
alpha = alpha + alpha ;
}
beta = 256 / alpha ;
alpha = alpha * z ;
}
for ( k = widthbase [ f ] ; k <= ligkernbase [ f ] - 1 ; k ++ )
{
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
c = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
d = tfmtemp ;
sw = ( ( ( ( ( d * z ) / 256 ) + ( c * z ) ) / 256 ) + ( b * z ) ) /
beta ;
if ( a == 0 )
fontinfo [ k ] .cint = sw ;
else if ( a == 255 )
fontinfo [ k ] .cint = sw - alpha ;
else goto lab11 ;
}
if ( fontinfo [ widthbase [ f ] ] .cint != 0 )
goto lab11 ;
if ( fontinfo [ heightbase [ f ] ] .cint != 0 )
goto lab11 ;
if ( fontinfo [ depthbase [ f ] ] .cint != 0 )
goto lab11 ;
if ( fontinfo [ italicbase [ f ] ] .cint != 0 )
goto lab11 ;
}
{
for ( k = ligkernbase [ f ] ; k <= kernbase [ f ] - 1 ; k ++ )
{
{
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
qw .b0 = a ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;
qw .b1 = b ;
tfmtemp = getc ( tfmfile ) ;
c = tfmtemp ;
qw .b2 = c ;
tfmtemp = getc ( tfmfile ) ;
d = tfmtemp ;
qw .b3 = d ;
fontinfo [ k ] .qqqq = qw ;
}
{
if ( ( b < bc ) || ( b > ec ) )
goto lab11 ;
}
if ( c < 128 )
{
if ( ( d < bc ) || ( d > ec ) )
goto lab11 ;
}
else if ( d >= nk )
goto lab11 ;
}
if ( ( nl > 0 ) && ( a < 128 ) )
goto lab11 ;
for ( k = kernbase [ f ] ; k <= extenbase [ f ] - 1 ; k ++ )
{
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
c = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
d = tfmtemp ;
sw = ( ( ( ( ( d * z ) / 256 ) + ( c * z ) ) / 256 ) + ( b * z ) ) /
beta ;
if ( a == 0 )
fontinfo [ k ] .cint = sw ;
else if ( a == 255 )
fontinfo [ k ] .cint = sw - alpha ;
else goto lab11 ;
}
}
for ( k = extenbase [ f ] ; k <= parambase [ f ] - 1 ; k ++ )
{
{
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
qw .b0 = a ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;
qw .b1 = b ;
tfmtemp = getc ( tfmfile ) ;
c = tfmtemp ;
qw .b2 = c ;
tfmtemp = getc ( tfmfile ) ;
d = tfmtemp ;
qw .b3 = d ;
fontinfo [ k ] .qqqq = qw ;
}
if ( a != 0 )
{
if ( ( a < bc ) || ( a > ec ) )
goto lab11 ;
}
if ( b != 0 )
{
if ( ( b < bc ) || ( b > ec ) )
goto lab11 ;
}
if ( c != 0 )
{
if ( ( c < bc ) || ( c > ec ) )
goto lab11 ;
}
{
if ( ( d < bc ) || ( d > ec ) )
goto lab11 ;
}
}
{
for ( k = 1 ; k <= np ; k ++ )
if ( k == 1 )
{
tfmtemp = getc ( tfmfile ) ;
sw = tfmtemp ;
if ( sw > 127 )
sw = sw - 256 ;
tfmtemp = getc ( tfmfile ) ;
sw = sw * 256 + tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
sw = sw * 256 + tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
fontinfo [ parambase [ f ] ] .cint = ( sw * 16 ) + ( tfmtemp / 16 ) ;
}
else {
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
c = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
d = tfmtemp ;
sw = ( ( ( ( ( d * z ) / 256 ) + ( c * z ) ) / 256 ) + ( b * z ) ) /
beta ;
if ( a == 0 )
fontinfo [ parambase [ f ] + k - 1 ] .cint = sw ;
else if ( a == 255 )
fontinfo [ parambase [ f ] + k - 1 ] .cint = sw - alpha ;
else goto lab11 ;
}
if ( eof ( tfmfile ) )
goto lab11 ;
for ( k = np + 1 ; k <= 7 ; k ++ )
fontinfo [ parambase [ f ] + k - 1 ] .cint = 0 ;
}
if ( np >= 7 )
fontparams [ f ] = np ;
else fontparams [ f ] = 7 ;
hyphenchar [ f ] = eqtb [ 5313 ] .cint ;
skewchar [ f ] = eqtb [ 5314 ] .cint ;
fontname [ f ] = nom ;
fontarea [ f ] = aire ;
fontbc [ f ] = bc ;
fontec [ f ] = ec ;
fontglue [ f ] = 0 ;
charbase [ f ] = charbase [ f ] ;
widthbase [ f ] = widthbase [ f ] ;
ligkernbase [ f ] = ligkernbase [ f ] ;
kernbase [ f ] = kernbase [ f ] ;
extenbase [ f ] = extenbase [ f ] ;
decr ( parambase [ f ] ) ;
fmemptr = fmemptr + lf ;
fontptr = f ;
g = f ;
goto lab30 ;
lab11: {
if ( interaction == 3 )
wakeuptermin () ;
printnl ( 133 ) ;
print ( 655 ) ;
}
sprintcs ( u ) ;
printchar ( 61 ) ;
printfilenam ( nom , aire , 206 ) ;
if ( s >= 0 )
{
print ( 598 ) ;
printscaled ( s ) ;
print ( 262 ) ;
}
else if ( s != - 1000 )
{
print ( 656 ) ;
printint ( - s ) ;
}
if ( fileopened )
print ( 657 ) ;
else print ( 658 ) ;
{
helpptr = 5 ;
helpline [ 4 ] = 659 ;
helpline [ 3 ] = 660 ;
helpline [ 2 ] = 661 ;
helpline [ 1 ] = 662 ;
helpline [ 0 ] = 663 ;
}
error () ;
lab30: if ( fileopened )
bclose ( tfmfile ) ;
Result = g ;
return(Result) ;
}
zcharwarning ( f , c )
internalfont f ;
eightbits c ;
{r_charwarning
if ( eqtb [ 5302 ] .cint > 0 )
{
begindiagnos () ;
printnl ( 678 ) ;
printASCII ( c ) ;
print ( 679 ) ;
print ( fontname [ f ] ) ;
printchar ( 33 ) ;
enddiagnosti ( false ) ;
}
}
halfword znewcharacter ( f , c )
internalfont f ;
eightbits c ;
{/* 10 */ register halfword Result; r_newcharacter
halfword p ;
if ( fontbc [ f ] <= c )
if ( fontec [ f ] >= c )
if ( ( fontinfo [ charbase [ f ] + c ] .qqqq .b0 > 0 ) )
{
p = getavail () ;
mem [(long) p ] .hh.b0 = f ;
mem [(long) p ] .hh.b1 = c ;
Result = p ;
return(Result) ;
}
charwarning ( f , c ) ;
Result = 0 ;
return(Result) ;
}
dviswap () { r_dviswap
if ( dvilimit == dvibufsize )
{
writedvi ( 0 , halfbuf - 1 ) ;
dvilimit = halfbuf ;
dvioffset = dvioffset + dvibufsize ;
dviptr = 0 ;
}
else {
writedvi ( halfbuf , dvibufsize - 1 ) ;
dvilimit = dvibufsize ;
}
dvigone = dvigone + halfbuf ;
}
zdvifour ( x )
integer x ;
{r_dvifour
if ( x >= 0 )
{
dvibuf [ dviptr ] = x / 16777216 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
else {
x = x + 1073741824 ;
x = x + 1073741824 ;
{
dvibuf [ dviptr ] = ( x / 16777216 ) + 128 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
}
x = x % 16777216 ;
{
dvibuf [ dviptr ] = x / 65536 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
x = x % 65536 ;
{
dvibuf [ dviptr ] = x / 256 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = x % 256 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
}
zdvipop ( l )
integer l ;
{r_dvipop
if ( ( l == dvioffset + dviptr ) && ( dviptr > 0 ) )
decr ( dviptr ) ;
else {
dvibuf [ dviptr ] = 142 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
}
zdvifontdef ( f )
internalfont f ;
{r_dvifontdef
poolpointer k ;
{
dvibuf [ dviptr ] = 243 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = f - 1 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = fontcheck [ f ] .b0 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = fontcheck [ f ] .b1 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = fontcheck [ f ] .b2 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = fontcheck [ f ] .b3 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
dvifour ( fontsize [ f ] ) ;
dvifour ( fontdsize [ f ] ) ;
{
dvibuf [ dviptr ] = ( strstart [ fontarea [ f ] + 1 ] - strstart [
fontarea [ f ] ] ) ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = ( strstart [ fontname [ f ] + 1 ] - strstart [
fontname [ f ] ] ) ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
for ( k = strstart [ fontarea [ f ] ] ; k <= strstart [ fontarea [ f ] + 1 ]
- 1 ; k ++ )
{
dvibuf [ dviptr ] = strpool [ k ] ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
for ( k = strstart [ fontname [ f ] ] ; k <= strstart [ fontname [ f ] + 1 ]
- 1 ; k ++ )
{
dvibuf [ dviptr ] = strpool [ k ] ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
}
zmovement ( w , o )
scaled w ;
eightbits o ;
{/* 10 40 45 2 1 */ r_movement
smallnumber mstate ;
halfword p, q ;
integer k ;
q = getnode ( 3 ) ;
mem [(long) q + 1 ] .cint = w ;
mem [(long) q + 2 ] .cint = dvioffset + dviptr ;
if ( o == 157 )
{
mem [(long) q ] .hh .v.RH = downptr ;
downptr = q ;
}
else {
mem [(long) q ] .hh .v.RH = rightptr ;
rightptr = q ;
}
p = mem [(long) q ] .hh .v.RH ;
mstate = 0 ;
while ( p != 0 ) {
if ( mem [(long) p + 1 ] .cint == w )
switch ( mstate + mem [(long) p ] .hh .v.LH )
{case 3 :
case 4 :
case 15 :
case 16 :
if ( mem [(long) p + 2 ] .cint < dvigone )
goto lab45 ;
else {
k = mem [(long) p + 2 ] .cint - dvioffset ;
if ( k < 0 )
k = k + dvibufsize ;
dvibuf [ k ] = dvibuf [ k ] + 5 ;
mem [(long) p ] .hh .v.LH = 1 ;
goto lab40 ;
}
break ;
case 5 :
case 9 :
case 11 :
if ( mem [(long) p + 2 ] .cint < dvigone )
goto lab45 ;
else {
k = mem [(long) p + 2 ] .cint - dvioffset ;
if ( k < 0 )
k = k + dvibufsize ;
dvibuf [ k ] = dvibuf [ k ] + 10 ;
mem [(long) p ] .hh .v.LH = 2 ;
goto lab40 ;
}
break ;
case 1 :
case 2 :
case 8 :
case 13 :
goto lab40 ;
break ;
default :
;
break ;
}
else switch ( mstate + mem [(long) p ] .hh .v.LH )
{case 1 :
mstate = 6 ;
break ;
case 2 :
mstate = 12 ;
break ;
case 8 :
case 13 :
goto lab45 ;
break ;
default :
;
break ;
}
p = mem [(long) p ] .hh .v.RH ;
}
lab45: ;
mem [(long) q ] .hh .v.LH = 3 ;
if ( abs ( w ) >= 8388608 )
{
{
dvibuf [ dviptr ] = o + 3 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
dvifour ( w ) ;
return ;
}
if ( abs ( w ) >= 32768 )
{
{
dvibuf [ dviptr ] = o + 2 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
if ( w < 0 )
w = w + 16777216 ;
{
dvibuf [ dviptr ] = w / 65536 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
w = w % 65536 ;
goto lab2 ;
}
if ( abs ( w ) >= 128 )
{
{
dvibuf [ dviptr ] = o + 1 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
if ( w < 0 )
w = w + 65536 ;
goto lab2 ;
}
{
dvibuf [ dviptr ] = o ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
if ( w < 0 )
w = w + 256 ;
goto lab1 ;
lab2: {
dvibuf [ dviptr ] = w / 256 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
lab1: {
dvibuf [ dviptr ] = w % 256 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
return ;
lab40: mem [(long) q ] .hh .v.LH = mem [(long) p ] .hh .v.LH ;
if ( mem [(long) q ] .hh .v.LH == 1 )
{
{
dvibuf [ dviptr ] = o + 4 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
while ( mem [(long) q ] .hh .v.RH != p ) {
q = mem [(long) q ] .hh .v.RH ;
switch ( mem [(long) q ] .hh .v.LH )
{case 3 :
mem [(long) q ] .hh .v.LH = 5 ;
break ;
case 4 :
mem [(long) q ] .hh .v.LH = 6 ;
break ;
default :
break ;
}
}
}
else {
{
dvibuf [ dviptr ] = o + 9 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
while ( mem [(long) q ] .hh .v.RH != p ) {
q = mem [(long) q ] .hh .v.RH ;
switch ( mem [(long) q ] .hh .v.LH )
{case 3 :
mem [(long) q ] .hh .v.LH = 4 ;
break ;
case 5 :
mem [(long) q ] .hh .v.LH = 6 ;
break ;
default :
break ;
}
}
}
}
zprunemovemen ( l )
integer l ;
{/* 30 10 */ r_prunemovemen
halfword p ;
while ( downptr != 0 ) {
if ( mem [(long) downptr + 2 ] .cint < l )
goto lab30 ;
p = downptr ;
downptr = mem [(long) p ] .hh .v.RH ;
freenode ( p , 3 ) ;
}
lab30: while ( rightptr != 0 ) {
if ( mem [(long) rightptr + 2 ] .cint < l )
return ;
p = rightptr ;
rightptr = mem [(long) p ] .hh .v.RH ;
freenode ( p , 3 ) ;
}
}
zspecialout ( p )
halfword p ;
{r_specialout
quarterword oldsetting ;
poolpointer k ;
if ( curh != dvih )
{
movement ( curh - dvih , 143 ) ;
dvih = curh ;
}
if ( curv != dviv )
{
movement ( curv - dviv , 157 ) ;
dviv = curv ;
}
oldsetting = selector ;
selector = 21 ;
showtokenlis ( mem [(long) mem [(long) p + 1 ] .hh .v.RH ] .hh .v.RH , 0 , poolsize -
poolptr ) ;
selector = oldsetting ;
{
if ( poolptr + 1 > poolsize )
overflow ( 128 , poolsize - initpoolptr ) ;
}
if ( ( poolptr - strstart [ strptr ] ) < 256 )
{
{
dvibuf [ dviptr ] = 239 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = ( poolptr - strstart [ strptr ] ) ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
}
else {
{
dvibuf [ dviptr ] = 242 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
dvifour ( ( poolptr - strstart [ strptr ] ) ) ;
}
for ( k = strstart [ strptr ] ; k <= poolptr - 1 ; k ++ )
{
dvibuf [ dviptr ] = strpool [ k ] ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
poolptr = strstart [ strptr ] ;
}
zwriteout ( p )
halfword p ;
{r_writeout
quarterword oldsetting ;
integer oldmode ;
smallnumber j ;
halfword q, r ;
q = getavail () ;
mem [(long) q ] .hh .v.LH = 637 ;
r = getavail () ;
mem [(long) q ] .hh .v.RH = r ;
mem [(long) r ] .hh .v.LH = 7362 ;
begintokenli ( q , 4 ) ;
begintokenli ( mem [(long) p + 1 ] .hh .v.RH , 15 ) ;
q = getavail () ;
mem [(long) q ] .hh .v.LH = 379 ;
begintokenli ( q , 4 ) ;
oldmode = curlist .modefield ;
curlist .modefield = 0 ;
curcs = writeloc ;
q = scantoks ( false , true ) ;
gettoken () ;
if ( curtok != 7362 )
{
{
if ( interaction == 3 )
wakeuptermin () ;
printnl ( 133 ) ;
print ( 1139 ) ;
}
{
helpptr = 2 ;
helpline [ 1 ] = 1140 ;
helpline [ 0 ] = 860 ;
}
error () ;
do { gettoken () ;
} while ( ! ( curtok == 7362 ) ) ;
}
curlist .modefield = oldmode ;
endtokenlist () ;
oldsetting = selector ;
j = mem [(long) p + 1 ] .hh .v.LH ;
if ( writeopen [ j ] )
selector = j ;
else {
if ( ( j == 17 ) && ( selector == 19 ) )
selector = 18 ;
printnl ( 206 ) ;
}
showtokenlis ( mem [(long) defref ] .hh .v.RH , 0 , 10000000 ) ;
println () ;
flushlist ( defref ) ;
selector = oldsetting ;
}
zoutwhat ( p )
halfword p ;
{r_outwhat
smallnumber j ;
switch ( mem [(long) p ] .hh.b1 )
{case 0 :
case 1 :
case 2 :
if ( ! doingleaders )
{
j = mem [(long) p + 1 ] .hh .v.LH ;
if ( mem [(long) p ] .hh.b1 == 1 )
writeout ( p ) ;
else {
if ( writeopen [ j ] )
aclose ( writefile [ j ] ) ;
if ( mem [(long) p ] .hh.b1 == 2 )
writeopen [ j ] = false ;
else if ( j < 16 )
{
curname = mem [(long) p + 1 ] .hh .v.RH ;
curarea = mem [(long) p + 2 ] .hh .v.LH ;
curext = mem [(long) p + 2 ] .hh .v.RH ;
if ( curext == 206 )
curext = 644 ;
packfilename ( curname , curarea , curext ) ;
while ( ! aopenout ( writefile [ j ] ) ) promptfilena ( 1142 , 644 )
;
writeopen [ j ] = true ;
}
}
}
break ;
case 3 :
specialout ( p ) ;
break ;
default :
confusion ( 1141 ) ;
break ;
}
}
hlistout () { /* 21 13 14 15 */ r_hlistout
scaled baseline ;
scaled leftedge ;
scaled saveh, savev ;
halfword thisbox ;
glueord gorder ;
quarterword gsign ;
halfword p ;
integer saveloc ;
halfword leaderbox ;
scaled leaderwd ;
scaled lx ;
boolean outerdoingle ;
scaled edge ;
fourquarters qi;
thisbox = tempptr ;
gorder = mem [(long) thisbox + 5 ] .hh.b1 ;
gsign = mem [(long) thisbox + 5 ] .hh.b0 ;
p = mem [(long) thisbox + 5 ] .hh .v.RH ;
incr ( curs ) ;
if ( curs > 0 )
{
dvibuf [ dviptr ] = 141 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
if ( curs > maxpush )
maxpush = curs ;
saveloc = dvioffset + dviptr ;
baseline = curv ;
leftedge = curh ;
while ( p != 0 ) lab21: if ( ( p >= himemmin ) )
{
if ( curh != dvih )
{
movement ( curh - dvih , 143 ) ;
dvih = curh ;
}
if ( curv != dviv )
{
movement ( curv - dviv , 157 ) ;
dviv = curv ;
}
do { f = mem [(long) p ] .hh.b0 ;
c = mem [(long) p ] .hh.b1 ;
if ( f != dvif )
{
if ( ! fontused [ f ] )
{
dvifontdef ( f ) ;
fontused [ f ] = true ;
}
if ( f <= 64 )
{
dvibuf [ dviptr ] = f + 170 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
else {
{
dvibuf [ dviptr ] = 235 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = f - 1 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
}
dvif = f ;
}
if ( c >= 128 )
{
dvibuf [ dviptr ] = 128 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = c ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
/* curh = curh + fontinfo [ widthbase [ f ] + fontinfo [ charbase [ f ] + c
] .qqqq .b0 ] .cint ; */
qi= fontinfo [ charbase [ f ] + c ] .qqqq;
curh = curh + fontinfo [ widthbase [ f ] + qi .b0 ] .cint ;
p = mem [(long) p ] .hh .v.RH ;
} while ( ! ( ! ( p >= himemmin ) ) ) ;
dvih = curh ;
}
else {
switch ( mem [(long) p ] .hh.b0 )
{case 0 :
case 1 :
if ( mem [(long) p + 5 ] .hh .v.RH == 0 )
curh = curh + mem [(long) p + 1 ] .cint ;
else {
saveh = dvih ;
savev = dviv ;
curv = baseline + mem [(long) p + 4 ] .cint ;
tempptr = p ;
edge = curh ;
if ( mem [(long) p ] .hh.b0 == 1 )
vlistout () ;
else hlistout () ;
dvih = saveh ;
dviv = savev ;
curh = edge + mem [(long) p + 1 ] .cint ;
curv = baseline ;
}
break ;
case 2 :
{
ruleht = mem [(long) p + 3 ] .cint ;
ruledp = mem [(long) p + 2 ] .cint ;
rulewd = mem [(long) p + 1 ] .cint ;
goto lab14 ;
}
break ;
case 8 :
outwhat ( p ) ;
break ;
case 10 :
{
g = mem [(long) p + 1 ] .hh .v.LH ;
rulewd = mem [(long) g + 1 ] .cint ;
if ( gsign != 0 )
{
if ( gsign == 1 )
{
if ( mem [(long) g ] .hh.b0 == gorder )
rulewd = rulewd + round ( mem [(long) thisbox + 6 ] .gr * mem [(long) g + 2 ]
.cint ) ;
}
else {
if ( mem [(long) g ] .hh.b1 == gorder )
rulewd = rulewd - round ( mem [(long) thisbox + 6 ] .gr * mem [(long) g + 3 ]
.cint ) ;
}
}
if ( mem [(long) p ] .hh.b1 >= 100 )
{
leaderbox = mem [(long) p + 1 ] .hh .v.RH ;
if ( mem [(long) leaderbox ] .hh.b0 == 2 )
{
ruleht = mem [(long) leaderbox + 3 ] .cint ;
ruledp = mem [(long) leaderbox + 2 ] .cint ;
goto lab14 ;
}
leaderwd = mem [(long) leaderbox + 1 ] .cint ;
if ( ( leaderwd > 0 ) && ( rulewd > 0 ) )
{
rulewd = rulewd + 10 ;
edge = curh + rulewd ;
lx = 0 ;
if ( mem [(long) p ] .hh.b1 == 100 )
{
saveh = curh ;
curh = leftedge + leaderwd * ( ( curh - leftedge ) / leaderwd )
;
if ( curh < saveh )
curh = curh + leaderwd ;
}
else {
lq = rulewd / leaderwd ;
lr = rulewd % leaderwd ;
if ( mem [(long) p ] .hh.b1 == 101 )
curh = curh + ( lr / 2 ) ;
else {
lx = ( 2 * lr + lq + 1 ) / ( 2 * lq + 2 ) ;
curh = curh + ( ( lr - ( lq - 1 ) * lx ) / 2 ) ;
}
}
while ( curh + leaderwd <= edge ) {
curv = baseline + mem [(long) leaderbox + 4 ] .cint ;
if ( curv != dviv )
{
movement ( curv - dviv , 157 ) ;
dviv = curv ;
}
savev = dviv ;
if ( curh != dvih )
{
movement ( curh - dvih , 143 ) ;
dvih = curh ;
}
saveh = dvih ;
tempptr = leaderbox ;
outerdoingle = doingleaders ;
doingleaders = true ;
if ( mem [(long) leaderbox ] .hh.b0 == 1 )
vlistout () ;
else hlistout () ;
doingleaders = outerdoingle ;
dviv = savev ;
dvih = saveh ;
curv = savev ;
curh = saveh + leaderwd + lx ;
}
curh = edge - 10 ;
goto lab15 ;
}
}
goto lab13 ;
}
break ;
case 11 :
case 9 :
curh = curh + mem [(long) p + 1 ] .cint ;
break ;
case 6 :
{
mem [(long) memtop - 12 ] = mem [(long) p + 1 ] ;
mem [(long) memtop - 12 ] .hh .v.RH = mem [(long) p ] .hh .v.RH ;
p = memtop - 12 ;
goto lab21 ;
}
break ;
default :
;
break ;
}
goto lab15 ;
lab14: if ( ( ruleht == - 1073741824 ) )
ruleht = mem [(long) thisbox + 3 ] .cint ;
if ( ( ruledp == - 1073741824 ) )
ruledp = mem [(long) thisbox + 2 ] .cint ;
ruleht = ruleht + ruledp ;
if ( ( ruleht > 0 ) && ( rulewd > 0 ) )
{
if ( curh != dvih )
{
movement ( curh - dvih , 143 ) ;
dvih = curh ;
}
curv = baseline + ruledp ;
if ( curv != dviv )
{
movement ( curv - dviv , 157 ) ;
dviv = curv ;
}
{
dvibuf [ dviptr ] = 132 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
dvifour ( ruleht ) ;
dvifour ( rulewd ) ;
curv = baseline ;
dvih = dvih + rulewd ;
}
lab13: curh = curh + rulewd ;
lab15: p = mem [(long) p ] .hh .v.RH ;
}
prunemovemen ( saveloc ) ;
if ( curs > 0 )
dvipop ( saveloc ) ;
decr ( curs ) ;
}
vlistout () { /* 13 14 15 */ r_vlistout
scaled leftedge ;
scaled topedge ;
scaled saveh, savev ;
halfword thisbox ;
glueord gorder ;
quarterword gsign ;
halfword p ;
integer saveloc ;
halfword leaderbox ;
scaled leaderht ;
scaled lx ;
boolean outerdoingle ;
scaled edge ;
thisbox = tempptr ;
gorder = mem [(long) thisbox + 5 ] .hh.b1 ;
gsign = mem [(long) thisbox + 5 ] .hh.b0 ;
p = mem [(long) thisbox + 5 ] .hh .v.RH ;
incr ( curs ) ;
if ( curs > 0 )
{
dvibuf [ dviptr ] = 141 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
if ( curs > maxpush )
maxpush = curs ;
saveloc = dvioffset + dviptr ;
leftedge = curh ;
curv = curv - mem [(long) thisbox + 3 ] .cint ;
topedge = curv ;
while ( p != 0 ) {
if ( ( p >= himemmin ) )
confusion ( 681 ) ;
else {
switch ( mem [(long) p ] .hh.b0 )
{case 0 :
case 1 :
if ( mem [(long) p + 5 ] .hh .v.RH == 0 )
curv = curv + mem [(long) p + 3 ] .cint + mem [(long) p + 2 ] .cint ;
else {
curv = curv + mem [(long) p + 3 ] .cint ;
if ( curv != dviv )
{
movement ( curv - dviv , 157 ) ;
dviv = curv ;
}
saveh = dvih ;
savev = dviv ;
curh = leftedge + mem [(long) p + 4 ] .cint ;
tempptr = p ;
if ( mem [(long) p ] .hh.b0 == 1 )
vlistout () ;
else hlistout () ;
dvih = saveh ;
dviv = savev ;
curv = savev + mem [(long) p + 2 ] .cint ;
curh = leftedge ;
}
break ;
case 2 :
{
ruleht = mem [(long) p + 3 ] .cint ;
ruledp = mem [(long) p + 2 ] .cint ;
rulewd = mem [(long) p + 1 ] .cint ;
goto lab14 ;
}
break ;
case 8 :
outwhat ( p ) ;
break ;
case 10 :
{
g = mem [(long) p + 1 ] .hh .v.LH ;
ruleht = mem [(long) g + 1 ] .cint ;
if ( gsign != 0 )
{
if ( gsign == 1 )
{
if ( mem [(long) g ] .hh.b0 == gorder )
ruleht = ruleht + round ( mem [(long) thisbox + 6 ] .gr * mem [(long) g + 2
] .cint ) ;
}
else {
if ( mem [(long) g ] .hh.b1 == gorder )
ruleht = ruleht - round ( mem [(long) thisbox + 6 ] .gr * mem [(long) g + 3
] .cint ) ;
}
}
if ( mem [(long) p ] .hh.b1 >= 100 )
{
leaderbox = mem [(long) p + 1 ] .hh .v.RH ;
if ( mem [(long) leaderbox ] .hh.b0 == 2 )
{
rulewd = mem [(long) leaderbox + 1 ] .cint ;
ruledp = 0 ;
goto lab14 ;
}
leaderht = mem [(long) leaderbox + 3 ] .cint + mem [(long) leaderbox + 2 ]
.cint ;
if ( ( leaderht > 0 ) && ( ruleht > 0 ) )
{
ruleht = ruleht + 10 ;
edge = curv + ruleht ;
lx = 0 ;
if ( mem [(long) p ] .hh.b1 == 100 )
{
savev = curv ;
curv = topedge + leaderht * ( ( curv - topedge ) / leaderht )
;
if ( curv < savev )
curv = curv + leaderht ;
}
else {
lq = ruleht / leaderht ;
lr = ruleht % leaderht ;
if ( mem [(long) p ] .hh.b1 == 101 )
curv = curv + ( lr / 2 ) ;
else {
lx = ( 2 * lr + lq + 1 ) / ( 2 * lq + 2 ) ;
curv = curv + ( ( lr - ( lq - 1 ) * lx ) / 2 ) ;
}
}
while ( curv + leaderht <= edge ) {
curh = leftedge + mem [(long) leaderbox + 4 ] .cint ;
if ( curh != dvih )
{
movement ( curh - dvih , 143 ) ;
dvih = curh ;
}
saveh = dvih ;
curv = curv + mem [(long) leaderbox + 3 ] .cint ;
if ( curv != dviv )
{
movement ( curv - dviv , 157 ) ;
dviv = curv ;
}
savev = dviv ;
tempptr = leaderbox ;
outerdoingle = doingleaders ;
doingleaders = true ;
if ( mem [(long) leaderbox ] .hh.b0 == 1 )
vlistout () ;
else hlistout () ;
doingleaders = outerdoingle ;
dviv = savev ;
dvih = saveh ;
curh = saveh ;
curv = savev - mem [(long) leaderbox + 3 ] .cint + leaderht + lx ;
}
curv = edge - 10 ;
goto lab15 ;
}
}
goto lab13 ;
}
break ;
case 11 :
curv = curv + mem [(long) p + 1 ] .cint ;
break ;
default :
break ;
}
goto lab15 ;
lab14: if ( ( rulewd == - 1073741824 ) )
rulewd = mem [(long) thisbox + 1 ] .cint ;
ruleht = ruleht + ruledp ;
curv = curv + ruleht ;
if ( ( ruleht > 0 ) && ( rulewd > 0 ) )
{
if ( curh != dvih )
{
movement ( curh - dvih , 143 ) ;
dvih = curh ;
}
if ( curv != dviv )
{
movement ( curv - dviv , 157 ) ;
dviv = curv ;
}
{
dvibuf [ dviptr ] = 137 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
dvifour ( ruleht ) ;
dvifour ( rulewd ) ;
}
goto lab15 ;
lab13: curv = curv + ruleht ;
}
lab15: p = mem [(long) p ] .hh .v.RH ;
}
prunemovemen ( saveloc ) ;
if ( curs > 0 )
dvipop ( saveloc ) ;
decr ( curs ) ;
}
zshipout ( p )
halfword p ;
{/* 30 */ r_shipout
integer pageloc ;
quarterword j, k ;
poolpointer s ;
quarterword oldsetting ;
if ( eqtb [ 5301 ] .cint > 0 )
{
printnl ( 206 ) ;
println () ;
print ( 682 ) ;
}
if ( termoffset > maxprintline - 9 )
println () ;
else if ( ( termoffset > 0 ) || ( fileoffset > 0 ) )
printchar ( 32 ) ;
printchar ( 91 ) ;
j = 9 ;
while ( ( eqtb [ 5317 + j ] .cint == 0 ) && ( j > 0 ) ) decr ( j ) ;
for ( k = 0 ; k <= j ; k ++ )
{
printint ( eqtb [ 5317 + k ] .cint ) ;
if ( k < j )
printchar ( 46 ) ;
}
termflush ( output ) ;
if ( eqtb [ 5301 ] .cint > 0 )
{
printchar ( 93 ) ;
begindiagnos () ;
showbox ( p ) ;
enddiagnosti ( true ) ;
}
if ( ( mem [(long) p + 3 ] .cint > 1073741823 ) || ( mem [(long) p + 2 ] .cint >
1073741823 ) || ( mem [(long) p + 3 ] .cint + mem [(long) p + 2 ] .cint + eqtb [ 5720 ]
.cint > 1073741823 ) || ( mem [(long) p + 1 ] .cint + eqtb [ 5719 ] .cint >
1073741823 ) )
{
{
if ( interaction == 3 )
wakeuptermin () ;
printnl ( 133 ) ;
print ( 686 ) ;
}
{
helpptr = 2 ;
helpline [ 1 ] = 687 ;
helpline [ 0 ] = 688 ;
}
error () ;
if ( eqtb [ 5301 ] .cint <= 0 )
{
begindiagnos () ;
printnl ( 689 ) ;
showbox ( p ) ;
enddiagnosti ( true ) ;
}
goto lab30 ;
}
if ( mem [(long) p + 3 ] .cint + mem [(long) p + 2 ] .cint + eqtb [ 5720 ] .cint > maxv
)
maxv = mem [(long) p + 3 ] .cint + mem [(long) p + 2 ] .cint + eqtb [ 5720 ] .cint ;
if ( mem [(long) p + 1 ] .cint + eqtb [ 5719 ] .cint > maxh )
maxh = mem [(long) p + 1 ] .cint + eqtb [ 5719 ] .cint ;
dvih = 0 ;
dviv = 0 ;
curh = eqtb [ 5719 ] .cint ;
dvif = 0 ;
if ( outputfilena == 0 )
{
if ( jobname == 0 )
openlogfile () ;
packjobname ( 647 ) ;
while ( ! bopenout ( dvifile ) ) promptfilena ( 648 , 647 ) ;
outputfilena = bmakenamestr ( dvifile ) ;
}
if ( totalpages == 0 )
{
{
dvibuf [ dviptr ] = 247 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
{
dvibuf [ dviptr ] = 2 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
dvifour ( 25400000 ) ;
dvifour ( 473628672 ) ;
preparemag () ;
dvifour ( eqtb [ 5284 ] .cint ) ;
oldsetting = selector ;
selector = 21 ;
print ( 680 ) ;
printint ( eqtb [ 5290 ] .cint ) ;
printchar ( 46 ) ;
printtwo ( eqtb [ 5289 ] .cint ) ;
printchar ( 46 ) ;
printtwo ( eqtb [ 5288 ] .cint ) ;
printchar ( 58 ) ;
printtwo ( eqtb [ 5287 ] .cint / 60 ) ;
printtwo ( eqtb [ 5287 ] .cint % 60 ) ;
selector = oldsetting ;
{
dvibuf [ dviptr ] = ( poolptr - strstart [ strptr ] ) ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
for ( s = strstart [ strptr ] ; s <= poolptr - 1 ; s ++ )
{
dvibuf [ dviptr ] = strpool [ s ] ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
poolptr = strstart [ strptr ] ;
}
pageloc = dvioffset + dviptr ;
{
dvibuf [ dviptr ] = 139 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
for ( k = 0 ; k <= 9 ; k ++ )
dvifour ( eqtb [ 5317 + k ] .cint ) ;
dvifour ( lastbop ) ;
lastbop = pageloc ;
curv = mem [(long) p + 3 ] .cint + eqtb [ 5720 ] .cint ;
tempptr = p ;
if ( mem [(long) p ] .hh.b0 == 1 )
vlistout () ;
else hlistout () ;
{
dvibuf [ dviptr ] = 140 ;
incr ( dviptr ) ;
if ( dviptr == dvilimit )
dviswap () ;
}
incr ( totalpages ) ;
curs = - 1 ;
lab30: ;
if ( eqtb [ 5301 ] .cint <= 0 )
printchar ( 93 ) ;
deadcycles = 0 ;
termflush ( output ) ;
#ifdef STAT
if ( eqtb [ 5298 ] .cint > 1 )
{
printnl ( 683 ) ;
printint ( varused ) ;
printchar ( 38 ) ;
printint ( dynused ) ;
printchar ( 59 ) ;
}
#endif /* STAT */
flushnodelis ( p ) ;
#ifdef STAT
if ( eqtb [ 5298 ] .cint > 1 )
{
print ( 684 ) ;
printint ( varused ) ;
printchar ( 38 ) ;
printint ( dynused ) ;
print ( 685 ) ;
printint ( himemmin - lomemmax - 1 ) ;
println () ;
}
#endif /* STAT */
}
scanspec () { /* 40 */ r_scanspec
if ( scankeyword ( 695 ) )
savestack [ saveptr + 0 ] .cint = 0 ;
else if ( scankeyword ( 696 ) )
savestack [ saveptr + 0 ] .cint = 1 ;
else {
savestack [ saveptr + 0 ] .cint = 1 ;
savestack [ saveptr + 1 ] .cint = 0 ;
goto lab40 ;
}
scandimen ( false , false , false ) ;
savestack [ saveptr + 1 ] .cint = curval ;
lab40: saveptr = saveptr + 2 ;
scanleftbrac () ;
}
halfword zhpack ( p , w , m )
halfword p ;
scaled w ;
smallnumber m ;
{/* 21 50 10 */ register halfword Result; r_hpack
halfword r ;
halfword q ;
scaled h, d, x ;
scaled s ;
halfword g ;
glueord o ;
internalfont f ;
fourquarters i ;
eightbits hd ;
integer b ;
r = getnode ( 7 ) ;
mem [(long) r ] .hh.b0 = 0 ;
mem [(long) r ] .hh.b1 = 0 ;
mem [(long) r + 4 ] .cint = 0 ;
q = r + 5 ;
mem [(long) q ] .hh .v.RH = p ;
h = 0 ;
d = 0 ;
x = 0 ;
totalstretch [ 0 ] = 0 ;
totalshrink [ 0 ] = 0 ;
totalstretch [ 1 ] = 0 ;
totalshrink [ 1 ] = 0 ;
totalstretch [ 2 ] = 0 ;
totalshrink [ 2 ] = 0 ;
totalstretch [ 3 ] = 0 ;
totalshrink [ 3 ] = 0 ;
while ( p != 0 ) {
lab21: while ( ( p >= himemmin ) ) {
f = mem [(long) p ] .hh.b0 ;
i = fontinfo [ charbase [ f ] + mem [(long) p ] .hh.b1 ] .qqqq ;
hd = i .b1 ;
x = x + fontinfo [ widthbase [ f ] + i .b0 ] .cint ;
s = fontinfo [ heightbase [ f ] + ( hd ) / 16 ] .cint ;
if ( s > h )
h = s ;
s = fontinfo [ depthbase [ f ] + ( hd ) % 16 ] .cint ;
if ( s > d )
d = s ;
p = mem [(long) p ] .hh .v.RH ;
}
if ( p != 0 )
{
switch ( mem [(long) p ] .hh.b0 )
{case 0 :
case 1 :
case 2 :
case 13 :
{
x = x + mem [(long) p + 1 ] .cint ;
if ( mem [(long) p ] .hh.b0 >= 2 )
s = 0 ;
else s = mem [(long) p + 4 ] .cint ;
if ( mem [(long) p + 3 ] .cint - s > h )
h = mem [(long) p + 3 ] .cint - s ;
if ( mem [(long) p + 2 ] .cint + s > d )
d = mem [(long) p + 2 ] .cint + s ;
}
break ;
case 3 :
case 4 :
case 5 :
if ( adjusttail != 0 )
{
while ( mem [(long) q ] .hh .v.RH != p ) q = mem [(long) q ] .hh .v.RH ;
if ( mem [(long) p ] .hh.b0 == 5 )
{
mem [(long) adjusttail ] .hh .v.RH = mem [(long) p + 1 ] .cint ;
while ( mem [(long) adjusttail ] .hh .v.RH != 0 ) adjusttail = mem [(long)
adjusttail ] .hh .v.RH ;
p = mem [(long) p ] .hh .v.RH ;
freenode ( mem [(long) q ] .hh .v.RH , 2 ) ;
}
else {
mem [(long) adjusttail ] .hh .v.RH = p ;
adjusttail = p ;
p = mem [(long) p ] .hh .v.RH ;
}
mem [(long) q ] .hh .v.RH = p ;
p = q ;
}
break ;
case 8 :
break ;
case 10 :
{
g = mem [(long) p + 1 ] .hh .v.LH ;
x = x + mem [(long) g + 1 ] .cint ;
o = mem [(long) g ] .hh.b0 ;
totalstretch [ o ] = totalstretch [ o ] + mem [(long) g + 2 ] .cint ;
o = mem [(long) g ] .hh.b1 ;
totalshrink [ o ] = totalshrink [ o ] + mem [(long) g + 3 ] .cint ;
if ( mem [(long) p ] .hh.b1 >= 100 )
{
g = mem [(long) p + 1 ] .hh .v.RH ;
if ( mem [(long) g + 3 ] .cint > h )
h = mem [(long) g + 3 ] .cint ;
if ( mem [(long) g + 2 ] .cint > d )
d = mem [(long) g + 2 ] .cint ;
}
}
break ;
case 11 :
case 9 :
x = x + mem [(long) p + 1 ] .cint ;
break ;
case 6 :
{
mem [(long) memtop - 12 ] = mem [(long) p + 1 ] ;
mem [(long) memtop - 12 ] .hh .v.RH = mem [(long) p ] .hh .v.RH ;
p = memtop - 12 ;
goto lab21 ;
}
break ;
default :
break ;
}
p = mem [(long) p ] .hh .v.RH ;
}
}
if ( adjusttail != 0 )
mem [(long) adjusttail ] .hh .v.RH = 0 ;
mem [(long) r + 3 ] .cint = h ;
mem [(long) r + 2 ] .cint = d ;
if ( m == 1 )
w = x + w ;
mem [(long) r + 1 ] .cint = w ;
x = w - x ;
if ( x == 0 )
{
mem [(long) r + 5 ] .hh.b0 = 0 ;
mem [(long) r + 5 ] .hh.b1 = 0 ;
mem [(long) r + 6 ] .gr = 0.0 ;
goto lab10 ;
}
else if ( x > 0 )
{
if ( totalstretch [ 3 ] != 0 )
o = 3 ;
else if ( totalstretch [ 2 ] != 0 )
o = 2 ;
else if ( totalstretch [ 1 ] != 0 )
o = 1 ;
else o = 0 ;
mem [(long) r + 5 ] .hh.b1 = o ;
mem [(long) r + 5 ] .hh.b0 = 1 ;
if ( totalstretch [ o ] != 0 )
mem [(long) r + 6 ] .gr = x / ((double) totalstretch [ o ] ) ;
else {
mem [(long) r + 5 ] .hh.b0 = 0 ;
mem [(long) r + 6 ] .gr = 0.0 ;
}
if ( ( eqtb [ 5293 ] .cint < 10000 ) && ( o == 0 ) && ( mem [(long) r + 5 ] .hh
.v.RH != 0 ) )
{
b = badness ( x , totalstretch [ 0 ] ) ;
if ( b > eqtb [ 5293 ] .cint )
{
println () ;
if ( b > 100 )
printnl ( 697 ) ;
else printnl ( 698 ) ;
print ( 699 ) ;
printint ( b ) ;
goto lab50 ;
}
}
goto lab10 ;
}
else {
if ( totalshrink [ 3 ] != 0 )
o = 3 ;
else if ( totalshrink [ 2 ] != 0 )
o = 2 ;
else if ( totalshrink [ 1 ] != 0 )
o = 1 ;
else o = 0 ;
mem [(long) r + 5 ] .hh.b1 = o ;
mem [(long) r + 5 ] .hh.b0 = 2 ;
if ( totalshrink [ o ] != 0 )
mem [(long) r + 6 ] .gr = ( - x ) / ((double) totalshrink [ o ] ) ;
else {
mem [(long) r + 5 ] .hh.b0 = 0 ;
mem [(long) r + 6 ] .gr = 0.0 ;
}
if ( ( totalshrink [ o ] < - x ) && ( o == 0 ) && ( mem [(long) r + 5 ] .hh
.v.RH != 0 ) )
{
mem [(long) r + 6 ] .gr = 1.0 ;
if ( ( - x - totalshrink [ 0 ] > eqtb [ 5709 ] .cint ) || ( eqtb [ 5293
] .cint < 100 ) )
{
if ( ( eqtb [ 5717 ] .cint > 0 ) && ( - x - totalshrink [ 0 ] > eqtb [
5709 ] .cint ) )
{
while ( mem [(long) q ] .hh .v.RH != 0 ) q = mem [(long) q ] .hh .v.RH ;
mem [(long) q ] .hh .v.RH = newrule () ;
mem [(long) mem [(long) q ] .hh .v.RH + 1 ] .cint = eqtb [ 5717 ] .cint ;
}
println () ;
printnl ( 705 ) ;
printscaled ( - x - totalshrink [ 0 ] ) ;
print ( 706 ) ;
goto lab50 ;
}
}
else if ( ( eqtb [ 5293 ] .cint < 100 ) && ( o == 0 ) && ( mem [(long) r + 5 ]
.hh .v.RH != 0 ) )
{
b = badness ( - x , totalshrink [ 0 ] ) ;
if ( b > eqtb [ 5293 ] .cint )
{
println () ;
printnl ( 707 ) ;
printint ( b ) ;
goto lab50 ;
}
}
goto lab10 ;
}
lab50: if ( outputactive )
print ( 700 ) ;
else {
if ( packbeginlin != 0 )
{
if ( packbeginlin > 0 )
print ( 701 ) ;
else print ( 702 ) ;
printint ( abs ( packbeginlin ) ) ;
print ( 703 ) ;
}
else print ( 704 ) ;
printint ( line ) ;
}
println () ;
fontinshortd = 0 ;
shortdisplay ( mem [(long) r + 5 ] .hh .v.RH ) ;
println () ;
begindiagnos () ;
showbox ( r ) ;
enddiagnosti ( true ) ;
lab10: Result = r ;
return(Result) ;
}
halfword zvpackage ( p , h , m , l )
halfword p ;
scaled h ;
smallnumber m ;
scaled l ;
{/* 50 10 */ register halfword Result; r_vpackage
halfword r ;
scaled w, d, x ;
scaled s ;
halfword g ;
glueord o ;
integer b ;
r = getnode ( 7 ) ;
mem [(long) r ] .hh.b0 = 1 ;
mem [(long) r ] .hh.b1 = 0 ;
mem [(long) r + 4 ] .cint = 0 ;
mem [(long) r + 5 ] .hh .v.RH = p ;
w = 0 ;
d = 0 ;
x = 0 ;
totalstretch [ 0 ] = 0 ;
totalshrink [ 0 ] = 0 ;
totalstretch [ 1 ] = 0 ;
totalshrink [ 1 ] = 0 ;
totalstretch [ 2 ] = 0 ;
totalshrink [ 2 ] = 0 ;
totalstretch [ 3 ] = 0 ;
totalshrink [ 3 ] = 0 ;
while ( p != 0 ) {
if ( ( p >= himemmin ) )
confusion ( 708 ) ;
else switch ( mem [(long) p ] .hh.b0 )
{case 0 :
case 1 :
case 2 :
case 13 :
{
x = x + d + mem [(long) p + 3 ] .cint ;
d = mem [(long) p + 2 ] .cint ;
if ( mem [(long) p ] .hh.b0 >= 2 )
s = 0 ;
else s = mem [(long) p + 4 ] .cint ;
if ( mem [(long) p + 1 ] .cint + s > w )
w = mem [(long) p + 1 ] .cint + s ;
}
break ;
case 8 :
;
break ;
case 10 :
{
x = x + d ;
d = 0 ;
g = mem [(long) p + 1 ] .hh .v.LH ;
x = x + mem [(long) g + 1 ] .cint ;
o = mem [(long) g ] .hh.b0 ;
totalstretch [ o ] = totalstretch [ o ] + mem [(long) g + 2 ] .cint ;
o = mem [(long) g ] .hh.b1 ;
totalshrink [ o ] = totalshrink [ o ] + mem [(long) g + 3 ] .cint ;
if ( mem [(long) p ] .hh.b1 >= 100 )
{
g = mem [(long) p + 1 ] .hh .v.RH ;
if ( mem [(long) g + 1 ] .cint > w )
w = mem [(long) g + 1 ] .cint ;
}
}
break ;
case 11 :
{
x = x + d + mem [(long) p + 1 ] .cint ;
d = 0 ;
}
break ;
default :
;
break ;
}
p = mem [(long) p ] .hh .v.RH ;
}
mem [(long) r + 1 ] .cint = w ;
if ( d > l )
{
x = x + d - l ;
mem [(long) r + 2 ] .cint = l ;
}
else mem [(long) r + 2 ] .cint = d ;
if ( m == 1 )
h = x + h ;
mem [(long) r + 3 ] .cint = h ;
x = h - x ;
if ( x == 0 )
{
mem [(long) r + 5 ] .hh.b0 = 0 ;
mem [(long) r + 5 ] .hh.b1 = 0 ;
mem [(long) r + 6 ] .gr = 0.0 ;
goto lab10 ;
}
else if ( x > 0 )
{
if ( totalstretch [ 3 ] != 0 )
o = 3 ;
else if ( totalstretch [ 2 ] != 0 )
o = 2 ;
else if ( totalstretch [ 1 ] != 0 )
o = 1 ;
else o = 0 ;
mem [(long) r + 5 ] .hh.b1 = o ;
mem [(long) r + 5 ] .hh.b0 = 1 ;
if ( totalstretch [ o ] != 0 )
mem [(long) r + 6 ] .gr = x / ((double) totalstretch [ o ] ) ;
else {
mem [(long) r + 5 ] .hh.b0 = 0 ;
mem [(long) r + 6 ] .gr = 0.0 ;
}
if ( ( eqtb [ 5294 ] .cint < 10000 ) && ( o == 0 ) && ( mem [(long) r + 5 ] .hh
.v.RH != 0 ) )
{
b = badness ( x , totalstretch [ 0 ] ) ;
if ( b > eqtb [ 5294 ] .cint )
{
println () ;
if ( b > 100 )
printnl ( 697 ) ;
else printnl ( 698 ) ;
print ( 709 ) ;
printint ( b ) ;
goto lab50 ;
}
}
goto lab10 ;
}
else {
if ( totalshrink [ 3 ] != 0 )
o = 3 ;
else if ( totalshrink [ 2 ] != 0 )
o = 2 ;
else if ( totalshrink [ 1 ] != 0 )
o = 1 ;
else o = 0 ;
mem [(long) r + 5 ] .hh.b1 = o ;
mem [(long) r + 5 ] .hh.b0 = 2 ;
if ( totalshrink [ o ] != 0 )
mem [(long) r + 6 ] .gr = ( - x ) / ((double) totalshrink [ o ] ) ;
else {
mem [(long) r + 5 ] .hh.b0 = 0 ;
mem [(long) r + 6 ] .gr = 0.0 ;
}
if ( ( totalshrink [ o ] < - x ) && ( o == 0 ) && ( mem [(long) r + 5 ] .hh
.v.RH != 0 ) )
{
mem [(long) r + 6 ] .gr = 1.0 ;
if ( ( - x - totalshrink [ 0 ] > eqtb [ 5710 ] .cint ) || ( eqtb [ 5294
] .cint < 100 ) )
{
println () ;
printnl ( 710 ) ;
printscaled ( - x - totalshrink [ 0 ] ) ;
print ( 711 ) ;
goto lab50 ;
}
}
else if ( ( eqtb [ 5294 ] .cint < 100 ) && ( o == 0 ) && ( mem [(long) r + 5 ]
.hh .v.RH != 0 ) )
{
b = badness ( - x , totalshrink [ 0 ] ) ;
if ( b > eqtb [ 5294 ] .cint )
{
println () ;
printnl ( 712 ) ;
printint ( b ) ;
goto lab50 ;
}
}
goto lab10 ;
}
lab50: if ( outputactive )
print ( 700 ) ;
else {
if ( packbeginlin != 0 )
{
print ( 702 ) ;
printint ( abs ( packbeginlin ) ) ;
print ( 703 ) ;
}
else print ( 704 ) ;
printint ( line ) ;
println () ;
}
begindiagnos () ;
showbox ( r ) ;
enddiagnosti ( true ) ;
lab10: Result = r ;
return(Result) ;
}