INTEGER RD(884) INTEGER I,J,TYPE,LEN,ERRS INTEGER FP,FLEN(40),FDELIM(40),FINDEX(40),LASTFP INTEGER ROW(500) INTEGER GETLIN,ADDFI0,CTOI,FINDF0,CTOC,ISATTY INTEGER STR(102),WORD(102),NAME(102) INTEGER BUF(400) INTEGER * 4 L INTEGER * 4 GCTOL REAL * 8 D REAL * 8 CTOD INTEGER AAAAA0 INTEGER AAAAB0(19) INTEGER AAAAC0 INTEGER AAAAD0(22) INTEGER AAAAE0(23) INTEGER AAAAF0(23) INTEGER AAAAG0(19) INTEGER AAAAH0(20) INTEGER AAAAI0 INTEGER AAAAJ0(25) INTEGER AAAAK0(22) INTEGER AAAAL0 INTEGER AAAAM0(18) INTEGER AAAAN0(15) DATA AAAAB0/201,236,236,229,231,225,236,160,236,229,238,231,244,23 *2,186,160,170,243,0/ DATA AAAAD0/201,236,236,229,231,225,236,160,228,225,244,225,160,24 *4,249,240,229,186,160,170,243,0/ DATA AAAAE0/201,236,236,229,231,225,236,160,230,233,229,236,228,16 *0,238,225,237,229,186,160,170,243,0/ DATA AAAAF0/201,236,236,229,231,225,236,160,230,233,229,236,228,16 *0,238,225,237,229,186,160,170,243,0/ DATA AAAAG0/196,245,240,236,233,227,225,244,229,160,238,225,237,22 *9,186,160,170,243,0/ DATA AAAAH0/195,225,238,167,244,160,225,228,228,160,230,233,229,23 *6,228,186,160,170,243,0/ DATA AAAAJ0/201,236,236,229,231,225,236,160,233,238,240,245,244,16 *0,236,229,238,231,244,232,186,160,170,243,0/ DATA AAAAK0/213,238,242,229,227,239,231,238,233,250,229,228,160,24 *7,239,242,228,186,160,170,243,0/ DATA AAAAM0/170,243,186,160,226,225,228,160,233,238,244,229,231,22 *9,242,170,238,0/ DATA AAAAN0/170,243,186,160,226,225,228,160,242,229,225,236,170,23 *8,0/ ERRS=0 RD(1)=3 RD(2)=3-22+1 RD(3)=0 FP=1 GOTO 10002 10000 FP=FP+(1) 10002 IF((GETLIN(STR,-12).EQ.-1))GOTO 10001 I=1 CALL GETWO0(STR,I,WORD) AAAAA0=WORD(1) GOTO 10003 10004 TYPE=1 GOTO 10005 10006 TYPE=2 GOTO 10005 10007 TYPE=3 J=2 LEN=CTOI(WORD,J) IF((LEN.EQ.0))GOTO 10009 IF((WORD(J).NE.0))GOTO 10009 GOTO 10008 10009 ERRS=ERRS+(1) CALL PRINT(-15,AAAAB0,STR) 10008 GOTO 10005 10003 IF(AAAAA0.EQ.201)GOTO 10004 AAAAC0=AAAAA0-209 GOTO(10006,10007),AAAAC0 IF(AAAAA0.EQ.233)GOTO 10004 AAAAC0=AAAAA0-241 GOTO(10006,10007),AAAAC0 ERRS=ERRS+(1) CALL PRINT(-15,AAAAD0,STR) 10005 CALL GETWO0(STR,I,NAME) IF((193.GT.NAME(1)))GOTO 10011 IF((NAME(1).GT.218))GOTO 10011 GOTO 10010 10011 IF((225.GT.NAME(1)))GOTO 10012 IF((NAME(1).GT.250))GOTO 10012 GOTO 10010 10012 ERRS=ERRS+(1) CALL PRINT(-15,AAAAE0,STR) GOTO 10013 10010 J=1 GOTO 10016 10014 J=J+(1) 10016 IF((NAME(J).EQ.0))GOTO 10015 IF((193.GT.NAME(J)))GOTO 10018 IF((NAME(J).GT.218))GOTO 10018 GOTO 10017 10018 IF((225.GT.NAME(J)))GOTO 10019 IF((NAME(J).GT.250))GOTO 10019 GOTO 10017 10019 IF((176.GT.NAME(J)))GOTO 10020 IF((NAME(J).GT.185))GOTO 10020 GOTO 10017 10020 IF((NAME(J).EQ.223))GOTO 10017 ERRS=ERRS+(1) CALL PRINT(-15,AAAAF0,STR) GOTO 10015 10017 GOTO 10014 10015 CONTINUE 10013 IF((FINDF0(RD,NAME).EQ.0))GOTO 10021 ERRS=ERRS+(1) CALL PRINT(-15,AAAAG0,STR) 10021 FINDEX(FP)=ADDFI0(RD,TYPE,LEN,NAME) IF((FINDEX(FP).NE.0))GOTO 10022 ERRS=ERRS+(1) CALL PRINT(-15,AAAAH0,STR) 10022 FLEN(FP)=400 FDELIM(FP)=160 10023 CALL GETWO0(STR,I,WORD) AAAAI0=WORD(1) GOTO 10024 10025 FDELIM(FP)=WORD(2) GOTO 10026 10027 J=2 FLEN(FP)=CTOI(WORD,J) IF((FLEN(FP).LT.1))GOTO 10029 IF((WORD(J).NE.0))GOTO 10029 GOTO 10028 10029 ERRS=ERRS+(1) CALL PRINT(-15,AAAAJ0,STR) 10028 GOTO 10026 10030 GOTO 10031 10024 IF(AAAAI0.EQ.0)GOTO 10030 IF(AAAAI0.EQ.163)GOTO 10030 IF(AAAAI0.EQ.196)GOTO 10025 IF(AAAAI0.EQ.204)GOTO 10027 IF(AAAAI0.EQ.228)GOTO 10025 IF(AAAAI0.EQ.236)GOTO 10027 ERRS=ERRS+(1) CALL PRINT(-15,AAAAK0,STR) 10026 CONTINUE GOTO 10023 10031 GOTO 10000 10001 IF((ERRS.LE.0))GOTO 10032 CALL SWT 10032 CALL SAVERD(RD,-11) IF((ISATTY(-11).NE.1))GOTO 10033 CALL PRINT0(RD,-11) 10033 LASTFP=FP-1 10034 IF((GETLIN(BUF,-10).EQ.-1))GOTO 10035 I=1 FP=1 GOTO 10038 10036 FP=FP+(1) 10038 IF((FP.GT.LASTFP))GOTO 10037 10039 IF((BUF(I).NE.FDELIM(FP)))GOTO 10040 I=I+(1) GOTO 10039 10040 J=1 GOTO 10043 10041 I=I+(1) J=J+(1) 10043 IF((BUF(I).EQ.138))GOTO 10042 IF((BUF(I).EQ.0))GOTO 10042 IF((BUF(I).EQ.FDELIM(FP)))GOTO 10042 IF((J.GT.FLEN(FP)))GOTO 10042 STR(J)=BUF(I) GOTO 10041 10042 STR(J)=0 IF((BUF(I).NE.FDELIM(FP)))GOTO 10044 I=I+(1) 10044 AAAAL0=RD(FINDEX(FP)) GOTO 10045 10046 J=1 L=GCTOL(STR,J,10) IF((STR(J).EQ.0))GOTO 10047 CALL PRINT(-15,AAAAM0,STR) 10047 CALL PUTDA0(RD,FINDEX(FP),ROW,L) GOTO 10048 10049 J=1 D=CTOD(STR,J) IF((STR(J).EQ.0))GOTO 10050 CALL PRINT(-15,AAAAN0,STR) 10050 CALL PUTDA0(RD,FINDEX(FP),ROW,D) GOTO 10048 10051 J=CTOC(STR,WORD,RD(FINDEX(FP)+1)+1) J=J+(1) GOTO 10054 10052 J=J+(1) 10054 IF((J.GT.RD(FINDEX(FP)+1)))GOTO 10053 WORD(J)=160 GOTO 10052 10053 CALL PUTDA0(RD,FINDEX(FP),ROW,WORD) GOTO 10048 10045 GOTO(10046,10049,10051),AAAAL0 10048 GOTO 10036 10037 CALL PUTROW(RD,-11,ROW) GOTO 10034 10035 IF((ISATTY(-11).NE.1))GOTO 10055 CALL PRINU0(RD,-11) 10055 CALL SWT END SUBROUTINE GETWO0(STR,I,WORD) INTEGER STR(1),WORD(102) INTEGER I INTEGER J 10056 IF((STR(I).NE.160))GOTO 10057 I=I+(1) GOTO 10056 10057 J=1 GOTO 10060 10058 I=I+(1) J=J+(1) 10060 IF((STR(I).EQ.160))GOTO 10059 IF((STR(I).EQ.138))GOTO 10059 IF((STR(I).EQ.0))GOTO 10059 WORD(J)=STR(I) GOTO 10058 10059 WORD(J)=0 RETURN END INTEGER FUNCTION LOADRD(RD,FD) INTEGER RD(884) INTEGER FD INTEGER ISATTY,READF IF((ISATTY(FD).NE.1))GOTO 10061 CALL REMARK('Sorry, a relation can''t be read from the terminal. *') LOADRD=-3 RETURN 10061 IF((READF(RD(1),1,FD).NE.-1))GOTO 10062 LOADRD=-3 RETURN 10062 IF((READF(RD(2),RD(1)-1,FD).NE.-1))GOTO 10063 CALL REMARK('relation is corrupted!!.') LOADRD=-3 RETURN 10063 LOADRD=-2 RETURN END SUBROUTINE SAVERD(RD,FD) INTEGER RD(884) INTEGER FD INTEGER ISATTY IF((ISATTY(FD).NE.1))GOTO 10064 CALL PRINV0(RD,FD) GOTO 10065 10064 CALL WRITEF(RD,RD(1),FD) 10065 RETURN END SUBROUTINE PRINV0(RD,FD) INTEGER RD(884) INTEGER FD INTEGER I INTEGER TYPE(102) INTEGER AAAAO0(10) INTEGER AAAAP0(33) INTEGER AAAAQ0(10) INTEGER AAAAR0 INTEGER AAAAS0(8) INTEGER AAAAT0(5) INTEGER AAAAU0(7) INTEGER AAAAV0(24) INTEGER AAAAW0(10) DATA AAAAO0/170,179,185,172,172,173,248,170,238,0/ DATA AAAAP0/252,160,244,249,240,229,160,160,160,160,252,160,236,22 *9,238,231,244,232,160,252,160,238,225,237,229,170,177,179,248,252, *170,238,0/ DATA AAAAQ0/170,179,185,172,172,173,248,170,238,0/ DATA AAAAS0/233,238,244,229,231,229,242,0/ DATA AAAAT0/242,229,225,236,0/ DATA AAAAU0/243,244,242,233,238,231,0/ DATA AAAAV0/252,160,170,183,243,160,252,160,170,181,233,160,160,25 *2,160,170,177,182,243,160,252,170,238,0/ DATA AAAAW0/170,179,185,172,172,173,248,170,238,0/ CALL PRINT(FD,AAAAO0) CALL PRINT(FD,AAAAP0) CALL PRINT(FD,AAAAQ0) I=3+1 GOTO 10068 10066 I=I+22 10068 IF((I.GT.RD(2)))GOTO 10067 AAAAR0=RD(I) GOTO 10069 10070 CALL CTOC(AAAAS0,TYPE,102) GOTO 10071 10072 CALL CTOC(AAAAT0,TYPE,102) GOTO 10071 10073 CALL CTOC(AAAAU0,TYPE,102) GOTO 10071 10069 GOTO(10070,10072,10073),AAAAR0 10071 CALL PRINT(FD,AAAAV0,TYPE,RD(I+1),RD(I+5)) GOTO 10066 10067 CALL PRINT(FD,AAAAW0) RETURN END INTEGER FUNCTION ADDFI0(RD,TYPE,LEN,NAME) INTEGER RD(884) INTEGER TYPE,LEN INTEGER NAME(1) INTEGER I INTEGER AAAAX0 I=RD(2)+22 IF((I+22-1.LE.884))GOTO 10074 ADDFI0=0 RETURN 10074 RD(I)=TYPE RD(I+4)=LENGTH(NAME) AAAAX0=TYPE GOTO 10075 10076 RD(I+1)=2 RD(I+4)=MAX0(RD(I+4),10) GOTO 10077 10078 RD(I+1)=4 RD(I+4)=MAX0(RD(I+4),15) GOTO 10077 10079 RD(I+1)=LEN RD(I+4)=MAX0(RD(I+4),LEN) GOTO 10077 10075 GOTO(10076,10078,10079),AAAAX0 CALL ERROR('in add_field_to_rd: bogus type passed.') 10077 RD(I+2)=RD(3)+1 RD(I+3)=RD(3)+RD(I+1) CALL CTOC(NAME,RD(I+5),17) RD(1)=RD(1)+(22) RD(2)=RD(2)+(22) RD(3)=RD(3)+(RD(I+1)) IF((RD(3).LE.500))GOTO 10080 ADDFI0=0 RETURN 10080 ADDFI0=I RETURN END INTEGER FUNCTION FINDF0(RD,NAME) INTEGER RD(884) INTEGER NAME(1) INTEGER I INTEGER EQUAL I=3+1 GOTO 10083 10081 I=I+22 10083 IF((I.GT.RD(2)))GOTO 10082 IF((EQUAL(RD(I+5),NAME).NE.1))GOTO 10084 FINDF0=I RETURN 10084 GOTO 10081 10082 FINDF0=0 RETURN END INTEGER FUNCTION COMPA0(TYPE,BUF1,BUF2) INTEGER TYPE INTEGER BUF1(500),BUF2(500) INTEGER R INTEGER COMPB0,COMPC0,COMPD0 INTEGER AAAAY0 INTEGER AAAAZ0(34) DATA AAAAZ0/233,238,160,227,239,237,240,225,242,229,223,230,233,22 *9,236,228,186,160,226,239,231,245,243,160,244,249,240,229,160,170, *233,170,238,0/ AAAAY0=TYPE GOTO 10085 10086 R=COMPB0(BUF1,BUF2) GOTO 10087 10088 R=COMPC0(BUF1,BUF2) GOTO 10087 10089 R=COMPD0(BUF1,BUF2) GOTO 10087 10085 GOTO(10086,10088,10089),AAAAY0 CALL PRINT(-15,AAAAZ0,TYPE) R=2 10087 COMPA0=R RETURN END INTEGER FUNCTION COMPB0(I1,I2) INTEGER * 4 I1,I2 IF((I1.GE.I2))GOTO 10090 COMPB0=1 RETURN 10090 IF((I1.LE.I2))GOTO 10091 COMPB0=3 RETURN 10091 COMPB0=2 RETURN END INTEGER FUNCTION COMPC0(D1,D2) REAL * 8 D1,D2 IF((D1.GE.D2))GOTO 10092 COMPC0=1 RETURN 10092 IF((D1.LE.D2))GOTO 10093 COMPC0=3 RETURN 10093 COMPC0=2 RETURN END INTEGER FUNCTION COMPD0(S1,S2) INTEGER S1(1),S2(1) INTEGER I I=1 GOTO 10096 10094 I=I+(1) 10096 IF((S1(I).NE.S2(I)))GOTO 10095 IF((S1(I).EQ.0))GOTO 10095 GOTO 10094 10095 IF((S1(I).NE.S2(I)))GOTO 10097 COMPD0=2 RETURN 10097 IF((S1(I).EQ.0))GOTO 10099 IF((S1(I).LT.S2(I)))GOTO 10099 GOTO 10098 10099 COMPD0=1 RETURN 10098 COMPD0=3 RETURN END SUBROUTINE PRINT0(RD,FD) INTEGER RD(884) INTEGER FD INTEGER I INTEGER AAABA0(2) INTEGER AAABB0(7) INTEGER AAABC0(3) INTEGER AAABD0(2) INTEGER AAABE0(7) INTEGER AAABF0(3) INTEGER AAABG0(2) INTEGER AAABH0(7) INTEGER AAABI0(3) DATA AAABA0/173,0/ DATA AAABB0/170,163,172,172,173,248,0/ DATA AAABC0/170,238,0/ DATA AAABD0/252,0/ DATA AAABE0/160,170,163,243,160,252,0/ DATA AAABF0/170,238,0/ DATA AAABG0/173,0/ DATA AAABH0/170,163,172,172,173,248,0/ DATA AAABI0/170,238,0/ CALL PRINT(FD,AAABA0) I=3+1 GOTO 10102 10100 I=I+22 10102 IF((I.GT.RD(2)))GOTO 10101 CALL PRINT(FD,AAABB0,RD(I+4)+3) GOTO 10100 10101 CALL PRINT(FD,AAABC0) CALL PRINT(FD,AAABD0) I=3+1 GOTO 10105 10103 I=I+22 10105 IF((I.GT.RD(2)))GOTO 10104 CALL PRINT(FD,AAABE0,RD(I+4),RD(I+5)) GOTO 10103 10104 CALL PRINT(FD,AAABF0) CALL PRINT(FD,AAABG0) I=3+1 GOTO 10108 10106 I=I+22 10108 IF((I.GT.RD(2)))GOTO 10107 CALL PRINT(FD,AAABH0,RD(I+4)+3) GOTO 10106 10107 CALL PRINT(FD,AAABI0) RETURN END SUBROUTINE PRINU0(RD,FD) INTEGER RD(884) INTEGER FD INTEGER I INTEGER AAABJ0(2) INTEGER AAABK0(7) INTEGER AAABL0(3) DATA AAABJ0/173,0/ DATA AAABK0/170,163,172,172,173,248,0/ DATA AAABL0/170,238,0/ CALL PRINT(FD,AAABJ0) I=3+1 GOTO 10111 10109 I=I+22 10111 IF((I.GT.RD(2)))GOTO 10110 CALL PRINT(FD,AAABK0,RD(I+4)+3) GOTO 10109 10110 CALL PRINT(FD,AAABL0) RETURN END SUBROUTINE PRINW0(RD,FD,BUF) INTEGER RD(884) INTEGER FD INTEGER BUF(500) INTEGER I INTEGER AAABM0(2) INTEGER AAABN0 INTEGER AAABO0(7) INTEGER AAABP0(7) INTEGER AAABQ0(9) INTEGER AAABR0(3) DATA AAABM0/252,0/ DATA AAABO0/160,170,163,236,160,252,0/ DATA AAABP0/160,170,163,228,160,252,0/ DATA AAABQ0/160,170,163,172,163,243,160,252,0/ DATA AAABR0/170,238,0/ CALL PRINT(FD,AAABM0) I=3+1 GOTO 10114 10112 I=I+22 10114 IF((I.GT.RD(2)))GOTO 10113 AAABN0=RD(I) GOTO 10115 10116 CALL PRINT(FD,AAABO0,RD(I+4),BUF(RD(I+2))) GOTO 10117 10118 CALL PRINT(FD,AAABP0,RD(I+4),BUF(RD(I+2))) GOTO 10117 10119 CALL PRINT(FD,AAABQ0,RD(I+4),RD(I+1),BUF(RD(I+2))) GOTO 10117 10115 GOTO(10116,10118,10119),AAABN0 10117 GOTO 10112 10113 CALL PRINT(FD,AAABR0) RETURN END INTEGER FUNCTION GETROW(RD,FD,BUF) INTEGER RD(884) INTEGER FD INTEGER BUF(500),I INTEGER READF I=READF(BUF,RD(3),FD) GETROW=I RETURN END SUBROUTINE PUTROW(RD,FD,BUF) INTEGER RD(884) INTEGER FD INTEGER BUF(500) INTEGER ISATTY IF((ISATTY(FD).NE.1))GOTO 10120 CALL PRINW0(RD,FD,BUF) GOTO 10121 10120 CALL WRITEF(BUF,RD(3),FD) 10121 RETURN END SUBROUTINE GETDA0(RD,I,BUF,DEST) INTEGER RD(884) INTEGER I,BUF(1),DEST(102) INTEGER J,K INTEGER AAABS0 AAABS0=RD(I) GOTO 10122 10123 J=RD(I+2) DEST(1)=BUF(J) DEST(2)=BUF(J+1) GOTO 10124 10125 J=RD(I+2) DEST(1)=BUF(J) DEST(2)=BUF(J+1) DEST(3)=BUF(J+2) DEST(4)=BUF(J+3) GOTO 10124 10126 J=RD(I+3) K=RD(I+1) GOTO 10129 10127 J=J-(1) K=K-(1) 10129 IF((K.LE.0))GOTO 10128 IF((BUF(J).NE.160))GOTO 10128 GOTO 10127 10128 DEST(K+1)=0 GOTO 10132 10130 J=J-(1) K=K-(1) 10132 IF((K.LE.0))GOTO 10131 DEST(K)=BUF(J) GOTO 10130 10131 GOTO 10124 10122 GOTO(10123,10125,10126),AAABS0 10124 RETURN END SUBROUTINE PUTDA0(RD,I,BUF,SRC) INTEGER RD(884) INTEGER I,BUF(1),SRC(102) INTEGER J,K INTEGER AAABT0 AAABT0=RD(I) GOTO 10133 10134 J=RD(I+2) BUF(J)=SRC(1) BUF(J+1)=SRC(2) GOTO 10135 10136 J=RD(I+2) BUF(J)=SRC(1) BUF(J+1)=SRC(2) BUF(J+2)=SRC(3) BUF(J+3)=SRC(4) GOTO 10135 10137 J=RD(I+2) K=1 GOTO 10140 10138 J=J+(1) K=K+(1) 10140 IF((SRC(K).EQ.0))GOTO 10139 IF((K.GT.RD(I+1)))GOTO 10139 BUF(J)=SRC(K) GOTO 10138 10139 GOTO 10143 10141 K=K+(1) J=J+(1) 10143 IF((K.GT.RD(I+1)))GOTO 10142 BUF(J)=160 GOTO 10141 10142 GOTO 10135 10133 GOTO(10134,10136,10137),AAABT0 10135 RETURN END INTEGER FUNCTION COMPE0(RD,ROW1,ROW2) INTEGER RD(884) INTEGER ROW1(500),ROW2(500) INTEGER BUF1(500),BUF2(500) INTEGER R,I INTEGER COMPA0 I=3+1 GOTO 10146 10144 I=I+22 10146 IF((I.GT.RD(2)))GOTO 10145 CALL GETDA0(RD,I,ROW1,BUF1) CALL GETDA0(RD,I,ROW2,BUF2) R=COMPA0(RD(I),BUF1,BUF2) IF((R.EQ.2))GOTO 10147 COMPE0=R RETURN 10147 GOTO 10144 10145 COMPE0=2 RETURN END C ---- Long Name Map ---- C comparefield compa0 C printheader print0 C comparerow compe0 C printtrailer prinu0 C putdata putda0 C compareinteger compb0 C comparestring compd0 C findfield findf0 C getword getwo0 C printrd prinv0 C printrow prinw0 C comparereal compc0 C getdata getda0 C addfieldtord addfi0