-- file: TFtoPLOrganizeImpl.mesa -- Pascal-to-Mesa translator output, translated at September 23, 1986 1:04:35 pm PDT DIRECTORY PascalBasic, PascalWizardFiles, TFtoPLPrivate, TFtoPLExternals, TFtoPLMain; TFtoPLOrganizeImpl: PROGRAM IMPORTS PascalWizardFiles, TFtoPLMain EXPORTS TFtoPLPrivate = PUBLIC BEGIN OPEN PascalBasic, PascalWizardFiles, TFtoPLPrivate, TFtoPLExternals, TFtoPLMain; --:52----85:-- Organize: PROCEDURE RETURNS[OrganizeResult: PascalBoolean] = BEGIN TfmPtr:Index; --20:--PascalReadLong[file: @TfmFile.baseFile, length: SIZE[PascalInteger[0..255], 2], element: @TfmFile.element, item: @Tfm^[0]];{{IF INT[Tfm^[0]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "The first byte of the input file exceeds 127!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;IF PascalEOF[file: @TfmFile.baseFile] THEN BEGIN { PascalWriteLongString[file: @Output, item: "The input file is only one byte long!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;PascalReadLong[file: @TfmFile.baseFile, length: SIZE[PascalInteger[0..255], 2], element: @TfmFile.element, item: @Tfm^[1]];Lf_Tfm^[0]*256+Tfm^[1]; IF Lf=0 THEN BEGIN { PascalWriteLongString[file: @Output, item: "The file claims to have length zero, but that's impossible!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;IF INT[4]*Lf-1>TfmSize THEN BEGIN { PascalWriteLongString[file: @Output, item: "The file is bigger than I can handle!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END; FOR i:INT IN [ INT[2 ].. INT[ INT[4]*Lf-1 ]] DO TfmPtr _ i; IF PascalEOF[file: @TfmFile.baseFile] THEN BEGIN { PascalWriteLongString[file: @Output, item: "The file has fewer bytes than it claims!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;PascalReadLong[file: @TfmFile.baseFile, length: SIZE[PascalInteger[0..255], 2], element: @TfmFile.element, item: @Tfm^[TfmPtr]]; ENDLOOP; IF NOT PascalEOF[file: @TfmFile.baseFile] THEN BEGIN { PascalWriteLongString[file: @Output, item: "There's some extra junk at the end of the TFM file,"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "but I'll proceed as if it weren't there."]; PascalWriteLn[file: @Output]}; END--:20--;--21: BEGIN TfmPtr_2;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Lh_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Bc_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Ec_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Nw_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Nh_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Nd_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Ni_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Nl_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Nk_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Ne_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;BEGIN IF INT[Tfm^[TfmPtr]]>127 THEN BEGIN { PascalWriteLongString[file: @Output, item: "One of the subfile sizes is negative!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;Np_Tfm^[TfmPtr]*256+Tfm^[TfmPtr+1];TfmPtr_TfmPtr+2; END;IF Lf#6+Lh+( INT[Ec-Bc]+1)+Nw+Nh+Nd+Ni+Nl+Nk+Ne+Np THEN BEGIN { PascalWriteLongString[file: @Output, item: "Subfile sizes don't add up to the stated total!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END;IF(Nw=0)OR (Nh=0)OR (Nd=0)OR (Ni=0) THEN BEGIN { PascalWriteLongString[file: @Output, item: "Incomplete subfiles for character dimensions!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END; IF( INT[Bc]>Ec+1)OR ( INT[Ec]>255) THEN BEGIN {PascalWriteLongString[file: @Output, item: "The character code range "]; PascalWriteInteger[file: @Output, item: Bc, fieldMinLength: 1 ]; PascalWriteLongString[file: @Output, item: ".."]; PascalWriteInteger[file: @Output, item: Ec, fieldMinLength: 1]; PascalWriteLongString[file: @Output, item: "is illegal!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END; IF INT[Ne]>256 THEN BEGIN {PascalWriteLongString[file: @Output, item: "There are "]; PascalWriteInteger[file: @Output, item: Ne, fieldMinLength: 1]; PascalWriteLongString[file: @Output, item: " extensible recipes!"]; PascalWriteLn[file: @Output]}; {PascalWriteLongString[file: @Output, item: "Sorry, but I can't go on; are you sure this is a TFM?"]; PascalWriteLn[file: @Output]}; GOTO Label9999; END; END--:21--;--23:--BEGIN CharBase_ INT[6+Lh]-Bc; WidthBase_CharBase+Ec+1;HeightBase_WidthBase+Nw; DepthBase_HeightBase+Nh;ItalicBase_DepthBase+Nd; LigKernBase_ItalicBase+Ni;KernBase_LigKernBase+Nl; ExtenBase_KernBase+Nk;ParamBase_ExtenBase+Ne-1; END--:23--; OrganizeResult_TRUE; GOTO Label30;EXITS Label9999 => NULL};OrganizeResult_FALSE;EXITS Label30 => NULL}; END;--:85----86: END.