home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-05-03 | 276.3 KB | 10,049 lines |
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --USERCALL.FOR
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- C-------------------------------------------------------------------------
- C
- C This program is set up as a concurrently running process on the
- C Startrapport request . On receipt of a message the type of service call
- C required is discovered by reference to the first long word of the message
- C buffer , the appropriate service handler is then called .
- C
- C After setting up the channel number to be equivalent to the mailbox
- C the program performs :-
- C
- C loop
- C { Read a message from the channel
- C Call appropriate handler
- C Write a message to the channel }
- C until EndRapport
- C
- C
- C Each handler receives the values it needs by equivalence with the message
- C buffer and returns answers in the same way .
- C
- C A word (INTEGER*2) message buffer is used but this is in fact not
- C neccesary ( it just in fact makes things more complex ) but as the program
- C as it stands works (and is just a demonstration) it was decided to leave well
- C alone.
- C
- C---------------------------------------------------------------------------
-
-
- PROGRAM USERCALL
-
-
- C IRET is the return code from the activation of a system service .
-
- INTEGER*4 IRET
-
- C SYS$ASSIGN is the system service to assign a channel number to a logical
- C name .
-
- INTEGER*4 SYS$ASSIGN
-
- C SYS$QIOW is the system service for message passing .
-
- INTEGER*4 SYS$QIOW
-
- C CHAN is the number of the channel that is connected to the mailbox .
-
- INTEGER*2 CHAN
-
- C NMESS is the number of bytes to read from and write to the mailbox .
-
- INTEGER*2 NMESS
-
-
-
- C WBUF is the message buffer that is filled from and emptied into the mailbox .
-
- COMMON/MSGBUF/WBUF(100)
- INTEGER*2 WBUF
-
-
- C LWBUF is a long word equivalent of the INTEGER*2 message buffer .
-
- INTEGER LWBUF(2)
- EQUIVALENCE (LWBUF,WBUF)
-
-
- C WHAT is the number of the system service required and is equivalent to the
- C first long word of the message buffer .
-
- INTEGER*4 WHAT
- EQUIVALENCE (WHAT,LWBUF(1))
-
-
- C IODEF and SSDEF are the definition file for the system services and the
- C input output services .
-
- INCLUDE '($IODEF)/NOLIST'
- INCLUDE '($SSDEF)/NOLIST'
-
-
-
- C Actual program start :-
-
-
- WRITE(6,900)
- 900 FORMAT(1X,' Sub-Nucleus activation ..... '/)
-
-
- C NMESS is set to 200 so 200 bytes (or 50 long-words) are read from the mailbox
-
- NMESS=200
-
- C The logical channel sys$error is assigned and identification channel number .
-
- IRET=SYS$ASSIGN('SYS$ERROR',CHAN,,)
-
-
-
- C This is the main program loop if WHAt is equal to 2 then the last RAPPORT
- C service called was EndRapport.WHAT is first set to to 0 to ensure that
- C the loop is not terminated accidently.
-
- WHAT=0
-
- DO WHILE (WHAT.NE.2)
-
-
- C Read 200 bytes from the mailbox and put it into the word message buffer.
-
- IRET=SYS$QIOW(,%VAL(CHAN),%VAL(IO$_READVBLK),,,,WBUF,
- * %VAL(NMESS),,,,)
-
- C Dispatch accordin to the value of what .
-
- IF (WHAT.EQ.1) CALL R8STAR
- IF (WHAT.EQ.2) CALL R8ENDR
- IF (WHAT.EQ.3) CALL R8TRAN
- IF (WHAT.EQ.4) CALL R8COMT
- IF (WHAT.EQ.5) CALL R8BKTK
- IF (WHAT.EQ.6) CALL R8INRT
- IF (WHAT.EQ.7) CALL R8UPDT
- IF (WHAT.EQ.8) CALL R8STOR
- IF (WHAT.EQ.9) CALL R8COND
- IF (WHAT.EQ.10) CALL R8FECH
- IF (WHAT.EQ.11) CALL R8DELT
- IF (WHAT.EQ.13) CALL R8STKY
- IF (WHAT.EQ.14) CALL R8HOLD
- IF (WHAT.EQ.15) CALL R8ENRV
- IF (WHAT.EQ.17) CALL R8RTRV
- IF (WHAT.EQ.18) CALL R8CLFI
- IF (WHAT.EQ.19) CALL R8LOCK
-
- C Write 200 bytes to the mailbox from the message buffer .
-
- IRET=SYS$QIOW(,%VAL(CHAN),%VAL(IO$_WRITEVBLK),,,,WBUF,
- * %VAL(NMESS),,,,)
-
-
-
- ENDDO
-
- WRITE(6 , 901)
- 901 FORMAT(1X,' Sub-Nucleus shutdown .....'/)
-
-
- STOP
- END
-
-
-
-
-
-
- SUBROUTINE R8STAR
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0STAR.
- C * The routine calls RAPPORT r0star .
- C * Sets the variable LIPB to true which indicates that
- C any data transfreal is via the ipb .
- C * Fills the common arrays NOFDS , IFPT , JWTEST .
- C
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF.This is equivalenced to
- C a long word buffer to extract the StartRapport parameters.
- C RCLIPB/LIPB : LIPB is a flag which indicates where the
- C nucleus is to get the record data from.If it
- C is false then this place is the FORTRAN
- C program buffers if true then the IPB.It is
- C set to flase by R0STAR.
- C RCJDD/JDDATA : Holds various RAPPORT parameters.
- C RCPPRM/PARAMS : Holds various RAPPORT parameters .
- C RCFDS/NOFDS : Given the number of a file returns the number
- C fields in that file .
- C RCFPT/IFPT : Given the number of a file returns the number
- C of the first field in the file .
- C RCWOR/NWORRB : Given a file number returns the amount of
- C space needed in the ipb by that file .
- C RCJWT : [?] .
- C RCIIPB/IIPB : IIPB given a file number returns an index
- C into the ipb for that file.
- C
- C Called by : Main.
- C
- C Calls : RAPPORT : R0STAR
- C RAPPORT : R0RDUS (to fill up common areas)
- C
- C Author : MDD ( 4/3/85 ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C KNAME is the name of the DDF that is passed to the RAPPORT R0STAR. in
- C our case though the DDF name will be specified from the terminal and so
- C Kname will be given a dummy value before the call to R0STAR.
-
- CHARACTER KNAME
-
- C NKNANE is the length of the dummy dcf name .
-
- INTEGER NKNAME
-
-
- C LFPRES is a boolean value indicating to R0STAR whether a correct DDF
- C name has been specified in the call.In our case we have not so LFPRES
- C will be set to .FALSE.
-
- LOGICAL LFPRES
-
- C FILNO is the last file accessed and is received from the message buffer
- C by equivalence with LWBUF (5)
-
- INTEGER FILNO
-
- C JFSCU is a check sum on the file structure equivalenced from the message
- C buffer LWBUF (3)
-
- INTEGER JFSCU
-
- C JTASK is a unique number assigned by R0STAR to identify the calling process
- C This is returned to the process by equivalencing JTASK to the message buffer
- C LWBUF (4)
-
- INTEGER JTASK
-
- C JER is an indication of the success of R0STAR.Returned by equivalence to the
- C message buffer LWBUF (2)
-
- INTEGER JER
-
- C LER is the error return from r0rdus .
-
- INTEGER LER
-
-
-
-
- C See header .
-
- COMMON/RCLIPB/LIPB
- LOGICAL LIPB
-
-
- COMMON/MSGBUF/WBUF(5)
- INTEGER LWBUF(10)
- EQUIVALENCE (LWBUF,WBUF)
-
-
-
- EQUIVALENCE (JER,LWBUF(2)) , (JFSCU,LWBUF(3))
- EQUIVALENCE (JTASK,LWBUF(4)) , (FILNO,LWBUF(5))
-
-
-
- C See Header .
-
- COMMON/RCJDD/JDDATA(18)
- INTEGER JDDATA
-
- EQUIVALENCE ( JDDATA(1) , JFILE )
- EQUIVALENCE ( JDDATA(2) , JFLPFD )
- EQUIVALENCE ( JDDATA(4) , JFIELD )
-
-
- C JFILE is the number of file specified in the ddf .
- C JFLPFD is
- C JFIELD is
-
-
- INTEGER JFILE , JFLPFD , JFIELD
-
-
- C IFILE is a count used to fill up the iipb
-
- INTEGER IFILE
-
-
- C See Header .
-
- COMMON/RCPPRM/PARAMS(100)
- INTEGER PARAMS
-
- EQUIVALENCE ( PARAMS(6) , MFIELD )
- EQUIVALENCE ( PARAMS(7) , MFILE )
- EQUIVALENCE ( PARAMS(21) , MWOFBF )
- EQUIVALENCE ( PARAMS(36) , MWOIPB )
- EQUIVALENCE ( PARAMS(96) , MFLPFD )
-
- INTEGER MFILED , MFILE
- INTEGER MWOFBF , MWOIPB , MFLPFD
-
-
- C See Header .
-
- COMMON/RCFDS/NOFDS(55)
- COMMON/RCFPT/IFPT(55)
- COMMON/RCWOR/NWORRB(55)
- COMMON/RCJWT/JWTEST(301)
-
-
-
- INTEGER NOFDS , IFPT , NWORRB , JWTEST
-
-
- C See Header .
-
- COMMON/RCIIPB/IIPB(55)
- INTEGER IIPB
-
-
-
-
-
-
- C Before calling R0STAR the values pertaining to the DDF are set to dummy
- C but consistent values.KNAME is a space and the length of KNAME is 1.
-
- NKNAME=1
- KNAME=' '
- LFPRES=.FALSE.
-
- C WRITE(6,1000)
- C 1000 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0STAR'/)
-
- CALL R0STAR(KNAME,NKNAME,LFPRES,FILNO,JFSCU,JTASK,JER)
-
- C WRITE(6,1001)
- C 1001 FORMAT(1X,' %USERCALL-TRACEMSG-EXITING RAPPORT R0STAR'/)
-
-
- C LIPB is set to true so that record transferal is by means of the ipb .
-
- LIPB=.TRUE.
-
-
-
- C Fill up the common array IFPT ( Given a file number returns the number of
- C the first field in that file )
-
- CALL R0RDUS(4 , 1 , JFILE , IFPT , MFILE , 1 , RAPERR )
-
- C Fill the common array NWORRB ( Given a file number return the amoun of space
- C in the ipb required to hold a record of that file ) .
-
- CALL R0RDUS(6 , 1 , JFILE-1 , NWORRB , MFILE , 1 , RAPERR )
-
- C Fill the common array nofds ( Given a file number return the number of fields
- C in that file ) .
-
- CALL R0RDUS(8 ,1 , JFILE-1 , NOFDS , MFILE , 1, RAPERR )
-
- C Fill the common array jwtest .
-
- CALL R0RDUS(29 , 1 , JFLPFD-1 , JWTEST , MFLPFD , 1, RAPERR )
-
- C Fill the ipb ( given a file number returns the index into the ipb)
- C iipb ( n ) := iipb ( n-1 ) + Amount of space required by file n-1
-
- IIPB(1)=1
- DO IFILE=1,JFILE-1
- IIPB(IFILE+1)=IIPB(IFILE)+NWORRB(IFILE)
- ENDDO
-
-
-
-
-
- RETURN
- END
-
-
-
-
- SUBROUTINE R8ENDR
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0ENDR.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF which is accessed via an
- C equivalent long word buffer .
- C
- C Called by : MAIN.
- C
- C Calls : RAPPORT : R0ENDR.
- C
- C Author : MDD ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JER is an indication of the success of R0ENDR.
-
- INTEGER JER
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER LWBUF(10)
- INTEGER*2 WBUF
- EQUIVALENCE (LWBUF,WBUF)
-
- EQUIVALENCE (JER,LWBUF(2))
-
- C WRITE(6,200)
- C 200 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0ENDR'/)
-
- CALL R0ENDR(JER)
-
- C WRITE(6,201)
- C 201 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVIVIN RAPPORT R0ENDR'/)
-
- RETURN
- END
-
-
-
- SUBROUTINE R8TRAN
-
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0TRAN.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF which is accessed by
- C reference to an equivalent long word buffer .
- C
- C Called by : Main.
- C
- C Calls : RAPPORT : R0TRAN.
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C NTRANS is the unique number assigned by rapport to identify this particular
- C transaction.
-
- INTEGER NTRANS
-
- C JER is an indication of the success of R0TRAN
-
- INTEGER JER
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JER,LWBUF(2)),(NTRANS,LWBUF(3))
-
- C WRITE(6,202)
- C 202 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERINR RAPPORT R0TRAN'/)
-
- CALL R0TRAN(NTRANS,JER)
- C WRITE(6,203)
- C 203 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0TRAN'/)
-
- RETURN
- END
-
-
-
- SUBROUTINE R8COMT
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R8COMT.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF which is accessed by
- C referace to an equivalent long word buffer .
- C
- C Called by : Main.
- C
- C Calls : RAPPORT R0COMT
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JER is an indication of the success of R0COMT.
-
- INTEGER JER
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JER,LWBUF(2))
-
- C WRITE(6,204)
- C 204 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0COMT'/)
-
- CALL R0COMT(JER)
-
- C WRITE(6,205)
- C 205 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0COMT'/)
-
- RETURN
- END
-
-
-
- SUBROUTINE R8BKTK
-
- C------------------------------------------------------------------------------
- C
- C Function : The fortran interface to the RAPPORT R0BKTK.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF which is accessed by
- C referenced to the equivalent long word buffer .
- C
- C Called by : Main.
- C
- C Calls : RAPPORT : R0BKTK.
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JER is an indication of the success of R0COMT.
-
- INTEGER JER
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JER,LWBUF(2))
-
- C WRITE(6,206)
- C 206 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0BKTK'/)
-
- CALL R0BKTK(JER)
- C WRITE(6,207)
- C 207 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0BKTK'/)
-
-
- RETURN
- END
-
-
-
- SUBROUTINE R8INRT
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interfac eto the RAPPORT R0INRT.It's actions are
- C * Place the record to insert(obtained from the
- C message buffer) into the ipb .
- C * Call RAPPORT R0INRT.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF accessed by
- C reference to the equivalent long word buffer .
- C
- C Called by : Main.
- C
- C Calls : PUTREC , RAPPORT : R0INRT
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
- C JFILE is the file number of the file to insert into.
-
- INTEGER JFILE
-
- C JER is an indication of the success of R0INRT.
-
- INTEGER JER
-
- C STRADD is the start address in the message buffer of the record to insert.
- C This is the first byte after the static parameters have been equivalenced.
-
- INTEGER STRADD
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JER,LWBUF(2)) , (JFILE,LWBUF(3))
-
-
- C The record starts at long word 4 of the message buffer.This is because
- C the last static parameter is at long word 3 .
-
- STRADD=4
-
- C Place the record into the ipb from the message buffer .
-
- CALL PUTREC(JFILE,STRADD)
-
- C WRITE(6,210)
- C 210 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0INRT'/)
-
- CALL R0INRT(JFILE,JER)
-
- C WRITE(6,211)
- C 211 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0INRT'/)
-
-
- RETURN
- END
-
-
-
-
- SUBROUTINE R8UPDT
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0UPDT.It's actions are
- C * Place the record to UPDATYE(obtained from the
- C message buffer) into the ipb .
- C * Call RAPPORT R0UPDT.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF.Accessed by reference to
- C the equivalent long word buffer .
- C
- C Called by : Main.
- C
- C Calls : PUTREC , RAPPORT : R0UPDT
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
- C JFILE is the file number of the file to update into.
-
- INTEGER JFILE
-
- C JER is an indication of the success of R0UPDT.
-
- INTEGER JER
-
- C STRADD is the start address in the message buffer of the record to update.
- C This is the first byte after the static parameters have been equivalenced.
-
- INTEGER STRADD
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JER,LWBUF(2)) , (JFILE,LWBUF(3))
-
-
- C The record starts at long word 4 of the message buffer.This ia because
- C the last static parameter is at long word 3 .
-
- STRADD=4
-
- C Put the record into the ipb from the message buffer
-
- CALL PUTREC(JFILE,STRADD)
-
- C WRITE(6,214)
- C 214 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0UPDT'/)
-
- CALL R0UPDT(JFILE,JER)
-
- C WRITE(6,215)
- C 215 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0UPDT'/)
-
-
- RETURN
- END
-
-
-
-
- SUBROUTINE R8STOR
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0STOR.It's actions are
- C * Place the record to STORE(obtained from the
- C message buffer into the program buffers.
- C * Call RAPPORT R0STOR.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF accessed by reference to the
- C equivalent long word buffer .
- C
- C Called by : Main.
- C
- C Calls : PUTREC , RAPPORT : R0STOR
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
- C JFILE is the file number of the file to to stote the record.
-
- INTEGER JFILE
-
- C JER is an indication of the success of R0STOR.
-
- INTEGER JER
-
- C STRADD is the start address in the message buffer of the record to STORE.
- C This is the first byte after the static parameters have been equivalenced.
-
- INTEGER STRADD
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JER,LWBUF(2)) , (JFILE,LWBUF(3))
-
-
- C The record starts at long word 4 of the message buffer.This is because
- C the last static parameter is at long word 3 .
-
- STRADD=4
-
- C Put the record into the ipb from the message buffer
-
- CALL PUTREC(JFILE,STRADD)
-
- C WRITE(6,217)
- C 217 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0STOR'/)
-
- CALL R0STOR(JFILE,JER)
-
- C WRITE(6,218)
- C 218 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0STOR'/)
-
-
- RETURN
- END
-
-
- SUBROUTINE R8COND
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortarn interface to the RAPPORT R0COND . R0COND places the
- C specified condition onto the specified file . It's actions
- C are :-
- C
- C * Set the number of elements to be found on the
- C right hand side of the condition .
- C * Place the right hand side into an array from the
- C message buffer .
- C * Calculate the size o fthe array .
- C * Call r0cond .
- C
- C Input arguments : None .
- C
- C Output arguments: None .
- C
- C Common blocks : The common message buffer wbuf accessed by reference to
- C the equivalent long word buffer .
- C RCIFT/IFTYPE : Given a field number returns an index into
- C FTYPE (The array of type information )
- C RCFT/FTYPE : The array of type information :-
- C Element 1 - Base type of the field
- C Element 2 - Number of elements in the field
- C 0 => scalar .
- C Element 3 - Number of characters in the
- C string if a character field .
- C RCFPT/IFPT : Given a file number returns the number of the
- C first field in that file .
- C
- C
- C Called by : MAIN .
- C
- C Calls : RAPPORT : R0COND , R8CV01 , R8CV02 , R8CV03 .
- C
- C Author : MDD ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- COMMON/MSGBUF/WBUF(1)
- INTEGER*2 WBUF
-
- INTEGER LWBUF(10)
- EQUIVALENCE (LWBUF,WBUF)
-
-
- C JFILE is the number of the file to place the condition on .
-
- INTEGER JFILE
-
- C JCOND is the current number of this condition in the overall condition set .
-
- INTEGER JCOND
-
- C JFLD is the absolute number of the field that the condition is on .
-
- INTEGER JFLD
-
- C JANAL is the any all switch . -1 => any element test -2 => all element
- C test 1=> subscript 0 otherwise .
-
- INTEGER JANAL
-
- C If a particular array element is being testes then this is the subscript
- C of this element .
-
- INTEGER JSUBSC
-
- C Thisa is the number of the relation i.e. EQUAL = 1 , .. UNEQUAL = 6 .
-
- INTEGER JREL
-
- C Thios is the number of the conjunction with an added modifier to indicate
- C the level of the conjunction.A modifier of 10 is added for eachg level in the
- C Condition structure.
-
- INTEGER JCONJ
-
-
- EQUIVALENCE (JFILE , LWBUF(2)) , (JCOND , LWBUF(3))
- EQUIVALENCE (JFLD , LWBUF(4)) , (JANAL , LWBUF(5))
- EQUIVALENCE (JSUBSC , LWBUF(6)) , (JREL , LWBUF(7))
- EQUIVALENCE ( JCONJ , LWBUF(8))
-
- C See Header .
-
- COMMON/RCFPT/IFPT(4)
- INTEGER IFPT
-
- C See Header .
-
- COMMON/RCFT/FTYPE(1)
- INTEGER FTYPE
-
- C See Header .
-
- COMMON/RCIFT/IFTYPE(1)
- INTEGER IFTYPE
-
- C TYPTR is the pointer into the FTYPE array for a particular field.
-
- INTEGER TYPTR
-
- C ITYPE is the base type of the field ( 1 => integer , 2 => real ,
- C 3 => character ) .
-
- INTEGER ITYPE
-
- C NELS is the number of elements in the field ( 0 => scalar ) .
-
- INTEGER NELS
-
- C NCHARS is the number of characters in the string if the type is character .
-
- INTEGER NCHARS
-
- C ARRINT is the array holding the condition right hand side in internal form .
-
- INTEGER ARRINT (50)
-
- C JSIZ is the calculated size of arrint .
-
- INTEGER JSIZ
-
- C STRADD is the position in the word buffer where the right hand side starts .
-
- INTEGER STRADD
-
-
- C WRITE(6,55)
- C 55 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING SUBROUTINE R8COND'/)
-
-
-
-
-
- TYPTR=IFTYPE(JFLD)
-
- ITYPE=FTYPE(TYPTR)
-
-
- C If JANAL is not equal to 0 then the right hand side is a single element of
- C an array and so is scalar.Otherwise it is anormal field size .
-
- IF (JANAL.NE.0) THEN
- NELS=0
- ELSE NELS=FTYPE(TYPTR+1)
- ENDIF
-
- IF(ITYPE.EQ.3) NCHARS=FTYPE(TYPTR+2)
-
- C STRADD is the position in the long word buffer of the right hand side (9)
- C modifeid to give the corresponding position in the word buffer .
-
- STRADD=(9*2)-1
-
-
- C Depending on the type of the field convert it to internal form .
-
- IF (ITYPE.EQ.1) CALL R8CV01(-1,STRADD,NELS,ARRINT)
- IF (ITYPE.EQ.2) CALL R8CV02(-1,STRADD,NELS,ARRINT)
- IF (ITYPE.EQ.3) CALL R8CV03(-1,STRADD,NELS,NCHARS,ARRINT)
-
- C Calculate the size of the array holding the right hand side in internal
- C format . A character right hand side size is the number of elements *
- C number of characters rounded up to the nearest long word .
-
- IF (NELS.EQ.0) NELS=1
- IF (ITYPE.EQ.1) JSIZ=NELS
- IF (ITYPE.EQ.2) JSIZ=NELS
- IF (ITYPE.EQ.3) JSIZ=((NELS*NCHARS)+3)/4
-
- C The field number must be made relative to the start of the particular file
- C and not absolut (relative to the start of the ddf )
-
- JFLD=JFLD-IFPT(JFILE)+1
-
-
-
- CALL R0COND( JFILE , JCOND , JFLD , JANAL , JSUBSC , JREL
- * , JCONJ , ARRINT , JSIZ , .FALSE. )
-
-
-
- RETURN
- END
-
-
-
-
-
-
- SUBROUTINE R8FECH
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0FECH.It's actions are:-
- C * Set the Level pointer ICT201 to the value of
- C level gained from the message buffer.( this
- C is now obsolete but is left in to avoid
- C complexities .
- C * Call R0FECH.
- C * Transfer the fetched record from the ipb to
- C the message buffer.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF reference by access to the
- C equivalent long word buffer .
- C The common area holding the level RCCTLP.
- C
- C Called by : Main.
- C
- C Calls : RAPPORT : R0FECH , GETREC
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
- C JFILE is the number ofthe file to fetch the record from.
-
- INTEGER JFILE
-
- C JCOUNT is an indicater to the last record that was fetched.
-
- INTEGER JCOUNT
-
- C JGETT is the retrieval strategy that was set by the caller.If it is found by
- C RAPPORT to be 0 then a strategy is chosen and returned for futute use.
-
- INTEGER JGETT
-
- C NCOND is the number of conditions imposed upon this particular fetch.
-
- INTEGER NCOND
-
- C LEVEL is the level in the search stack and the actual stack pointer
- C ICT201 is made equal to this.This is not actually needed but is kept in
- C to avoid the complexities of it's removal .
-
- INTEGER LEVEL
-
- C STRADD is the address in the message buffer into which to start loading
- C the fetched record.It is in fact the first longword of the buffer after
- C the equivalence of the static parameters.
-
- INTEGER STRADD
-
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
- COMMON/RCCTLP/ICT201
-
- C IC201 is the actual search loop stack pointer set equal to LEVEL.
-
- INTEGER ICT201
-
- EQUIVALENCE (JCOUNT,LWBUF(2)),(LEVEL,LWBUF(3))
- EQUIVALENCE (JFILE,LWBUF(4)),(JGETT,LWBUF(5))
- EQUIVALENCE (NCOND,LWBUF(6))
-
- COMMON/RCIPB/IPB(25)
- INTEGER IPB
-
- C This is not needed but is kept in to avoid complexities .
-
- ICT201=LEVEL
-
-
- C WRITE(6,219)
- C 219 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0FECH'/)
-
- CALL R0FECH(JFILE,JCOUNT,JGETT,NCOND)
-
- C WRITE(6,220)
- C 220 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0FECH'/)
-
-
- C STRADD is the start address in the message buffer to place the fetched record
- C It is 7 because the last static parameter is at address 6 .
-
- STRADD=7
-
- C Place the record into the message buffer from the ipb .
-
- CALL GETREC(JFILE,STRADD)
-
- RETURN
- END
-
-
-
-
- SUBROUTINE R8DELT
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0DELT.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF accessed by reference to
- C the equivalent long word buffer .
- C
- C Called by : Main
- C
- C Calls : RAPPORT : R0DELT
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JFILE is the number of the file to delete from.
-
- INTEGER JFILE
-
- C NCOND is the number of conditions applying to this particular deletion.
-
- INTEGER NCOND
-
- C JCOUNT is returned as the number of records deleted by R0DELT or if an
- C error has occurred it is signified by jcount.
-
- INTEGER JCOUNT
-
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JCOUNT,LWBUF(2)),(JFILE,LWBUF(3))
- EQUIVALENCE (NCOND,LWBUF(4))
-
-
- C WRITE(6,223)
- C 223 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0DELT'/)
- CALL R0DELT(JFILE,JCOUNT,NCOND)
- C WRITE(6,224)
- C 224 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0DELT'/)
-
-
- RETURN
- END
-
-
-
-
-
-
- SUBROUTINE R8STKY
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0STKY.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF accessed by reference to the
- C equivalent long word buffer .
- C RCFPT/IFPT : Given a file number returns the number of the
- C first field in that fiule .
- C
- C Called by : Main.
- C
- C Calls : R0STKY
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JFILE is the numebr of the file that the sort keys are for.
-
- INTEGER JFILE
-
- C NSKEY is the number of keys in the sort key array.
-
- INTEGER NSKEY
-
- C JSOKEY is the array of sort keys.It is dimensioned with the dummy parameter
- C one as we do not at compile time know it's size.
-
- INTEGER JSOKEY(1)
-
- C JTYPE is an indicater of the type of retrieval that will be performed on
- C the finally ordered file.0 => a normal retrieval and 1 => a unique
- C retrieval.
-
- INTEGER JTYPE
-
- C SKCNT is a count used when modifying the sort keys to be reative to the
- C start of the file .
-
- INTEGER SKCNT
-
- C See Header .
-
- COMMON/RCFPT/IFPT(3)
- INTEGER IFPT
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
-
- EQUIVALENCE (JFILE,LWBUF(2)),(JTYPE,LWBUF(3))
- EQUIVALENCE (NSKEY,LWBUF(4)),(JSOKEY(1),LWBUF(5))
-
-
- C The Sort keys that are obtained from the message buffer are in absolute
- C form i.e. relative to the first field of the first file in the ddf but are
- C required in relative form ( to the first field of this file ) .
-
- DO SKCNT=1,NSKEY
- IF (JSOKEY(SKCNT).GT.0)
- * JSOKEY(SKCNT)=JSOKEY(SKCNT)-IFPT(JFILE)+1
- IF (JSOKEY(SKCNT).LT.0)
- * JSOKEY(SKCNT)=JSOKEY(SKCNT)+IFPT(JFILE)-1
- ENDDO
-
-
-
- C WRITE(6,227)
- C 227 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0STKY'/)
-
- CALL R0STKY(JFILE,JSOKEY,NSKEY,JTYPE)
-
- C WRITE(6,228)
- C 228 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0STKY'/)
-
- RETURN
- END
-
-
-
-
- SUBROUTINE R8HOLD
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0HOLD.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF accessed by reference to the
- C equivalent long word buffer .
- C
- C Called by : Main
- C
- C Calls : RAPPORT : R0HOLD
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JFILE is the number of the file on which to perform the HOLD.
-
- INTEGER JFILE
-
- C NCOND is the number of conditions preiously set .
-
- INTEGER NCOND
-
- C NREC IS RETURNED AS THE NUMBER OF RECORDS IN THE HOLD
-
- INTEGER NREC
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JFILE,LWBUF(2)),(NCOND,LWBUF(3))
- EQUIVALENCE (NREC,LWBUF(4))
-
-
-
- C WRITE(6,229)
- C 229 FORMAT(1X,' %USERCALL-TRACEMSG-ENETRING RAPPORT R0HOLD'/)
-
- CALL R0HOLD(JFILE,NCOND,NREC)
-
- C WRITE(6,230)
- C 230 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0HOLD'/)
-
-
- RETURN
- END
-
-
-
- SUBROUTINE R8ENRV
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortarn interface to the RAPPORT R0ENRV.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common mesage buffer WBUF accessed by refernce to the
- C equivalent long word buffer .
- C
- C Called by : Main.
- C
- C Calls : RAPPORT : R0ENRV
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
-
- C JCOUNT is a pointer to the last record in the file to be retrieved.
-
- INTEGER JCOUNT
-
- C JER is an indication of the success of R0ENRV
-
- INTEGER JER
-
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JER,LWBUF(2)),(JCOUNT,LWBUF(3))
-
-
- C WRITE(6,231)
- C 231 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0ENRV'/)
-
- CALL R0ENRV(JCOUNT,JER)
-
- C WRITE(6,232)
- C 232 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0ENRV'/)
-
-
- RETURN
- END
-
-
-
-
-
- SUBROUTINE R8RTRV
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0RTRV.This gets a record
- C from a file that is sorted .
- C
- C Input arguments : None .
- C
- C Output arguments: None .
- C
- C Common blocks : The common message buffer WBUF referenced by accessing
- C the equivalent long word buffer .
- C
- C Called by : MAIN .
- C
- C Calls : RAPPORT : R0RTRV ; GETREC .
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
- C JFILE is the number of the file that was sorted .
-
- INTEGER JFILE
-
-
- C JCOUNT is the count variable inicating the last record fetched.
-
- INTEGER JCOUNT
-
- C STRADD is the start address in the message buffer to return the record to
-
- INTEGER STRADD
-
-
- COMMON/MSGBUF/WBUF(5)
- INTEGER*2 WBUF
-
- INTEGER LWBUF(4)
- EQUIVALENCE (LWBUF,WBUF)
-
- EQUIVALENCE (LWBUF(2),JCOUNT)
- EQUIVALENCE (LWBUF(3),JFILE)
-
- C WRITE(6,482)
- C 482 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING SUBROUTINE R8RTRV'/)
-
- C WRITE(6,483)
- C 483 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0RTRV'/)
-
- CALL R0RTRV ( JCOUNT )
-
- C WRITE(6,484)
- C 484 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0RTRV'/)
-
- C The address in the message buffer to start placing the record in is
- C long word 4 as thalast static parameter is at long word 3 .
-
- STRADD = 4
-
- C Place the record in the message buffer from the ipb .
-
- CALL GETREC ( JFILE , STRADD )
-
- C WRITE(6,485)
- C 485 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING SUBROUTINE R8RTRV'/)
-
- RETURN
- END
-
-
-
-
-
- SUBROUTINE R8CLFI
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT : R0CLFI
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF accessed by refernce to the
- C equivalent long word buffer .
- C
- C Called by : Main.
- C
- C Calls : RAPPORT : R0CLFI
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JFILE is the number of the file to clear.
-
- INTEGER JFILE
-
- C JER is an indication of the success of R0CLFI.
-
- INTEGER JER
-
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JER,LWBUF(2)),(JFILE,LWBUF(3))
-
-
- C WRITE(6,235)
- C 235 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0CLFI'/)
- CALL R0CLFI(JFILE,JER)
- C WRITE(6,236)
- C 236 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0CLFI'/)
-
-
- RETURN
- END
-
-
- SUBROUTINE R8LOCK
-
- C------------------------------------------------------------------------------
- C
- C Function : Fortran interface to the RAPPORT R0LOCK.
- C
- C Input arguments : None.
- C
- C Output arguments: None.
- C
- C Common blocks : The common message buffer WBUF refernced by equivalence to
- C a long word buffer .
- C
- C Called by : Main.
- C
- C Calls : RAPPORT : R0LOCK
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JFILE is the number o fthe file to lock
-
- INTEGER JFILE
-
- C JREWO is the switch indivating how to lock the file
-
- INTEGER JREWO
-
- C JER is an indication of the success of R0LOCK
-
- INTEGER JER
-
-
-
- COMMON/MSGBUF/WBUF(10)
- INTEGER*2 WBUF
- INTEGER LWBUF(10)
- EQUIVALENCE (WBUF,LWBUF)
-
- EQUIVALENCE (JER,LWBUF(2)),(JFILE,LWBUF(3))
- EQUIVALENCE (JREWO,LWBUF(4))
-
- c write(6,444)jfile,jrewo
- c444 format(1x,'file , rw'i,i/)
-
-
- c WRITE(6,237)
- c237 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING RAPPORT R0LOCK'/)
-
- CALL R0LOCK(JFILE,JREWO,JER)
-
- c WRITE(6,238)
- c238 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING RAPPORT R0LOCK'/)
-
-
- RETURN
- END
-
-
-
-
- SUBROUTINE PUTREC(JFILE,STRADD)
-
- C------------------------------------------------------------------------------
- C
- C Function : Moves a record , field by field , from the message buffer
- C to the program buffers.An outline algorithm for this is:-
- C * Get the number of fields in the record
- C * LOOP for the number of fields
- C - find the type of the field
- C - depending on the type call a conversion
- C routine.
- C 1.) R8CV01 (integer conversion)
- C 2.) R8CV02 (real conversion)
- C 3.) R8CVo3 (character conversion)
- C * end LOOP
- C
- C Input arguments : JFILE:- The number of the file of the record.Used to
- C extract information about the number of fields
- C in the record.
- C STRADD:-the start address in the message buffer to get
- C the record from.
- C
- C Output arguments: None.
- C
- C Common blocks : RCFDS/NOFDS : information about the number of fields in a
- C given file.
- C RCIFT/IFTYPE : given a field number returns a pointer into
- C the type description array tp get type
- C information for that particular field.
- C RCFT/FTYPE : holds the array of type information.The
- C structure of this array is -
- C Element 1 - type
- C Element 2 - number of elemnts in field
- C Element 3 - if character then number of
- C chars in string.
- C RCFPT/IFPT : contains an array giving for every file the
- C number of the first field.
- C RCJWT/JWTEST : } These are to locate the positiuon of a
- C RCIF/IFTEST : } particular field in the ipb .
- C RCIPB/IPB : The ipb .
- C RCIIPB/IIPB : The index into the ipb for a given file .
- C RCPPRM/ : Various rapport parameters .
- C
- C Called by : R8INRT , R8UPDT , R8STOR
- C
- C Calls : R8cv01 , R8CV02 , R8cv03
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JFILE is the number of the file concerned
-
- INTEGER JFILE
-
- C STRADD is the start address in the message buffer to transfer the record
- C from.
-
- INTEGER STRADD
-
- C TOTFDS is the number of fields in the file.
-
- INTEGER TOTFDS
-
- C FLDNO is a count variable indicating the field to transfer.
-
- INTEGER FLDNO
-
- C FSTFLD is the number of the first field in the file
-
- INTEGER FSTFLD
-
- C LSTFLD is the number of the last field in the file.
-
- INTEGER LSTFLD
-
- C TYPE is information about the base type of the field , NELS is the number
- C of elements in the filed and NCHARS is,if the field is a character field
- C the number of characters in the string.
-
- INTEGER ITYPE,NELS,NCHARS
-
- C BUFADD is the current position in the message buffer in words.The inputed
- C address is in long words so BUFADD:=STRADD*2-1.
-
- INTEGER BUFADD
-
- C TYPTR is a pointer into the type array for a particular fiel;d
-
- INTEGER TYPTR
-
- C ARRINT is the field value in internal form returned by the R*CV'S as the
- C conversion of the ADA field value
-
- INTEGER ARRINT(50)
-
- C RFLDNO is the number of the field relatve to the start of the file.
-
- INTEGER RFLDNO
-
- C IFLD
-
- INTEGER IFLD
-
-
- C See Header .
-
- COMMON/RCFDS/NOFDS(1)
- INTEGER NOFDS
-
- C See Header .
-
- COMMON/RCFPT/IFPT(1)
- INTEGER IFPT
-
- C See Header .
-
- COMMON/RCFT/FTYPE(1)
- INTEGER FTYPE
-
- C See Header .
-
- COMMON/RCIFT/IFTYPE(1)
- INTEGER IFTYPE
-
- C See Header .
-
- COMMON/RCJWT/JWTEST(1)
- INTEGER JWTEST
-
- C See Header .
-
- COMMON/RCIF/IFTEST(1)
- INTEGER IFTEST
-
- C See Header
-
- COMMON/RCPPRM/DUMM1(20),MWOFBF,DUMM2(14),MWOIPB
- INTEGER DUMM1,DUMM2,MWOFBF,MWOIPB
-
- C See Header .
-
- COMMON/RCIPB/IPB(300)
- INTEGER IPB
-
- C See Header .
-
- COMMON/RCIIPB/IIPB(1)
- INTEGER IIPB
-
-
- C LER is the error returned from RUCPEI
-
- LOGICAL LER
-
-
- C WRITE(6,208)
- C 208 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING ROUTINE PUTREC'/)
-
-
- C Set up the parameters required .
- C TOTFDS the number of fields in the file .
- C FSTFLD is the number of the first field in the file .
- C LSTFLD is the number of the last field in the file.
- C BUFADD is the address in the message buffer to get the record in words .
-
-
- TOTFDS=NOFDS(JFILE)
- FSTFLD=IFPT(JFILE)
- LSTFLD=FSTFLD+TOTFDS-1
- BUFADD=(STRADD*2)-1
-
-
-
-
- C LOOP to transfer all the fields to the ipb .
-
- DO FLDNO=FSTFLD,LSTFLD
-
-
- C Set up the field dependant variables .
- C TYPTR is the index into ftype for the field .
- C ITYPE is the base type of the field .
- C NELS is the number of elements of this base type in the field .
- C NCHARS if the base type is character is the number of elements in tyhe string
-
- TYPTR=IFTYPE(FLDNO)
- ITYPE=FTYPE(TYPTR)
- NELS=FTYPE(TYPTR+1)
- IF (ITYPE.EQ.3) NCHARS=FTYPE(TYPTR+2)
-
- C Get the field from the message buffer into arrint and convert into
- C internal format . BUFADD is returned as the address in the word byffer of
- C the next field .
-
- IF (ITYPE.EQ.1) CALL R8CV01(-1,BUFADD,NELS,ARRINT)
- IF (ITYPE.EQ.2) CALL R8CV02(-1,BUFADD,NELS,ARRINT)
- IF (ITYPE.EQ.3) CALL R8CV03(-1,BUFADD,NELS,NCHARS,
- * ARRINT)
-
-
-
-
- C RFLDNO is the number of the field relative to the start of the file .
- C IFLD is the index into jwtest for that field .
-
- RFLDNO=FLDNO-FSTFLD
- IFLD=IFTEST(JFILE)+RFLDNO
-
-
- C Transfer the field in internal format from arrint to the ipb . The format
- C of the call is :-
- C
- C RUCPEI ( Sense , TypeInformation , StartOfTypeInformation ,
- C EndOfTypeInformation , ipb , SizeOfIpb ,
- C WhereInIpbToStartLoading , 0 => Transfer all elements ,
- C arrint , SizeOfArrint , WhereToTRansferFromInArrint , LER )
- C
- C Sense = -1 => ARRINT -> IPB
- C Sense = 1 => IPB -> ARRINT
- C
-
-
-
- CALL RUCPEI(-1,FTYPE,IFTYPE(FLDNO),IFTYPE(FLDNO+1)-1,
- * IPB,MWOIPB,IIPB(JFILE)+JWTEST(IFLD)-1,0,
- * ARRINT,50,1,LER)
-
-
-
- ENDDO
-
-
-
-
- C WRITE(6,209)
- C 209 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING ROUTINE PUTREC'/)
-
-
-
-
-
- RETURN
- END
-
-
-
-
-
- SUBROUTINE GETREC(JFILE,STRADD)
-
- C------------------------------------------------------------------------------
- C
- C Function : Moves a record , field by field , from the message buffer
- C to the program buffers.An outline algorithm for this is:-
- C * Get the number of fields in the record
- C * LOOP for the number of fields
- C - find the type of the field
- C - depending on the type call a conversion
- C routine.
- C 1.) R8CV01 (integer conversion)
- C 2.) R8CV02 (real conversion)
- C 3.) R8CVo3 (character conversion)
- C * end LOOP
- C
- C Input arguments : JFILE:- The number of the file of the record.Used to
- C extract information about the number of fields
- C in the record.
- C STRADD:-the start address in the message buffer to get
- C the record from.
- C
- C Output arguments: None.
- C Common blocks : RCFDS/NOFDS : information about the number of fields in a
- C given file.
- C RCIFT/IFTYPE : given a field number returns a pointer into
- C the type description array tp get type
- C information for that particular field.
- C RCFT/FTYPE : holds the array of type information.The
- C structure of this array is -
- C Element 1 - type
- C Element 2 - number of elemnts in field
- C Element 3 - if character then number of
- C chars in string.
- C RCFPT/IFPT : contains an array giving for every file the
- C number of the first field.
- C RCJWT/JWTEST : } These are to locate the positiuon of a
- C RCIF/IFTEST : } particular field in the ipb .
- C RCIPB/IPB : The ipb .
- C RCIIPB/IIPB : The index into the ipb for a given file .
- C RCPPRM/ : Various rapport parameters .
- C
- C Called by : R8INRT , R8UPDT , R8STOR
- C
- C Calls : R8cv01 , R8CV02 , R8cv03
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C JFILE is the number of the file concerned
-
- INTEGER JFILE
-
- C STRADD is the start address in the message buffer to transfer the record
- C from.
-
- INTEGER STRADD
-
- C TOTFDS is the number of fields in the file.
-
- INTEGER TOTFDS
-
- C FLDNO is a count variable indicating the field to transfer.
-
- INTEGER FLDNO
-
- C FSTFLD is the number of the first field in the file
-
- INTEGER FSTFLD
-
- C LSTFLD is the number of the last field in the file.
-
- INTEGER LSTFLD
-
- C TYPE is information about the base type of the field , NELS is the number
- C of elements in the filed and NCHARS is,if the field is a character field
- C the number of characters in the string.
-
- INTEGER ITYPE,NELS,NCHARS
-
- C BUFADD is the current position in the message buffer in words.The inputed
- C address is in long words so BUFADD:=STRADD*2-1.
-
- INTEGER BUFADD
-
- C TYPTR is a pointer into the type array for a particular fiel;d
-
- INTEGER TYPTR
-
- C ARRINT is the field value in internal form returned by the R*CV'S as the
- C conversion of the ADA field value
-
- INTEGER ARRINT(50)
-
- C RFLDNO is the number of the field relatve to the start of eth file.
-
- INTEGER RFLDNO
-
- C IFLD
-
- INTEGER IFLD
-
-
- C See Header .
-
- COMMON/RCFDS/NOFDS(1)
- INTEGER NOFDS
-
- C See Header .
-
- COMMON/RCFPT/IFPT(1)
- INTEGER IFPT
-
- C See Header .
-
- COMMON/RCFT/FTYPE(1)
- INTEGER FTYPE
-
- C See Header .
-
- COMMON/RCIFT/IFTYPE(1)
- INTEGER IFTYPE
-
- C See Header .
-
- COMMON/RCJWT/JWTEST(1)
- INTEGER JWTEST
-
- C See Header .
-
- COMMON/RCIF/IFTEST(1)
- INTEGER IFTEST
-
- C See Header .
-
- COMMON/RCPPRM/DUMM1(20),MWOFBF,DUMM2(14),MWOIPB
- INTEGER DUMM1,DUMM2,MWOFBF,MWOIPB
-
- C See Header .
-
- COMMON/RCIPB/IPB(300)
- INTEGER IPB
-
- C See Header .
-
- COMMON/RCIIPB/IIPB(1)
- INTEGER IIPB
-
- C LER is the error returned from rucpei .
-
- LOGICAL LER
-
-
- C WRITE(6,769)
- C 769 FORMAT(1X,' %USERCALL-TRACEMSG-ENTERING ROUTINE GETREC'/)
-
-
- C Set up the parameters required .
- C TOTFDS the number of fields in the file .
- C FSTFLD is the number of the first field in the file .
- C LSTFLD is the number of the last field in the file.
- C BUFADD is the address in the message buffer to put the record in words .
-
- TOTFDS=NOFDS(JFILE)
- FSTFLD=IFPT(JFILE)
- LSTFLD=FSTFLD+TOTFDS-1
- BUFADD=(STRADD*2)-1
-
-
- C LOOP for the number of fileds .
-
- DO FLDNO=FSTFLD,LSTFLD
-
-
-
-
-
-
- C RFLDNO is the number of the field relative to the start of the file .
- C IFLD is the index into jwtest for that field .
-
- RFLDNO=FLDNO-FSTFLD
- IFLD=IFTEST(JFILE)+RFLDNO
-
-
- C Transfer the field in internal format from arrint to the ipb . The format
- C of the call is :-
- C
- C RUCPEI ( Sense , TypeInformation , StartOfTypeInformation ,
- C EndOfTypeInformation , ipb , SizeOfIpb ,
- C WhereInIpbToStartLoading , 0 => Transfer all elements ,
- C arrint , SizeOfArrint , WhereToTRansferFromInArrint , LER )
- C
- C Sense = -1 => ARRINT -> IPB
- C Sense = 1 => IPB -> ARRINT
- C
-
-
-
- CALL RUCPEI(1,FTYPE,IFTYPE(FLDNO),IFTYPE(FLDNO+1)-1,
- * IPB,MWOIPB,IIPB(JFILE)+JWTEST(IFLD)-1,0,
- * ARRINT,50,1,LER)
-
-
- C Set up the field dependant variables .
- C TYPTR is the index into ftype for the field .
- C ITYPE is the base type of the field .
- C NELS is the number of elements of this base type in the field .
- C NCHARS if the base type is character is the number of elements in tyhe string
-
-
- TYPTR=IFTYPE(FLDNO)
- ITYPE=FTYPE(TYPTR)
- NELS=FTYPE(TYPTR+1)
- IF (ITYPE.EQ.3) NCHARS=FTYPE(TYPTR+2)
-
- IF (ITYPE.EQ.1) CALL R8CV01(1,BUFADD,NELS,ARRINT)
- IF (ITYPE.EQ.2) CALL R8CV02(1,BUFADD,NELS,ARRINT)
- IF (ITYPE.EQ.3) CALL R8CV03(1,BUFADD,NELS,NCHARS,
- * ARRINT)
-
-
-
-
-
- ENDDO
-
-
-
-
- C WRITE(6,770)
- C 770 FORMAT(1X,' %USERCALL-TRACEMSG-LEAVING ROUTINE getREC'/)
-
-
-
-
-
- RETURN
- END
-
-
-
-
-
- SUBROUTINE R8CV02(SENSE , BUFADD , NELS , ARRINT)
-
- C------------------------------------------------------------------------------
- C
- C Function : Get an real field from the message buffer starting at
- C address BUFADD convert to internal format and place
- C in output array arrint . Note that npo conversion is infact
- C needed and the process is a straight copy .
- C Or from the array arrint into the message buffer
- C
- C Input arguments : SENSE = -1 => Move field Message buffer -> Arrint
- C SENSE = 1 => Move field arrint -> message buffer .
- C BUFADD : the address in the word message buffer .
- C NELS : the number of elements to transfer .
- C
- C Output arguments: BUFADD
- C ARRINT : Output is sense = -1 and moving into arrint .
- C
- C Common blocks : The common message buffer wbuf .
- C
- C Called by : PUTREC , GETREC , R8COND .
- C
- C Calls : None .
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C SENSE decides in which direction the transferance is to be (see header)
-
- INTEGER SENSE
-
- C BUFADD is the address in the message buffer.
-
- INTEGER BUFADD
-
- C NELS is the number of elements to transfer.
-
- INTEGER NELS
-
- C ARRINT is the array of the field in internal form.
-
- INTEGER*2 ARRINT(100)
-
- C WCNT is a count of the current number of the word to transfer
-
- INTEGER WCNT
-
- INTEGER C
-
-
- COMMON/MSGBUF/WBUF(1)
- INTEGER*2 WBUF
-
- C If the field is scalar then only transfer 1 field .
-
- IF (NELS.EQ.0) NELS=1
-
-
- C Transfer from the message buffer into arrint
-
- IF (SENSE.EQ.-1) THEN
- DO WCNT=0,(NELS*2)-1
- WBADD=BUFADD+WCNT
- ARRINT(WCNT+1)=WBUF(WBADD)
- ENDDO
-
- C Transfer from arrint into the message buffer .
-
- ELSE
- DO WCNT=0,(NELS*2)-1
- WBADD=BUFADD+WCNT
- WBUF(WBADD)=ARRINT(WCNT+1)
- ENDDO
- ENDIF
-
- C Calculate the position in the message buffer for the nextf iled .
-
- BUFADD=BUFADD+(NELS*2)
-
-
- RETURN
- END
-
-
-
-
-
- SUBROUTINE R8CV01(SENSE , BUFADD , NELS , ARRINT)
-
-
- C------------------------------------------------------------------------------
- C
- C Function : Get an integer field from the message buffer starting at
- C address BUFADD convert to internal format and place
- C in output array arrint . Note that npo conversion is infact
- C needed and the process is a straight copy .
- C Or transfer from the arrint array imnto the message buffer
- C
- C Input arguments : SENSE = -1 => Move field Message buffer -> Arrint
- C SENSE = 1 => Move field arrint -> message buffer .
- C BUFADD : the address in the word message buffer .
- C NELS : the number of elements to transfer .
- C
- C Output arguments: BUFADD
- C ARRINT : Output is sense = -1 and moving into arrint .
- C
- C Common blocks : The common message buffer wbuf .
- C
- C Called by : PUTREC , GETREC , R8COND .
- C
- C Calls : None .
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C SENSE decides in which direction the transferance is to be (see header)
-
- INTEGER SENSE
-
- C BUFADD is the address in the message buffer.
-
- INTEGER BUFADD
-
- C NELS is the number of elements to transfer.
-
- INTEGER NELS
-
- C ARRINT is the array of the field in internal form.
-
- INTEGER*2 ARRINT(50)
-
- C WCNT is a count of the current number of the word to transfer
-
- INTEGER WCNT
-
-
-
-
- COMMON/MSGBUF/WBUF(1)
- INTEGER*2 WBUF
-
-
-
- C If the field is scalar then only 1 elemnt needs to be transfered .
-
- IF (NELS.EQ.0) NELS=1
-
- C Transfer from the message buffer into arrint .
-
- IF (SENSE.EQ.-1) THEN
- DO WCNT=0,(NELS*2)-1
- WBADD=BUFADD+WCNT
- ARRINT(WCNT+1)=WBUF(WBADD)
- ENDDO
-
- C Transfer into arrint from the message buffer .
-
- ELSE
- DO WCNT=0,(NELS*2)-1
- WBADD=BUFADD+WCNT
- WBUF(WBADD)=ARRINT(WCNT+1)
- ENDDO
- ENDIF
-
- C Calculate the start int the message buffer for the next field .
-
- BUFADD=BUFADD+(NELS*2)
-
- RETURN
- END
-
-
- SUBROUTINE R8CV03(SENSE,BUFADD,NELS,NCHARS,ARRINT)
-
-
-
- C------------------------------------------------------------------------------
- C
- C Function : Get an character field from the message buffer starting at
- C address BUFADD convert to internal format and place
- C in output array arrint . Note that npo conversion is infact
- C needed and the process is a straight copy . Or get the
- C field from the ipb and put into the message buffer .
- C
- C
- C Input arguments : SENSE = -1 => Move field Message buffer -> Arrint
- C SENSE = 1 => Move field arrint -> message buffer .
- C BUFADD : the address in the word message buffer .
- C NELS : the number of elements to transfer .
- C NCHARS : the number of characters in an element string .
- C
- C Output arguments: BUFADD
- C ARRINT : Output is sense = -1 and moving into arrint .
- C
- C Common blocks : The common message buffer wbuf .
- C
- C Called by : PUTREC , GETREC , R8COND .
- C
- C Calls : None .
- C
- C Author : ( / / ) Version 1.0
- C
- C Amendments : ( / / )
- C
- C Notes :
- C
- C------------------------------------------------------------------------------
-
-
-
- C SENSE is the direction of conversion ( see header )
-
- INTEGER SENSE
-
- C BUFADD is the address in the word buffer
-
- INTEGER BUFADD
-
- C NELS is the number of elements.
-
- INTEGER NELS
-
- C NCHARS is the number of characters per element.
-
- INTEGER NCHARS
-
- C ARRINT is the byte array into which the field is placed or taken from
- C depending on sense.Note that it is passed in as a word array and declared
- C here as a byte array .
-
- BYTE ARRINT(400)
-
- C CCNT is a byte count of the characters transfered .
- C CBUFADD is the current position in thecharacter buffer .
- C CMOVE is the number of characters to move .
-
- INTEGER CCNT,CBUFAD,CMOVE,ECNT,IND
-
-
- C Characters are taken/put from the array cbuf a byte array equivalenced
- C to the message buffer .
-
- COMMON/MSGBUF/WBUF(100)
- INTEGER*2 WBUF
-
- BYTE CBUF(200)
- EQUIVALENCE (CBUF,WBUF)
-
-
-
- C If the field is scalar then the number of elements to move is 1 .
-
- IF (NELS.EQ.0) NELS=1
-
-
- C BUFADD is the address in the message buffer in words soit must be
- C converted into an address in the byte buffer .
-
- CBUFAD=(BUFADD*2)-1
-
- CMOVE=(NELS*NCHARS)
-
-
- C Transfer from the message buffer into the arrint array .
-
- IF (SENSE.EQ.-1) THEN
- DO ECNT=1,NELS
- DO CCNT=1,NCHARS
- IND = (ECNT-1)*NCHARS + CCNT
- ARRINT(IND)=CBUF(CBUFAD)
- CBUFAD=CBUFAD+1
- ENDDO
- CBUFAD = ((CBUFAD/2)*2)+1
- ENDDO
-
- C In RAPPORT all fields must start and finish on a long word boundary .
- C So it is neccesary in the case of a character field (which is not
- C automatically long word aligned) to pad arrit out to a long word
- C boundary with spaces (ASCII decimal 32) as does RAPPORT
-
-
- DO CCNT=(CMOVE+1),((CMOVE+3)/4)*4
- ARRINT(CCNT)=32
- ENDDO
-
-
- C Move from ARRINT into the message buffer.
-
- ELSE
-
-
- DO ECNT=1,NELS
- DO CCNT=1,NCHARS
- IND = (ECNT-1)*NCHARS + CCNT
- CBUF(CBUFAD) = ARRINT(IND)
- CBUFAD=CBUFAD+1
- ENDDO
- CBUFAD = ((CBUFAD/2)*2)+1
- ENDDO
-
-
- ENDIF
-
- C Note that in an ada record each field of that record must be WORD
- C aligned (i.e. 16 bit).With a character field if we have an odd number of
- C characters then thgis is not the case.The address then must be rounded
- C up to the next word in the message buffer .
-
- BUFADD=(CBUFAD+2)/2
-
-
-
-
-
-
- RETURN
- END
-
-
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --V23USR.MAR
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- .TITLE ROSUSR.MAR ROS 2.2 VMS USER SUPPORT
- .IDENT /V2.3a/
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; ;
- ; ROS 2.2 VMS USER SUPPORT ;
- ; ;
- ; Written by ;
- ; ;
- ; H. Rutherford 12-Sep-83 ;
- ; ;
- ; Copyright (c) TeleSoft 1983 ;
- ; All Rights Reserved ;
- ; ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- ;--------------------------------------------------------------
- ; Bug List BUGS bugs BUGS bugs
- ;
- ; when who bug# Description of problem
- ;
- ;
- ;--------------------------------------------------------------
- ; Log of Modifications LOG log
- ;
- ; when who version where what
- ;
- ; 30/1/85 MDD
- ;
- ;
- ;--------------------------------------------------------------
-
-
- .PSECT ROSUSR LONG,EXE
-
- .SAVE_PSECT
-
- .PSECT ROSDAT LONG,CON,NOEXE,WRT,NOSHR,REL,PIC
-
- USRDRVRT::
- .ADDRESS USRDRVRT ; empty queue
- .ADDRESS USRDRVRT ;
- .ADDRESS USRSTART ;
- .ADDRESS USRCLR ;
- .ADDRESS USRCNTRL ;
- .WORD 0
- .WORD 0
-
- .ALIGN LONG,0
-
- USRFAB::$FAB- ; Default FAB
- SHR=<GET,PUT,UPD,DEL,UPI>
- USRNAM: $NAM ; Default NAM
- USRRAB: $RAB ; Default RAB
-
- $IODEF
- $PRCDEF
- $DVIDEF
-
-
-
-
- ; In setting the input and output of the process that we create to the
- ; terminal we need to discover the name of the device.This is done via
- ; a call to the system service $GETDVI_S hich takes as an argument the
- ; DVILIST so described.
-
-
- DVILIST:
- .WORD 64
- .WORD DVI$_DEVNAM
- .ADDRESS -
- TERM
- .ADDRESS -
- TERMDESC
- .LONG 0
-
- TERMDESC:
- .WORD 64
- .WORD 0
- TERMADDR:
- .ADDRESS -
- TERM
- CONCTERM:
- .ASCII /_/
- TERM: .BLKB 64
-
-
- ;The name of the terminal is derived by GETDVI from the logical name assigned
- ;to it which is SYS$INPUT
-
- LOGNAM: .ASCID /SYS$INPUT/
-
-
- ; We will also need to discover the name of the mailbox that we create as
- ; on creation of the mailbox it is only identifiable by its channel number
- ; and when the process is created we need to know its logical name
-
-
- MBXLIST:
- .WORD 64
- .WORD DVI$_DEVNAM
- .ADDRESS -
- MBX
- .ADDRESS -
- MBXDESC
- .LONG 0
-
- MBXDESC:
- .WORD 64
- .WORD 0
- MBXADDR:
- .ADDRESS -
- MBX
- CONCMBX:
- .ASCII /_/
- MBX: .BLKB 64
-
-
-
-
- ; There follows declarations of theinformation needed to set up and maintain
- ; the mailbox lionk to user call lib:-
- ;
- ; A longword to hold the channel number of the mailbox
- ;
-
-
- MESSAGEPIPE:
- .BLKW 1
-
-
-
- ; This is the declaration of the message buferr which is a contiguous sequence
- ; of longwords enough to hold the largest possible message
-
-
- MESSAGE:
- .BLKL 50
-
-
- ; This is a character descriptor of the name and location of user call lib.
- ; This descriptor is used by $CREPRC to set up and run user call lib in
- ; parallel with the ada application progam
-
-
- USERCALLLIB:
- .ASCID /DBA2:[ADARAPP.FORTRAN]usercall.exe/
-
-
-
- ; This is the argument list used by SIMPLE , RECWRIE , RECREAD to store
- ; and access two pointers :-
- ;
- ; ENDADAREC : A pointer to the description (if it exists)
- ; of the size and position of the database record
- ; in ada address space.
- ; END MESSAGE : A pointer to the start of a sequence of long
- ; words in the message buffer that hold (or are
- ; to hold the database record.
-
-
- ADDRLIST:
- .LONG 2
- .ADDRESS ENDADARECORD,ENDMESSAGE
-
- ENDADARECORD:
- .BLKL 1
-
- ENDMESSAGE:
- .BLKL 1
-
-
-
- ; This is the argument list used to give the parameters for a data transferal
- ; to TRANSFER and to return pointers to the nex available byte in both data
- ; areas after data transferal.It is used by TRANSFER , ADATOMSG , MSGTOADA
- ; ATOMREC , MTOAREC . Its parts are:-
- ;
- ; FROM : The start address of the data to transfer.
- ; TO : The start of the data area to transfer the data to.
- ; SIZE : The amount of words of data to transfer.
- ; ENDFROM : The first available byte in the from area.
- ; ENDTO : The first available byte in the to area.
- ;
-
-
- TRANSPARAMS:
- .LONG 5
- .ADDRESS FROMSTART,TOSTART,SIZE,ENDFROM,ENDTO
-
- FROMSTART:
- .BLKL 1
-
- TOSTART:
- .BLKL 1
-
- SIZE: .BLKL 1
-
- ENDFROM:
- .BLKL 1
-
- ENDTO: .BLKL 1
-
-
- DUMMY: .BLKL 1
-
-
- .ALIGN LONG,0
-
-
- .RESTORE_PSECT
-
-
-
- ;-------------------------------------
- ; R1 = ^ TO TASK CONTROL BLOCK
- ; R2 = scratch
- ; R6 = untouchable
- ; R8 = task stack pointer
- ; R9 = scratch
- ; R10= scratch
- ;
- ; The following are general constants
- ;
- ;-------------------------------------
-
- ACSZE = 256. ; Size of an ASCII packed array (also size of bufs)
- ; The actual size is 255, but 256 bytes are allocated
- ADSZE = 8. + ACSZE ; The size of an ASCID record
-
- ;
- ; Argument offsets in parameter block
- ;
- WHAT = 0 ; What call kind it is
- P1 = 4 ; First parameter
- P2 = 8 ; Second parameter
- P3 = 12 ; Third parameter
- RESULT = 16 ; The result of this call
- ERRNO = 20 ; The system result
-
-
- ; This is a list of mnemonic equating the various service call to rapport
- ; with their equivalent integer identifiers
-
-
- STARTRAPPORT = 1
- ENDRAPPORT = 2
- TRANSACT = 3
- COMMIT = 4
- BACKOUT = 5
- INSERT = 6
- UPDATE = 7
- STORE = 8
- CONDITION = 9
- FETCH = 10
- DELETE = 11
- STACK = 12
- STOREKEY = 13
- HOLD = 14
- ENDRETRIEVE = 15
- ENDSEARCH = 16
- RETRIEVE = 17
- CLEARFILE = 18
- LOCK = 19
-
-
-
-
-
-
-
- USRSTART:: ;--------- start of code --------
- PUSHR #^M<R2,R3,R4,R5,R6,R7,R8,R9,R10>
- MOVL TSP(R1),R8 ; get task stack pointer
- MOVL BUFFER(R8),R8 ; get param block
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * If the call is StartRapport then set up communications.
- ; * Dispatch the call to the appropriate handling routine:-
- ; - Simple
- ; - Recread
- ; - Recwrite
- ; * If the call is EndRapport then shut down the mailbox.
- ;
- ; Input arguments : None
- ;
- ; Output arguments: None
- ;
- ; Common blocks : Acceses the the parameter WHAT(The service call number).
- ;
- ; Calls To : SETCOMS , BRKCOMS , SIMPLE , RECREAD , RECWRITE
- ;
- ; Called By : A da application program.
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
- CMPL WHAT(R8),#STARTRAPPORT
- BNEQ DISPATCHER
- CALLS #0,SETCOMS
-
- DISPATCHER:
- CMPL WHAT(R8),#STARTRAPPORT
- BNEQ CONT1
- CALLS #0,SIMPLE
- JMP QUIT
- CONT1: CMPL WHAT(R8),#ENDRAPPORT
- BNEQ CONT2
- CALLS #0,SIMPLE
- CALLS #0,BRKCOMS
- JMP QUIT
- CONT2: CMPL WHAT(R8),#TRANSACT
- BNEQ CONT3
- CALLS #0,SIMPLE
- JMP QUIT
- CONT3: CMPL WHAT(R8),#COMMIT
- BNEQ CONT4
- CALLS #0,SIMPLE
- JMP QUIT
- CONT4: CMPL WHAT(R8),#BACKOUT
- BNEQ CONT5
- CALLS #0,SIMPLE
- JMP QUIT
- CONT5: CMPL WHAT(R8),#INSERT
- BNEQ CONT6
- CALLS #0,RECWRITE
- JMP QUIT
- CONT6: CMPL WHAT(R8),#UPDATE
- BNEQ CONT7
- CALLS #0,RECWRITE
- JMP QUIT
- CONT7: CMPL WHAT(R8),#STORE
- BNEQ CONT8
- CALLS #0,RECWRITE
- JMP QUIT
- CONT8: CMPL WHAT(R8),#CONDITION
- BNEQ CONT9
- CALLS #0,RECWRITE
- JMP QUIT
- CONT9: CMPL WHAT(R8),#FETCH
- BNEQ CONT10
- CALLS #0,RECREAD
- JMP QUIT
- CONT10: CMPL WHAT(R8),#DELETE
- BNEQ CONT11
- CALLS #0,SIMPLE
- JMP QUIT
- CONT11: CMPL WHAT(R8),#STACK
- BNEQ CONT12
- CALLS #0,SIMPLE
- JMP QUIT
- CONT12: CMPL WHAT(R8),#STOREKEY
- BNEQ CONT13
- CALLS #0,RECWRITE
- JMP QUIT
- CONT13: CMPL WHAT(R8),#HOLD
- BNEQ CONT14
- CALLS #0,SIMPLE
- JMP QUIT
- CONT14: CMPL WHAT(R8),#ENDRETRIEVE
- BNEQ CONT15
- CALLS #0,SIMPLE
- JMP QUIT
- CONT15: CMPL WHAT(R8),#ENDSEARCH
- BNEQ CONT16
- CALLS #0,SIMPLE
- JMP QUIT
- CONT16: CMPL WHAT(R8),#RETRIEVE
- BNEQ CONT17
- CALLS #0,RECREAD
- JMP QUIT
- CONT17: CMPL WHAT(R8),#CLEARFILE
- BNEQ CONT18
- CALLS #0,SIMPLE
- JMP QUIT
- CONT18: CMPL WHAT(R8),#LOCK
- BNEQ CONT19
- CALLS #0,SIMPLE
- JMP QUIT
- CONT19: JMP QUIT
-
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Set up a mailbox.
- ; * Find the logical name of the terminal.
- ; * Find the logical name of the mailbox just created
- ; * Create the user call lib process setting the input
- ; and output channels equal to the terminal and the
- ; error channel(for the passage of the messages) equal
- ; to the mailbox name.
- ; * Place the channel of the mailbox in the return
- ; location for the syscall function.
- ;
- ; Input arguments : None
- ;
- ; Output arguments: None
- ;
- ; Globals Used : syscall result (RESULT(R8)) , Terminal descriptor (DVILIST)
- ; Mailbox descriptor (MBXLIST) , Channel number (MESSAGEPIPE)
- ;
- ; Calls To : System services :- $CREMBX , $GETDVI , $CREPRC
- ;
- ; Called By : Main
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
- .ENTRY SETCOMS,^M<R4,R5>
- $CREMBX_S CHAN=MESSAGEPIPE ; Create the mailbox
- $GETDVI_S DEVNAM=LOGNAM,- ; Get the device name of the
- ITMLST=DVILIST ; terminal
- $GETDVI_S CHAN=MESSAGEPIPE,- ; Get the device name of the
- ITMLST=MBXLIST ; mailbox
- $CREPRC_S IMAGE=USERCALLLIB,- ; Create a process to run user
- INPUT=TERMDESC,- ; call lib and set the input,output
- OUTPUT=TERMDESC,- ; and error channels to appropriate
- ERROR=MBXDESC ; devices.
- MOVL MESSAGEPIPE,RESULT(R8) ; Put the channel number in fn ret.
- RET
-
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Unhook the channel from the mailbox.
- ;
- ; Input arguments : None.
- ;
- ; Output arguments: None.
- ;
- ; Globals Used : MESSAGEPIPE:-Address of the channel number.
- ; The cahnnel number passed from syscall (P3(R8))
- ;
- ; Calls To : System service:- $DASSGN
- ;
- ; Called By : Called from ENDRAPPORT section of DISPATCHER.
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
- .ENTRY BRKCOMS,^M<R4,R5>
- MOVL P3(R8),MESSAGEPIPE
- $DASSGN_S CHAN=MESSAGEPIPE
- RET
-
-
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Transfer the parameters from ada record to the
- ; message buffer.
- ; * Communicate with user call lib.
- ; * Transfer the parameters back from the message
- ; buffer into the ada record.
- ;
- ; Input arguments : None.
- ;
- ; Output arguments: None.
- ;
- ; Globals Used : ADDRLIST (used to call sub-procedures but not accessed)
- ;
- ; Calls To : ADATOMSG , RAPCOMS , MSGTOADA
- ;
- ; Called By : Dispatcher parts ( .. )
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
- .ENTRY SIMPLE,^M<R4,R5>
- CALLG ADDRLIST,ADATOMSG ; Move static parameters to message.
- CALLS #0,RAPCOMS ; Talk to user call lib.
- CALLG ADDRLIST,MSGTOADA ; Transfer back static parameters.
- RET
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Transfer static parameters from ada record space
- ; the message buffer.
- ; * Transfer the variable length database record from
- ; ada space to the message buffer.
- ; * Communicate with user call lib.
- ; * Transfer the static parameters back from the
- ; message buffer into the ada record.
- ;
- ; Input arguments : None.
- ;
- ; Output arguments: None.
- ;
- ; Globals Used : ADDRLIST The elements of this tell the procedure where
- ; to find the description of the database record (ENDADA)
- ; and where to put it (ENDMESSAGE).This information is
- ; passed to AtoMREC.
- ;
- ; Calls To : ADATOMSG , ATOMREC , RAPCOMS , MSGTOADA
- ;
- ; Called By : DISPATCHER parts ( .. )
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
- .ENTRY RECWRITE,^M<R4,R5>
- CALLG ADDRLIST,ADATOMSG ; Move static parameters to
- ; message buffer
- CALLG ADDRLIST,ATOMREC ; Move the variable length part
- ; to the message buffer.
- CALLS #0,RAPCOMS ; Talk to user call lib.
- CALLG ADDRLIST,MSGTOADA ; Return the static parameters
- ; back from the message buffer.
- RET
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Transfer the static parameters from the ada
- ; record to the message buffer.
- ; * Communicate with user call lib.
- ; * Transfer the static parameters back from the
- ; message buffer into the ada record.
- ; * Transfer the database record returned by user
- ; call lib from the meesage buffer to the ada
- ; database record.
- ;
- ; Input arguments : None
- ;
- ; Output arguments: None.
- ;
- ; Globals Used : ADDRLIST containing information about where to put the
- ; record (ENDADA) and where to find it (ENDMESSAGE) this
- ; information is passed to MtoAREC.
- ;
- ; Calls To : ADATOMSG , RAPCOMSD , MSGTOADA , MTOAREC
- ;
- ; Called By : DISPATCHER parts ( .. )
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
- .ENTRY RECREAD,^M<R4,R5>
- CALLG ADDRLIST,ADATOMSG ; Transfer the static parameters
- ; to the message buffer.
- CALLS #0,RAPCOMS ; Talk to user call lib.
- CALLG ADDRLIST,MSGTOADA ; Return the static parameters from
- ; the message buffer.
- CALLG ADDRLIST,MTOAREC ; Move the variable length part from
- ; the message buffer to ada space.
- RET
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Move the number of the service call to the first
- ; longword of the message buffer.
- ; * Get the size and start address of the static
- ; parameters and move them to the message buffer.
- ; * Put the address of the end of the static parameters
- ; and the address reached in the message buffer into
- ; thereturn parameters.
- ;
- ; Input arguments : None.
- ;
- ; Output arguments: 1.) The address of the first byte after the static
- ; parameters and also the address of the record
- ; descriptor - if there is one .
- ; 2.)The address in the message buffer after the
- ; static parameters have been transfered.
- ;
- ; Globals Used : TRANSPARAMS as the argument list to call transfer.
- ;
- ; Calls To : TRANSFER.
- ;
- ; Called By : SIMPLE , RECWRITE , RECREAD
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
- .ENTRY ADATOMSG,^M<R4,R5>
- MOVL P1(R8),FROMSTART ; Move the start of the parameter
- ; record to FROMSTART which will be
- ; passed to transfer.
- MOVL P2(R8),SIZE ; Likewise move the size of the
- ; parameter record to SIZE.
- MOVL #MESSAGE,R4 ; Address of the message buffer to r4
- MOVL WHAT(R8),(R4)+ ; Move the number of the service call
- ; to the message buffer.
- MOVL R4,TOSTART ; Move r4 (first free byte in buffer)
- ; to TOSTART.
- CALLG TRANSPARAMS,TRANSFER ; Do the data transfer FROMSTART ->
- ; TOSTART.
- MOVL (AP)+,DUMMY ; Correctly align the argument pointer.
- MOVL ENDFROM,@(AP)+ ; Move ENDFROM and ENDTO to the
- MOVL ENDTO,@(AP)+ ; ouput parameters.
- RET
-
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Move the number of the service call from the message
- ; to align the pointers correctle.
- ; * Get the size and start address of the static
- ; parameters in ada space and move them there from
- ; the message buffer.
- ; * Put the address of the end of the static parameters
- ; and the address reached in the message buffer into
- ; thereturn parameters.
- ;
- ; Input arguments : None.
- ;
- ; Output arguments: 1.) The address of the first byte after the static
- ; parameters and also the address of the record
- ; descriptor - if there is one )
- ; 2.) The address in the message buffer after the
- ; static parameters have been transfered)
- ;
- ; Globals Used : TRANSPARAMS as the argument list to call transfer.
- ;
- ; Calls To : TRANSFER.
- ;
- ; Called By : SIMPLE , RECWRITE , RECREAD
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
- .ENTRY MSGTOADA,^M<R4,R5>
- MOVL P1(R8),TOSTART ; Move the address of the pasrameter
- ; record to TOSTART which is used by
- ; transfer.
- MOVL P2(R8),SIZE ; Likewise with the size of the params.
- MOVL #MESSAGE,R4 ; address of message buffer -> r4
- MOVL WHAT(R8),(R4)+ ; Move the number of the service call
- ; to the message buffer
- MOVL R4,FROMSTART ; Move the address of the place in the
- ; message buffer to get parameters from.
- CALLG TRANSPARAMS,TRANSFER ; Do the data transfer .
- MOVL (AP)+,DUMMY ; Align argument pointer.
- MOVL ENDTO,@(AP)+ ; Move ENDTO and ENDFROM to the
- MOVL ENDFROM,@(AP)+ ; Output parameters.
- RET
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Move the size and start address of the record in
- ; ada store along with the addres in the message
- ; buffer to transfger to to the transfer parameters
- ; * Transfer the record to the message buffer
- ;
- ; Input arguments : 1.) The address of the record description in ada
- ; space.
- ; 2.) The address to transfer to in the message
- ; buffer.
- ;
- ; Output arguments: None.
- ;
- ; Globals Used : The transfer parameters used as argument list for transfer
- ;
- ; Calls To : TRANSFER
- ;
- ; Called By : RECWRITE
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
-
- .ENTRY ATOMREC,^M<R2,R4>
- MOVL (AP)+,DUMMY ; Align argument pointer.
- MOVL @(AP)+,R2 ; Move the start of the record
- ; description to r2.
- MOVL (R2)+,SIZE ; First input p[arameter is the size
- ; of the record to write.
- MOVL (R2)+,FROMSTART ; Secon input is the start address of the
- ; record to write.
- MOVL @(AP)+,TOSTART ; Third is the address to start loading
- ; the message buffer.
- CALLG TRANSPARAMS,TRANSFER ; Do the data transfer.
- RET
-
-
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Move the size and start address of the record in
- ; ada store along with the addres in the message
- ; buffer to transfger from to the transfer parameters
- ; * Transfer the record to the ada record from the
- ; message buffer.
- ;
- ; Input arguments : 1.) The address of the record description in ada
- ; space.
- ; 2.) The address to transfer from in the message
- ; buffer.
- ;
- ; Output arguments: None.
- ;
- ; Globals Used : The transfer parameters used as argument list for transfer
- ;
- ; Calls To : TRANSFER
- ;
- ; Called By : RECREAD
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
- .ENTRY MTOAREC,^M<R2,R4>
- MOVL (AP)+,DUMMY ; Align the argument pointer.
- MOVL @(AP)+,R2 ; Move the address of the record
- ; description to r2.
- MOVL (R2)+,SIZE ; Move the size of the record to SIZE.
- MOVL (R2)+,TOSTART ; The start address of the record is
- ; where we are going to transfer data to.
- MOVL @(AP)+,FROMSTART ; Move the address of the start of the
- ; record in the message buffer.
- CALLG TRANSPARAMS,TRANSFER ; Transdfer the data.
- RET
-
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Transfer the channel number to MESSAGEPIPE.
- ; * Using MESSAGEPIPE as the channel number send a
- ; message to user call lib.
- ; * Receive a reply from user call lib.
- ;
- ; Input arguments : None.
- ;
- ; Output arguments: None.
- ;
- ; Globals Used : P3(R8) is the channel number passed by the syscall function
- ; MESSAGE is the buffer filled.
- ;
- ; Calls To : System services $QIOW
- ;
- ; Called By : SIMPLE , RECREAD , RECWRITE
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
- .ENTRY RAPCOMS,^M<R4,R5>
- CMPL WHAT(R8),#1
- BEQL COM
- MOVW P3(R8),MESSAGEPIPE ; Move the number of the channel
- ; from the function space.
- COM: $QIOW_S FUNC=#IO$_WRITEVBLK,- ; Give the message to user call lib.
- CHAN=MESSAGEPIPE,-
- P1=MESSAGE,-
- P2=#200
- $QIOW_S FUNC=#IO$_READVBLK,- ; Read the replyt from user call lib
- CHAN=MESSAGEPIPE,-
- P1=MESSAGE,-
- P2=#200
- RET
-
-
-
- ;------------------------------------------------------------------------------
- ;
- ; Function : * Move the parameters so that:=-
- ; - R2 = The from start.
- ; - R3 = The to start.
- ; - R4 = The number of words to move.
- ; * Move R4 words from R2 to R3.
- ; * Place the end addresses in the retrun parameters.
- ;
- ; Input arguments : 1.) The from address.
- ; 2.) The size.
- ; 3.) The to address.
- ;
- ; Output arguments: 1.) The end address of the from area.
- ; 2.) The end address of the to area.
- ;
- ; Globals Used : None.
- ;
- ; Calls To : None.
- ;
- ; Called By : ADATOMSG , ATOMREC , MTOAREC
- ;
- ; Author : M.D.DICK (30/1/85) Version 1.0
- ;
- ; Amendments : ( / / )
- ;
- ; Notes :
- ;
- ;------------------------------------------------------------------------------
-
-
-
- .ENTRY TRANSFER,^M<R2,R3,R4>
- MOVL (AP)+,DUMMY ; Align argument pointer.
- MOVL @(AP)+,R2 ; Start
- MOVL @(AP)+,R3 ; Size
- MOVL @(AP)+,R4 ; To
- ADDL2 R2,R4 ; R3=Last Address = Start+Size .
- LOOP: CMPL R2,R4 ; If the From=Last Address Then
- BEQL FINIS ; Finished
- MOVW (R2)+,(R3)+ ; Otherwise transfer a word
- JMP LOOP
- FINIS: MOVL R2,@(AP)+ ; Move the final addresses to the output
- MOVL R3,@(AP)+ ; parameters.
- RET
-
-
-
-
-
- QUIT: MOVL R0,ERRNO(R8) ; Return status
- CLRL R1 ; OK IOresult
- BLBS R0,QUIT2 ; Its even true
- MOVL #BADIO,R1 ; set ROS I/O result
-
- QUIT2: POPR #^M<R2,R3,R4,R5,R6,R7,R8,R9,R10> ; Restore registers
- MOVAL USRDRVRT,R0 ; get ready for NEXTIOQ
- JSB NEXTIOQ ; put task on readyqueue
- BEQL 10$ ; if no more, get out
- BRW USRSTART ; else do next one
- 10$: RSB
-
-
-
-
-
-
- USRCLR:: ;--------- clear code -----------
- MOVL #CANCEL,IORSLTX(R6) ; Report cancelled I/O
- RSB
-
- USRCNTRL:: ;--------- control code ---------
- RSB ; Not implemented
-
- .END
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --R8LIB.TXT
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ------------------------------------------------------------------------
- ------------------------------------------------------------------------
- -- --
- -- This package contains the full set of R8 routines.These act as the --
- -- ADA end of the interface between the high level database access --
- -- routines (FETCH , INSERT , TRANSACT , .. ) and their equivalent --
- -- decompositions in rapport (R0FECH,R0INRT , .. ). --
- -- --
- -- All of the procedures are of the same basic type.This basic --
- -- structure can be defined as follows:- --
- -- --
- -- * A declaration as a record type of the list of --
- -- parameters that need to be passed to the --
- -- equivalent R0 routine.Variable length records are --
- -- expressed in terms of the size (in bytes) and the --
- -- start position in ADA address space.From this --
- -- information the macro message handler can find and --
- -- transfer this message to the message buffer. --
- -- --
- -- * The start address and size of this record is --
- -- record is calculated so that the macro message --
- -- handler can find the parameters. --
- -- --
- -- * The neccesary IN parameters are placed into the --
- -- parameter record. --
- -- --
- -- * The function syscall is called with parameters:- --
- -- 1.)The start addres of the record. --
- -- 2.)The size of the record. --
- -- 3.)The channel number of the mailbox. --
- -- --
- -- * The OUT parameters are copied from the parameter --
- -- record into the actual parameters. --
- -- --
- -- The only exception to this is on StartRapport where R8STAR calls --
- -- syscall with only two parameters ( as there is as yet no channel --
- -- number) and the assigned channel number is determined through the --
- -- return value of the syscall function. --
- -- --
- ------------------------------------------------------------------------
- ------------------------------------------------------------------------
-
-
-
-
-
-
- with vms_call , unchecked_conversion , system ; use vms_call ;
-
- package r8lib is
-
-
-
-
-
- procedure R8STAR ( CheckSum : in long_integer ;
- LastFile : in long_integer ;
- UserTaskNumber : out long_integer ;
- ErrorCode : out long_integer ;
- Channel : out long_integer ) ;
-
-
-
-
-
-
- procedure R8ENDR ( ErrorCode : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
- procedure R8TRAN ( TransactionNumber : out long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
- procedure R8COMT ( ErrorCode : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
- procedure R8BKTK ( ErrorCode : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
- procedure R8INRT ( FileNumber : in long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- ErrorCode : out long_integer ;
- channel : in long_integer ) ;
-
-
-
-
-
-
-
- procedure R8UPDT ( FileNumber : in long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
-
-
- procedure R8STOR ( FileNumber : in long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
-
-
- procedure R8COND ( FileNumber : in long_integer ;
- ConditionNumber : in long_integer ;
- FieldNumber : in long_integer ;
- AnyAllSwitch : in long_integer ;
- SubscriptValue : in long_integer ;
- RelationNumber : in long_integer ;
- ConjunctionNumber : in long_integer ;
- SizeOfRHS : in long_integer ;
- StartOfRHS : in long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
- procedure R8FECH ( FileNumber : in long_integer ;
- CountVariable : in out long_integer ;
- RetrievalStrategy : in out long_integer ;
- NumberOfConditions : in long_integer ;
- Level : in long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
- procedure R8DELT ( FileNumber : in long_integer ;
- CountVariable : in out long_integer ;
- NumberOfConditions : in long_integer ;
- channel : in long_integer ) ;
-
-
-
-
-
-
-
-
- procedure R8STKY ( FileNumber : in long_integer ;
- NumberOfFields : in long_integer ;
- StartOfSortKeyArray : in long_integer ;
- TypeOfRetrieval : in long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
-
- procedure R8HOLD ( FileNumber : in long_integer ;
- NumberOfConditions : in long_integer ;
- NumberOfRecords : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
-
- procedure R8ENRV ( CountVariable : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
-
- procedure R8RTRV ( FileNumber : in long_integer ;
- CountVariable : in out long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
-
- procedure R8CLFI ( FileNumber : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
- procedure R8LOCK ( FileNumber : in long_integer ;
- ReadWriteSwitch : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) ;
-
-
-
-
-
-
- end R8LIB ;
-
-
-
-
-
- package body R8LIB is
-
-
- -- Package specific data used in creation of the parameter record
-
- NumberOfBytesOfRecordDescription : constant integer:=8 ;
-
- NumberOfBitsInAByte : constant integer:=8 ;
-
-
-
-
- -- this takes as input an address and returns a long_integer . Used in
- -- converting the address of a parameter record to understandable
- -- long integer form .
-
- function AddressToLongInteger is new Unchecked_Conversion(System.address ,
- long_integer ) ;
-
-
-
-
-
-
- procedure R8STAR ( CheckSum : in long_integer ;
- LastFile : in long_integer ;
- UserTaskNumber : out long_integer ;
- ErrorCode : out long_integer ;
- Channel : out long_integer ) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : Acts as the user interface to the rapport R0STAR which
- -- starts communication with the rapport nucleus.
- --
- -- Input arguments : CheckSum:- A value introduced by MakePackage as a
- -- check on the ddf of the named file.
- -- LastFile:- A number indicating the last file refrenced
- -- in the DDF .
- --
- -- Output arguments: UserTaskNumber:-A number returned to the task by the
- -- nucleus which uniquely identifies the task
- -- ErrorCode:-Returned as an indicator of the success of
- -- the execution of R0STAR.A value <-1 indicates
- -- indicates that a serious error has been
- -- detected in the execution.
- -- Channel:-The returned channel code to the set-up mailbox
- -- to user call lib.
- --
- -- Globals Accessed: NumberOfBitsInAByte .
- --
- -- Calls to : vms_call.syscall2 , AddressToLongInteger .
- --
- -- Called by : PerFile.StartRapport
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- type StartRapportParameters is
-
- record
-
- ErrorCode : long_integer ;
- CheckSum : long_integer ;
- UserTaskNumber : long_integer ;
- LastFile : long_integer ;
-
- end record ;
-
-
- StartRapportRequest : long_integer:=1 ;
-
- Params : StartRapportParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
-
- begin
-
- -- parameters INTO the record .
-
- Params.CheckSum:=CheckSum ;
- Params.LastFile:=LastFile ;
- ParamsSize:=long_integer(StartRapportParameters'Size/NumberOfBitsInAByte) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
-
- -- transmit to RAPPORT .
-
- Channel:=syscall2(StartRapportRequest , ParamsStart, ParamsSize ) ;
-
- -- parameters OUT OF record .
-
- ErrorCode:=Params.ErrorCode ;
- UserTaskNumber:=Params.UserTaskNumber ;
-
- end ;
-
-
-
-
-
- procedure R8ENDR ( ErrorCode : out long_integer ;
- Channel : in long_integer ) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to the rapport R0ENDR.Cuts off
- -- communication with the connected nucleus.
- --
- -- Input arguments : Channel:-Number of the mail box connecting to user call
- -- lib.
- --
- -- Output arguments: ErrorCode:- Indication as to the success in executing
- -- R0ENDR.An ErrorCode <-1 is an indication
- -- that a serious error has occurred.
- --
- -- Global variables: NumberOfBitsInAByte .
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.EndRapport
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type EndRapportParameters is
-
- record
-
- ErrorCode : long_integer ;
-
- end record ;
-
-
- EndRapportRequest : long_integer:=2 ;
-
- Params : EndRapportParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
-
- begin
-
- -- Parameters INTO the record
-
- ParamsSize:=long_integer(EndRapportParameters'Size/NumberOfBitsInAByte) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
-
- -- transmit to RAPPORT
-
- DummyReturn:=syscall3(EndRapportRequest,ParamsStart,ParamsSize,Channel ) ;
-
- -- parameters OUT OF record
-
- ErrorCode:=Params.ErrorCode ;
-
-
- end ;
-
-
-
-
- procedure R8TRAN ( TransactionNumber : out long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to the rapport R0TRAN.Starts a databse
- -- transaction.
- --
- -- Input arguments : Channel:-The channel number to the mailbox connecting to
- -- user call lib.
- --
- -- Output arguments: TransactionNumber:- An identifier given by the nucleus
- -- to identify the transaction.
- -- ErrorCode:- An indication as to the success of the
- -- execution of R0TRANS.An errorCode < -1
- -- indicates that a serious error has occurred.
- --
- -- Global variables: NumberOfBitsInAByte..
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Transact
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- type TransactionParameters is
-
- record
-
- ErrorCode : long_integer ;
- TransactionNumber : long_integer ;
-
- end record ;
-
-
- TransactionRequest : long_integer:=3 ;
-
- Params : TransactionParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO record .
-
- ParamsSize:=long_integer(TransactionParameters'Size/NumberOfBitsInAByte) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(TransactionRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- TransactionNumber:=Params.TransactionNumber ;
- ErrorCode:=Params.ErrorCode ;
-
- end ;
-
-
-
-
-
-
- procedure R8COMT ( ErrorCode : out long_integer ;
- Channel : in long_integer ) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to the rapport R0COMT.
- --
- -- Input arguments : Channel:-Number of the channel to the mailbox connecting
- -- to user call lib.
- --
- -- Output arguments: ErrorCode:- An indication as to the success of the
- -- execution of R0COMT.Error code < -1
- -- indicates that a serious error has occurred.
- --
- -- Global variables: NumberOfBitsInAByte
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Commit
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- type CommitParameters is
-
- record
-
- ErrorCode : long_integer ;
-
- end record ;
-
-
- CommitRequest : long_integer:=4 ;
-
- Params : CommitParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
-
- begin
-
- -- paramaters INTO record .
-
- ParamsSize:=long_integer(CommitParameters'Size/NumberOfBitsInAByte) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(CommitRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- ErrorCode:=Params.ErrorCode ;
-
- end ;
-
-
-
-
-
-
- procedure R8BKTK ( ErrorCode : out long_integer ;
- Channel : in long_integer ) is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to the rapport R0BKTK.
- --
- -- Input arguments : Channel :-The number of the channel of the mailbox
- -- connecting to user calll ib.
- --
- -- Output arguments: ErrorCode:- An indication as to the success of the
- -- execution of R0BKTK.An error code < -1
- -- indicates that a serious error has occurred.
- --
- -- Global variables: NumberOfBitsInAByte
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Backout
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- type BackoutParameters is
-
- record
-
- ErrorCode : long_integer ;
-
- end record ;
-
-
- BackoutRequest : long_integer:=5 ;
-
- Params : BackoutParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO record .
-
- ParamsSize:=long_integer(BackoutParameters'Size/NumberOfBitsInAByte) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(BackoutRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- ErrorCode:=Params.ErrorCode ;
-
- end ;
-
-
-
-
-
-
-
- procedure R8INRT ( FileNumber : in long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- ErrorCode : out long_integer ;
- channel : in long_integer ) is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to the rapport R0INRT.To insert a record
- -- into a file.
- --
- -- Input arguments : FileNumber:- File number of the file to insert the record
- -- into.
- -- SizeOfRecord:- The size of the record to insert in words.
- -- StartOfRecord:- The address in ADA space of the record.
- -- Channel:-The number of the channel of the mailbox
- -- connecting to the user calll ib.
- --
- -- Output arguments: ErrorCode:- An indication as to the success of the
- -- execution of R0INRT.An error code < -1
- -- indicates thatt a serious error has occurred.
- --
- -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecordDescription .
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Insert
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type InsertParameters is
-
- record
-
- ErrorCode : long_integer ;
- FileNumber : long_integer ;
- SizeOfRecord : long_integer ;
- StartOfRecord : long_integer ;
-
- end record ;
-
-
- InsertRequest : long_integer:=6 ;
-
- Params : InsertParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO the record .
-
- -- notice that the size of the record is modified by the number of
- -- bytes of the record that contain information about the record to
- -- insert . ParamsSize is the size of trhe parameters to be transmitted
- -- to RAPPORT .
-
- ParamsSize:=long_integer((InsertParameters'Size/NumberOfBitsInAByte)
- - NumberOfBytesOfRecordDescription ) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.FileNumber:=FileNumber ;
- Params.SizeOfREcord:=SizeOfRecord ;
- Params.StartOfREcord:=StartOfRecord ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(InsertRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- ErrorCode:=Params.ErrorCode ;
-
- end ;
-
-
-
-
-
-
-
-
- procedure R8UPDT ( FileNumber : in long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to the rapport R0UPDT.To update a record
- -- in a file.
- --
- -- Input arguments : FileNumber:- File number of the file to update the record
- -- into.
- -- SizeOfRecord:- The size of the record to update in words.
- -- StartOfRecord:- The address in ADA space of the record.
- -- Channel:-The channel number of the mailbox connecting
- -- to user call lib.
- --
- -- Output arguments: ErrorCode:- An indication as to the success of the
- -- execution of R0UPDT.An error code < -1
- -- indicates thatt a serious error has occurred.
- --
- -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecorddescription .
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Update
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
- type UpdateParameters is
-
- record
-
- ErrorCode : long_integer ;
- FileNumber : long_integer ;
- SizeOfRecord : long_integer ;
- StartOfRecord : long_integer ;
-
- end record ;
-
-
- UpdateRequest : long_integer:=7 ;
-
- Params : UpdateParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO the record .
-
- -- notice that the size of the record is modified by the number of
- -- bytes of the record that contain information about the record to
- -- insert . ParamsSize is the size of trhe parameters to be transmitted
- -- to RAPPORT .
-
-
- ParamsSize:=long_integer((UpdateParameters'Size/NumberOfBitsInAByte)
- - NumberOfBytesOfRecordDescription ) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.FileNumber:=FileNumber ;
- Params.SizeOfRecord:=SizeOfRecord ;
- Params.StartOfRecord:=StartOfRecord ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(UpdateRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUt OF record .
-
- ErrorCode:=Params.ErrorCode ;
-
-
- end ;
-
-
-
-
-
-
-
- procedure R8STOR ( FileNumber : in long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) is
-
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to the rapport R0STOR.To store a record
- -- in a file.
- --
- -- Input arguments : FileNumber:- File number of the file to store the record
- -- in.
- -- SizeOfRecord:- The size of the record to store in words.
- -- StartOfRecord:- The address in ADA space of the record.
- -- Channel:-The number of the channel of the mailbox
- -- connecting to user call lib.
- --
- -- Output arguments: ErrorCode:- An indication as to the success of the
- -- execution of R0STOR.An error code < -1
- -- indicates thatt a serious error has occurred.
- --
- -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecorddescription .
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Store
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type StoreParameters is
-
- record
-
- ErrorCode : long_integer ;
- FileNumber : long_integer ;
- SizeOfRecord : long_integer ;
- StartOfRecord : long_integer ;
-
- end record ;
-
-
- StoreRequest : long_integer:=8;
-
- Params : StoreParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO the record .
-
- -- notice that the size of the record is modified by the number of
- -- bytes of the record that contain information about the record to
- -- insert . ParamsSize is the size of trhe parameters to be transmitted
- -- to RAPPORT .
-
- ParamsSize:=long_integer((StoreParameters'Size/NumberOfBitsInAByte)
- - NumberOfBytesOfRecordDescription ) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.FileNumber:=FileNumber ;
- Params.SizeOfRecord:=SizeOfRecord ;
- Params.StartOfRecord:=StartOfRecord ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(StoreRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- ErrorCode:=Params.ErrorCode ;
-
-
- end ;
-
-
-
-
-
-
-
- procedure R8COND ( FileNumber : in long_integer ;
- ConditionNumber : in long_integer ;
- FieldNumber : in long_integer ;
- AnyAllSwitch : in long_integer ;
- SubscriptValue : in long_integer ;
- RelationNumber : in long_integer ;
- ConjunctionNumber : in long_integer ;
- SizeOfRHS : in long_integer ;
- StartOfRHS : in long_integer ;
- Channel : in long_integer ) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to the rapport R0COND.To place a condition
- -- on a file that will be used in a subsequent search or
- -- or delete.
- --
- -- Input arguments : Filenumber:- The number of the file that the condition
- -- is on.
- -- ConditionNumber:- The number of this particular call in
- -- the set of calls.
- -- FieldNumber:-The number of the field on the LHS of the
- -- condition.
- -- AnyAllSwitch:- An indication as to the mode of testing
- -- on an array.
- -- i.e ANY element of array > 10
- -- ALL elements of array > 10
- -- SubscriptValue:- If only one element of an array is to
- -- be tested then this indicates which one.
- -- RelationNumber:-The code number of the relation connecting
- -- the left and right hand sides.
- -- i.e. 1 - Equals
- -- -
- -- 6 - Unequal
- -- ConjunctionNumber:-The number of the conjunction
- -- assosciated with the relation.The
- -- number is modified to indicate the
- -- level in the whole condition that the
- -- particular conjuction occurs at.
- -- i.e. 1 - or
- -- 2 - and
- -- Plus an offset of 10 for each level
- -- So a value of 32 => an and conjunction
- -- at the third level.
- -- Channel:-The number of the channel of the mailbox
- -- connecting to user call lib.
- --
- -- Output arguments: None.
- --
- -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecorddescription .
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.TreeWalker
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type ConditionParameters is
-
- record
-
- FileNumber : long_integer ;
- ConditionNumber : long_integer ;
- FieldNumber : long_integer ;
- AnyAllSwitch : long_integer ;
- SubscriptValue : long_integer ;
- RelationNumber : long_integer ;
- ConjunctionNumber : long_integer ;
- SizeOfRHS : long_integer ;
- StartOfRHS : long_integer ;
-
- end record ;
-
-
- ConditionRequest : long_integer:=9;
-
- Params : ConditionParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO the record .
-
- -- notice that the size of the record is modified by the number of
- -- bytes of the record that contain information about the record to
- -- insert . ParamsSize is the size of trhe parameters to be transmitted
- -- to RAPPORT .
-
-
- ParamsSize:=long_integer((ConditionParameters'Size/NumberOfBitsInAByte)
- - NumberOfBytesOfRecordDescription) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.FileNumber:=FileNumber ;
- Params.ConditionNumber:=ConditionNumber ;
- Params.FieldNumber:=FieldNumber ;
- Params.AnyAllSwitch:=AnyAllSwitch ;
- Params.SubscriptValue:=SubscriptValue ;
- Params.RelationNumber:=RelationNumber ;
- Params.ConjunctionNumber:=ConjunctionNumber ;
- Params.SizeOfRHS:=SizeOfRHS ;
- Params.StartOfRHS:=StartOfRHS ;
-
- -- transmit to RAPPORT
-
- DummyReturn:=syscall3(ConditionRequest,ParamsStart,ParamsSize,Channel) ;
-
-
- -- there are no returns .
-
- end ;
-
-
-
-
-
- procedure R8FECH ( FileNumber : in long_integer ;
- CountVariable : in out long_integer ;
- RetrievalStrategy : in out long_integer ;
- NumberOfConditions : in long_integer ;
- Level : in long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- Channel : in long_integer ) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to R0FECH.To fetch a record from the
- -- database.
- --
- -- Input arguments : FileNumber:-The number of the file to fetch the record
- -- from.
- -- CountVariable:-A pointer to the last record fetched.This
- -- is 0 if this is the first call of a set or
- -- a stand alone call.
- -- RetrievalStrategy:-If none is known then this is set to 0.
- -- NumberOfConditions:-The number of conditions on this
- -- particular fetch.
- -- Level:-A rapport search loop stack pointer .
- -- SizeOfRecord:-The size of the record that is to be fetched.
- -- StartOfRecord:-The start address in ada space where the
- -- record is to be put.
- -- Channel:-The number of the channel to the mailbox
- -- connecting to user calll ib.
- --
- -- Output arguments: CountVariable:-A pointer to the record that has just been
- -- fetched.On the next call to fetch (if it is
- -- one of a set in a search) will have the
- -- count variable set to this value.
- -- RetrievalStrategy:-If this was set to 0 on the call then
- -- rapport will have decided upon a search
- -- strategy and set RetrievalSDtrategy to
- -- indicate the choice that has been made.
- --
- -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecordDescription .
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Search
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- type FetchParameters is
-
- record
-
- CountVariable : long_integer ;
- Level : long_integer ;
- FileNumber : long_integer ;
- RetrievalStrategy : long_integer ;
- NumberOfConditions : long_integer ;
- SizeOfRecord : long_integer ;
- StartOfRecord : long_integer ;
-
- end record ;
-
-
- FetchRequest : long_integer:=10;
-
- Params : FetchParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO the record .
-
- -- notice that the size of the record is modified by the number of
- -- bytes of the record that contain information about the record to
- -- insert . ParamsSize is the size of trhe parameters to be transmitted
- -- to RAPPORT .
-
-
- ParamsSize:=long_integer((FetchParameters'Size/NumberOfBitsInAByte)
- - NumberOfBytesOfREcordDescription ) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.Level:=Level ;
- Params.RetrievalStrategy:=RetrievalStrategy ;
- Params.NumberOfConditions:=NumberOfConditions ;
- Params.FileNumber:=FileNumber ;
- Params.CountVariable:=CountVariable ;
- Params.SizeOfRecord:=SizeOfRecord ;
- Params.StartOfRecord:=StartOfRecord ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(FetchRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- CountVariable:=Params.CountVariable ;
- RetrievalStrategy:=Params.RetrievalStrategy ;
-
- end ;
-
-
-
-
-
- procedure R8DELT ( FileNumber : in long_integer ;
- CountVariable : in out long_integer ;
- NumberOfConditions : in long_integer ;
- channel : in long_integer ) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to the rapport R0DELT.To delete records
- -- from the database.
- --
- -- Input arguments : FileNumber:-The file number of the file to delete from.
- -- CountVariable:-Indicates the number of records deleted .
- -- NumberOfConditions:-The number of conditions on the delete
- -- Channel:-The number of the channel to the mailbox
- -- connecting to user call lib.
- --
- -- Output arguments: UserCount (?)
- --
- -- Global variables: NumberOfBitsInAByte.
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Delete
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type DeleteParameters is
-
- record
-
- CountVariable : long_integer ;
- FileNumber : long_integer ;
- NumberOfConditions : long_integer ;
-
- end record ;
-
-
- DeleteRequest : long_integer:=11;
-
- Params : DeleteParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO the record .
-
- -- notice that the size of the record is modified by the number of
- -- bytes of the record that contain information about the record to
- -- insert . ParamsSize is the size of trhe parameters to be transmitted
- -- to RAPPORT .
-
-
- ParamsSize:=long_integer((DeleteParameters'Size/NumberOfBitsInAByte)) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.CountVariable:=CountVariable ;
- Params.NumberOfConditions:=NumberOfConditions ;
- Params.FileNumber:=FileNumber ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(DeleteRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- CountVariable:=Params.CountVariable ;
-
-
- end ;
-
-
-
-
-
-
- procedure R8STKY ( FileNumber : in long_integer ;
- NumberOfFields : in long_integer ;
- StartOfSortKeyArray : in long_integer ;
- TypeOfRetrieval : in long_integer ;
- Channel : in long_integer ) is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to R0STKY.To indicate to rapport the
- -- ordering that is desired on a search.
- --
- -- Input arguments : FileNumber:-The number of the file onto which to impose
- -- the ordering.
- -- NumberOfFields -This is the number of fields in the sort
- -- key array.From this the size in words of
- -- the array can be calculated.
- -- StartOfSortKeyArray:-The start address in ada space of the
- -- sort key array.
- -- TypeOfRetrieval:- 0 => Normal
- -- 1 => Order Unique
- -- Channel:-The number of the channel to the mailbox
- -- connecting to user call lib.
- --
- -- Output arguments: None .
- --
- -- Global variables: NumberOfBitsInAByte.
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.OrderingTreeWalker
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type StoreKeyParameters is
-
- record
-
- FileNumber : long_integer ;
- TypeOfRetrieval: long_integer ;
- NumberOfFields : long_integer ;
- SizeOfArray : long_integer ;
- StartOfSortKeyArray : long_integer ;
-
- end record ;
-
-
- StoreKeyRequest : long_integer:=13;
-
- Params : StoreKeyParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
- NumberOfBytesPerArrayElement : constant long_integer:=8 ;
-
-
- begin
-
- -- parameters INTO record
-
- -- note that the size of the record is modified by the number of bytes
- -- required to hold the description of the sort keys as size indicates
- -- the size of the parameters to be transmitted to RAPPORT .
-
-
- ParamsSize:=long_integer((StoreKeyParameters'Size/NumberOfBitsInAByte)
- - NumberOfBytesOfRecordDescription) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.FileNumber:=FileNumber ;
- Params.TypeOfRetrieval:=TypeOfRetrieval ;
- Params.NumberOfFields:=NumberOfFields ;
- Params.SizeOfArray:=NumberOfFields*NumberOfBytesPerArrayElement ;
- Params.StartOfSortKeyArray:=StartOfSortKeyArray ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(StoreKeyRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- there is no return from RAPPORT .
-
-
- end ;
-
-
-
-
-
- procedure R8HOLD ( FileNumber : in long_integer ;
- NumberOfConditions : in long_integer ;
- NumberOfRecords : out long_integer ;
- Channel : in long_integer ) is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to R0HOLD . Performs the ordered copy of
- -- the file .
- --
- -- Input arguments : FileNumber:-The number of the file to sort.
- -- NumberOfConditions:-The number of conditons on the file.
- -- Channel:-The number of the channel to the mailbox
- -- connecting to user call lib.
- --
- -- Output arguments: NumberOfRecords:-The number of records in the sort.
- --
- -- Global variables: NumberOfBitsInAByte.
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Set_Ordered
- -- PerFile.Set_Unique
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type HoldParameters is
-
- record
-
- FileNumber : long_integer ;
- NumberOfConditions : long_integer ;
- NumberOfRecords : long_integer ;
-
- end record ;
-
-
- HoldRequest : long_integer:=14;
-
- Params : HoldParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO record .
-
- ParamsSize:=long_integer(HoldParameters'Size/NumberOfBitsInAByte) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.FileNumber:=FileNumber ;
- Params.NumberOfConditions:=NumberOfConditions ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(HoldRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- NumberOfRecords:=Params.NumberOfRecords ;
-
-
- end ;
-
-
-
-
-
- procedure R8ENRV ( CountVariable : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to R0ENRV.Used to end an ordered search.
- --
- -- Input arguments : CountVariable:-Pointer to the last record accessed.
- -- Channel:-Number of the channel to the mailbox connecting
- -- to user call lib.
- --
- -- Output arguments: ErrorCode:-An indication as to the success of R0ENRV.
- -- A value < -1 indicates a serious error.
- --
- -- Global variables: NumberOfBitsInAByte
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Clear_Selector
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type EndRetrieveParameters is
-
- record
-
- ErrorCode : long_integer ;
- CountVariable : long_integer ;
-
- end record ;
-
-
- EndRetrieveRequest : long_integer:=15;
-
- Params : EndRetrieveParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO record .
-
- ParamsSize:=long_integer(EndRetrieveParameters'Size/NumberOfBitsInAByte) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.CountVariable:=CountVariable ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(EndRetrieveRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- ErrorCode:=Params.ErrorCode ;
-
- end ;
-
-
-
-
-
-
-
- procedure R8RTRV ( FileNumber : in long_integer ;
- CountVariable : in out long_integer ;
- SizeOfRecord : in long_integer ;
- StartOfRecord : in long_integer ;
- Channel : in long_integer ) is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to R0RTRV.Fetches a record for an ordered
- -- search.
- --
- -- Input arguments : CountVariable:-Indicates the last record accessed.
- -- SizeOfRecord:-The size of the record that is to be got.
- -- StartOfRecord:-The start address in ada space to put
- -- the got record.
- -- Channel:-The number of the channel to the mailbox
- -- connecting to user calll ib.
- --
- -- Output arguments: CountVariable:-Indicates the record that has just been
- -- retrieved.In the next call to R8RTRV in
- -- this particular set wilkl have this value
- -- as a pointer to the last record accessed.
- --
- -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRcordDescription .
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Searc
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type RetrieveParameters is
-
- record
-
- CountVariable : long_integer ;
- FileNumber : long_integer ;
- SizeOfRecord : long_integer ;
- StartOfRecord : long_integer ;
-
- end record ;
-
-
-
- RetrieveRequest : long_integer:=17;
-
- Params : RetrieveParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
-
- -- parameters into record .
-
- -- note that the size is modified by the number of bytes needed to
- -- hold the description of the record . This is as the size is the
- -- size of the parameters to be transmitted to RAPPORT .
-
-
- ParamsSize:=long_integer((RetrieveParameters'Size/NumberOfBitsInAByte)
- - NumberOfBytesOfRecordDescription) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.CountVariable:=CountVariable ;
- Params.FileNumber := FileNumber ;
- Params.StartOfRecord:=StartOfREcord ;
- Params.SizeOfREcord:=SizeOfREcord ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(RetrieveRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- CountVariable := Params.CountVariable ;
-
- end ;
-
-
-
-
-
- procedure R8CLFI ( FileNumber : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to R0CLFI.To clear a specified file.
- --
- -- Input arguments : FileNumber:-Number of the file to clear.
- -- Channel:-The number of the channel to the mailbox
- -- connecting to user calll ib.
- --
- -- Output arguments: ErrorCode:-Indicator as to the success of the execution
- -- of R0CLFI.An Error code < -1 indicates that
- -- a serious error has occvurred.
- --
- -- Global variables: NumberOfBitsInAByte.
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Clear
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type ClearFileParameters is
-
- record
-
- ErrorCode : long_integer ;
- FileNumber : long_integer ;
-
- end record ;
-
-
- ClearFileRequest : long_integer:=18;
-
- Params : ClearFileParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO record .
-
- ParamsSize:=long_integer(ClearFileParameters'Size/NumberOfBitsInAByte) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.FileNumber:=FileNumber ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(ClearFileRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- ErrorCode:=Params.ErrorCode ;
-
- end ;
-
-
-
-
-
-
-
- procedure R8LOCK ( FileNumber : in long_integer ;
- ReadWriteSwitch : in long_integer ;
- ErrorCode : out long_integer ;
- Channel : in long_integer ) is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : User interface to R0LOCK.To lock a particular file.
- --
- -- Input arguments : FileNumber:-The number of the file to lock.
- -- ReadWriteSwitch:-An indicator as tio the type of lock
- -- required on the file.
- -- Channel:-The number of the channel to the mailbox
- -- connecting to user calll lib.
- --
- -- Output arguments: ErrorCode:-Indicatiopn as to the success of R0LOCK.An
- -- Error code < -1 indicates a serious error.
- --
- -- Global variables: NumberOfBitsInAByte.
- --
- -- Calls to : vms_call.syscall3
- --
- -- Called by : PerFile.Lock
- --
- -- Author : M.D.DICK (28/1/85) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- type LockParameters is
-
- record
-
- ErrorCode : long_integer ;
- FileNumber : long_integer ;
- ReadWriteSwitch : long_integer ;
-
- end record ;
-
-
- LockRequest : long_integer:=19;
-
- Params : LockParameters ;
-
- ParamsSize : long_integer ;
-
- ParamsStart : long_integer ;
-
- DummyReturn : long_integer ;
-
-
- begin
-
- -- parameters INTO the record .
-
- ParamsSize:=long_integer(LockParameters'Size/NumberOfBitsInAByte) ;
- ParamsStart:=AddressToLongInteger(Params'Address) ;
- Params.FileNumber:=FileNumber ;
- Params.ReadWriteSwitch:=ReadWriteSwitch ;
-
- -- transmit to RAPPORT .
-
- DummyReturn:=syscall3(LockRequest,ParamsStart,ParamsSize,Channel) ;
-
- -- parameters OUT OF record .
-
- ErrorCode:=Params.ErrorCode ;
-
-
- end ;
-
-
-
-
-
-
-
- end R8LIB ;
-
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --PERDDF.TXT
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ----------------------------------------------------------------------------
- -- --
- -- This package is a set of procedures suitable for use on any file . It --
- -- contains these procedures and also the set of global data neccesary --
- -- for an activation of RAPPORT . A new package is required for every --
- -- DDF accessed as different CHECKSUMS and LAST_FILES will be in --
- -- operation . --
- -- --
- -- To instantiate for each seperate ddf :- --
- -- --
- -- Replace %1 with the value of the CheckSum determined by --
- -- RCP'ing a dummy fortran program . --
- -- Replace %2 with the value of the last file determoined as --
- -- worst . --
- -- Replace %3 with the name of the ddf --
- -- --
- -- --
- -- Exit finally as %3.txt . --
- -- --
- ----------------------------------------------------------------------------
-
-
-
- WITH TEXT_IO , R8LIB ; USE TEXT_IO , R8LIB ;
- with unchecked_conversion , system ;
- package %3 is
-
-
- RAPPORT_ERROR : exception;
-
- type GENERAL_ELEMENT is (ANY_ELEMENT,ALL_ELEMENTS);
-
- type LOCKING_MODE is (READ, WRITE);
-
-
- -- Non-generic rapport access procedures .
-
- procedure RAPPORT_STATUS(ERROR_NO : out LONG_INTEGER;
- TASK_NO : out LONG_INTEGER;
- TRANS_NO : out LONG_INTEGER);
-
- procedure STARTRAPPORT;
-
- procedure ENDRAPPORT;
-
- procedure TRANSACT;
-
- procedure COMMIT;
-
- procedure BACKOUT;
-
- procedure BAILOUT;
-
-
-
-
-
-
- -- Generic data dependant on the ddf assosciated with this package .
-
- CHECKSUM : constant LONG_INTEGER := %1 ;
- LAST_FILE : constant LONG_INTEGER := %2 ;
-
- -- Non-generic global data required by a rapport application .
-
- RAPPORT_STARTED : BOOLEAN;
- TASK_NUMBER : LONG_INTEGER;
- MAILBOX : LONG_INTEGER;
- TRANSACTION : LONG_INTEGER;
- ERROR_CODE : LONG_INTEGER;
-
- LOCKNUMBER : constant array (LOCKING_MODE) of LONG_INTEGER :=
- (1, 2);
-
-
- -- Information must be kept as to the current and the currently active
- -- search loops and their assosciated types . A search loop can be
- -- normal ordered or unique.There can be a maximum of 26 active search
- -- loops.
-
- type SELECTION is (NORMAL , ORDERED , UNIQUE) ;
-
- MAX_STACK_SIZE : constant integer:=26 ;
-
- SELECTOR_STACK : array(1..MAX_STACK_SIZE) of SELECTION ;
-
- CURRENT_LEVEL : integer :=1 ;
-
-
-
- -- The file dependant procedured require a function to convert between an
- -- address and long_integer format .
-
- function AddressToLongInteger is new Unchecked_Conversion(System.address,
- long_integer ) ;
-
-
- end ;
-
-
-
- package body %3 is
-
-
-
-
-
-
- procedure RAPPORT_STATUS(ERROR_NO : out LONG_INTEGER;
- TASK_NO : out LONG_INTEGER;
- TRANS_NO : out LONG_INTEGER) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : To return the current status.Can be used on a RAPPORT
- -- exception to discover the error_code and the other
- -- status information
- --
- -- Input arguments : None .
- --
- -- Output arguments: Error_No : The current error number 0 => no error .
- -- Task_no : The number assigned by the nucleus to this
- -- task
- -- Trans_No : If we are in a transaction set then this
- -- is the number assigned to the transaction
- -- by the nucleus .
- --
- -- Global variables: ERROR_CODE , TASK_NUMBER , TRANSACTION_NUMBER
- --
- -- Calls to : None.
- --
- -- Called by : ADA Application programs .
- --
- -- Author : RP ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- begin
-
- ERROR_NO := ERROR_CODE;
- TASK_NO := TASK_NUMBER;
- TRANS_NO := TRANSACTION;
-
- end;
-
-
-
-
-
- procedure STARTRAPPORT is
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure establishes a connection between an ADA
- -- application program and the RAPPORT nucleus.
- --
- -- Input arguments : None .
- --
- -- Output arguments: None .
- --
- -- Global variables: ERROR_CODE , TASK_NUMBER , CHECKSUM , LAST_FILE , MAILBOX
- -- RAPPORT_STARTED.
- --
- -- Calls to : R8LIB.R8STAR .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING STARTRAPPORT") ; new_line ;
-
- if RAPPORT_STARTED then
-
- ERROR_CODE := -103;
- raise RAPPORT_ERROR;
-
- else
-
- ERROR_CODE := 0;
- R8STAR(CHECKSUM, LAST_FILE, TASK_NUMBER, ERROR_CODE, MAILBOX);
-
- if ERROR_CODE < -1 then
- raise RAPPORT_ERROR;
- else
- RAPPORT_STARTED := TRUE;
- end if;
-
- end if;
-
- -- put("%ADALIB-TRACEMSG-LEAVING STARTRAPPORT") ; new_line ;
-
- end;
-
-
-
-
-
- procedure ENDRAPPORT is
-
- -------------------------------------------------------------------------------
- --
- -- Function : To stop the current intercation with the RAPPORT nucleus
- --
- -- Input arguments : None.
- --
- -- Output arguments: None.
- --
- -- Global variables: ERROR_CODE , MAILBOX , RAPPORT_STARTED .
- --
- -- Calls to : R8LIB.R8ENDR
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING ENDRAPPORT") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- ERROR_CODE:=0 ;
-
- R8ENDR ( ERROR_CODE , MAILBOX ) ;
-
- RAPPORT_STARTED := FALSE ;
-
- if ERROR_CODE < -1 then
- raise RAPPORT_ERROR ;
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING ENDRAPPORT") ; NEW_LINE ;
-
- end;
-
-
- procedure TRANSACT is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To start a transaction set .
- --
- -- Input arguments : None .
- --
- -- Output arguments: None .
- --
- -- Global variables: ERROR_CODE , MAILBOX , TRANSACTION_NUMBER .
- --
- -- Calls to : R8LIB.R8TRAN .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE TRANSACT") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- ERROR_CODE:=0 ;
-
- R8TRAN ( TRANSACTION , ERROR_CODE , MAILBOX ) ;
-
- if ERROR_CODE < -1 then
- raise RAPPORT_ERROR ;
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE TRANSACT") ; NEW_LINE ;
-
- end;
-
-
-
-
-
-
-
- procedure COMMIT is
-
- -------------------------------------------------------------------------------
- --
- -- Function : To commit the transaction set marked by the transact
- -- command to the database .
- --
- -- Input arguments : None.
- --
- -- Output arguments: None.
- --
- -- Global variables: ERROR_CODE , MAILBOX .
- --
- -- Calls to : R8LIB.R8COMT .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENETERINT PROCEDURE TRACE") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- ERROR_CODE:=0 ;
-
- R8COMT ( ERROR_CODE , MAILBOX ) ;
-
- if ERROR_CODE < -1 then
- raise RAPPORT_ERROR ;
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE COMMIT") ; NEW_LINE ;
-
- end;
-
-
-
-
-
-
- procedure BACKOUT is
-
- -------------------------------------------------------------------------------
- --
- -- Function : To backout of a transaction set marked by the command
- -- TRANSACT .
- --
- -- Input arguments : None.
- --
- -- Output arguments: None.
- --
- -- Global variables: ERROR_CODE , MAILBOX .
- --
- -- Calls to : R8LIB.BKTK
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE BACKOUT") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- ERROR_CODE:=0 ;
-
- R8BKTK ( ERROR_CODE , MAILBOX ) ;
-
- if ERROR_CODE < -1 then
- raise RAPPORT_ERROR ;
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE BNACKOUT") ; NEW_LINE ;
-
- end;
-
-
-
-
- procedure BAILOUT is
-
- -------------------------------------------------------------------------------
- --
- -- Function : On receipt of a rapport_error , if rapport is started to
- -- perform an endrapport . If an error is discovered then no
- -- statement is executed as a loop situation could develop .
- --
- -- Input arguments : None.
- --
- -- Output arguments: None.
- --
- -- Global variables: None .
- --
- -- Calls to : EndRapport .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- begin
-
- ENDRAPPORT;
-
- exception
- when RAPPORT_ERROR =>
- null;
- end;
-
-
-
- begin
-
- -- The following code is activated at the start of an application program
- -- and sets the global variables to their intial values .
-
-
- RAPPORT_STARTED := FALSE;
- TASK_NUMBER := 0;
- MAILBOX := 0;
- TRANSACTION := 0;
- ERROR_CODE := 0;
-
- end;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --PERFILE.TXT
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ------------------------------------------------------------------------
- ------------------------------------------------------------------------
- -- --
- -- This is a pseudo generic package suitable for hand instantiation --
- -- for the package for each database file.To instantiate :- --
- -- --
- -- Replace %1 with a complete set of type declarations --
- -- for every field in the file including in --
- -- the case of array fields a type definition --
- -- for the base element of the array. --
- -- note that field type renaming base type --
- -- must be specified as subtypes :- --
- -- --
- -- subtype FIELD_TYPE is FLOAT ; --
- -- --
- -- Replace %2 with the components of the record --
- -- description for the file.This will consist --
- -- of a set of elements of the form :- --
- -- --
- -- FIELD_NAME : FIELD_TYPE ; --
- -- --
- -- Replace %3 with the number of the file . --
- -- --
- -- Replace %4 with the name of the file . --
- -- --
- -- Replace %5 with the name of the ddf package . --
- -- --
- -- --
- -- Finally exit the edit by "EXIT %4.txt" . --
- -- --
- ------------------------------------------------------------------------
- ------------------------------------------------------------------------
-
-
-
-
- WITH TEXT_IO , R8LIB , %5 ; USE TEXT_IO , R8LIB , %5 ;
- with unchecked_conversion , system ;
- package %4 is
-
- procedure CLEAR ;
-
- procedure LOCK( LOCK : LOCKING_MODE );
-
-
- %1
-
-
- type DB_RECORD is
-
- record
-
- %2
-
- end record ;
-
-
- type CONDITION_BLOCK;
- type CONDITION_TREE is access CONDITION_BLOCK;
-
-
- type TreeBlock is ( Conjunction , Condition ) ;
-
- type RHSParametersRecord is
-
- record
-
- ConditionNumber : long_integer ;
- FieldNumber : long_integer ;
- AnyAllSwitch : long_integer ;
- ArraySubscript : long_integer ;
- SizeOfRightHandSide : long_integer ;
- StartOfRightHandSide : long_integer ;
-
- end record ;
-
-
-
- type CONDITION_BLOCK is
-
- record
-
- BlockType : TreeBlock ;
-
- ConjunctionNumber : long_integer ;
- LeftPartOfConjunction : CONDITION_TREE ;
- RightPartOfConjunction : CONDITION_TREE ;
-
- RHSParameters : RHSParametersRecord ;
-
- end record ;
-
-
-
-
- type SELECTOR is
-
- record
-
- CountVariable : long_integer ;
- RetrievalStrategy : long_integer ;
- Level : integer ;
- Conditions : CONDITION_TREE ;
-
- end record;
-
-
- type ORDER_BLOCK;
- type ORDERING_TREE is access ORDER_BLOCK;
-
- type ORDER_BLOCK_TYPE is ( NODE , LEAF ) ;
-
- type ORDER_BLOCK is
-
- record
-
- BlockType : ORDER_BLOCK_TYPE ;
-
- LeftPart : ORDERING_TREE ;
- RightPart : ORDERING_TREE ;
-
- OrderingInformation : long_integer ;
-
- end record;
-
-
- MAX_NUMBER_OF_ORDER_FIELDS : constant integer := 10 ;
-
- type ORDERING_ARRAY is array(1..MAX_NUMBER_OF_ORDER_FIELDS) of long_integer ;
-
-
-
-
-
-
- procedure INSERT(REC : DB_RECORD);
-
- procedure UPDATE(REC : DB_RECORD);
-
- procedure STORE(REC : DB_RECORD);
-
-
-
- procedure FETCH(REC : out DB_RECORD;
- EXISTS : out BOOLEAN;
- CONDITIONS : CONDITION_TREE);
-
-
-
- procedure DELETE(NUMBER : out integer ;
- CONDITIONS : CONDITION_TREE);
-
-
-
- procedure SET_SELECTOR(SELECTION : out SELECTOR);
-
- procedure SET_SELECTOR(SELECTION : out SELECTOR;
- CONDITIONS : CONDITION_TREE);
-
- procedure SET_ORDERED(SELECTION : out SELECTOR;
- ORDERING : ORDERING_TREE);
-
- procedure SET_ORDERED(SELECTION : out SELECTOR;
- ORDERING : ORDERING_TREE;
- CONDITIONS : CONDITION_TREE);
-
- procedure SET_UNIQUE(SELECTION : out SELECTOR;
- ORDERING : ORDERING_TREE);
-
- procedure SET_UNIQUE(SELECTION : out SELECTOR;
- ORDERING : ORDERING_TREE;
- CONDITIONS : CONDITION_TREE);
-
-
-
- procedure SEARCH(SELECTION : in out SELECTOR;
- REC : out DB_RECORD;
- END_OF_SEARCH : out BOOLEAN);
-
-
-
- procedure CLEAR_SELECTOR(SELECTION : in out SELECTOR);
-
-
-
-
- function "and" ( LeftPart , RightPart : CONDITION_TREE )
-
- return CONDITION_TREE ;
-
-
- function "or" ( LeftPart , RightPart : CONDITION_TREE )
-
- return CONDITION_TREE ;
-
-
-
-
- function "&" ( LeftPart , RightPart : ORDERING_TREE )
-
- return ORDERING_TREE ;
-
-
-
-
-
-
-
- end;
-
-
-
-
-
-
-
- package body %4 is
-
-
- FileNumber : constant long_integer := %3 ;
-
- NumberOfBitsInAByte : constant integer :=8 ;
-
-
-
-
-
-
-
- procedure OrderingTreeWalker ( OrderTree : in ORDERING_TREE ;
- OrderList : out ORDERING_ARRAY ;
- NumberOfFields : out integer ) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure traverses the ordering tree of the form
- --
- -- node
- -- / \
- -- info node
- -- / \
- --
- -- produced by the functions "&" and up & down and produces
- -- as a result an array of ordering information .
- --
- --
- -- Input arguments : OrderTree : A pointer to an order tree of the form
- -- shown above .
- --
- --
- -- Output arguments: OrderList : An array representation of the order tree.
- -- NumberInList : The number of fields in the order.
- --
- -- Global variables: None.
- --
- -- Calls to : WalkTree a nested sub-procedure.
- --
- -- Called by : set_ordered .
- --
- -- Author : MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- -- This is an inner procedure to the ordering tree walker . It
- -- recursively walks the ordering tree by :-
- -- LeftTree , Leaf , RightTree .
-
- procedure WalkTree ( Tree : in ORDERING_TREE ;
- CurrentNumber : in out integer ) is
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE WALK TREE" ) ; NEW_LINE ;
-
- if Tree.BlockType = LEAF
-
- then CurrentNumber := CurrentNumber+1 ;
- OrderList(CurrentNumber) := Tree.OrderingInformation ;
-
- else WalkTree ( Tree.LeftPart , CurrentNumber ) ;
- WalkTree ( Tree.RightPart , CurrentNumber ) ;
-
- end if ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE WALK TREE") ; NEW_LINE ;
-
- end WalkTree ;
-
-
-
-
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE ORDERING TREE WALKER") ;
- NEW_LINE ;
-
-
- NumberOfFields := 0 ;
-
- if OrderTree /= null
- then WalkTree ( OrderTree , NumberOfFields);
- end if ;
-
- -- put("%ADALIB-TTRACEMSG-LEAVING PROCEDURE ORDERING TREE WALKER") ;
- NEW_LINE ;
-
- end OrderingTreeWalker ;
-
-
-
-
-
-
- procedure ConditionTreeWalker ( ConditionTree : in CONDITION_TREE ;
- NumberOfConditions : out long_integer ) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure walks over an inputed Condition tree
- -- producing a number of calls to r8cond one for each
- -- condition.
- -- The actual mechanics of the traversal are very difficult
- -- to explain . It is best to work through an example.
- --
- -- Input arguments : ConditionTree : A pointer to a condition tree.
- --
- -- Output arguments: NumberOfConditions : The number of conditions found.
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber .
- --
- -- Calls to : R8LIB.R8COND , UnfoldConditionTree a nested sub-procedure
- --
- -- Called by : set_ordered , search
- --
- -- Author : MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- ReturnedParametersOut : RHSParametersRecord ;
- LevelInTheConditionTree : long_integer :=0 ;
- NumberOfCurrentConditionInSet : long_integer := 0 ;
- NoConjunction : long_integer := 0 ;
-
-
-
-
- procedure UnfoldConditionTree ( ConditionTreePointer :
- in CONDITION_TREE ;
- LevelInTheTree : in long_integer ;
- FoundParameters : out RHSParametersRecord ) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : To recursively walk the condition tree.
- --
- -- Input arguments : ConditoionTreePointer : a pointer to a condition tree.
- -- Level : the current level reached in the condition tree
- --
- -- Output arguments: FoundParameters : the parameter set located at the bottom
- -- of the tree.
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber .
- --
- -- Calls to : Itself .
- --
- -- Called by : Itself , ConditionTreeWalker .
- --
- -- Author : MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- NewLevelInTheConditionTree : long_integer ;
- ThisConjunction : long_integer ;
- ReturnedParameters : RHSParametersRecord ;
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING UNFOOLD PART OF WALKER") ; NEW_LINE ;
-
- if ConditionTreePointer.BlockType = Condition
-
- -- We have recursed to the bottom of the tree and so the found
- -- parameters are returned.
-
- then FoundParameters := ConditionTreePointer.RHSParameters ;
-
- -- Else the bottom has not been reached
-
- else
- -- We are going down one more level so adjust the level.
-
- NewLevelInTheConditionTree := LevelInTheTree + 10 ;
-
-
- -- Recurse down the left hand side of the tree .
-
- UnfoldConditionTree ( ConditionTreePointer.LeftPartOfConjunction ,
- NewLevelInTheConditionTree ,
- ReturnedParameters ) ;
-
-
- -- We have returned with a set of parameters located at the
- -- bottom of the tree so we must do an r8cond on them .
-
-
- -- Adjust the conjunction number to reflect the level in the tree
-
- ThisConjunction := ConditionTreePointer.ConjunctionNumber +
- LevelInTheTree ;
-
- NumberOfCurrentConditionInSet :=
- NumberOfCurrentConditionInset + 1 ;
-
- R8COND ( FileNumber , NumberOfCurrentConditionInSet ,
- ReturnedParameters.FieldNumber ,
- ReturnedParameters.AnyAllSwitch ,
- ReturnedParameters.ArraySubscript ,
- ReturnedParameters.ConditionNumber ,
- ThisConjunction ,
- ReturnedParameters.SizeOfRightHandSide ,
- ReturnedParameters.StartOfRightHandSide ,
- MAILBOX ) ;
-
-
-
- -- Recurse on down the right hand side of the tree.
-
- UnfoldConditionTree ( ConditionTreePointer.RightPartOfConjunction ,
- NewLevelInTheConditionTree ,
- FoundParameters ) ;
-
-
- end if ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING UNFOLD PART OF TREE WALKER") ; NEW_LINE ;
-
- end UnfoldConditionTree ;
-
-
-
- begin
-
-
- -- PUT("%ADALIB-TRACEMSG-ENETRING PROCEUDRE TREE WALKER") ; NEW_LINE ;
-
- if ConditionTree /= null
-
-
- then UnfoldConditionTree ( ConditionTree ,
- LevelInTheConditionTree ,
- ReturnedParametersOut ) ;
-
- NumberOfCurrentConditionInSet :=
- NumberOfCurrentConditionInset + 1 ;
-
-
-
- -- The found parameters have no condition on their right side
- -- as they represent the last condition so the conjunction is 0 .
-
- R8COND ( FileNumber , NumberOfCurrentConditionInSet ,
- ReturnedParametersOut.FieldNumber ,
- ReturnedParametersOut.AnyAllSwitch ,
- ReturnedParametersOut.ArraySubscript ,
- ReturnedParametersOut.ConditionNumber ,
- NoConjunction ,
- ReturnedParametersOut.SizeOfRightHandSide ,
- ReturnedParametersOut.StartOfRightHandSide ,
- MAILBOX ) ;
-
-
-
- NumberOfConditions := NumberOfCurrentConditionInSet ;
-
- else NumberOfConditions := 0 ;
-
- end if ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE TREE WALKER") ; NEW_LINE ;
-
- end ConditionTreeWalker ;
-
-
-
-
-
-
- procedure CLEAR is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure clears the file that the package has been
- -- instantiated for .
- --
- -- Input arguments : None .
- --
- -- Output arguments: None .
- --
- -- Global variables: FileNumber , RAPPORT.MAILBOX , RAPPORT.ERROR_CODE .
- --
- -- Calls to : R8LIB.R8CLFI
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE CLEAR") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- ERROR_CODE:=0 ;
-
- R8CLFI ( FileNumber , ERROR_CODE , MAILBOX ) ;
-
- if ERROR_CODE < -1 then
- raise RAPPORT_ERROR ;
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
-
- end if ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE CLEARFILE") ; NEW_LINE ;
-
- end CLEAR ;
-
-
-
-
-
- procedure LOCK(LOCK : LOCKING_MODE) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure locks the file for either read or write
- -- access for the user.
- --
- -- Input arguments : LOCK : An indication of the lock to be applied(read or
- -- write)
- --
- -- Output arguments: None.
- --
- -- Global variables: RAPPORT.ERROR_CODE , RAPPORT.MAILBOX , FileNumber ,
- -- LOCKNUMBER .
- --
- -- Calls to : R8LIB.R8LOCK
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- ReadWriteSwitch : long_integer ;
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE LOCK") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- ReadWriteSwitch := LOCKNUMBER ( LOCK ) ;
-
- ERROR_CODE := 0 ;
-
- R8LOCK ( FileNumber , ReadWriteSwitch , ERROR_CODE , MAILBOX ) ;
-
- if ERROR_CODE < -1 then
- raise RAPPORT_ERROR ;
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE LOCK") ; NEW_LINE ;
-
-
- end LOCK ;
-
-
-
-
-
- procedure INSERT(REC : DB_RECORD) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure inserts a record into the file.An error
- -- is returned if a record with the same prime key is
- -- already present.
- --
- -- Input arguments : REC : The record to insert .
- --
- -- Output arguments: None .
- --
- -- Global variables: FileNumber , RAPPORT.MAILBOX , RAPPORT.ERROR_CODE .
- --
- -- Calls to : R8LIB.R8INRT , RAPPORT.AddressToLongInteger .
- --
- -- Called by : ADA Application program
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- SizeOfRecord : long_integer ;
- StartOfRecord : long_integer ;
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE INSERT") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- -- Note that 'size returns bits and we require bytes
-
- SizeOfRecord := long_integer( DB_RECORD'size/NumberOfBitsInAByte) ;
- StartOfRecord := AddressToLongInteger ( REC'Address ) ;
-
- ERROR_CODE := 0 ;
-
- R8INRT ( FileNumber , SizeOfRecord , StartOfRecord , ERROR_CODE ,
- MAILBOX ) ;
-
-
- -- A return of -7 indicates that the file is 90% full
-
- if ERROR_CODE = -7
- then put(" <<RAPPORT WARNING>>") ; new_line ; new_line ;
- put(" < File number ") ;
- system.put(integer(FileNumber)) ;
- put(" is greater than 90% full>") ;
- new_line ; new_line ;
- end if ;
-
-
-
- if ( ERROR_CODE < -1 ) and ( ERROR_CODE /= -7 )then
- raise RAPPORT_ERROR ;
- end if ;
-
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE INSERT") ; NEW_LINE ;
-
-
- end INSERT;
-
-
-
-
-
-
- procedure UPDATE(REC : DB_RECORD) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : To update the record in the file.
- --
- -- Input arguments : REC : The record to update .
- --
- -- Output arguments: None .
- --
- -- Global variables: FileNumber , RAPPORT.ERROR_CODE , RAPPORT.MAILBOX .
- --
- -- Calls to : R8LIB.R8UPDT , RAPPORT.AddressToLongInteger .
- --
- -- Called by : ADA Application program
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
-
- SizeOfRecord : long_integer ;
-
- StartOfRecord : long_integer ;
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE UPDATE") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- -- Note that 'size returns bits and we require bytes.
-
- SizeOfRecord := long_integer ( DB_RECORD'size/NumberOfBitsInAByte ) ;
- StartOfRecord := AddressToLongInteger ( REC'address ) ;
-
- ERROR_CODE := 0 ;
-
- R8UPDT ( FileNumber , SizeOfRecord , StartOfRecord ,
- ERROR_CODE , MAILBOX ) ;
-
- if ERROR_CODE < -1 then
- raise RAPPORT_ERROR ;
- end if ;
-
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE UPDATE") ; NEW_LINE ;
-
-
-
- end UPDATE ;
-
-
-
-
-
-
- procedure STORE(REC : DB_RECORD) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To store the record in the database.If the record is
- -- already present as determined by the prime key then the
- -- record is updated.
- --
- -- Input arguments : REC : The record to update .
- --
- -- Output arguments: None.
- --
- -- Global variables: RAPPORT.MAILBOX , RAPPORT.ERROR_CODE , FileNumber
- --
- -- Calls to : R8LIB.R8UPDT , RAPPORT.AddressToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- SizeOfRecord : long_integer ;
-
- StartOfRecord : long_integer ;
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE STORE") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- -- Note that 'size return s bits and we require bytes.
-
- SizeOfRecord := long_integer ( DB_RECORD'size/NumberOfBitsInAByte ) ;
- StartOfRecord := AddressToLongInteger ( REC'address ) ;
-
- ERROR_CODE := 0 ;
-
- R8STOR ( FileNumber , SizeOfRecord , StartOfRecord ,
- ERROR_CODE , MAILBOX ) ;
-
-
- -- Error return of -7 => that the file is 90% full
-
- if ERROR_CODE = -7
- then put(" <<RAPPORT WARNING>>") ; new_line ; new_line ;
- put(" < File number ") ;
- system.put(integer(FileNumber)) ;
- put(" is greater than 90% full>") ;
- new_line ; new_line ;
- end if ;
-
-
-
- if ( ERROR_CODE < -1 ) and ( ERROR_CODE /= -7 )then
- raise RAPPORT_ERROR ;
- end if ;
-
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE STORE") ; NEW_LINE ;
-
-
-
- end STORE ;
-
-
-
-
-
-
- procedure FETCH(REC : out DB_RECORD;
- EXISTS : out BOOLEAN;
- CONDITIONS : CONDITION_TREE) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure returns a record from the file that
- -- satisfies the input conditions.If more than one record
- -- satisfies the conditions then the return is
- -- non-deterministic.
- --
- -- Input arguments : CONDITIONS : A pointer to a condition tree detailing the
- -- set of conditions on the fetch.
- --
- -- Output arguments: REC : The discovered database record if it is found .
- -- EXISTS : A boolean indicator saying if a record was found
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber ,
- --
- -- Calls to : ConditionTreeWalker , R8LIB.R8FECH
- -- RAPPORT.AddressToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- -- CountVariable is an indication of the last record fetched.In this case as
- -- none has been fetched it is 0.
-
- CountVariable : long_integer := 0 ;
-
-
- -- RetrievalStrategy is an indication of how to fetch the record.
-
- RetrievalStrategy : long_integer := 0 ;
-
- NumberOfConditions : long_integer ;
-
-
- -- Level no longer serves a purpose.
-
- Level : long_integer := 0 ;
-
- SizeOfRecord : long_integer ;
-
- StartOfRecord : long_integer ;
-
-
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE FETCH") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- SizeOfRecord := long_integer ( DB_RECORD'size/NumberOfBitsInAByte ) ;
- StartOfRecord := AddressToLongInteger ( REC'address ) ;
-
-
- -- The set of conditions are sent to the nucleus.
-
- ConditionTreeWalker ( Conditions , NumberOfConditions ) ;
-
-
- -- A record is fetched.
-
- R8FECH ( FileNumber , CountVariable , RetrievalStrategy ,
- NumberOfConditions , Level , SizeOfRecord , StartOfRecord ,
- MAILBOX ) ;
-
-
-
- -- CountVariable also acts as an error return.
-
- if CountVariable < -1
- then raise RAPPORT_ERROR ;
- end if ;
-
-
- -- If a record is found then CountVariable will indiacte it and so will
- -- be greater than 0.
-
- EXISTS := (CountVariable > 0 ) ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- PUT("%ADALIB-TRACEMSG-LEAVING PROCEDURE FETCH") ; NEW_LINE ;
-
- end FETCH ;
-
-
-
-
-
-
- procedure DELETE(NUMBER : out integer ;
- CONDITIONS : CONDITION_TREE) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure deletes all records from the file that
- -- satisfy the inputed conditions.
- --
- -- Input arguments : CONDITIONS : A poinetr indicating the condition tree.
- --
- -- Output arguments: NUMBER : The number of records deleted in the delete.
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber .
- --
- -- Calls to : ConditionTreewalker , R8LIB.R8DELT.
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
-
- NumberOfConditions : long_integer ;
- NumberDeleted : long_integer ;
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DELETE") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- -- Send the conditions to the nucleus.
-
- ConditionTreeWalker ( CONDITIONS , NumberOfConditions ) ;
-
-
- R8DELT ( FileNumber , NumberDeleted , NumberOfConditions ,
- MAILBOX ) ;
-
- Number := integer ( NumberDeleted ) ;
-
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DELETE") ; NEW_LINE ;
-
- end DELETE ;
-
-
-
-
-
- procedure SET_SELECTOR(SELECTION : out SELECTOR) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure sets a selector when there are no condition
- -- on the search.
- --
- -- Input arguments : None .
- --
- -- Output arguments: SELECTION : A selector to use in a search.
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber , SELECTOR_STACK .
- -- CURRENT_LEVEL , MAX_STACK_SIZE .
- --
- -- Calls to : None.
- --
- -- Called by : ADA Application program.
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- begin
-
- if RAPPORT_STARTED then
-
- -- we must first check that the searches have not been nested too deep
-
- if CURRENT_LEVEL >= MAX_STACK_SIZE
-
- then ERROR_CODE := -30 ;
- raise RAPPORT_ERROR ;
-
- else CURRENT_LEVEL := CURRENT_LEVEL+1 ;
- SELECTOR_STACK( CURRENT_LEVEL ) := NORMAL ;
-
- -- The count variable is set to 0 as no record has yet been
- -- fetched.
-
- SELECTION.CounTVariable := 0 ;
-
- -- The retrieval strategy is set to 0 as none has been decided
- -- upon.
-
- SELECTION.RetrievalStrategy := 0 ;
- SELECTION.Level := CURRENT_LEVEL ;
- SELECTION.Conditions := null ;
-
- end if ;
-
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- end SET_SELECTOR ;
-
-
-
-
-
- procedure SET_SELECTOR(SELECTION : out SELECTOR;
- CONDITIONS : CONDITION_TREE) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure sets a selector when there are conditions
- -- on the search.
- --
- -- Input arguments : CONDITIONS : The conditions that are to be imposed on the
- -- search.
- --
- -- Output arguments: SELECTION : A selector to use in a search.
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber , SELECTOR_STACK .
- -- CURRENT_LEVEL , MAX_STACK_SIZE .
- --
- -- Calls to : None .
- --
- -- Called by : ADA Application program.
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- begin
-
-
- if RAPPORT_STARTED then
-
- -- we must first check that the searches have not been nested too deep.
-
- if CURRENT_LEVEL >= MAX_STACK_SIZE
-
- then ERROR_CODE := -30 ;
- raise RAPPORT_ERROR ;
-
- else CURRENT_LEVEL := CURRENT_LEVEL+1 ;
- SELECTOR_STACK( CURRENT_LEVEL ) := NORMAL ;
-
- -- CoutnVariable is set to 0 as no record has yet been fetched .
-
- SELECTION.CounTVariable := 0 ;
-
- -- Retrieval strategy is set to 0 has it has not yet been
- -- decided.
-
- SELECTION.RetrievalStrategy := 0 ;
- SELECTION.Level := CURRENT_LEVEL ;
- SELECTION.Conditions := Conditions ;
-
- end if ;
-
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- end SET_SELECTOR ;
-
-
-
-
-
- procedure SET_ORDERED(SELECTION : out SELECTOR;
- ORDERING : ORDERING_TREE) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : Sets a selector for an ordered search where there are no
- -- conditions applied . The Ordering is transmited to the
- -- nucleus which is then requested to make the ordered
- -- copy of the file which is then used to retrieve from.
- --
- -- Input arguments : ORDERING : A pointer to an order tree specifying the
- -- ordering that is to be applied.
- --
- -- Output arguments: SELECTION : A selector to be used in a search.
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber , RAPPORT.ERROR_CODE .
- -- SELECTOR_STACK CURRENT_LEVEL , MAX_STACK_SIZE .
- --
- -- Calls to : R8LIB.R8STKY , R8LIB.R8HOLD , OrderingTreewAlker .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
-
- OrderList : ORDERING_ARRAY ;
- NumberOfFieldsInOrdering : integer ;
- LongNumberInList : long_integer ;
- NormalRetrieval : long_integer :=0 ;
- StartAddressOfList : long_integer ;
- NoConditions : long_integer :=0 ;
- NumberOfRecords : long_integer ;
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DET_ORDERED") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- -- we must first check that the search nesting is not too great.
-
- if CURRENT_LEVEL >= MAX_STACK_SIZE
-
- then ERROR_CODE := -30 ;
- raise RAPPORT_ERROR ;
-
- else CURRENT_LEVEL := CURRENT_LEVEL + 1 ;
- SELECTOR_STACK(CURRENT_LEVEL) := ORDERED ;
-
- -- The count variable is set to 0 as no records have yet been
- -- retrieved .
-
- SELECTION.CountVariable := 0 ;
-
- -- Retrieval strategy is set to 0 as none has been decided upon.
-
- SELECTION.RetrievalStrategy := 0 ;
- SELECTION.Level := CURRENT_LEVEL ;
-
-
- -- Collapse the ordering tree into an array representation.
-
- OrderingTreeWalker ( Ordering , OrderList ,
- NumberOfFieldsInOrdering);
-
-
-
-
- LongNumberInList := long_integer ( NumberOfFieldsInOrdering ) ;
- StartAddressOfList :=
- AddressToLongInteger ( OrderList'address ) ;
-
- -- Transmit the list to the nucleus
-
- R8STKY ( FileNumber , LongNumberInList , StartAddressOfList ,
- NormalRetrieval , MAILBOX ) ;
-
-
- -- create an ordered copy of the file on that ordering
-
- R8HOLD ( FileNumber , NoConditions , NumberOfRecords ,
- MAILBOX ) ;
-
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DET_ORDERED") ; NEW_LINE ;
-
-
- end SET_ORDERED ;
-
-
-
-
-
- procedure SET_ORDERED(SELECTION : out SELECTOR;
- ORDERING : ORDERING_TREE;
- CONDITIONS : CONDITION_TREE) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : Sets a selector for an ordered search where there are
- -- conditions applied . The Ordering is transmited to the
- -- nucleus which is then requested to make the ordered
- -- copy of the file which is then usedc to retrieve from.
- --
- -- Input arguments : ORDERING : A poinetr to an order tree specifying the
- -- ordering that is to be applied.
- -- CONDITIONS : A pointer to the condition tree.
- --
- -- Output arguments: SELECTION : A selector to be used in a search.
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber , RAPPORT.ERROR_CODE .
- -- CURRENT_LEVEL , MAX_STACK_SIZE .
- --
- -- Calls to : R8LIB.R8STKY , R8LIB.R8HOLD , ConditionTreeWalker ,
- -- Ordering TreeWalker .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- OrderList : ORDERING_ARRAY ;
- NumberOfFieldsInOrdering : integer ;
- LongNumberInList: long_integer ;
- NormalRetrieval : long_integer :=0 ;
- StartAddressOfList : long_integer ;
- NumberOfConditions : long_integer ;
- NumberOfRecords : long_integer ;
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DET_ORDERED") ; NEW_LINE ;
-
-
- if RAPPORT_STARTED then
-
- -- We must first check that the search nesting is not too deep
-
- if CURRENT_LEVEL >= MAX_STACK_SIZE
-
- then ERROR_CODE := -30 ;
- raise RAPPORT_ERROR ;
-
- else CURRENT_LEVEL := CURRENT_LEVEL + 1 ;
- SELECTOR_STACK(CURRENT_LEVEL) := ORDERED ;
-
-
- -- The count variable is set to 0 as no record has yet been
- -- retrieved .
-
- SELECTION.CountVariable := 0 ;
-
-
- -- The retrieval strategy is set to 0 as none has yet been
- -- decided upon.
-
- SELECTION.RetrievalStrategy := 0 ;
- SELECTION.Level := CURRENT_LEVEL ;
-
- OrderingTreeWalker ( Ordering , OrderList ,
- NumberOfFieldsInOrdering);
-
-
- LongNumberInList := long_integer ( NumberOfFieldsInOrdering ) ;
- StartAddressOfList :=
- AddressToLongInteger ( OrderList'address ) ;
-
-
- -- Transmit the ordering to the nucleus.
-
- R8STKY ( FileNumber , LongNumberInList , StartAddressOfList ,
- NormalRetrieval , MAILBOX ) ;
-
- -- Transmit the conditions to the nucleus.
-
- ConditionTreeWalker ( Conditions , NumberOfConditions ) ;
-
- -- Create an ordered copy of the file.
-
- R8HOLD ( FileNumber , NumberOfConditions , NumberOfRecords ,
- MAILBOX ) ;
-
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DET_ORDERED") ; NEW_LINE ;
-
- end SET_ORDERED ;
-
-
-
-
- procedure SET_UNIQUE(SELECTION : out SELECTOR;
- ORDERING : ORDERING_TREE) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : Sets a selector for an ordered search where there are no
- -- conditions applied . The Ordering is transmited to the
- -- nucleus which is then requested to make the ordered
- -- copy of the file which is then usedc to retrieve from.
- -- The difference with a unique search is that only one
- -- record matching the ordering is copied to the order.
- --
- -- Input arguments : ORDERING : A poinetr to an order tree specifying the
- -- ordering that is to be applied.
- --
- -- Output arguments: SELECTION : A selector to be used in a search.
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber , RAPPORT.ERROR_CODE .
- -- SELECTOR_STACK , CURRENT_LEVEL , MAX_STACK_SIZE .
- --
- -- Calls to : R8LIB.R8STKY , R8LIB.R8HOLD ,
- -- Ordering TreeWalker .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- OrderList : ORDERING_ARRAY ;
- NumberOfFieldsInOrdering : integer ;
- LongNumberInList : long_integer ;
- UniqueRetrieval : long_integer :=1 ;
- StartAddressOfList : long_integer ;
- NoConditions : long_integer :=0 ;
- NumberOfRecords : long_integer ;
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DET_UNIQUED") ; NEW_LINE ;
-
- if RAPPORT_STARTED then
-
- -- we must first check that the ordering is not too deep.
-
- if CURRENT_LEVEL >= MAX_STACK_SIZE
-
- then ERROR_CODE := -30 ;
- raise RAPPORT_ERROR ;
-
- else CURRENT_LEVEL := CURRENT_LEVEL + 1 ;
- SELECTOR_STACK(CURRENT_LEVEL) := UNIQUE ;
-
-
- -- The count variable is set to 0 as no record has yet been
- -- fetched.
-
- SELECTION.CountVariable := 0 ;
- SELECTION.RetrievalStrategy := 0 ;
- SELECTION.Level := CURRENT_LEVEL ;
-
- OrderingTreeWalker ( Ordering , OrderList ,
- NumberOfFieldsInOrdering);
-
-
- LongNumberInList := long_integer ( NumberOfFieldsInOrdering ) ;
- StartAddressOfList :=
- AddressToLongInteger ( OrderList'address ) ;
-
-
- -- transmit the ordering to the nucleus .
-
- R8STKY ( FileNumber , LongNumberInList , StartAddressOfList ,
- UniqueRetrieval , MAILBOX ) ;
-
-
- -- make an ordered copy of the file .
-
- R8HOLD ( FileNumber , NoConditions , NumberOfRecords ,
- MAILBOX ) ;
-
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DET_UNIQUE") ; NEW_LINE ;
-
-
- end SET_UNIQUE ;
-
-
-
-
- procedure SET_UNIQUE(SELECTION : out SELECTOR;
- ORDERING : ORDERING_TREE;
- CONDITIONS : CONDITION_TREE) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : Sets a selector for an ordered search where there are no
- -- conditions applied . The Ordering is transmited to the
- -- nucleus which is then requested to make the ordered
- -- copy of the file which is then usedc to retrieve from.
- -- The difference with a unique search is that only one
- -- record matching the ordering is copied to the order.
- --
- -- Input arguments : ORDERING : A poinetr to an order tree specifying the
- -- ordering that is to be applied.
- --
- -- Output arguments: SELECTION : A selector to be used in a search.
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber , RAPPORT.ERROR_CODE .
- -- SELECTOR_STACK , CURRENT_LEVEL , MAX_STACK_SIZE .
- --
- -- Calls to : R8LIB.R8STKY , R8LIB.R8HOLD , ConditionTreeWalker
- -- Ordering TreeWalker .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- OrderList : ORDERING_ARRAY ;
- NumberOfFieldsInOrdering : integer ;
- LongNumberInList : long_integer ;
- UniqueRetrieval : long_integer :=1 ;
- StartAddressOfList : long_integer ;
- NumberOfConditions : long_integer ;
- NumberOfRecords : long_integer ;
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DET_UNIQUE") ; NEW_LINE ;
-
-
- if RAPPORT_STARTED then
-
- -- wee must first check that we are not overloading the stack .
-
- if CURRENT_LEVEL >= MAX_STACK_SIZE
-
- then ERROR_CODE := -30 ;
- raise RAPPORT_ERROR ;
-
- else CURRENT_LEVEL := CURRENT_LEVEL + 1 ;
- SELECTOR_STACK(CURRENT_LEVEL) := UNIQUE ;
-
- -- count is set to 0 to indicate the first fetch .
-
- SELECTION.CountVariable := 0 ;
- SELECTION.RetrievalStrategy := 0 ;
- SELECTION.Level := CURRENT_LEVEL ;
-
- OrderingTreeWalker ( Ordering , OrderList ,
- NumberOfFieldsInOrdering);
-
-
-
-
- LongNumberInList := long_integer ( NumberOfFieldsInOrdering ) ;
- StartAddressOfList :=
- AddressToLongInteger ( OrderList'address ) ;
-
-
- -- transmit the ordering to the nucleus
-
- R8STKY ( FileNumber , LongNumberInList , StartAddressOfList ,
- UniqueRetrieval , MAILBOX ) ;
-
-
- -- transmit the conditions to the nucleus .
-
- ConditionTreeWalker ( Conditions , NumberOfConditions ) ;
-
-
- -- make an ordered copy of the file
-
- R8HOLD ( FileNumber , NumberOfConditions , NumberOfRecords ,
- MAILBOX ) ;
-
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DET_UNIQUE") ; NEW_LINE ;
-
- end SET_UNIQUE ;
-
-
-
-
-
- procedure SEARCH(SELECTION : in out SELECTOR;
- REC : out DB_RECORD;
- END_OF_SEARCH : out BOOLEAN) is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : This procedure given a selector returns a record from
- -- the file . The count variable in the selector is
- -- updated on each search ( The retrieval strategy is updated
- -- only on the first ) so that the next record on is returned
- -- on each search in a set .
- -- The termination of the search occurrs when the count
- -- returned from the nucleus is -1 . ( Note that the count
- -- also acts as an error code as it can take negative values
- -- which => error .
- -- There are two main types of search , one done on acopy
- -- of the file (ORDERED , UNIQUE ) and one done on the file
- -- itself ( NORMAL ) .These require different strategies .
- -- A normal search has to transmit the conditions to the
- -- nucleus before performing a fetch but an ordered or unique
- -- search does not as the conditions have already been
- -- performed on the copy file .
- --
- --
- -- Input arguments : SELECTION : which details information relevant to the
- -- search ( Count , Retrieval , Conditions ,type )
- --
- -- Output arguments: REC : the database record got from the file.
- -- END_OF_SEARCH : a boolean which is true if the count
- -- variable is returned as -1 .
- --
- -- Global variables: RAPPORT.MAILBOX , FileNumber , CURRENT_LEVEL ,
- -- SELECTION_STACK , CURRENT_LEVEL .
- --
- -- Calls to : R8LIB.R8FECH , R8LIB.R8RTRV , ConditionTreeWalker .
- -- RAPPORT.AddressToLongInteger
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- Selector_Stack_Level : integer ;
- StartOfRecord : long_integer ;
- SizeOfRecord : long_integer ;
- NumberOfConditions : long_integer ;
- DummyLevel : long_integer :=0 ;
-
-
- begin
-
-
- if RAPPORT_STARTED then
-
- -- there are two groups of search pattern NORMAL & otherwise
-
- if SELECTOR_STACK ( SELECTION.Level ) /= NORMAL
-
- -- in the case of a non-noramal search we are working with an
- -- ordered copy of the file . To ensure that this has not been
- -- subsequently overwritten we must ensure that since this search
- -- was initiated ( with a set_ordered or a set_unique ) no other
- -- non-normal searches have been requested .
-
- then for Selector_Stack_Level in SELECTION.Level+1..CURRENT_LEVEL
- loop
- if SELECTOR_STACK(Selector_Stack_Level) /= NORMAL
- then ERROR_CODE := -10000 ;
- raise RAPPORT_ERROR ;
- end if ;
- end loop ;
-
- StartOfRecord := AddressToLongInteger(REC'address) ;
- SizeOfRecord :=
- long_integer( DB_RECORD'size/NumberOfBitsInAByte) ;
-
-
- -- to get a record from the copy file a retrieve , as opposed
- -- to a fetch must be performed .
-
- R8RTRV(FileNumber , SELECTION.CountVariable ,
- SizeOfRecord , StartOfRecord , MAILBOX ) ;
-
-
- -- note here how the CountVariable is acting also as an
- -- error code .
-
- if SELECTION.CountVariable < -1
- then raise RAPPORT_ERROR ;
- end if ;
-
-
- End_Of_SEARCH := (SELECTION.CountVariable = -1 ) ;
-
-
- -- here we have a normal search and as this does not use a copy file
- -- we need do no checking.
-
- else StartOfRecord := AddressToLongInteger(REC'address) ;
- SizeOfRecord :=
- long_integer( DB_RECORD'size/NumberOfBitsInAByte) ;
-
-
- -- note that on each fetch in the search set we must send the
- -- conditions on the search to the nucleus . This is because
- -- there is no copy file and so the conditions are not stored
- -- in the nucleus .
-
- ConditionTreeWalker (SELECTION.Conditions ,
- NumberOfConditions);
-
-
- R8FECH ( FileNumber , SELECTION.CountVariable ,
- SELECTION.RetrievalStrategy ,
- NumberOfConditions ,
- DummyLevel ,
- SizeOfRecord ,
- StartOfRecord ,
- MAILBOX ) ;
-
-
- -- count is also used as an error return .
-
- if SELECTION.CountVariable < -1
- then raise RAPPORT_ERROR ;
- end if ;
-
-
- End_Of_SEARCH := (SELECTION.CountVariable = -1 ) ;
-
-
- end if;
-
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- end SEARCH ;
-
-
-
-
-
- procedure CLEAR_SELECTOR(SELECTION : in out SELECTOR) is
-
- -------------------------------------------------------------------------------
- --
- -- Function : After a search is completed the selector used in that
- -- search must be cleared so that it cannot be re-used .
- --
- -- Input arguments : SELECTION : the selector used in the previous search .
- --
- -- Output arguments: SELECTION : a cleared and unusable selector .
- --
- -- Global variables: CURRENT_LEVEL .
- --
- -- Calls to : None .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- begin
-
-
- if RAPPORT_STARTED then
-
- -- it is only possible to clear the current level as the integrity of
- -- the selector_stack has to be preserved .
-
- if SELECTION.Level /= CURRENT_LEVEL
-
- then ERROR_CODE := -10001 ;
- raise RAPPORT_ERROR ;
-
- else if SELECTOR_STACK(SELECTION.Level) /= NORMAL
-
- -- if the search was not normal then we must inform the
- -- nucleus that it can get rid of the ordered copy .
-
- then R8ENRV ( SELECTION.CountVariable , ERROR_CODE , MAILBOX) ;
-
- end if ;
-
- if ERROR_CODE <-1
- then raise RAPPORT_ERROR ;
- end if ;
-
-
- -- the current level in the stack is decremented .
-
- CURRENT_LEVEL := CURRENT_LEVEL-1 ;
-
-
- -- in either search case the selection parameters must be made
- -- unusable . ( if count = -1 then no search can take place
- -- as the nucleus will return an error .
-
- SELECTION.CountVariable := -1 ;
- SELECTION.Conditions := null ;
-
- end if ;
-
- else
-
- ERROR_CODE := -100 ;
- raise RAPPORT_ERROR ;
-
- end if ;
-
-
- end CLEAR_SELECTOR ;
-
-
-
-
- function "and" ( LeftPart , RightPart : CONDITION_TREE )
-
- return CONDITION_TREE is
-
- -------------------------------------------------------------------------------
- --
- -- Function : This is the and conjunction used in specifying a condition
- -- set . It takes as input a LeftPart of a condition tree and
- -- a right part and forms another tree with a root node
- -- specifying the and is to be done on the left and right
- -- parts .
- --
- -- Input arguments : LeftPart : a condition tree pointer ( i.e. a set of
- -- conditions in the form of a tree )
- -- RightPart : a conditiontree pointer .
- --
- -- Output arguments: a condition tree :-
- --
- -- < and-node >
- -- / \
- -- / \
- -- <LeftPart> <RightPart>
- --
- -- Global variables: None .
- --
- -- Calls to : None .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- ConjunctionNode : CONDITION_TREE ;
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING FUNCTION AND") ; NEW_LINE ;
-
- ConjunctionNode := new Condition_Block ;
-
- ConjunctionNode.BlockType := Conjunction ;
-
- -- note that an and node is represented by the nucleus by the number 2
-
- ConjunctionNode.ConjunctionNumber := 2 ;
-
- ConjunctionNode.LeftPartOfConjunction := LeftPart ;
- ConjunctionNode.RightPartOfConjunction := RightPart ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING FUNCTION AND") ; NEW_LINE ;
-
- return ConjunctionNode ;
-
- end "and" ;
-
-
-
-
- function "or" ( LeftPart , RightPart : CONDITION_TREE )
-
- return CONDITION_TREE is
-
- -------------------------------------------------------------------------------
- --
- -- Function : This is the or conjunction used in specifying a condition
- -- set . It takes as input a LeftPart of a condition tree and
- -- a right part and forms another tree with a root node
- -- specifying the or is to be done on the left and right
- -- parts .
- --
- -- Input arguments : LeftPart : a condition tree pointer ( i.e. a set of
- -- conditions in the form of a tree )
- -- RightPart : a conditiontree pointer .
- --
- -- Output arguments: a condition tree :-
- --
- -- < or-node >
- -- / \
- -- / \
- -- <LeftPart> <RightPart>
- --
- -- Global variables: None .
- --
- -- Calls to : None .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
-
- ConjunctionNode : CONDITION_TREE ;
-
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING FUNCTION AND") ; NEW_LINE ;
-
- ConjunctionNode := new Condition_Block ;
-
- ConjunctionNode.BlockType := Conjunction ;
-
- -- note that the nucleus identifies an or conjunction with 2
-
- ConjunctionNode.ConjunctionNumber := 1 ;
- ConjunctionNode.LeftPartOfConjunction := LeftPart ;
- ConjunctionNode.RightPartOfConjunction := RightPart ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING FUNCTION AND") ; NEW_LINE ;
-
- return ConjunctionNode ;
-
- end "or" ;
-
-
-
-
-
- function "&" ( LeftPart , RightPart : ORDERING_TREE )
-
- return ORDERING_TREE is
-
- -------------------------------------------------------------------------------
- --
- -- Function : This is the function used to group together individual
- -- pieces of ordering information to form an oredering set .
- --
- -- Input arguments : LeftPart , RightPart : These are sets of one or more
- -- pieces of ordering information .
- --
- -- Output arguments: an ordering set comprising the two input orderings .
- --
- -- Global variables: None .
- --
- -- Calls to : None .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- TempOrderBlock : ORDERING_TREE ;
-
- begin
-
- -- put("%ADALIB-TRACEMSG-ENTERING PROCEDURE &") ; NEW_LINE ;
-
- TempOrderBlock := new ORDER_BLOCK ;
-
- TempOrderBlock.BlockType := NODE ;
- TempOrderBlock.LeftPart := LeftPart ;
- TempOrderBlock.RightPart := RightPart ;
-
- -- put("%ADALIB-TRACEMSG-LEAVING PROCEDURE &") ; NEW_LINE ;
-
- return TempOrderBlock ;
-
- end "&" ;
-
-
-
-
- end ;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --GACOND.TXT
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- -----------------------------------------------------------------------
- -- --
- -- This is a generic package for the conditions on and ordering of --
- -- an array field. --
- -- The package must be hand instantiated as follows :- --
- -- --
- -- Replace %1 with the name of the package with the --
- -- file information . --
- -- --
- -- Replace %2 with the type of the field declared in --
- -- the package specified above. --
- -- --
- -- replace %3 with the number of the absolute number of --
- -- the field . --
- -- --
- -- Replace %4 with the name of the field specified in --
- -- the package containing file information. --
- -- This then will become the name of the --
- -- package . --
- -- --
- -- Replace %5 with the type name of an individual element --
- -- of a field. --
- -- --
- -- Replace %6 with the name of theddf package --
- -- --
- -- --
- -- Finally exit the package as %4.txt and compile it --
- -- --
- -----------------------------------------------------------------------
-
-
-
- with %6 , %1 ; use %6 , %1 ;
- with UNCHECKED_CONVERSION ;
-
-
- package %4 is
-
-
-
- function EQUAL ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
-
-
- function EQUAL ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
- function EQUAL ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
-
-
-
- function GREATER_EQUAL ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
-
-
- function GREATER_EQUAL ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
- function GREATER_EQUAL ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
-
-
-
- function GREATER_THAN ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
-
-
- function GREATER_THAN ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
- function GREATER_THAN ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
-
-
-
- function LESS_EQUAL ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
-
-
- function LESS_EQUAL ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
- function LESS_EQUAL ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
-
-
-
- function LESS_THAN ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
-
-
- function LESS_THAN ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
- function LESS_THAN ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
-
-
-
- function UNEQUAL ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
-
-
- function UNEQUAL ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
- function UNEQUAL ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE ;
-
-
-
-
-
- function UP return ORDERING_TREE ;
-
- function DOWN return ORDERING_TREE ;
-
-
- end ;
-
-
-
-
-
-
- package body %4 is
-
-
- NumberOfBitsInAByte : constant integer := 8 ;
-
-
-
- -------------------------------------------------------------------------
- -------------------------------------------------------------------------
- -- --
- -- NOTE ON THE IMPLEMENTATION OF CONDITIONS --
- -- --
- -- All of the conditions take the same form . --
- -- --
- -- * A pointer to the type of the field is set up . --
- -- * It is instantiated and set equal to the RHS of --
- -- the condition . --
- -- * The address of the pointer is calculated by a --
- -- function translating from a pointer type to a long --
- -- integer type . --
- -- * The size of the RHS is the size of the field_type --
- -- * The start and size of the RHS along with the --
- -- condition number are stored in the condition tree --
- -- --
- -- A pointer type was used to store the value of the RHS of a --
- -- condition as is the only type that can be used . A local variable --
- -- (to the function) would dissapear after termination of the function --
- -- Pointers live on . A global variable would be unsuitable as it is --
- -- not known at compile time the amount of conditions that are to be --
- -- set . Pointers are dynamic and so this problem does not arise . --
- -- --
- -- In the case here of array field there is more than one type of --
- -- comparison for each comparison type . All the array can be tested --
- -- a single named element of the array can be tested or it can be --
- -- tested for any value of the array . So for each comparison there --
- -- are three functions . One header is supplied for each set of --
- -- functions and an individual explanation note for each one . --
- -- --
- -------------------------------------------------------------------------
- -------------------------------------------------------------------------
-
-
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition EQUAL .
- -- Note equlaity applied to string fields is true if every
- -- element of the strings being compared is identical .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
-
- -- this function is testing all of the array elements are equivalent to the
- -- corresponding elemnts of the comparison value .
-
-
- function EQUAL ( Value : %2 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 1 => EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not used as normal comparison .
-
-
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 1 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
-
- return NewCondition ;
-
- end ;
-
-
-
- -- this function deals with comparison of equality betwwen an individual
- -- named array element and a value .
-
-
- function EQUAL ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 1 => EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 1 => named array element comparison.
- -- ArraySubscript = Index => Compare array element number Index.
-
-
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 1 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 1 ;
- NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
- -- this function tests either ALL_ELEMENTS of the array against the value
- -- or to see if ANY_ELEMENT EQUAL to the value .
-
-
- function EQUAL ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 1 => EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
- -- ArraySubscript = 0 => not applicable to this condition.
-
-
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 1 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
-
- if Index = Any_Element
- then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
- else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
- end if ;
-
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition
- -- GREATER_EQUAL . On string fields comparison is by
- -- dictionary order .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- -- this function is testing all of the array elements are GREATER_EQUAL to the
- -- corresponding elemnts of the comparison value .
-
- function GREATER_EQUAL ( Value : %2 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 2 => GREATER_EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not used as normal comparison .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 2 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
- -- this function deals with comparison of GREATER_EQUAL betwwen an individual
- -- named array element and a value .
-
-
- function GREATER_EQUAL ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 2 => GREATER_EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 1 => named array element comparison.
- -- ArraySubscript = Index => Compare array element number Index.
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 2 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 1 ;
- NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
- -- this function tests either ALL_ELEMENTS of the array against the value
- -- or to see if ANY_ELEMENT GREATER_EQUAL to the value .
-
-
- function GREATER_EQUAL ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 2 => LESS_EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
- -- ArraySubscript = 0 => not applicable to this condition .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 2 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
-
- if Index = Any_Element
- then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
- else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
- end if ;
-
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition
- -- GREATER_THAN . On string fields comparison is by
- -- dictionary order .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- -- this function is testing all of the array elements are GREATER_THAN to the
- -- corresponding elemnts of the comparison value .
-
-
- function GREATER_THAN ( Value : %2 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 3 => GREATER_THAN condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not used as normal comparison .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 3 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
- -- this function deals with comparison of GREATER_THAN betwwen an individual
- -- named array element and a value .
-
-
- function GREATER_THAN ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 3 => GREATER_THAN condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 1 => named array element comparison.
- -- ArraySubscript = Index => Compare array element number Index.
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 3 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 1 ;
- NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
-
- -- this function tests either ALL_ELEMENTS of the array against the value
- -- or to see if ANY_ELEMENT GREATER_THAN to the value .
-
-
- function GREATER_THAN ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 3 => GREATER_THAN condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
- -- ArraySubscript = 0 => not applicable to this condition .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 3 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
-
- if Index = Any_Element
- then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
- else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
- end if ;
-
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition
- -- LESS EQUAL . On string fields comparison is by
- -- dictionary order .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- -- this function is testing all of the array elements are LESS_EQUAL to the
- -- corresponding elemnts of the comparison value .
-
-
- function LESS_EQUAL ( Value : %2 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 4 => LESS_EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not used as normal comparison .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 4 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
- -- this function deals with comparison of GREATER_EQUAL betwwen an individual
- -- named array element and a value .
-
-
- function LESS_EQUAL ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 4 => LESS_EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 1 => named array element comparison.
- -- ArraySubscript = Index => Compare array element number Index.
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 4 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 1 ;
- NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
-
- -- this function tests either ALL_ELEMENTS of the array against the value
- -- or to see if ANY_ELEMENT KLESS_EQUAL to the value .
-
-
- function LESS_EQUAL ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 4 => LESS_EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
- -- ArraySubscript = 0 => not applicable to this condition .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 4 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
-
- if Index = Any_Element
- then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
- else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
- end if ;
-
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition
- -- LESS_THAN . On string fields comparison is by
- -- dictionary order .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- -- this function is testing all of the array elements are LESS_THAN to the
- -- corresponding elemnts of the comparison value .
-
-
- function LESS_THAN ( Value : %2 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 5 => LESS_THAN condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not used as normal comparison .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 5 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
- -- this function deals with comparison of LESS_THAN betwwen an individual
- -- named array element and a value .
-
-
- function LESS_THAN ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 5 => LESS_THAN condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 1 => named array element comparison.
- -- ArraySubscript = Index => Compare array element number Index.
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 5 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 1 ;
- NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
-
- -- this function tests either ALL_ELEMENTS of the array against the value
- -- or to see if ANY_ELEMENT LESS_THAN to the value .
-
-
- function LESS_THAN ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 5 => LESS_THAN condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
- -- ArraySubscript = 0 => not applicable to this condition .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 5 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
-
- if Index = Any_Element
- then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
- else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
- end if ;
-
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition
- -- UNEQUAL . On string fields comparison is by
- -- dictionary order .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- -- this function is testing all of the array elements are UNEQUAL to the
- -- corresponding elemnts of the comparison value .
-
-
- function UNEQUAL ( Value : %2 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 6 => UNEQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not used as normal comparison .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 6 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
-
- -- this function deals with comparison of UNEQUAL betwwen an individual
- -- named array element and a value .
-
-
- function UNEQUAL ( Index : integer ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 6 => UNEQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 1 => named array element comparison.
- -- ArraySubscript = Index => Compare array element number Index.
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 6 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 1 ;
- NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
-
- -- this function tests either ALL_ELEMENTS of the array against the value
- -- or to see if ANY_ELEMENT UNEQUAL to the value .
-
-
- function UNEQUAL ( Index : GENERAL_ELEMENT ;
- Value : %5 )
-
- return CONDITION_TREE is
-
-
- type RightHandSidePointer is access %5 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- RightHandSide := new %5 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 6 => UNEQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
- -- ArraySubscript = 0 => not applicable to this condition .
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 6 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
-
- if Index = Any_Element
- then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
- else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
- end if ;
-
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %5'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
-
- function UP return ORDERING_TREE is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create an ordering tree leaf node to contain the
- -- information that this field is to be in ascending order .
- --
- -- Input arguments : None .
- --
- -- Output arguments: Returns an ordering tree block .
- --
- -- Global variables: PerFile.ORDERING_TREE , PerFile.ORDER_BLOCK
- --
- -- Calls to : None .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
-
- TempBlock : ORDERING_TREE ;
-
-
- begin
-
- TempBlock := new ORDER_BLOCK ;
-
- TempBlock.BlockType := LEAF ;
- TempBlock.OrderingInformation := %3 ;
-
- return TempBlock ;
-
- end ;
-
-
-
-
-
-
-
- function DOWN return ORDERING_TREE is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create an ordering tree leaf node to contain the
- -- information that this field is to be in descending order .
- --
- -- Input arguments : None .
- --
- -- Output arguments: Returns an ordering tree block .
- --
- -- Global variables: PerFile.ORDERING_TREE , PerFile.ORDER_BLOCK
- --
- -- Calls to : None .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
- TempBlock : ORDERING_TREE ;
-
-
- begin
-
- TempBlock := new ORDER_BLOCK ;
-
- TempBlock.BlockType := LEAF ;
- TempBlock.OrderingInformation := -(%3) ;
-
- return TempBlock ;
-
- end ;
-
-
-
-
- end ;
-
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --GSCOND.TXT
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- -----------------------------------------------------------------------
- -- --
- -- This is a generic package for the conditions on and ordering of --
- -- a scalar element. --
- -- --
- -- The package must be hand instantiated as follows :- --
- -- --
- -- Replace %1 with the name of the package with the --
- -- file information . --
- -- --
- -- Replace %2 with the type of the field declared in --
- -- the package specified above. --
- -- --
- -- replace %3 with the number of the absolute number of --
- -- the field . --
- -- --
- -- Replace %4 with the name of the field specified in --
- -- the package containing file information. --
- -- This then will become the name of the --
- -- package . --
- -- --
- -- Replace %5 with the name of the ddf package --
- -- --
- -- --
- -- Finally exit the package as %4.txt and compile it --
- -- --
- -----------------------------------------------------------------------
-
-
-
- with %5 , %1 ; use %5 , %1 ;
- with UNCHECKED_CONVERSION , text_io ; use text_io ;
- package %4 is
-
-
- function EQUAL ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
- function GREATER_EQUAL ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
- function GREATER_THAN ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
- function LESS_EQUAL( Value : %2 )
-
- return CONDITION_TREE ;
-
-
- function LESS_THAN ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
- function UNEQUAL ( Value : %2 )
-
- return CONDITION_TREE ;
-
-
-
-
-
- function UP return ORDERING_TREE ;
-
-
- function DOWN return ORDERING_TREE ;
-
-
- end ;
-
-
-
-
-
-
-
- package body %4 is
-
-
-
- NumberOfBitsInAByte : constant integer := 8 ;
-
-
- -------------------------------------------------------------------------
- -------------------------------------------------------------------------
- -- --
- -- NOTE ON THE IMPLEMENTATION OF CONDITIONS --
- -- --
- -- All of the conditions take the same form . --
- -- --
- -- * A pointer to the type of the field is set up . --
- -- * It is instantiated and set equal to the RHS of --
- -- the condition . --
- -- * The address of the pointer is calculated by a --
- -- function translating from a pointer type to a long --
- -- integer type . --
- -- * The size of the RHS is the size of the field_type --
- -- * The start and size of the RHS along with the --
- -- condition number are stored in the condition tree --
- -- --
- -- A pointer type was used to store the value of the RHS of a --
- -- condition as is the only type that can be used . A local variable --
- -- (to the function) would dissapear after termination of the function --
- -- Pointers live on . A global variable would be unsuitable as it is --
- -- not known at compile time the amount of conditions that are to be --
- -- set . Pointers are dynamic and so this problem does not arise . --
- -- --
- -------------------------------------------------------------------------
- -------------------------------------------------------------------------
-
-
-
- function EQUAL ( Value : %2 )
-
- return CONDITION_TREE is
-
- -------------------------------------------------------------------------------
- --
- -- Function : To craete a condition tree node for the condition EQUAL .
- -- Note equlaity applied to string fields is true if every
- -- element of the strings being compared is identical .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
-
- -- instantiate the pointer to the type of the right hand side
- -- and set it equal to the comparison value .
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 1 => EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not dealing with arrays .
-
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 1 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
- function GREATER_EQUAL ( Value : %2 )
-
- return CONDITION_TREE is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition
- -- GREATER_EQUAL . Note GREATER_EQUAL applied to string
- -- fields is based on dictionary order .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
-
- -- instantiate the pointer to the type of the right hand side
- -- and set it equal to the comparison value .
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 2 => GREATER_EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not dealing with arrays .
-
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 2 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
- function GREATER_THAN ( Value : %2 )
-
- return CONDITION_TREE is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To craete a condition tree node for the condition
- -- GREATER_THAN . Note GREATER_THAN applied to string
- -- fields is based on dictionary order .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
-
- -- instantiate the pointer to the type of the right hand side
- -- and set it equal to the comparison value .
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 3 => GREATER_THAN condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not dealing with arrays .
-
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 3 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
- function LESS_EQUAL ( Value : %2 )
-
- return CONDITION_TREE is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition
- -- LESS_EQUAL . Note LESS_EQUAL applied to string fields is
- -- based on dictionary order .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
- -- instantiate the pointer to the type of the right hand side
- -- and set it equal to the comparison value .
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 4 => LESS_EQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not dealing with arrays .
-
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 4 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
- function LESS_THAN ( Value : %2 )
-
- return CONDITION_TREE is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition
- -- LESS_THAN .Note LESS_THAN applied to string fields is
- -- based on all strings before in dictionary order .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
-
- -- instantiate the pointer to the type of the right hand side
- -- and set it equal to the comparison value .
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 5 => LESS_THAN condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not dealing with arrays .
-
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 5 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
-
- return NewCondition ;
-
- end ;
-
-
-
-
-
- function UNEQUAL( Value : %2 )
-
- return CONDITION_TREE is
-
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create a condition tree node for the condition
- -- UNEQUAL .Note inequlaity applied to string fields is true
- -- if any element of the strings being compared is
- -- different .
- --
- -- Input arguments : Value : The value of the RHS of the condition .
- --
- -- Output arguments: Returns a pointer to the created condition tree node .
- --
- -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
- --
- -- Calls to : RightHandSideToLongInteger .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- type RightHandSidePointer is access %2 ;
-
- function RightHandSideToLongInteger is new
- UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
-
- NewCondition : CONDITION_TREE ;
-
- RightHandSide : RightHandSidePointer ;
-
-
- begin
-
-
- -- instantiate the pointer to the type of the right hand side
- -- and set it equal to the comparison value .
-
- RightHandSide := new %2 ;
- RightHandSide.all := Value ;
-
-
- -- create a new condition block and set parameter values .
-
- -- ConditionNumber = 6 => UNEQUAL condition .
- -- FieldNumber = absolute number of the field the package is
- -- instantiated for .
- -- AnyAllSwitch = 0 => normal comparison .
- -- ArraySubscript = 0 => not dealing with arrays .
-
-
- NewCondition := new Condition_Block ;
- NewCondition.BlockType := Condition ;
- NewCondition.RHSParameters.ConditionNumber := 6 ;
- NewCondition.RHSParameters.FieldNumber := %3 ;
- NewCondition.RHSParameters.AnyAllSwitch := 0 ;
- NewCondition.RHSParameters.ArraySubscript := 0 ;
- NewCondition.RHSParameters.SizeOfRightHandSide :=
- long_integer ( %2'size/NumberOfBitsInAByte ) ;
- NewCondition.RHSParameters.StartOfRightHandSide :=
- RightHandSideToLongInteger ( RightHandSide ) ;
-
-
- return NewCondition ;
-
- end ;
-
-
-
-
- function UP return ORDERING_TREE is
-
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create an ordering tree leaf node to contain the
- -- information that this field is to be in ascending order .
- --
- -- Input arguments : None .
- --
- -- Output arguments: Returns an ordering tree block .
- --
- -- Global variables: PerFile.ORDERING_TREE , PerFile.ORDER_BLOCK
- --
- -- Calls to : None .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- TempBlock : ORDERING_TREE ;
-
- begin
-
- TempBlock := new Order_Block ;
-
- -- we are creating a leaf node ( bottom of the ordering tree )
-
- TempBlock.BlockType := LEAF ;
-
- -- the fact that field x is to be in ascending order is specified by storing
- -- the number + x
-
- TempBlock.OrderingInformation := %3 ;
-
- return TempBlock ;
-
- end ;
-
-
-
-
- function DOWN return ORDERING_TREE is
-
- -------------------------------------------------------------------------------
- --
- -- Function : To create an ordering tree leaf node to contain the
- -- information that this field is to be in descending order .
- --
- -- Input arguments : None .
- --
- -- Output arguments: Returns an ordering tree block .
- --
- -- Global variables: PerFile.ORDERING_TREE , PerFile.ORDER_BLOCK
- --
- -- Calls to : None .
- --
- -- Called by : ADA Application program .
- --
- -- Author : RP/MDD ( / / ) Version 1.0
- --
- -- Amendments : ( / / )
- --
- -- Notes :
- --
- -------------------------------------------------------------------------------
-
-
- TempBlock : ORDERING_TREE ;
-
- begin
-
- TempBlock := new Order_Block ;
-
- -- we are creating a LEAF node ( at the bottom of the tree )
-
- TempBlock.BlockType := LEAF ;
-
- -- the fact that field x is to be in ascending order is stored as - x
-
- TempBlock.OrderingInformation := -(%3) ;
-
- return TempBlock ;
-
- end ;
-
-
-
-
- end ;
-
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --ADARAP.COM
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- $! First define the name of the "TeleSoft Code" directory
- $! ****************************
- $DEFINE TADA$DIR DBA2:[ADARAPP.ADK]
- $! ****************************
- $! Now define all the relevant code files
- $ DEFINE TADA$RTK TADA$DIR:V30R23
- $ DEFINE TADA$PSE TADA$DIR:ROS.ROS
- $ DEFINE TADA$ACOMP TADA$DIR:CMDADA.COD
- $ DEFINE TADA$PCOMP TADA$DIR:PASCAL.COD
- $ DEFINE TADA$TRVAX TADA$DIR:TRVAX.COD
- $ DEFINE TADA$EDIT "EDIT/EDT"
- $!
- $! Enable the Help library
- $ DEFINE HLP$LIBRARY_1 TADA$DIR:TELESOFT
- $!
- $! Set up the default file types
- $! DEFINE TADA$IPT ".ADA"
- $! DEFINE TADA$OPT ".ROS"
- $!
- $! ******************************************
- $ DEFINE HLP$LIBRARY_2 DBA2:[ADARAPP.HELP]ADK.HLB
- $! ******************************************
- $!
- $! This file sets up all the commands and assignments required
- $! by a user for RAPPORT-4
- $!
- $! ************************************************
- $assign DBA2:[RAPPVMS3] rapport4:
- $assign __DBA2:[RAPPVMS3.] rapproot4:
- $assign DBA2:[RAPPVMS3] rapport2:
- $assign __DBA2:[RAPPVMS3.] rapproot2:
- $assign DBA2:[adaRAPP] adarap:
- $assign __DBA2:[adaRAPP.] araproot:
- $ ASSIGN araproot:[fortran]USERCALL.EXE ADA$SUBNUC
- $set command/tables=adarap:r4user.exe
- $! ************************************************
- $define hlp$library rapport4:rapport4.hlb
- $rapie*r :== zzzz
- $err*or :== "@rapport4:errorlist.com"
- $t*ype :== type
- $lo*gout :== logout
- !
- ! OPTIONS --- Set Global Logical names stating which
- ! RAPPORT-4 options are installed and which
- ! older RAPPORT versions were installed.
- !
- $!
- $! Set up flags to be used throughout the RAPPORT-4 tests and
- $! maintainence command files.
- $!
- $ TRUE == 1 .eq. 1
- $ FALSE == 1 .eq. 0
- $!
- $! DCL Global variable Installed ? Description
- $!
- $ opt_nucleus_backup== TRUE ! Nucleus with Backup and Recovery
- $ opt_data_security == TRUE ! Data security
- $ opt_multi_user == TRUE ! Multi-user
- $ opt_rapide == TRUE ! RAPIDE
- $ opt_rapide_de == FALSE ! Rapide Data-Entry
- $ opt_rapier == TRUE ! Rapier
- $ opt_fortran_66 == FALSE ! (Option Unavailable)
- $ opt_fortran_77 == TRUE ! FORTRAN-77 interface
- $ opt_COBOL == FALSE ! COBOL interface
- $ opt_pascal == TRUE ! PASCAL interface
- $!
- $! determine which , if any, old RAPPORT versions exist at this site
- $!
- $ opt_rapport_1_02 == FALSE ! determines need for CSVAMP
- $ opt_rapport_3 == FALSE ! determines need for C4VAMP
- $!
- $ RLINK :== @adarap:MUFORAPPL.COM
- $ RSLINK :== @adarap:SUFORAPPL.COM
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --LOGIN.COM
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- $ SET NOVERIFY
- $ ON CONTROL_Y THEN CONTINUE
- $ SET DEF DBA2:[ADARAPP]
- $ SET PROT/PROT=(O:RWED,S:RWE,G:R)/DEFAULT
- $ @adarap.com
- $ defs :== @[adarapp.distoct84.adk]tadadefs
- $ ADK :== SET DEFAULT dba2:[adarapp.ADK]
- $ HOME :== SET DEFAULT dba2:[adarapp.ada]
- $ UNI :== SET DEF DBA2:[ADARAPP.UNITREP]
- $ STARTNUC :== SUBMIT/NOPRINTER/LOG=dba2:[adarapp]NUCLEUS.LOG DBA2:[ADARAPP]NUCRUN.COM
- $ STOPNUC :== SERVICE/NAME=ADANUC
- $ STARTUNIT :== SUBMIT/NOPRINT [ADARAPP.UNITREP]NUCRUN
- $ STOPUNIT :== SERVICE/NAME=UNITNUC
- $ UP :== SET DEFAULT [-]
- $ SBQ :== SHOW QUEUE SYS$BATCH/ALL
- $ SPQ :== SHOW QUEUE TXA6/ALL
- $ PRI :== PRINT/QUEUE=TXA6/NOFLAG
- $ DD :== DIR *.DIR
- $ TODRA0 :== @DBA2:[ADARAPP]TODRA0.COM
- $ USER1 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER1]
- $ USER2 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER2]
- $ USER3 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER3]
- $ USER4 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER4]
- $ USER5 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER5]
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --MUFORAPPL.COM
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- !
- ! MUFORAPPL --- This is the build file for a multi-user Fortran
- ! application program.
- !
- $link/trace/exe='P1.exe -
- 'P1, -
- rapproot4:[objs]umblok, -
- mduslbblk, -
- rapproot4:[libs]userlb/lib, -
- nuinlb/lib, -
- nodslb/lib, -
- mpinlb/lib, -
- poollb/lib,mduslb/lib,corelb/lib
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --NUCRUN.COM
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- NUCLEUS
- ADANUC
- araproot:[unitrep]unitrep
- ENTER
- CONT
- EXIT
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --R4USER.COM
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- $!
- $! This file sets up all the commands and assignments required
- $! by a user for RAPPORT-4
- $!
- $assign DRA1:[RAPPORT4] rapport4:
- $assign __DRA1:[RAPPORT4.] rapproot4:
- $assign DRA1:[RAPPORT4] rapport2:
- $assign __DRA1:[RAPPORT4.] rapproot2:
- $set command/tables=rapport4:r4user.exe
- $define hlp$library rapport4:rapport4.hlb
- $rapie*r :== zzzz
- $err*or :== "@rapport4:errorlist.com"
- $t*ype :== type
- $lo*gout :== logout
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --R4USERCLD.COM
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- $copy sys$library:dcltables.exe r4user.exe
- $set command/output=r4user.exe -
- /tables=r4user.exe -
- r4user.cld
- $set command/tables=r4user.exe
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --REFRESH.COM
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- copy rapproot4:[companies.fortran]'P1.dbs -
- araproot:[companies]'P1.dbs
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --SUFORAPPL.COM
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- !
- ! SUFORAPPL --- This is the build file for a single-user Fortran
- ! application program.
- !
- $link/trace/exe='P1.exe -
- 'P1.OBJ, -
- rapproot4:[objs]usblok, -
- mduslbblk, -
- rapproot4:[libs]userlb/lib, -
- nucolb/lib, -
- lonulb/lib, -
- singlb/lib, -
- nodslb/lib, -
- poollb/lib,mduslb/lib,corelb/lib
-
-