.TITLE INIFIL - CHECK FOR INITIALIZTION PARAMETER FILE .IDENT /1.4/ .ENABL LC ;+ ; ; Free software BY ; Project Software & Development, Inc. ; ; This software is furnished for free and may be used and copied as ; desired. This software or any other copies thereof may be provided ; or otherwise made available to any other person. No title to and ; ownership of the software is hereby transferred or allowed. ; ; The information in this software is subject to change without notice ; and should not be construed as a commitment by PROJECT SOFTWARE ; AND DEVELOPMENT, INC. ; ; PROJECT SOFTWARE assumes no responsibility for the use or reliability ; of this software on any equipment whatsoever. ; ; Project Software & Development, Inc. ; 14 Story St. ; Cambridge, Ma. 02138 ; 617-661-1444 ; ; ; Title: RSXINI ; Author: Gary Larsen ; Date: April 19, 1982 ; ; Description: ; ; This module will check for an RSXNET.INI file to set the parameters ; for the present RSXNET session. ; ; Modification History: ; ; Version 1.3 July 21, 1982 by Robin Miller ; Check for system initialization file in LB:[1,2]. ; ; Version 1.4 November 1, 1982 by Gary Larsen ; Check to see if an ini file was specified on mcr command line. ;- .ENABL AMA .NLIST BEX .MCALL CLOSE$, GET$ ; Local storage: SYSINI: .ASCII "LB:[1,2]" ; SYSTEM INI FILE ACCOUNT INIDFL: .ASCIZ "RSXNET.INI" ; DEFAULT INITILIZATION FILE NAME .EVEN INIFLG::.WORD 0 ; .INI FILE OPEN FLAG <> 0 = TRUE BADINI::.WORD 0 ; BAD INI FILE NAME FLAG <> 0 = TRUE .SBTTL INIFIL - OPEN THE RSXNET INITIALIZATION FILE ;+ ; ; INIFIL - Open the RSXNET initialization file. ; ; This routine attempts to open the RSXNET initialization file. This ; file is used to answer the various startup questions. An .INI file ; is searched for in the current UIC first and if that fails, LB:[1,2] ; is also checked so a system initialization file can be used. ; ; Inputs: ; None. ; ; Outputs: ; INIFLG = -1 if an initialization file is open. ; ; All registers are preserved. ; ;- INIFIL:: CALL $SAVAL ; SAVE THE REGISTERS CLR INIFLG ; CLEAR THE INIT FILE FLAG MOV #CMDFDB,R0 ; ADDRESS OF COMMAND FDB MOV #CMDFDB+F.FNB,R1 ; ADDRESS OF THE FNB MOV #'R,R3 ; SET FOR READ TST GMCFLG ; DID WE SPECIFY AN INI FILE ? BEQ 5$ ; IF EQ, NO MOV #INIFLN,R2 ; INI FILE INPUT ADDRESS 2$: CMPB (R2),#'. ; DID THEY SPECIFY AN EXTENSION ? BEQ 4$ ; IF NE, NO 3$: TSTB (R2)+ ; FIND THE END OF INPUT STRING BNE 2$ ; IF NE, NOT YET DECB R2 ; POINT TO NULL MOVB #'.,(R2)+ ; MOVE MOVB #'I,(R2)+ ; IN MOVB #'N,(R2)+ ; THE MOVB #'I,(R2)+ ; .INI EXTENSION 4$: MOV #INIFLN,R2 ; COPY THE DEFAULT INPUT ADDRESS CALL OPEN ; TRY TO OPEN THE FILE BCC 10$ ; IF CC, FOUND ONE MOV #-1,BADINI ; SHOW THEY SPECIFIED A BAD INI FILE JMP EXIT ; AND EXIT 5$: MOV #INIDFL,R2 ; COPY THE DEFAULT INPUT ADDRESS CALL OPEN ; TRY TO OPEN THE FILE BCC 10$ ; IF CC, FOUND ONE MOV #SYSINI,R2 ; TRY LB:[1,2] NEXT CALL OPEN ; TRY TO OPEN IT BCS 20$ ; IF CS, FAILURE 10$: MOV #-1,INIFLG ; SHOW INI FILE IS OPEN 20$: RETURN .SBTTL GETINI - GET RECORD FROM INI FILE ;+ ; ; GETINI - Get next record from the INI file. ; ; This routine reads in the record from the RSXNET .INI file and ; returns the answer in the input command buffer. Lines starting ; with a semi-colon or an exclaimation point are treated as comments. ; ; Inputs: ; None. ; ; Outputs: ; C bit clear/set = got record/EOF (no record). ; ; All registers are preserved. ; ;- GETINI:: CALL $SAVAL ; SAVE THE REGISTERS TST INIFLG ; IS THE .INI FILE OPEN ? BEQ 40$ ; IF EQ, NO (RETURN) 10$: GET$ #CMDFDB,#INCMD,#80. ; GET THE RESPONSE BCS 30$ ; IF CS, ERROR MOV #INCMD,R2 ; ADDRESS OF INPUT BUFFER MOV F.NRBD(R0),R1 ; COPY THE BYTE COUNT BEQ 15$ ; IF EQ, BLANK LINE ; Comment lines start with either a "!" or a ";". CMPB (R2),#'! ; IS THIS A COMMENT LINE ? BEQ 10$ ; IF EQ, YES (READ ANOTHER) CMPB (R2),#'; ; IS THIS A COMMAND LINE ? BEQ 10$ ; IF EQ, YES (READ ANOTHER) ; Set up the local I/O status block so it looks like the ; command came from the terminal. 15$: MOV #IS.CR,LIOSB ; SUCCESSFUL RETURN + MOV R1,LIOSB+2 ; PUT COUNT IN STATUS BLOCK MOV R2,R0 ; COPY THE INPUT ADDRESS ADD R1,R2 ; POINT TO END OF COMMAND LINE CLRB (R2) ; AND TERMINATE IT WITH A NULL ; Convert command line to uppercase. 20$: CALL CUPPER ; CONVERT TO UPPER CASE TSTB (R0)+ ; AT END OF COMMAND ? BNE 20$ ; IF NE, NO (LOOP) CLC ; ELSE, REPORT SUCCESS RETURN ; AND RETURN ; Error reading from the .INI file. 30$: CMPB F.ERR(R0),#IE.EOF ; WAS IT END-OF-FILE ? BEQ 40$ ; IF EQ, YES CALL FILERR ; ELSE REPORT THE ERROR 40$: CALL CLOINI ; CLOSE THE .INI FILE SEC ; SHOW FAILURE RETURN ; AND RETURN .SBTTL CLOINI - CLOSE RSXNET INI FILE ;+ ; ; CLOINI - Close the RSXNET initilization file. ; ;- CLOINI:: TST INIFLG ; IS THE .INI FILE OPEN ? BEQ 10$ ; IF EQ, NO CLOSE$ #CMDFDB ; ELSE CLOSE IT CLR INIFLG ; CLEAR THE OPEN FLAG 10$: RETURN ; AND RETURN .END