PROC MBUFMAN ((SM$ID),(ORDINAL),OFFSET,RSTATUS); # TITLE MBUFMAN - RETURNS MAP ENTRY OFFSET. # BEGIN # MBUFMAN # # ** MBUFMAN - ENSURES THAT THE DESIRED MAP ENTRY IS IN THE BUFFER * AND RETURNS THE WORD OFFSET OF THE ENTRY WITHIN * THE BUFFER. * * MBUFMAN - IS CALLED BY MGETENT AND MPUTENT. * * PROC MBUFMAN (SM$ID,ORDINAL,OFFSET,RSTATUS) * * ENTRY SM$ID - *SM* NUMBER. * ORDINAL - *XY* COORDINATE ORDINAL. * * EXIT OFFSET - OFFSET OF ENTRY. * RSTATUS - ERROR STATUS. * (VALUES DEFINED IN *COMBCMS*) * = NO ERRORS. * = *CIO* ERROR. * = MAP ORDINAL OUT OF RANGE. # ITEM SM$ID U; # *SM* NUMBER # ITEM ORDINAL U; # *XY* COORDINATE ORDINAL # ITEM OFFSET U; # ENTRY OFFSET # ITEM RSTATUS U; # STATUS RETURNED TO CALLER # # **** PROC MBUFMAN - XREF LIST BEGIN. # XREF BEGIN PROC MCLOSE; # CLOSE MAP # PROC MFLUSH; # FLUSH MAP TO FILE # PROC READ; # INTERFACE TO *READ* MACRO # PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* # END # **** PROC MBUFMAN - EXREF LIST END. # DEF LISTCON #0#; # DO NOT LIST COMMON DECKS # *CALL COMBFAS *CALL COMBCMD *CALL COMBCMS *CALL COMBFET *CALL COMBMAP *CALL COMBMCT *CALL COMXMSC *CALL COMSPFM ITEM BFWA U; # WORD ADDRESS OF FIRST ENTRY IN BUFFER # ITEM DWA U; # WORD ADDRESS OF DESIRED ENTRY # ITEM PRUNUM U; # *PRU* NUMBER WHERE *XY* ENTRY RESIDES # RSTATUS = CMASTAT"NOERR"; # * *XY* COORDINATE HAS TO BE 1 - 352. # IF ORDINAL LQ 0 OR ORDINAL GR MAXORD THEN BEGIN RSTATUS = CMASTAT"ORDERR"; RETURN; END # * COMPUTE * DWA - WORD ADDRESS IN MAP OF DESIRED MAP ENTRY. * BFWA - WORD ADDRESS OF FIRST ENTRY IN BUFFER. # DWA = ORDINAL * MAPENTL; BFWA = (MB$PRUNUM[0] - 1) * PRULEN; # * ENSURE DESIRED ENTRY IS IN THE BUFFER. # IF MB$SMID[0] NQ SM$ID OR MB$PRUNUM[0] EQ 0 # # OR BFWA GR DWA OR DWA GR (BFWA + MAPBUFL - MAPENTL) THEN BEGIN # ENTRY NOT IN BUFFER # IF MB$BMF[0] THEN BEGIN MFLUSH; END PRUNUM = (DWA/PRULEN) + 1; ZSETFET(MAPFADR,OMT$LFN[SM$ID],MAPBADR,MAPBUFL,RFETL); FET$R[0] = TRUE; FET$RR[0] = PRUNUM; FET$EP[0] = TRUE; READ(MAPFET,RCL); IF FET$AT[0] NQ 0 THEN BEGIN MCLOSE(ORDINAL); RSTATUS = CMASTAT"CIOERR"; RETURN; END MB$PRUNUM[0] = PRUNUM; MB$SMID[0] = SM$ID; MB$LFN[0] = OMT$LFN[SM$ID]; BFWA = (PRUNUM - 1) * PRULEN; END # ENTRY NOT IN BUFFER # OFFSET = (DWA - BFWA); RETURN; END # MBUFMAN # TERM PROC MCLOSE((SM$ID),RSTATUS); # TITLE MCLOSE - TERMINATE MAP REFERENCE BY CALLER. # BEGIN # MCLOSE # # ** MCLOSE - INDICATES TERMINATION OF MAP REFERENCES BY CALLER. * * MCLOSE - IS CALLED BY DBCMAP,DBFLAG,DBRDSTM,MBUFMAN,MOPEN, * TERMCAT,USRPC,VLSUBFM. * * PROC MCLOSE (SM$ID,RSTATUS) * * ENTRY SM$ID - *SM* NUMBER FROM CALLER. * * EXIT RSTATUS - ERROR STATUS. * (VALUES DEFINED IN *COMBCMS*) * = NO ERRORS. * = MAP NOT OPEN. * # ITEM SM$ID U; # *SM* NUMBER FROM CALLER # ITEM RSTATUS U; # ERROR STATUS RETURNED # # **** PROC MCLOSE - XREF LIST BEGIN. # XREF BEGIN PROC MFLUSH; # FLUSH MAP TO FILE # PROC RETERN; # INTERFACE TO *RETURN* MACRO # PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* # END # **** PROC MCLOSE - EXREF LIST END. # DEF LISTCON #0#; # CONTROLS COMDECK LISTING # *CALL COMBFAS *CALL COMBCMD *CALL COMBCMS *CALL COMBFET *CALL COMBMCT *CALL COMXMSC *CALL COMSPFM RSTATUS = CMASTAT"NOERR"; # * MAP HAS TO BE OPEN. # IF NOT OMT$OPEN[SM$ID] THEN BEGIN RSTATUS = CMASTAT"NOTOPEN"; RETURN; END # * CLEAR *OMT* ENTRY IF INTERLOCKED. # IF OMT$INTLK[SM$ID] THEN BEGIN OMT$OPEN[SM$ID] = FALSE; OMT$INTLK[SM$ID] = FALSE; RETURN; END # * FLUSH BUFFER IF *MODIFY* MODE. # IF MB$SMID[0] EQ SM$ID AND OMT$ATTM[SM$ID] EQ "M" THEN BEGIN MFLUSH; END # * SET UP *FET* AND RETURN THE FILE. # ZSETFET(MAPFADR,OMT$LFN[SM$ID],MAPBADR,MAPBUFL,RFETL); RETERN(MAPFET,RCL); OMT$OPEN[SM$ID] = FALSE; RETURN; END # MCLOSE # TERM PROC MFLUSH; # TITLE MFLUSH - FLUSH MAP TO FILE. # BEGIN # MFLUSH # # ** MFLUSH - ENSURES THAT THE RESULTS OF ANY PREVIOUS *MPUTENT* * REQUESTS ARE WRITTEN TO THE MAP FILE. * * * MFLUSH - IS CALLED BY ADDCAR,ADDCUBE,MBUFMAN,MCLOSE,MRELSLK, * RVMCAR,RVMCUBE. * * PROC MFLUSH * # # **** PROC MFLUSH - XREF LIST BEGIN. # XREF BEGIN PROC REWRITE; # INTERFACE TO *REWRITE* MACRO # PROC REWRITR; # INTERFACE # END # **** PROC MFLUSH - EXREF LIST END. # DEF LISTCON #0#; # CONTROLS COMDECK LISTING # *CALL COMBFAS *CALL COMBCMD *CALL COMBCMS *CALL COMBFET *CALL COMBMAP *CALL COMBMCT *CALL COMXMSC *CALL COMSPFM # * IF BUFFER NOT MODIFIED, EXIT. # IF NOT MB$BMF[0] THEN BEGIN IF OMT$ATTM[MB$SMID[0]] NQ "M" THEN BEGIN MB$CWRD[0] = 0; END RETURN; END # * REWRITE MAP BUFFER TO THE FILE. # P = MAPFADR; FET$R[0] = TRUE; FET$RR[0] = MB$PRUNUM[0]; FET$EP[0] = TRUE; FET$LFN[0] = MB$LFN[0]; IF MB$PRUNUM[0] EQ 17 THEN # PARTIAL PRU # BEGIN REWRITR(MAPFET,RCL); END ELSE BEGIN IF MB$PRUNUM[0] EQ 16 THEN # PARTIAL PRU STILL REMAINS # BEGIN REWRITE(MAPFET,RCL); FET$RR[0] = 17; REWRITR(MAPFET,RCL); END ELSE BEGIN REWRITE(MAPFET,RCL); END END P = TFETADR; MB$CWRD[0] = 0; RETURN; END # MFLUSH # TERM PROC MGETENT ((SM$ID),(ORDINAL),(MAPADR),RSTATUS); # TITLE MGETENT - RETURN THE MAP ENTRY TO THE CALLER. # BEGIN # MGETENT # # ** MGETENT - RETURNS THE REQUESTED MAP ENTRY TO THE CALLERS * MEMORY SPACE. * * MGETENT - IS CALLED BY ADDCAR,ADDCUBE,DBCMAP,DBFLAG, * DBVSN,MSFINIT,RMVCAR,RMVCUBE,SERCSU,USRPG,VLCMAP, * VLCSUSC. * * * PROC MGETENT (SM$ID,ORDINAL,MAPADR,RSTATUS) * * ENTRY SM$ID - *SM* NUMBER. * ORDINAL - *XY* COORDINATE ORDINAL. * MAPADR - ADDRESS OF ENTRY DESTINATION. * * EXIT (MAPADR) - MAP ENTRY. * RSTATUS - ERROR STATUS. * (VALUES DEFINED IN *COMBCMS*) * = NO ERRORS. * = MAP INTERLOCKED. * = MAP NOT OPEN. * = *CIO* ERROR. * = MAP ORDINAL OUT OF RANGE. # ITEM SM$ID U; # *SM* NUMBER # ITEM ORDINAL U; # *XY* COORDINATE ORDINAL # ITEM MAPADR U; # ENTRY DESTINATION # ITEM RSTATUS U; # STATUS RETURNED TO CALLER # # **** PROC MGETENT - XREF LIST BEGIN. # XREF BEGIN PROC MBUFMAN; # GET ENTRY OFFSET # END # **** PROC MGETENT - EXREF LIST END. # DEF LISTCON #0#; # CONTROLS COMDECK LISTING # *CALL COMBFAS *CALL COMBCMD *CALL COMBCMS *CALL COMBMAP ITEM I I; # INDUCTION VARIABLE # ITEM OFFSET U; # RELATIVE LOCATION OF *XY* IN BUFFER # BASED ARRAY MENTRY [0:0] P(1); BEGIN ITEM ENT$WRD U(00,00,60); # ENTRY WORD # END RSTATUS = CMASTAT"NOERR"; # * RETURN ERROR IF FILE INTERLOCKED. # IF OMT$INTLK[SM$ID] THEN BEGIN RSTATUS = CMASTAT"INTLK"; RETURN; END # * MAP FILE HAS TO BE OPEN. # IF NOT OMT$OPEN[SM$ID] THEN BEGIN RSTATUS = CMASTAT"NOTOPEN"; RETURN; END # * GET OFFSET OF ENTRY IN BUFFER. # MBUFMAN(SM$ID,ORDINAL,OFFSET,RSTATUS); IF RSTATUS NQ 0 THEN BEGIN RETURN; END # * TRANSFER ENTRY TO CALLER. # P = MAPADR; P = MAPBADR; FASTFOR I = 1 STEP 1 UNTIL MAPENTL DO BEGIN ENT$WRD[I - 1] = MAPB$W[OFFSET + I]; END RETURN; END # MGETENT # TERM PROC MINIT ((LFN),(SM$ID),RSTATUS); # TITLE MINIT - INITIALIZE A *SMU* MAP. # BEGIN # MINIT # # ** MINIT - INITIALIZE A *SMMAP* TO INDICATE CARTRIDGES ARE * EITHER: * 1. NON EXISTENT (NO CUBES) * 2. RESERVED FOR CE USE OR * 3. UNASSIGNED * 4. RESERVED FOR SYSTEM USE * * THE PREAMBLE OF THE FILE WHICH CONTAINS THE MAP AND * OTHER FIELDS IN THE MAP ARE APPROPRIATELY FILLED IN * WITH ZEROES OR SPACES. * * * MINIT - IS CALLED BY SSDEF FOR EACH SM THAT SSDF CREATES. * * PROC MINIT(LFN,RSTATUS) * * ENTRY LFN - MAP FILE NAME. * * EXIT RSTATUS - ERROR STATUS. * (VALUES DEFINED IN *COMBCMS*) * = NO ERRORS. * = MAP ALREADY EXISTS. * = *CIO* ERROR. * = MAP DEFINE ERROR. # ITEM LFN C(6); # NAME OF MAP FILE # ITEM SM$ID U; # *SM* NUMBER # ITEM RSTATUS I; # ERROR STATUS # # **** PROC MINIT - XREF LIST BEGIN. # XREF BEGIN PROC PFD; # PERMANENT FILE REQUEST DELAYS # PROC RETERN; # INTERFACE TO *RETURN* MACRO # PROC WRITER; # INTERFACE TO *WRITER* MACRO # PROC WRITEW; # INTERFACE TO *WRITEW* MACRO # PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* # END # **** PROC MINIT - EXREF LIST END. # DEF LISTCON #0#; # CONTROLS COMDECK LISTING # *CALL COMBFAS *CALL COMBCMD *CALL COMBCMS *CALL COMBFET *CALL COMBMAP *CALL COMBMCT *CALL COMBPFS *CALL COMXMSC *CALL COMSPFM ITEM ZI U; # *Z* COUNTER FOR ORDINAL CALCULATION # ITEM YI U; # *Y* COUNTER FOR ORDINAL CALCULATION # ITEM MAPORD U; # ORDINAL OF CARTRIDGE IN MAP # ITEM WRITESTAT U; # STATUS FROM *WRITEW* MACRO # # * DEFINITION OF A MAP ENTRY WHICH IS USED * TO INITIALIZE A MAP FILE. # ARRAY SMUENTRY [0:0] P(MAPENTL); # CHANGE LINES 2032,2035,2099 # BEGIN ITEM FILLWRD1 U(00,00,60) = [O"0000 0055 5555 5555 5555"]; ITEM FILLWRD2 U(01,00,60); ITEM FILLWRD3 U(02,00,60) = [O"0000 5555 5555 5555 5555"]; END RSTATUS = CMASTAT"NOERR"; # * DEFINE A PERMANENT FILE FOR THE MAP. # PFD("DEFINE",LFN,0,"BR","Y","RC",PFSTAT,"UP",0,0); IF PFSTAT NQ 0 THEN BEGIN IF PFSTAT EQ FAP THEN BEGIN RSTATUS = CMASTAT"INTLZD"; END ELSE BEGIN RSTATUS = CMASTAT"DEFERR"; END RETURN; END # * INITIALIZE A *SMUMAP* FET. # ZSETFET (MAPFADR,LFN,MAPBADR,MAPBUFL,RFETL); FET$EP[0] =TRUE; # * INITIALIZE THE PREAMBLE FOR THE MAP FILE. # P = LOC(SMUENTRY); # CHANGE CSUMAP TO SMUMAP # CM$CODE[0] = CUBSTAT"NOCUBE"; CM$SMID = SM$ID; WRITEW(MAPFET,SMUENTRY,MAPENTL,WRITESTAT); IF FET$AT[0] NQ 0 THEN BEGIN RSTATUS = CMASTAT"CIOERR"; RETERN(MAPFET); RETURN; END # * PREPARE A BUFFER FOR THE FILE. * DATA IS MOVED INTO THE CIRCULAR BUFFER IN ORDINAL FASHION BY * EXECUTING A DRECEMENTING * DO* LOOP FOR * Z* INSIDE A * *DO* LOOP FOR *Y*. THIS IS EQUIVALENT TO THE ORDINAL * CALCULATION DESCRIBED BY NOCUBES-Z-(Y-MAX$Z). # # CHANGE LINES 2054 THROUGH 2110 # FASTFOR YI = MAX$Y STEP -1 UNTIL 0 DO BEGIN # YI DO # FASTFOR ZI = MAX$Z STEP -1 UNTIL 0 DO BEGIN # ZI DO # CM$CODE[0] = CUBSTAT"UNASGN"; # * THERE ARE NO CUBICLES FOR CARTRIDGES AT *Z* = 6 BECAUSE * THE DRDS RESIDE IN THIS AREA. THERE ARE NO CUBICLES * AT THE FOLLOWING COORDINATES: *Z* = 0 *Y* = 15, * *Z* = 1 *Y* = 15, *Z* = 0 *Y* = 14, *Z* = 1 *Y* = 14, * *Z* = 0 *Y* = 13, *Z* = 1 *Y* = 13, *Z* = 0 *Y* = 12, * *Z* = 1 *Y* = 12, *Z* = 0 *Y* = 11, *Z* = 1 *Y* = 11. * THERE ARE NO CUBLICLES IN THE PREVIOUSLY LISTED COORDINATES * BECAUSE THE ENTRY TRAY IS PHYSICALLY LOCATED AT THESE LOCATIONS. # IF ZI EQ 6 OR (( YI LQ 15 AND YI GQ 11) AND (ZI EQ 0 OR ZI EQ 1)) THEN BEGIN CM$CODE[0] = CUBSTAT"NOCUBE"; END # * RESERVE *CE* CUBICLES. # IF ((YI EQ 0) AND ( ZI EQ 0 OR ZI EQ 15)) OR (( ZI EQ 15) AND ( YI EQ 11 OR YI EQ 21)) THEN BEGIN CM$CODE[0] = CUBSTAT"CEUSE"; END WRITEW(MAPFET,SMUENTRY,MAPENTL,WRITESTAT); IF FET$AT[0] NQ 0 THEN BEGIN RSTATUS = CMASTAT"CIOERR"; RETERN(MAPFET); RETURN; END END # ZI DO # END # YI DO # # * FLUSH THE CIRCULAR BUFFER TO DISK. # WRITER(MAPFET,RCL); IF FET$AT[0] NQ 0 THEN BEGIN RSTATUS = CMASTAT"CIOERR"; END RETERN(MAPFET); RETURN; END # MINIT # TERM PROC MOPEN ((SM$ID),(LFN),(MODE),RSTATUS); # TITLE MOPEN - ESTABLISH CALLER ACCESS TO MAP FILE. # BEGIN # MOPEN # # ** MOPEN - PREPARES THE MAP FILE FOR SUBSEQUENT REFERENCES BY THE * CALLER. * * MOPEN - IS CALLED BY USRPC,VLSUBSM. * * PROC MOPEN (SM$ID,LFN,MODE,RSTATUS) * * ENTRY SM$ID - *SM* NUMBER FOR THE MAP. * LFN - NAME OF MAP FILE. * MODE - FILE ATTACH MODE IN DISPLAY CODE. * = *M*, MODIFY MODE. * = *RM*, READ/ALLOW MODIFY MODE. * * EXIT RSTATUS - ERROR STATUS. * (VALUES DEFINED IN *COMBCMS*) * = NO ERRORS. * = MAP INTERLOCKED. * = MAP ALREADY OPEN. * = *CIO* ERROR. * = MAP ATTACH ERROR. # ITEM SM$ID U; # *SM* NUMBER FOR MAP # ITEM LFN C(6); # NAME OF MAP FILE # ITEM MODE C(2); # FILE ATTACH MODE # ITEM RSTATUS U; # ERROR STATUS RETURNED # # **** PROC MOPEN - XREF LIST BEGIN. # XREF BEGIN PROC MCLOSE; # CLOSE MAP # PROC MFLUSH; # FLUSH MAP TO FILE # PROC PFD; # PERMANENT FILE REQUEST DELAYS # PROC READ; # INTERFACE TO *READ* MACRO # PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* # END # **** PROC MOPEN - EXREF LIST END. # DEF LISTCON #0#; # NO LISTING OF COMMON DECKS # *CALL COMBFAS *CALL COMBCMD *CALL COMBCMS *CALL COMBFET *CALL COMBMAP *CALL COMBMCT *CALL COMBPFS *CALL COMXCTF *CALL COMXMSC *CALL COMSPFM ITEM ZERO U = 0; # WORD OF ZERO # RSTATUS = CMASTAT"NOERR"; P = OMTADR; # * RETURN ERROR IF FILE OPEN. # IF OMT$OPEN [SM$ID] THEN BEGIN RSTATUS = CMASTAT"FOPEN"; RETURN; END PFD("ATTACH",LFN,0,"M",MODE,"RC",PFSTAT,"NA",0,"UP",0,0); # * RETURN ATTACH ERROR IF NOT BUSY. # IF PFSTAT NQ 0 AND PFSTAT NQ FBS THEN BEGIN RSTATUS = CMASTAT"ATTERR"; RETURN; END # * CREATE AN OPEN MAP TABLE ENTRY FOR AN EXISTING FILE. # OMT$ATTM[SM$ID] = MODE; OMT$LFN[SM$ID] = LFN; OMT$ZER[SM$ID] = 0; # * INTERLOCK THE FILE IF BUSY. # IF PFSTAT EQ FBS THEN BEGIN OMT$INTLK[SM$ID] = TRUE; MAPINTLK = TRUE; RSTATUS = CMASTAT"INTLK"; RETURN; END # * SET FILE OPEN AND AVAILABLE. # OMT$INTLK[SM$ID] = FALSE; OMT$OPEN[SM$ID] = TRUE; MFLUSH; ZSETFET (MAPFADR,LFN,MAPBADR,MAPBUFL,RFETL); P = MAPFADR; FET$EP[0] = TRUE; FET$R[0] = TRUE; FET$RR[0] = 1; READ(MAPFET,RCL); IF FET$AT[0] NQ 0 THEN BEGIN MCLOSE(SM$ID); RSTATUS = CMASTAT"CIOERR"; RETURN; END # * UPDATE MAP BUFFER CONTROL WORD TO REFLECT CURRENT CONTENTS. # P = MAPBADR; MB$PRUNUM[0] = 1; MB$SMID[0] = CM$SMID[0]; MB$LFN[0] = OMT$LFN[SM$ID]; # * VERIFY THAT THE RIGHT FILE HAS BEEN ATTACHED. # IF CM$SMID[0] NQ SM$ID THEN BEGIN MCLOSE(SM$ID,RSTATUS); RSTATUS = CMASTAT"ATTERR"; END RETURN; END # MOPEN # TERM PROC MPUTENT ((SM$ID),(ORDINAL),(MAPADR),RSTATUS); # TITLE MPUTENT - MAP ENTRY TO THE MAP FILE BUFFER. # BEGIN # MPUTENT # # ** MPUTENT - MOVES THE REQUESTED MAP ENTRY FROM THE CALLERS * MEMORY SPACE TO THE MAP *I/O* BUFFER. * * THE BUFFER IS NOT WRITTEN TO THE FILE AT THIS TIME * BUT THE BUFFER MODIFIED FLAG IS SET. * THE CALLER IS RESPONSIBLE FOR CALLING *MFLUSH* AT THE * TIME THE BUFFER SHOULD BE WRITTEN TO THE FILE. * * MPUTENT - IS CALLED BY ADDCAR,ADDCUBE,RMVCAR,RMVCUBE, * UPDMAP. * * PROC MPUTENT (SM$ID,ORDINAL,MAPADR,RSTATUS) * * ENTRY SM$ID - *SM* NUMBER OF MAP FILE. * ORDINAL - *XY* COORDINATE ORDINAL FOR THE ENTRY. * MAPADR - ADDRESS OF MAP ENTRY WITHIN CALLER AREA. * * EXIT RSTATUS - ERROR STATUS. * (VALUES DEFINED IN *COMBCMS*) * = NO ERRORS. * = MAP INTERLOCKED. * = MAP NOT OPEN. * = MAP NOT OPEN IN MODIFY MODE. * = *CIO* ERROR. * = MAP ORDINAL OUT OF RANGE. # ITEM SM$ID U; # *SM* NUMBER # ITEM ORDINAL U; # *XY* COORDINATE ORDINAL # ITEM MAPADR U; # SOURCE OF CATALOG ENTRY # ITEM RSTATUS U; # STATUS RETURNED TO THE CALLER # # **** PROC MPUTENT - XREF LIST BEGIN. # XREF BEGIN PROC MBUFMAN; # GET ENTRY INTO BUFFER # END # **** PROC MPUTENT - EXREF LIST END. # DEF LISTCON #0#; # CONTROLS COMDECK LISTING # *CALL COMBFAS *CALL COMBCMD *CALL COMBCMS *CALL COMBMAP *CALL COMSPFM ITEM I I; # INDUCTION VARIABLE # ITEM OFFSET U; # RELATIVE LOCATION OF *XY* IN BUFFER # BASED ARRAY MENTRY [0:0] P(1); BEGIN ITEM ENT$WRD U(00,00,60); # ENTRY WORD # END RSTATUS = CMASTAT"NOERR"; # * RETURN ERROR IF FILE INTERLOCKED. # IF OMT$INTLK[SM$ID] THEN BEGIN RSTATUS = CMASTAT"INTLK"; RETURN; END # * * MAP FILE HAS TO BE OPENED IN *MODIFY* MODE. # IF NOT OMT$OPEN[SM$ID] THEN BEGIN RSTATUS = CMASTAT"NOTOPEN"; RETURN; END IF OMT$ATTM[SM$ID] EQ "RM" THEN BEGIN RSTATUS = CMASTAT"MODERR"; RETURN; END # * GET OFFSET OF ENTRY IN BUFFER. # MBUFMAN(SM$ID,ORDINAL,OFFSET,RSTATUS); IF RSTATUS NQ 0 THEN BEGIN RETURN; END # * TRANSFER ENTRY TO BUFFER. # P = MAPADR; P = MAPBADR; FASTFOR I = 1 STEP 1 UNTIL MAPENTL DO BEGIN MAPB$W[OFFSET + I] = ENT$WRD[I - 1]; END MB$BMF[0] = TRUE; RETURN; END # MPUTENT # TERM PROC MRCLMLK((SM$ID),RSTATUS); # TITLE MRCLMLK - RECLAIM MAP INTERLOCK. # BEGIN # MRCLMLK # # ** MRCLMLK - TRIES TO RECLAIM THE MAP FILE FOR THE SPECIFIED *SM*. * IT IS ASSUMED THAT THE CALLER IS RUNNING UNDER THE * DEFAULT FAMILY AND USER INDEX OF 377760B. * * MRCLMLK - IS CALLED BY RCLMLK AND MAPRCLM. * * PROC MRCLMLK(SM$ID,RSTATUS) * * ENTRY SM$ID - *SM* NUMBER OF THE MAP. * * EXIT RSTATUS - ERROR STATUS. * (VALUES DEFINED IN *COMBCMS*) * = NO ERRORS. * = MAP INTERLOCKED. * = MAP ATTACH ERROR. * * * MESSAGES * UNABLE TO REATTACH SMUMAP. * CSMAPX CLOSED.* # ITEM SM$ID U; # *SM* NUMBER # ITEM RSTATUS U; # ERROR STATUS RETURNED # # **** PROC MRCLMLK - XREF LIST BEGIN. # XREF BEGIN PROC MESSAGE; # ISSUE MESSAGE # PROC MOPEN; # OPEN MAP # PROC PF; # *PFM* REQUEST INTERFACE # END # **** PROC MRCLMLK - EXREF LIST END. # DEF LISTCON #0#; # DO NOT LIST COMMON DECKS # *CALL COMBFAS *CALL COMBCMD *CALL COMBCMS *CALL COMBMCT *CALL COMXMSC *CALL COMSPFM ITEM ATCH$STAT U; # STATUS FROM *ATTACH* REQUEST # RSTATUS = CMASTAT"NOERR"; P = OMTADR; # * EXIT IF MAP NOT INTERLOCKED. # IF NOT OMT$INTLK[SM$ID] THEN BEGIN RETURN; END # * IF THE FILE IS OPEN, ATTACH IT. * IF THE FILE IS NOT OPEN, OPEN IT. # IF NOT OMT$OPEN[SM$ID] THEN BEGIN MOPEN(SM$ID,OMT$LFN[SM$ID],OMT$ATTM[SM$ID],RSTATUS); RETURN; END PF("ATTACH",OMT$LFN[SM$ID],0,"M",OMT$ATTM[SM$ID], "RC",ATCH$STAT,"NA",0,"UP",0,0); IF ATCH$STAT NQ 0 THEN BEGIN # INTERLOCK NOT RECLAIMED # IF ATCH$STAT EQ FBS OR ATCH$STAT EQ PFA ## OR ATCH$STAT EQ INA OR ATCH$STAT EQ FTF ## OR ATCH$STAT EQ PEA THEN # MAP BUSY OR TEMPORARY ERROR # BEGIN RSTATUS = CMASTAT"INTLK"; END ELSE BEGIN RSTATUS = CMASTAT"ATTERR"; OMT$OPEN[SM$ID] = FALSE; OMT$INTLK[SM$ID] = FALSE; CMSGLINE[0] = MMSG1; # ISSUE ERROR MESSAGE # MESSAGE(CMSGAREA,UDFL1); CMSGLINE[0] = MMSGCLOSE; CMSGMAPID[0] = SM$ID; MESSAGE(CMSGAREA,UDFL1); END END # INTERLOCK NOT RECLAIMED # ELSE # INTERLOCK RECLAIMED # BEGIN OMT$INTLK[SM$ID] = FALSE; END RETURN; END # MRCLMLK # TERM PROC MRELSLK ((SM$ID)); # TITLE MRELSLK - RETURN A MAP FILE. # BEGIN # MRELSLK # # ** MRELSLK - RETURNS A *SMMAP* FILE FOR A *SMID* WHICH HAS BEEN * PREVIOUSLY OPENED IN *MODIFY* MODE. * * MRELSLK - IS CALLED BY MAPRELS. * * PROC MRELSLK (SM$ID) * * ENTRY SM$ID - *SM* NUMBER OF MAP FILE. # ITEM SM$ID U; # *SM* NUMBER FROM CALLER # # **** PROC MRELSLK - XREF LIST BEGIN. # XREF BEGIN PROC MFLUSH; # FLUSH MAP TO FILE # PROC RETERN; # INTERFACE TO *RETURN* MACRO # PROC RTIME; # GET CURRENT TIME # PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* # END # **** PROC MRELSLK - EXREF LIST END. # DEF LISTCON #0#; # CONTROLS COMDECK LISTING # *CALL COMBFAS *CALL COMBCMD *CALL COMBCMS *CALL COMBFET *CALL COMBMCT *CALL COMXCTF *CALL COMXIPR *CALL COMXMSC *CALL COMSPFM # * MAP FILE HAS TO BE OPEN AND IN *MODIFY* MODE. # IF OMT$OPEN[SM$ID] # # AND OMT$ATTM[SM$ID] EQ "M" # # AND NOT OMT$INTLK[SM$ID] THEN BEGIN MFLUSH; P = MAPFADR; FET$LFN[0] = OMT$LFN[SM$ID]; RETERN(MAPFET,RCL); OMT$INTLK[SM$ID] = TRUE; MAPINTLK = TRUE; RTIME(RTIMESTAT[0]); MAP$EXPIR = RTIMSECS[0] + MAP$INTV; END RETURN; END # MRELSLK # TERM