%%s 0/0/0 %%d D 1.1 25-Mar-82 12:00:43 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 #-h- defns 458 asc 25-mar-82 07:14:30 v1.1 (sw-tools v1.1) # TCS data file keys define(STATS,"%%s ") # statistics define(VERKEY,"%%d ") # key field on history-info lines define(COMMENT,"%%c ") define(ENDKEY,"%%T") # end of header define(INSERT,"%%I ") # begin "inserted in this version" define(DELETE,"%%D ") # begin "deleted in this version" define(ENDSEG,"%%E ") # end of segment # definitions to convert long names to 6 characters define(txtfile,txtfil) define(tcsfile,tcsfil) define(scrfile,scrfil) #-h- admin.r 4322 asc 25-mar-82 11:25:23 v1.1 (sw-tools v1.1) #-h- main 1152 asc 25-mar-82 07:14:18 v1.1 (sw-tools v1.1) #-p- # # # # MAIN # # author: Neil P. Groundwater (ADI) date: 11-SEP-81 # # # # Purpose: Validates the calling arguments then calls ADMIT. # # # Calling convention: main # # Modules called by MAIN # error # admit # getarg # clower # # # #-p- include "defns" subroutine main integer getarg, getlin, open character arg1(FILENAMESIZE) # might need to be longer character txtfile(FILENAMESIZE) # source (text) file (-i flag) character tcsfile(FILENAMESIZE) # history (.tcs) file character clower integer i, j call query("usage: admin -ifile file.tcs.") if (getarg(1, arg1, FILENAMESIZE) == EOF | getarg(2, tcsfile, FILENAMESIZE) == EOF) # for now, only one valid form call error("? Usage: admin -ifile file.tcs") if (arg1(1) != '-') call error("- flag missing") else { if (clower(arg1(2)) == 'i') { i = 3; j = 1 repeat { txtfile(j) = arg1(i) if (arg1(i) == EOS) break i = i+1 j = j+1 } if (j == 1) call error("-i... filename missing") call admit(txtfile, tcsfile) } else call error("Invalid flag") } return end #-h- admit 3024 asc 25-mar-82 11:22:53 v1.1 (sw-tools v1.1) #-p- # # # # ADMIT # # author: Neil P. Groundwater (ADI) date: 11-SEP-81 # # # # Purpose: Enter text file into Text Control System for the first time. # # # Calling convention: admit(txtfile, tcsfile) # # # Formal Parameters # txtfile: User's source file # tcsfile: Name of Text Control System version of source file # # # Modules called by ADMIT # cant # scratf # putlin # putch # gdate # gtime # mailid # close # amove # bmatch # create # getlin # open # prompt # # # Modules which call ADMIT # main # # # Description of algorithm: Gather date,time,and username from the # system. Accept initial user comments. Enter the source file and add # appropriate keys for Text Control System recognition. # # # #-p- include "defns" define(DATESIZE, 10) define(NOWSIZE, 7) define(TIMESIZE, 9) subroutine admit(txtfile, tcsfile) character txtfile(FILENAMESIZE) # name of history file character tcsfile(FILENAMESIZE) # name of new history file # (may be tcsfile) character scrfile(FILENAMESIZE) # name of scratch file integer bmatch, create, getlin, open, prompt, index character date(DATESIZE), time(TIMESIZE) character inbuf(MAXLINE) integer fdtxt, fdscr # i/o file descriptors integer cnt, now(NOWSIZE), ind string sct "SCT" fdtxt = open(txtfile, READ) if (fdtxt == ERR) call cant(txtfile) call scratf(sct, scrfile) fdscr = create(scrfile, WRITE) if (fdscr == ERR) call cant(scrfile) # STEP 1. Initialize the history info. # fake the statistics for now. call putlin(STATS, fdscr) call putlin("0/0/0", fdscr) call putch('@n', fdscr) call putlin(VERKEY, fdscr) call putlin("D 1.1 ", fdscr) call getnow(now) call fmtdat( date, time, now, LETTER) call putlin( date, fdscr) call putch(' ', fdscr) call putlin( time, fdscr) call putch(' ', fdscr) call mailid(inbuf) # fetch user name ind = index(inbuf, ' ') # see if buried blanks in name if (ind > 0) # YES, truncate user name inbuf(ind) = EOS call putlin(inbuf, fdscr) call putlin(" 1 0", fdscr) # initialize ancestry call putch('@n', fdscr) # STEP 2. General comments. call putlin("Enter general comments (end with a 'dot-line')", ERROUT) call putch('@n', ERROUT) repeat { cnt = prompt("> ", inbuf, STDIN) if (cnt == 0) break if ((cnt == 2) & (inbuf(1) == '.')) break call putlin(COMMENT, fdscr) call putlin(inbuf, fdscr) } call putlin(ENDKEY, fdscr) # end the header call putch('@n', fdscr) # STEP 3. Append the text file. call putlin(INSERT, fdscr) # start version 1 info call putlin("1", fdscr) call putch('@n', fdscr) while (getlin(inbuf, fdtxt) != EOF) call putlin(inbuf, fdscr) call putlin(ENDSEG, fdscr) # end version 1 info call putlin("1", fdscr) call putch('@n', fdscr) # STEP 4. Housekeeping. call close(fdtxt) call close(fdscr) call amove(scrfile, tcsfile) # done - move the results return end #-h- admin.fmt 1013 asc 25-mar-82 07:14:34 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Admin (1) 14-Sep-81 administer TCS file. .sy admin -ifile file.tcs .ds Admin -i enters a text file into the TCS system for the first time. File is the source file to be entered into the system. Local convention is to use the name "file.tcs" for files maintained by TCS. The file is tagged as Version #1.1 and the user is prompted for initial comments concerning the development of the file. The date, time and user ID are recorded in the statistics portion of the file. .fl A scratch file is used while creating the output file and moved upon completion of input. .sa delta, get .di usage: admin -ifile file.tcs .in +10 Correct calling format is provided when called without arguments. .in -10 - flag missing .in +10 Incorrect calling procedure. .in -10 -i... filename missing .in +10 The input filename is expected to be immediately adjacent to the -i flag. (no white-space) .in -10 Invalid flag .in +10 -i is the only valid flag at present. .in -10 .au Neil Groundwater at ADI. .bu %%E 1