#-h- convrt.r 1387 asc 08-jul-80 15:56:13 #-h- convrt.q 541 asc 08-jul-80 15:50:03 subroutine main character buf(MAXLINE), arg(FILENAMESIZE) integer fdb, getfdb, cctl, cctype, declin, i, getarg, unit, open i = 1 repeat { if (getarg(i, arg, FILENAMESIZE) == EOF) if (i == 1) { i = i + 1 unit = STDIN } else break else { i = i + 1 unit = open(arg, READ) if (unit == ERR) call cant(arg) } fdb = getfdb(unit) cctl = cctype(fdb) while (declin(buf, fdb, cctl) != EOF) call putlin(buf, STDOUT) if (unit != STDIN) call close(unit) } return end #-h- declin.q 748 asc 08-jul-80 15:50:04 define(LISTCTRL,2) define(FORTCTRL,1) define(NONECTRL,0) define(CONTROLM,13) define(CONTROLL,12) integer function declin(buf, fdb, cctl) integer fdb, cctl, n, gets, i, j, length character buf(ARB) n = gets(fdb, buf, MAXLINE-2) if (n < 0) { declin = EOF buf(1) = EOS } else { if (cctl == LISTCTRL) { n = n + 1 buf(n) = NEWLINE } else if (cctl == FORTCTRL) { if (buf(1) == DIG1) buf(1) = CONTROLL else if (buf(1) == DIG0) buf(1) = NEWLINE else buf(1) = CONTROLM n = n + 1 buf(n) = NEWLINE } i = 1 for (j=1; j <= n; j=j+1) if (buf(j) != CONTROLM & buf(j) != EOS) { buf(i) = buf(j) i = i + 1 } buf(i) = EOS declin = length(buf) } return end