home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / sql / rapport.src < prev    next >
Encoding:
Text File  |  1988-05-03  |  276.3 KB  |  10,049 lines

  1. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. --USERCALL.FOR
  3. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. C-------------------------------------------------------------------------
  5. C
  6. C   This program is set up as a concurrently running process on the 
  7. C Startrapport request . On receipt of a message the type of service call
  8. C required is discovered by reference to the first long word of the message
  9. C buffer , the appropriate service handler is then called .
  10. C
  11. C   After setting up the channel number to be equivalent to the mailbox
  12. C the program performs :-
  13. C
  14. C                 loop
  15. C                     { Read a message from the channel
  16. C                       Call appropriate handler
  17. C                       Write a message to the channel }
  18. C                 until EndRapport
  19. C
  20. C
  21. C   Each handler receives the values it needs by equivalence with the message
  22. C buffer and returns answers in the same way .
  23. C
  24. C   A word (INTEGER*2) message buffer is used but this is in fact not
  25. C neccesary ( it just in fact makes things more complex ) but as the program
  26. C as it stands works (and is just a demonstration) it was decided to leave well
  27. C alone.
  28. C
  29. C---------------------------------------------------------------------------
  30.  
  31.  
  32.     PROGRAM USERCALL
  33.  
  34.  
  35. C IRET is the return code from the activation of a system service .
  36.  
  37.         INTEGER*4 IRET
  38.  
  39. C SYS$ASSIGN is the system service to assign a channel number to a logical
  40. C name .
  41.  
  42.     INTEGER*4 SYS$ASSIGN
  43.  
  44. C SYS$QIOW is the system service for message passing .
  45.  
  46.         INTEGER*4 SYS$QIOW
  47.  
  48. C CHAN is the number of the channel that is connected to the mailbox .
  49.  
  50.         INTEGER*2 CHAN
  51.  
  52. C NMESS is the number of bytes to read from and write to the mailbox .
  53.  
  54.     INTEGER*2 NMESS
  55.  
  56.  
  57.  
  58. C WBUF is the message buffer that is filled from and emptied into the mailbox .
  59.  
  60.     COMMON/MSGBUF/WBUF(100)
  61.         INTEGER*2 WBUF
  62.  
  63.  
  64. C LWBUF is a long word equivalent of the INTEGER*2 message buffer .
  65.  
  66.         INTEGER LWBUF(2)
  67.         EQUIVALENCE (LWBUF,WBUF)
  68.  
  69.  
  70. C WHAT is the number of the system service required and is equivalent to the
  71. C first long word of the message buffer .
  72.  
  73.     INTEGER*4 WHAT
  74.         EQUIVALENCE (WHAT,LWBUF(1))
  75.  
  76.  
  77. C IODEF and SSDEF are the definition file for the system services and the
  78. C input output services .
  79.  
  80.         INCLUDE '($IODEF)/NOLIST'
  81.         INCLUDE '($SSDEF)/NOLIST'
  82.  
  83.  
  84.  
  85. C Actual program start :-
  86.  
  87.  
  88.         WRITE(6,900)
  89. 900     FORMAT(1X,'  Sub-Nucleus activation ..... '/)
  90.  
  91.  
  92. C NMESS is set to 200 so 200 bytes (or 50 long-words) are read from the mailbox
  93.  
  94.         NMESS=200
  95.  
  96. C The logical channel sys$error is assigned and identification channel number .
  97.  
  98.         IRET=SYS$ASSIGN('SYS$ERROR',CHAN,,)
  99.  
  100.  
  101.  
  102. C This is the main program loop if WHAt is equal to 2 then the last RAPPORT
  103. C service called was EndRapport.WHAT is first set to to 0 to ensure that
  104. C the loop is not terminated accidently.
  105.  
  106.         WHAT=0
  107.  
  108.         DO WHILE (WHAT.NE.2)
  109.  
  110.  
  111. C Read 200 bytes from the mailbox and put it into the word message buffer.
  112.  
  113.             IRET=SYS$QIOW(,%VAL(CHAN),%VAL(IO$_READVBLK),,,,WBUF,
  114.      *                     %VAL(NMESS),,,,)
  115.  
  116. C Dispatch accordin to the value of what .
  117.  
  118.             IF (WHAT.EQ.1) CALL R8STAR
  119.             IF (WHAT.EQ.2) CALL R8ENDR    
  120.             IF (WHAT.EQ.3) CALL R8TRAN
  121.         IF (WHAT.EQ.4) CALL R8COMT
  122.         IF (WHAT.EQ.5) CALL R8BKTK
  123.         IF (WHAT.EQ.6) CALL R8INRT
  124.         IF (WHAT.EQ.7) CALL R8UPDT
  125.         IF (WHAT.EQ.8) CALL R8STOR
  126.         IF (WHAT.EQ.9) CALL R8COND
  127.         IF (WHAT.EQ.10) CALL R8FECH
  128.         IF (WHAT.EQ.11) CALL R8DELT
  129.         IF (WHAT.EQ.13) CALL R8STKY
  130.         IF (WHAT.EQ.14) CALL R8HOLD
  131.         IF (WHAT.EQ.15) CALL R8ENRV
  132.         IF (WHAT.EQ.17) CALL R8RTRV
  133.         IF (WHAT.EQ.18) CALL R8CLFI
  134.         IF (WHAT.EQ.19) CALL R8LOCK
  135.  
  136. C Write 200 bytes to the mailbox from the message buffer .
  137.  
  138.             IRET=SYS$QIOW(,%VAL(CHAN),%VAL(IO$_WRITEVBLK),,,,WBUF,
  139.      *                     %VAL(NMESS),,,,)
  140.  
  141.  
  142.  
  143.         ENDDO
  144.  
  145.         WRITE(6 , 901)
  146. 901    FORMAT(1X,'  Sub-Nucleus shutdown .....'/)
  147.  
  148.  
  149.         STOP
  150.     END
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.     SUBROUTINE R8STAR
  158.  
  159. C------------------------------------------------------------------------------
  160. C
  161. C Function        : Fortran interface to the RAPPORT R0STAR.
  162. C                      * The routine calls RAPPORT r0star .
  163. C                      * Sets the variable LIPB to true which indicates that 
  164. C                        any data transfreal is via the ipb .
  165. C                      * Fills the common arrays NOFDS , IFPT , JWTEST .
  166. C
  167. C
  168. C Input arguments : None.
  169. C
  170. C Output arguments: None.
  171. C
  172. C Common blocks   : The common message buffer WBUF.This is equivalenced to 
  173. C                   a long word buffer to extract the StartRapport parameters.
  174. C                   RCLIPB/LIPB : LIPB is a flag which indicates where the 
  175. C                                 nucleus is to get the record data from.If it
  176. C                                 is false then this place is the FORTRAN 
  177. C                                 program buffers if true then the IPB.It is
  178. C                                 set to flase by R0STAR.
  179. C                   RCJDD/JDDATA : Holds various RAPPORT parameters.
  180. C                   RCPPRM/PARAMS : Holds various RAPPORT parameters .
  181. C                   RCFDS/NOFDS : Given the number of a file returns the number
  182. C                                 fields in that file .
  183. C                   RCFPT/IFPT : Given the number of  a file returns the number
  184. C                                of the first field in the file .
  185. C                   RCWOR/NWORRB : Given a file number returns the amount of
  186. C                                  space needed in the ipb by that file .
  187. C                   RCJWT : [?] .
  188. C                   RCIIPB/IIPB : IIPB given a file number returns an index
  189. C                                 into the ipb for that file.
  190. C                     
  191. C Called by       : Main.
  192. C
  193. C Calls           : RAPPORT : R0STAR
  194. C                   RAPPORT : R0RDUS (to fill up common areas)
  195. C
  196. C Author          : MDD                    ( 4/3/85 )     Version 1.0
  197. C
  198. C Amendments      :                        (  /  /  )
  199. C
  200. C Notes           : 
  201. C
  202. C------------------------------------------------------------------------------
  203.  
  204.  
  205.  
  206. C KNAME  is the name of the DDF that is passed to the RAPPORT R0STAR. in
  207. C our case though the DDF name will be specified from the terminal and so
  208. C Kname will be given a dummy value before the call to R0STAR.
  209.  
  210.     CHARACTER KNAME
  211.  
  212. C NKNANE is the length of the dummy dcf name .
  213.  
  214.     INTEGER NKNAME
  215.  
  216.  
  217. C LFPRES is a boolean value indicating to R0STAR whether a correct DDF
  218. C name has been specified in the call.In our case we have not so LFPRES
  219. C will be set to .FALSE.
  220.  
  221.         LOGICAL LFPRES
  222.  
  223. C FILNO is the last file accessed and is received from the message buffer
  224. C by equivalence with LWBUF (5)
  225.  
  226.         INTEGER FILNO
  227.  
  228. C JFSCU is a check sum on the file structure equivalenced from the message
  229. C buffer LWBUF (3)
  230.  
  231.       INTEGER JFSCU
  232.  
  233. C JTASK is a unique number assigned by R0STAR to identify the calling process
  234. C This is returned to the process by equivalencing JTASK to the message buffer
  235. C LWBUF (4)
  236.  
  237.     INTEGER JTASK
  238.  
  239. C JER is an indication of the success of R0STAR.Returned by equivalence to the
  240. C message buffer LWBUF (2)
  241.  
  242.     INTEGER JER
  243.  
  244. C LER is the error return from r0rdus .
  245.  
  246.     INTEGER LER
  247.  
  248.  
  249.  
  250.  
  251. C See header .
  252.  
  253.     COMMON/RCLIPB/LIPB
  254.     LOGICAL LIPB
  255.  
  256.  
  257.     COMMON/MSGBUF/WBUF(5)
  258.     INTEGER LWBUF(10)
  259.         EQUIVALENCE (LWBUF,WBUF)
  260.  
  261.  
  262.  
  263.     EQUIVALENCE (JER,LWBUF(2)) , (JFSCU,LWBUF(3))
  264.     EQUIVALENCE (JTASK,LWBUF(4)) , (FILNO,LWBUF(5))
  265.  
  266.  
  267.  
  268. C See Header .
  269.  
  270.     COMMON/RCJDD/JDDATA(18)
  271.     INTEGER JDDATA
  272.  
  273.         EQUIVALENCE ( JDDATA(1) , JFILE )
  274.         EQUIVALENCE ( JDDATA(2) , JFLPFD )
  275.         EQUIVALENCE ( JDDATA(4) , JFIELD )
  276.  
  277.  
  278. C JFILE is the number of file specified in the ddf .
  279. C JFLPFD is
  280. C JFIELD is
  281.  
  282.  
  283.     INTEGER JFILE , JFLPFD , JFIELD  
  284.  
  285.  
  286. C IFILE is a count used to fill up the iipb
  287.  
  288.     INTEGER IFILE
  289.  
  290.  
  291. C See Header .
  292.  
  293.     COMMON/RCPPRM/PARAMS(100)
  294.     INTEGER PARAMS
  295.  
  296.         EQUIVALENCE ( PARAMS(6) , MFIELD )
  297.         EQUIVALENCE ( PARAMS(7) , MFILE )
  298.         EQUIVALENCE ( PARAMS(21) , MWOFBF )
  299.         EQUIVALENCE ( PARAMS(36) , MWOIPB )
  300.         EQUIVALENCE ( PARAMS(96) , MFLPFD )
  301.  
  302.     INTEGER MFILED , MFILE 
  303.     INTEGER MWOFBF , MWOIPB , MFLPFD
  304.  
  305.  
  306. C See Header .
  307.  
  308.     COMMON/RCFDS/NOFDS(55)
  309.     COMMON/RCFPT/IFPT(55)
  310.     COMMON/RCWOR/NWORRB(55)
  311.     COMMON/RCJWT/JWTEST(301)
  312.  
  313.  
  314.  
  315.     INTEGER NOFDS , IFPT , NWORRB , JWTEST
  316.  
  317.  
  318. C See Header .
  319.  
  320.     COMMON/RCIIPB/IIPB(55)
  321.     INTEGER IIPB 
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. C Before calling R0STAR the values pertaining to the DDF are set to dummy
  329. C but consistent values.KNAME is a space and the length of KNAME is 1.
  330.  
  331.         NKNAME=1
  332.     KNAME=' '
  333.     LFPRES=.FALSE.
  334.  
  335. C        WRITE(6,1000)
  336. C 1000    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0STAR'/)
  337.  
  338.     CALL R0STAR(KNAME,NKNAME,LFPRES,FILNO,JFSCU,JTASK,JER)
  339.  
  340. C        WRITE(6,1001)
  341. C 1001    FORMAT(1X,'  %USERCALL-TRACEMSG-EXITING RAPPORT R0STAR'/)
  342.  
  343.  
  344. C LIPB is set to true so that record transferal is by means of the ipb .
  345.  
  346.     LIPB=.TRUE.
  347.  
  348.  
  349.  
  350. C Fill up the common array IFPT ( Given a file number returns the number of
  351. C the first field in that file )
  352.  
  353.     CALL R0RDUS(4 , 1 , JFILE , IFPT , MFILE , 1 , RAPERR )
  354.  
  355. C Fill the common array NWORRB ( Given a file number return the amoun of space
  356. C in the ipb required to hold a record of that file ) .
  357.  
  358.     CALL R0RDUS(6 , 1 , JFILE-1 , NWORRB , MFILE , 1 , RAPERR )
  359.  
  360. C Fill the common array nofds ( Given a file number return the number of fields
  361. C in that file ) .
  362.  
  363.     CALL R0RDUS(8 ,1 , JFILE-1 , NOFDS , MFILE , 1, RAPERR )
  364.  
  365. C Fill the common array jwtest .
  366.  
  367.     CALL R0RDUS(29 , 1 , JFLPFD-1 , JWTEST , MFLPFD , 1, RAPERR )
  368.  
  369. C Fill the ipb ( given a file number returns the index into the ipb)
  370. C iipb ( n ) := iipb ( n-1 ) + Amount of space required by file n-1
  371.  
  372.     IIPB(1)=1
  373.     DO IFILE=1,JFILE-1
  374.            IIPB(IFILE+1)=IIPB(IFILE)+NWORRB(IFILE)
  375.         ENDDO
  376.  
  377.  
  378.  
  379.  
  380.  
  381.     RETURN
  382.         END
  383.  
  384.  
  385.  
  386.  
  387.     SUBROUTINE R8ENDR
  388.  
  389. C------------------------------------------------------------------------------
  390. C
  391. C Function        : Fortran interface to the RAPPORT R0ENDR.
  392. C
  393. C Input arguments : None.
  394. C
  395. C Output arguments: None.
  396. C
  397. C Common blocks   : The common message buffer WBUF which is accessed via an
  398. C                   equivalent long word buffer .
  399. C
  400. C Called by       : MAIN.
  401. C
  402. C Calls           : RAPPORT : R0ENDR.
  403. C
  404. C Author          : MDD                    (  /  /  )     Version 1.0
  405. C
  406. C Amendments      :                        (  /  /  )
  407. C
  408. C Notes           : 
  409. C
  410. C------------------------------------------------------------------------------
  411.  
  412.  
  413.  
  414. C JER is an indication of the success of R0ENDR.
  415.  
  416.     INTEGER JER
  417.  
  418.  
  419.         COMMON/MSGBUF/WBUF(10)
  420.         INTEGER LWBUF(10)
  421.      INTEGER*2 WBUF
  422.       EQUIVALENCE (LWBUF,WBUF)
  423.  
  424.         EQUIVALENCE (JER,LWBUF(2))
  425.  
  426. C    WRITE(6,200)
  427. C 200    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0ENDR'/)
  428.  
  429.         CALL R0ENDR(JER)
  430.  
  431. C    WRITE(6,201)
  432. C 201    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVIVIN RAPPORT R0ENDR'/)
  433.  
  434.         RETURN
  435.     END
  436.  
  437.  
  438.  
  439.     SUBROUTINE R8TRAN
  440.  
  441.  
  442. C------------------------------------------------------------------------------
  443. C
  444. C Function        : Fortran interface to the RAPPORT R0TRAN. 
  445. C
  446. C Input arguments : None.
  447. C
  448. C Output arguments: None.
  449. C
  450. C Common blocks   : The common message buffer WBUF which is accessed by
  451. C                   reference to an equivalent long word buffer .
  452. C
  453. C Called by       : Main.
  454. C
  455. C Calls           : RAPPORT : R0TRAN.
  456. C
  457. C Author          :                        (  /  /  )     Version 1.0
  458. C
  459. C Amendments      :                        (  /  /  )
  460. C
  461. C Notes           : 
  462. C
  463. C------------------------------------------------------------------------------
  464.  
  465.  
  466.  
  467. C NTRANS is the unique number assigned by rapport to identify this particular
  468. C transaction.
  469.  
  470.     INTEGER NTRANS
  471.  
  472. C JER is an indication of the success of R0TRAN
  473.  
  474.     INTEGER JER
  475.  
  476.  
  477.     COMMON/MSGBUF/WBUF(10)
  478.     INTEGER*2 WBUF
  479.     INTEGER LWBUF(10)
  480.     EQUIVALENCE (WBUF,LWBUF)
  481.  
  482.         EQUIVALENCE (JER,LWBUF(2)),(NTRANS,LWBUF(3))
  483.  
  484. C    WRITE(6,202)
  485. C 202    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERINR RAPPORT R0TRAN'/)
  486.  
  487.     CALL R0TRAN(NTRANS,JER)
  488. C    WRITE(6,203)
  489. C 203    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0TRAN'/)
  490.  
  491.         RETURN
  492.     END
  493.  
  494.  
  495.  
  496.     SUBROUTINE R8COMT
  497.  
  498. C------------------------------------------------------------------------------
  499. C
  500. C Function        : Fortran interface to the RAPPORT R8COMT.
  501. C
  502. C Input arguments : None.
  503. C
  504. C Output arguments: None.
  505. C
  506. C Common blocks   : The common message buffer WBUF which is accessed by
  507. C                   referace to an equivalent long word buffer .
  508. C
  509. C Called by       : Main.
  510. C
  511. C Calls           : RAPPORT R0COMT
  512. C
  513. C Author          :                        (  /  /  )     Version 1.0
  514. C
  515. C Amendments      :                        (  /  /  )
  516. C
  517. C Notes           : 
  518. C
  519. C------------------------------------------------------------------------------
  520.  
  521.  
  522.  
  523. C JER is an indication of the success of R0COMT.
  524.  
  525.     INTEGER JER
  526.  
  527.  
  528.     COMMON/MSGBUF/WBUF(10)
  529.     INTEGER*2 WBUF
  530.     INTEGER LWBUF(10)
  531.     EQUIVALENCE (WBUF,LWBUF)
  532.  
  533.       EQUIVALENCE (JER,LWBUF(2))
  534.  
  535. C    WRITE(6,204)
  536. C 204    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0COMT'/)
  537.  
  538.     CALL R0COMT(JER)
  539.  
  540. C    WRITE(6,205)
  541. C 205    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0COMT'/)
  542.  
  543.     RETURN
  544.     END
  545.  
  546.  
  547.  
  548.     SUBROUTINE R8BKTK
  549.  
  550. C------------------------------------------------------------------------------
  551. C
  552. C Function        : The fortran interface to the RAPPORT R0BKTK.
  553. C
  554. C Input arguments : None.
  555. C
  556. C Output arguments: None.
  557. C
  558. C Common blocks   : The common message buffer WBUF which is accessed by 
  559. C                   referenced to the equivalent long word buffer .
  560. C
  561. C Called by       : Main.
  562. C
  563. C Calls           : RAPPORT : R0BKTK.
  564. C
  565. C Author          :                        (  /  /  )     Version 1.0
  566. C
  567. C Amendments      :                        (  /  /  )
  568. C
  569. C Notes           : 
  570. C
  571. C------------------------------------------------------------------------------
  572.  
  573.  
  574.  
  575. C JER is an indication of the success of R0COMT.
  576.  
  577.     INTEGER JER
  578.  
  579.  
  580.     COMMON/MSGBUF/WBUF(10)
  581.     INTEGER*2 WBUF
  582.     INTEGER LWBUF(10)
  583.     EQUIVALENCE (WBUF,LWBUF)
  584.  
  585.     EQUIVALENCE (JER,LWBUF(2))
  586.  
  587. C    WRITE(6,206)
  588. C 206    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0BKTK'/)
  589.  
  590.     CALL R0BKTK(JER)
  591. C    WRITE(6,207)
  592. C 207    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0BKTK'/)
  593.  
  594.  
  595.     RETURN
  596.     END
  597.  
  598.  
  599.  
  600.     SUBROUTINE R8INRT
  601.  
  602. C------------------------------------------------------------------------------
  603. C
  604. C Function        : Fortran interfac eto the RAPPORT R0INRT.It's actions are
  605. C                           * Place the record to insert(obtained from the
  606. C                             message buffer) into the ipb .
  607. C                           * Call RAPPORT R0INRT.
  608. C
  609. C Input arguments : None.
  610. C
  611. C Output arguments: None.
  612. C
  613. C Common blocks   : The common message buffer WBUF accessed by
  614. C                   reference to the equivalent long word buffer .
  615. C
  616. C Called by       : Main.
  617. C
  618. C Calls           : PUTREC , RAPPORT : R0INRT
  619. C
  620. C Author          :                        (  /  /  )     Version 1.0
  621. C
  622. C Amendments      :                        (  /  /  )
  623. C
  624. C Notes           : 
  625. C
  626. C------------------------------------------------------------------------------
  627.  
  628.  
  629. C JFILE is the file number of the file to insert into.
  630.  
  631.     INTEGER JFILE
  632.  
  633. C JER is an indication of the success of R0INRT.
  634.  
  635.     INTEGER JER
  636.  
  637. C STRADD is the start address in the message buffer of the record to insert.
  638. C This is the first byte after the static parameters have been equivalenced.
  639.  
  640.     INTEGER STRADD
  641.  
  642.  
  643.     COMMON/MSGBUF/WBUF(10)
  644.     INTEGER*2 WBUF
  645.     INTEGER LWBUF(10)
  646.     EQUIVALENCE (WBUF,LWBUF)
  647.  
  648.     EQUIVALENCE (JER,LWBUF(2)) , (JFILE,LWBUF(3))
  649.  
  650.  
  651. C The record starts at long word 4 of the message buffer.This is because
  652. C the last static parameter is at long word 3 .
  653.  
  654.       STRADD=4
  655.  
  656. C Place the record into the ipb from the message buffer .
  657.  
  658.         CALL PUTREC(JFILE,STRADD)
  659.  
  660. C    WRITE(6,210)
  661. C 210    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0INRT'/)
  662.  
  663.     CALL R0INRT(JFILE,JER)
  664.  
  665. C    WRITE(6,211)
  666. C 211    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0INRT'/)
  667.  
  668.  
  669.       RETURN
  670.     END
  671.  
  672.  
  673.  
  674.  
  675.     SUBROUTINE R8UPDT
  676.  
  677. C------------------------------------------------------------------------------
  678. C
  679. C Function        : Fortran interface to the RAPPORT R0UPDT.It's actions are
  680. C                           * Place the record to UPDATYE(obtained from the
  681. C                             message buffer) into the ipb .
  682. C                           * Call RAPPORT R0UPDT.
  683. C
  684. C Input arguments : None.
  685. C
  686. C Output arguments: None.
  687. C
  688. C Common blocks   : The common message buffer WBUF.Accessed by reference to
  689. C                   the equivalent long word buffer .
  690. C
  691. C Called by       : Main.
  692. C
  693. C Calls           : PUTREC , RAPPORT : R0UPDT
  694. C
  695. C Author          :                        (  /  /  )     Version 1.0
  696. C
  697. C Amendments      :                        (  /  /  )
  698. C
  699. C Notes           : 
  700. C
  701. C------------------------------------------------------------------------------
  702.  
  703.  
  704. C JFILE is the file number of the file to update into.
  705.  
  706.     INTEGER JFILE
  707.  
  708. C JER is an indication of the success of R0UPDT.
  709.  
  710.     INTEGER JER
  711.  
  712. C STRADD is the start address in the message buffer of the record to update.
  713. C This is the first byte after the static parameters have been equivalenced.
  714.  
  715.     INTEGER STRADD
  716.  
  717.  
  718.     COMMON/MSGBUF/WBUF(10)
  719.     INTEGER*2 WBUF
  720.     INTEGER LWBUF(10)
  721.     EQUIVALENCE (WBUF,LWBUF)
  722.  
  723.     EQUIVALENCE (JER,LWBUF(2)) , (JFILE,LWBUF(3))
  724.  
  725.  
  726. C The record starts at long word 4 of the message buffer.This ia because
  727. C the last static parameter is at long word 3 .
  728.  
  729.       STRADD=4
  730.  
  731. C Put the record into the ipb from the message buffer
  732.  
  733.         CALL PUTREC(JFILE,STRADD)
  734.  
  735. C    WRITE(6,214)
  736. C 214    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0UPDT'/)
  737.  
  738.     CALL R0UPDT(JFILE,JER)
  739.  
  740. C    WRITE(6,215)
  741. C 215    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0UPDT'/)
  742.  
  743.  
  744.       RETURN
  745.     END
  746.  
  747.  
  748.  
  749.  
  750.     SUBROUTINE R8STOR
  751.  
  752. C------------------------------------------------------------------------------
  753. C
  754. C Function        : Fortran interface to the RAPPORT R0STOR.It's actions are
  755. C                           * Place the record to STORE(obtained from the
  756. C                             message buffer into the program buffers.
  757. C                           * Call RAPPORT R0STOR.
  758. C
  759. C Input arguments : None.
  760. C
  761. C Output arguments: None.
  762. C
  763. C Common blocks   : The common message buffer WBUF accessed by reference to the
  764. C                   equivalent long word buffer .
  765. C
  766. C Called by       : Main.
  767. C
  768. C Calls           : PUTREC , RAPPORT : R0STOR
  769. C
  770. C Author          :                        (  /  /  )     Version 1.0
  771. C
  772. C Amendments      :                        (  /  /  )
  773. C
  774. C Notes           : 
  775. C
  776. C------------------------------------------------------------------------------
  777.  
  778.  
  779. C JFILE is the file number of the file to to stote the record.
  780.  
  781.     INTEGER JFILE
  782.  
  783. C JER is an indication of the success of R0STOR.
  784.  
  785.     INTEGER JER
  786.  
  787. C STRADD is the start address in the message buffer of the record to STORE.
  788. C This is the first byte after the static parameters have been equivalenced.
  789.  
  790.     INTEGER STRADD
  791.  
  792.  
  793.     COMMON/MSGBUF/WBUF(10)
  794.     INTEGER*2 WBUF
  795.     INTEGER LWBUF(10)
  796.     EQUIVALENCE (WBUF,LWBUF)
  797.  
  798.     EQUIVALENCE (JER,LWBUF(2)) , (JFILE,LWBUF(3))
  799.  
  800.  
  801. C The record starts at long word 4 of the message buffer.This is because
  802. C the last static parameter is at long word 3 .
  803.  
  804.       STRADD=4
  805.  
  806. C Put the record into the ipb from the message buffer
  807.  
  808.         CALL PUTREC(JFILE,STRADD)
  809.  
  810. C    WRITE(6,217)
  811. C 217    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0STOR'/)
  812.  
  813.     CALL R0STOR(JFILE,JER)
  814.  
  815. C    WRITE(6,218)
  816. C 218    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0STOR'/)
  817.  
  818.  
  819.       RETURN
  820.     END
  821.  
  822.  
  823.     SUBROUTINE R8COND
  824.  
  825. C------------------------------------------------------------------------------
  826. C
  827. C Function        : Fortarn interface to the RAPPORT R0COND . R0COND places the
  828. C                   specified condition onto the  specified file . It's actions
  829. C                   are :- 
  830. C
  831. C                          * Set the number of elements to be found on the
  832. C                            right hand side of the condition .
  833. C                          * Place the right hand side into an array from the
  834. C                            message buffer .
  835. C                          * Calculate the size o fthe array .
  836. C                          * Call r0cond .
  837. C
  838. C Input arguments : None .
  839. C
  840. C Output arguments: None .
  841. C
  842. C Common blocks   : The common message buffer wbuf accessed by reference to
  843. C                   the equivalent long word buffer .
  844. C                   RCIFT/IFTYPE : Given a field number returns an index into
  845. C                                  FTYPE (The array of type information )
  846. C                   RCFT/FTYPE : The array of type information :-
  847. C                                  Element 1 - Base type of the field 
  848. C                                  Element 2 - Number of elements in the field
  849. C                                              0 => scalar .
  850. C                                  Element 3 - Number of characters in the 
  851. C                                              string if a character field .
  852. C                   RCFPT/IFPT : Given a file number returns the number of the
  853. C                                first field in that file .
  854. C
  855. C Called by       : MAIN .
  856. C
  857. C Calls           : RAPPORT : R0COND , R8CV01 , R8CV02 , R8CV03 .
  858. C
  859. C Author          : MDD                    (  /  /  )     Version 1.0
  860. C
  861. C Amendments      :                        (  /  /  )
  862. C
  863. C Notes           : 
  864. C
  865. C------------------------------------------------------------------------------
  866.  
  867.  
  868.  
  869.     COMMON/MSGBUF/WBUF(1)
  870.     INTEGER*2 WBUF
  871.  
  872.     INTEGER LWBUF(10)
  873.     EQUIVALENCE (LWBUF,WBUF)
  874.  
  875.  
  876. C JFILE is the number of the file to place the condition on .
  877.  
  878.     INTEGER JFILE
  879.  
  880. C JCOND is the current number of this condition in the overall condition set .
  881.  
  882.     INTEGER JCOND
  883.  
  884. C JFLD is the absolute number of the field that the condition is on .
  885.  
  886.     INTEGER JFLD
  887.  
  888. C JANAL is the any all switch . -1 => any element test -2 =>  all element
  889. C test 1=> subscript 0 otherwise .
  890.  
  891.     INTEGER JANAL
  892.  
  893. C If a particular array element is being testes then this is the subscript
  894. C of this element .
  895.  
  896.     INTEGER JSUBSC
  897.  
  898. C Thisa is the number of the relation i.e. EQUAL = 1 , .. UNEQUAL = 6 .
  899.  
  900.     INTEGER JREL
  901.  
  902. C Thios is the number of the conjunction with an added modifier to indicate
  903. C the level of the conjunction.A modifier of 10 is added for eachg level in the
  904. C Condition structure.
  905.  
  906.     INTEGER JCONJ
  907.  
  908.  
  909.     EQUIVALENCE (JFILE , LWBUF(2)) , (JCOND , LWBUF(3))
  910.     EQUIVALENCE (JFLD , LWBUF(4)) , (JANAL , LWBUF(5))
  911.     EQUIVALENCE (JSUBSC , LWBUF(6)) , (JREL , LWBUF(7))
  912.     EQUIVALENCE ( JCONJ , LWBUF(8))
  913.  
  914. C See Header .
  915.  
  916.     COMMON/RCFPT/IFPT(4)
  917.     INTEGER IFPT
  918.  
  919. C See Header .
  920.  
  921.     COMMON/RCFT/FTYPE(1)
  922.     INTEGER FTYPE
  923.  
  924. C See Header .
  925.  
  926.     COMMON/RCIFT/IFTYPE(1)
  927.     INTEGER IFTYPE
  928.  
  929. C TYPTR is the pointer into the FTYPE array for a particular field.
  930.  
  931.     INTEGER TYPTR
  932.  
  933. C ITYPE is the base type of the field ( 1 => integer , 2 => real ,
  934. C 3 => character ) .
  935.  
  936.     INTEGER ITYPE
  937.  
  938. C NELS is the number of elements in the field ( 0 => scalar ) .
  939.  
  940.     INTEGER NELS
  941.  
  942. C NCHARS is the number of characters in the string if the type is character .
  943.  
  944.     INTEGER NCHARS
  945.  
  946. C ARRINT is the array holding the condition right hand side in internal form .
  947.  
  948.     INTEGER ARRINT (50)
  949.  
  950. C JSIZ is the calculated size of arrint .
  951.  
  952.     INTEGER JSIZ
  953.  
  954. C STRADD is the position in the word buffer where the right hand side starts .
  955.  
  956.     INTEGER STRADD
  957.  
  958.  
  959. C    WRITE(6,55)
  960. C 55    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING SUBROUTINE R8COND'/)
  961.  
  962.  
  963.  
  964.  
  965.  
  966.     TYPTR=IFTYPE(JFLD)
  967.  
  968.     ITYPE=FTYPE(TYPTR)
  969.  
  970.  
  971. C If JANAL is not equal to 0 then the right hand side is a single element of
  972. C an array and so is scalar.Otherwise it is anormal field size .
  973.  
  974.     IF (JANAL.NE.0) THEN 
  975.                 NELS=0
  976.            ELSE NELS=FTYPE(TYPTR+1)
  977.         ENDIF
  978.  
  979.         IF(ITYPE.EQ.3) NCHARS=FTYPE(TYPTR+2)
  980.  
  981. C STRADD is the position in the long word buffer of the right hand side (9)
  982. C modifeid to give the corresponding position in the word buffer .
  983.  
  984.     STRADD=(9*2)-1        
  985.  
  986.  
  987. C Depending on the type of the field convert it to internal form .
  988.  
  989.     IF (ITYPE.EQ.1) CALL R8CV01(-1,STRADD,NELS,ARRINT)
  990.     IF (ITYPE.EQ.2) CALL R8CV02(-1,STRADD,NELS,ARRINT)
  991.     IF (ITYPE.EQ.3) CALL R8CV03(-1,STRADD,NELS,NCHARS,ARRINT)
  992.      
  993. C Calculate the size of the array holding the right hand side in internal
  994. C format . A character right hand side size is the number of elements * 
  995. C number of characters rounded up to the nearest long word .
  996.  
  997.     IF (NELS.EQ.0) NELS=1
  998.     IF (ITYPE.EQ.1) JSIZ=NELS
  999.     IF (ITYPE.EQ.2) JSIZ=NELS
  1000.     IF (ITYPE.EQ.3) JSIZ=((NELS*NCHARS)+3)/4
  1001.  
  1002. C The field number must be made relative to the start of the particular file
  1003. C and not absolut (relative to the start of the ddf )
  1004.  
  1005.         JFLD=JFLD-IFPT(JFILE)+1
  1006.  
  1007.  
  1008.  
  1009.     CALL R0COND( JFILE , JCOND , JFLD , JANAL , JSUBSC , JREL 
  1010.      *               , JCONJ , ARRINT , JSIZ , .FALSE. )
  1011.  
  1012.  
  1013.  
  1014.     RETURN
  1015.     END
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.     SUBROUTINE R8FECH
  1023.  
  1024. C------------------------------------------------------------------------------
  1025. C
  1026. C Function        : Fortran interface to the RAPPORT R0FECH.It's actions are:-
  1027. C                           * Set the Level pointer ICT201 to the value of
  1028. C                             level gained from the message buffer.( this
  1029. C                             is now obsolete but is left in to avoid 
  1030. C                             complexities .
  1031. C                           * Call R0FECH.
  1032. C                           * Transfer the fetched record from the ipb to
  1033. C                             the message buffer.
  1034. C
  1035. C Input arguments : None.
  1036. C
  1037. C Output arguments: None.
  1038. C
  1039. C Common blocks   : The common message buffer WBUF reference by access to the
  1040. C                   equivalent long word buffer .
  1041. C                   The common area holding the level RCCTLP.
  1042. C
  1043. C Called by       : Main.
  1044. C
  1045. C Calls           : RAPPORT : R0FECH , GETREC
  1046. C
  1047. C Author          :                        (  /  /  )     Version 1.0
  1048. C
  1049. C Amendments      :                        (  /  /  )
  1050. C
  1051. C Notes           : 
  1052. C
  1053. C------------------------------------------------------------------------------
  1054.  
  1055.  
  1056. C JFILE is the number ofthe file to fetch the record from.
  1057.  
  1058.     INTEGER JFILE
  1059.  
  1060. C JCOUNT is an indicater to the last record that was fetched.
  1061.  
  1062.     INTEGER JCOUNT
  1063.  
  1064. C JGETT is the retrieval strategy that was set by the caller.If it is found by
  1065. C RAPPORT to be 0 then a strategy is chosen and returned for futute use.
  1066.  
  1067.     INTEGER JGETT
  1068.  
  1069. C NCOND is the number of conditions imposed upon this particular fetch.
  1070.  
  1071.     INTEGER NCOND
  1072.  
  1073. C LEVEL is the level in the search stack and the actual stack pointer
  1074. C ICT201 is made equal to this.This is not actually needed but is kept in
  1075. C to avoid the complexities of it's removal .
  1076.  
  1077.     INTEGER LEVEL
  1078.  
  1079. C STRADD is the address in the message buffer into which to start loading 
  1080. C the fetched record.It is in fact the first longword of the buffer after
  1081. C the equivalence of the static parameters.
  1082.  
  1083.     INTEGER STRADD
  1084.  
  1085.  
  1086.  
  1087.     COMMON/MSGBUF/WBUF(10)
  1088.     INTEGER*2 WBUF
  1089.     INTEGER LWBUF(10)
  1090.     EQUIVALENCE (WBUF,LWBUF)
  1091.         COMMON/RCCTLP/ICT201
  1092.  
  1093. C IC201 is the actual search loop stack pointer set equal to LEVEL.
  1094.  
  1095.     INTEGER ICT201
  1096.  
  1097.     EQUIVALENCE (JCOUNT,LWBUF(2)),(LEVEL,LWBUF(3))
  1098.     EQUIVALENCE (JFILE,LWBUF(4)),(JGETT,LWBUF(5))
  1099.     EQUIVALENCE (NCOND,LWBUF(6))
  1100.  
  1101.         COMMON/RCIPB/IPB(25)
  1102.         INTEGER IPB
  1103.         
  1104. C This is not needed but is kept in to avoid complexities .
  1105.  
  1106.         ICT201=LEVEL
  1107.  
  1108.  
  1109. C    WRITE(6,219)
  1110. C 219    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0FECH'/)
  1111.  
  1112.     CALL R0FECH(JFILE,JCOUNT,JGETT,NCOND)
  1113.  
  1114. C    WRITE(6,220)
  1115. C 220    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0FECH'/)
  1116.  
  1117.  
  1118. C STRADD is the start address in the message buffer to place the fetched record
  1119. C It is 7 because the last static parameter is at address 6 .
  1120.  
  1121.     STRADD=7
  1122.  
  1123. C Place the record into the message buffer from the ipb .
  1124.  
  1125.     CALL GETREC(JFILE,STRADD)
  1126.  
  1127.     RETURN 
  1128.     END
  1129.  
  1130.  
  1131.  
  1132.  
  1133.     SUBROUTINE R8DELT
  1134.  
  1135. C------------------------------------------------------------------------------
  1136. C
  1137. C Function        : Fortran interface to the RAPPORT R0DELT.
  1138. C
  1139. C Input arguments : None.
  1140. C
  1141. C Output arguments: None.
  1142. C
  1143. C Common blocks   : The common message buffer WBUF accessed by reference to
  1144. C                   the equivalent long word buffer .
  1145. C
  1146. C Called by       : Main
  1147. C
  1148. C Calls           : RAPPORT : R0DELT
  1149. C
  1150. C Author          :                        (  /  /  )     Version 1.0
  1151. C
  1152. C Amendments      :                        (  /  /  )
  1153. C
  1154. C Notes           : 
  1155. C
  1156. C------------------------------------------------------------------------------
  1157.  
  1158.  
  1159.  
  1160. C JFILE is the number of the file to delete from.
  1161.  
  1162.     INTEGER JFILE
  1163.  
  1164. C NCOND is the number of conditions applying to this particular deletion.
  1165.  
  1166.     INTEGER NCOND
  1167.  
  1168. C JCOUNT is returned as the number of records deleted by R0DELT or if an
  1169. C error has occurred it is signified by jcount.
  1170.  
  1171.     INTEGER JCOUNT
  1172.  
  1173.  
  1174.  
  1175.     COMMON/MSGBUF/WBUF(10)
  1176.     INTEGER*2 WBUF
  1177.     INTEGER LWBUF(10)
  1178.     EQUIVALENCE (WBUF,LWBUF)
  1179.  
  1180.       EQUIVALENCE (JCOUNT,LWBUF(2)),(JFILE,LWBUF(3))
  1181.     EQUIVALENCE (NCOND,LWBUF(4))
  1182.  
  1183.  
  1184. C    WRITE(6,223)
  1185. C 223    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0DELT'/)
  1186.     CALL R0DELT(JFILE,JCOUNT,NCOND)
  1187. C    WRITE(6,224)
  1188. C 224    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0DELT'/)
  1189.  
  1190.  
  1191.     RETURN
  1192.     END
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.     SUBROUTINE R8STKY
  1200.  
  1201. C------------------------------------------------------------------------------
  1202. C
  1203. C Function        : Fortran interface to the RAPPORT R0STKY.
  1204. C
  1205. C Input arguments : None.
  1206. C
  1207. C Output arguments: None.
  1208. C
  1209. C Common blocks   : The common message buffer WBUF accessed by reference to the
  1210. C                   equivalent long word buffer .
  1211. C                   RCFPT/IFPT : Given a file number returns the number of the
  1212. C                                first field in that fiule .
  1213. C  
  1214. C Called by       : Main.
  1215. C
  1216. C Calls           : R0STKY
  1217. C
  1218. C Author          :                        (  /  /  )     Version 1.0
  1219. C
  1220. C Amendments      :                        (  /  /  )
  1221. C
  1222. C Notes           : 
  1223. C
  1224. C------------------------------------------------------------------------------
  1225.  
  1226.  
  1227.  
  1228. C JFILE is the numebr of the file that the sort keys are for.
  1229.  
  1230.     INTEGER JFILE
  1231.  
  1232. C NSKEY is the number of keys in the sort key array.
  1233.  
  1234.     INTEGER NSKEY
  1235.  
  1236. C JSOKEY is the array of sort keys.It is dimensioned with the dummy parameter
  1237. C one as we do not at compile time know it's size.
  1238.  
  1239.     INTEGER JSOKEY(1)
  1240.  
  1241. C JTYPE is an indicater of the type of retrieval that will be performed on
  1242. C the finally ordered file.0  => a normal retrieval and 1 => a unique
  1243. C retrieval.
  1244.  
  1245.     INTEGER JTYPE
  1246.  
  1247. C SKCNT is a count used when modifying the sort keys to be reative to the 
  1248. C start of the file .
  1249.  
  1250.     INTEGER SKCNT
  1251.  
  1252. C See Header .
  1253.  
  1254.     COMMON/RCFPT/IFPT(3)
  1255.     INTEGER IFPT
  1256.  
  1257.  
  1258.     COMMON/MSGBUF/WBUF(10)
  1259.     INTEGER*2 WBUF
  1260.     INTEGER LWBUF(10)
  1261.     EQUIVALENCE (WBUF,LWBUF)
  1262.  
  1263.  
  1264.     EQUIVALENCE (JFILE,LWBUF(2)),(JTYPE,LWBUF(3))
  1265.     EQUIVALENCE (NSKEY,LWBUF(4)),(JSOKEY(1),LWBUF(5))
  1266.  
  1267.  
  1268. C The Sort keys that are obtained from the message buffer are in absolute
  1269. C form i.e. relative to the first field of the first file in the ddf but are 
  1270. C required in relative form ( to the first field of this file ) .
  1271.  
  1272.     DO SKCNT=1,NSKEY
  1273.            IF (JSOKEY(SKCNT).GT.0) 
  1274.      *        JSOKEY(SKCNT)=JSOKEY(SKCNT)-IFPT(JFILE)+1
  1275.            IF (JSOKEY(SKCNT).LT.0) 
  1276.      *        JSOKEY(SKCNT)=JSOKEY(SKCNT)+IFPT(JFILE)-1
  1277.         ENDDO
  1278.  
  1279.  
  1280.  
  1281. C    WRITE(6,227)
  1282. C 227    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0STKY'/)
  1283.  
  1284.     CALL R0STKY(JFILE,JSOKEY,NSKEY,JTYPE)
  1285.  
  1286. C    WRITE(6,228)
  1287. C 228    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0STKY'/)
  1288.  
  1289.     RETURN
  1290.     END
  1291.  
  1292.  
  1293.  
  1294.  
  1295.     SUBROUTINE R8HOLD
  1296.  
  1297. C------------------------------------------------------------------------------
  1298. C
  1299. C Function        : Fortran interface to the RAPPORT R0HOLD.
  1300. C
  1301. C Input arguments : None.
  1302. C
  1303. C Output arguments: None.
  1304. C
  1305. C Common blocks   : The common message buffer WBUF accessed by reference to the
  1306. C                   equivalent long word buffer .
  1307. C
  1308. C Called by       : Main
  1309. C
  1310. C Calls           : RAPPORT : R0HOLD
  1311. C
  1312. C Author          :                        (  /  /  )     Version 1.0
  1313. C
  1314. C Amendments      :                        (  /  /  )
  1315. C
  1316. C Notes           : 
  1317. C
  1318. C------------------------------------------------------------------------------
  1319.  
  1320.  
  1321.  
  1322. C JFILE is the number of the file on which to perform the HOLD.
  1323.  
  1324.     INTEGER JFILE
  1325.  
  1326. C NCOND is the number of conditions preiously set .
  1327.  
  1328.     INTEGER NCOND
  1329.  
  1330. C NREC IS RETURNED AS THE NUMBER OF RECORDS IN THE HOLD
  1331.  
  1332.     INTEGER NREC
  1333.  
  1334.  
  1335.     COMMON/MSGBUF/WBUF(10)
  1336.     INTEGER*2 WBUF
  1337.     INTEGER LWBUF(10)
  1338.     EQUIVALENCE (WBUF,LWBUF)
  1339.  
  1340.     EQUIVALENCE (JFILE,LWBUF(2)),(NCOND,LWBUF(3))
  1341.     EQUIVALENCE (NREC,LWBUF(4))
  1342.  
  1343.  
  1344.  
  1345. C    WRITE(6,229)
  1346. C 229    FORMAT(1X,'  %USERCALL-TRACEMSG-ENETRING RAPPORT R0HOLD'/)
  1347.  
  1348.     CALL R0HOLD(JFILE,NCOND,NREC)
  1349.  
  1350. C    WRITE(6,230)
  1351. C 230    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0HOLD'/)
  1352.  
  1353.  
  1354.     RETURN
  1355.     END
  1356.  
  1357.  
  1358.  
  1359.     SUBROUTINE R8ENRV
  1360.  
  1361. C------------------------------------------------------------------------------
  1362. C
  1363. C Function        : Fortarn interface to the RAPPORT R0ENRV.
  1364. C
  1365. C Input arguments : None.
  1366. C
  1367. C Output arguments: None.
  1368. C
  1369. C Common blocks   : The common mesage buffer WBUF accessed by refernce to the
  1370. C                   equivalent long word buffer .
  1371. C
  1372. C Called by       : Main.
  1373. C
  1374. C Calls           : RAPPORT : R0ENRV
  1375. C
  1376. C Author          :                        (  /  /  )     Version 1.0
  1377. C
  1378. C Amendments      :                        (  /  /  )
  1379. C
  1380. C Notes           : 
  1381. C
  1382. C------------------------------------------------------------------------------
  1383.  
  1384.  
  1385.  
  1386.  
  1387. C JCOUNT is a pointer to the last record in the file to be retrieved.
  1388.  
  1389.     INTEGER JCOUNT
  1390.  
  1391. C JER is an indication of the success of R0ENRV
  1392.  
  1393.     INTEGER JER
  1394.  
  1395.  
  1396.  
  1397.     COMMON/MSGBUF/WBUF(10)
  1398.     INTEGER*2 WBUF
  1399.     INTEGER LWBUF(10)
  1400.     EQUIVALENCE (WBUF,LWBUF)
  1401.  
  1402.     EQUIVALENCE (JER,LWBUF(2)),(JCOUNT,LWBUF(3))
  1403.  
  1404.  
  1405. C    WRITE(6,231)
  1406. C 231    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0ENRV'/)
  1407.  
  1408.     CALL R0ENRV(JCOUNT,JER)
  1409.  
  1410. C    WRITE(6,232)
  1411. C 232    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0ENRV'/)
  1412.  
  1413.  
  1414.     RETURN
  1415.     END
  1416.  
  1417.  
  1418.  
  1419.  
  1420.     
  1421.     SUBROUTINE R8RTRV
  1422.  
  1423. C------------------------------------------------------------------------------
  1424. C
  1425. C Function        : Fortran interface to the RAPPORT R0RTRV.This gets a record
  1426. C                   from a file that is sorted . 
  1427. C
  1428. C Input arguments : None .
  1429. C
  1430. C Output arguments: None .
  1431. C
  1432. C Common blocks   : The common message buffer WBUF referenced by accessing 
  1433. C                   the equivalent long word buffer .
  1434. C
  1435. C Called by       : MAIN .
  1436. C
  1437. C Calls           : RAPPORT : R0RTRV ; GETREC .
  1438. C
  1439. C Author          :                        (  /  /  )     Version 1.0
  1440. C
  1441. C Amendments      :                        (  /  /  )
  1442. C
  1443. C Notes           : 
  1444. C
  1445. C------------------------------------------------------------------------------
  1446.  
  1447. C JFILE is the number of the file that was sorted .
  1448.  
  1449.         INTEGER JFILE
  1450.  
  1451.  
  1452. C JCOUNT is the count variable inicating the last record fetched.
  1453.  
  1454.     INTEGER JCOUNT
  1455.  
  1456. C STRADD is the start address in the message buffer to return the record to
  1457.  
  1458.     INTEGER STRADD
  1459.  
  1460.  
  1461.     COMMON/MSGBUF/WBUF(5)
  1462.     INTEGER*2 WBUF
  1463.  
  1464.     INTEGER LWBUF(4)
  1465.     EQUIVALENCE (LWBUF,WBUF)
  1466.  
  1467.     EQUIVALENCE (LWBUF(2),JCOUNT)
  1468.         EQUIVALENCE (LWBUF(3),JFILE)
  1469.  
  1470. C    WRITE(6,482)
  1471. C 482    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING SUBROUTINE R8RTRV'/)
  1472.  
  1473. C     WRITE(6,483)
  1474. C 483    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0RTRV'/)
  1475.  
  1476.     CALL R0RTRV ( JCOUNT )
  1477.  
  1478. C    WRITE(6,484)
  1479. C 484    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0RTRV'/)
  1480.  
  1481. C The address in the message buffer to start placing the record in is
  1482. C long word 4 as thalast static parameter is at long word 3 .
  1483.  
  1484.     STRADD = 4
  1485.  
  1486. C Place the record in the message buffer from the ipb .
  1487.  
  1488.     CALL GETREC ( JFILE , STRADD )
  1489.  
  1490. C    WRITE(6,485)
  1491. C 485    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING SUBROUTINE R8RTRV'/)
  1492.  
  1493.     RETURN
  1494.     END
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.     SUBROUTINE R8CLFI
  1501.  
  1502. C------------------------------------------------------------------------------
  1503. C
  1504. C Function        : Fortran interface to the RAPPORT : R0CLFI
  1505. C
  1506. C Input arguments : None.
  1507. C
  1508. C Output arguments: None.
  1509. C
  1510. C Common blocks   : The common message buffer WBUF accessed by refernce to the
  1511. C                   equivalent long word buffer .
  1512. C
  1513. C Called by       : Main.
  1514. C
  1515. C Calls           : RAPPORT : R0CLFI
  1516. C
  1517. C Author          :                        (  /  /  )     Version 1.0
  1518. C
  1519. C Amendments      :                        (  /  /  )
  1520. C
  1521. C Notes           : 
  1522. C
  1523. C------------------------------------------------------------------------------
  1524.  
  1525.  
  1526.  
  1527. C JFILE is the number of the file to clear.
  1528.  
  1529.     INTEGER JFILE
  1530.  
  1531. C JER is an indication of the success of R0CLFI.
  1532.  
  1533.      INTEGER JER
  1534.  
  1535.  
  1536.  
  1537.     COMMON/MSGBUF/WBUF(10)
  1538.     INTEGER*2 WBUF
  1539.     INTEGER LWBUF(10)
  1540.     EQUIVALENCE (WBUF,LWBUF)
  1541.  
  1542.     EQUIVALENCE (JER,LWBUF(2)),(JFILE,LWBUF(3))
  1543.  
  1544.  
  1545. C    WRITE(6,235)
  1546. C 235    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0CLFI'/)
  1547.     CALL R0CLFI(JFILE,JER)
  1548. C    WRITE(6,236)
  1549. C 236    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0CLFI'/)
  1550.  
  1551.  
  1552.     RETURN
  1553.     END
  1554.  
  1555.  
  1556.     SUBROUTINE R8LOCK
  1557.  
  1558. C------------------------------------------------------------------------------
  1559. C
  1560. C Function        : Fortran interface to the RAPPORT R0LOCK.
  1561. C
  1562. C Input arguments : None.
  1563. C
  1564. C Output arguments: None.
  1565. C
  1566. C Common blocks   : The common message buffer WBUF refernced by equivalence to
  1567. C                   a long word buffer .
  1568. C
  1569. C Called by       : Main.
  1570. C
  1571. C Calls           : RAPPORT : R0LOCK
  1572. C
  1573. C Author          :                        (  /  /  )     Version 1.0
  1574. C
  1575. C Amendments      :                        (  /  /  )
  1576. C
  1577. C Notes           : 
  1578. C
  1579. C------------------------------------------------------------------------------
  1580.  
  1581.  
  1582.  
  1583. C JFILE is the number o fthe file to lock
  1584.  
  1585.     INTEGER JFILE
  1586.  
  1587. C JREWO is the switch indivating how to lock the file 
  1588.  
  1589.     INTEGER JREWO
  1590.  
  1591. C JER is an indication of the success of R0LOCK
  1592.  
  1593.     INTEGER JER
  1594.  
  1595.  
  1596.  
  1597.     COMMON/MSGBUF/WBUF(10)
  1598.     INTEGER*2 WBUF
  1599.     INTEGER LWBUF(10)
  1600.     EQUIVALENCE (WBUF,LWBUF)
  1601.  
  1602.     EQUIVALENCE (JER,LWBUF(2)),(JFILE,LWBUF(3))
  1603.     EQUIVALENCE (JREWO,LWBUF(4))
  1604.  
  1605. c    write(6,444)jfile,jrewo
  1606. c444    format(1x,'file , rw'i,i/)
  1607.  
  1608.  
  1609. c    WRITE(6,237)
  1610. c237    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING RAPPORT R0LOCK'/)
  1611.  
  1612.     CALL R0LOCK(JFILE,JREWO,JER)
  1613.  
  1614. c    WRITE(6,238)
  1615. c238    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING RAPPORT R0LOCK'/)
  1616.  
  1617.  
  1618.     RETURN 
  1619.     END
  1620.  
  1621.  
  1622.  
  1623.  
  1624.     SUBROUTINE PUTREC(JFILE,STRADD)
  1625.  
  1626. C------------------------------------------------------------------------------
  1627. C
  1628. C Function        : Moves a record , field by field , from the message buffer
  1629. C                   to the program buffers.An outline algorithm for this is:-
  1630. C                          * Get the number of fields in the record
  1631. C                          * LOOP for the number of fields
  1632. C                                 - find the type of the field
  1633. C                                 - depending on the type call a conversion
  1634. C                                   routine.
  1635. C                                   1.) R8CV01 (integer conversion)
  1636. C                                   2.) R8CV02 (real conversion)
  1637. C                                   3.) R8CVo3 (character conversion)
  1638. C                          * end LOOP
  1639. C
  1640. C Input arguments : JFILE:- The number of the file of the record.Used to
  1641. C                           extract information about the number of fields
  1642. C                           in the record.
  1643. C                   STRADD:-the start address in the message buffer to get
  1644. C                           the record from.
  1645. C
  1646. C Output arguments: None.
  1647. C
  1648. C Common blocks   : RCFDS/NOFDS : information about the number of fields in a
  1649. C                                 given file.
  1650. C                   RCIFT/IFTYPE : given a field number returns a pointer into
  1651. C                                  the type description array tp get type
  1652. C                                  information for that particular field.
  1653. C                   RCFT/FTYPE : holds the array of type information.The 
  1654. C                                structure of this array is -
  1655. C                                 Element 1 - type
  1656. C                                 Element 2 - number of elemnts in field
  1657. C                                 Element 3 - if character then number of 
  1658. C                                             chars in string.
  1659. C                   RCFPT/IFPT : contains an array giving for every file the 
  1660. C                                number of the first field.
  1661. C                   RCJWT/JWTEST : } These are to locate the positiuon of a
  1662. C                   RCIF/IFTEST :  } particular field in the ipb .
  1663. C                   RCIPB/IPB : The ipb .
  1664. C                   RCIIPB/IIPB : The index into the ipb for a given file .
  1665. C                   RCPPRM/ : Various rapport parameters .
  1666. C
  1667. C Called by       : R8INRT , R8UPDT , R8STOR
  1668. C
  1669. C Calls           : R8cv01 , R8CV02 , R8cv03
  1670. C
  1671. C Author          :                        (  /  /  )     Version 1.0
  1672. C
  1673. C Amendments      :                        (  /  /  )
  1674. C
  1675. C Notes           : 
  1676. C
  1677. C------------------------------------------------------------------------------
  1678.  
  1679.  
  1680.  
  1681. C JFILE is the number of the file concerned
  1682.  
  1683.     INTEGER JFILE
  1684.  
  1685. C STRADD is the start address in the message buffer to transfer the record
  1686. C from.
  1687.  
  1688.     INTEGER STRADD
  1689.  
  1690. C TOTFDS is the number of fields in the file.
  1691.  
  1692.     INTEGER TOTFDS
  1693.  
  1694. C FLDNO is a count variable indicating the field to transfer.
  1695.  
  1696.     INTEGER FLDNO
  1697.  
  1698. C FSTFLD is the number of the first field in the file
  1699.  
  1700.     INTEGER FSTFLD
  1701.  
  1702. C LSTFLD is the number of the last field in the file.
  1703.  
  1704.     INTEGER LSTFLD
  1705.  
  1706. C TYPE is information about the base type of the field , NELS is the number
  1707. C of elements in the filed and NCHARS is,if the field is a character field
  1708. C the number of characters in the string.
  1709.  
  1710.     INTEGER ITYPE,NELS,NCHARS
  1711.  
  1712. C BUFADD is the current position in the message buffer in words.The inputed
  1713. C address is in long words so BUFADD:=STRADD*2-1.
  1714.  
  1715.     INTEGER BUFADD
  1716.  
  1717. C TYPTR is a pointer into the type array for a particular fiel;d
  1718.  
  1719.     INTEGER TYPTR
  1720.  
  1721. C ARRINT  is the field value in internal form returned by the R*CV'S as the
  1722. C conversion of the ADA field value
  1723.  
  1724.     INTEGER ARRINT(50)
  1725.  
  1726. C RFLDNO is the number of the field relatve to the start of the file.
  1727.  
  1728.     INTEGER RFLDNO
  1729.  
  1730. C IFLD
  1731.  
  1732.     INTEGER IFLD
  1733.  
  1734.  
  1735. C See Header .
  1736.  
  1737.     COMMON/RCFDS/NOFDS(1)
  1738.     INTEGER NOFDS
  1739.  
  1740. C See Header .
  1741.  
  1742.     COMMON/RCFPT/IFPT(1)
  1743.     INTEGER IFPT
  1744.  
  1745. C See Header .
  1746.  
  1747.     COMMON/RCFT/FTYPE(1)
  1748.     INTEGER FTYPE
  1749.  
  1750. C See Header .
  1751.  
  1752.     COMMON/RCIFT/IFTYPE(1)
  1753.     INTEGER IFTYPE
  1754.  
  1755. C See Header .
  1756.  
  1757.     COMMON/RCJWT/JWTEST(1)
  1758.     INTEGER JWTEST
  1759.  
  1760. C See Header .
  1761.  
  1762.     COMMON/RCIF/IFTEST(1)
  1763.     INTEGER IFTEST
  1764.  
  1765. C See Header
  1766.  
  1767.     COMMON/RCPPRM/DUMM1(20),MWOFBF,DUMM2(14),MWOIPB
  1768.     INTEGER DUMM1,DUMM2,MWOFBF,MWOIPB
  1769.  
  1770. C See Header .
  1771.  
  1772.     COMMON/RCIPB/IPB(300)
  1773.     INTEGER IPB
  1774.  
  1775. C See Header .
  1776.  
  1777.     COMMON/RCIIPB/IIPB(1)
  1778.     INTEGER IIPB
  1779.  
  1780.  
  1781. C LER is the error returned from RUCPEI
  1782.  
  1783.     LOGICAL LER
  1784.  
  1785.  
  1786. C    WRITE(6,208)
  1787. C 208    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING ROUTINE PUTREC'/)
  1788.  
  1789.  
  1790. C Set up the parameters required .
  1791. C TOTFDS the number of fields in the file .
  1792. C FSTFLD is the number of the first field in the file .
  1793. C LSTFLD is the number of the last field in the file.
  1794. C BUFADD is the address in the message buffer to get the record in words .
  1795.  
  1796.  
  1797.     TOTFDS=NOFDS(JFILE)
  1798.     FSTFLD=IFPT(JFILE)
  1799.     LSTFLD=FSTFLD+TOTFDS-1
  1800.     BUFADD=(STRADD*2)-1
  1801.  
  1802.  
  1803.  
  1804.  
  1805. C LOOP to transfer all the fields to the ipb .
  1806.  
  1807.     DO FLDNO=FSTFLD,LSTFLD
  1808.  
  1809.  
  1810. C Set up the field dependant variables .
  1811. C TYPTR is the index into ftype for the field .
  1812. C ITYPE is the base type of the field .
  1813. C NELS is the number of elements of this base type in the field .
  1814. C NCHARS if the base type is character is the number of elements in tyhe string
  1815.  
  1816.        TYPTR=IFTYPE(FLDNO)
  1817.        ITYPE=FTYPE(TYPTR)
  1818.        NELS=FTYPE(TYPTR+1)
  1819.        IF (ITYPE.EQ.3) NCHARS=FTYPE(TYPTR+2)
  1820.  
  1821. C Get the field from the message buffer into arrint and convert into
  1822. C internal format . BUFADD is returned as the address in the word byffer of
  1823. C the next field .
  1824.  
  1825.        IF (ITYPE.EQ.1) CALL R8CV01(-1,BUFADD,NELS,ARRINT)
  1826.        IF (ITYPE.EQ.2) CALL R8CV02(-1,BUFADD,NELS,ARRINT)
  1827.        IF (ITYPE.EQ.3) CALL R8CV03(-1,BUFADD,NELS,NCHARS,
  1828.      *                                 ARRINT)
  1829.  
  1830.  
  1831.  
  1832.  
  1833. C RFLDNO is the number of the field relative to the start of the file .
  1834. C IFLD is the index into jwtest for that field .
  1835.  
  1836.             RFLDNO=FLDNO-FSTFLD
  1837.        IFLD=IFTEST(JFILE)+RFLDNO
  1838.  
  1839.  
  1840. C Transfer the field in internal format from arrint to the ipb . The format
  1841. C of the call is :-
  1842. C
  1843. C       RUCPEI ( Sense , TypeInformation , StartOfTypeInformation ,
  1844. C                EndOfTypeInformation , ipb , SizeOfIpb ,
  1845. C                WhereInIpbToStartLoading , 0 => Transfer all elements ,
  1846. C                arrint , SizeOfArrint , WhereToTRansferFromInArrint , LER )
  1847. C
  1848. C Sense = -1  =>  ARRINT -> IPB
  1849. C Sense = 1  =>  IPB -> ARRINT
  1850. C
  1851.  
  1852.  
  1853.  
  1854.        CALL RUCPEI(-1,FTYPE,IFTYPE(FLDNO),IFTYPE(FLDNO+1)-1,
  1855.      *                 IPB,MWOIPB,IIPB(JFILE)+JWTEST(IFLD)-1,0,
  1856.      *                 ARRINT,50,1,LER)
  1857.  
  1858.  
  1859.  
  1860.     ENDDO
  1861.  
  1862.  
  1863.  
  1864.  
  1865. C    WRITE(6,209)
  1866. C 209    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING ROUTINE PUTREC'/)
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.     RETURN
  1873.     END
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.     SUBROUTINE GETREC(JFILE,STRADD)
  1880.  
  1881. C------------------------------------------------------------------------------
  1882. C
  1883. C Function        : Moves a record , field by field , from the message buffer
  1884. C                   to the program buffers.An outline algorithm for this is:-
  1885. C                          * Get the number of fields in the record
  1886. C                          * LOOP for the number of fields
  1887. C                                 - find the type of the field
  1888. C                                 - depending on the type call a conversion
  1889. C                                   routine.
  1890. C                                   1.) R8CV01 (integer conversion)
  1891. C                                   2.) R8CV02 (real conversion)
  1892. C                                   3.) R8CVo3 (character conversion)
  1893. C                          * end LOOP
  1894. C
  1895. C Input arguments : JFILE:- The number of the file of the record.Used to
  1896. C                           extract information about the number of fields
  1897. C                           in the record.
  1898. C                   STRADD:-the start address in the message buffer to get
  1899. C                           the record from.
  1900. C
  1901. C Output arguments: None.
  1902. C Common blocks   : RCFDS/NOFDS : information about the number of fields in a
  1903. C                                 given file.
  1904. C                   RCIFT/IFTYPE : given a field number returns a pointer into
  1905. C                                  the type description array tp get type
  1906. C                                  information for that particular field.
  1907. C                   RCFT/FTYPE : holds the array of type information.The 
  1908. C                                structure of this array is -
  1909. C                                 Element 1 - type
  1910. C                                 Element 2 - number of elemnts in field
  1911. C                                 Element 3 - if character then number of 
  1912. C                                             chars in string.
  1913. C                   RCFPT/IFPT : contains an array giving for every file the 
  1914. C                                number of the first field.
  1915. C                   RCJWT/JWTEST : } These are to locate the positiuon of a
  1916. C                   RCIF/IFTEST :  } particular field in the ipb .
  1917. C                   RCIPB/IPB : The ipb .
  1918. C                   RCIIPB/IIPB : The index into the ipb for a given file .
  1919. C                   RCPPRM/ : Various rapport parameters .
  1920. C
  1921. C Called by       : R8INRT , R8UPDT , R8STOR
  1922. C
  1923. C Calls           : R8cv01 , R8CV02 , R8cv03
  1924. C
  1925. C Author          :                        (  /  /  )     Version 1.0
  1926. C
  1927. C Amendments      :                        (  /  /  )
  1928. C
  1929. C Notes           : 
  1930. C
  1931. C------------------------------------------------------------------------------
  1932.  
  1933.  
  1934.  
  1935. C JFILE is the number of the file concerned
  1936.  
  1937.     INTEGER JFILE
  1938.  
  1939. C STRADD is the start address in the message buffer to transfer the record
  1940. C from.
  1941.  
  1942.     INTEGER STRADD
  1943.  
  1944. C TOTFDS is the number of fields in the file.
  1945.  
  1946.     INTEGER TOTFDS
  1947.  
  1948. C FLDNO is a count variable indicating the field to transfer.
  1949.  
  1950.     INTEGER FLDNO
  1951.  
  1952. C FSTFLD is the number of the first field in the file
  1953.  
  1954.     INTEGER FSTFLD
  1955.  
  1956. C LSTFLD is the number of the last field in the file.
  1957.  
  1958.     INTEGER LSTFLD
  1959.  
  1960. C TYPE is information about the base type of the field , NELS is the number
  1961. C of elements in the filed and NCHARS is,if the field is a character field
  1962. C the number of characters in the string.
  1963.  
  1964.     INTEGER ITYPE,NELS,NCHARS
  1965.  
  1966. C BUFADD is the current position in the message buffer in words.The inputed
  1967. C address is in long words so BUFADD:=STRADD*2-1.
  1968.  
  1969.     INTEGER BUFADD
  1970.  
  1971. C TYPTR is a pointer into the type array for a particular fiel;d
  1972.  
  1973.     INTEGER TYPTR
  1974.  
  1975. C ARRINT  is the field value in internal form returned by the R*CV'S as the
  1976. C conversion of the ADA field value
  1977.  
  1978.     INTEGER ARRINT(50)
  1979.  
  1980. C RFLDNO is the number of the field relatve to the start of eth file.
  1981.  
  1982.     INTEGER RFLDNO
  1983.  
  1984. C IFLD
  1985.  
  1986.     INTEGER IFLD
  1987.  
  1988.  
  1989. C See Header .
  1990.  
  1991.     COMMON/RCFDS/NOFDS(1)
  1992.     INTEGER NOFDS
  1993.  
  1994. C See Header .
  1995.  
  1996.     COMMON/RCFPT/IFPT(1)
  1997.     INTEGER IFPT
  1998.  
  1999. C See Header .
  2000.  
  2001.     COMMON/RCFT/FTYPE(1)
  2002.     INTEGER FTYPE
  2003.  
  2004. C See Header .
  2005.  
  2006.     COMMON/RCIFT/IFTYPE(1)
  2007.     INTEGER IFTYPE
  2008.  
  2009. C See Header .
  2010.  
  2011.     COMMON/RCJWT/JWTEST(1)
  2012.     INTEGER JWTEST
  2013.  
  2014. C See Header .
  2015.  
  2016.     COMMON/RCIF/IFTEST(1)
  2017.     INTEGER IFTEST
  2018.  
  2019. C See Header .
  2020.  
  2021.     COMMON/RCPPRM/DUMM1(20),MWOFBF,DUMM2(14),MWOIPB
  2022.     INTEGER DUMM1,DUMM2,MWOFBF,MWOIPB
  2023.  
  2024. C See Header .
  2025.  
  2026.     COMMON/RCIPB/IPB(300)
  2027.     INTEGER IPB
  2028.  
  2029. C See Header .
  2030.  
  2031.     COMMON/RCIIPB/IIPB(1)
  2032.     INTEGER IIPB
  2033.  
  2034. C LER is the error returned from rucpei .
  2035.  
  2036.     LOGICAL LER
  2037.  
  2038.  
  2039. C    WRITE(6,769)
  2040. C 769    FORMAT(1X,'  %USERCALL-TRACEMSG-ENTERING ROUTINE GETREC'/)
  2041.  
  2042.  
  2043. C Set up the parameters required .
  2044. C TOTFDS the number of fields in the file .
  2045. C FSTFLD is the number of the first field in the file .
  2046. C LSTFLD is the number of the last field in the file.
  2047. C BUFADD is the address in the message buffer to put the record in words .
  2048.  
  2049.     TOTFDS=NOFDS(JFILE)
  2050.     FSTFLD=IFPT(JFILE)
  2051.     LSTFLD=FSTFLD+TOTFDS-1
  2052.     BUFADD=(STRADD*2)-1
  2053.  
  2054.  
  2055. C LOOP for the number of fileds .
  2056.  
  2057.     DO FLDNO=FSTFLD,LSTFLD
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064. C RFLDNO is the number of the field relative to the start of the file .
  2065. C IFLD is the index into jwtest for that field .
  2066.  
  2067.             RFLDNO=FLDNO-FSTFLD
  2068.        IFLD=IFTEST(JFILE)+RFLDNO
  2069.  
  2070.  
  2071. C Transfer the field in internal format from arrint to the ipb . The format
  2072. C of the call is :-
  2073. C
  2074. C       RUCPEI ( Sense , TypeInformation , StartOfTypeInformation ,
  2075. C                EndOfTypeInformation , ipb , SizeOfIpb ,
  2076. C                WhereInIpbToStartLoading , 0 => Transfer all elements ,
  2077. C                arrint , SizeOfArrint , WhereToTRansferFromInArrint , LER )
  2078. C
  2079. C Sense = -1  =>  ARRINT -> IPB
  2080. C Sense = 1  =>  IPB -> ARRINT
  2081. C
  2082.  
  2083.  
  2084.  
  2085.        CALL RUCPEI(1,FTYPE,IFTYPE(FLDNO),IFTYPE(FLDNO+1)-1,
  2086.      *                 IPB,MWOIPB,IIPB(JFILE)+JWTEST(IFLD)-1,0,
  2087.      *                 ARRINT,50,1,LER)
  2088.  
  2089.  
  2090. C Set up the field dependant variables .
  2091. C TYPTR is the index into ftype for the field .
  2092. C ITYPE is the base type of the field .
  2093. C NELS is the number of elements of this base type in the field .
  2094. C NCHARS if the base type is character is the number of elements in tyhe string
  2095.  
  2096.  
  2097.        TYPTR=IFTYPE(FLDNO)
  2098.        ITYPE=FTYPE(TYPTR)
  2099.        NELS=FTYPE(TYPTR+1)
  2100.        IF (ITYPE.EQ.3) NCHARS=FTYPE(TYPTR+2)
  2101.  
  2102.        IF (ITYPE.EQ.1) CALL R8CV01(1,BUFADD,NELS,ARRINT)
  2103.        IF (ITYPE.EQ.2) CALL R8CV02(1,BUFADD,NELS,ARRINT)
  2104.        IF (ITYPE.EQ.3) CALL R8CV03(1,BUFADD,NELS,NCHARS,
  2105.      *                                 ARRINT)
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.     ENDDO
  2112.  
  2113.  
  2114.  
  2115.  
  2116. C    WRITE(6,770)
  2117. C 770    FORMAT(1X,'  %USERCALL-TRACEMSG-LEAVING ROUTINE getREC'/)
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.     RETURN
  2124.     END
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.     SUBROUTINE R8CV02(SENSE , BUFADD , NELS , ARRINT)
  2131.  
  2132. C------------------------------------------------------------------------------
  2133. C
  2134. C Function        : Get an real field from the message buffer starting at 
  2135. C                   address BUFADD convert to internal format and place
  2136. C                   in output array arrint . Note that npo conversion is infact
  2137. C                   needed and the process is a straight copy .
  2138. C                   Or from the array arrint into the message buffer                   
  2139. C
  2140. C Input arguments : SENSE = -1 => Move field Message buffer -> Arrint
  2141. C                   SENSE = 1 => Move field arrint -> message buffer .
  2142. C                   BUFADD : the address in the word message buffer .        
  2143. C                   NELS : the number of elements to transfer .
  2144. C
  2145. C Output arguments: BUFADD
  2146. C                   ARRINT : Output is sense = -1 and moving into arrint .
  2147. C
  2148. C Common blocks   : The common message buffer wbuf .
  2149. C
  2150. C Called by       : PUTREC , GETREC , R8COND .
  2151. C
  2152. C Calls           : None .
  2153. C
  2154. C Author          :                        (  /  /  )     Version 1.0
  2155. C
  2156. C Amendments      :                        (  /  /  )
  2157. C
  2158. C Notes           : 
  2159. C
  2160. C------------------------------------------------------------------------------
  2161.  
  2162.  
  2163.  
  2164. C SENSE decides in which direction the transferance is to be (see header)
  2165.  
  2166.     INTEGER SENSE
  2167.  
  2168. C BUFADD is the address in the message buffer.
  2169.  
  2170.     INTEGER BUFADD
  2171.  
  2172. C NELS is the number of elements to transfer.
  2173.  
  2174.     INTEGER NELS
  2175.  
  2176. C ARRINT is the array of the field in internal form.
  2177.  
  2178.     INTEGER*2 ARRINT(100)
  2179.  
  2180. C WCNT is a count of the current number of the word to transfer
  2181.  
  2182.     INTEGER WCNT
  2183.  
  2184.     INTEGER C
  2185.  
  2186.  
  2187.     COMMON/MSGBUF/WBUF(1)
  2188.     INTEGER*2 WBUF
  2189.  
  2190. C If the field is scalar then only transfer 1 field .
  2191.  
  2192.     IF (NELS.EQ.0) NELS=1
  2193.  
  2194.  
  2195. C Transfer from the message buffer into arrint 
  2196.  
  2197.     IF (SENSE.EQ.-1) THEN
  2198.        DO WCNT=0,(NELS*2)-1
  2199.           WBADD=BUFADD+WCNT        
  2200.           ARRINT(WCNT+1)=WBUF(WBADD)
  2201.        ENDDO
  2202.  
  2203. C Transfer from arrint into the message buffer .
  2204.  
  2205.     ELSE
  2206.        DO WCNT=0,(NELS*2)-1
  2207.           WBADD=BUFADD+WCNT        
  2208.           WBUF(WBADD)=ARRINT(WCNT+1)
  2209.        ENDDO
  2210.     ENDIF
  2211.  
  2212. C Calculate the position in the message buffer for the nextf iled .
  2213.  
  2214.     BUFADD=BUFADD+(NELS*2)
  2215.  
  2216.  
  2217.     RETURN
  2218.     END
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.     SUBROUTINE R8CV01(SENSE , BUFADD , NELS , ARRINT)
  2225.  
  2226.  
  2227. C------------------------------------------------------------------------------
  2228. C
  2229. C Function        : Get an integer field from the message buffer starting at 
  2230. C                   address BUFADD convert to internal format and place
  2231. C                   in output array arrint . Note that npo conversion is infact
  2232. C                   needed and the process is a straight copy .
  2233. C                   Or transfer from the arrint array imnto the message buffer
  2234. C
  2235. C Input arguments : SENSE = -1 => Move field Message buffer -> Arrint
  2236. C                   SENSE = 1 => Move field arrint -> message buffer .
  2237. C                   BUFADD : the address in the word message buffer .        
  2238. C                   NELS : the number of elements to transfer .
  2239. C
  2240. C Output arguments: BUFADD
  2241. C                   ARRINT : Output is sense = -1 and moving into arrint .
  2242. C
  2243. C Common blocks   : The common message buffer wbuf .
  2244. C
  2245. C Called by       : PUTREC , GETREC , R8COND .
  2246. C
  2247. C Calls           : None .
  2248. C
  2249. C Author          :                        (  /  /  )     Version 1.0
  2250. C
  2251. C Amendments      :                        (  /  /  )
  2252. C
  2253. C Notes           : 
  2254. C
  2255. C------------------------------------------------------------------------------
  2256.  
  2257.  
  2258.  
  2259. C SENSE decides in which direction the transferance is to be (see header)
  2260.  
  2261.     INTEGER SENSE
  2262.  
  2263. C BUFADD is the address in the message buffer.
  2264.  
  2265.     INTEGER BUFADD
  2266.  
  2267. C NELS is the number of elements to transfer.
  2268.  
  2269.     INTEGER NELS
  2270.  
  2271. C ARRINT is the array of the field in internal form.
  2272.  
  2273.     INTEGER*2 ARRINT(50)
  2274.  
  2275. C WCNT is a count of the current number of the word to transfer
  2276.  
  2277.     INTEGER WCNT
  2278.  
  2279.  
  2280.  
  2281.  
  2282.     COMMON/MSGBUF/WBUF(1)
  2283.     INTEGER*2 WBUF
  2284.  
  2285.  
  2286.  
  2287. C If the field is scalar then only 1 elemnt needs to be transfered .
  2288.  
  2289.     IF (NELS.EQ.0) NELS=1
  2290.  
  2291. C Transfer from the message buffer into arrint .
  2292.  
  2293.     IF (SENSE.EQ.-1) THEN
  2294.        DO WCNT=0,(NELS*2)-1
  2295.           WBADD=BUFADD+WCNT        
  2296.           ARRINT(WCNT+1)=WBUF(WBADD)
  2297.        ENDDO
  2298.  
  2299. C Transfer into arrint from the message buffer .
  2300.  
  2301.     ELSE
  2302.        DO WCNT=0,(NELS*2)-1
  2303.           WBADD=BUFADD+WCNT        
  2304.           WBUF(WBADD)=ARRINT(WCNT+1)
  2305.        ENDDO
  2306.     ENDIF
  2307.  
  2308. C Calculate the start int the message buffer for the next field .
  2309.  
  2310.     BUFADD=BUFADD+(NELS*2)
  2311.  
  2312.     RETURN
  2313.     END
  2314.  
  2315.  
  2316.     SUBROUTINE R8CV03(SENSE,BUFADD,NELS,NCHARS,ARRINT)
  2317.  
  2318.  
  2319.  
  2320. C------------------------------------------------------------------------------
  2321. C
  2322. C Function        : Get an character field from the message buffer starting at 
  2323. C                   address BUFADD convert to internal format and place
  2324. C                   in output array arrint . Note that npo conversion is infact
  2325. C                   needed and the process is a straight copy . Or get the 
  2326. C                   field from the ipb and put into the message buffer .
  2327. C                    
  2328. C
  2329. C Input arguments : SENSE = -1 => Move field Message buffer -> Arrint
  2330. C                   SENSE = 1 => Move field arrint -> message buffer .
  2331. C                   BUFADD : the address in the word message buffer .        
  2332. C                   NELS : the number of elements to transfer .
  2333. C                   NCHARS : the number of characters in an element string .
  2334. C
  2335. C Output arguments: BUFADD
  2336. C                   ARRINT : Output is sense = -1 and moving into arrint .
  2337. C
  2338. C Common blocks   : The common message buffer wbuf .
  2339. C
  2340. C Called by       : PUTREC , GETREC , R8COND .
  2341. C
  2342. C Calls           : None .
  2343. C
  2344. C Author          :                        (  /  /  )     Version 1.0
  2345. C
  2346. C Amendments      :                        (  /  /  )
  2347. C
  2348. C Notes           : 
  2349. C
  2350. C------------------------------------------------------------------------------
  2351.  
  2352.  
  2353.  
  2354. C SENSE is the direction of conversion ( see header )
  2355.  
  2356.     INTEGER SENSE
  2357.  
  2358. C BUFADD is the address in the word buffer
  2359.  
  2360.     INTEGER BUFADD
  2361.  
  2362. C NELS is the number of elements.
  2363.  
  2364.     INTEGER NELS
  2365.  
  2366. C NCHARS is the number of characters per element.
  2367.  
  2368.     INTEGER NCHARS
  2369.  
  2370. C ARRINT is the byte array into which the field is placed or taken from
  2371. C depending on sense.Note that it is passed in as a word array and declared
  2372. C here as a byte array .
  2373.  
  2374.     BYTE ARRINT(400)
  2375.  
  2376. C CCNT is a byte count of the characters transfered .
  2377. C CBUFADD is the current position in thecharacter buffer .
  2378. C CMOVE is the number of characters to move .
  2379.  
  2380.     INTEGER CCNT,CBUFAD,CMOVE,ECNT,IND
  2381.  
  2382.  
  2383. C Characters are taken/put from the array cbuf a byte array equivalenced
  2384. C to the message buffer .
  2385.  
  2386.         COMMON/MSGBUF/WBUF(100)
  2387.     INTEGER*2 WBUF
  2388.  
  2389.     BYTE CBUF(200)
  2390.     EQUIVALENCE (CBUF,WBUF)
  2391.  
  2392.  
  2393.  
  2394. C If the field is scalar then the number of elements to move is 1 .
  2395.  
  2396.     IF (NELS.EQ.0) NELS=1
  2397.  
  2398.  
  2399. C BUFADD is the address in the message buffer in words soit must be
  2400. C converted into an address in the byte buffer .
  2401.  
  2402.     CBUFAD=(BUFADD*2)-1
  2403.  
  2404.     CMOVE=(NELS*NCHARS)
  2405.  
  2406.  
  2407. C Transfer from the message buffer into the arrint array .
  2408.         
  2409.         IF (SENSE.EQ.-1) THEN
  2410.        DO ECNT=1,NELS
  2411.               DO CCNT=1,NCHARS
  2412.                  IND = (ECNT-1)*NCHARS + CCNT
  2413.                  ARRINT(IND)=CBUF(CBUFAD)
  2414.              CBUFAD=CBUFAD+1
  2415.               ENDDO   
  2416.               CBUFAD = ((CBUFAD/2)*2)+1
  2417.        ENDDO
  2418.  
  2419. C In RAPPORT all fields must start and finish on a long word boundary .
  2420. C So it is neccesary in the case of a character field (which is not
  2421. C automatically long word aligned) to pad arrit out to a long word 
  2422. C boundary with spaces (ASCII decimal 32) as does RAPPORT 
  2423.  
  2424.  
  2425.            DO CCNT=(CMOVE+1),((CMOVE+3)/4)*4
  2426.               ARRINT(CCNT)=32
  2427.            ENDDO
  2428.  
  2429.  
  2430. C Move from ARRINT into the message buffer.
  2431.  
  2432.     ELSE
  2433.  
  2434.  
  2435.        DO ECNT=1,NELS
  2436.               DO CCNT=1,NCHARS
  2437.                  IND = (ECNT-1)*NCHARS + CCNT
  2438.                  CBUF(CBUFAD) = ARRINT(IND)
  2439.              CBUFAD=CBUFAD+1
  2440.               ENDDO   
  2441.               CBUFAD = ((CBUFAD/2)*2)+1
  2442.        ENDDO
  2443.  
  2444.  
  2445.     ENDIF
  2446.  
  2447. C Note that in an ada record each field of that record must be WORD
  2448. C aligned (i.e. 16 bit).With a character field if we have an odd number of
  2449. C characters then thgis is not the case.The address then must be rounded
  2450. C up to the next word in the message buffer .
  2451.  
  2452.     BUFADD=(CBUFAD+2)/2
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.     RETURN
  2460.     END
  2461.                          
  2462.  
  2463. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2464. --V23USR.MAR
  2465. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2466.     .TITLE    ROSUSR.MAR    ROS 2.2    VMS USER SUPPORT
  2467.     .IDENT    /V2.3a/
  2468.     
  2469.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2470.     ;                                  ;
  2471.     ;    ROS 2.2    VMS USER SUPPORT                  ;
  2472.     ;                                  ;
  2473.     ;    Written    by                          ;
  2474.     ;                                  ;
  2475.     ;    H. Rutherford    12-Sep-83                  ;
  2476.     ;                                  ;
  2477.     ;    Copyright (c) TeleSoft 1983                  ;
  2478.     ;    All Rights Reserved                      ;
  2479.     ;                                  ;
  2480.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2481.  
  2482.     ;--------------------------------------------------------------
  2483.     ; Bug List    BUGS bugs BUGS bugs
  2484.     ;
  2485.     ; when      who    bug#    Description of problem
  2486.     ;
  2487.     ;
  2488.     ;--------------------------------------------------------------
  2489.     ; Log of Modifications    LOG  log
  2490.     ;
  2491.     ; when      who    version    where    what
  2492.     ;
  2493.     ; 30/1/85 MDD 
  2494.         ;
  2495.     ; 
  2496.     ;--------------------------------------------------------------
  2497.     
  2498.     
  2499.     .PSECT    ROSUSR    LONG,EXE
  2500.     
  2501.     .SAVE_PSECT
  2502.  
  2503.     .PSECT    ROSDAT    LONG,CON,NOEXE,WRT,NOSHR,REL,PIC
  2504.     
  2505. USRDRVRT::
  2506.     .ADDRESS    USRDRVRT    ; empty    queue
  2507.     .ADDRESS    USRDRVRT    ;
  2508.     .ADDRESS    USRSTART    ;
  2509.     .ADDRESS    USRCLR        ;
  2510.     .ADDRESS    USRCNTRL    ;
  2511.     .WORD        0
  2512.     .WORD        0
  2513.     
  2514.     .ALIGN    LONG,0
  2515.     
  2516. USRFAB::$FAB-            ; Default FAB
  2517.       SHR=<GET,PUT,UPD,DEL,UPI>
  2518. USRNAM:    $NAM            ; Default NAM
  2519. USRRAB:    $RAB            ; Default RAB
  2520.  
  2521.     $IODEF
  2522.         $PRCDEF
  2523.         $DVIDEF
  2524.  
  2525.  
  2526.  
  2527.  
  2528. ; In setting the input and output of the process that we create to the
  2529. ; terminal we need to discover the name of the device.This is done via
  2530. ; a call to the system service $GETDVI_S hich takes as an argument the
  2531. ; DVILIST so described.
  2532.  
  2533.  
  2534. DVILIST:
  2535.         .WORD   64
  2536.         .WORD   DVI$_DEVNAM
  2537.         .ADDRESS -
  2538.                 TERM
  2539.         .ADDRESS -
  2540.                 TERMDESC
  2541.         .LONG   0
  2542.  
  2543. TERMDESC:
  2544.         .WORD   64
  2545.         .WORD   0
  2546. TERMADDR:
  2547.         .ADDRESS -
  2548.                 TERM
  2549. CONCTERM:
  2550.         .ASCII  /_/
  2551. TERM:   .BLKB   64
  2552.  
  2553.  
  2554. ;The name of the terminal is derived by GETDVI from the logical name assigned
  2555. ;to it which is SYS$INPUT
  2556.  
  2557. LOGNAM: .ASCID  /SYS$INPUT/
  2558.  
  2559.  
  2560. ; We will also need to discover the name of the mailbox that we create as
  2561. ; on creation of the mailbox it is only identifiable by its channel number
  2562. ; and when the process is created we need to know its logical name
  2563.  
  2564.  
  2565. MBXLIST:
  2566.         .WORD   64
  2567.         .WORD   DVI$_DEVNAM
  2568.         .ADDRESS -
  2569.                 MBX
  2570.         .ADDRESS -
  2571.                 MBXDESC
  2572.         .LONG   0
  2573.  
  2574. MBXDESC:
  2575.         .WORD   64
  2576.         .WORD   0
  2577. MBXADDR:
  2578.         .ADDRESS -
  2579.                 MBX
  2580. CONCMBX:
  2581.         .ASCII  /_/
  2582. MBX:    .BLKB   64
  2583.  
  2584.  
  2585.  
  2586.  
  2587. ; There follows declarations of theinformation needed to set up and maintain
  2588. ; the mailbox lionk to user call lib:-
  2589. ;
  2590. ;               A longword to hold the channel number of the mailbox
  2591. ;
  2592.  
  2593.  
  2594. MESSAGEPIPE:
  2595.         .BLKW   1
  2596.  
  2597.  
  2598.  
  2599. ; This is the declaration of the message buferr which is a contiguous sequence
  2600. ; of longwords enough to hold the largest possible message
  2601.  
  2602.  
  2603. MESSAGE:
  2604.         .BLKL   50       
  2605.  
  2606.  
  2607. ; This is a character descriptor of the name and location of user call lib.
  2608. ; This descriptor is used by $CREPRC to set up and run user call lib in
  2609. ; parallel with the ada application progam
  2610.  
  2611.  
  2612. USERCALLLIB:
  2613.         .ASCID   /DBA2:[ADARAPP.FORTRAN]usercall.exe/
  2614.  
  2615.  
  2616.  
  2617. ; This is the argument list used by SIMPLE , RECWRIE , RECREAD to store
  2618. ; and access two pointers :-
  2619. ;
  2620. ;               ENDADAREC : A pointer to the description (if it exists)
  2621. ;                           of the size and position of the database record
  2622. ;                           in ada address space.
  2623. ;               END MESSAGE : A pointer to the start of a sequence of long
  2624. ;                             words in the message buffer that hold (or are
  2625. ;                             to hold the database record.
  2626.  
  2627.  
  2628. ADDRLIST:
  2629.         .LONG    2
  2630.         .ADDRESS ENDADARECORD,ENDMESSAGE
  2631.  
  2632. ENDADARECORD:
  2633.         .BLKL   1
  2634.  
  2635. ENDMESSAGE:
  2636.         .BLKL   1
  2637.  
  2638.  
  2639.  
  2640. ; This is the argument list used to give the parameters for a data transferal
  2641. ; to TRANSFER and to return pointers to the nex available byte in both data
  2642. ; areas after data transferal.It is used by TRANSFER , ADATOMSG , MSGTOADA
  2643. ; ATOMREC , MTOAREC . Its parts are:-
  2644. ;
  2645. ;           FROM : The start address of the data to transfer.
  2646. ;           TO : The start of the data area to transfer the data to.
  2647. ;           SIZE : The amount of words of data to transfer.
  2648. ;           ENDFROM : The first available byte in the from area.
  2649. ;           ENDTO : The first available byte in the to area.
  2650. ;
  2651.  
  2652.  
  2653. TRANSPARAMS:
  2654.         .LONG   5 
  2655.         .ADDRESS FROMSTART,TOSTART,SIZE,ENDFROM,ENDTO
  2656.       
  2657. FROMSTART:
  2658.         .BLKL   1
  2659.  
  2660. TOSTART:
  2661.         .BLKL   1
  2662.  
  2663. SIZE:   .BLKL   1
  2664.  
  2665. ENDFROM:
  2666.         .BLKL   1
  2667.  
  2668. ENDTO:  .BLKL   1
  2669.         
  2670.  
  2671. DUMMY:  .BLKL   1
  2672.  
  2673.  
  2674.     .ALIGN    LONG,0
  2675.  
  2676.  
  2677.     .RESTORE_PSECT
  2678.  
  2679.  
  2680.  
  2681.     ;-------------------------------------
  2682.     ;  R1 =    ^ TO TASK CONTROL BLOCK
  2683.     ;  R2 =    scratch
  2684.     ;  R6 =    untouchable
  2685.     ;  R8 =    task stack pointer
  2686.     ;  R9 =    scratch
  2687.     ;  R10= scratch    
  2688.     ;
  2689.     ;  The following are general constants
  2690.     ;
  2691.     ;-------------------------------------
  2692.     
  2693. ACSZE    =    256.    ; Size of an ASCII packed array    (also size of bufs)
  2694.             ; The actual size is 255, but 256 bytes are allocated
  2695. ADSZE    =  8. +    ACSZE    ; The size of an ASCID record
  2696.  
  2697. ;
  2698. ; Argument offsets in parameter block
  2699. ;
  2700. WHAT    =    0    ; What call kind it is
  2701. P1    =    4    ; First parameter
  2702. P2    =    8    ; Second parameter
  2703. P3    =    12    ; Third parameter
  2704. RESULT  =       16    ; The result of this call
  2705. ERRNO    =    20    ; The system result
  2706.  
  2707.  
  2708. ; This is a list of mnemonic equating the various service call to rapport
  2709. ; with their equivalent integer identifiers
  2710.  
  2711.  
  2712. STARTRAPPORT  =  1
  2713. ENDRAPPORT    =  2
  2714. TRANSACT      =  3
  2715. COMMIT        =  4
  2716. BACKOUT       =  5
  2717. INSERT        =  6
  2718. UPDATE        =  7 
  2719. STORE         =  8 
  2720. CONDITION     =  9
  2721. FETCH         =  10
  2722. DELETE        =  11    
  2723. STACK         =  12
  2724. STOREKEY      =  13
  2725. HOLD          =  14
  2726. ENDRETRIEVE   =  15  
  2727. ENDSEARCH     =  16
  2728. RETRIEVE      =  17
  2729. CLEARFILE     =  18
  2730. LOCK          =  19
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738. USRSTART::      ;--------- start of code --------
  2739.         PUSHR   #^M<R2,R3,R4,R5,R6,R7,R8,R9,R10>
  2740.         MOVL    TSP(R1),R8                      ; get task stack pointer
  2741.         MOVL    BUFFER(R8),R8                   ; get param block
  2742.  
  2743. ;------------------------------------------------------------------------------
  2744. ;
  2745. ; Function        :  * If the call is StartRapport then set up communications.
  2746. ;                    * Dispatch the call to the appropriate handling routine:-
  2747. ;                                   - Simple
  2748. ;                                   - Recread
  2749. ;                                   - Recwrite
  2750. ;                    * If the call is EndRapport then shut down the mailbox. 
  2751. ;
  2752. ; Input arguments : None
  2753. ;
  2754. ; Output arguments: None
  2755. ;
  2756. ; Common blocks   : Acceses the the parameter WHAT(The service call number).
  2757. ;
  2758. ; Calls To        : SETCOMS , BRKCOMS , SIMPLE , RECREAD , RECWRITE
  2759. ;
  2760. ; Called By       : A da application program.
  2761. ;
  2762. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  2763. ;
  2764. ; Amendments      :                        (  /  /  )
  2765. ;
  2766. ; Notes           : 
  2767. ;
  2768. ;------------------------------------------------------------------------------
  2769.  
  2770.         CMPL    WHAT(R8),#STARTRAPPORT
  2771.         BNEQ    DISPATCHER
  2772.         CALLS   #0,SETCOMS
  2773.  
  2774. DISPATCHER:
  2775.         CMPL    WHAT(R8),#STARTRAPPORT
  2776.         BNEQ    CONT1
  2777.         CALLS   #0,SIMPLE
  2778.         JMP     QUIT
  2779. CONT1:  CMPL    WHAT(R8),#ENDRAPPORT
  2780.         BNEQ    CONT2
  2781.         CALLS   #0,SIMPLE
  2782.         CALLS   #0,BRKCOMS
  2783.         JMP     QUIT
  2784. CONT2:  CMPL    WHAT(R8),#TRANSACT
  2785.         BNEQ    CONT3
  2786.         CALLS   #0,SIMPLE
  2787.         JMP     QUIT
  2788. CONT3:  CMPL    WHAT(R8),#COMMIT
  2789.         BNEQ    CONT4
  2790.         CALLS   #0,SIMPLE
  2791.         JMP     QUIT
  2792. CONT4:  CMPL    WHAT(R8),#BACKOUT
  2793.         BNEQ    CONT5
  2794.         CALLS   #0,SIMPLE
  2795.         JMP     QUIT
  2796. CONT5:  CMPL    WHAT(R8),#INSERT
  2797.         BNEQ    CONT6
  2798.         CALLS   #0,RECWRITE
  2799.         JMP     QUIT
  2800. CONT6:  CMPL    WHAT(R8),#UPDATE
  2801.         BNEQ    CONT7
  2802.         CALLS   #0,RECWRITE
  2803.         JMP     QUIT
  2804. CONT7:  CMPL    WHAT(R8),#STORE
  2805.         BNEQ    CONT8
  2806.         CALLS   #0,RECWRITE
  2807.         JMP     QUIT
  2808. CONT8:  CMPL    WHAT(R8),#CONDITION
  2809.         BNEQ    CONT9
  2810.         CALLS   #0,RECWRITE
  2811.         JMP     QUIT
  2812. CONT9:  CMPL    WHAT(R8),#FETCH
  2813.         BNEQ    CONT10
  2814.         CALLS   #0,RECREAD
  2815.         JMP     QUIT
  2816. CONT10: CMPL    WHAT(R8),#DELETE
  2817.         BNEQ    CONT11
  2818.         CALLS   #0,SIMPLE
  2819.         JMP     QUIT
  2820. CONT11: CMPL    WHAT(R8),#STACK
  2821.         BNEQ    CONT12
  2822.         CALLS   #0,SIMPLE
  2823.         JMP     QUIT
  2824. CONT12: CMPL    WHAT(R8),#STOREKEY
  2825.         BNEQ    CONT13
  2826.         CALLS   #0,RECWRITE
  2827.         JMP     QUIT
  2828. CONT13: CMPL    WHAT(R8),#HOLD
  2829.         BNEQ    CONT14
  2830.         CALLS   #0,SIMPLE
  2831.         JMP     QUIT
  2832. CONT14: CMPL    WHAT(R8),#ENDRETRIEVE
  2833.         BNEQ    CONT15
  2834.         CALLS   #0,SIMPLE
  2835.         JMP     QUIT
  2836. CONT15: CMPL    WHAT(R8),#ENDSEARCH
  2837.         BNEQ    CONT16
  2838.         CALLS   #0,SIMPLE
  2839.         JMP     QUIT
  2840. CONT16: CMPL    WHAT(R8),#RETRIEVE
  2841.         BNEQ    CONT17
  2842.         CALLS   #0,RECREAD
  2843.         JMP     QUIT
  2844. CONT17: CMPL    WHAT(R8),#CLEARFILE
  2845.         BNEQ    CONT18
  2846.         CALLS   #0,SIMPLE
  2847.         JMP     QUIT
  2848. CONT18: CMPL    WHAT(R8),#LOCK
  2849.         BNEQ    CONT19
  2850.         CALLS   #0,SIMPLE
  2851.         JMP     QUIT
  2852. CONT19: JMP     QUIT
  2853.  
  2854.  
  2855.  
  2856.  
  2857. ;------------------------------------------------------------------------------
  2858. ;
  2859. ; Function        :      * Set up a mailbox.
  2860. ;                        * Find the logical name of the terminal.
  2861. ;                        * Find the logical name of the mailbox just created
  2862. ;                        * Create the user call lib process setting the input
  2863. ;                          and output channels equal to the terminal and the
  2864. ;                          error channel(for the passage of the messages) equal
  2865. ;                          to the mailbox name.
  2866. ;                        * Place the channel of the mailbox in the return
  2867. ;                          location for the syscall function.
  2868. ;
  2869. ; Input arguments : None
  2870. ;
  2871. ; Output arguments: None
  2872. ;
  2873. ; Globals Used    : syscall result (RESULT(R8)) , Terminal descriptor (DVILIST)
  2874. ;                   Mailbox descriptor (MBXLIST) , Channel number (MESSAGEPIPE)
  2875. ;
  2876. ; Calls To        : System services :- $CREMBX , $GETDVI , $CREPRC
  2877. ;
  2878. ; Called By       : Main
  2879. ;
  2880. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  2881. ;
  2882. ; Amendments      :                        (  /  /  )
  2883. ;
  2884. ; Notes           : 
  2885. ;
  2886. ;------------------------------------------------------------------------------
  2887.  
  2888.  
  2889.         .ENTRY    SETCOMS,^M<R4,R5>
  2890.         $CREMBX_S CHAN=MESSAGEPIPE         ; Create the mailbox
  2891.         $GETDVI_S DEVNAM=LOGNAM,-          ; Get the device name of the
  2892.                 ITMLST=DVILIST             ; terminal
  2893.         $GETDVI_S CHAN=MESSAGEPIPE,-       ; Get the device name of the
  2894.                 ITMLST=MBXLIST             ; mailbox
  2895.         $CREPRC_S IMAGE=USERCALLLIB,-      ; Create a process to run user
  2896.                 INPUT=TERMDESC,-           ; call lib and set the input,output
  2897.                 OUTPUT=TERMDESC,-          ; and error channels to appropriate
  2898.                 ERROR=MBXDESC              ; devices.
  2899.         MOVL    MESSAGEPIPE,RESULT(R8)     ; Put the channel number in fn ret.
  2900.         RET
  2901.  
  2902.  
  2903.  
  2904.  
  2905. ;------------------------------------------------------------------------------
  2906. ;
  2907. ; Function        :       * Unhook the channel from the mailbox.
  2908. ;
  2909. ; Input arguments : None.
  2910. ;
  2911. ; Output arguments: None.
  2912. ;
  2913. ; Globals Used    : MESSAGEPIPE:-Address of the channel number.
  2914. ;                   The cahnnel number passed from syscall (P3(R8))
  2915. ;
  2916. ; Calls To        : System service:- $DASSGN
  2917. ;
  2918. ; Called By       : Called from ENDRAPPORT section of DISPATCHER.
  2919. ;
  2920. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  2921. ;
  2922. ; Amendments      :                        (  /  /  )
  2923. ;
  2924. ; Notes           : 
  2925. ;
  2926. ;------------------------------------------------------------------------------
  2927.  
  2928.  
  2929.     .ENTRY    BRKCOMS,^M<R4,R5>
  2930.     MOVL    P3(R8),MESSAGEPIPE
  2931.     $DASSGN_S CHAN=MESSAGEPIPE
  2932.     RET
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938. ;------------------------------------------------------------------------------
  2939. ;
  2940. ; Function        :       * Transfer the parameters from ada record to the
  2941. ;                           message buffer.
  2942. ;                         * Communicate with user call lib.
  2943. ;                         * Transfer the parameters back from the message 
  2944. ;                           buffer into the ada record. 
  2945. ;
  2946. ; Input arguments : None.
  2947. ;
  2948. ; Output arguments: None.
  2949. ;
  2950. ; Globals Used    : ADDRLIST (used to call sub-procedures but not accessed)
  2951. ;
  2952. ; Calls To        : ADATOMSG , RAPCOMS , MSGTOADA
  2953. ;
  2954. ; Called By       : Dispatcher parts ( .. )
  2955. ;
  2956. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  2957. ;
  2958. ; Amendments      :                        (  /  /  )
  2959. ;
  2960. ; Notes           : 
  2961. ;
  2962. ;------------------------------------------------------------------------------
  2963.  
  2964.  
  2965.         .ENTRY    SIMPLE,^M<R4,R5>
  2966.     CALLG    ADDRLIST,ADATOMSG        ; Move static parameters to message.
  2967.     CALLS   #0,RAPCOMS               ; Talk to user call lib.
  2968.     CALLG    ADDRLIST,MSGTOADA        ; Transfer back static parameters. 
  2969.     RET
  2970.  
  2971.  
  2972. ;------------------------------------------------------------------------------
  2973. ;
  2974. ; Function        :      * Transfer static parameters from ada record space 
  2975. ;                          the message buffer.
  2976. ;                        * Transfer the variable length database record from
  2977. ;                          ada space to the message buffer.
  2978. ;                        * Communicate with user call lib.
  2979. ;                        * Transfer the static parameters back from the
  2980. ;                          message buffer into the ada record. 
  2981. ;
  2982. ; Input arguments : None.
  2983. ;
  2984. ; Output arguments: None.
  2985. ;
  2986. ; Globals Used    : ADDRLIST The elements of this tell the procedure where
  2987. ;                   to find the description of the database record (ENDADA)
  2988. ;                   and where to put it (ENDMESSAGE).This information is
  2989. ;                   passed to AtoMREC.
  2990. ;
  2991. ; Calls To        : ADATOMSG , ATOMREC , RAPCOMS , MSGTOADA
  2992. ;
  2993. ; Called By       : DISPATCHER parts ( .. )
  2994. ;
  2995. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  2996. ;
  2997. ; Amendments      :                        (  /  /  )
  2998. ;
  2999. ; Notes           : 
  3000. ;
  3001. ;------------------------------------------------------------------------------
  3002.  
  3003.  
  3004.         .ENTRY    RECWRITE,^M<R4,R5>
  3005.     CALLG    ADDRLIST,ADATOMSG         ; Move static parameters to 
  3006.                                           ; message buffer 
  3007.     CALLG    ADDRLIST,ATOMREC          ; Move the variable length part 
  3008.                                           ; to the message buffer.
  3009.     CALLS    #0,RAPCOMS                ; Talk to user call lib.
  3010.     CALLG    ADDRLIST,MSGTOADA         ; Return the static parameters
  3011.                                           ; back from the message buffer.
  3012.     RET
  3013.  
  3014.  
  3015.  
  3016. ;------------------------------------------------------------------------------
  3017. ;
  3018. ; Function        :        * Transfer the static parameters from the ada
  3019. ;                            record to the message buffer.
  3020. ;                          * Communicate with user call lib.
  3021. ;                          * Transfer the static parameters back from the
  3022. ;                            message buffer into the ada record.
  3023. ;                          * Transfer the database record returned by user
  3024. ;                            call lib from the meesage buffer  to the ada
  3025. ;                            database record. 
  3026. ;
  3027. ; Input arguments : None
  3028. ;
  3029. ; Output arguments: None.
  3030. ;
  3031. ; Globals Used    : ADDRLIST containing information about where to put the 
  3032. ;                   record (ENDADA) and where to find it (ENDMESSAGE) this
  3033. ;                   information is passed to MtoAREC.
  3034. ;
  3035. ; Calls To        : ADATOMSG , RAPCOMSD , MSGTOADA , MTOAREC
  3036. ;
  3037. ; Called By       : DISPATCHER parts ( .. )
  3038. ;
  3039. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  3040. ;
  3041. ; Amendments      :                        (  /  /  )
  3042. ;
  3043. ; Notes           : 
  3044. ;
  3045. ;------------------------------------------------------------------------------
  3046.  
  3047.  
  3048.         .ENTRY    RECREAD,^M<R4,R5>        
  3049.     CALLG    ADDRLIST,ADATOMSG        ; Transfer the static parameters
  3050.                                          ; to the message buffer.
  3051.     CALLS    #0,RAPCOMS               ; Talk to user call lib.
  3052.     CALLG    ADDRLIST,MSGTOADA        ; Return the static parameters from
  3053.                                          ; the message buffer.
  3054.     CALLG    ADDRLIST,MTOAREC         ; Move the variable length part from
  3055.                                          ; the message buffer to ada space.
  3056.     RET
  3057.  
  3058.  
  3059.  
  3060. ;------------------------------------------------------------------------------
  3061. ;
  3062. ; Function        :     * Move the number of the service call to the first
  3063. ;                         longword of the message buffer.
  3064. ;                       * Get the size and start address of the static
  3065. ;                         parameters and move them to the message buffer.
  3066. ;                       * Put the address of the end of the static parameters
  3067. ;                         and the address reached in the message buffer into
  3068. ;                         thereturn parameters.
  3069. ;           
  3070. ; Input arguments : None.
  3071. ;
  3072. ; Output arguments:     1.) The address of the first byte after the static
  3073. ;                           parameters and also the address of the record
  3074. ;                           descriptor - if there is one .
  3075. ;                        2.)The address in the message buffer after the
  3076. ;                           static parameters have been transfered.
  3077. ;
  3078. ; Globals Used    : TRANSPARAMS as the argument list to call transfer.
  3079. ;
  3080. ; Calls To        : TRANSFER.
  3081. ;
  3082. ; Called By       : SIMPLE , RECWRITE , RECREAD
  3083. ;
  3084. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  3085. ;
  3086. ; Amendments      :                        (  /  /  )
  3087. ;
  3088. ; Notes           : 
  3089. ;
  3090. ;------------------------------------------------------------------------------
  3091.  
  3092.  
  3093.         .ENTRY    ADATOMSG,^M<R4,R5>
  3094.     MOVL    P1(R8),FROMSTART        ; Move the start of the parameter
  3095.                                         ; record to FROMSTART which will be
  3096.                                         ; passed to transfer.
  3097.     MOVL    P2(R8),SIZE             ; Likewise move the size of the 
  3098.                                         ; parameter record to SIZE.
  3099.     MOVL    #MESSAGE,R4             ; Address of the message buffer to r4
  3100.     MOVL    WHAT(R8),(R4)+          ; Move the number of the service call
  3101.                                         ; to the message buffer.   
  3102.     MOVL    R4,TOSTART              ; Move r4 (first free byte in buffer)
  3103.                                         ; to TOSTART.
  3104.       CALLG    TRANSPARAMS,TRANSFER    ; Do the data transfer FROMSTART ->
  3105.                                         ; TOSTART.
  3106.         MOVL    (AP)+,DUMMY             ; Correctly align the argument pointer.
  3107.     MOVL    ENDFROM,@(AP)+          ; Move ENDFROM and ENDTO  to the 
  3108.         MOVL    ENDTO,@(AP)+            ; ouput parameters.
  3109.     RET
  3110.  
  3111.  
  3112.  
  3113.  
  3114. ;------------------------------------------------------------------------------
  3115. ;
  3116. ; Function        :     * Move the number of the service call from the message
  3117. ;                         to align the pointers correctle.
  3118. ;                       * Get the size and start address of the static
  3119. ;                         parameters in ada space and move them there from
  3120. ;                         the message buffer.
  3121. ;                       * Put the address of the end of the static parameters
  3122. ;                         and the address reached in the message buffer into
  3123. ;                         thereturn parameters.
  3124. ;           
  3125. ; Input arguments : None.
  3126. ;
  3127. ; Output arguments:     1.) The address of the first byte after the static
  3128. ;                           parameters and also the address of the record
  3129. ;                           descriptor - if there is one )
  3130. ;                       2.) The address in the message buffer after the
  3131. ;                           static parameters have been transfered)
  3132. ;
  3133. ; Globals Used    : TRANSPARAMS as the argument list to call transfer.
  3134. ;
  3135. ; Calls To        : TRANSFER.
  3136. ;
  3137. ; Called By       : SIMPLE , RECWRITE , RECREAD
  3138. ;
  3139. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  3140. ;
  3141. ; Amendments      :                        (  /  /  )
  3142. ;
  3143. ; Notes           : 
  3144. ;
  3145. ;------------------------------------------------------------------------------
  3146.  
  3147.  
  3148.         .ENTRY    MSGTOADA,^M<R4,R5>
  3149.     MOVL    P1(R8),TOSTART        ; Move the address of the pasrameter
  3150.                                       ; record to TOSTART which is used by
  3151.                                       ; transfer.
  3152.     MOVL    P2(R8),SIZE           ; Likewise with the size of the params.
  3153.     MOVL    #MESSAGE,R4           ; address of message buffer -> r4
  3154.     MOVL    WHAT(R8),(R4)+        ; Move the number of the service call
  3155.                                       ; to the message buffer
  3156.     MOVL    R4,FROMSTART          ; Move the address of the place in the
  3157.                                       ; message buffer to get parameters from.
  3158.       CALLG    TRANSPARAMS,TRANSFER  ; Do the data transfer .
  3159.         MOVL    (AP)+,DUMMY           ; Align argument pointer.
  3160.     MOVL    ENDTO,@(AP)+          ; Move ENDTO and ENDFROM to the
  3161.     MOVL    ENDFROM,@(AP)+         ; Output parameters.
  3162.     RET
  3163.      
  3164.  
  3165.  
  3166. ;------------------------------------------------------------------------------
  3167. ;
  3168. ; Function        :        * Move the size and start address of the record in
  3169. ;                            ada store along with the addres in the message
  3170. ;                            buffer to transfger to to the transfer parameters
  3171. ;                          * Transfer the record to the message buffer 
  3172. ;
  3173. ; Input arguments :        1.) The address of the record description in ada 
  3174. ;                              space.
  3175. ;                          2.) The address to transfer to in the message
  3176. ;                              buffer.
  3177. ;
  3178. ; Output arguments: None.
  3179. ;
  3180. ; Globals Used    : The transfer parameters used as argument list for transfer
  3181. ;
  3182. ; Calls To        : TRANSFER
  3183. ;
  3184. ; Called By       : RECWRITE
  3185. ;
  3186. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  3187. ;
  3188. ; Amendments      :                        (  /  /  )
  3189. ;
  3190. ; Notes           : 
  3191. ;
  3192. ;------------------------------------------------------------------------------
  3193.  
  3194.  
  3195.  
  3196.         .ENTRY    ATOMREC,^M<R2,R4>
  3197.         MOVL    (AP)+,DUMMY          ; Align argument pointer.
  3198.         MOVL    @(AP)+,R2             ; Move the start of the record
  3199.                                       ; description to r2.
  3200.     MOVL    (R2)+,SIZE            ; First input p[arameter is the size
  3201.                                       ; of the record to write.
  3202.     MOVL    (R2)+,FROMSTART       ; Secon input is the start address of the
  3203.                                       ; record to write.
  3204.     MOVL    @(AP)+,TOSTART        ; Third is the address to start loading
  3205.                                       ; the message buffer.
  3206.     CALLG    TRANSPARAMS,TRANSFER  ; Do the data transfer.
  3207.     RET
  3208.  
  3209.  
  3210.      
  3211.  
  3212.  
  3213. ;------------------------------------------------------------------------------
  3214. ;
  3215. ; Function        :        * Move the size and start address of the record in
  3216. ;                            ada store along with the addres in the message
  3217. ;                            buffer to transfger from to the transfer parameters
  3218. ;                          * Transfer the record to the ada record from the
  3219. ;                            message buffer.
  3220. ;
  3221. ; Input arguments :        1.) The address of the record description in ada 
  3222. ;                              space.
  3223. ;                          2.) The address to transfer from in the message
  3224. ;                              buffer.
  3225. ;
  3226. ; Output arguments: None.
  3227. ;
  3228. ; Globals Used    : The transfer parameters used as argument list for transfer
  3229. ;
  3230. ; Calls To        : TRANSFER
  3231. ;
  3232. ; Called By       : RECREAD
  3233. ;
  3234. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  3235. ;
  3236. ; Amendments      :                        (  /  /  )
  3237. ;
  3238. ; Notes           : 
  3239. ;
  3240. ;------------------------------------------------------------------------------
  3241.  
  3242.  
  3243.     .ENTRY    MTOAREC,^M<R2,R4>
  3244.         MOVL    (AP)+,DUMMY           ; Align the argument pointer.
  3245.     MOVL    @(AP)+,R2             ; Move the address of the record
  3246.                                       ; description to r2.
  3247.     MOVL    (R2)+,SIZE            ; Move the size of the record to SIZE.
  3248.     MOVL    (R2)+,TOSTART         ; The start address of the record is
  3249.                                       ; where we are going to transfer data to.
  3250.     MOVL    @(AP)+,FROMSTART      ; Move the address of the start of the
  3251.                                       ; record in the message buffer.
  3252.     CALLG    TRANSPARAMS,TRANSFER  ; Transdfer the data.
  3253.     RET
  3254.  
  3255.  
  3256.  
  3257.  
  3258. ;------------------------------------------------------------------------------
  3259. ;
  3260. ; Function        :        * Transfer the channel number to MESSAGEPIPE.
  3261. ;                          * Using MESSAGEPIPE as the channel number send a 
  3262. ;                            message to user call lib.
  3263. ;                          * Receive a reply from user call lib.
  3264. ;
  3265. ; Input arguments : None.
  3266. ;
  3267. ; Output arguments: None.
  3268. ;
  3269. ; Globals Used    : P3(R8) is the channel number passed by the syscall function
  3270. ;                   MESSAGE is the buffer filled.
  3271. ;
  3272. ; Calls To        : System services $QIOW
  3273. ;
  3274. ; Called By       : SIMPLE , RECREAD , RECWRITE
  3275. ;
  3276. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  3277. ;
  3278. ; Amendments      :                        (  /  /  )
  3279. ;
  3280. ; Notes           : 
  3281. ;
  3282. ;------------------------------------------------------------------------------
  3283.  
  3284.  
  3285.         .ENTRY    RAPCOMS,^M<R4,R5>
  3286.         CMPL    WHAT(R8),#1
  3287.         BEQL    COM
  3288.     MOVW    P3(R8),MESSAGEPIPE        ; Move the number of the channel
  3289.                                           ; from the function space.
  3290. COM:    $QIOW_S FUNC=#IO$_WRITEVBLK,-     ; Give the message to user call lib.
  3291.          CHAN=MESSAGEPIPE,-
  3292.                 P1=MESSAGE,-
  3293.                 P2=#200
  3294.         $QIOW_S FUNC=#IO$_READVBLK,-      ; Read the replyt from user call lib
  3295.                 CHAN=MESSAGEPIPE,-
  3296.                 P1=MESSAGE,-
  3297.                 P2=#200
  3298.         RET
  3299.  
  3300.  
  3301.  
  3302. ;------------------------------------------------------------------------------
  3303. ;
  3304. ; Function        :    * Move the parameters so that:=-
  3305. ;                             - R2 = The from start.
  3306. ;                             - R3 = The to start.
  3307. ;                             - R4 = The number of words to move.
  3308. ;                      * Move R4 words from R2 to R3.
  3309. ;                      * Place the end addresses in the retrun parameters.   
  3310. ;
  3311. ; Input arguments :    1.) The from address.
  3312. ;                      2.) The size.
  3313. ;                      3.) The to address.
  3314. ;
  3315. ; Output arguments:    1.) The end address of the from area.
  3316. ;                      2.) The end address of the to area.
  3317. ;
  3318. ; Globals Used    : None.
  3319. ;
  3320. ; Calls To        : None.
  3321. ;
  3322. ; Called By       : ADATOMSG , ATOMREC , MTOAREC
  3323. ;
  3324. ; Author          : M.D.DICK               (30/1/85)     Version 1.0
  3325. ;
  3326. ; Amendments      :                        (  /  /  )
  3327. ;
  3328. ; Notes           : 
  3329. ;
  3330. ;------------------------------------------------------------------------------
  3331.  
  3332.  
  3333.  
  3334.         .ENTRY    TRANSFER,^M<R2,R3,R4>
  3335.         MOVL    (AP)+,DUMMY         ; Align argument pointer.
  3336.     MOVL    @(AP)+,R2           ; Start
  3337.     MOVL    @(AP)+,R3           ; Size
  3338.     MOVL    @(AP)+,R4           ; To
  3339.     ADDL2    R2,R4               ; R3=Last Address = Start+Size .
  3340. LOOP:    CMPL    R2,R4               ; If the From=Last Address Then
  3341.     BEQL    FINIS               ; Finished
  3342.     MOVW    (R2)+,(R3)+         ; Otherwise transfer a word
  3343.     JMP    LOOP
  3344. FINIS:    MOVL    R2,@(AP)+           ; Move the final addresses to the output
  3345.     MOVL    R3,@(AP)+           ; parameters.
  3346.     RET
  3347.  
  3348.  
  3349.  
  3350.    
  3351.  
  3352. QUIT:   MOVL    R0,ERRNO(R8)        ; Return status
  3353.     CLRL    R1                      ; OK IOresult
  3354.         BLBS    R0,QUIT2                ; Its even true
  3355.         MOVL    #BADIO,R1               ; set ROS I/O result
  3356.  
  3357. QUIT2:    POPR    #^M<R2,R3,R4,R5,R6,R7,R8,R9,R10>    ; Restore registers
  3358.         MOVAL   USRDRVRT,R0             ; get ready for NEXTIOQ
  3359.         JSB     NEXTIOQ                 ; put task on readyqueue
  3360.         BEQL    10$                     ; if no more, get out
  3361.         BRW     USRSTART                ; else do next one
  3362. 10$:    RSB
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369. USRCLR::        ;--------- clear code -----------
  3370.         MOVL    #CANCEL,IORSLTX(R6)     ; Report cancelled I/O
  3371.         RSB
  3372.         
  3373. USRCNTRL::      ;--------- control code ---------
  3374.         RSB                             ; Not implemented
  3375.  
  3376.     .END
  3377. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3378. --R8LIB.TXT
  3379. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3380. ------------------------------------------------------------------------
  3381. ------------------------------------------------------------------------
  3382. --                                                                    --
  3383. -- This package contains the full set of R8 routines.These act as the --
  3384. -- ADA end of the interface between the high level database access    --
  3385. -- routines (FETCH , INSERT , TRANSACT , .. ) and their equivalent    --
  3386. -- decompositions in rapport (R0FECH,R0INRT , .. ).                   --
  3387. --                                                                    --
  3388. -- All of the procedures are of the same basic type.This basic        --
  3389. -- structure can be defined as follows:-                              --
  3390. --                                                                    --
  3391. --          * A declaration as a record type of the list of           --
  3392. --            parameters that need to be passed to the                --
  3393. --            equivalent R0 routine.Variable length records are       --
  3394. --            expressed in terms of the size (in bytes) and the       --
  3395. --            start position in ADA address space.From this           --
  3396. --            information the macro message handler can find and      --
  3397. --            transfer this message to the message buffer.            --
  3398. --                                                                    --
  3399. --          * The start address and size of this record is            --
  3400. --            record is calculated so that the macro message          --
  3401. --            handler can find the parameters.                        --
  3402. --                                                                    --
  3403. --          * The neccesary IN parameters are placed into the         --
  3404. --            parameter record.                                       --
  3405. --                                                                    --
  3406. --          * The function syscall is called with parameters:-        --
  3407. --                   1.)The start addres of the record.               --
  3408. --                   2.)The size of the record.                       --
  3409. --                   3.)The channel number of the mailbox.            --
  3410. --                                                                    --
  3411. --          * The OUT parameters are copied from the parameter        --
  3412. --            record into the actual parameters.                      --
  3413. --                                                                    --
  3414. --  The only exception to this is on StartRapport where R8STAR calls  --
  3415. --  syscall with only two parameters ( as there is as yet no channel  --
  3416. --  number) and the assigned channel number is determined through the --
  3417. --  return value of the syscall function.                             --
  3418. --                                                                    --
  3419. ------------------------------------------------------------------------
  3420. ------------------------------------------------------------------------
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427. with vms_call , unchecked_conversion , system  ; use vms_call ;
  3428.  
  3429. package r8lib is
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435. procedure R8STAR ( CheckSum : in long_integer ;
  3436.                    LastFile : in long_integer ;
  3437.                    UserTaskNumber : out long_integer ;
  3438.                    ErrorCode : out long_integer ;
  3439.                    Channel : out long_integer ) ;  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446. procedure R8ENDR ( ErrorCode : out long_integer ;
  3447.                    Channel : in long_integer ) ;
  3448.  
  3449.  
  3450.  
  3451.  
  3452. procedure R8TRAN ( TransactionNumber : out long_integer ;
  3453.                    ErrorCode : out long_integer ;
  3454.                    Channel : in long_integer ) ;
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460. procedure R8COMT ( ErrorCode : out long_integer ;
  3461.                    Channel : in long_integer ) ;
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468. procedure R8BKTK ( ErrorCode : out long_integer ;
  3469.                    Channel : in long_integer ) ;
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476. procedure R8INRT ( FileNumber : in long_integer ;
  3477.            SizeOfRecord : in long_integer ;
  3478.                    StartOfRecord : in long_integer ;
  3479.                    ErrorCode : out long_integer ;
  3480.                    channel : in long_integer ) ;
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488. procedure R8UPDT ( FileNumber : in long_integer ;
  3489.                    SizeOfRecord : in long_integer ;
  3490.                    StartOfRecord : in long_integer ;
  3491.                    ErrorCode : out long_integer ;
  3492.                    Channel : in long_integer ) ;
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501. procedure R8STOR ( FileNumber : in long_integer ;
  3502.                    SizeOfRecord : in long_integer ;
  3503.                    StartOfRecord : in long_integer ;
  3504.                    ErrorCode : out long_integer ;
  3505.                    Channel : in long_integer ) ;
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514. procedure R8COND  ( FileNumber : in long_integer ;
  3515.             ConditionNumber : in long_integer ;
  3516.             FieldNumber : in long_integer ;
  3517.             AnyAllSwitch : in long_integer ;
  3518.             SubscriptValue : in long_integer ;
  3519.             RelationNumber : in long_integer ;
  3520.             ConjunctionNumber : in long_integer ;
  3521.                     SizeOfRHS : in long_integer ;
  3522.                     StartOfRHS : in long_integer ;
  3523.                     Channel : in long_integer ) ;
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530. procedure R8FECH ( FileNumber : in long_integer ;
  3531.                    CountVariable : in out long_integer ;
  3532.                    RetrievalStrategy : in out long_integer ;
  3533.                    NumberOfConditions : in long_integer ;
  3534.                    Level : in long_integer ;
  3535.                    SizeOfRecord : in long_integer ;
  3536.                    StartOfRecord : in long_integer ;
  3537.                    Channel : in long_integer ) ;
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544. procedure R8DELT ( FileNumber : in long_integer ;
  3545.                    CountVariable : in out long_integer ;
  3546.                    NumberOfConditions : in long_integer ;
  3547.                    channel : in long_integer ) ;
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556. procedure R8STKY ( FileNumber : in long_integer ;
  3557.                    NumberOfFields : in long_integer ;
  3558.                    StartOfSortKeyArray : in long_integer ;
  3559.                    TypeOfRetrieval : in long_integer ;
  3560.                    Channel : in long_integer ) ;
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568. procedure R8HOLD ( FileNumber : in long_integer ;
  3569.                    NumberOfConditions : in long_integer ;
  3570.                    NumberOfRecords : out long_integer ;
  3571.                    Channel : in long_integer ) ;
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579. procedure R8ENRV ( CountVariable : in long_integer ;
  3580.                    ErrorCode : out long_integer ;
  3581.                    Channel : in long_integer ) ;
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589. procedure R8RTRV ( FileNumber : in long_integer ;
  3590.                    CountVariable : in out long_integer ;
  3591.                    SizeOfRecord : in long_integer ;
  3592.                    StartOfRecord : in long_integer ;
  3593.                    Channel : in long_integer ) ;
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601. procedure R8CLFI ( FileNumber : in long_integer ;
  3602.                    ErrorCode : out long_integer ;
  3603.                    Channel : in long_integer ) ;
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609. procedure R8LOCK ( FileNumber : in long_integer ;
  3610.                    ReadWriteSwitch : in long_integer ;
  3611.                    ErrorCode : out long_integer ;
  3612.                    Channel : in long_integer ) ;
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619. end R8LIB ;
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625. package body R8LIB is
  3626.  
  3627.  
  3628. -- Package specific data used in creation of the parameter record
  3629.  
  3630. NumberOfBytesOfRecordDescription : constant integer:=8 ;
  3631.  
  3632. NumberOfBitsInAByte : constant integer:=8  ;
  3633.  
  3634.  
  3635.  
  3636.  
  3637. -- this takes as input an address and returns a long_integer . Used in 
  3638. -- converting the address of a parameter record to understandable 
  3639. -- long integer form .
  3640.  
  3641. function AddressToLongInteger is new Unchecked_Conversion(System.address ,
  3642.                                                           long_integer ) ;
  3643.  
  3644.    
  3645.  
  3646.  
  3647.  
  3648.  
  3649. procedure R8STAR ( CheckSum : in long_integer ;
  3650.                    LastFile : in long_integer ;
  3651.                    UserTaskNumber : out long_integer ;
  3652.                    ErrorCode : out long_integer ;
  3653.                    Channel : out long_integer ) is
  3654.  
  3655. -------------------------------------------------------------------------------
  3656. --
  3657. -- Function        : Acts as the user interface to the rapport R0STAR which
  3658. --                   starts communication with the rapport nucleus. 
  3659. --
  3660. -- Input arguments : CheckSum:- A value introduced by MakePackage as a
  3661. --                              check on the ddf of the named file.
  3662. --                   LastFile:- A number indicating the last file refrenced
  3663. --                              in the DDF .
  3664. --
  3665. -- Output arguments: UserTaskNumber:-A number returned to the task by the 
  3666. --                                   nucleus which uniquely identifies the task
  3667. --                   ErrorCode:-Returned as an indicator of the success of
  3668. --                              the execution of R0STAR.A value <-1 indicates
  3669. --                              indicates that a serious error has been 
  3670. --                              detected in the execution. 
  3671. --                   Channel:-The returned channel code to the set-up mailbox
  3672. --                            to user call lib.
  3673. --
  3674. -- Globals Accessed: NumberOfBitsInAByte .
  3675. --
  3676. -- Calls to        : vms_call.syscall2 , AddressToLongInteger .
  3677. --
  3678. -- Called by       : PerFile.StartRapport
  3679. --
  3680. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  3681. --
  3682. -- Amendments      :                        (  /  /  )
  3683. --
  3684. -- Notes           : 
  3685. --
  3686. -------------------------------------------------------------------------------
  3687.  
  3688.  
  3689.  
  3690. type StartRapportParameters is
  3691.  
  3692.      record
  3693.  
  3694.        ErrorCode : long_integer ;
  3695.        CheckSum : long_integer ;
  3696.        UserTaskNumber : long_integer ;
  3697.        LastFile : long_integer ;
  3698.  
  3699.      end record ;
  3700.  
  3701.  
  3702. StartRapportRequest : long_integer:=1 ;
  3703.  
  3704. Params : StartRapportParameters ; 
  3705.  
  3706. ParamsSize : long_integer ;
  3707.  
  3708. ParamsStart : long_integer ;
  3709.  
  3710.  
  3711. begin
  3712.  
  3713.   -- parameters INTO the record .
  3714.  
  3715.   Params.CheckSum:=CheckSum ;
  3716.   Params.LastFile:=LastFile ;
  3717.   ParamsSize:=long_integer(StartRapportParameters'Size/NumberOfBitsInAByte) ;
  3718.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  3719.  
  3720.   -- transmit to RAPPORT .
  3721.  
  3722.   Channel:=syscall2(StartRapportRequest , ParamsStart, ParamsSize ) ;
  3723.  
  3724.   -- parameters OUT OF record .
  3725.  
  3726.   ErrorCode:=Params.ErrorCode ;
  3727.   UserTaskNumber:=Params.UserTaskNumber ;
  3728.  
  3729. end ;
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735. procedure R8ENDR ( ErrorCode : out long_integer ;
  3736.                    Channel : in long_integer ) is
  3737.  
  3738. -------------------------------------------------------------------------------
  3739. --
  3740. -- Function        : User interface to the rapport R0ENDR.Cuts off 
  3741. --                   communication with the connected nucleus.
  3742. --
  3743. -- Input arguments : Channel:-Number of the mail box connecting to user call 
  3744. --                            lib. 
  3745. --
  3746. -- Output arguments: ErrorCode:- Indication as to the success in executing
  3747. --                               R0ENDR.An ErrorCode <-1 is an indication
  3748. --                               that a serious error has occurred.
  3749. --
  3750. -- Global variables: NumberOfBitsInAByte . 
  3751. --
  3752. -- Calls to        : vms_call.syscall3
  3753. --
  3754. -- Called by       : PerFile.EndRapport
  3755. --
  3756. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  3757. --
  3758. -- Amendments      :                        (  /  /  )
  3759. --
  3760. -- Notes           : 
  3761. --
  3762. -------------------------------------------------------------------------------
  3763.  
  3764.  
  3765. type EndRapportParameters is
  3766.  
  3767.      record
  3768.  
  3769.        ErrorCode : long_integer ;
  3770.  
  3771.      end record ;
  3772.  
  3773.  
  3774. EndRapportRequest : long_integer:=2 ;
  3775.  
  3776. Params : EndRapportParameters ;
  3777.  
  3778. ParamsSize : long_integer ;
  3779.  
  3780. ParamsStart : long_integer ;
  3781.  
  3782. DummyReturn : long_integer ;
  3783.  
  3784.  
  3785.  
  3786. begin
  3787.  
  3788.   -- Parameters INTO the record
  3789.  
  3790.   ParamsSize:=long_integer(EndRapportParameters'Size/NumberOfBitsInAByte) ;
  3791.   ParamsStart:=AddressToLongInteger(Params'Address) ;   
  3792.  
  3793.   -- transmit to RAPPORT
  3794.  
  3795.   DummyReturn:=syscall3(EndRapportRequest,ParamsStart,ParamsSize,Channel ) ;
  3796.  
  3797.   -- parameters OUT OF record
  3798.  
  3799.   ErrorCode:=Params.ErrorCode ;
  3800.  
  3801.  
  3802. end ;
  3803.  
  3804.  
  3805.  
  3806.  
  3807. procedure R8TRAN ( TransactionNumber : out long_integer ;
  3808.                    ErrorCode : out long_integer ;
  3809.                    Channel : in long_integer ) is
  3810.  
  3811.  
  3812. -------------------------------------------------------------------------------
  3813. --
  3814. -- Function        : User interface to the rapport R0TRAN.Starts a databse 
  3815. --                   transaction.
  3816. --
  3817. -- Input arguments : Channel:-The channel number to the mailbox connecting to
  3818. --                   user call lib.
  3819. --
  3820. -- Output arguments: TransactionNumber:- An identifier given by the nucleus
  3821. --                                       to identify the transaction.
  3822. --                 ErrorCode:- An indication as to the success of the 
  3823. --                 execution of R0TRANS.An errorCode < -1
  3824. --                 indicates that a serious error has occurred.
  3825. --
  3826. -- Global variables: NumberOfBitsInAByte..
  3827. --
  3828. -- Calls to        : vms_call.syscall3
  3829. --
  3830. -- Called by       : PerFile.Transact
  3831. --
  3832. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  3833. --
  3834. -- Amendments      :                        (  /  /  )
  3835. --
  3836. -- Notes           : 
  3837. --
  3838. -------------------------------------------------------------------------------
  3839.  
  3840.  
  3841.  
  3842. type TransactionParameters is
  3843.  
  3844.      record
  3845.  
  3846.        ErrorCode : long_integer ;
  3847.        TransactionNumber : long_integer ;
  3848.  
  3849.      end record ;
  3850.  
  3851.  
  3852. TransactionRequest : long_integer:=3 ;
  3853.  
  3854. Params : TransactionParameters ;
  3855.  
  3856. ParamsSize : long_integer ;
  3857.  
  3858. ParamsStart : long_integer ;
  3859.  
  3860. DummyReturn : long_integer ;
  3861.  
  3862.  
  3863. begin
  3864.  
  3865.   -- parameters INTO record .
  3866.  
  3867.   ParamsSize:=long_integer(TransactionParameters'Size/NumberOfBitsInAByte) ;
  3868.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  3869.  
  3870.   -- transmit to RAPPORT .
  3871.  
  3872.   DummyReturn:=syscall3(TransactionRequest,ParamsStart,ParamsSize,Channel) ;
  3873.  
  3874.   -- parameters OUT OF record .
  3875.  
  3876.   TransactionNumber:=Params.TransactionNumber ;
  3877.   ErrorCode:=Params.ErrorCode ;
  3878.  
  3879. end ;
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886. procedure R8COMT ( ErrorCode : out long_integer ;
  3887.                    Channel : in long_integer ) is
  3888.  
  3889.  
  3890. -------------------------------------------------------------------------------
  3891. --
  3892. -- Function        : User interface to the rapport R0COMT. 
  3893. --
  3894. -- Input arguments : Channel:-Number of the channel to the mailbox connecting
  3895. --                  to user call lib.
  3896. --
  3897. -- Output arguments: ErrorCode:- An indication as to the success of the 
  3898. --                 execution of R0COMT.Error code < -1
  3899. --                               indicates that a serious error has occurred.
  3900. --
  3901. -- Global variables: NumberOfBitsInAByte
  3902. --
  3903. -- Calls to        : vms_call.syscall3
  3904. --
  3905. -- Called by       : PerFile.Commit
  3906. --
  3907. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  3908. --
  3909. -- Amendments      :                        (  /  /  )
  3910. --
  3911. -- Notes           : 
  3912. --
  3913. -------------------------------------------------------------------------------
  3914.  
  3915.  
  3916.  
  3917. type CommitParameters is
  3918.  
  3919.      record
  3920.  
  3921.        ErrorCode : long_integer ;
  3922.  
  3923.      end record ;
  3924.  
  3925.  
  3926. CommitRequest : long_integer:=4 ;
  3927.  
  3928. Params : CommitParameters ;
  3929.  
  3930. ParamsSize : long_integer ;
  3931.  
  3932. ParamsStart : long_integer ;
  3933.  
  3934. DummyReturn : long_integer ;
  3935.  
  3936.  
  3937.  
  3938. begin
  3939.  
  3940.   -- paramaters INTO record .
  3941.  
  3942.   ParamsSize:=long_integer(CommitParameters'Size/NumberOfBitsInAByte) ;
  3943.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  3944.  
  3945.   -- transmit to RAPPORT .
  3946.  
  3947.   DummyReturn:=syscall3(CommitRequest,ParamsStart,ParamsSize,Channel) ;
  3948.  
  3949.   -- parameters OUT OF record .
  3950.  
  3951.   ErrorCode:=Params.ErrorCode ;
  3952.  
  3953. end ;
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960. procedure R8BKTK ( ErrorCode : out long_integer ;
  3961.                    Channel : in long_integer ) is
  3962.  
  3963.  
  3964.  
  3965. -------------------------------------------------------------------------------
  3966. --
  3967. -- Function        : User interface to the rapport R0BKTK. 
  3968. --
  3969. -- Input arguments : Channel :-The number of the channel of the mailbox
  3970. --                      connecting to user calll ib.
  3971. --
  3972. -- Output arguments: ErrorCode:- An indication as to the success of the 
  3973. --                 execution of R0BKTK.An error code < -1
  3974. --                               indicates that a serious error has occurred.
  3975. --
  3976. -- Global variables: NumberOfBitsInAByte
  3977. --
  3978. -- Calls to        : vms_call.syscall3
  3979. --
  3980. -- Called by       : PerFile.Backout
  3981. --
  3982. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  3983. --
  3984. -- Amendments      :                        (  /  /  )
  3985. --
  3986. -- Notes           : 
  3987. --
  3988. -------------------------------------------------------------------------------
  3989.  
  3990.  
  3991.  
  3992. type BackoutParameters is
  3993.  
  3994.      record
  3995.  
  3996.        ErrorCode : long_integer ;
  3997.  
  3998.      end record ;
  3999.  
  4000.  
  4001. BackoutRequest : long_integer:=5 ;
  4002.  
  4003. Params : BackoutParameters ;
  4004.  
  4005. ParamsSize : long_integer ;
  4006.  
  4007. ParamsStart : long_integer ;
  4008.  
  4009. DummyReturn : long_integer ;
  4010.  
  4011.  
  4012. begin
  4013.  
  4014.   -- parameters INTO record .
  4015.  
  4016.   ParamsSize:=long_integer(BackoutParameters'Size/NumberOfBitsInAByte) ;
  4017.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4018.  
  4019.   -- transmit to RAPPORT .
  4020.  
  4021.   DummyReturn:=syscall3(BackoutRequest,ParamsStart,ParamsSize,Channel) ;
  4022.  
  4023.   -- parameters OUT OF record .
  4024.  
  4025.   ErrorCode:=Params.ErrorCode ;
  4026.  
  4027. end ;
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.  
  4035. procedure R8INRT ( FileNumber : in long_integer ;
  4036.            SizeOfRecord : in long_integer ;
  4037.                    StartOfRecord : in long_integer ;
  4038.                    ErrorCode : out long_integer ;
  4039.                    channel : in long_integer ) is
  4040.  
  4041.  
  4042.  
  4043. -------------------------------------------------------------------------------
  4044. --
  4045. -- Function        : User interface to the rapport R0INRT.To insert a record
  4046. --             into a file.
  4047. --
  4048. -- Input arguments : FileNumber:- File number of the file to insert the record
  4049. --                                into.
  4050. --                   SizeOfRecord:- The size of the record to insert in words.
  4051. --                   StartOfRecord:- The address in ADA space of the record.
  4052. --             Channel:-The number of the channel of the mailbox
  4053. --                  connecting to the user calll ib.
  4054. --
  4055. -- Output arguments: ErrorCode:- An indication as to the success of the 
  4056. --                               execution of R0INRT.An error code < -1
  4057. --                               indicates thatt a serious error has occurred.
  4058. --
  4059. -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecordDescription .
  4060. --
  4061. -- Calls to        : vms_call.syscall3
  4062. --
  4063. -- Called by       : PerFile.Insert
  4064. --
  4065. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4066. --
  4067. -- Amendments      :                        (  /  /  )
  4068. --
  4069. -- Notes           : 
  4070. --
  4071. -------------------------------------------------------------------------------
  4072.  
  4073.  
  4074. type InsertParameters is
  4075.  
  4076.      record
  4077.  
  4078.        ErrorCode : long_integer ;
  4079.        FileNumber : long_integer ;
  4080.        SizeOfRecord : long_integer ;
  4081.        StartOfRecord : long_integer ;
  4082.  
  4083.      end record ;
  4084.  
  4085.  
  4086. InsertRequest : long_integer:=6 ;
  4087.  
  4088. Params : InsertParameters ;
  4089.  
  4090. ParamsSize : long_integer ;
  4091.  
  4092. ParamsStart : long_integer ;
  4093.  
  4094. DummyReturn : long_integer ;
  4095.  
  4096.  
  4097. begin
  4098.  
  4099.   -- parameters INTO the record .
  4100.  
  4101.      -- notice that the size of the record is modified by the number of
  4102.      -- bytes of the record that contain information about the record to
  4103.      -- insert . ParamsSize is the size of trhe parameters to be transmitted 
  4104.      -- to RAPPORT .
  4105.  
  4106.   ParamsSize:=long_integer((InsertParameters'Size/NumberOfBitsInAByte)
  4107.                             - NumberOfBytesOfRecordDescription ) ;
  4108.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4109.   Params.FileNumber:=FileNumber ;
  4110.   Params.SizeOfREcord:=SizeOfRecord ;
  4111.   Params.StartOfREcord:=StartOfRecord ;
  4112.  
  4113.   -- transmit to RAPPORT .
  4114.  
  4115.   DummyReturn:=syscall3(InsertRequest,ParamsStart,ParamsSize,Channel) ;
  4116.  
  4117.   -- parameters OUT OF record .
  4118.  
  4119.   ErrorCode:=Params.ErrorCode ;
  4120.  
  4121. end ;
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130. procedure R8UPDT ( FileNumber : in long_integer ;
  4131.                    SizeOfRecord : in long_integer ;
  4132.                    StartOfRecord : in long_integer ;
  4133.                    ErrorCode : out long_integer ;
  4134.                    Channel : in long_integer ) is
  4135.  
  4136.  
  4137. -------------------------------------------------------------------------------
  4138. --
  4139. -- Function        : User interface to the rapport R0UPDT.To update a record
  4140. --             in a file.
  4141. --
  4142. -- Input arguments : FileNumber:- File number of the file to update the record
  4143. --                                into.
  4144. --                   SizeOfRecord:- The size of the record to update in words.
  4145. --                   StartOfRecord:- The address in ADA space of the record.
  4146. --             Channel:-The channel number of the mailbox connecting
  4147. --                  to user call lib.
  4148. --
  4149. -- Output arguments: ErrorCode:- An indication as to the success of the 
  4150. --                               execution of R0UPDT.An error code < -1
  4151. --                               indicates thatt a serious error has occurred.
  4152. --
  4153. -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecorddescription .
  4154. --
  4155. -- Calls to        : vms_call.syscall3
  4156. --
  4157. -- Called by       : PerFile.Update
  4158. --
  4159. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4160. --
  4161. -- Amendments      :                        (  /  /  )
  4162. --
  4163. -- Notes           : 
  4164. --
  4165. -------------------------------------------------------------------------------
  4166.  
  4167. type UpdateParameters is
  4168.  
  4169.      record
  4170.  
  4171.        ErrorCode : long_integer ;
  4172.        FileNumber : long_integer ;
  4173.        SizeOfRecord : long_integer ;
  4174.        StartOfRecord : long_integer ;
  4175.  
  4176.      end record ;
  4177.  
  4178.  
  4179. UpdateRequest : long_integer:=7 ;
  4180.  
  4181. Params : UpdateParameters ;
  4182.  
  4183. ParamsSize : long_integer ;
  4184.  
  4185. ParamsStart : long_integer ;
  4186.  
  4187. DummyReturn : long_integer ;
  4188.  
  4189.  
  4190. begin
  4191.  
  4192.   -- parameters INTO the record .
  4193.  
  4194.      -- notice that the size of the record is modified by the number of
  4195.      -- bytes of the record that contain information about the record to
  4196.      -- insert . ParamsSize is the size of trhe parameters to be transmitted 
  4197.      -- to RAPPORT .
  4198.  
  4199.  
  4200.   ParamsSize:=long_integer((UpdateParameters'Size/NumberOfBitsInAByte)
  4201.                            - NumberOfBytesOfRecordDescription ) ;
  4202.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4203.   Params.FileNumber:=FileNumber ;
  4204.   Params.SizeOfRecord:=SizeOfRecord ;
  4205.   Params.StartOfRecord:=StartOfRecord ;
  4206.  
  4207.   -- transmit to RAPPORT .
  4208.  
  4209.   DummyReturn:=syscall3(UpdateRequest,ParamsStart,ParamsSize,Channel) ;
  4210.  
  4211.   -- parameters OUt OF record .
  4212.  
  4213.   ErrorCode:=Params.ErrorCode ;
  4214.  
  4215.  
  4216. end ;
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224. procedure R8STOR ( FileNumber : in long_integer ;
  4225.                    SizeOfRecord : in long_integer ;
  4226.                    StartOfRecord : in long_integer ;
  4227.                    ErrorCode : out long_integer ;
  4228.                    Channel : in long_integer ) is
  4229.  
  4230.  
  4231.  
  4232.  
  4233. -------------------------------------------------------------------------------
  4234. --
  4235. -- Function        : User interface to the rapport R0STOR.To store a record
  4236. --             in a file.
  4237. --
  4238. -- Input arguments : FileNumber:- File number of the file to store the record
  4239. --                                in.
  4240. --                   SizeOfRecord:- The size of the record to store in words.
  4241. --                   StartOfRecord:- The address in ADA space of the record.
  4242. --                   Channel:-The number of the channel of the mailbox
  4243. --                  connecting to user call lib.
  4244. --
  4245. -- Output arguments: ErrorCode:- An indication as to the success of the 
  4246. --                               execution of R0STOR.An error code < -1
  4247. --                               indicates thatt a serious error has occurred.
  4248. --
  4249. -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecorddescription .
  4250. --
  4251. -- Calls to        : vms_call.syscall3
  4252. --
  4253. -- Called by       : PerFile.Store
  4254. --
  4255. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4256. --
  4257. -- Amendments      :                        (  /  /  )
  4258. --
  4259. -- Notes           : 
  4260. --
  4261. -------------------------------------------------------------------------------
  4262.  
  4263.  
  4264. type StoreParameters is
  4265.  
  4266.      record
  4267.   
  4268.        ErrorCode : long_integer ;
  4269.        FileNumber : long_integer ;
  4270.        SizeOfRecord : long_integer ;
  4271.        StartOfRecord : long_integer ;
  4272.  
  4273.      end record ;
  4274.  
  4275.  
  4276. StoreRequest : long_integer:=8;
  4277.  
  4278. Params : StoreParameters ;
  4279.  
  4280. ParamsSize : long_integer ;
  4281.  
  4282. ParamsStart : long_integer ;
  4283.  
  4284. DummyReturn : long_integer ;
  4285.  
  4286.  
  4287. begin
  4288.  
  4289.   -- parameters INTO the record .
  4290.  
  4291.      -- notice that the size of the record is modified by the number of
  4292.      -- bytes of the record that contain information about the record to
  4293.      -- insert . ParamsSize is the size of trhe parameters to be transmitted 
  4294.      -- to RAPPORT .
  4295.  
  4296.   ParamsSize:=long_integer((StoreParameters'Size/NumberOfBitsInAByte)
  4297.                            - NumberOfBytesOfRecordDescription ) ;
  4298.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4299.   Params.FileNumber:=FileNumber ;
  4300.   Params.SizeOfRecord:=SizeOfRecord ;
  4301.   Params.StartOfRecord:=StartOfRecord ;
  4302.  
  4303.   -- transmit to RAPPORT .
  4304.  
  4305.   DummyReturn:=syscall3(StoreRequest,ParamsStart,ParamsSize,Channel) ;
  4306.  
  4307.   -- parameters OUT OF record .
  4308.  
  4309.   ErrorCode:=Params.ErrorCode ;
  4310.  
  4311.  
  4312. end ;
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320. procedure R8COND  ( FileNumber : in long_integer ;
  4321.             ConditionNumber : in long_integer ;
  4322.             FieldNumber : in long_integer ;
  4323.             AnyAllSwitch : in long_integer ;
  4324.             SubscriptValue : in long_integer ;
  4325.             RelationNumber : in long_integer ;
  4326.             ConjunctionNumber : in long_integer ;
  4327.                     SizeOfRHS : in long_integer ;
  4328.                     StartOfRHS : in long_integer ;
  4329.                     Channel : in long_integer ) is
  4330.  
  4331.  
  4332. -------------------------------------------------------------------------------
  4333. --
  4334. -- Function        : User interface to the rapport R0COND.To place a condition
  4335. --                   on a file that will be used in a subsequent search or
  4336. --             or delete. 
  4337. --
  4338. -- Input arguments : Filenumber:- The number of the file that the condition 
  4339. --                  is on.
  4340. --             ConditionNumber:- The number of this particular call in
  4341. --                           the set of calls. 
  4342. --             FieldNumber:-The number of the field on the LHS of the
  4343. --                  condition.
  4344. --                   AnyAllSwitch:- An indication as to the mode of testing
  4345. --                    on an array.
  4346. --                       i.e ANY element of array > 10
  4347. --                           ALL elements of array > 10
  4348. --                   SubscriptValue:- If only one element of an array is to
  4349. --                      be tested then this indicates which one.
  4350. --                   RelationNumber:-The code number of the relation connecting
  4351. --                                   the left and right hand sides.
  4352. --                          i.e. 1  -  Equals
  4353. --                                  -
  4354. --                                             6  -  Unequal
  4355. --             ConjunctionNumber:-The number of the conjunction
  4356. --                            assosciated with the relation.The
  4357. --                        number is modified to indicate the 
  4358. --                        level in the whole condition that the 
  4359. --                    particular conjuction occurs at.
  4360. --                           i.e. 1 - or
  4361. --                                 2 - and
  4362. --                    Plus an offset of  10 for each level
  4363. --                                       So a value of 32 => an and conjunction
  4364. --                    at the third level.
  4365. --             Channel:-The number of the channel of the mailbox
  4366. --                  connecting to user call lib.
  4367. --
  4368. -- Output arguments: None.
  4369. --
  4370. -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecorddescription .
  4371. --
  4372. -- Calls to        : vms_call.syscall3
  4373. --
  4374. -- Called by       : PerFile.TreeWalker
  4375. --
  4376. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4377. --
  4378. -- Amendments      :                        (  /  /  )
  4379. --
  4380. -- Notes           : 
  4381. --
  4382. -------------------------------------------------------------------------------
  4383.  
  4384.  
  4385. type ConditionParameters is
  4386.  
  4387.      record
  4388.  
  4389.        FileNumber : long_integer ;
  4390.        ConditionNumber : long_integer ;
  4391.        FieldNumber : long_integer ;
  4392.        AnyAllSwitch : long_integer ;
  4393.        SubscriptValue : long_integer ;
  4394.        RelationNumber : long_integer ;
  4395.        ConjunctionNumber : long_integer ;
  4396.        SizeOfRHS : long_integer ;
  4397.        StartOfRHS : long_integer ;
  4398.  
  4399.      end record ;
  4400.  
  4401.  
  4402. ConditionRequest : long_integer:=9;
  4403.  
  4404. Params : ConditionParameters ;
  4405.  
  4406. ParamsSize : long_integer ;
  4407.  
  4408. ParamsStart : long_integer ;
  4409.  
  4410. DummyReturn : long_integer ;
  4411.  
  4412.  
  4413. begin
  4414.  
  4415.   -- parameters INTO the record .
  4416.  
  4417.      -- notice that the size of the record is modified by the number of
  4418.      -- bytes of the record that contain information about the record to
  4419.      -- insert . ParamsSize is the size of trhe parameters to be transmitted 
  4420.      -- to RAPPORT .
  4421.  
  4422.  
  4423.   ParamsSize:=long_integer((ConditionParameters'Size/NumberOfBitsInAByte)
  4424.                             - NumberOfBytesOfRecordDescription) ;
  4425.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4426.   Params.FileNumber:=FileNumber ;
  4427.   Params.ConditionNumber:=ConditionNumber ;
  4428.   Params.FieldNumber:=FieldNumber ;
  4429.   Params.AnyAllSwitch:=AnyAllSwitch ;
  4430.   Params.SubscriptValue:=SubscriptValue ;
  4431.   Params.RelationNumber:=RelationNumber ;
  4432.   Params.ConjunctionNumber:=ConjunctionNumber ;
  4433.   Params.SizeOfRHS:=SizeOfRHS ;
  4434.   Params.StartOfRHS:=StartOfRHS ;
  4435.  
  4436.   -- transmit to RAPPORT
  4437.  
  4438.   DummyReturn:=syscall3(ConditionRequest,ParamsStart,ParamsSize,Channel) ;
  4439.  
  4440.  
  4441.   -- there are no returns .
  4442.  
  4443. end ;
  4444.  
  4445.  
  4446.  
  4447.  
  4448.  
  4449. procedure R8FECH ( FileNumber : in long_integer ;
  4450.                    CountVariable : in out long_integer ;
  4451.                    RetrievalStrategy : in out long_integer ;
  4452.                    NumberOfConditions : in long_integer ;
  4453.                    Level : in long_integer ;
  4454.                    SizeOfRecord : in long_integer ;
  4455.                    StartOfRecord : in long_integer ;
  4456.                    Channel : in long_integer ) is
  4457.  
  4458.  
  4459. -------------------------------------------------------------------------------
  4460. --
  4461. -- Function        : User interface to R0FECH.To fetch a record from the
  4462. --             database.
  4463. --
  4464. -- Input arguments : FileNumber:-The number of the file to fetch the record
  4465. --                 from.
  4466. --             CountVariable:-A pointer to the last record fetched.This
  4467. --                    is 0 if this is the first call of a set or
  4468. --                                  a stand alone call.
  4469. --             RetrievalStrategy:-If none is known then this is set to 0.
  4470. --                   NumberOfConditions:-The number of conditions on this 
  4471. --                         particular fetch.
  4472. --                   Level:-A rapport search loop stack pointer .
  4473. --                   SizeOfRecord:-The size of the record that is to be fetched.
  4474. --                   StartOfRecord:-The start address in ada space where the
  4475. --                    record is to be put.
  4476. --                   Channel:-The number of the channel to the mailbox
  4477. --                  connecting to user calll ib.
  4478. --
  4479. -- Output arguments: CountVariable:-A pointer to the record that has just been 
  4480. --                    fetched.On the next call to fetch (if it is
  4481. --                    one of a set in a search) will have the
  4482. --                    count variable set to this value.
  4483. --                   RetrievalStrategy:-If this was set to 0 on the call then 
  4484. --                    rapport will have decided upon a search
  4485. --                                      strategy and set RetrievalSDtrategy to
  4486. --                    indicate the choice that has been made.
  4487. --
  4488. -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRecordDescription .
  4489. --
  4490. -- Calls to        : vms_call.syscall3
  4491. --
  4492. -- Called by       : PerFile.Search
  4493. --
  4494. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4495. --
  4496. -- Amendments      :                        (  /  /  )
  4497. --
  4498. -- Notes           : 
  4499. --
  4500. -------------------------------------------------------------------------------
  4501.  
  4502.  
  4503.  
  4504. type FetchParameters is
  4505.  
  4506.      record
  4507.  
  4508.        CountVariable : long_integer ;
  4509.        Level : long_integer ;
  4510.        FileNumber : long_integer ;
  4511.        RetrievalStrategy : long_integer ;
  4512.        NumberOfConditions : long_integer ;
  4513.        SizeOfRecord : long_integer ;
  4514.        StartOfRecord : long_integer ;
  4515.  
  4516.      end record ;
  4517.  
  4518.  
  4519. FetchRequest : long_integer:=10;
  4520.  
  4521. Params : FetchParameters ;
  4522.  
  4523. ParamsSize : long_integer ;
  4524.  
  4525. ParamsStart : long_integer ;
  4526.  
  4527. DummyReturn : long_integer ;
  4528.  
  4529.  
  4530. begin
  4531.  
  4532.   -- parameters INTO the record .
  4533.  
  4534.      -- notice that the size of the record is modified by the number of
  4535.      -- bytes of the record that contain information about the record to
  4536.      -- insert . ParamsSize is the size of trhe parameters to be transmitted 
  4537.      -- to RAPPORT .
  4538.  
  4539.  
  4540.   ParamsSize:=long_integer((FetchParameters'Size/NumberOfBitsInAByte)
  4541.                             - NumberOfBytesOfREcordDescription ) ;
  4542.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4543.   Params.Level:=Level ;
  4544.   Params.RetrievalStrategy:=RetrievalStrategy ;
  4545.   Params.NumberOfConditions:=NumberOfConditions ;
  4546.   Params.FileNumber:=FileNumber ;
  4547.   Params.CountVariable:=CountVariable ;
  4548.   Params.SizeOfRecord:=SizeOfRecord ;
  4549.   Params.StartOfRecord:=StartOfRecord ;
  4550.  
  4551.   -- transmit to RAPPORT .
  4552.  
  4553.   DummyReturn:=syscall3(FetchRequest,ParamsStart,ParamsSize,Channel) ;
  4554.  
  4555.   -- parameters OUT OF record .
  4556.  
  4557.   CountVariable:=Params.CountVariable ;
  4558.   RetrievalStrategy:=Params.RetrievalStrategy ;
  4559.  
  4560. end ;
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566. procedure R8DELT ( FileNumber : in long_integer ;
  4567.                    CountVariable : in out long_integer ;
  4568.                    NumberOfConditions : in long_integer ;
  4569.                    channel : in long_integer ) is
  4570.  
  4571.  
  4572. -------------------------------------------------------------------------------
  4573. --
  4574. -- Function        : User interface to the rapport R0DELT.To delete records
  4575. --             from the database.
  4576. --
  4577. -- Input arguments : FileNumber:-The file number of the file to delete from.
  4578. --                   CountVariable:-Indicates the number of records deleted .
  4579. --             NumberOfConditions:-The number of conditions on the delete
  4580. --                   Channel:-The number of the channel to the mailbox
  4581. --                  connecting to user call lib.
  4582. --
  4583. -- Output arguments: UserCount (?)
  4584. --
  4585. -- Global variables: NumberOfBitsInAByte.
  4586. --
  4587. -- Calls to        : vms_call.syscall3
  4588. --
  4589. -- Called by       : PerFile.Delete
  4590. --
  4591. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4592. --
  4593. -- Amendments      :                        (  /  /  )
  4594. --
  4595. -- Notes           : 
  4596. --
  4597. -------------------------------------------------------------------------------
  4598.  
  4599.  
  4600. type DeleteParameters is
  4601.  
  4602.      record
  4603.  
  4604.        CountVariable : long_integer ;
  4605.        FileNumber : long_integer ;
  4606.        NumberOfConditions : long_integer ;
  4607.  
  4608.      end record ;
  4609.  
  4610.  
  4611. DeleteRequest : long_integer:=11;
  4612.  
  4613. Params : DeleteParameters ;
  4614.  
  4615. ParamsSize : long_integer ;
  4616.  
  4617. ParamsStart : long_integer ;
  4618.  
  4619. DummyReturn : long_integer ;
  4620.  
  4621.  
  4622. begin
  4623.  
  4624.   -- parameters INTO the record .
  4625.  
  4626.      -- notice that the size of the record is modified by the number of
  4627.      -- bytes of the record that contain information about the record to
  4628.      -- insert . ParamsSize is the size of trhe parameters to be transmitted 
  4629.      -- to RAPPORT .
  4630.  
  4631.  
  4632.   ParamsSize:=long_integer((DeleteParameters'Size/NumberOfBitsInAByte)) ;
  4633.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4634.   Params.CountVariable:=CountVariable ;
  4635.   Params.NumberOfConditions:=NumberOfConditions ;
  4636.   Params.FileNumber:=FileNumber ;
  4637.  
  4638.   -- transmit to RAPPORT .
  4639.  
  4640.   DummyReturn:=syscall3(DeleteRequest,ParamsStart,ParamsSize,Channel) ;
  4641.  
  4642.   -- parameters OUT OF record .
  4643.  
  4644.   CountVariable:=Params.CountVariable ;
  4645.  
  4646.  
  4647. end ;
  4648.  
  4649.  
  4650.  
  4651.  
  4652.  
  4653.  
  4654. procedure R8STKY ( FileNumber : in long_integer ;
  4655.                    NumberOfFields : in long_integer ;
  4656.                    StartOfSortKeyArray : in long_integer ;
  4657.                    TypeOfRetrieval : in long_integer ;
  4658.                    Channel : in long_integer ) is
  4659.  
  4660.  
  4661.  
  4662. -------------------------------------------------------------------------------
  4663. --
  4664. -- Function        : User interface to R0STKY.To indicate to rapport the 
  4665. --             ordering that is desired  on a search. 
  4666. --
  4667. -- Input arguments : FileNumber:-The number of the file onto which to impose
  4668. --                 the ordering.
  4669. --             NumberOfFields -This is the number of fields in the sort
  4670. --                                   key array.From this the size in words of
  4671. --                                   the array can be calculated.
  4672. --             StartOfSortKeyArray:-The start address in ada space of the
  4673. --                       sort key array.
  4674. --             TypeOfRetrieval:- 0 => Normal
  4675. --                       1 => Order Unique
  4676. --                   Channel:-The number of the channel to the mailbox
  4677. --                  connecting to user call lib.
  4678. --
  4679. -- Output arguments: None .
  4680. --
  4681. -- Global variables: NumberOfBitsInAByte.
  4682. --
  4683. -- Calls to        : vms_call.syscall3
  4684. --
  4685. -- Called by       : PerFile.OrderingTreeWalker
  4686. --
  4687. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4688. --
  4689. -- Amendments      :                        (  /  /  )
  4690. --
  4691. -- Notes           : 
  4692. --
  4693. -------------------------------------------------------------------------------
  4694.  
  4695.  
  4696. type StoreKeyParameters is
  4697.  
  4698.      record
  4699.  
  4700.        FileNumber : long_integer ;
  4701.        TypeOfRetrieval: long_integer ;
  4702.        NumberOfFields : long_integer ;
  4703.        SizeOfArray : long_integer ;
  4704.        StartOfSortKeyArray : long_integer ;
  4705.  
  4706.      end record ;
  4707.  
  4708.  
  4709. StoreKeyRequest : long_integer:=13;
  4710.  
  4711. Params : StoreKeyParameters ;
  4712.  
  4713. ParamsSize : long_integer ;
  4714.  
  4715. ParamsStart : long_integer ;
  4716.  
  4717. DummyReturn : long_integer ;
  4718.  
  4719. NumberOfBytesPerArrayElement : constant long_integer:=8 ;
  4720.  
  4721.  
  4722. begin
  4723.  
  4724.   -- parameters INTO record 
  4725.  
  4726.      -- note that the size of the record is modified by the number of bytes
  4727.      -- required to hold the description of the sort keys as size indicates
  4728.      -- the size of the parameters to be transmitted to RAPPORT .
  4729.  
  4730.  
  4731.   ParamsSize:=long_integer((StoreKeyParameters'Size/NumberOfBitsInAByte)
  4732.                             - NumberOfBytesOfRecordDescription) ;
  4733.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4734.   Params.FileNumber:=FileNumber ;
  4735.   Params.TypeOfRetrieval:=TypeOfRetrieval ;
  4736.   Params.NumberOfFields:=NumberOfFields ;
  4737.   Params.SizeOfArray:=NumberOfFields*NumberOfBytesPerArrayElement ;
  4738.   Params.StartOfSortKeyArray:=StartOfSortKeyArray ;
  4739.  
  4740.   -- transmit to RAPPORT .
  4741.  
  4742.   DummyReturn:=syscall3(StoreKeyRequest,ParamsStart,ParamsSize,Channel) ;
  4743.  
  4744.   -- there is no return from RAPPORT .
  4745.  
  4746.  
  4747. end ;
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753. procedure R8HOLD ( FileNumber : in long_integer ;
  4754.                    NumberOfConditions : in long_integer ;
  4755.                    NumberOfRecords : out long_integer ;
  4756.                    Channel : in long_integer ) is
  4757.  
  4758.  
  4759.  
  4760. -------------------------------------------------------------------------------
  4761. --
  4762. -- Function        : User interface to R0HOLD . Performs the ordered copy of
  4763. --                   the file .
  4764. --
  4765. -- Input arguments : FileNumber:-The number of the file to sort.
  4766. --                   NumberOfConditions:-The number of conditons on the file.
  4767. --                   Channel:-The number of the channel to the mailbox
  4768. --                            connecting to user call lib.      
  4769. --
  4770. -- Output arguments: NumberOfRecords:-The number of records in the sort.
  4771. --
  4772. -- Global variables: NumberOfBitsInAByte.
  4773. --
  4774. -- Calls to        : vms_call.syscall3
  4775. --
  4776. -- Called by       : PerFile.Set_Ordered
  4777. --             PerFile.Set_Unique
  4778. --
  4779. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4780. --
  4781. -- Amendments      :                        (  /  /  )
  4782. --
  4783. -- Notes           : 
  4784. --
  4785. -------------------------------------------------------------------------------
  4786.  
  4787.  
  4788. type HoldParameters is
  4789.  
  4790.      record
  4791.  
  4792.        FileNumber : long_integer ;
  4793.        NumberOfConditions : long_integer ;
  4794.        NumberOfRecords : long_integer ;
  4795.  
  4796.      end record ;
  4797.  
  4798.  
  4799. HoldRequest : long_integer:=14;
  4800.  
  4801. Params : HoldParameters ;
  4802.  
  4803. ParamsSize : long_integer ;
  4804.  
  4805. ParamsStart : long_integer ;
  4806.  
  4807. DummyReturn : long_integer ;
  4808.  
  4809.  
  4810. begin
  4811.  
  4812.   -- parameters INTO record .
  4813.  
  4814.   ParamsSize:=long_integer(HoldParameters'Size/NumberOfBitsInAByte) ;
  4815.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4816.   Params.FileNumber:=FileNumber ;
  4817.   Params.NumberOfConditions:=NumberOfConditions ;
  4818.  
  4819.   -- transmit to RAPPORT .
  4820.  
  4821.   DummyReturn:=syscall3(HoldRequest,ParamsStart,ParamsSize,Channel) ;
  4822.  
  4823.   -- parameters OUT OF record .
  4824.  
  4825.   NumberOfRecords:=Params.NumberOfRecords ;
  4826.  
  4827.  
  4828. end ;
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834. procedure R8ENRV ( CountVariable : in long_integer ;
  4835.                    ErrorCode : out long_integer ;
  4836.                    Channel : in long_integer ) is
  4837.  
  4838.  
  4839.  
  4840. -------------------------------------------------------------------------------
  4841. --
  4842. -- Function        : User interface to R0ENRV.Used to end an ordered search.
  4843. --
  4844. -- Input arguments : CountVariable:-Pointer to the last record accessed.
  4845. --                   Channel:-Number of the channel to the mailbox connecting
  4846. --                            to user call lib.
  4847. --
  4848. -- Output arguments: ErrorCode:-An indication as to the success of R0ENRV.
  4849. --                    A value < -1 indicates a serious error.
  4850. --
  4851. -- Global variables: NumberOfBitsInAByte
  4852. --
  4853. -- Calls to        : vms_call.syscall3
  4854. --
  4855. -- Called by       : PerFile.Clear_Selector
  4856. --
  4857. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4858. --
  4859. -- Amendments      :                        (  /  /  )
  4860. --
  4861. -- Notes           : 
  4862. --
  4863. -------------------------------------------------------------------------------
  4864.  
  4865.  
  4866. type EndRetrieveParameters is
  4867.     
  4868.      record
  4869.  
  4870.        ErrorCode : long_integer ;
  4871.        CountVariable : long_integer ;
  4872.  
  4873.      end record ;
  4874.  
  4875.  
  4876. EndRetrieveRequest : long_integer:=15;
  4877.  
  4878. Params : EndRetrieveParameters ;
  4879.  
  4880. ParamsSize : long_integer ;
  4881.  
  4882. ParamsStart : long_integer ;
  4883.  
  4884. DummyReturn : long_integer ;
  4885.  
  4886.  
  4887. begin
  4888.  
  4889.   -- parameters INTO record .
  4890.  
  4891.   ParamsSize:=long_integer(EndRetrieveParameters'Size/NumberOfBitsInAByte) ;
  4892.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4893.   Params.CountVariable:=CountVariable ;
  4894.  
  4895.   -- transmit to RAPPORT .
  4896.  
  4897.   DummyReturn:=syscall3(EndRetrieveRequest,ParamsStart,ParamsSize,Channel) ;
  4898.  
  4899.   -- parameters OUT OF record .
  4900.  
  4901.   ErrorCode:=Params.ErrorCode ;
  4902.  
  4903. end ;
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911. procedure R8RTRV ( FileNumber : in long_integer ;
  4912.                    CountVariable : in out long_integer ;
  4913.                    SizeOfRecord : in long_integer ;
  4914.                    StartOfRecord : in long_integer ;
  4915.                    Channel : in long_integer ) is
  4916.  
  4917.  
  4918.  
  4919. -------------------------------------------------------------------------------
  4920. --
  4921. -- Function        : User interface to R0RTRV.Fetches a record for an ordered 
  4922. --             search.
  4923. --
  4924. -- Input arguments : CountVariable:-Indicates the last record accessed.
  4925. --                   SizeOfRecord:-The size of the record that is to be got.
  4926. --             StartOfRecord:-The start address in ada space to put 
  4927. --                                  the got record.
  4928. --                   Channel:-The number of the channel to the mailbox
  4929. --                  connecting to user calll ib.
  4930. --
  4931. -- Output arguments: CountVariable:-Indicates the record that has just been
  4932. --                        retrieved.In the next call to R8RTRV in
  4933. --                    this particular set wilkl have this value
  4934. --                    as a pointer to the last record accessed.
  4935. --
  4936. -- Global variables: NumberOfBitsInAByte , NumberOfBytesOfRcordDescription .
  4937. --
  4938. -- Calls to        : vms_call.syscall3
  4939. --
  4940. -- Called by       : PerFile.Searc
  4941. --
  4942. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  4943. --
  4944. -- Amendments      :                        (  /  /  )
  4945. --
  4946. -- Notes           : 
  4947. --
  4948. -------------------------------------------------------------------------------
  4949.  
  4950.  
  4951. type RetrieveParameters is
  4952.  
  4953.      record
  4954.  
  4955.        CountVariable : long_integer ;
  4956.        FileNumber : long_integer ;
  4957.        SizeOfRecord : long_integer ;
  4958.        StartOfRecord : long_integer ;
  4959.      
  4960.      end record ;
  4961.  
  4962.  
  4963.  
  4964. RetrieveRequest : long_integer:=17;
  4965.  
  4966. Params : RetrieveParameters ;
  4967.  
  4968. ParamsSize : long_integer ;
  4969.  
  4970. ParamsStart : long_integer ;
  4971.  
  4972. DummyReturn : long_integer ;
  4973.  
  4974.  
  4975. begin
  4976.  
  4977.  
  4978.   -- parameters into record .
  4979.  
  4980.      -- note that the size is modified by the number of bytes needed to
  4981.      -- hold the description of the record . This is as the size is the
  4982.      -- size of the parameters to be transmitted to RAPPORT .
  4983.  
  4984.  
  4985.   ParamsSize:=long_integer((RetrieveParameters'Size/NumberOfBitsInAByte)
  4986.                             - NumberOfBytesOfRecordDescription) ;
  4987.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  4988.   Params.CountVariable:=CountVariable ;
  4989.   Params.FileNumber := FileNumber ;
  4990.   Params.StartOfRecord:=StartOfREcord ;
  4991.   Params.SizeOfREcord:=SizeOfREcord ;
  4992.  
  4993.   -- transmit to RAPPORT .
  4994.  
  4995.   DummyReturn:=syscall3(RetrieveRequest,ParamsStart,ParamsSize,Channel) ;
  4996.  
  4997.   -- parameters OUT OF record .
  4998.  
  4999.   CountVariable := Params.CountVariable ;
  5000.  
  5001. end ;
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007. procedure R8CLFI ( FileNumber : in long_integer ;
  5008.                    ErrorCode : out long_integer ;
  5009.                    Channel : in long_integer ) is
  5010.  
  5011.  
  5012. -------------------------------------------------------------------------------
  5013. --
  5014. -- Function        : User interface to R0CLFI.To clear a specified file.
  5015. --
  5016. -- Input arguments : FileNumber:-Number of the file to clear.
  5017. --                   Channel:-The number of the channel to the mailbox
  5018. --                            connecting to user calll ib.
  5019. --
  5020. -- Output arguments: ErrorCode:-Indicator as to the success of the execution
  5021. --                    of R0CLFI.An Error code < -1 indicates that
  5022. --                a serious error has occvurred.
  5023. --
  5024. -- Global variables: NumberOfBitsInAByte.
  5025. --
  5026. -- Calls to        : vms_call.syscall3
  5027. --
  5028. -- Called by       : PerFile.Clear
  5029. --
  5030. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  5031. --
  5032. -- Amendments      :                        (  /  /  )
  5033. --
  5034. -- Notes           : 
  5035. --
  5036. -------------------------------------------------------------------------------
  5037.  
  5038.  
  5039. type ClearFileParameters is
  5040.  
  5041.      record
  5042.  
  5043.        ErrorCode : long_integer ;
  5044.        FileNumber : long_integer ;
  5045.  
  5046.      end record ;
  5047.  
  5048.  
  5049. ClearFileRequest : long_integer:=18;
  5050.  
  5051. Params : ClearFileParameters ;
  5052.  
  5053. ParamsSize : long_integer ;
  5054.  
  5055. ParamsStart : long_integer ;
  5056.  
  5057. DummyReturn : long_integer ;
  5058.  
  5059.  
  5060. begin
  5061.  
  5062.   -- parameters INTO record .
  5063.  
  5064.   ParamsSize:=long_integer(ClearFileParameters'Size/NumberOfBitsInAByte) ;
  5065.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  5066.   Params.FileNumber:=FileNumber ;
  5067.  
  5068.   -- transmit to RAPPORT .
  5069.  
  5070.   DummyReturn:=syscall3(ClearFileRequest,ParamsStart,ParamsSize,Channel) ;
  5071.  
  5072.   -- parameters OUT OF record .
  5073.  
  5074.   ErrorCode:=Params.ErrorCode ;
  5075.  
  5076. end ;
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084. procedure R8LOCK ( FileNumber : in long_integer ;
  5085.                    ReadWriteSwitch : in long_integer ;
  5086.                    ErrorCode : out long_integer ;
  5087.                    Channel : in long_integer ) is
  5088.  
  5089.  
  5090.  
  5091. -------------------------------------------------------------------------------
  5092. --
  5093. -- Function        : User interface to R0LOCK.To lock a particular file.
  5094. --
  5095. -- Input arguments : FileNumber:-The number of the file to lock.
  5096. --                   ReadWriteSwitch:-An indicator as tio the type of lock
  5097. --                          required on the file.
  5098. --                   Channel:-The number of the channel to the mailbox
  5099. --                  connecting to user calll lib.
  5100. --
  5101. -- Output arguments: ErrorCode:-Indicatiopn as to the success of R0LOCK.An
  5102. --                    Error code < -1 indicates a serious error.
  5103. --
  5104. -- Global variables: NumberOfBitsInAByte.
  5105. --
  5106. -- Calls to        : vms_call.syscall3
  5107. --
  5108. -- Called by       : PerFile.Lock
  5109. --
  5110. -- Author          : M.D.DICK               (28/1/85)     Version 1.0
  5111. --
  5112. -- Amendments      :                        (  /  /  )
  5113. --
  5114. -- Notes           : 
  5115. --
  5116. -------------------------------------------------------------------------------
  5117.  
  5118.  
  5119.  
  5120. type LockParameters is
  5121.  
  5122.      record
  5123.  
  5124.        ErrorCode : long_integer ;
  5125.        FileNumber : long_integer ;
  5126.        ReadWriteSwitch : long_integer ;
  5127.  
  5128.      end record ;
  5129.  
  5130.  
  5131. LockRequest : long_integer:=19;
  5132.  
  5133. Params : LockParameters ;
  5134.  
  5135. ParamsSize : long_integer ;
  5136.  
  5137. ParamsStart : long_integer ;
  5138.  
  5139. DummyReturn : long_integer ;
  5140.  
  5141.  
  5142. begin
  5143.  
  5144.   -- parameters INTO the record .
  5145.  
  5146.   ParamsSize:=long_integer(LockParameters'Size/NumberOfBitsInAByte) ;
  5147.   ParamsStart:=AddressToLongInteger(Params'Address) ;
  5148.   Params.FileNumber:=FileNumber ;
  5149.   Params.ReadWriteSwitch:=ReadWriteSwitch ; 
  5150.  
  5151.   -- transmit to RAPPORT .
  5152.  
  5153.   DummyReturn:=syscall3(LockRequest,ParamsStart,ParamsSize,Channel) ;
  5154.  
  5155.   -- parameters OUT OF record .
  5156.  
  5157.   ErrorCode:=Params.ErrorCode ;
  5158.  
  5159.  
  5160. end ;
  5161.  
  5162.  
  5163.  
  5164.  
  5165.  
  5166.  
  5167.  
  5168. end R8LIB ;
  5169.  
  5170. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5171. --PERDDF.TXT
  5172. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5173. ----------------------------------------------------------------------------
  5174. --                                                                        --
  5175. -- This package is a set of procedures suitable for use on any file . It  --
  5176. -- contains these procedures and also the set of global data neccesary    --
  5177. -- for an activation of RAPPORT . A new package is required for every     --
  5178. -- DDF accessed as different CHECKSUMS and LAST_FILES will be in          --
  5179. -- operation .                                                            --
  5180. --                                                                        --
  5181. -- To instantiate for each seperate ddf :-                                --
  5182. --                                                                        --
  5183. --          Replace  %1 with the value of the CheckSum determined by      --
  5184. --                      RCP'ing a dummy fortran program .                 --
  5185. --          Replace  %2 with the value of the last file determoined as    --
  5186. --                      worst .                                           --
  5187. --          Replace  %3 with the name of the ddf                          --
  5188. --                                                                        --
  5189. --                                                                        --
  5190. --  Exit finally as %3.txt .                                              --
  5191. --                                                                        --
  5192. ----------------------------------------------------------------------------
  5193.  
  5194.  
  5195.  
  5196. WITH TEXT_IO , R8LIB ; USE TEXT_IO , R8LIB ;
  5197. with unchecked_conversion , system ;
  5198. package %3 is
  5199.  
  5200.  
  5201.    RAPPORT_ERROR : exception;
  5202.  
  5203.    type GENERAL_ELEMENT is (ANY_ELEMENT,ALL_ELEMENTS);
  5204.  
  5205.    type LOCKING_MODE is (READ, WRITE);
  5206.  
  5207.  
  5208. -- Non-generic rapport access procedures .
  5209.  
  5210.    procedure RAPPORT_STATUS(ERROR_NO : out LONG_INTEGER;
  5211.                             TASK_NO : out LONG_INTEGER;
  5212.                             TRANS_NO : out LONG_INTEGER);
  5213.  
  5214.    procedure STARTRAPPORT;
  5215.  
  5216.    procedure ENDRAPPORT;
  5217.  
  5218.    procedure TRANSACT;
  5219.  
  5220.    procedure COMMIT;
  5221.  
  5222.    procedure BACKOUT;
  5223.  
  5224.    procedure BAILOUT;
  5225.  
  5226.  
  5227.  
  5228.  
  5229.  
  5230.  
  5231. -- Generic data dependant on the ddf assosciated with this package .
  5232.  
  5233.    CHECKSUM : constant LONG_INTEGER := %1 ;
  5234.    LAST_FILE : constant LONG_INTEGER := %2  ;
  5235.  
  5236. -- Non-generic global data required by a rapport application .
  5237.  
  5238.    RAPPORT_STARTED : BOOLEAN;
  5239.    TASK_NUMBER : LONG_INTEGER;
  5240.    MAILBOX : LONG_INTEGER;
  5241.    TRANSACTION : LONG_INTEGER;
  5242.    ERROR_CODE : LONG_INTEGER;
  5243.  
  5244.    LOCKNUMBER : constant array (LOCKING_MODE) of LONG_INTEGER :=
  5245.          (1, 2);
  5246.  
  5247.  
  5248. -- Information must be kept as to the current and the currently active
  5249. -- search loops and their assosciated types . A search loop can be 
  5250. -- normal ordered or unique.There can be a maximum of 26 active search
  5251. -- loops.
  5252.  
  5253.    type SELECTION is (NORMAL , ORDERED , UNIQUE) ;
  5254.  
  5255.    MAX_STACK_SIZE : constant integer:=26 ;
  5256.  
  5257.    SELECTOR_STACK : array(1..MAX_STACK_SIZE) of SELECTION ;
  5258.  
  5259.    CURRENT_LEVEL : integer :=1 ;
  5260.  
  5261.  
  5262.  
  5263. -- The file dependant procedured require a function to convert between an
  5264. -- address and long_integer format .
  5265.  
  5266.    function AddressToLongInteger is new Unchecked_Conversion(System.address,
  5267.                                                              long_integer ) ;
  5268.  
  5269.  
  5270. end ;
  5271.  
  5272.  
  5273.  
  5274. package body %3 is
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.    procedure RAPPORT_STATUS(ERROR_NO : out LONG_INTEGER;
  5282.                             TASK_NO : out LONG_INTEGER;
  5283.                             TRANS_NO : out LONG_INTEGER) is
  5284.  
  5285. -------------------------------------------------------------------------------
  5286. --
  5287. -- Function        : To return the current status.Can be used on a RAPPORT
  5288. --                   exception to discover the error_code and the other
  5289. --                   status information
  5290. --
  5291. -- Input arguments : None .
  5292. --
  5293. -- Output arguments: Error_No : The current error number 0 => no error .
  5294. --                   Task_no  : The number assigned by the nucleus to this 
  5295. --                              task 
  5296. --                   Trans_No : If we are in a transaction set then this
  5297. --                              is the number assigned to the transaction 
  5298. --                              by the nucleus .
  5299. --
  5300. -- Global variables: ERROR_CODE , TASK_NUMBER , TRANSACTION_NUMBER
  5301. --
  5302. -- Calls to        : None.
  5303. --
  5304. -- Called by       : ADA Application programs .
  5305. --
  5306. -- Author          : RP                     (  /  /  )     Version 1.0
  5307. --
  5308. -- Amendments      :                        (  /  /  )
  5309. --
  5310. -- Notes           : 
  5311. --
  5312. -------------------------------------------------------------------------------
  5313.  
  5314.  
  5315.  
  5316.    begin
  5317.  
  5318.       ERROR_NO := ERROR_CODE;
  5319.       TASK_NO := TASK_NUMBER;
  5320.       TRANS_NO := TRANSACTION;
  5321.  
  5322.    end;
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.    procedure STARTRAPPORT is
  5329.  
  5330. -------------------------------------------------------------------------------
  5331. --
  5332. -- Function        : This procedure establishes a connection between an ADA
  5333. --                   application program and the RAPPORT nucleus.
  5334. --
  5335. -- Input arguments : None .
  5336. --
  5337. -- Output arguments: None .
  5338. --
  5339. -- Global variables: ERROR_CODE , TASK_NUMBER , CHECKSUM , LAST_FILE , MAILBOX
  5340. --                   RAPPORT_STARTED.
  5341. --
  5342. -- Calls to        : R8LIB.R8STAR .
  5343. --
  5344. -- Called by       : ADA Application program .
  5345. --
  5346. -- Author          : RP                      (  /  /  )     Version 1.0
  5347. --
  5348. -- Amendments      :                        (  /  /  )
  5349. --
  5350. -- Notes           : 
  5351. --
  5352. -------------------------------------------------------------------------------
  5353.  
  5354.  
  5355.  
  5356.    begin
  5357.  
  5358. --      put("%ADALIB-TRACEMSG-ENTERING STARTRAPPORT") ; new_line ;
  5359.  
  5360.       if RAPPORT_STARTED then
  5361.        
  5362.          ERROR_CODE := -103;
  5363.          raise RAPPORT_ERROR;
  5364.  
  5365.       else
  5366.  
  5367.          ERROR_CODE := 0;
  5368.          R8STAR(CHECKSUM, LAST_FILE, TASK_NUMBER, ERROR_CODE, MAILBOX);
  5369.  
  5370.          if ERROR_CODE < -1 then
  5371.             raise RAPPORT_ERROR;
  5372.          else
  5373.             RAPPORT_STARTED := TRUE;
  5374.          end if;
  5375.  
  5376.       end if;
  5377.  
  5378. --      put("%ADALIB-TRACEMSG-LEAVING STARTRAPPORT") ; new_line ;
  5379.  
  5380.    end;
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386.    procedure ENDRAPPORT is
  5387.  
  5388. -------------------------------------------------------------------------------
  5389. --
  5390. -- Function        : To stop the current intercation with the RAPPORT nucleus
  5391. --
  5392. -- Input arguments : None.
  5393. --
  5394. -- Output arguments: None.
  5395. --
  5396. -- Global variables: ERROR_CODE , MAILBOX , RAPPORT_STARTED .
  5397. --
  5398. -- Calls to        : R8LIB.R8ENDR
  5399. --
  5400. -- Called by       : ADA Application program .
  5401. --
  5402. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  5403. --
  5404. -- Amendments      :                        (  /  /  )
  5405. --
  5406. -- Notes           : 
  5407. --
  5408. -------------------------------------------------------------------------------
  5409.  
  5410.  
  5411.  
  5412.    begin
  5413.  
  5414. --     put("%ADALIB-TRACEMSG-ENTERING ENDRAPPORT") ; NEW_LINE ;
  5415.   
  5416.      if RAPPORT_STARTED then
  5417.  
  5418.        ERROR_CODE:=0 ;
  5419.  
  5420.        R8ENDR ( ERROR_CODE , MAILBOX ) ;
  5421.    
  5422.        RAPPORT_STARTED := FALSE ;
  5423.  
  5424.        if ERROR_CODE < -1 then
  5425.           raise RAPPORT_ERROR ;
  5426.        end if ;
  5427.  
  5428.      else
  5429.  
  5430.        ERROR_CODE := -100 ;
  5431.        raise RAPPORT_ERROR ;
  5432.  
  5433.      end if ;
  5434.  
  5435.  
  5436. --     put("%ADALIB-TRACEMSG-LEAVING ENDRAPPORT") ; NEW_LINE ;
  5437.  
  5438.    end;
  5439.  
  5440.  
  5441.    procedure TRANSACT is
  5442.  
  5443.  
  5444. -------------------------------------------------------------------------------
  5445. --
  5446. -- Function        : To start a transaction set .
  5447. --
  5448. -- Input arguments : None .
  5449. --
  5450. -- Output arguments: None .
  5451. --
  5452. -- Global variables: ERROR_CODE , MAILBOX , TRANSACTION_NUMBER .
  5453. --
  5454. -- Calls to        : R8LIB.R8TRAN .
  5455. --
  5456. -- Called by       : ADA Application program .
  5457. --
  5458. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  5459. --
  5460. -- Amendments      :                        (  /  /  )
  5461. --
  5462. -- Notes           : 
  5463. --
  5464. -------------------------------------------------------------------------------
  5465.  
  5466.  
  5467.  
  5468.    begin
  5469.  
  5470. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE TRANSACT") ; NEW_LINE ;
  5471.  
  5472.      if RAPPORT_STARTED then 
  5473.  
  5474.        ERROR_CODE:=0 ;
  5475.  
  5476.        R8TRAN ( TRANSACTION , ERROR_CODE , MAILBOX ) ;
  5477.  
  5478.        if ERROR_CODE < -1 then
  5479.           raise RAPPORT_ERROR ;
  5480.        end if ;
  5481.  
  5482.      else 
  5483.  
  5484.        ERROR_CODE := -100 ;
  5485.        raise RAPPORT_ERROR ;
  5486.  
  5487.      end if ;
  5488.  
  5489.  
  5490.  
  5491. --     put("%ADALIB-TRACEMSG-LEAVING PROCEDURE TRANSACT") ; NEW_LINE ;
  5492.  
  5493.    end;
  5494.  
  5495.  
  5496.  
  5497.  
  5498.  
  5499.  
  5500.  
  5501.    procedure COMMIT is
  5502.  
  5503. -------------------------------------------------------------------------------
  5504. --
  5505. -- Function        : To commit the transaction set marked by the transact
  5506. --                   command to the database .
  5507. --
  5508. -- Input arguments : None.
  5509. --
  5510. -- Output arguments: None.
  5511. --
  5512. -- Global variables: ERROR_CODE , MAILBOX .
  5513. --
  5514. -- Calls to        : R8LIB.R8COMT .
  5515. --
  5516. -- Called by       : ADA Application program .
  5517. --
  5518. -- Author          : RP/MDD                  (  /  /  )     Version 1.0
  5519. --
  5520. -- Amendments      :                        (  /  /  )
  5521. --
  5522. -- Notes           : 
  5523. --
  5524. -------------------------------------------------------------------------------
  5525.  
  5526.  
  5527.  
  5528.    begin
  5529.  
  5530. --     put("%ADALIB-TRACEMSG-ENETERINT PROCEDURE TRACE") ; NEW_LINE ;
  5531.  
  5532.      if RAPPORT_STARTED then 
  5533.  
  5534.        ERROR_CODE:=0 ;
  5535.  
  5536.        R8COMT ( ERROR_CODE , MAILBOX ) ;
  5537.  
  5538.        if ERROR_CODE < -1 then
  5539.           raise RAPPORT_ERROR ;
  5540.        end if ;
  5541.  
  5542.      else
  5543.  
  5544.        ERROR_CODE := -100 ;
  5545.        raise RAPPORT_ERROR ;
  5546.  
  5547.      end if ;
  5548.  
  5549.  
  5550. --     put("%ADALIB-TRACEMSG-LEAVING PROCEDURE COMMIT") ; NEW_LINE ;
  5551.  
  5552.    end;
  5553.  
  5554.  
  5555.  
  5556.  
  5557.  
  5558.  
  5559.    procedure BACKOUT is
  5560.  
  5561. -------------------------------------------------------------------------------
  5562. --
  5563. -- Function        : To backout of a transaction set marked by the command
  5564. --                   TRANSACT . 
  5565. --
  5566. -- Input arguments : None.
  5567. --
  5568. -- Output arguments: None.
  5569. --
  5570. -- Global variables: ERROR_CODE , MAILBOX .
  5571. --
  5572. -- Calls to        : R8LIB.BKTK
  5573. --
  5574. -- Called by       : ADA Application program .
  5575. --
  5576. -- Author          : RP/MDD                  (  /  /  )     Version 1.0
  5577. --
  5578. -- Amendments      :                        (  /  /  )
  5579. --
  5580. -- Notes           : 
  5581. --
  5582. -------------------------------------------------------------------------------
  5583.  
  5584.  
  5585.  
  5586.    begin
  5587.  
  5588. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE BACKOUT") ; NEW_LINE ;
  5589.  
  5590.      if RAPPORT_STARTED then 
  5591.  
  5592.        ERROR_CODE:=0 ;
  5593.  
  5594.        R8BKTK ( ERROR_CODE , MAILBOX ) ;
  5595.  
  5596.        if ERROR_CODE < -1 then
  5597.           raise RAPPORT_ERROR ;
  5598.        end if ;
  5599.  
  5600.      else
  5601.  
  5602.        ERROR_CODE := -100 ;
  5603.        raise RAPPORT_ERROR ;
  5604.  
  5605.      end if ;
  5606.  
  5607.  
  5608. --     put("%ADALIB-TRACEMSG-LEAVING PROCEDURE BNACKOUT") ; NEW_LINE ;
  5609.  
  5610.    end;
  5611.  
  5612.  
  5613.  
  5614.  
  5615.    procedure BAILOUT is
  5616.  
  5617. -------------------------------------------------------------------------------
  5618. --
  5619. -- Function        : On receipt of a rapport_error , if rapport is started to
  5620. --                   perform an endrapport . If an error is discovered then no 
  5621. --                   statement is executed as a loop situation could develop .
  5622. --              
  5623. -- Input arguments : None.
  5624. --
  5625. -- Output arguments: None.
  5626. --
  5627. -- Global variables: None .
  5628. --
  5629. -- Calls to        : EndRapport .
  5630. --
  5631. -- Called by       : ADA Application program .
  5632. --
  5633. -- Author          : RP/MDD                  (  /  /  )     Version 1.0
  5634. --
  5635. -- Amendments      :                        (  /  /  )
  5636. --
  5637. -- Notes           : 
  5638. --
  5639. -------------------------------------------------------------------------------
  5640.  
  5641.  
  5642.    begin
  5643.  
  5644.       ENDRAPPORT;
  5645.  
  5646.    exception
  5647.       when RAPPORT_ERROR =>
  5648.          null;
  5649.    end;
  5650.  
  5651.  
  5652.  
  5653. begin
  5654.  
  5655. -- The following code is activated at the start of an application program
  5656. -- and sets the global variables to their intial values .
  5657.  
  5658.  
  5659.    RAPPORT_STARTED := FALSE;
  5660.    TASK_NUMBER := 0;
  5661.    MAILBOX := 0;
  5662.    TRANSACTION := 0;
  5663.    ERROR_CODE := 0;
  5664.  
  5665. end;
  5666. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5667. --PERFILE.TXT
  5668. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5669. ------------------------------------------------------------------------
  5670. ------------------------------------------------------------------------
  5671. --                                                                    --
  5672. --  This is a pseudo generic package suitable for hand instantiation  --
  5673. --  for the package for each database file.To instantiate :-          --
  5674. --                                                                    --
  5675. --          Replace  %1  with a complete set of type declarations     --
  5676. --                       for every field in the file including in     --
  5677. --                       the case of array fields a type definition   --
  5678. --                       for the base element of the array.           --
  5679. --                       note that field type renaming base type      --
  5680. --                       must be specified as subtypes :-             --
  5681. --                                                                    --
  5682. --                         subtype FIELD_TYPE is FLOAT ;              --
  5683. --                                                                    --
  5684. --          Replace  %2  with the components of the record            --
  5685. --                       description for the file.This will consist   --
  5686. --                       of a set of elements of the form :-          --
  5687. --                                                                    --
  5688. --                         FIELD_NAME : FIELD_TYPE ;                  --
  5689. --                                                                    --
  5690. --          Replace  %3  with the number of the file .                --
  5691. --                                                                    --
  5692. --          Replace  %4  with the name of the file .                  --
  5693. --                                                                    --
  5694. --          Replace %5   with the name of the ddf package .           --
  5695. --                                                                    --
  5696. --                                                                    --
  5697. --  Finally exit the edit by "EXIT %4.txt" .                          --
  5698. --                                                                    --
  5699. ------------------------------------------------------------------------
  5700. ------------------------------------------------------------------------
  5701.  
  5702.  
  5703.  
  5704.  
  5705. WITH TEXT_IO , R8LIB , %5 ; USE TEXT_IO , R8LIB , %5 ;
  5706. with unchecked_conversion , system ;
  5707. package %4 is
  5708.  
  5709.    procedure CLEAR ;
  5710.  
  5711.    procedure LOCK( LOCK : LOCKING_MODE );
  5712.  
  5713.  
  5714.    %1
  5715.    
  5716.  
  5717.    type DB_RECORD is
  5718.  
  5719.       record
  5720.  
  5721.         %2      
  5722.  
  5723.       end record ;
  5724.  
  5725.  
  5726.    type CONDITION_BLOCK;
  5727.    type CONDITION_TREE is access CONDITION_BLOCK;
  5728.  
  5729.  
  5730.    type TreeBlock is ( Conjunction , Condition ) ;
  5731.  
  5732.    type RHSParametersRecord is
  5733.  
  5734.         record
  5735.  
  5736.           ConditionNumber : long_integer ;
  5737.           FieldNumber : long_integer ;
  5738.           AnyAllSwitch : long_integer ;
  5739.           ArraySubscript : long_integer ;
  5740.           SizeOfRightHandSide : long_integer ;
  5741.           StartOfRightHandSide : long_integer ;
  5742.  
  5743.         end record ;
  5744.  
  5745.  
  5746.  
  5747.    type CONDITION_BLOCK is
  5748.  
  5749.       record
  5750.  
  5751.         BlockType : TreeBlock ;
  5752.         
  5753.         ConjunctionNumber : long_integer ;
  5754.         LeftPartOfConjunction : CONDITION_TREE ;
  5755.         RightPartOfConjunction : CONDITION_TREE ;
  5756.  
  5757.         RHSParameters : RHSParametersRecord ;
  5758.  
  5759.      end record ;
  5760.  
  5761.  
  5762.  
  5763.  
  5764.    type SELECTOR is
  5765.  
  5766.       record
  5767.  
  5768.         CountVariable : long_integer ;
  5769.         RetrievalStrategy : long_integer ;
  5770.         Level : integer ;
  5771.         Conditions : CONDITION_TREE ;
  5772.  
  5773.       end record;
  5774.  
  5775.   
  5776.    type ORDER_BLOCK;
  5777.    type ORDERING_TREE is access ORDER_BLOCK;
  5778.  
  5779.    type ORDER_BLOCK_TYPE is ( NODE , LEAF ) ;
  5780.  
  5781.    type ORDER_BLOCK is
  5782.  
  5783.       record
  5784.  
  5785.         BlockType : ORDER_BLOCK_TYPE ;
  5786.  
  5787.         LeftPart : ORDERING_TREE ;
  5788.         RightPart : ORDERING_TREE ;
  5789.  
  5790.         OrderingInformation : long_integer ;
  5791.  
  5792.       end record;
  5793.  
  5794.  
  5795.  MAX_NUMBER_OF_ORDER_FIELDS : constant integer := 10 ;
  5796.  
  5797.  type ORDERING_ARRAY is array(1..MAX_NUMBER_OF_ORDER_FIELDS) of long_integer ;
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.    procedure INSERT(REC : DB_RECORD);
  5805.  
  5806.    procedure UPDATE(REC : DB_RECORD);
  5807.  
  5808.    procedure STORE(REC : DB_RECORD);
  5809.  
  5810.  
  5811.  
  5812.    procedure FETCH(REC : out DB_RECORD;
  5813.                    EXISTS : out BOOLEAN;
  5814.                    CONDITIONS : CONDITION_TREE);
  5815.  
  5816.  
  5817.  
  5818.    procedure DELETE(NUMBER : out integer ;
  5819.                     CONDITIONS : CONDITION_TREE);
  5820.  
  5821.  
  5822.  
  5823.    procedure SET_SELECTOR(SELECTION : out SELECTOR);
  5824.  
  5825.    procedure SET_SELECTOR(SELECTION : out SELECTOR;
  5826.                           CONDITIONS : CONDITION_TREE);
  5827.  
  5828.    procedure SET_ORDERED(SELECTION : out SELECTOR;
  5829.                          ORDERING : ORDERING_TREE);
  5830.  
  5831.    procedure SET_ORDERED(SELECTION : out SELECTOR;
  5832.                          ORDERING : ORDERING_TREE;
  5833.                          CONDITIONS : CONDITION_TREE);
  5834.  
  5835.    procedure SET_UNIQUE(SELECTION : out SELECTOR;
  5836.                         ORDERING : ORDERING_TREE);
  5837.  
  5838.    procedure SET_UNIQUE(SELECTION : out SELECTOR;
  5839.                         ORDERING : ORDERING_TREE;
  5840.                         CONDITIONS : CONDITION_TREE);
  5841.  
  5842.  
  5843.  
  5844.    procedure SEARCH(SELECTION : in out SELECTOR;
  5845.                     REC : out DB_RECORD;
  5846.                     END_OF_SEARCH : out BOOLEAN);
  5847.  
  5848.  
  5849.  
  5850.    procedure CLEAR_SELECTOR(SELECTION : in out SELECTOR);
  5851.  
  5852.  
  5853.  
  5854.  
  5855.    function "and" ( LeftPart , RightPart : CONDITION_TREE ) 
  5856.      
  5857.             return CONDITION_TREE ;
  5858.  
  5859.  
  5860.    function "or" ( LeftPart , RightPart : CONDITION_TREE ) 
  5861.      
  5862.             return CONDITION_TREE ;
  5863.  
  5864.  
  5865.  
  5866.  
  5867.    function "&" ( LeftPart , RightPart : ORDERING_TREE )
  5868.  
  5869.             return ORDERING_TREE ;
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.   
  5877. end;
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.  
  5885. package body %4 is
  5886.  
  5887.  
  5888. FileNumber  : constant long_integer := %3 ;
  5889.  
  5890. NumberOfBitsInAByte : constant integer :=8 ;
  5891.  
  5892.  
  5893.  
  5894.  
  5895.  
  5896.  
  5897.  
  5898.  procedure OrderingTreeWalker ( OrderTree : in ORDERING_TREE ;
  5899.                                 OrderList : out ORDERING_ARRAY ;
  5900.                                 NumberOfFields : out integer ) is
  5901.  
  5902. -------------------------------------------------------------------------------
  5903. --
  5904. -- Function        : This procedure traverses the ordering tree of the form
  5905. --
  5906. --                                     node
  5907. --                                     /  \
  5908. --                                   info node
  5909. --                                        /  \
  5910. --
  5911. --                   produced by the functions "&" and up & down and produces
  5912. --                   as a result an array of ordering information .
  5913. --
  5914. --
  5915. -- Input arguments : OrderTree : A pointer to an order tree of the form 
  5916. --                               shown above .
  5917. --        
  5918. --
  5919. -- Output arguments: OrderList : An array representation of the order tree.
  5920. --                   NumberInList : The number of fields in the order.
  5921. --
  5922. -- Global variables: None.
  5923. --
  5924. -- Calls to        : WalkTree a nested sub-procedure.
  5925. --
  5926. -- Called by       : set_ordered .
  5927. --
  5928. -- Author          : MDD                     (  /  /  )     Version 1.0
  5929. --
  5930. -- Amendments      :                        (  /  /  )
  5931. --
  5932. -- Notes           : 
  5933. --
  5934. -------------------------------------------------------------------------------
  5935.  
  5936.  
  5937.  
  5938.     -- This is an inner procedure to the ordering tree walker . It
  5939.     -- recursively walks the ordering tree by :-
  5940.     -- LeftTree , Leaf , RightTree .
  5941.  
  5942.      procedure WalkTree ( Tree : in ORDERING_TREE  ;
  5943.                           CurrentNumber : in out integer ) is
  5944.  
  5945.         begin
  5946.     
  5947. --          put("%ADALIB-TRACEMSG-ENTERING PROCEDURE WALK TREE" ) ; NEW_LINE ;
  5948.  
  5949.           if Tree.BlockType = LEAF
  5950.  
  5951.              then CurrentNumber := CurrentNumber+1 ;
  5952.                   OrderList(CurrentNumber) := Tree.OrderingInformation ;
  5953.  
  5954.              else WalkTree ( Tree.LeftPart , CurrentNumber  ) ;
  5955.                   WalkTree ( Tree.RightPart , CurrentNumber  ) ;
  5956.  
  5957.           end if ;
  5958.  
  5959. --          put("%ADALIB-TRACEMSG-LEAVING PROCEDURE WALK TREE") ; NEW_LINE ;
  5960.  
  5961.          end WalkTree ;
  5962.  
  5963.  
  5964.  
  5965.  
  5966.  
  5967.  
  5968.    begin
  5969.  
  5970. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE ORDERING TREE WALKER") ;
  5971.      NEW_LINE ;
  5972.  
  5973.  
  5974.      NumberOfFields := 0 ;
  5975.  
  5976.      if OrderTree /= null
  5977.         then WalkTree ( OrderTree  , NumberOfFields);
  5978.      end if ;
  5979.  
  5980. --     put("%ADALIB-TTRACEMSG-LEAVING PROCEDURE ORDERING TREE WALKER") ;   
  5981.      NEW_LINE ;
  5982.  
  5983.    end OrderingTreeWalker ;
  5984.  
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.   procedure ConditionTreeWalker ( ConditionTree : in CONDITION_TREE ;
  5991.                                   NumberOfConditions : out long_integer ) is
  5992.  
  5993. -------------------------------------------------------------------------------
  5994. --
  5995. -- Function        : This procedure walks over an inputed Condition tree 
  5996. --                   producing a number of calls to r8cond one for each
  5997. --                   condition.
  5998. --                   The actual mechanics of the traversal are very difficult
  5999. --                   to explain . It is best to work through an example.
  6000. --
  6001. -- Input arguments : ConditionTree : A pointer to a condition tree.
  6002. --
  6003. -- Output arguments: NumberOfConditions : The number of conditions found.
  6004. --
  6005. -- Global variables: RAPPORT.MAILBOX , FileNumber .
  6006. --
  6007. -- Calls to        : R8LIB.R8COND , UnfoldConditionTree a nested sub-procedure 
  6008. --
  6009. -- Called by       : set_ordered , search
  6010. --
  6011. -- Author          : MDD                      (  /  /  )     Version 1.0
  6012. --
  6013. -- Amendments      :                        (  /  /  )
  6014. --
  6015. -- Notes           : 
  6016. --
  6017. -------------------------------------------------------------------------------
  6018.  
  6019.  
  6020.  
  6021.   ReturnedParametersOut : RHSParametersRecord ;
  6022.   LevelInTheConditionTree : long_integer :=0 ;
  6023.   NumberOfCurrentConditionInSet : long_integer := 0 ;
  6024.   NoConjunction : long_integer := 0 ;
  6025.  
  6026.  
  6027.  
  6028.  
  6029.     procedure UnfoldConditionTree ( ConditionTreePointer : 
  6030.                                         in CONDITION_TREE ;
  6031.                               LevelInTheTree : in long_integer ;
  6032.                               FoundParameters : out RHSParametersRecord ) is
  6033.  
  6034. -------------------------------------------------------------------------------
  6035. --
  6036. -- Function        : To recursively walk the condition tree.
  6037. --
  6038. -- Input arguments : ConditoionTreePointer : a pointer to a condition tree.
  6039. --                   Level : the current level reached in the condition tree
  6040. --
  6041. -- Output arguments: FoundParameters : the parameter set located at the bottom
  6042. --                                     of the tree.
  6043. --
  6044. -- Global variables: RAPPORT.MAILBOX , FileNumber .
  6045. --
  6046. -- Calls to        : Itself .
  6047. --
  6048. -- Called by       : Itself , ConditionTreeWalker .
  6049. --
  6050. -- Author          : MDD                      (  /  /  )     Version 1.0
  6051. --
  6052. -- Amendments      :                        (  /  /  )
  6053. --
  6054. -- Notes           : 
  6055. --
  6056. -------------------------------------------------------------------------------
  6057.          
  6058.  
  6059.     NewLevelInTheConditionTree : long_integer  ;
  6060.     ThisConjunction : long_integer ;
  6061.     ReturnedParameters : RHSParametersRecord ;
  6062.  
  6063.     begin
  6064.  
  6065. --      put("%ADALIB-TRACEMSG-ENTERING UNFOOLD PART OF WALKER") ; NEW_LINE ;
  6066.  
  6067.       if ConditionTreePointer.BlockType = Condition
  6068.  
  6069.          -- We have recursed to the bottom of the tree and so the found
  6070.          -- parameters are returned.
  6071.  
  6072.          then FoundParameters := ConditionTreePointer.RHSParameters ;
  6073.  
  6074.          -- Else the bottom has not been reached
  6075.  
  6076.          else
  6077.              -- We are going down one more level so adjust the level.
  6078.  
  6079.              NewLevelInTheConditionTree := LevelInTheTree + 10 ;
  6080.  
  6081.  
  6082.              -- Recurse down the left hand side of the tree .
  6083.  
  6084.              UnfoldConditionTree ( ConditionTreePointer.LeftPartOfConjunction ,
  6085.                                   NewLevelInTheConditionTree ,
  6086.                                   ReturnedParameters ) ;
  6087.  
  6088.                                   
  6089.              -- We have returned with a set of parameters located at the 
  6090.              -- bottom of the tree so we must do an r8cond on them .
  6091.  
  6092.  
  6093.              -- Adjust the conjunction number to reflect the level in the tree
  6094.           
  6095.              ThisConjunction := ConditionTreePointer.ConjunctionNumber +
  6096.                               LevelInTheTree ;                              
  6097.  
  6098.              NumberOfCurrentConditionInSet :=
  6099.                    NumberOfCurrentConditionInset + 1 ;
  6100.  
  6101.              R8COND ( FileNumber , NumberOfCurrentConditionInSet ,
  6102.                       ReturnedParameters.FieldNumber ,
  6103.                       ReturnedParameters.AnyAllSwitch ,
  6104.                       ReturnedParameters.ArraySubscript ,
  6105.                       ReturnedParameters.ConditionNumber ,
  6106.                       ThisConjunction ,
  6107.                       ReturnedParameters.SizeOfRightHandSide ,
  6108.                       ReturnedParameters.StartOfRightHandSide ,
  6109.                       MAILBOX ) ;
  6110.  
  6111.  
  6112.  
  6113.              -- Recurse on down  the right hand side of the tree.
  6114.  
  6115.              UnfoldConditionTree ( ConditionTreePointer.RightPartOfConjunction ,
  6116.                                   NewLevelInTheConditionTree ,
  6117.                                   FoundParameters ) ;
  6118.  
  6119.  
  6120.        end if ;
  6121.  
  6122. --    put("%ADALIB-TRACEMSG-LEAVING UNFOLD PART OF TREE WALKER") ; NEW_LINE ;
  6123.  
  6124.     end UnfoldConditionTree ;
  6125.  
  6126.  
  6127.  
  6128.   begin
  6129.  
  6130.     
  6131. --    PUT("%ADALIB-TRACEMSG-ENETRING PROCEUDRE TREE WALKER") ; NEW_LINE ;
  6132.  
  6133.     if ConditionTree /= null
  6134.  
  6135.       
  6136.        then UnfoldConditionTree ( ConditionTree ,
  6137.                                  LevelInTheConditionTree ,
  6138.                                  ReturnedParametersOut ) ;
  6139.        
  6140.             NumberOfCurrentConditionInSet := 
  6141.                   NumberOfCurrentConditionInset + 1 ;
  6142.  
  6143.  
  6144.  
  6145.            -- The found parameters have no condition on their right side
  6146.            -- as they represent the last condition so the conjunction is 0 .
  6147.  
  6148.            R8COND ( FileNumber , NumberOfCurrentConditionInSet ,
  6149.                     ReturnedParametersOut.FieldNumber ,
  6150.                     ReturnedParametersOut.AnyAllSwitch ,
  6151.                     ReturnedParametersOut.ArraySubscript ,
  6152.                     ReturnedParametersOut.ConditionNumber ,
  6153.                     NoConjunction ,
  6154.                     ReturnedParametersOut.SizeOfRightHandSide ,
  6155.                     ReturnedParametersOut.StartOfRightHandSide ,
  6156.                     MAILBOX ) ;
  6157.   
  6158.  
  6159.  
  6160.             NumberOfConditions := NumberOfCurrentConditionInSet ;
  6161.        
  6162.       else  NumberOfConditions := 0 ;
  6163.  
  6164.  end if ;
  6165.  
  6166. --    put("%ADALIB-TRACEMSG-LEAVING PROCEDURE TREE WALKER") ; NEW_LINE ;
  6167.  
  6168.  end ConditionTreeWalker ;
  6169.  
  6170.  
  6171.  
  6172.  
  6173.  
  6174.  
  6175.    procedure CLEAR is
  6176.  
  6177.  
  6178. -------------------------------------------------------------------------------
  6179. --
  6180. -- Function        : This procedure clears the file that the package has been
  6181. --                   instantiated for .
  6182. --
  6183. -- Input arguments : None .
  6184. --
  6185. -- Output arguments: None .
  6186. --
  6187. -- Global variables: FileNumber , RAPPORT.MAILBOX , RAPPORT.ERROR_CODE .
  6188. --
  6189. -- Calls to        : R8LIB.R8CLFI
  6190. --
  6191. -- Called by       : ADA Application program .
  6192. --
  6193. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6194. --
  6195. -- Amendments      :                        (  /  /  )
  6196. --
  6197. -- Notes           : 
  6198. --
  6199. -------------------------------------------------------------------------------
  6200.  
  6201.  
  6202.  
  6203.    begin
  6204.  
  6205. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE CLEAR") ; NEW_LINE ;
  6206.  
  6207.      if RAPPORT_STARTED then
  6208.  
  6209.        ERROR_CODE:=0 ;
  6210.   
  6211.        R8CLFI ( FileNumber , ERROR_CODE , MAILBOX ) ;
  6212.  
  6213.        if ERROR_CODE < -1 then
  6214.           raise RAPPORT_ERROR ;
  6215.        end if ;
  6216.  
  6217.      else
  6218.  
  6219.        ERROR_CODE := -100 ;
  6220.        raise RAPPORT_ERROR ;
  6221.  
  6222.  
  6223.      end if ;
  6224.  
  6225. --     put("%ADALIB-TRACEMSG-LEAVING PROCEDURE CLEARFILE") ; NEW_LINE ;
  6226.  
  6227.    end CLEAR  ;
  6228.  
  6229.  
  6230.   
  6231.  
  6232.  
  6233.    procedure LOCK(LOCK : LOCKING_MODE) is
  6234.  
  6235.  
  6236. -------------------------------------------------------------------------------
  6237. --
  6238. -- Function        : This procedure locks the file for either read or write 
  6239. --                   access for the user.
  6240. --
  6241. -- Input arguments : LOCK : An indication of the lock to be applied(read or
  6242. --                          write)
  6243. --
  6244. -- Output arguments: None.
  6245. --
  6246. -- Global variables: RAPPORT.ERROR_CODE , RAPPORT.MAILBOX , FileNumber , 
  6247. --                   LOCKNUMBER .
  6248. --
  6249. -- Calls to        : R8LIB.R8LOCK
  6250. --
  6251. -- Called by       : ADA Application program .
  6252. --
  6253. -- Author          : RP/MDD                  (  /  /  )     Version 1.0
  6254. --
  6255. -- Amendments      :                        (  /  /  )
  6256. --
  6257. -- Notes           : 
  6258. --
  6259. -------------------------------------------------------------------------------
  6260.  
  6261.  
  6262.  
  6263.    ReadWriteSwitch : long_integer ;
  6264.  
  6265.    begin
  6266.  
  6267. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE LOCK") ; NEW_LINE ;
  6268.  
  6269.      if RAPPORT_STARTED then
  6270.  
  6271.        ReadWriteSwitch := LOCKNUMBER ( LOCK ) ;
  6272.  
  6273.        ERROR_CODE := 0 ;
  6274.  
  6275.        R8LOCK ( FileNumber , ReadWriteSwitch , ERROR_CODE , MAILBOX ) ;
  6276.  
  6277.        if ERROR_CODE < -1 then
  6278.           raise RAPPORT_ERROR ;
  6279.        end if ;
  6280.  
  6281.      else
  6282.  
  6283.        ERROR_CODE := -100 ;
  6284.        raise RAPPORT_ERROR ;
  6285.  
  6286.      end if ;
  6287.  
  6288.  
  6289. --     put("%ADALIB-TRACEMSG-LEAVING PROCEDURE LOCK") ; NEW_LINE ;
  6290.  
  6291.  
  6292.    end LOCK ;
  6293.  
  6294.  
  6295.  
  6296.  
  6297.  
  6298.    procedure INSERT(REC : DB_RECORD) is
  6299.  
  6300. -------------------------------------------------------------------------------
  6301. --
  6302. -- Function        : This procedure inserts a record into the file.An error
  6303. --                   is returned if a record with the same prime key is
  6304. --                   already present.
  6305. --
  6306. -- Input arguments : REC : The record to insert .
  6307. --
  6308. -- Output arguments: None .
  6309. --
  6310. -- Global variables: FileNumber , RAPPORT.MAILBOX , RAPPORT.ERROR_CODE .
  6311. --
  6312. -- Calls to        : R8LIB.R8INRT , RAPPORT.AddressToLongInteger .
  6313. --
  6314. -- Called by       : ADA Application program
  6315. --
  6316. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6317. --
  6318. -- Amendments      :                        (  /  /  )
  6319. --
  6320. -- Notes           : 
  6321. --
  6322. -------------------------------------------------------------------------------
  6323.  
  6324.  
  6325.  
  6326.    SizeOfRecord : long_integer ;
  6327.    StartOfRecord : long_integer ;
  6328.  
  6329.  
  6330.    begin
  6331.  
  6332. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE INSERT") ; NEW_LINE ;
  6333.  
  6334.      if RAPPORT_STARTED then
  6335.  
  6336.        -- Note that 'size returns bits and we require bytes
  6337.  
  6338.        SizeOfRecord := long_integer( DB_RECORD'size/NumberOfBitsInAByte) ;
  6339.        StartOfRecord := AddressToLongInteger ( REC'Address ) ;
  6340.  
  6341.        ERROR_CODE := 0 ;
  6342.  
  6343.        R8INRT ( FileNumber , SizeOfRecord , StartOfRecord , ERROR_CODE ,
  6344.                 MAILBOX ) ;
  6345.  
  6346.  
  6347.        -- A return of -7 indicates that the file is 90% full
  6348.  
  6349.        if ERROR_CODE = -7
  6350.           then put("  <<RAPPORT WARNING>>") ; new_line ; new_line ;
  6351.                put("    < File number ") ;
  6352.                system.put(integer(FileNumber)) ;
  6353.                put(" is greater than 90% full>") ;
  6354.                new_line ; new_line ;
  6355.        end if ;
  6356.  
  6357.  
  6358.  
  6359.        if ( ERROR_CODE < -1 ) and ( ERROR_CODE /= -7 )then
  6360.           raise RAPPORT_ERROR ;
  6361.        end if ;
  6362.  
  6363.  
  6364.      else
  6365.    
  6366.        ERROR_CODE := -100 ;
  6367.        raise RAPPORT_ERROR ;
  6368.  
  6369.      end if ;
  6370.  
  6371. --     put("%ADALIB-TRACEMSG-LEAVING PROCEDURE INSERT") ; NEW_LINE ;
  6372.  
  6373.  
  6374.    end INSERT;
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.    procedure UPDATE(REC : DB_RECORD) is
  6382.  
  6383. -------------------------------------------------------------------------------
  6384. --
  6385. -- Function        : To update the record in the file.
  6386. --
  6387. -- Input arguments : REC : The record to update .
  6388. --
  6389. -- Output arguments: None .
  6390. --
  6391. -- Global variables: FileNumber , RAPPORT.ERROR_CODE , RAPPORT.MAILBOX .
  6392. --
  6393. -- Calls to        : R8LIB.R8UPDT , RAPPORT.AddressToLongInteger .
  6394. --
  6395. -- Called by       : ADA Application program
  6396. --
  6397. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6398. --
  6399. -- Amendments      :                        (  /  /  )
  6400. --
  6401. -- Notes           : 
  6402. --
  6403. -------------------------------------------------------------------------------
  6404.  
  6405.  
  6406.  
  6407.  
  6408.    SizeOfRecord : long_integer ;
  6409.  
  6410.    StartOfRecord : long_integer ;
  6411.  
  6412.  
  6413.    begin
  6414.    
  6415. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE UPDATE") ; NEW_LINE ;
  6416.  
  6417.      if RAPPORT_STARTED then
  6418.  
  6419.        -- Note that 'size returns bits and we require bytes.
  6420.  
  6421.        SizeOfRecord := long_integer ( DB_RECORD'size/NumberOfBitsInAByte )  ;
  6422.        StartOfRecord := AddressToLongInteger ( REC'address ) ;
  6423.  
  6424.        ERROR_CODE := 0 ;
  6425.  
  6426.        R8UPDT ( FileNumber , SizeOfRecord , StartOfRecord ,
  6427.                 ERROR_CODE , MAILBOX ) ;
  6428.  
  6429.        if ERROR_CODE < -1 then
  6430.           raise RAPPORT_ERROR ;
  6431.        end if ;
  6432.     
  6433.  
  6434.      else
  6435.  
  6436.        ERROR_CODE := -100 ;
  6437.        raise RAPPORT_ERROR ;
  6438.  
  6439.      end if ;
  6440.  
  6441.  
  6442. --     put("%ADALIB-TRACEMSG-LEAVING PROCEDURE UPDATE") ; NEW_LINE ;
  6443.  
  6444.  
  6445.  
  6446.    end UPDATE ;
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.    procedure STORE(REC : DB_RECORD) is
  6454.  
  6455.  
  6456. -------------------------------------------------------------------------------
  6457. --
  6458. -- Function        : To store the record in the database.If the record is 
  6459. --                   already present as determined by the prime key then  the
  6460. --                   record is updated.
  6461. --
  6462. -- Input arguments : REC : The record to update .
  6463. --
  6464. -- Output arguments: None.
  6465. --
  6466. -- Global variables: RAPPORT.MAILBOX , RAPPORT.ERROR_CODE , FileNumber
  6467. --
  6468. -- Calls to        : R8LIB.R8UPDT , RAPPORT.AddressToLongInteger .
  6469. --
  6470. -- Called by       : ADA Application program .
  6471. --
  6472. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6473. --
  6474. -- Amendments      :                        (  /  /  )
  6475. --
  6476. -- Notes           : 
  6477. --
  6478. -------------------------------------------------------------------------------
  6479.  
  6480.  
  6481.  
  6482.    SizeOfRecord : long_integer ;
  6483.  
  6484.    StartOfRecord : long_integer ;
  6485.  
  6486.  
  6487.    begin
  6488.  
  6489. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE STORE") ; NEW_LINE ;
  6490.  
  6491.      if RAPPORT_STARTED then
  6492.  
  6493.        -- Note that 'size return s bits and we require bytes.
  6494.  
  6495.        SizeOfRecord := long_integer ( DB_RECORD'size/NumberOfBitsInAByte ) ;
  6496.        StartOfRecord := AddressToLongInteger ( REC'address ) ;
  6497.  
  6498.        ERROR_CODE := 0 ;
  6499.  
  6500.        R8STOR ( FileNumber , SizeOfRecord , StartOfRecord ,
  6501.                 ERROR_CODE , MAILBOX ) ;
  6502.  
  6503.  
  6504.       -- Error return of -7 => that the file is 90% full
  6505.  
  6506.        if ERROR_CODE = -7
  6507.           then put("  <<RAPPORT WARNING>>") ; new_line ; new_line ;
  6508.                put("    < File number ") ;
  6509.                system.put(integer(FileNumber)) ;
  6510.                put(" is greater than 90% full>") ;
  6511.                new_line ; new_line ;
  6512.        end if ;
  6513.  
  6514.  
  6515.  
  6516.        if ( ERROR_CODE < -1 ) and ( ERROR_CODE /= -7 )then
  6517.           raise RAPPORT_ERROR ;
  6518.        end if ;
  6519.  
  6520.  
  6521.      else
  6522.  
  6523.        ERROR_CODE := -100 ;
  6524.        raise RAPPORT_ERROR ;
  6525.  
  6526.      end if ;
  6527.  
  6528.  
  6529. --     put("%ADALIB-TRACEMSG-LEAVING PROCEDURE STORE") ; NEW_LINE ;
  6530.  
  6531.  
  6532.  
  6533.    end STORE ;
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.    procedure FETCH(REC : out DB_RECORD;
  6541.                    EXISTS : out BOOLEAN;
  6542.                    CONDITIONS : CONDITION_TREE) is
  6543.  
  6544.  
  6545. -------------------------------------------------------------------------------
  6546. --
  6547. -- Function        : This procedure returns a record from the file that 
  6548. --                   satisfies the input conditions.If more than one record
  6549. --                   satisfies the conditions then the return is
  6550. --                   non-deterministic.
  6551. --
  6552. -- Input arguments : CONDITIONS : A pointer to a condition tree detailing the
  6553. --                   set of conditions on the fetch. 
  6554. --
  6555. -- Output arguments: REC : The discovered database record if it is found .
  6556. --                   EXISTS : A boolean indicator saying if a record was found
  6557. --
  6558. -- Global variables: RAPPORT.MAILBOX , FileNumber , 
  6559. --
  6560. -- Calls to        : ConditionTreeWalker , R8LIB.R8FECH
  6561. --                   RAPPORT.AddressToLongInteger .
  6562. --
  6563. -- Called by       : ADA Application program .
  6564. --
  6565. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6566. --
  6567. -- Amendments      :                        (  /  /  )
  6568. --
  6569. -- Notes           : 
  6570. --
  6571. -------------------------------------------------------------------------------
  6572.  
  6573.  
  6574.    -- CountVariable is an indication of the last record fetched.In this case as
  6575.    -- none has been fetched it is 0.
  6576.  
  6577.    CountVariable : long_integer := 0 ;
  6578.  
  6579.    
  6580.    -- RetrievalStrategy is an indication of how to fetch the record.
  6581.  
  6582.    RetrievalStrategy : long_integer := 0 ;
  6583.  
  6584.    NumberOfConditions : long_integer ;
  6585.  
  6586.  
  6587.    -- Level no longer serves a purpose.
  6588.  
  6589.    Level : long_integer := 0 ;
  6590.  
  6591.    SizeOfRecord : long_integer ;
  6592.  
  6593.    StartOfRecord : long_integer ;
  6594.  
  6595.  
  6596.  
  6597.  
  6598.    begin
  6599.  
  6600. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE FETCH") ; NEW_LINE ;
  6601.  
  6602.      if RAPPORT_STARTED then 
  6603.  
  6604.        SizeOfRecord := long_integer ( DB_RECORD'size/NumberOfBitsInAByte ) ;
  6605.        StartOfRecord := AddressToLongInteger ( REC'address ) ;
  6606.  
  6607.  
  6608.        -- The set of conditions are sent to the nucleus.
  6609.  
  6610.        ConditionTreeWalker ( Conditions , NumberOfConditions ) ;
  6611.  
  6612.  
  6613.        -- A record is fetched.
  6614.  
  6615.        R8FECH ( FileNumber , CountVariable , RetrievalStrategy ,
  6616.                 NumberOfConditions , Level , SizeOfRecord , StartOfRecord ,
  6617.                 MAILBOX ) ;
  6618.  
  6619.  
  6620.  
  6621.        -- CountVariable also acts as an error return.
  6622.  
  6623.        if CountVariable < -1
  6624.           then raise RAPPORT_ERROR ;
  6625.        end if ;
  6626.  
  6627.  
  6628.        -- If a record is found then CountVariable will indiacte it and so will
  6629.        -- be greater than 0.
  6630.  
  6631.        EXISTS := (CountVariable > 0 ) ;
  6632.  
  6633.      else
  6634.  
  6635.        ERROR_CODE := -100 ;
  6636.        raise RAPPORT_ERROR ;
  6637.  
  6638.      end if ;
  6639.  
  6640.  
  6641. --     PUT("%ADALIB-TRACEMSG-LEAVING PROCEDURE FETCH") ; NEW_LINE ;
  6642.  
  6643.    end FETCH ;
  6644.  
  6645.  
  6646.  
  6647.  
  6648.  
  6649.  
  6650.    procedure DELETE(NUMBER : out integer ;
  6651.                     CONDITIONS : CONDITION_TREE) is
  6652.  
  6653.  
  6654. -------------------------------------------------------------------------------
  6655. --
  6656. -- Function        : This procedure deletes all records from the file that
  6657. --                   satisfy the inputed conditions.
  6658. --
  6659. -- Input arguments : CONDITIONS : A poinetr indicating the condition tree.
  6660. --
  6661. -- Output arguments: NUMBER : The number of records deleted in the delete.
  6662. --
  6663. -- Global variables: RAPPORT.MAILBOX , FileNumber .
  6664. --
  6665. -- Calls to        : ConditionTreewalker , R8LIB.R8DELT.
  6666. --
  6667. -- Called by       : ADA Application program .
  6668. --
  6669. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6670. --
  6671. -- Amendments      :                        (  /  /  )
  6672. --
  6673. -- Notes           : 
  6674. --
  6675. -------------------------------------------------------------------------------
  6676.  
  6677.  
  6678.  
  6679.  
  6680.    NumberOfConditions : long_integer ;
  6681.    NumberDeleted : long_integer ;
  6682.  
  6683.    begin
  6684.  
  6685. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DELETE") ; NEW_LINE ;
  6686.  
  6687.      if RAPPORT_STARTED then
  6688.  
  6689.        -- Send the conditions to the nucleus.
  6690.  
  6691.        ConditionTreeWalker ( CONDITIONS , NumberOfConditions ) ;
  6692.  
  6693.  
  6694.        R8DELT ( FileNumber , NumberDeleted , NumberOfConditions ,
  6695.                 MAILBOX ) ;
  6696.  
  6697.        Number := integer ( NumberDeleted ) ;
  6698.  
  6699.  
  6700.      else
  6701.  
  6702.        ERROR_CODE := -100 ;
  6703.        raise RAPPORT_ERROR ;
  6704.  
  6705.      end if ;
  6706.  
  6707. --     put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DELETE") ; NEW_LINE ;
  6708.  
  6709.    end DELETE ;
  6710.  
  6711.  
  6712.  
  6713.  
  6714.  
  6715.    procedure SET_SELECTOR(SELECTION : out SELECTOR) is
  6716.  
  6717.  
  6718. -------------------------------------------------------------------------------
  6719. --
  6720. -- Function        : This procedure sets a selector when there are no condition
  6721. --                   on the search.
  6722. --
  6723. -- Input arguments : None .
  6724. --
  6725. -- Output arguments: SELECTION : A selector to use in a search.
  6726. --
  6727. -- Global variables: RAPPORT.MAILBOX , FileNumber , SELECTOR_STACK .
  6728. --                   CURRENT_LEVEL , MAX_STACK_SIZE .
  6729. --
  6730. -- Calls to        : None.
  6731. --
  6732. -- Called by       : ADA Application program.
  6733. --
  6734. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6735. --
  6736. -- Amendments      :                        (  /  /  )
  6737. --
  6738. -- Notes           : 
  6739. --
  6740. -------------------------------------------------------------------------------
  6741.  
  6742.  
  6743.  
  6744.    begin
  6745.  
  6746.      if RAPPORT_STARTED then
  6747.  
  6748.        -- we must first check that the searches have not been nested too deep
  6749.  
  6750.        if CURRENT_LEVEL >= MAX_STACK_SIZE
  6751.      
  6752.           then ERROR_CODE := -30 ;
  6753.                raise RAPPORT_ERROR ;
  6754.  
  6755.           else CURRENT_LEVEL := CURRENT_LEVEL+1 ;
  6756.                SELECTOR_STACK( CURRENT_LEVEL ) := NORMAL ;
  6757.  
  6758.                -- The count variable is set to 0 as no record has yet been 
  6759.                -- fetched.
  6760.  
  6761.                SELECTION.CounTVariable := 0 ;
  6762.  
  6763.                -- The retrieval strategy is set to 0 as none has been decided
  6764.                -- upon.
  6765.  
  6766.                SELECTION.RetrievalStrategy := 0 ;
  6767.                SELECTION.Level := CURRENT_LEVEL ;
  6768.                SELECTION.Conditions := null ;
  6769.  
  6770.        end if ;
  6771.  
  6772.     
  6773.      else
  6774.  
  6775.        ERROR_CODE := -100 ;
  6776.        raise RAPPORT_ERROR ;
  6777.  
  6778.      end if ;      
  6779.  
  6780.  
  6781.    end SET_SELECTOR ;
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.    procedure SET_SELECTOR(SELECTION : out SELECTOR;
  6788.                           CONDITIONS : CONDITION_TREE) is
  6789.  
  6790.  
  6791. -------------------------------------------------------------------------------
  6792. --
  6793. -- Function        : This procedure sets a selector when there are conditions
  6794. --                   on the search.
  6795. --
  6796. -- Input arguments : CONDITIONS : The conditions that are to be imposed on the
  6797. --                                search.
  6798. --
  6799. -- Output arguments: SELECTION : A selector to use in a search.
  6800. --
  6801. -- Global variables: RAPPORT.MAILBOX , FileNumber , SELECTOR_STACK .
  6802. --                   CURRENT_LEVEL , MAX_STACK_SIZE .
  6803. --
  6804. -- Calls to        : None .
  6805. --
  6806. -- Called by       : ADA Application program.
  6807. --
  6808. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6809. --
  6810. -- Amendments      :                        (  /  /  )
  6811. --
  6812. -- Notes           : 
  6813. --
  6814. -------------------------------------------------------------------------------
  6815.  
  6816.  
  6817.    begin
  6818.  
  6819.  
  6820.      if RAPPORT_STARTED then 
  6821.  
  6822.        -- we must first check that the searches have not been nested too deep.
  6823.  
  6824.        if CURRENT_LEVEL >= MAX_STACK_SIZE
  6825.      
  6826.           then ERROR_CODE := -30  ;
  6827.                raise RAPPORT_ERROR ;
  6828.  
  6829.           else CURRENT_LEVEL := CURRENT_LEVEL+1 ;
  6830.                SELECTOR_STACK( CURRENT_LEVEL ) := NORMAL ;
  6831.  
  6832.                -- CoutnVariable is set to 0 as no record has yet been fetched .
  6833.  
  6834.                SELECTION.CounTVariable := 0 ;
  6835.  
  6836.                -- Retrieval strategy is set to 0 has it has not yet been 
  6837.                -- decided.
  6838.  
  6839.                SELECTION.RetrievalStrategy := 0 ;
  6840.                SELECTION.Level := CURRENT_LEVEL ;
  6841.                SELECTION.Conditions := Conditions ;
  6842.  
  6843.        end if ;
  6844.  
  6845.  
  6846.      else
  6847.  
  6848.        ERROR_CODE := -100 ;
  6849.        raise RAPPORT_ERROR ;
  6850.  
  6851.      end if ;
  6852.  
  6853.  
  6854.    end SET_SELECTOR ;
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.    procedure SET_ORDERED(SELECTION : out SELECTOR;
  6861.                          ORDERING : ORDERING_TREE) is
  6862.  
  6863. -------------------------------------------------------------------------------
  6864. --
  6865. -- Function        : Sets a selector for an ordered search where there are no
  6866. --                   conditions applied . The Ordering is transmited to the 
  6867. --                   nucleus which is then requested to make the ordered
  6868. --                   copy of the file which is then used to retrieve from.
  6869. --
  6870. -- Input arguments : ORDERING : A pointer to an order tree specifying the 
  6871. --                   ordering that is to be applied.
  6872. --
  6873. -- Output arguments: SELECTION : A selector to be used in a search.
  6874. --
  6875. -- Global variables: RAPPORT.MAILBOX , FileNumber , RAPPORT.ERROR_CODE .
  6876. --                   SELECTOR_STACK CURRENT_LEVEL , MAX_STACK_SIZE .
  6877. --
  6878. -- Calls to        : R8LIB.R8STKY , R8LIB.R8HOLD , OrderingTreewAlker .
  6879. --
  6880. -- Called by       : ADA Application program .
  6881. --
  6882. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6883. --
  6884. -- Amendments      :                        (  /  /  )
  6885. --
  6886. -- Notes           : 
  6887. --
  6888. -------------------------------------------------------------------------------
  6889.  
  6890.  
  6891.  
  6892.  
  6893.     OrderList : ORDERING_ARRAY ;
  6894.     NumberOfFieldsInOrdering : integer ;
  6895.     LongNumberInList : long_integer ;
  6896.     NormalRetrieval : long_integer :=0 ;
  6897.     StartAddressOfList : long_integer ;
  6898.     NoConditions : long_integer :=0 ;
  6899.     NumberOfRecords : long_integer ;
  6900.  
  6901.  
  6902.    begin
  6903.  
  6904. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DET_ORDERED") ; NEW_LINE ;
  6905.  
  6906.      if RAPPORT_STARTED then 
  6907.  
  6908.        -- we must first check that the search nesting is not too great.
  6909.  
  6910.        if CURRENT_LEVEL >= MAX_STACK_SIZE
  6911.  
  6912.           then ERROR_CODE := -30 ;
  6913.                raise RAPPORT_ERROR ;
  6914.      
  6915.           else CURRENT_LEVEL := CURRENT_LEVEL + 1 ;
  6916.                SELECTOR_STACK(CURRENT_LEVEL) := ORDERED ;
  6917.  
  6918.                -- The count variable is set to 0 as no records have yet been 
  6919.                -- retrieved .
  6920.  
  6921.                SELECTION.CountVariable := 0 ;
  6922.  
  6923.                -- Retrieval strategy is set to 0 as none has been decided upon.
  6924.  
  6925.                SELECTION.RetrievalStrategy := 0 ;
  6926.                SELECTION.Level := CURRENT_LEVEL ;
  6927.  
  6928.  
  6929.                -- Collapse the ordering tree into an array representation.
  6930.        
  6931.                OrderingTreeWalker ( Ordering , OrderList , 
  6932.                                     NumberOfFieldsInOrdering);
  6933.  
  6934.  
  6935.          
  6936.  
  6937.                LongNumberInList := long_integer ( NumberOfFieldsInOrdering ) ;
  6938.                StartAddressOfList := 
  6939.                AddressToLongInteger ( OrderList'address ) ;
  6940.  
  6941.                -- Transmit the list to the nucleus
  6942.  
  6943.                R8STKY ( FileNumber , LongNumberInList , StartAddressOfList ,
  6944.                         NormalRetrieval , MAILBOX ) ;
  6945.  
  6946.  
  6947.                -- create an ordered copy of the file on that ordering
  6948.  
  6949.                R8HOLD ( FileNumber , NoConditions , NumberOfRecords ,
  6950.                         MAILBOX ) ;
  6951.  
  6952.           end if ;
  6953.  
  6954.        else
  6955.  
  6956.           ERROR_CODE := -100 ;
  6957.           raise RAPPORT_ERROR ;
  6958.  
  6959.        end if ;
  6960.  
  6961.  
  6962. --       put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DET_ORDERED") ; NEW_LINE ;
  6963.    
  6964.  
  6965.    end SET_ORDERED ;
  6966.  
  6967.  
  6968.  
  6969.  
  6970.  
  6971.    procedure SET_ORDERED(SELECTION : out SELECTOR;
  6972.                          ORDERING : ORDERING_TREE;
  6973.                          CONDITIONS : CONDITION_TREE) is
  6974.  
  6975. -------------------------------------------------------------------------------
  6976. --
  6977. -- Function        : Sets a selector for an ordered search where there are 
  6978. --                   conditions applied . The Ordering is transmited to the 
  6979. --                   nucleus which is then requested to make the ordered
  6980. --                   copy of the file which is then usedc to retrieve from.
  6981. --
  6982. -- Input arguments : ORDERING : A poinetr to an order tree specifying the 
  6983. --                   ordering that is to be applied.
  6984. --                   CONDITIONS : A pointer to the condition tree.
  6985. --
  6986. -- Output arguments: SELECTION : A selector to be used in a search.
  6987. --
  6988. -- Global variables: RAPPORT.MAILBOX , FileNumber , RAPPORT.ERROR_CODE .
  6989. --                   CURRENT_LEVEL , MAX_STACK_SIZE .
  6990. --
  6991. -- Calls to        : R8LIB.R8STKY , R8LIB.R8HOLD , ConditionTreeWalker ,
  6992. --                   Ordering TreeWalker .
  6993. --
  6994. -- Called by       : ADA Application program .
  6995. --
  6996. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  6997. --
  6998. -- Amendments      :                        (  /  /  )
  6999. --
  7000. -- Notes           : 
  7001. --
  7002. -------------------------------------------------------------------------------
  7003.  
  7004.  
  7005.  
  7006.     OrderList : ORDERING_ARRAY ;
  7007.     NumberOfFieldsInOrdering : integer ;
  7008.     LongNumberInList: long_integer ;
  7009.     NormalRetrieval : long_integer :=0 ;
  7010.     StartAddressOfList : long_integer ;
  7011.     NumberOfConditions : long_integer ;
  7012.     NumberOfRecords : long_integer ;
  7013.  
  7014.  
  7015.    begin
  7016.  
  7017. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DET_ORDERED") ; NEW_LINE ;
  7018.  
  7019.  
  7020.      if RAPPORT_STARTED then
  7021.  
  7022.        -- We must first check that the search nesting is not too deep
  7023.  
  7024.        if CURRENT_LEVEL >= MAX_STACK_SIZE
  7025.  
  7026.           then ERROR_CODE := -30 ;
  7027.                raise RAPPORT_ERROR ;
  7028.      
  7029.           else CURRENT_LEVEL := CURRENT_LEVEL + 1 ;
  7030.                SELECTOR_STACK(CURRENT_LEVEL) := ORDERED ;
  7031.  
  7032.  
  7033.                -- The count variable is set to 0 as no record has yet been
  7034.                -- retrieved .
  7035.  
  7036.                SELECTION.CountVariable := 0 ;
  7037.  
  7038.  
  7039.                -- The retrieval strategy is set to 0 as none has yet been 
  7040.                -- decided upon.
  7041.  
  7042.                SELECTION.RetrievalStrategy := 0 ;
  7043.                SELECTION.Level := CURRENT_LEVEL ;
  7044.  
  7045.                OrderingTreeWalker ( Ordering , OrderList , 
  7046.                                     NumberOfFieldsInOrdering);
  7047.  
  7048.  
  7049.                LongNumberInList := long_integer ( NumberOfFieldsInOrdering ) ;
  7050.                StartAddressOfList := 
  7051.                AddressToLongInteger ( OrderList'address ) ;
  7052.  
  7053.  
  7054.                -- Transmit the ordering to the nucleus.
  7055.  
  7056.                R8STKY ( FileNumber , LongNumberInList , StartAddressOfList ,
  7057.                         NormalRetrieval , MAILBOX ) ;
  7058.  
  7059.                -- Transmit the conditions to the nucleus.
  7060.  
  7061.                ConditionTreeWalker ( Conditions , NumberOfConditions ) ;
  7062.  
  7063.                -- Create an ordered copy of the file.
  7064.  
  7065.                R8HOLD ( FileNumber , NumberOfConditions , NumberOfRecords ,
  7066.                         MAILBOX ) ;
  7067.  
  7068.           end if ;
  7069.  
  7070.         else
  7071.  
  7072.           ERROR_CODE := -100 ;
  7073.           raise RAPPORT_ERROR ;
  7074.  
  7075.         end if ;
  7076.  
  7077.  
  7078. --       put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DET_ORDERED") ; NEW_LINE ;
  7079.    
  7080.    end SET_ORDERED ;
  7081.  
  7082.  
  7083.  
  7084.  
  7085.    procedure SET_UNIQUE(SELECTION : out SELECTOR;
  7086.                         ORDERING : ORDERING_TREE) is
  7087.  
  7088. -------------------------------------------------------------------------------
  7089. --
  7090. -- Function        : Sets a selector for an ordered search where there are no 
  7091. --                   conditions applied . The Ordering is transmited to the 
  7092. --                   nucleus which is then requested to make the ordered
  7093. --                   copy of the file which is then usedc to retrieve from.
  7094. --                   The difference with a unique search is that only one
  7095. --                   record matching the ordering is copied to the order.
  7096. --
  7097. -- Input arguments : ORDERING : A poinetr to an order tree specifying the 
  7098. --                   ordering that is to be applied.
  7099. --
  7100. -- Output arguments: SELECTION : A selector to be used in a search.
  7101. --
  7102. -- Global variables: RAPPORT.MAILBOX , FileNumber , RAPPORT.ERROR_CODE .
  7103. --                   SELECTOR_STACK , CURRENT_LEVEL , MAX_STACK_SIZE .
  7104. --
  7105. -- Calls to        : R8LIB.R8STKY , R8LIB.R8HOLD ,
  7106. --                   Ordering TreeWalker .
  7107. --
  7108. -- Called by       : ADA Application program .
  7109. --
  7110. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  7111. --
  7112. -- Amendments      :                        (  /  /  )
  7113. --
  7114. -- Notes           : 
  7115. --
  7116. -------------------------------------------------------------------------------
  7117.  
  7118.  
  7119.  
  7120.     OrderList : ORDERING_ARRAY ;
  7121.     NumberOfFieldsInOrdering : integer ;
  7122.     LongNumberInList : long_integer ;
  7123.     UniqueRetrieval : long_integer :=1 ;
  7124.     StartAddressOfList : long_integer ;
  7125.     NoConditions : long_integer :=0 ;
  7126.     NumberOfRecords : long_integer ;
  7127.  
  7128.  
  7129.    begin
  7130.  
  7131. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DET_UNIQUED") ; NEW_LINE ;
  7132.  
  7133.      if RAPPORT_STARTED then
  7134.  
  7135.        -- we must first check that the ordering is not too deep.
  7136.  
  7137.        if CURRENT_LEVEL >= MAX_STACK_SIZE
  7138.  
  7139.           then ERROR_CODE := -30 ;
  7140.                raise RAPPORT_ERROR ;
  7141.      
  7142.           else CURRENT_LEVEL := CURRENT_LEVEL + 1 ;
  7143.                SELECTOR_STACK(CURRENT_LEVEL) := UNIQUE ;
  7144.  
  7145.  
  7146.                -- The count variable is set to 0 as no record has yet been
  7147.                -- fetched.
  7148.  
  7149.                SELECTION.CountVariable := 0 ;
  7150.                SELECTION.RetrievalStrategy := 0 ;
  7151.                SELECTION.Level := CURRENT_LEVEL ;
  7152.  
  7153.                OrderingTreeWalker ( Ordering , OrderList , 
  7154.                                     NumberOfFieldsInOrdering);
  7155.  
  7156.  
  7157.                LongNumberInList := long_integer ( NumberOfFieldsInOrdering ) ;
  7158.                StartAddressOfList := 
  7159.                AddressToLongInteger ( OrderList'address ) ;
  7160.  
  7161.  
  7162.                -- transmit the ordering to the nucleus .
  7163.  
  7164.                R8STKY ( FileNumber , LongNumberInList , StartAddressOfList ,
  7165.                         UniqueRetrieval , MAILBOX ) ;
  7166.  
  7167.  
  7168.              -- make an   ordered copy of the file .
  7169.  
  7170.              R8HOLD ( FileNumber , NoConditions , NumberOfRecords ,
  7171.                       MAILBOX ) ;
  7172.  
  7173.           end if ;
  7174.  
  7175.         else
  7176.  
  7177.           ERROR_CODE := -100 ;
  7178.           raise RAPPORT_ERROR ;
  7179.  
  7180.         end if ;
  7181.  
  7182. --       put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DET_UNIQUE") ; NEW_LINE ;
  7183.    
  7184.  
  7185.    end SET_UNIQUE ;
  7186.  
  7187.  
  7188.  
  7189.  
  7190.    procedure SET_UNIQUE(SELECTION : out SELECTOR;
  7191.                         ORDERING : ORDERING_TREE;
  7192.                         CONDITIONS : CONDITION_TREE) is
  7193.  
  7194. -------------------------------------------------------------------------------
  7195. --
  7196. -- Function        : Sets a selector for an ordered search where there are no 
  7197. --                   conditions applied . The Ordering is transmited to the 
  7198. --                   nucleus which is then requested to make the ordered
  7199. --                   copy of the file which is then usedc to retrieve from.
  7200. --                   The difference with a unique search is that only one
  7201. --                   record matching the ordering is copied to the order.
  7202. --
  7203. -- Input arguments : ORDERING : A poinetr to an order tree specifying the 
  7204. --                   ordering that is to be applied.
  7205. --
  7206. -- Output arguments: SELECTION : A selector to be used in a search.
  7207. --
  7208. -- Global variables: RAPPORT.MAILBOX , FileNumber , RAPPORT.ERROR_CODE .
  7209. --                   SELECTOR_STACK , CURRENT_LEVEL , MAX_STACK_SIZE .
  7210. --
  7211. -- Calls to        : R8LIB.R8STKY , R8LIB.R8HOLD , ConditionTreeWalker
  7212. --                   Ordering TreeWalker .
  7213. --
  7214. -- Called by       : ADA Application program .
  7215. --
  7216. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  7217. --
  7218. -- Amendments      :                        (  /  /  )
  7219. --
  7220. -- Notes           : 
  7221. --
  7222. -------------------------------------------------------------------------------
  7223.  
  7224.  
  7225.     OrderList : ORDERING_ARRAY ;
  7226.     NumberOfFieldsInOrdering : integer ;
  7227.     LongNumberInList : long_integer ;
  7228.     UniqueRetrieval : long_integer :=1 ;
  7229.     StartAddressOfList : long_integer ;
  7230.     NumberOfConditions : long_integer ;
  7231.     NumberOfRecords : long_integer ;
  7232.  
  7233.  
  7234.    begin
  7235.  
  7236. --     put("%ADALIB-TRACEMSG-ENTERING PROCEDURE DET_UNIQUE") ; NEW_LINE ;
  7237.  
  7238.  
  7239.      if RAPPORT_STARTED then 
  7240.  
  7241.        -- wee must first check that we are not overloading the stack .
  7242.  
  7243.        if CURRENT_LEVEL >= MAX_STACK_SIZE
  7244.  
  7245.           then ERROR_CODE := -30 ;
  7246.                raise RAPPORT_ERROR ;
  7247.      
  7248.           else CURRENT_LEVEL := CURRENT_LEVEL + 1 ;
  7249.                SELECTOR_STACK(CURRENT_LEVEL) := UNIQUE ;
  7250.  
  7251.                -- count is set to 0 to indicate the first fetch .
  7252.  
  7253.                SELECTION.CountVariable := 0 ;
  7254.                SELECTION.RetrievalStrategy := 0 ;
  7255.                SELECTION.Level := CURRENT_LEVEL ;
  7256.  
  7257.                OrderingTreeWalker ( Ordering , OrderList , 
  7258.                                     NumberOfFieldsInOrdering);
  7259.  
  7260.  
  7261.  
  7262.  
  7263.                LongNumberInList := long_integer ( NumberOfFieldsInOrdering ) ;
  7264.                StartAddressOfList := 
  7265.                AddressToLongInteger ( OrderList'address ) ;
  7266.  
  7267.  
  7268.                -- transmit the ordering to the nucleus
  7269.  
  7270.                R8STKY ( FileNumber , LongNumberInList , StartAddressOfList ,
  7271.                         UniqueRetrieval , MAILBOX ) ;
  7272.  
  7273.      
  7274.                -- transmit the conditions to the nucleus .
  7275.  
  7276.                ConditionTreeWalker ( Conditions , NumberOfConditions ) ;
  7277.              
  7278.  
  7279.                -- make an ordered copy of the file
  7280.  
  7281.                R8HOLD ( FileNumber , NumberOfConditions , NumberOfRecords ,
  7282.                         MAILBOX ) ;
  7283.  
  7284.           end if ;
  7285.  
  7286.         else
  7287.  
  7288.           ERROR_CODE := -100 ;
  7289.           raise RAPPORT_ERROR ;
  7290.  
  7291.         end if ;
  7292.  
  7293.  
  7294. --       put("%ADALIB-TRACEMSG-LEAVING PROCEDURE DET_UNIQUE") ; NEW_LINE ;
  7295.    
  7296.    end SET_UNIQUE ;
  7297.  
  7298.  
  7299.  
  7300.  
  7301.  
  7302.    procedure SEARCH(SELECTION : in out SELECTOR;
  7303.                     REC : out DB_RECORD;
  7304.                     END_OF_SEARCH : out BOOLEAN) is
  7305.  
  7306.  
  7307. -------------------------------------------------------------------------------
  7308. --
  7309. -- Function        : This procedure given a selector returns a record from
  7310. --                   the file . The count variable in the selector is
  7311. --                   updated on each search ( The retrieval strategy is updated
  7312. --                   only on the first ) so that the next record on is returned
  7313. --                   on each search in a set .
  7314. --                      The termination of the search occurrs when the count
  7315. --                   returned from the nucleus is -1 . ( Note that the count
  7316. --                   also acts as an error code as it can take negative values
  7317. --                   which => error .
  7318. --                      There are two main types of search , one done on acopy
  7319. --                   of the file (ORDERED , UNIQUE ) and one done on the file
  7320. --                   itself ( NORMAL ) .These require different strategies .
  7321. --                   A normal search has to transmit the conditions to the
  7322. --                   nucleus before performing a fetch but an ordered or unique
  7323. --                   search does not as the conditions have already been 
  7324. --                   performed on the copy file .
  7325. --                     
  7326. --
  7327. -- Input arguments : SELECTION : which details information relevant to the 
  7328. --                   search ( Count , Retrieval , Conditions ,type )
  7329. --
  7330. -- Output arguments: REC : the database record got from the file.
  7331. --                   END_OF_SEARCH : a boolean which is true if the count 
  7332. --                   variable is returned as -1 .
  7333. --
  7334. -- Global variables: RAPPORT.MAILBOX , FileNumber , CURRENT_LEVEL , 
  7335. --                   SELECTION_STACK , CURRENT_LEVEL  .
  7336. --
  7337. -- Calls to        : R8LIB.R8FECH , R8LIB.R8RTRV , ConditionTreeWalker .
  7338. --                   RAPPORT.AddressToLongInteger
  7339. --
  7340. -- Called by       : ADA Application program .
  7341. --
  7342. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  7343. --
  7344. -- Amendments      :                        (  /  /  )
  7345. --
  7346. -- Notes           : 
  7347. --
  7348. -------------------------------------------------------------------------------
  7349.  
  7350.  
  7351.    Selector_Stack_Level : integer ;
  7352.    StartOfRecord : long_integer ;
  7353.    SizeOfRecord : long_integer ;
  7354.    NumberOfConditions : long_integer ;
  7355.    DummyLevel : long_integer :=0 ;
  7356.  
  7357.  
  7358.    begin
  7359.  
  7360.  
  7361.      if RAPPORT_STARTED then 
  7362.  
  7363.        -- there are two groups of search pattern NORMAL & otherwise
  7364.  
  7365.        if SELECTOR_STACK ( SELECTION.Level ) /= NORMAL
  7366.  
  7367.           -- in the case of a non-noramal search we are working with an
  7368.           -- ordered copy of the file . To ensure that this has not been
  7369.           -- subsequently overwritten we must ensure that since this search
  7370.           -- was initiated ( with a set_ordered or a set_unique ) no other
  7371.           -- non-normal searches have been requested .
  7372.  
  7373.           then for Selector_Stack_Level in SELECTION.Level+1..CURRENT_LEVEL 
  7374.                    loop
  7375.                        if SELECTOR_STACK(Selector_Stack_Level) /= NORMAL
  7376.                           then ERROR_CODE := -10000 ;
  7377.                                raise RAPPORT_ERROR ;
  7378.                        end if ;
  7379.                     end loop ;
  7380.  
  7381.                 StartOfRecord := AddressToLongInteger(REC'address) ;
  7382.                 SizeOfRecord := 
  7383.                 long_integer( DB_RECORD'size/NumberOfBitsInAByte) ;
  7384.  
  7385.  
  7386.                 -- to get a record from the copy file a retrieve , as opposed
  7387.                 -- to a fetch must be performed .
  7388.  
  7389.                 R8RTRV(FileNumber , SELECTION.CountVariable , 
  7390.                        SizeOfRecord , StartOfRecord , MAILBOX ) ;
  7391.  
  7392.  
  7393.                 -- note here how the CountVariable is acting also as an 
  7394.                 -- error code .
  7395.  
  7396.                 if SELECTION.CountVariable < -1
  7397.                    then raise RAPPORT_ERROR ;
  7398.                 end if ;
  7399.  
  7400.  
  7401.                 End_Of_SEARCH := (SELECTION.CountVariable = -1 ) ;
  7402.  
  7403.  
  7404.            -- here we have a normal search and as this does not use a copy file
  7405.            -- we need do no checking.
  7406.  
  7407.            else StartOfRecord := AddressToLongInteger(REC'address) ;
  7408.                 SizeOfRecord := 
  7409.                 long_integer( DB_RECORD'size/NumberOfBitsInAByte) ;
  7410.  
  7411.  
  7412.                 -- note that on each fetch in the search set we must send the
  7413.                 -- conditions on the search to the nucleus . This is because
  7414.                 -- there is no copy file and so the conditions are not stored
  7415.                 -- in the nucleus .
  7416.  
  7417.                 ConditionTreeWalker (SELECTION.Conditions , 
  7418.                                      NumberOfConditions);
  7419.         
  7420.  
  7421.                 R8FECH ( FileNumber , SELECTION.CountVariable ,
  7422.                          SELECTION.RetrievalStrategy ,
  7423.                          NumberOfConditions ,
  7424.                          DummyLevel ,
  7425.                          SizeOfRecord ,
  7426.                          StartOfRecord ,
  7427.                          MAILBOX ) ;
  7428.  
  7429.  
  7430.                 -- count is also used as an error return .
  7431.  
  7432.                 if SELECTION.CountVariable < -1
  7433.                    then raise RAPPORT_ERROR ;
  7434.                 end if ;
  7435.  
  7436.  
  7437.                 End_Of_SEARCH := (SELECTION.CountVariable = -1 ) ;
  7438.  
  7439.                     
  7440.       end if; 
  7441.  
  7442.  
  7443.     else
  7444.  
  7445.       ERROR_CODE := -100 ;
  7446.       raise RAPPORT_ERROR ;
  7447.    
  7448.     end if ;  
  7449.  
  7450.  
  7451.    end SEARCH ;
  7452.  
  7453.  
  7454.  
  7455.  
  7456.  
  7457.    procedure CLEAR_SELECTOR(SELECTION : in out SELECTOR) is
  7458.  
  7459. -------------------------------------------------------------------------------
  7460. --
  7461. -- Function        : After a search is completed the selector used in that
  7462. --                   search must be cleared so that it cannot be re-used .
  7463. --
  7464. -- Input arguments : SELECTION : the selector used in the previous search .
  7465. --
  7466. -- Output arguments: SELECTION : a cleared and unusable selector .
  7467. --
  7468. -- Global variables: CURRENT_LEVEL .
  7469. --
  7470. -- Calls to        : None .
  7471. --
  7472. -- Called by       : ADA Application program .
  7473. --
  7474. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  7475. --
  7476. -- Amendments      :                        (  /  /  )
  7477. --
  7478. -- Notes           : 
  7479. --
  7480. -------------------------------------------------------------------------------
  7481.  
  7482.  
  7483.  
  7484.    begin
  7485.  
  7486.    
  7487.      if RAPPORT_STARTED then
  7488.  
  7489.        -- it is only possible to clear the current level as the integrity of 
  7490.        -- the selector_stack has to be preserved . 
  7491.  
  7492.        if SELECTION.Level /= CURRENT_LEVEL
  7493.  
  7494.           then ERROR_CODE := -10001 ;
  7495.                raise RAPPORT_ERROR ;
  7496.  
  7497.           else if SELECTOR_STACK(SELECTION.Level) /= NORMAL
  7498.  
  7499.                   -- if the search was not normal then we must inform the
  7500.                   -- nucleus that it can get rid of the ordered copy .
  7501.  
  7502.                   then R8ENRV ( SELECTION.CountVariable , ERROR_CODE , MAILBOX) ;
  7503.                 
  7504.                end if ;
  7505.  
  7506.                if ERROR_CODE <-1 
  7507.                   then raise RAPPORT_ERROR ;
  7508.                end if ;
  7509.  
  7510.  
  7511.                -- the current level in the stack is decremented .
  7512.  
  7513.                CURRENT_LEVEL := CURRENT_LEVEL-1 ;
  7514.  
  7515.  
  7516.                -- in either search case the selection parameters must be made
  7517.                -- unusable . ( if count = -1 then no search can take place
  7518.                -- as the nucleus will return an error .
  7519.  
  7520.                SELECTION.CountVariable := -1 ;
  7521.                SELECTION.Conditions := null ;
  7522.          
  7523.        end if ;
  7524.  
  7525.      else
  7526.  
  7527.        ERROR_CODE := -100 ;
  7528.        raise RAPPORT_ERROR ;
  7529.  
  7530.      end if ;
  7531.  
  7532.  
  7533.    end CLEAR_SELECTOR ;
  7534.  
  7535.  
  7536.  
  7537.  
  7538.    function "and" ( LeftPart , RightPart : CONDITION_TREE ) 
  7539.      
  7540.             return CONDITION_TREE  is
  7541.  
  7542. -------------------------------------------------------------------------------
  7543. --
  7544. -- Function        : This is the and conjunction used in specifying a condition
  7545. --                   set . It takes as input a LeftPart of a condition tree and
  7546. --                   a right part and forms another tree with a root node
  7547. --                   specifying the and is to be done on the left and right 
  7548. --                   parts .
  7549. --
  7550. -- Input arguments : LeftPart : a condition tree pointer ( i.e. a set of 
  7551. --                   conditions in the form of a tree )
  7552. --                   RightPart : a conditiontree pointer .
  7553. --
  7554. -- Output arguments: a condition tree :-
  7555. --
  7556. --                                   < and-node >
  7557. --                                     /      \
  7558. --                                    /        \
  7559. --                               <LeftPart> <RightPart>
  7560. --
  7561. -- Global variables: None .
  7562. --
  7563. -- Calls to        : None .
  7564. --
  7565. -- Called by       : ADA Application program .
  7566. --
  7567. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  7568. --
  7569. -- Amendments      :                        (  /  /  )
  7570. --
  7571. -- Notes           : 
  7572. --
  7573. -------------------------------------------------------------------------------
  7574.  
  7575.  
  7576.  
  7577.    ConjunctionNode : CONDITION_TREE ;
  7578.  
  7579.   
  7580.    begin
  7581.  
  7582. --     put("%ADALIB-TRACEMSG-ENTERING FUNCTION AND") ; NEW_LINE ;
  7583.  
  7584.      ConjunctionNode := new Condition_Block ;
  7585.  
  7586.      ConjunctionNode.BlockType := Conjunction ;
  7587.  
  7588.      -- note that an and node is represented by the nucleus by the number 2
  7589.  
  7590.      ConjunctionNode.ConjunctionNumber := 2 ;
  7591.  
  7592.      ConjunctionNode.LeftPartOfConjunction := LeftPart ;
  7593.      ConjunctionNode.RightPartOfConjunction := RightPart ;
  7594.  
  7595. --     put("%ADALIB-TRACEMSG-LEAVING FUNCTION AND") ; NEW_LINE ;
  7596.  
  7597.      return ConjunctionNode ;
  7598.  
  7599.  end "and" ;    
  7600.  
  7601.  
  7602.  
  7603.  
  7604.    function "or" ( LeftPart , RightPart : CONDITION_TREE ) 
  7605.      
  7606.             return CONDITION_TREE  is
  7607.  
  7608. -------------------------------------------------------------------------------
  7609. --
  7610. -- Function        : This is the or conjunction used in specifying a condition
  7611. --                   set . It takes as input a LeftPart of a condition tree and
  7612. --                   a right part and forms another tree with a root node
  7613. --                   specifying the or is to be done on the left and right 
  7614. --                   parts .
  7615. --
  7616. -- Input arguments : LeftPart : a condition tree pointer ( i.e. a set of 
  7617. --                   conditions in the form of a tree )
  7618. --                   RightPart : a conditiontree pointer .
  7619. --
  7620. -- Output arguments: a condition tree :-
  7621. --
  7622. --                                   < or-node >
  7623. --                                     /      \
  7624. --                                    /        \
  7625. --                               <LeftPart> <RightPart>
  7626. --
  7627. -- Global variables: None .
  7628. --
  7629. -- Calls to        : None .
  7630. --
  7631. -- Called by       : ADA Application program .
  7632. --
  7633. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  7634. --
  7635. -- Amendments      :                        (  /  /  )
  7636. --
  7637. -- Notes           : 
  7638. --
  7639. -------------------------------------------------------------------------------
  7640.  
  7641.  
  7642.  
  7643.  
  7644.    ConjunctionNode : CONDITION_TREE ;
  7645.  
  7646.   
  7647.    begin
  7648.  
  7649. --     put("%ADALIB-TRACEMSG-ENTERING FUNCTION AND") ; NEW_LINE ;
  7650.  
  7651.      ConjunctionNode := new Condition_Block ;
  7652.  
  7653.      ConjunctionNode.BlockType := Conjunction ;
  7654.  
  7655.      -- note that the nucleus identifies an or conjunction with 2
  7656.  
  7657.      ConjunctionNode.ConjunctionNumber := 1 ;
  7658.      ConjunctionNode.LeftPartOfConjunction := LeftPart ;
  7659.      ConjunctionNode.RightPartOfConjunction := RightPart ;
  7660.  
  7661. --     put("%ADALIB-TRACEMSG-LEAVING FUNCTION AND") ; NEW_LINE ;
  7662.  
  7663.      return ConjunctionNode ;
  7664.  
  7665.  end "or" ;    
  7666.    
  7667.  
  7668.  
  7669.  
  7670.  
  7671.  function "&" ( LeftPart , RightPart  : ORDERING_TREE )
  7672.           
  7673.           return ORDERING_TREE is
  7674.  
  7675. -------------------------------------------------------------------------------
  7676. --
  7677. -- Function        : This is the function used to group together individual
  7678. --                   pieces of ordering information to form an oredering set .
  7679. --
  7680. -- Input arguments : LeftPart , RightPart : These are sets of one or more
  7681. --                   pieces of ordering information .
  7682. --
  7683. -- Output arguments: an ordering set comprising the two input orderings .
  7684. --
  7685. -- Global variables: None .
  7686. --
  7687. -- Calls to        : None .
  7688. --
  7689. -- Called by       : ADA Application  program .
  7690. --
  7691. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  7692. --
  7693. -- Amendments      :                        (  /  /  )
  7694. --
  7695. -- Notes           : 
  7696. --
  7697. -------------------------------------------------------------------------------
  7698.  
  7699.  
  7700.  
  7701.   TempOrderBlock : ORDERING_TREE ;
  7702.  
  7703.   begin
  7704.  
  7705. --    put("%ADALIB-TRACEMSG-ENTERING PROCEDURE &") ; NEW_LINE ;
  7706.  
  7707.     TempOrderBlock := new ORDER_BLOCK ;
  7708.    
  7709.     TempOrderBlock.BlockType := NODE ;
  7710.     TempOrderBlock.LeftPart := LeftPart ;
  7711.     TempOrderBlock.RightPart := RightPart ;
  7712.  
  7713. --    put("%ADALIB-TRACEMSG-LEAVING PROCEDURE &") ; NEW_LINE ;
  7714.  
  7715.     return TempOrderBlock ;
  7716.  
  7717.   end  "&" ;
  7718.  
  7719.  
  7720.  
  7721.  
  7722. end ;
  7723. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7724. --GACOND.TXT
  7725. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7726. -----------------------------------------------------------------------
  7727. --                                                                   --
  7728. -- This is a generic package for the conditions on and ordering of   --
  7729. -- an array field.                                                   --
  7730. -- The package must be hand instantiated as follows :-               --
  7731. --                                                                   --
  7732. --         Replace   %1  with the name of the package with the       --
  7733. --                       file information .                          --
  7734. --                                                                   --
  7735. --         Replace   %2  with the type of the field declared in      --
  7736. --                       the package specified above.                --
  7737. --                                                                   --
  7738. --         replace   %3  with the number of the absolute number of   --
  7739. --                       the field .                                 --
  7740. --                                                                   --
  7741. --         Replace   %4 with the name of the field specified in      --
  7742. --                       the package containing file information.    --
  7743. --                       This then will become the name of the       --
  7744. --                       package .                                   --
  7745. --                                                                   --
  7746. --         Replace   %5 with the type name of an individual element  --
  7747. --                      of a field.                                  --
  7748. --                                                                   --
  7749. --         Replace   %6  with the name of theddf package             --
  7750. --                                                                   --
  7751. --                                                                   --
  7752. --         Finally exit the package as %4.txt and compile it         --
  7753. --                                                                   --
  7754. -----------------------------------------------------------------------
  7755.  
  7756.  
  7757.  
  7758. with %6 , %1 ; use %6 , %1 ;
  7759. with UNCHECKED_CONVERSION ;
  7760.  
  7761.  
  7762. package %4 is
  7763.  
  7764.  
  7765.  
  7766.     function EQUAL ( Value : %2 ) 
  7767.         
  7768.              return  CONDITION_TREE ;
  7769.  
  7770.  
  7771.  
  7772.  
  7773.     function EQUAL ( Index : integer ;
  7774.                      Value : %5 ) 
  7775.         
  7776.              return  CONDITION_TREE ;
  7777.  
  7778.  
  7779.     function EQUAL ( Index : GENERAL_ELEMENT ;
  7780.                      Value : %5 ) 
  7781.         
  7782.              return  CONDITION_TREE ;
  7783.  
  7784.  
  7785.  
  7786.  
  7787.  
  7788.     function GREATER_EQUAL ( Value : %2 ) 
  7789.         
  7790.              return  CONDITION_TREE ;
  7791.  
  7792.  
  7793.  
  7794.  
  7795.     function GREATER_EQUAL ( Index : integer ;
  7796.                      Value : %5 ) 
  7797.         
  7798.              return  CONDITION_TREE ;
  7799.  
  7800.  
  7801.     function GREATER_EQUAL ( Index : GENERAL_ELEMENT ;
  7802.                      Value : %5 ) 
  7803.         
  7804.              return  CONDITION_TREE ;
  7805.  
  7806.  
  7807.  
  7808.  
  7809.  
  7810.     function GREATER_THAN ( Value : %2 ) 
  7811.         
  7812.              return  CONDITION_TREE ;
  7813.  
  7814.  
  7815.  
  7816.  
  7817.     function GREATER_THAN ( Index : integer ;
  7818.                      Value : %5 ) 
  7819.         
  7820.              return  CONDITION_TREE ;
  7821.  
  7822.  
  7823.     function GREATER_THAN ( Index : GENERAL_ELEMENT ;
  7824.                      Value : %5 ) 
  7825.         
  7826.              return  CONDITION_TREE ;
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.     function LESS_EQUAL ( Value : %2 ) 
  7833.         
  7834.              return  CONDITION_TREE ;
  7835.  
  7836.  
  7837.  
  7838.  
  7839.     function LESS_EQUAL ( Index : integer ;
  7840.                      Value : %5 ) 
  7841.         
  7842.              return  CONDITION_TREE ;
  7843.  
  7844.  
  7845.     function LESS_EQUAL ( Index : GENERAL_ELEMENT ;
  7846.                      Value : %5 ) 
  7847.         
  7848.              return  CONDITION_TREE ;
  7849.  
  7850.  
  7851.  
  7852.  
  7853.  
  7854.     function LESS_THAN ( Value : %2 ) 
  7855.         
  7856.              return  CONDITION_TREE ;
  7857.  
  7858.  
  7859.  
  7860.  
  7861.     function LESS_THAN ( Index : integer ;
  7862.                      Value : %5 ) 
  7863.         
  7864.              return  CONDITION_TREE ;
  7865.  
  7866.  
  7867.     function LESS_THAN ( Index : GENERAL_ELEMENT ;
  7868.                      Value : %5 ) 
  7869.         
  7870.              return  CONDITION_TREE ;
  7871.  
  7872.  
  7873.  
  7874.  
  7875.  
  7876.     function UNEQUAL ( Value : %2 ) 
  7877.         
  7878.              return  CONDITION_TREE ;
  7879.  
  7880.  
  7881.  
  7882.  
  7883.     function UNEQUAL ( Index : integer ;
  7884.                      Value : %5 ) 
  7885.         
  7886.              return  CONDITION_TREE ;
  7887.  
  7888.  
  7889.     function UNEQUAL ( Index : GENERAL_ELEMENT ;
  7890.                      Value : %5 ) 
  7891.         
  7892.              return  CONDITION_TREE ;
  7893.  
  7894.  
  7895.  
  7896.  
  7897.  
  7898.     function UP return ORDERING_TREE ;
  7899.  
  7900.     function DOWN return ORDERING_TREE ;
  7901.  
  7902.  
  7903. end ;
  7904.  
  7905.  
  7906.  
  7907.  
  7908.  
  7909.  
  7910. package body %4 is
  7911.  
  7912.  
  7913. NumberOfBitsInAByte : constant integer := 8 ;
  7914.  
  7915.  
  7916.  
  7917. -------------------------------------------------------------------------
  7918. -------------------------------------------------------------------------
  7919. --                                                                     --
  7920. --             NOTE ON THE IMPLEMENTATION OF CONDITIONS                --
  7921. --                                                                     --
  7922. --     All of the conditions take the same form .                      --
  7923. --                                                                     --
  7924. --              * A pointer to the type of the field is set up .       --
  7925. --              * It is instantiated and set equal to the RHS of       --
  7926. --                the condition .                                      --
  7927. --              * The address of the pointer is calculated by a        --
  7928. --                function translating from a pointer type to a long   --
  7929. --                integer type .                                       --
  7930. --              * The size of the RHS is the size of the field_type    --
  7931. --              * The start and size of the RHS along with the         --
  7932. --                condition number are stored in the condition tree    --
  7933. --                                                                     --
  7934. --     A pointer type was used to store the value of the RHS of a      --
  7935. -- condition as is the only type that can be used . A local variable   --
  7936. -- (to the function) would dissapear after termination of the function --
  7937. -- Pointers live on . A global variable would be unsuitable as it is   --
  7938. -- not known at compile time the amount of conditions that are to be   --
  7939. -- set . Pointers are dynamic and so this problem does not arise .     --
  7940. --                                                                     --
  7941. --     In the case here of array field there is more than one type of  --
  7942. -- comparison for each comparison type . All the array can be tested   --
  7943. -- a single named element of the array can be tested or it can be      --
  7944. -- tested for any value of the array . So for each comparison there    --
  7945. -- are three functions . One header is supplied for each set of        --
  7946. -- functions and an individual explanation note for each one .         --
  7947. --                                                                     --
  7948. -------------------------------------------------------------------------
  7949. -------------------------------------------------------------------------
  7950.  
  7951.  
  7952.  
  7953.  
  7954.  
  7955. -------------------------------------------------------------------------------
  7956. --
  7957. -- Function        : To create a condition tree node for the condition EQUAL .
  7958. --                   Note equlaity applied to string fields is true if every
  7959. --                   element of the strings being compared is identical .
  7960. --
  7961. -- Input arguments : Value : The value of the RHS of the condition .
  7962. --
  7963. -- Output arguments: Returns a pointer to the created condition tree node .
  7964. --
  7965. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  7966. --
  7967. -- Calls to        : RightHandSideToLongInteger .
  7968. --
  7969. -- Called by       : ADA Application program .
  7970. --
  7971. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  7972. --
  7973. -- Amendments      :                        (  /  /  )
  7974. --
  7975. -- Notes           : 
  7976. --
  7977. -------------------------------------------------------------------------------
  7978.  
  7979.  
  7980.  
  7981.  
  7982. -- this function is testing all of the array elements are equivalent to the
  7983. -- corresponding elemnts of the comparison value .
  7984.  
  7985.  
  7986.     function EQUAL ( Value : %2 ) 
  7987.         
  7988.              return  CONDITION_TREE is
  7989.  
  7990.  
  7991.     type RightHandSidePointer is access %2 ;
  7992.  
  7993.     function RightHandSideToLongInteger is new
  7994.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  7995.  
  7996.     NewCondition :  CONDITION_TREE ;
  7997.  
  7998.     RightHandSide : RightHandSidePointer ;
  7999.  
  8000.  
  8001.     begin
  8002.  
  8003.       RightHandSide := new %2 ;
  8004.       RightHandSide.all := Value ;
  8005.  
  8006.  
  8007.  
  8008.  
  8009.       -- create a new condition block and set parameter values .
  8010.  
  8011.          -- ConditionNumber = 1 => EQUAL condition .
  8012.          -- FieldNumber = absolute number of the field the package is
  8013.          --               instantiated for .
  8014.          -- AnyAllSwitch = 0 => normal comparison .
  8015.          -- ArraySubscript = 0 => not used as normal comparison .
  8016.          
  8017.  
  8018.  
  8019.       NewCondition := new Condition_Block ;
  8020.       NewCondition.BlockType := Condition ;
  8021.       NewCondition.RHSParameters.ConditionNumber := 1 ;
  8022.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8023.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  8024.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8025.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8026.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  8027.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8028.            RightHandSideToLongInteger ( RightHandSide ) ;
  8029.  
  8030.  
  8031.       return NewCondition ;
  8032.  
  8033.     end ;
  8034.                    
  8035.  
  8036.  
  8037. -- this function deals with comparison of equality betwwen an individual
  8038. -- named array element and a value .
  8039.  
  8040.  
  8041.     function EQUAL ( Index : integer ;
  8042.                      Value : %5 ) 
  8043.         
  8044.              return  CONDITION_TREE is
  8045.  
  8046.  
  8047.     type RightHandSidePointer is access %5 ;
  8048.  
  8049.     function RightHandSideToLongInteger is new
  8050.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8051.  
  8052.     NewCondition :  CONDITION_TREE ;
  8053.  
  8054.     RightHandSide : RightHandSidePointer ;
  8055.  
  8056.  
  8057.     begin
  8058.  
  8059.       RightHandSide := new %5 ;
  8060.       RightHandSide.all := Value ;
  8061.  
  8062.  
  8063.  
  8064.  
  8065.       -- create a new condition block and set parameter values .
  8066.  
  8067.          -- ConditionNumber = 1 => EQUAL condition .
  8068.          -- FieldNumber = absolute number of the field the package is
  8069.          --               instantiated for .
  8070.          -- AnyAllSwitch = 1 => named array element comparison.
  8071.          -- ArraySubscript = Index => Compare array element number Index.
  8072.          
  8073.  
  8074.  
  8075.       NewCondition := new Condition_Block ;
  8076.       NewCondition.BlockType := Condition ;
  8077.       NewCondition.RHSParameters.ConditionNumber := 1 ;
  8078.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8079.       NewCondition.RHSParameters.AnyAllSwitch := 1 ;
  8080.       NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
  8081.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8082.                    long_integer ( %5'size/NumberOfBitsInAByte ) ;
  8083.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8084.            RightHandSideToLongInteger ( RightHandSide ) ;
  8085.  
  8086.       return NewCondition ;
  8087.  
  8088.     end ;
  8089.                    
  8090.  
  8091.  
  8092.  
  8093.  
  8094. -- this function tests either ALL_ELEMENTS of the array against the value
  8095. -- or to see if ANY_ELEMENT EQUAL to the value .
  8096.  
  8097.  
  8098.     function EQUAL ( Index : GENERAL_ELEMENT ;
  8099.                      Value : %5 ) 
  8100.         
  8101.              return  CONDITION_TREE is
  8102.  
  8103.  
  8104.     type RightHandSidePointer is access %5 ;
  8105.  
  8106.     function RightHandSideToLongInteger is new
  8107.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8108.  
  8109.     NewCondition :  CONDITION_TREE ;
  8110.  
  8111.     RightHandSide : RightHandSidePointer ;
  8112.  
  8113.  
  8114.     begin
  8115.  
  8116.       RightHandSide := new %5 ;
  8117.       RightHandSide.all := Value ;
  8118.  
  8119.  
  8120.  
  8121.  
  8122.       -- create a new condition block and set parameter values .
  8123.  
  8124.          -- ConditionNumber = 1 => EQUAL condition .
  8125.          -- FieldNumber = absolute number of the field the package is
  8126.          --               instantiated for .
  8127.          -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
  8128.          -- ArraySubscript = 0 => not applicable to this condition.
  8129.          
  8130.  
  8131.  
  8132.       NewCondition := new Condition_Block ;
  8133.       NewCondition.BlockType := Condition ;
  8134.       NewCondition.RHSParameters.ConditionNumber := 1 ;
  8135.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8136.  
  8137.       if Index = Any_Element
  8138.          then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
  8139.          else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
  8140.       end if ;
  8141.  
  8142.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8143.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8144.                    long_integer ( %5'size/NumberOfBitsInAByte ) ; 
  8145.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8146.            RightHandSideToLongInteger ( RightHandSide ) ;
  8147.  
  8148.       return NewCondition ;
  8149.  
  8150.     end ;
  8151.                    
  8152.  
  8153.  
  8154. -------------------------------------------------------------------------------
  8155. --
  8156. -- Function        : To create a condition tree node for the condition 
  8157. --                   GREATER_EQUAL . On string fields comparison is by
  8158. --                   dictionary order .
  8159. --
  8160. -- Input arguments : Value : The value of the RHS of the condition .
  8161. --
  8162. -- Output arguments: Returns a pointer to the created condition tree node .
  8163. --
  8164. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  8165. --
  8166. -- Calls to        : RightHandSideToLongInteger .
  8167. --
  8168. -- Called by       : ADA Application program .
  8169. --
  8170. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  8171. --
  8172. -- Amendments      :                        (  /  /  )
  8173. --
  8174. -- Notes           : 
  8175. --
  8176. -------------------------------------------------------------------------------
  8177.  
  8178.  
  8179. -- this function is testing all of the array elements are GREATER_EQUAL to the
  8180. -- corresponding elemnts of the comparison value .
  8181.  
  8182.     function GREATER_EQUAL ( Value : %2 ) 
  8183.         
  8184.              return  CONDITION_TREE is
  8185.  
  8186.  
  8187.     type RightHandSidePointer is access %2 ;
  8188.  
  8189.     function RightHandSideToLongInteger is new
  8190.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8191.  
  8192.     NewCondition :  CONDITION_TREE ;
  8193.  
  8194.     RightHandSide : RightHandSidePointer ;
  8195.  
  8196.  
  8197.     begin
  8198.  
  8199.       RightHandSide := new %2 ;
  8200.       RightHandSide.all := Value ;
  8201.  
  8202.  
  8203.       -- create a new condition block and set parameter values .
  8204.  
  8205.          -- ConditionNumber = 2 => GREATER_EQUAL condition .
  8206.          -- FieldNumber = absolute number of the field the package is
  8207.          --               instantiated for .
  8208.          -- AnyAllSwitch = 0 => normal comparison .
  8209.          -- ArraySubscript = 0 => not used as normal comparison .
  8210.  
  8211.       NewCondition := new Condition_Block ;
  8212.       NewCondition.BlockType := Condition ;
  8213.       NewCondition.RHSParameters.ConditionNumber := 2 ;
  8214.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8215.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  8216.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8217.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8218.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  8219.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8220.            RightHandSideToLongInteger ( RightHandSide ) ;
  8221.  
  8222.       return NewCondition ;
  8223.  
  8224.     end ;
  8225.                    
  8226.  
  8227.  
  8228. -- this function deals with comparison of GREATER_EQUAL betwwen an individual
  8229. -- named array element and a value .
  8230.  
  8231.  
  8232.     function GREATER_EQUAL ( Index : integer ;
  8233.                      Value : %5 ) 
  8234.         
  8235.              return  CONDITION_TREE is
  8236.  
  8237.  
  8238.     type RightHandSidePointer is access %5 ;
  8239.  
  8240.     function RightHandSideToLongInteger is new
  8241.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8242.  
  8243.     NewCondition :  CONDITION_TREE ;
  8244.  
  8245.     RightHandSide : RightHandSidePointer ;
  8246.  
  8247.  
  8248.     begin
  8249.  
  8250.       RightHandSide := new %5 ;
  8251.       RightHandSide.all := Value ;
  8252.  
  8253.  
  8254.       -- create a new condition block and set parameter values .
  8255.  
  8256.          -- ConditionNumber = 2  => GREATER_EQUAL condition .
  8257.          -- FieldNumber = absolute number of the field the package is
  8258.          --               instantiated for .
  8259.          -- AnyAllSwitch = 1 => named array element comparison.
  8260.          -- ArraySubscript = Index => Compare array element number Index.
  8261.  
  8262.       NewCondition := new Condition_Block ;
  8263.       NewCondition.BlockType := Condition ;
  8264.       NewCondition.RHSParameters.ConditionNumber := 2 ;
  8265.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8266.       NewCondition.RHSParameters.AnyAllSwitch := 1 ;
  8267.       NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
  8268.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8269.                    long_integer ( %5'size/NumberOfBitsInAByte ) ;
  8270.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8271.            RightHandSideToLongInteger ( RightHandSide ) ;
  8272.  
  8273.       return NewCondition ;
  8274.  
  8275.     end ;
  8276.                    
  8277.  
  8278.  
  8279.  
  8280.  
  8281. -- this function tests either ALL_ELEMENTS of the array against the value
  8282. -- or to see if ANY_ELEMENT GREATER_EQUAL to the value .
  8283.  
  8284.  
  8285.     function GREATER_EQUAL ( Index : GENERAL_ELEMENT ;
  8286.                      Value : %5 ) 
  8287.         
  8288.              return  CONDITION_TREE is
  8289.  
  8290.  
  8291.     type RightHandSidePointer is access %5 ;
  8292.  
  8293.     function RightHandSideToLongInteger is new
  8294.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8295.  
  8296.     NewCondition :  CONDITION_TREE ;
  8297.  
  8298.     RightHandSide : RightHandSidePointer ;
  8299.  
  8300.  
  8301.     begin
  8302.  
  8303.       RightHandSide := new %5 ;
  8304.       RightHandSide.all := Value ;
  8305.  
  8306.  
  8307.       -- create a new condition block and set parameter values .
  8308.  
  8309.          -- ConditionNumber = 2 => LESS_EQUAL condition .
  8310.          -- FieldNumber = absolute number of the field the package is
  8311.          --               instantiated for .
  8312.          -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
  8313.          -- ArraySubscript = 0 => not applicable to this condition .
  8314.  
  8315.       NewCondition := new Condition_Block ;
  8316.       NewCondition.BlockType := Condition ;
  8317.       NewCondition.RHSParameters.ConditionNumber := 2 ;
  8318.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8319.  
  8320.       if Index = Any_Element
  8321.          then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
  8322.          else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
  8323.       end if ;
  8324.  
  8325.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8326.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8327.                    long_integer ( %5'size/NumberOfBitsInAByte ) ; 
  8328.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8329.            RightHandSideToLongInteger ( RightHandSide ) ;
  8330.  
  8331.       return NewCondition ;
  8332.  
  8333.     end ;
  8334.                    
  8335.  
  8336.  
  8337. -------------------------------------------------------------------------------
  8338. --
  8339. -- Function        : To create a condition tree node for the condition 
  8340. --                   GREATER_THAN . On string fields comparison is by
  8341. --                   dictionary order .
  8342. --
  8343. -- Input arguments : Value : The value of the RHS of the condition .
  8344. --
  8345. -- Output arguments: Returns a pointer to the created condition tree node .
  8346. --
  8347. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  8348. --
  8349. -- Calls to        : RightHandSideToLongInteger .
  8350. --
  8351. -- Called by       : ADA Application program .
  8352. --
  8353. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  8354. --
  8355. -- Amendments      :                        (  /  /  )
  8356. --
  8357. -- Notes           : 
  8358. --
  8359. -------------------------------------------------------------------------------
  8360.  
  8361.  
  8362.  
  8363. -- this function is testing all of the array elements are GREATER_THAN to the
  8364. -- corresponding elemnts of the comparison value .
  8365.  
  8366.  
  8367.     function GREATER_THAN ( Value : %2 ) 
  8368.         
  8369.              return  CONDITION_TREE is
  8370.  
  8371.  
  8372.     type RightHandSidePointer is access %2 ;
  8373.  
  8374.     function RightHandSideToLongInteger is new
  8375.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8376.  
  8377.     NewCondition :  CONDITION_TREE ;
  8378.  
  8379.     RightHandSide : RightHandSidePointer ;
  8380.  
  8381.  
  8382.     begin
  8383.  
  8384.       RightHandSide := new %2 ;
  8385.       RightHandSide.all := Value ;
  8386.  
  8387.  
  8388.       -- create a new condition block and set parameter values .
  8389.  
  8390.          -- ConditionNumber = 3 => GREATER_THAN condition .
  8391.          -- FieldNumber = absolute number of the field the package is
  8392.          --               instantiated for .
  8393.          -- AnyAllSwitch = 0 => normal comparison .
  8394.          -- ArraySubscript = 0 => not used as normal comparison .
  8395.  
  8396.       NewCondition := new Condition_Block ;
  8397.       NewCondition.BlockType := Condition ;
  8398.       NewCondition.RHSParameters.ConditionNumber := 3 ;
  8399.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8400.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  8401.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8402.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8403.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  8404.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8405.            RightHandSideToLongInteger ( RightHandSide ) ;
  8406.  
  8407.       return NewCondition ;
  8408.  
  8409.     end ;
  8410.                    
  8411.  
  8412.  
  8413. -- this function deals with comparison of GREATER_THAN betwwen an individual
  8414. -- named array element and a value .
  8415.  
  8416.  
  8417.     function GREATER_THAN ( Index : integer ;
  8418.                      Value : %5 ) 
  8419.         
  8420.              return  CONDITION_TREE is
  8421.  
  8422.  
  8423.     type RightHandSidePointer is access %5 ;
  8424.  
  8425.     function RightHandSideToLongInteger is new
  8426.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8427.  
  8428.     NewCondition :  CONDITION_TREE ;
  8429.  
  8430.     RightHandSide : RightHandSidePointer ;
  8431.  
  8432.  
  8433.     begin
  8434.  
  8435.       RightHandSide := new %5 ;
  8436.       RightHandSide.all := Value ;
  8437.  
  8438.  
  8439.       -- create a new condition block and set parameter values .
  8440.  
  8441.          -- ConditionNumber = 3 => GREATER_THAN condition .
  8442.          -- FieldNumber = absolute number of the field the package is
  8443.          --               instantiated for .
  8444.          -- AnyAllSwitch = 1 => named array element comparison.
  8445.          -- ArraySubscript = Index => Compare array element number Index.
  8446.  
  8447.       NewCondition := new Condition_Block ;
  8448.       NewCondition.BlockType := Condition ;
  8449.       NewCondition.RHSParameters.ConditionNumber := 3 ;
  8450.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8451.       NewCondition.RHSParameters.AnyAllSwitch := 1 ;
  8452.       NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
  8453.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8454.                    long_integer ( %5'size/NumberOfBitsInAByte ) ;
  8455.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8456.            RightHandSideToLongInteger ( RightHandSide ) ;
  8457.  
  8458.       return NewCondition ;
  8459.  
  8460.     end ;
  8461.                    
  8462.  
  8463.  
  8464.  
  8465.  
  8466.  
  8467. -- this function tests either ALL_ELEMENTS of the array against the value
  8468. -- or to see if ANY_ELEMENT GREATER_THAN to the value .
  8469.  
  8470.  
  8471.     function GREATER_THAN ( Index : GENERAL_ELEMENT ;
  8472.                      Value : %5 ) 
  8473.         
  8474.              return  CONDITION_TREE is
  8475.  
  8476.  
  8477.     type RightHandSidePointer is access %5 ;
  8478.  
  8479.     function RightHandSideToLongInteger is new
  8480.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8481.  
  8482.     NewCondition :  CONDITION_TREE ;
  8483.  
  8484.     RightHandSide : RightHandSidePointer ;
  8485.  
  8486.  
  8487.     begin
  8488.  
  8489.       RightHandSide := new %5 ;
  8490.       RightHandSide.all := Value ;
  8491.  
  8492.  
  8493.       -- create a new condition block and set parameter values .
  8494.  
  8495.          -- ConditionNumber = 3 => GREATER_THAN condition .
  8496.          -- FieldNumber = absolute number of the field the package is
  8497.          --               instantiated for .
  8498.          -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
  8499.          -- ArraySubscript = 0 => not applicable to this condition .
  8500.  
  8501.       NewCondition := new Condition_Block ;
  8502.       NewCondition.BlockType := Condition ;
  8503.       NewCondition.RHSParameters.ConditionNumber := 3 ;
  8504.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8505.  
  8506.       if Index = Any_Element
  8507.          then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
  8508.          else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
  8509.       end if ;
  8510.  
  8511.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8512.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8513.                    long_integer ( %5'size/NumberOfBitsInAByte ) ; 
  8514.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8515.            RightHandSideToLongInteger ( RightHandSide ) ;
  8516.  
  8517.       return NewCondition ;
  8518.  
  8519.     end ;
  8520.                    
  8521.  
  8522.  
  8523. -------------------------------------------------------------------------------
  8524. --
  8525. -- Function        : To create a condition tree node for the condition 
  8526. --                   LESS EQUAL . On string fields comparison is by
  8527. --                   dictionary order .
  8528. --
  8529. -- Input arguments : Value : The value of the RHS of the condition .
  8530. --
  8531. -- Output arguments: Returns a pointer to the created condition tree node .
  8532. --
  8533. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  8534. --
  8535. -- Calls to        : RightHandSideToLongInteger .
  8536. --
  8537. -- Called by       : ADA Application program .
  8538. --
  8539. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  8540. --
  8541. -- Amendments      :                        (  /  /  )
  8542. --
  8543. -- Notes           : 
  8544. --
  8545. -------------------------------------------------------------------------------
  8546.  
  8547.  
  8548.  
  8549. -- this function is testing all of the array elements are LESS_EQUAL to the
  8550. -- corresponding elemnts of the comparison value .
  8551.  
  8552.  
  8553.     function LESS_EQUAL ( Value : %2 ) 
  8554.         
  8555.              return  CONDITION_TREE is
  8556.  
  8557.  
  8558.     type RightHandSidePointer is access %2 ;
  8559.  
  8560.     function RightHandSideToLongInteger is new
  8561.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8562.  
  8563.     NewCondition :  CONDITION_TREE ;
  8564.  
  8565.     RightHandSide : RightHandSidePointer ;
  8566.  
  8567.  
  8568.     begin
  8569.  
  8570.       RightHandSide := new %2 ;
  8571.       RightHandSide.all := Value ;
  8572.  
  8573.  
  8574.       -- create a new condition block and set parameter values .
  8575.  
  8576.          -- ConditionNumber = 4 => LESS_EQUAL condition .
  8577.          -- FieldNumber = absolute number of the field the package is
  8578.          --               instantiated for .
  8579.          -- AnyAllSwitch = 0 => normal comparison .
  8580.          -- ArraySubscript = 0 => not used as normal comparison .
  8581.  
  8582.       NewCondition := new Condition_Block ;
  8583.       NewCondition.BlockType := Condition ;
  8584.       NewCondition.RHSParameters.ConditionNumber := 4 ;
  8585.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8586.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  8587.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8588.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8589.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  8590.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8591.            RightHandSideToLongInteger ( RightHandSide ) ;
  8592.  
  8593.       return NewCondition ;
  8594.  
  8595.     end ;
  8596.                    
  8597.  
  8598.  
  8599. -- this function deals with comparison of GREATER_EQUAL betwwen an individual
  8600. -- named array element and a value .
  8601.  
  8602.  
  8603.     function LESS_EQUAL ( Index : integer ;
  8604.                      Value : %5 ) 
  8605.         
  8606.              return  CONDITION_TREE is
  8607.  
  8608.  
  8609.     type RightHandSidePointer is access %5 ;
  8610.  
  8611.     function RightHandSideToLongInteger is new
  8612.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8613.  
  8614.     NewCondition :  CONDITION_TREE ;
  8615.  
  8616.     RightHandSide : RightHandSidePointer ;
  8617.  
  8618.  
  8619.     begin
  8620.  
  8621.       RightHandSide := new %5 ;
  8622.       RightHandSide.all := Value ;
  8623.  
  8624.  
  8625.       -- create a new condition block and set parameter values .
  8626.  
  8627.          -- ConditionNumber = 4 => LESS_EQUAL condition .
  8628.          -- FieldNumber = absolute number of the field the package is
  8629.          --               instantiated for .
  8630.          -- AnyAllSwitch = 1 => named array element comparison.
  8631.          -- ArraySubscript = Index => Compare array element number Index.
  8632.  
  8633.       NewCondition := new Condition_Block ;
  8634.       NewCondition.BlockType := Condition ;
  8635.       NewCondition.RHSParameters.ConditionNumber := 4 ;
  8636.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8637.       NewCondition.RHSParameters.AnyAllSwitch := 1 ;
  8638.       NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
  8639.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8640.                    long_integer ( %5'size/NumberOfBitsInAByte ) ;
  8641.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8642.            RightHandSideToLongInteger ( RightHandSide ) ;
  8643.  
  8644.       return NewCondition ;
  8645.  
  8646.     end ;
  8647.                    
  8648.  
  8649.  
  8650.  
  8651.  
  8652.  
  8653. -- this function tests either ALL_ELEMENTS of the array against the value
  8654. -- or to see if ANY_ELEMENT KLESS_EQUAL to the value .
  8655.  
  8656.  
  8657.     function LESS_EQUAL ( Index : GENERAL_ELEMENT ;
  8658.                      Value : %5 ) 
  8659.         
  8660.              return  CONDITION_TREE is
  8661.  
  8662.  
  8663.     type RightHandSidePointer is access %5 ;
  8664.  
  8665.     function RightHandSideToLongInteger is new
  8666.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8667.  
  8668.     NewCondition :  CONDITION_TREE ;
  8669.  
  8670.     RightHandSide : RightHandSidePointer ;
  8671.  
  8672.  
  8673.     begin
  8674.  
  8675.       RightHandSide := new %5 ;
  8676.       RightHandSide.all := Value ;
  8677.  
  8678.  
  8679.       -- create a new condition block and set parameter values .
  8680.  
  8681.          -- ConditionNumber = 4 => LESS_EQUAL condition .
  8682.          -- FieldNumber = absolute number of the field the package is
  8683.          --               instantiated for .
  8684.          -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
  8685.          -- ArraySubscript = 0 => not applicable to this condition .
  8686.  
  8687.       NewCondition := new Condition_Block ;
  8688.       NewCondition.BlockType := Condition ;
  8689.       NewCondition.RHSParameters.ConditionNumber := 4 ;
  8690.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8691.  
  8692.       if Index = Any_Element
  8693.          then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
  8694.          else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
  8695.       end if ;
  8696.  
  8697.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8698.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8699.                    long_integer ( %5'size/NumberOfBitsInAByte ) ; 
  8700.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8701.            RightHandSideToLongInteger ( RightHandSide ) ;
  8702.  
  8703.       return NewCondition ;
  8704.  
  8705.     end ;
  8706.                    
  8707.  
  8708. -------------------------------------------------------------------------------
  8709. --
  8710. -- Function        : To create a condition tree node for the condition 
  8711. --                   LESS_THAN . On string fields comparison is by
  8712. --                   dictionary order .
  8713. --
  8714. -- Input arguments : Value : The value of the RHS of the condition .
  8715. --
  8716. -- Output arguments: Returns a pointer to the created condition tree node .
  8717. --
  8718. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  8719. --
  8720. -- Calls to        : RightHandSideToLongInteger .
  8721. --
  8722. -- Called by       : ADA Application program .
  8723. --
  8724. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  8725. --
  8726. -- Amendments      :                        (  /  /  )
  8727. --
  8728. -- Notes           : 
  8729. --
  8730. -------------------------------------------------------------------------------
  8731.  
  8732.  
  8733. -- this function is testing all of the array elements are LESS_THAN to the
  8734. -- corresponding elemnts of the comparison value .
  8735.  
  8736.  
  8737.     function LESS_THAN ( Value : %2 ) 
  8738.         
  8739.              return  CONDITION_TREE is
  8740.  
  8741.  
  8742.     type RightHandSidePointer is access %2 ;
  8743.  
  8744.     function RightHandSideToLongInteger is new
  8745.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8746.  
  8747.     NewCondition :  CONDITION_TREE ;
  8748.  
  8749.     RightHandSide : RightHandSidePointer ;
  8750.  
  8751.  
  8752.     begin
  8753.  
  8754.       RightHandSide := new %2 ;
  8755.       RightHandSide.all := Value ;
  8756.  
  8757.  
  8758.       -- create a new condition block and set parameter values .
  8759.  
  8760.          -- ConditionNumber = 5 => LESS_THAN condition .
  8761.          -- FieldNumber = absolute number of the field the package is
  8762.          --               instantiated for .
  8763.          -- AnyAllSwitch = 0 => normal comparison .
  8764.          -- ArraySubscript = 0 => not used as normal comparison .
  8765.  
  8766.       NewCondition := new Condition_Block ;
  8767.       NewCondition.BlockType := Condition ;
  8768.       NewCondition.RHSParameters.ConditionNumber := 5 ;
  8769.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8770.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  8771.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8772.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8773.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  8774.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8775.            RightHandSideToLongInteger ( RightHandSide ) ;
  8776.  
  8777.       return NewCondition ;
  8778.  
  8779.     end ;
  8780.                    
  8781.  
  8782.  
  8783. -- this function deals with comparison of LESS_THAN betwwen an individual
  8784. -- named array element and a value .
  8785.  
  8786.  
  8787.     function LESS_THAN ( Index : integer ;
  8788.                      Value : %5 ) 
  8789.         
  8790.              return  CONDITION_TREE is
  8791.  
  8792.  
  8793.     type RightHandSidePointer is access %5 ;
  8794.  
  8795.     function RightHandSideToLongInteger is new
  8796.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8797.  
  8798.     NewCondition :  CONDITION_TREE ;
  8799.  
  8800.     RightHandSide : RightHandSidePointer ;
  8801.  
  8802.  
  8803.     begin
  8804.  
  8805.       RightHandSide := new %5 ;
  8806.       RightHandSide.all := Value ;
  8807.  
  8808.  
  8809.       -- create a new condition block and set parameter values .
  8810.  
  8811.          -- ConditionNumber = 5 => LESS_THAN condition .
  8812.          -- FieldNumber = absolute number of the field the package is
  8813.          --               instantiated for .
  8814.          -- AnyAllSwitch = 1 => named array element comparison.
  8815.          -- ArraySubscript = Index => Compare array element number Index.
  8816.  
  8817.       NewCondition := new Condition_Block ;
  8818.       NewCondition.BlockType := Condition ;
  8819.       NewCondition.RHSParameters.ConditionNumber := 5 ;
  8820.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8821.       NewCondition.RHSParameters.AnyAllSwitch := 1 ;
  8822.       NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
  8823.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8824.                    long_integer ( %5'size/NumberOfBitsInAByte ) ;
  8825.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8826.            RightHandSideToLongInteger ( RightHandSide ) ;
  8827.  
  8828.       return NewCondition ;
  8829.  
  8830.     end ;
  8831.                    
  8832.  
  8833.  
  8834.  
  8835.  
  8836.  
  8837. -- this function tests either ALL_ELEMENTS of the array against the value
  8838. -- or to see if ANY_ELEMENT LESS_THAN to the value .
  8839.  
  8840.  
  8841.     function LESS_THAN ( Index : GENERAL_ELEMENT ;
  8842.                      Value : %5 ) 
  8843.         
  8844.              return  CONDITION_TREE is
  8845.  
  8846.  
  8847.     type RightHandSidePointer is access %5 ;
  8848.  
  8849.     function RightHandSideToLongInteger is new
  8850.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8851.  
  8852.     NewCondition :  CONDITION_TREE ;
  8853.  
  8854.     RightHandSide : RightHandSidePointer ;
  8855.  
  8856.  
  8857.     begin
  8858.  
  8859.       RightHandSide := new %5 ;
  8860.       RightHandSide.all := Value ;
  8861.  
  8862.  
  8863.       -- create a new condition block and set parameter values .
  8864.  
  8865.          -- ConditionNumber = 5 => LESS_THAN condition .
  8866.          -- FieldNumber = absolute number of the field the package is
  8867.          --               instantiated for .
  8868.          -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
  8869.          -- ArraySubscript = 0 => not applicable to this condition .
  8870.  
  8871.       NewCondition := new Condition_Block ;
  8872.       NewCondition.BlockType := Condition ;
  8873.       NewCondition.RHSParameters.ConditionNumber := 5 ;
  8874.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8875.  
  8876.       if Index = Any_Element
  8877.          then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
  8878.          else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
  8879.       end if ;
  8880.  
  8881.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8882.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8883.                    long_integer ( %5'size/NumberOfBitsInAByte ) ; 
  8884.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8885.            RightHandSideToLongInteger ( RightHandSide ) ;
  8886.  
  8887.       return NewCondition ;
  8888.  
  8889.     end ;
  8890.                    
  8891.  
  8892. -------------------------------------------------------------------------------
  8893. --
  8894. -- Function        : To create a condition tree node for the condition 
  8895. --                   UNEQUAL . On string fields comparison is by
  8896. --                   dictionary order .
  8897. --
  8898. -- Input arguments : Value : The value of the RHS of the condition .
  8899. --
  8900. -- Output arguments: Returns a pointer to the created condition tree node .
  8901. --
  8902. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  8903. --
  8904. -- Calls to        : RightHandSideToLongInteger .
  8905. --
  8906. -- Called by       : ADA Application program .
  8907. --
  8908. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  8909. --
  8910. -- Amendments      :                        (  /  /  )
  8911. --
  8912. -- Notes           : 
  8913. --
  8914. -------------------------------------------------------------------------------
  8915.  
  8916.  
  8917. -- this function is testing all of the array elements are UNEQUAL to the
  8918. -- corresponding elemnts of the comparison value .
  8919.  
  8920.  
  8921.     function UNEQUAL ( Value : %2 ) 
  8922.         
  8923.              return  CONDITION_TREE is
  8924.  
  8925.  
  8926.     type RightHandSidePointer is access %2 ;
  8927.  
  8928.     function RightHandSideToLongInteger is new
  8929.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8930.  
  8931.     NewCondition :  CONDITION_TREE ;
  8932.  
  8933.     RightHandSide : RightHandSidePointer ;
  8934.  
  8935.  
  8936.     begin
  8937.  
  8938.       RightHandSide := new %2 ;
  8939.       RightHandSide.all := Value ;
  8940.  
  8941.  
  8942.       -- create a new condition block and set parameter values .
  8943.  
  8944.          -- ConditionNumber = 6 => UNEQUAL condition .
  8945.          -- FieldNumber = absolute number of the field the package is
  8946.          --               instantiated for .
  8947.          -- AnyAllSwitch = 0 => normal comparison .
  8948.          -- ArraySubscript = 0 => not used as normal comparison .
  8949.  
  8950.       NewCondition := new Condition_Block ;
  8951.       NewCondition.BlockType := Condition ;
  8952.       NewCondition.RHSParameters.ConditionNumber := 6 ;
  8953.       NewCondition.RHSParameters.FieldNumber := %3 ;
  8954.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  8955.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  8956.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  8957.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  8958.       NewCondition.RHSParameters.StartOfRightHandSide :=
  8959.            RightHandSideToLongInteger ( RightHandSide ) ;
  8960.  
  8961.       return NewCondition ;
  8962.  
  8963.     end ;
  8964.                    
  8965.  
  8966.  
  8967.  
  8968. -- this function deals with comparison of UNEQUAL betwwen an individual
  8969. -- named array element and a value .
  8970.  
  8971.  
  8972.     function UNEQUAL ( Index : integer ;
  8973.                      Value : %5 ) 
  8974.         
  8975.              return  CONDITION_TREE is
  8976.  
  8977.  
  8978.     type RightHandSidePointer is access %5 ;
  8979.  
  8980.     function RightHandSideToLongInteger is new
  8981.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  8982.  
  8983.     NewCondition :  CONDITION_TREE ;
  8984.  
  8985.     RightHandSide : RightHandSidePointer ;
  8986.  
  8987.  
  8988.     begin
  8989.  
  8990.       RightHandSide := new %5 ;
  8991.       RightHandSide.all := Value ;
  8992.  
  8993.  
  8994.       -- create a new condition block and set parameter values .
  8995.  
  8996.          -- ConditionNumber = 6  => UNEQUAL condition .
  8997.          -- FieldNumber = absolute number of the field the package is
  8998.          --               instantiated for .
  8999.          -- AnyAllSwitch = 1 => named array element comparison.
  9000.          -- ArraySubscript = Index => Compare array element number Index.
  9001.  
  9002.       NewCondition := new Condition_Block ;
  9003.       NewCondition.BlockType := Condition ;
  9004.       NewCondition.RHSParameters.ConditionNumber := 6 ;
  9005.       NewCondition.RHSParameters.FieldNumber := %3 ;
  9006.       NewCondition.RHSParameters.AnyAllSwitch := 1 ;
  9007.       NewCondition.RHSParameters.ArraySubscript := long_integer( index ) ;
  9008.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  9009.                    long_integer ( %5'size/NumberOfBitsInAByte ) ;
  9010.       NewCondition.RHSParameters.StartOfRightHandSide :=
  9011.            RightHandSideToLongInteger ( RightHandSide ) ;
  9012.  
  9013.       return NewCondition ;
  9014.  
  9015.     end ;
  9016.                    
  9017.  
  9018.  
  9019.  
  9020.  
  9021.  
  9022. -- this function tests either ALL_ELEMENTS of the array against the value
  9023. -- or to see if ANY_ELEMENT UNEQUAL to the value .
  9024.  
  9025.  
  9026.     function UNEQUAL ( Index : GENERAL_ELEMENT ;
  9027.                      Value : %5 ) 
  9028.         
  9029.              return  CONDITION_TREE is
  9030.  
  9031.  
  9032.     type RightHandSidePointer is access %5 ;
  9033.  
  9034.     function RightHandSideToLongInteger is new
  9035.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  9036.  
  9037.     NewCondition :  CONDITION_TREE ;
  9038.  
  9039.     RightHandSide : RightHandSidePointer ;
  9040.  
  9041.  
  9042.     begin
  9043.  
  9044.       RightHandSide := new %5 ;
  9045.       RightHandSide.all := Value ;
  9046.  
  9047.  
  9048.       -- create a new condition block and set parameter values .
  9049.  
  9050.          -- ConditionNumber = 6 => UNEQUAL condition .
  9051.          -- FieldNumber = absolute number of the field the package is
  9052.          --               instantiated for .
  9053.          -- AnyAllSwitch = -1 or -2 => ANY_ELEMENT or ALL_ELEMENTS .
  9054.          -- ArraySubscript = 0 => not applicable to this condition .
  9055.  
  9056.       NewCondition := new Condition_Block ;
  9057.       NewCondition.BlockType := Condition ;
  9058.       NewCondition.RHSParameters.ConditionNumber := 6 ;
  9059.       NewCondition.RHSParameters.FieldNumber := %3 ;
  9060.  
  9061.       if Index = Any_Element
  9062.          then NewCondition.RHSParameters.AnyAllSwitch := -2 ;
  9063.          else NewCondition.RHSParameters.AnyAllSwitch := -1 ;
  9064.       end if ;
  9065.  
  9066.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  9067.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  9068.                    long_integer ( %5'size/NumberOfBitsInAByte ) ; 
  9069.       NewCondition.RHSParameters.StartOfRightHandSide :=
  9070.            RightHandSideToLongInteger ( RightHandSide ) ;
  9071.  
  9072.       return NewCondition ;
  9073.  
  9074.     end ;
  9075.  
  9076.  
  9077.  
  9078.  
  9079.                    
  9080.  
  9081.    function UP return ORDERING_TREE is
  9082.  
  9083.  
  9084. -------------------------------------------------------------------------------
  9085. --
  9086. -- Function        : To create an ordering tree leaf node to contain the 
  9087. --                   information that this field is to be in ascending order .
  9088. --
  9089. -- Input arguments : None .
  9090. --
  9091. -- Output arguments: Returns an ordering tree block .
  9092. --
  9093. -- Global variables: PerFile.ORDERING_TREE , PerFile.ORDER_BLOCK
  9094. --
  9095. -- Calls to        : None .
  9096. --
  9097. -- Called by       : ADA Application program .
  9098. --
  9099. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9100. --
  9101. -- Amendments      :                        (  /  /  )
  9102. --
  9103. -- Notes           : 
  9104. --
  9105. -------------------------------------------------------------------------------
  9106.  
  9107.  
  9108.  
  9109.  
  9110.    TempBlock : ORDERING_TREE ;
  9111.  
  9112.  
  9113.    begin
  9114.  
  9115.      TempBlock := new ORDER_BLOCK ;
  9116.  
  9117.      TempBlock.BlockType := LEAF ;
  9118.      TempBlock.OrderingInformation := %3 ;
  9119.  
  9120.      return TempBlock ;
  9121.  
  9122.    end ;
  9123.  
  9124.  
  9125.  
  9126.  
  9127.  
  9128.  
  9129.  
  9130.    function DOWN return ORDERING_TREE is
  9131.  
  9132.  
  9133.  
  9134. -------------------------------------------------------------------------------
  9135. --
  9136. -- Function        : To create an ordering tree leaf node to contain the 
  9137. --                   information that this field is to be in descending order .
  9138. --
  9139. -- Input arguments : None .
  9140. --
  9141. -- Output arguments: Returns an ordering tree block .
  9142. --
  9143. -- Global variables: PerFile.ORDERING_TREE , PerFile.ORDER_BLOCK
  9144. --
  9145. -- Calls to        : None .
  9146. --
  9147. -- Called by       : ADA Application program .
  9148. --
  9149. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9150. --
  9151. -- Amendments      :                        (  /  /  )
  9152. --
  9153. -- Notes           : 
  9154. --
  9155. -------------------------------------------------------------------------------
  9156.  
  9157.  
  9158.  
  9159.    TempBlock : ORDERING_TREE ;
  9160.  
  9161.  
  9162.    begin
  9163.  
  9164.      TempBlock := new ORDER_BLOCK ;
  9165.  
  9166.      TempBlock.BlockType := LEAF ;
  9167.      TempBlock.OrderingInformation := -(%3) ;
  9168.  
  9169.      return TempBlock ;
  9170.  
  9171.    end ;
  9172.  
  9173.  
  9174.  
  9175.  
  9176. end ;
  9177.  
  9178. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9179. --GSCOND.TXT
  9180. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9181. -----------------------------------------------------------------------
  9182. --                                                                   --
  9183. -- This is a generic package for the conditions on and ordering of   --
  9184. -- a scalar element.                                                 --
  9185. --                                                                   --
  9186. -- The package must be hand instantiated as follows :-               --
  9187. --                                                                   --
  9188. --         Replace   %1  with the name of the package with the       --
  9189. --                       file information .                          --
  9190. --                                                                   --
  9191. --         Replace   %2  with the type of the field declared in      --
  9192. --                       the package specified above.                --
  9193. --                                                                   --
  9194. --         replace   %3  with the number of the absolute number of   --
  9195. --                       the field .                                 --
  9196. --                                                                   --
  9197. --         Replace   %4 with the name of the field specified in      --
  9198. --                       the package containing file information.    --
  9199. --                       This then will become the name of the       --
  9200. --                       package .                                   --
  9201. --                                                                   --
  9202. --         Replace   %5  with the name of the ddf package            --
  9203. --                                                                   --
  9204. --                                                                   --
  9205. --         Finally exit the package as %4.txt and compile it         --
  9206. --                                                                   --
  9207. -----------------------------------------------------------------------
  9208.  
  9209.  
  9210.  
  9211. with %5 , %1 ; use %5 , %1 ;
  9212. with UNCHECKED_CONVERSION , text_io ; use text_io ;
  9213. package %4 is
  9214.  
  9215.  
  9216.     function EQUAL ( Value : %2 ) 
  9217.         
  9218.              return CONDITION_TREE ;
  9219.  
  9220.  
  9221.     function GREATER_EQUAL ( Value : %2 ) 
  9222.         
  9223.              return CONDITION_TREE ;
  9224.  
  9225.  
  9226.     function GREATER_THAN ( Value : %2 ) 
  9227.         
  9228.              return CONDITION_TREE ;
  9229.  
  9230.  
  9231.     function LESS_EQUAL( Value : %2 ) 
  9232.         
  9233.              return CONDITION_TREE ;
  9234.  
  9235.  
  9236.     function LESS_THAN ( Value : %2 ) 
  9237.         
  9238.              return CONDITION_TREE ;
  9239.  
  9240.  
  9241.     function UNEQUAL ( Value : %2 ) 
  9242.         
  9243.              return CONDITION_TREE ;
  9244.  
  9245.  
  9246.  
  9247.  
  9248.  
  9249.     function UP return ORDERING_TREE ;
  9250.  
  9251.  
  9252.     function DOWN return ORDERING_TREE ;
  9253.  
  9254.  
  9255. end ;
  9256.  
  9257.  
  9258.  
  9259.  
  9260.  
  9261.  
  9262.  
  9263. package body %4 is
  9264.  
  9265.  
  9266.  
  9267. NumberOfBitsInAByte : constant integer := 8 ;
  9268.  
  9269.  
  9270. -------------------------------------------------------------------------
  9271. -------------------------------------------------------------------------
  9272. --                                                                     --
  9273. --             NOTE ON THE IMPLEMENTATION OF CONDITIONS                --
  9274. --                                                                     --
  9275. --     All of the conditions take the same form .                      --
  9276. --                                                                     --
  9277. --              * A pointer to the type of the field is set up .       --
  9278. --              * It is instantiated and set equal to the RHS of       --
  9279. --                the condition .                                      --
  9280. --              * The address of the pointer is calculated by a        --
  9281. --                function translating from a pointer type to a long   --
  9282. --                integer type .                                       --
  9283. --              * The size of the RHS is the size of the field_type    --
  9284. --              * The start and size of the RHS along with the         --
  9285. --                condition number are stored in the condition tree    --
  9286. --                                                                     --
  9287. --     A pointer type was used to store the value of the RHS of a      --
  9288. -- condition as is the only type that can be used . A local variable   --
  9289. -- (to the function) would dissapear after termination of the function --
  9290. -- Pointers live on . A global variable would be unsuitable as it is   --
  9291. -- not known at compile time the amount of conditions that are to be   --
  9292. -- set . Pointers are dynamic and so this problem does not arise .     --
  9293. --                                                                     --
  9294. -------------------------------------------------------------------------
  9295. -------------------------------------------------------------------------
  9296.  
  9297.  
  9298.  
  9299.     function EQUAL ( Value : %2 ) 
  9300.         
  9301.              return CONDITION_TREE is
  9302.  
  9303. -------------------------------------------------------------------------------
  9304. --
  9305. -- Function        : To craete a condition tree node for the condition EQUAL .
  9306. --                   Note equlaity applied to string fields is true if every
  9307. --                   element of the strings being compared is identical .
  9308. --
  9309. -- Input arguments : Value : The value of the RHS of the condition .
  9310. --
  9311. -- Output arguments: Returns a pointer to the created condition tree node .
  9312. --
  9313. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  9314. --
  9315. -- Calls to        : RightHandSideToLongInteger .
  9316. --
  9317. -- Called by       : ADA Application program .
  9318. --
  9319. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9320. --
  9321. -- Amendments      :                        (  /  /  )
  9322. --
  9323. -- Notes           : 
  9324. --
  9325. -------------------------------------------------------------------------------
  9326.  
  9327.  
  9328.  
  9329.  
  9330.     type RightHandSidePointer is access %2 ;
  9331.  
  9332.     function RightHandSideToLongInteger is new
  9333.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  9334.  
  9335.     NewCondition : CONDITION_TREE ;
  9336.  
  9337.     RightHandSide : RightHandSidePointer ;
  9338.  
  9339.  
  9340.     begin
  9341.  
  9342.  
  9343.       -- instantiate the pointer to the type of the right hand side
  9344.       -- and set it equal to the comparison value .
  9345.  
  9346.       RightHandSide := new %2 ;
  9347.       RightHandSide.all := Value ;
  9348.  
  9349.  
  9350.       -- create a new condition block and set parameter values .
  9351.  
  9352.          -- ConditionNumber = 1 => EQUAL condition .
  9353.          -- FieldNumber = absolute number of the field the package is
  9354.          --               instantiated for .
  9355.          -- AnyAllSwitch = 0 => normal comparison .
  9356.          -- ArraySubscript = 0 => not dealing with arrays .
  9357.          
  9358.  
  9359.       NewCondition := new Condition_Block ;
  9360.       NewCondition.BlockType := Condition ;
  9361.       NewCondition.RHSParameters.ConditionNumber := 1 ;
  9362.       NewCondition.RHSParameters.FieldNumber := %3 ;
  9363.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  9364.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  9365.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  9366.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  9367.       NewCondition.RHSParameters.StartOfRightHandSide :=
  9368.            RightHandSideToLongInteger ( RightHandSide ) ;
  9369.  
  9370.  
  9371.       return NewCondition ;
  9372.  
  9373.     end ;
  9374.  
  9375.  
  9376.  
  9377.  
  9378.  
  9379.     function GREATER_EQUAL ( Value : %2 ) 
  9380.         
  9381.              return CONDITION_TREE is
  9382.  
  9383.  
  9384. -------------------------------------------------------------------------------
  9385. --
  9386. -- Function        : To create a condition tree node for the condition 
  9387. --                   GREATER_EQUAL . Note GREATER_EQUAL applied to string 
  9388. --                   fields is based on dictionary order .
  9389. --
  9390. -- Input arguments : Value : The value of the RHS of the condition .
  9391. --
  9392. -- Output arguments: Returns a pointer to the created condition tree node .
  9393. --
  9394. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  9395. --
  9396. -- Calls to        : RightHandSideToLongInteger .
  9397. --
  9398. -- Called by       : ADA Application program .
  9399. --
  9400. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9401. --
  9402. -- Amendments      :                        (  /  /  )
  9403. --
  9404. -- Notes           : 
  9405. --
  9406. -------------------------------------------------------------------------------
  9407.  
  9408.  
  9409.     type RightHandSidePointer is access %2 ;
  9410.  
  9411.     function RightHandSideToLongInteger is new
  9412.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  9413.  
  9414.     NewCondition : CONDITION_TREE ;
  9415.  
  9416.     RightHandSide : RightHandSidePointer ;
  9417.  
  9418.  
  9419.     begin
  9420.  
  9421.  
  9422.       -- instantiate the pointer to the type of the right hand side
  9423.       -- and set it equal to the comparison value .
  9424.  
  9425.       RightHandSide := new %2 ;
  9426.       RightHandSide.all := Value ;
  9427.  
  9428.  
  9429.       -- create a new condition block and set parameter values .
  9430.  
  9431.          -- ConditionNumber = 2 => GREATER_EQUAL condition .
  9432.          -- FieldNumber = absolute number of the field the package is
  9433.          --               instantiated for .
  9434.          -- AnyAllSwitch = 0 => normal comparison .
  9435.          -- ArraySubscript = 0 => not dealing with arrays .
  9436.  
  9437.  
  9438.       NewCondition := new Condition_Block ;
  9439.       NewCondition.BlockType := Condition ;
  9440.       NewCondition.RHSParameters.ConditionNumber := 2 ;
  9441.       NewCondition.RHSParameters.FieldNumber := %3 ;
  9442.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  9443.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  9444.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  9445.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  9446.       NewCondition.RHSParameters.StartOfRightHandSide :=
  9447.            RightHandSideToLongInteger ( RightHandSide ) ;
  9448.  
  9449.  
  9450.       return NewCondition ;
  9451.  
  9452.     end ;
  9453.  
  9454.  
  9455.  
  9456.  
  9457.  
  9458.     function GREATER_THAN ( Value : %2 ) 
  9459.         
  9460.              return CONDITION_TREE is
  9461.  
  9462.  
  9463. -------------------------------------------------------------------------------
  9464. --
  9465. -- Function        : To craete a condition tree node for the condition 
  9466. --                   GREATER_THAN . Note GREATER_THAN applied to string 
  9467. --                   fields is based on dictionary order .
  9468. --
  9469. -- Input arguments : Value : The value of the RHS of the condition .
  9470. --
  9471. -- Output arguments: Returns a pointer to the created condition tree node .
  9472. --
  9473. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  9474. --
  9475. -- Calls to        : RightHandSideToLongInteger .
  9476. --
  9477. -- Called by       : ADA Application program .
  9478. --
  9479. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9480. --
  9481. -- Amendments      :                        (  /  /  )
  9482. --
  9483. -- Notes           : 
  9484. --
  9485. -------------------------------------------------------------------------------
  9486.  
  9487.  
  9488.     type RightHandSidePointer is access %2 ;
  9489.  
  9490.     function RightHandSideToLongInteger is new
  9491.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  9492.  
  9493.     NewCondition : CONDITION_TREE ;
  9494.  
  9495.     RightHandSide : RightHandSidePointer ;
  9496.  
  9497.  
  9498.     begin
  9499.  
  9500.  
  9501.       -- instantiate the pointer to the type of the right hand side
  9502.       -- and set it equal to the comparison value .
  9503.  
  9504.       RightHandSide := new %2 ;
  9505.       RightHandSide.all := Value ;
  9506.  
  9507.  
  9508.       -- create a new condition block and set parameter values .
  9509.  
  9510.          -- ConditionNumber = 3 => GREATER_THAN condition .
  9511.          -- FieldNumber = absolute number of the field the package is
  9512.          --               instantiated for .
  9513.          -- AnyAllSwitch = 0 => normal comparison .
  9514.          -- ArraySubscript = 0 => not dealing with arrays .
  9515.  
  9516.  
  9517.       NewCondition := new Condition_Block ;
  9518.       NewCondition.BlockType := Condition ;
  9519.       NewCondition.RHSParameters.ConditionNumber := 3 ;
  9520.       NewCondition.RHSParameters.FieldNumber := %3 ;
  9521.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  9522.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  9523.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  9524.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  9525.       NewCondition.RHSParameters.StartOfRightHandSide :=
  9526.            RightHandSideToLongInteger ( RightHandSide ) ;
  9527.  
  9528.  
  9529.       return NewCondition ;
  9530.  
  9531.     end ;
  9532.  
  9533.  
  9534.  
  9535.  
  9536.  
  9537.     function LESS_EQUAL ( Value : %2 ) 
  9538.         
  9539.              return CONDITION_TREE is
  9540.  
  9541.  
  9542.  
  9543. -------------------------------------------------------------------------------
  9544. --
  9545. -- Function        : To create a condition tree node for the condition 
  9546. --                   LESS_EQUAL . Note LESS_EQUAL applied to string fields is 
  9547. --                   based on dictionary order .
  9548. --
  9549. -- Input arguments : Value : The value of the RHS of the condition .
  9550. --
  9551. -- Output arguments: Returns a pointer to the created condition tree node .
  9552. --
  9553. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  9554. --
  9555. -- Calls to        : RightHandSideToLongInteger .
  9556. --
  9557. -- Called by       : ADA Application program .
  9558. --
  9559. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9560. --
  9561. -- Amendments      :                        (  /  /  )
  9562. --
  9563. -- Notes           : 
  9564. --
  9565. -------------------------------------------------------------------------------
  9566.  
  9567.     type RightHandSidePointer is access %2 ;
  9568.  
  9569.     function RightHandSideToLongInteger is new
  9570.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  9571.  
  9572.     NewCondition : CONDITION_TREE ;
  9573.  
  9574.     RightHandSide : RightHandSidePointer ;
  9575.  
  9576.  
  9577.     begin
  9578.  
  9579.       -- instantiate the pointer to the type of the right hand side
  9580.       -- and set it equal to the comparison value .
  9581.  
  9582.       RightHandSide := new %2 ;
  9583.       RightHandSide.all := Value ;
  9584.  
  9585.  
  9586.       -- create a new condition block and set parameter values .
  9587.  
  9588.          -- ConditionNumber = 4 => LESS_EQUAL condition .
  9589.          -- FieldNumber = absolute number of the field the package is
  9590.          --               instantiated for .
  9591.          -- AnyAllSwitch = 0 => normal comparison .
  9592.          -- ArraySubscript = 0 => not dealing with arrays .
  9593.  
  9594.  
  9595.       NewCondition := new Condition_Block ;
  9596.       NewCondition.BlockType := Condition ;
  9597.       NewCondition.RHSParameters.ConditionNumber := 4 ;
  9598.       NewCondition.RHSParameters.FieldNumber := %3 ;
  9599.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  9600.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  9601.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  9602.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  9603.       NewCondition.RHSParameters.StartOfRightHandSide :=
  9604.            RightHandSideToLongInteger ( RightHandSide ) ;
  9605.  
  9606.       
  9607.       return NewCondition ;
  9608.  
  9609.     end ;
  9610.  
  9611.  
  9612.  
  9613.  
  9614.  
  9615.     function LESS_THAN ( Value : %2 ) 
  9616.         
  9617.              return CONDITION_TREE is
  9618.  
  9619.  
  9620. -------------------------------------------------------------------------------
  9621. --
  9622. -- Function        : To create a condition tree node for the condition 
  9623. --                   LESS_THAN .Note LESS_THAN applied to string fields is 
  9624. --                   based on all strings before in dictionary order .
  9625. --
  9626. -- Input arguments : Value : The value of the RHS of the condition .
  9627. --
  9628. -- Output arguments: Returns a pointer to the created condition tree node .
  9629. --
  9630. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  9631. --
  9632. -- Calls to        : RightHandSideToLongInteger .
  9633. --
  9634. -- Called by       : ADA Application program .
  9635. --
  9636. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9637. --
  9638. -- Amendments      :                        (  /  /  )
  9639. --
  9640. -- Notes           : 
  9641. --
  9642. -------------------------------------------------------------------------------
  9643.  
  9644.  
  9645.     type RightHandSidePointer is access %2 ;
  9646.  
  9647.     function RightHandSideToLongInteger is new
  9648.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  9649.  
  9650.     NewCondition : CONDITION_TREE ;
  9651.  
  9652.     RightHandSide : RightHandSidePointer ;
  9653.  
  9654.  
  9655.     begin
  9656.  
  9657.  
  9658.       -- instantiate the pointer to the type of the right hand side
  9659.       -- and set it equal to the comparison value .
  9660.  
  9661.       RightHandSide := new %2 ;
  9662.       RightHandSide.all := Value ;
  9663.  
  9664.  
  9665.       -- create a new condition block and set parameter values .
  9666.  
  9667.          -- ConditionNumber = 5 => LESS_THAN condition .
  9668.          -- FieldNumber = absolute number of the field the package is
  9669.          --               instantiated for .
  9670.          -- AnyAllSwitch = 0 => normal comparison .
  9671.          -- ArraySubscript = 0 => not dealing with arrays .
  9672.  
  9673.  
  9674.       NewCondition := new Condition_Block ;
  9675.       NewCondition.BlockType := Condition ;
  9676.       NewCondition.RHSParameters.ConditionNumber := 5 ;
  9677.       NewCondition.RHSParameters.FieldNumber := %3 ;
  9678.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  9679.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  9680.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  9681.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  9682.       NewCondition.RHSParameters.StartOfRightHandSide :=
  9683.            RightHandSideToLongInteger ( RightHandSide ) ;
  9684.  
  9685.  
  9686.       return NewCondition ;
  9687.  
  9688.     end ;
  9689.  
  9690.  
  9691.  
  9692.  
  9693.  
  9694.     function UNEQUAL( Value : %2 ) 
  9695.         
  9696.              return CONDITION_TREE is
  9697.  
  9698.  
  9699.  
  9700. -------------------------------------------------------------------------------
  9701. --
  9702. -- Function        : To create a condition tree node for the condition 
  9703. --                   UNEQUAL .Note inequlaity applied to string fields is true 
  9704. --                   if any element of the strings being compared is 
  9705. --                   different .
  9706. --
  9707. -- Input arguments : Value : The value of the RHS of the condition .
  9708. --
  9709. -- Output arguments: Returns a pointer to the created condition tree node .
  9710. --
  9711. -- Global variables: PerFile.CONDITION_TREE , PerFile.CONDITION_BLOCK .
  9712. --
  9713. -- Calls to        : RightHandSideToLongInteger .
  9714. --
  9715. -- Called by       : ADA Application program .
  9716. --
  9717. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9718. --
  9719. -- Amendments      :                        (  /  /  )
  9720. --
  9721. -- Notes           : 
  9722. --
  9723. -------------------------------------------------------------------------------
  9724.  
  9725.  
  9726.     type RightHandSidePointer is access %2 ;
  9727.  
  9728.     function RightHandSideToLongInteger is new
  9729.              UNCHECKED_CONVERSION ( RightHandSidePointer , long_integer ) ;
  9730.  
  9731.     NewCondition : CONDITION_TREE ;
  9732.  
  9733.     RightHandSide : RightHandSidePointer ;
  9734.  
  9735.  
  9736.     begin
  9737.  
  9738.  
  9739.       -- instantiate the pointer to the type of the right hand side
  9740.       -- and set it equal to the comparison value .
  9741.  
  9742.       RightHandSide := new %2 ;
  9743.       RightHandSide.all := Value ;
  9744.  
  9745.  
  9746.       -- create a new condition block and set parameter values .
  9747.  
  9748.          -- ConditionNumber = 6 => UNEQUAL condition .
  9749.          -- FieldNumber = absolute number of the field the package is
  9750.          --               instantiated for .
  9751.          -- AnyAllSwitch = 0 => normal comparison .
  9752.          -- ArraySubscript = 0 => not dealing with arrays .
  9753.  
  9754.  
  9755.       NewCondition := new Condition_Block ;
  9756.       NewCondition.BlockType := Condition ;
  9757.       NewCondition.RHSParameters.ConditionNumber := 6 ;
  9758.       NewCondition.RHSParameters.FieldNumber := %3 ;
  9759.       NewCondition.RHSParameters.AnyAllSwitch := 0 ;
  9760.       NewCondition.RHSParameters.ArraySubscript := 0 ;
  9761.       NewCondition.RHSParameters.SizeOfRightHandSide := 
  9762.                                  long_integer ( %2'size/NumberOfBitsInAByte ) ;
  9763.       NewCondition.RHSParameters.StartOfRightHandSide :=
  9764.            RightHandSideToLongInteger ( RightHandSide ) ;
  9765.  
  9766.  
  9767.       return NewCondition ;
  9768.  
  9769.     end ;
  9770.                    
  9771.  
  9772.  
  9773.  
  9774. function UP return ORDERING_TREE is 
  9775.  
  9776.  
  9777. -------------------------------------------------------------------------------
  9778. --
  9779. -- Function        : To create an ordering tree leaf node to contain the 
  9780. --                   information that this field is to be in ascending order .
  9781. --
  9782. -- Input arguments : None .
  9783. --
  9784. -- Output arguments: Returns an ordering tree block .
  9785. --
  9786. -- Global variables: PerFile.ORDERING_TREE , PerFile.ORDER_BLOCK
  9787. --
  9788. -- Calls to        : None .
  9789. --
  9790. -- Called by       : ADA Application program .
  9791. --
  9792. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9793. --
  9794. -- Amendments      :                        (  /  /  )
  9795. --
  9796. -- Notes           : 
  9797. --
  9798. -------------------------------------------------------------------------------
  9799.  
  9800.  
  9801. TempBlock : ORDERING_TREE ;
  9802.  
  9803. begin
  9804.  
  9805.   TempBlock := new Order_Block ;
  9806.  
  9807.   -- we are creating a leaf node ( bottom of the ordering tree )
  9808.  
  9809.   TempBlock.BlockType := LEAF ;
  9810.  
  9811.   -- the fact that field x is to be in ascending order is specified by storing
  9812.   -- the number + x
  9813.  
  9814.   TempBlock.OrderingInformation := %3 ;
  9815.  
  9816.   return TempBlock ;
  9817.  
  9818. end ;
  9819.  
  9820.  
  9821.  
  9822.  
  9823. function DOWN return ORDERING_TREE is 
  9824.  
  9825. -------------------------------------------------------------------------------
  9826. --
  9827. -- Function        : To create an ordering tree leaf node to contain the 
  9828. --                   information that this field is to be in descending order .
  9829. --
  9830. -- Input arguments : None .
  9831. --
  9832. -- Output arguments: Returns an ordering tree block .
  9833. --
  9834. -- Global variables: PerFile.ORDERING_TREE , PerFile.ORDER_BLOCK
  9835. --
  9836. -- Calls to        : None .
  9837. --
  9838. -- Called by       : ADA Application program .
  9839. --
  9840. -- Author          : RP/MDD                 (  /  /  )     Version 1.0
  9841. --
  9842. -- Amendments      :                        (  /  /  )
  9843. --
  9844. -- Notes           : 
  9845. --
  9846. -------------------------------------------------------------------------------
  9847.  
  9848.  
  9849. TempBlock : ORDERING_TREE ;
  9850.  
  9851. begin
  9852.  
  9853.   TempBlock := new Order_Block ;
  9854.  
  9855.   -- we are creating a LEAF node ( at the bottom of the tree )
  9856.  
  9857.   TempBlock.BlockType :=  LEAF ;
  9858.  
  9859.   -- the fact that field x is to be in ascending order is stored as - x
  9860.  
  9861.   TempBlock.OrderingInformation := -(%3) ;
  9862.  
  9863.   return TempBlock ;
  9864.  
  9865. end ;
  9866.  
  9867.  
  9868.  
  9869.  
  9870. end ;
  9871.  
  9872. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9873. --ADARAP.COM
  9874. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9875. $! First define the name of the "TeleSoft Code" directory
  9876. $! ****************************
  9877. $DEFINE TADA$DIR DBA2:[ADARAPP.ADK]
  9878. $! ****************************
  9879. $! Now define all the relevant code files
  9880. $ DEFINE TADA$RTK    TADA$DIR:V30R23
  9881. $ DEFINE TADA$PSE    TADA$DIR:ROS.ROS
  9882. $ DEFINE TADA$ACOMP  TADA$DIR:CMDADA.COD
  9883. $ DEFINE TADA$PCOMP  TADA$DIR:PASCAL.COD
  9884. $ DEFINE TADA$TRVAX  TADA$DIR:TRVAX.COD
  9885. $ DEFINE TADA$EDIT   "EDIT/EDT"
  9886. $!
  9887. $! Enable the Help library
  9888. $ DEFINE HLP$LIBRARY_1 TADA$DIR:TELESOFT
  9889. $!
  9890. $! Set up the default file types
  9891. $!     DEFINE TADA$IPT    ".ADA"
  9892. $!     DEFINE TADA$OPT    ".ROS"
  9893. $!
  9894. $! ******************************************
  9895. $ DEFINE HLP$LIBRARY_2 DBA2:[ADARAPP.HELP]ADK.HLB
  9896. $! ******************************************
  9897. $!
  9898. $! This file sets up all the commands and assignments required
  9899. $! by a user for RAPPORT-4
  9900. $!
  9901. $! ************************************************
  9902. $assign DBA2:[RAPPVMS3] rapport4:
  9903. $assign __DBA2:[RAPPVMS3.] rapproot4:
  9904. $assign DBA2:[RAPPVMS3] rapport2:
  9905. $assign __DBA2:[RAPPVMS3.] rapproot2:
  9906. $assign DBA2:[adaRAPP] adarap:
  9907. $assign __DBA2:[adaRAPP.] araproot:
  9908. $ ASSIGN araproot:[fortran]USERCALL.EXE ADA$SUBNUC
  9909. $set command/tables=adarap:r4user.exe
  9910. $! ************************************************
  9911. $define hlp$library rapport4:rapport4.hlb
  9912. $rapie*r   :== zzzz
  9913. $err*or    :== "@rapport4:errorlist.com"
  9914. $t*ype     :== type
  9915. $lo*gout   :== logout
  9916. !
  9917. ! OPTIONS --- Set Global Logical names stating which
  9918. !             RAPPORT-4 options are installed and which
  9919. !             older RAPPORT versions were installed.
  9920. !
  9921. $!
  9922. $! Set up flags to be used throughout the RAPPORT-4 tests and
  9923. $! maintainence command files.
  9924. $!
  9925. $   TRUE      == 1 .eq. 1
  9926. $   FALSE     == 1 .eq. 0
  9927. $!
  9928. $! DCL Global variable     Installed ? Description
  9929. $!
  9930. $  opt_nucleus_backup==     TRUE      ! Nucleus with Backup and Recovery
  9931. $  opt_data_security ==     TRUE      ! Data security
  9932. $  opt_multi_user    ==     TRUE      ! Multi-user
  9933. $  opt_rapide        ==     TRUE      ! RAPIDE
  9934. $  opt_rapide_de     ==     FALSE     ! Rapide Data-Entry
  9935. $  opt_rapier        ==     TRUE      ! Rapier
  9936. $  opt_fortran_66    ==     FALSE     ! (Option Unavailable)
  9937. $  opt_fortran_77    ==     TRUE      ! FORTRAN-77 interface
  9938. $  opt_COBOL         ==     FALSE     ! COBOL interface
  9939. $  opt_pascal        ==     TRUE      ! PASCAL interface
  9940. $!
  9941. $! determine which , if any, old RAPPORT versions exist at this site
  9942. $!
  9943. $  opt_rapport_1_02  ==     FALSE     ! determines need for CSVAMP
  9944. $  opt_rapport_3     ==     FALSE     ! determines need for C4VAMP
  9945. $!
  9946. $ RLINK :== @adarap:MUFORAPPL.COM
  9947. $ RSLINK :== @adarap:SUFORAPPL.COM
  9948. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9949. --LOGIN.COM
  9950. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9951. $ SET NOVERIFY
  9952. $ ON CONTROL_Y THEN CONTINUE
  9953. $ SET DEF DBA2:[ADARAPP]
  9954. $ SET PROT/PROT=(O:RWED,S:RWE,G:R)/DEFAULT
  9955. $ @adarap.com
  9956. $ defs :== @[adarapp.distoct84.adk]tadadefs
  9957. $ ADK :== SET DEFAULT dba2:[adarapp.ADK]
  9958. $ HOME :== SET DEFAULT dba2:[adarapp.ada]
  9959. $ UNI :== SET DEF DBA2:[ADARAPP.UNITREP]
  9960. $ STARTNUC :== SUBMIT/NOPRINTER/LOG=dba2:[adarapp]NUCLEUS.LOG DBA2:[ADARAPP]NUCRUN.COM
  9961. $ STOPNUC :== SERVICE/NAME=ADANUC
  9962. $ STARTUNIT :== SUBMIT/NOPRINT [ADARAPP.UNITREP]NUCRUN
  9963. $ STOPUNIT :== SERVICE/NAME=UNITNUC
  9964. $ UP :== SET DEFAULT [-]
  9965. $ SBQ :== SHOW QUEUE SYS$BATCH/ALL
  9966. $ SPQ :== SHOW QUEUE TXA6/ALL
  9967. $ PRI :== PRINT/QUEUE=TXA6/NOFLAG
  9968. $ DD :== DIR *.DIR
  9969. $ TODRA0 :== @DBA2:[ADARAPP]TODRA0.COM
  9970. $ USER1 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER1]
  9971. $ USER2 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER2]
  9972. $ USER3 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER3]
  9973. $ USER4 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER4]
  9974. $ USER5 :== SET DEFAULT DBA2:[ADARAPP.COURSE.USER5]
  9975. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9976. --MUFORAPPL.COM
  9977. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9978. !
  9979. ! MUFORAPPL --- This is the build file for a multi-user Fortran
  9980. !               application program.
  9981. !
  9982. $link/trace/exe='P1.exe -
  9983.                  'P1, -
  9984.                  rapproot4:[objs]umblok, -
  9985.                                  mduslbblk, -
  9986.                  rapproot4:[libs]userlb/lib, -
  9987.                                  nuinlb/lib, -
  9988.                                  nodslb/lib, -
  9989.                                  mpinlb/lib, -
  9990.                                  poollb/lib,mduslb/lib,corelb/lib
  9991. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9992. --NUCRUN.COM
  9993. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9994. NUCLEUS
  9995. ADANUC
  9996. araproot:[unitrep]unitrep
  9997. ENTER
  9998. CONT
  9999. EXIT
  10000. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10001. --R4USER.COM
  10002. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10003. $!
  10004. $! This file sets up all the commands and assignments required
  10005. $! by a user for RAPPORT-4
  10006. $!
  10007. $assign DRA1:[RAPPORT4] rapport4:
  10008. $assign __DRA1:[RAPPORT4.] rapproot4:
  10009. $assign DRA1:[RAPPORT4] rapport2:
  10010. $assign __DRA1:[RAPPORT4.] rapproot2:
  10011. $set command/tables=rapport4:r4user.exe
  10012. $define hlp$library rapport4:rapport4.hlb
  10013. $rapie*r   :== zzzz
  10014. $err*or    :== "@rapport4:errorlist.com"
  10015. $t*ype     :== type
  10016. $lo*gout   :== logout
  10017. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10018. --R4USERCLD.COM
  10019. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10020. $copy sys$library:dcltables.exe r4user.exe
  10021. $set command/output=r4user.exe -
  10022.             /tables=r4user.exe -
  10023.                     r4user.cld
  10024. $set command/tables=r4user.exe
  10025. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10026. --REFRESH.COM
  10027. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10028. copy rapproot4:[companies.fortran]'P1.dbs -
  10029.      araproot:[companies]'P1.dbs
  10030. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10031. --SUFORAPPL.COM
  10032. --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10033. !
  10034. ! SUFORAPPL --- This is the build file for a single-user Fortran
  10035. !               application program. 
  10036. !
  10037. $link/trace/exe='P1.exe -
  10038.                 'P1.OBJ, -
  10039.                 rapproot4:[objs]usblok, -
  10040.                                 mduslbblk, -
  10041.                 rapproot4:[libs]userlb/lib, -
  10042.                                 nucolb/lib, -
  10043.                                 lonulb/lib, -
  10044.                                 singlb/lib, -
  10045.                                 nodslb/lib, -
  10046.                                 poollb/lib,mduslb/lib,corelb/lib
  10047.  
  10048.