%%s 2/2/387 %%d D 1.7 21-Oct-83 13:42:35 tools 7 6 %%c Modified rc.fmt to eliminate reference to -l... and -p... loader %%c specific flags in the synopsis. %%s 5/5/384 %%d D 1.6 27-Sep-83 17:29:05 tools 6 5 %%c Added support for -x... loader flags in main and rccmd. This permits %%c site-dependent loader flags to be added without requiring modifications %%c to the source for rc. %%s 47/6/342 %%d D 1.5 31-Jul-83 09:47:01 tools 5 4 %%c When displaying commands in verbose mode, namfix is now called to %%c convert long directory specs into the shorthand ./, ~/, ~usr/ and ~bin/. %%s 5/5/343 %%d D 1.4 15-Jun-83 12:45:47 sventek 4 3 %%c Removed trailing periods from quoted strings, as they are no longer needed. %%s 58/23/290 %%d D 1.3 13-Jun-83 09:56:39 sventek 3 2 %%c Modifications made to invoke ratp1 FILE.r | ratp2 >FILE.f %%s 40/22/273 %%d D 1.2 13-Dec-82 14:38:37 dpm 2 1 %%c Added a "-m" switch to force generation of a load map. The "-d" option %%c no longer forces a listing and link map, but instead forces the source %%c to be left around ("-f"). This was done to better support the source-level %%c debugging facilities in the V3.0 VMS debugger. %%s 0/0/0 %%d D 1.1 25-Mar-82 12:12:30 v1.1 1 0 %%c Version 1.1 is the Spring 1982 Distribution of the LBL/Hughes release %%c of the Software Tools Virtual Operating System software and documentation. %%T %%I 1 %%D 2 #-h- crc 523 asc 25-mar-82 08:30:13 v1.1 (sw-tools v1.1) #--------------------------------------------------------------- %%E 2 %%I 2 #-h- crc 484 asc 10-nov-82 17:20:42 dpm (dave martin) %%E 2 ## crc common block for 'rc' tool %%D 2 # put on a file named 'crc' %%E 2 %%D 2 common / crc / load, savef, ratonl, verbos, list, debug %%E 2 %%I 2 common / crc / ldmap, load, savef, ratonl, verbos, list, debug %%E 2 %%I 2 integer ldmap # YES/NO for load map from linker %%E 2 integer load # YES/NO for link after compilation integer savef # YES/NO for saving intermediate .f files integer ratonl # YES/NO for rat4 only => savef == YES integer verbos # YES/NO for verbose mutterings integer list # YES/NO for fortran listings during compilation integer debug # YES/NO for debugging aid; init = NO #-h- flist 277 asc 25-mar-82 08:30:15 v1.1 (sw-tools v1.1) #------------------------------------------------------ # flist - common block # should be put on a file named 'flist' common /flist/ flevel, ffiles(FILENAMESIZE, FLMAX) integer flevel #pointer to current file character ffiles #list of files to process %%D 2 #-h- rc.r 4503 asc 25-mar-82 08:30:19 v1.1 (sw-tools v1.1) %%E 2 %%I 2 %%D 3 #-h- rc.r 4660 asc 10-nov-82 19:34:57 dpm (dave martin) %%E 3 %%E 2 %%I 3 %%D 4 #-h- rc.r 5756 asc 13-may-83 12:05:10 sventek (joseph sventek) %%E 4 %%E 3 %%I 4 %%D 5 #-h- rc.r 5753 asc 15-jun-83 12:45:21 sventek (joseph sventek) %%E 5 %%E 4 %%I 5 %%D 6 #-h- rc.r 6777 asc 31-jul-83 09:45:56 tools (lblh csam sventek) %%E 6 %%E 5 %%I 6 #-h- rc.r 6809 asc 27-sep-83 17:17:14 tools (lblh csam sventek) %%E 6 #-h- defns 37 asc 25-mar-82 08:29:37 v1.1 (sw-tools v1.1) define(FLMAX,25) define(EXTSIZE,4) %%D 2 #-h- main 2264 asc 25-mar-82 08:29:40 v1.1 (sw-tools v1.1) %%E 2 %%I 2 %%D 3 #-h- main 2353 asc 10-nov-82 19:33:02 dpm (dave martin) %%E 3 %%E 2 %%I 3 %%D 4 #-h- main 3442 asc 13-may-83 09:31:06 sventek (joseph sventek) %%E 4 %%E 3 %%I 4 %%D 5 #-h- main 3439 asc 15-jun-83 12:44:57 sventek (joseph sventek) %%E 5 %%E 4 %%I 5 %%D 6 #-h- main 3565 asc 30-jul-83 19:06:09 tools (lblh csam sventek) %%E 6 %%E 5 %%I 6 #-h- main 3573 asc 27-sep-83 16:51:42 tools (lblh csam sventek) %%E 6 DRIVER(rc) character arg(FILENAMESIZE), ext(EXTSIZE), args(ARGBUFSIZE), %%D 3 rat4(FILENAMESIZE), descr(PIDSIZE), spath(arith(FILENAMESIZE,*,3)) integer errcnt, i, k, status, spawn, getarg, loccom, junk, remove %%E 3 %%I 3 ratp1(FILENAMESIZE), ratp2(FILENAMESIZE), temp(FILENAMESIZE), %%D 5 descr(PIDSIZE) %%E 5 %%I 5 descr(PIDSIZE), p1fix(FILENAMESIZE), p2fix(FILENAMESIZE) %%E 5 integer errcnt, i, k, status, spawn, getarg, loccom, junk, remove, amove, index %%E 3 include flist include crc string suffix IMAGE_SUFFIX %%D 2 string minusd "-d " %%E 2 %%D 3 string rat4s "ratfor" %%E 3 %%I 3 string spath STD_PATH string ratp1s "ratp1" string ratp2s "ratp2" %%E 3 string fc "fc" string extf(EXTSIZE) "f" %%I 3 string scrext "rp1" %%E 3 string minusc "-c " %%D 2 string minusv "-v " %%E 2 %%I 2 string minusd "-d " string minusm "-m " %%E 2 string minuso "-o " %%I 2 string minusv "-v " %%E 2 %%D 2 call query("usage: rc [-cdforv] [-l[libr]] [-pproc] file ...") %%E 2 %%I 2 %%D 6 call query("usage: rc [-cdfmorv] [-l[libr]] [-pproc] file ...") %%E 6 %%E 2 %%I 6 call query("usage: rc [-cdfmorv] [-l[libr]] [-pproc] [-x...] file ...") %%E 6 load = YES savef = NO ratonl = NO verbos = NO list = NO debug = NO %%I 2 ldmap = NO %%E 2 errcnt = 0 for (i=1; getarg(i, arg, FILENAMESIZE) != EOF; i=i+1) { if (arg(1) == '-' | arg(1) == '+') call rccmd(arg) else call fstack(arg) } %%D 3 call impath(spath) if (loccom(rat4s, spath, suffix, rat4) != BINARY) call error("Cannot locate ratfor image file.") %%E 3 %%I 3 if (loccom(ratp1s, spath, suffix, ratp1) != BINARY) %%D 4 call error("Cannot locate ratp1 image file.") %%E 4 %%I 4 call error("Cannot locate ratp1 image file") %%E 4 %%I 5 call namfix(ratp1, p1fix) %%E 5 if (loccom(ratp2s, spath, suffix, ratp2) != BINARY) %%D 4 call error("Cannot locate ratp2 image file.") %%E 4 %%I 4 call error("Cannot locate ratp2 image file") %%E 4 %%I 5 call namfix(ratp2, p2fix) %%E 5 call scratf(scrext, temp) %%E 3 for (i=1; i <= flevel; i=i+1) { call getext(ffiles(1,i), ext) if (ffiles(1,i) != '-' & ext(1) == 'r' & ext(2) == EOS) { call genfil(ffiles(1,i), extf, arg) %%I 3 k = 1 call stcopy(ratp1s, 1, args, k) call chcopy(' ', args, k) call stcopy(ffiles(1,i), 1, args, k) call chcopy(' ', args, k) call chcopy('>', args, k) call scopy(temp, 1, args, k) if (verbos == YES) { %%D 5 call putlin(ratp1, ERROUT) %%E 5 %%I 5 call putlin(p1fix, ERROUT) %%E 5 call putch(' ', ERROUT) call putlin(ffiles(1,i), ERROUT) call putlin(" | ", ERROUT) %%D 5 call putlin(ratp2, ERROUT) %%E 5 %%I 5 call putlin(p2fix, ERROUT) %%E 5 call putlin(" >", ERROUT) call putlnl(arg, ERROUT) } if (spawn(ratp1, args, descr, WAIT) != OK) { errcnt = errcnt + 1 junk = amove(temp, arg) } else { k = 1 call stcopy(ratp2s, 1, args, k) call chcopy(' ', args, k) call stcopy(temp, 1, args, k) call chcopy(' ', args, k) call chcopy('>', args, k) call scopy(arg, 1, args, k) if (spawn(ratp2, args, descr, WAIT) != OK) errcnt = errcnt + 1 } %%E 3 k = 1 %%D 3 call stcopy(rat4s, 1, args, k) call chcopy(' ', args, k) call stcopy(ffiles(1,i), 1, args, k) call chcopy(' ', args, k) call chcopy('>', args, k) call scopy(arg, 1, args, k) if (verbos == YES) call remark(args) if (spawn(rat4, args, descr, WAIT) == ERR) errcnt = errcnt + 1 k = 1 %%E 3 if (savef == NO) { ffiles(1,i) = '>' k = 2 } call scopy(arg, 1, ffiles(1,i), k) } } if (ratonl == NO & errcnt == 0) { k = 1 call stcopy(fc, 1, args, k) call chcopy(' ', args, k) if (load == NO) call stcopy(minusc, 1, args, k) if (verbos == YES) %%D 3 call stcopy(minusv, 1, args, k) %%E 3 %%I 3 call stcopy(minusv, 1, args, k) %%E 3 if (list == YES) call stcopy(minuso, 1, args, k) if (debug == YES) call stcopy(minusd, 1, args, k) %%I 2 if (ldmap == YES) call stcopy(minusm, 1, args, k) %%E 2 for (i=1; i <= flevel; i=i+1) { if (ffiles(1,i) == '>') call stcopy(ffiles(1,i), 2, args, k) else call stcopy(ffiles(1,i), 1, args, k) call chcopy(' ', args, k) } args(k-1) = EOS %%D 3 if (verbos == YES) call remark(args) %%E 3 if (loccom(fc, spath, suffix, arg) != BINARY) %%D 4 call error("Cannot locate fc image file.") %%E 4 %%I 3 %%I 4 call error("Cannot locate fc image file") %%E 4 %%I 5 call namfix(arg, p1fix) %%E 5 if (verbos == YES) { %%D 5 call putlin(arg, ERROUT) %%E 5 %%I 5 call putlin(p1fix, ERROUT) %%E 5 k = index(args, ' ') call putlnl(args(k), ERROUT) } %%E 3 status = spawn(arg, args, descr, WAIT) for (i=1; i <= flevel; i=i+1) { if (ffiles(1,i) == '>') junk = remove(ffiles(2,i)) } } %%I 3 junk = remove(temp) %%E 3 DRETURN end #-h- fstack 330 asc 25-mar-82 08:29:43 v1.1 (sw-tools v1.1) ## fstack - generate stack of input files subroutine fstack (iarg) integer i character iarg(FILENAMESIZE) include flist if (flevel < FLMAX) { flevel = flevel + 1 for (i=1; i<=FILENAMESIZE; i=i+1) ffiles(i,flevel) = iarg(i) call fold(ffiles(1, flevel)) } return end #-h- genfil 458 asc 25-mar-82 08:29:44 v1.1 (sw-tools v1.1) ## genfil -- generates file name with extension ext from in subroutine genfil(in, ext, out) integer i, j integer length character in(FILENAMESIZE), ext(EXTSIZE), out(FILENAMESIZE) string trmchr "/]" for (i=length(in); i > 0; i=i-1) if (index(trmchr, in(i)) > 0) break for (j=i+1; in(j) != EOS; j=j+1) if (in(j) == '.') break for (i=1; i < j; i=i+1) out(i) = in(i) call chcopy('.', out, i) call scopy(ext, 1, out, i) return end #-h- getext 456 asc 25-mar-82 08:29:46 v1.1 (sw-tools v1.1) subroutine getext(file, ext) character file(FILENAMESIZE), ext(EXTSIZE) integer i, j integer length, index string trmchr "/]" for (i=length(file); i > 0; i=i-1) if (index(trmchr, file(i)) > 0) break for (j=i+1; file(j) != EOS; j=j+1) if (file(j) == '.') { j = j + 1 break } for (i=1; file(j) != EOS & file(j) != ';' & file(j) != '.'; i=i+1) { ext(i) = file(j) j = j + 1 } ext(i) = EOS call fold(ext) return end %%D 2 #-h- rccmd 520 asc 25-mar-82 08:29:48 v1.1 (sw-tools v1.1) %%E 2 %%I 2 %%D 6 #-h- rccmd 594 asc 10-nov-82 17:09:29 dpm (dave martin) %%E 6 %%E 2 %%I 6 #-h- rccmd 610 asc 27-sep-83 16:51:45 tools (lblh csam sventek) %%E 6 subroutine rccmd(arg) character arg(FILENAMESIZE) integer index include crc call fold(arg) if (arg(1) == '-') %%D 6 if (arg(2) == 'l' | arg(2) == 'p') %%E 6 %%I 6 if (arg(2) == 'l' | arg(2) == 'p' | arg(2) == 'x') %%E 6 call fstack(arg) else { if (index(arg, 'c') > 0) load = NO if (index(arg, 'd') > 0) %%I 2 { %%E 2 debug = YES %%I 2 savef = YES } %%E 2 if (index(arg, 'f') > 0) savef = YES %%I 2 if (index(arg, 'm') > 0) ldmap = YES %%E 2 if (index(arg, 'o') > 0) list = YES if (index(arg, 'r') > 0) { ratonl = YES savef = YES } if (index(arg, 'v') > 0) verbos = YES } else call badarg(arg) return end %%D 2 #-h- rc.fmt 1719 asc 25-mar-82 08:30:25 v1.1 (sw-tools v1.1) %%E 2 %%I 2 %%I 5 #-h- namfix 819 asc 30-jul-83 19:22:48 tools (lblh csam sventek) subroutine namfix(file, fixfil) character file(FILENAMESIZE), fixfil(FILENAMESIZE) integer i, n integer indexs, length for (i = 1; i <= 5; i = i + 1) { switch (i) { case 1: call gwdir(fixfil, LOCAL) case 2: call tooldr(fixfil, LOCAL) case 3: call getdir(USRDIRECTORY, LOCAL, fixfil) case 4: call getdir(BINDIRECTORY, LOCAL, fixfil) case 5: fixfil(1) = EOS } if (i == 5) break if (indexs(file, fixfil) == 1) break } n = length(fixfil) + 1 switch (i) { case 1: call strcpy("./", fixfil) ifdef(TREE_STRUCT_FILE_SYS) case 2: call strcpy("~/tools/", fixfil) elsedef case 2: call strcpy("~/", fixfil) enddef case 3: call strcpy("~usr/", fixfil) case 4: call strcpy("~bin/", fixfil) } call concat(fixfil, file(n), fixfil) return end %%E 5 %%D 7 #-h- rc.fmt 1780 asc 13-dec-82 14:07:14 dpm (dave martin) %%E 7 %%E 2 %%I 7 #-h- rc.fmt 1760 asc 21-oct-83 13:41:33 tools (lblh csam sventek) %%E 7 .so ~bin/manhdr %%D 2 .hd Rc (1) 12-Aug-81 %%E 2 %%I 2 .hd Rc (1) 13-Dec-82 %%E 2 RatFor compiler .sy %%D 2 rc [-cdforv] [-l[libr]] [-pproc] file ... %%E 2 %%I 2 %%D 7 rc [-cdfmorv] [-l[libr]] [-pproc] file ... %%E 7 %%E 2 %%I 7 rc [-cdfmorv] file ... %%E 7 .ds rc is the ratfor compiler. It accepts the following types of arguments: .in +3 .ti -3 1. Files whose names end in '.r' are assumed to be ratfor source programs; they are preprocessed into fortran and compiled. The preprocessed file for name.r is placed on name.f and the compiled object code appears on name.obj. The name.f file is removed unless -f is specified (see below). .ti -3 %%D 2 2. Six flags which affect the actions of the compiler are: %%E 2 %%I 2 2. The flags which affect the actions of the compiler are: %%E 2 .in +3 .ti -3 -c suppress the loading phase, as does any preprocessing or compilation error %%I 2 %%E 2 .ti -3 %%D 2 -d do whatever is necessary to prepare the fortran files for the system debugger. In addition, pass the -d on to fc. %%E 2 %%I 2 -d do whatever is necessary to prepare the fortran files for the system debugger. In addition, pass the -d on to fc. The -d implies -f also. %%E 2 .ti -3 %%D 2 -r ratfor only; don't compile fortran; implies -f and -c .ti -3 %%E 2 -f save fortran intermediate files; usually for debugging purposes %%I 2 %%E 2 .ti -3 %%D 2 -v verbose option; prints name of each file as it is preprocessed and prints name of each '.f' file as it is compiled %%E 2 %%I 2 -m passed on to fc and ld. Produce a load map of some sort. %%E 2 .ti -3 -o generates fortran listing for name.f on name.l %%I 2 .ti -3 -r ratfor only; don't compile fortran; implies -f and -c .ti -3 -v verbose option; prints additional information about the compilation process %%E 2 .in -3 .ti -3 3. Files whose names end in '.f' are assumed to be fortran source programs, and are compiled. Other arguments are assumed to be loader flags, or object files, typically created by an earlier rc or fc run. These files, together with the results of any compilations, are loaded to produce an executable process. .in -3 .sa ratfor, the ratfor preprocessor, for descriptions of the language and for a more general way of performing the preprocessing. .br fc, the fortran compiler .br ld, the loader, for loader flags and process naming conventions .au Joe Sventek wrote the interface of rc to ratfor, fc, and ld. .bu %%E 1