| 1 |
.TITLE FSY_EXTBDF |
| 2 |
; @(#)fsyvmsc.mar 19.1 (ESO-IPG) 02/25/03 %U;% |
| 3 |
;++ |
| 4 |
; EXTBDF - Extend Bulk Data File |
| 5 |
; |
| 6 |
; This routine is used to extend an EXISTING Bulk Data File. The |
| 7 |
; file is opened using RMS NAM block; the calling program supplies |
| 8 |
; the FILES-11 file identification and the device name string. |
| 9 |
; (i.e. it is assumed that the file has been opened previously on |
| 10 |
; another channel, probably by FSY_OPNBDF). |
| 11 |
; |
| 12 |
; If the file is opened successfully, the initial file size |
| 13 |
; (measured in virtual blocks) is saved and the file extended |
| 14 |
; by the specified number of blocks; the new file size is then |
| 15 |
; calculated and returned to the calling program. |
| 16 |
; (Note that this value is rounded to the next cluster boundary). |
| 17 |
; The file's end-of-file marker is NOT automatically updated |
| 18 |
; by the RMS $EXTEND macro, |
| 19 |
; therefore, a RMS block I/O write is performed on the |
| 20 |
; highest virtual block number to accomplish this. |
| 21 |
; |
| 22 |
; +++ |
| 23 |
; This is the version of MID_EXTBDF for C modules, |
| 24 |
; so character strings are handled more directly. |
| 25 |
; +++ |
| 26 |
; |
| 27 |
; use as FSY_EXTBDF(FILEIDA,FILEIDB,DEVICE,EXALQ,NVB,STATUS) |
| 28 |
; |
| 29 |
; Input parameters: |
| 30 |
; ---------------- |
| 31 |
; FILEIDA: INTEGER variable: FILES-11 File Identification (part A) |
| 32 |
; FILEIDB: INTEGER variable: FILES-11 File Identification (part B) |
| 33 |
; DEVICE: char. string Device Identification. |
| 34 |
; EXALQ: I*4 Extension Allocation Quantity, |
| 35 |
; (measured in virtual blocks). |
| 36 |
; |
| 37 |
; Output parameters: |
| 38 |
; ----------------- |
| 39 |
; NVB: I*4 Total number of Virtual Blocks |
| 40 |
; now allocated to file. |
| 41 |
; STATUS: I*4 Status return. |
| 42 |
; |
| 43 |
; |
| 44 |
; K. Banse version 2.3 860128 |
| 45 |
; K. Banse version 1.30 980616, W_FID is 6 bytes! |
| 46 |
;-- |
| 47 |
|
| 48 |
BDFFAB: $FAB FOP=<CBT,NAM>, - |
| 49 |
FAC=<PUT,GET,BIO>, - |
| 50 |
RFM=FIX, - |
| 51 |
MRS=512, - |
| 52 |
SHR=<UPI,PUT,GET>, - |
| 53 |
NAM=BDFNAM |
| 54 |
|
| 55 |
BDFNAM: $NAM |
| 56 |
|
| 57 |
BDFRAB: $RAB FAB=BDFFAB, - |
| 58 |
RBF=BUFFER, - |
| 59 |
RSZ=512, - |
| 60 |
ROP=BIO |
| 61 |
|
| 62 |
BUFFER: .BLKB 512 |
| 63 |
|
| 64 |
FSY_EXTBDF:: |
| 65 |
|
| 66 |
.WORD ^M<R2> |
| 67 |
|
| 68 |
MOVL 04(AP),BDFNAM+NAM$W_FID ;store FILEIDA |
| 69 |
MOVW 08(AP),BDFNAM+NAM$W_FID+4 ;store FILEIDB |
| 70 |
MOVL 12(AP),R0 ;addr of DEVICE descr |
| 71 |
MOVAL BDFNAM+NAM$T_DVI,R1 ;move to DEVICE field in NAM block |
| 72 |
MOVL (R0),(R1) |
| 73 |
ADDL2 I^#4,R0 |
| 74 |
ADDL2 I^#4,R1 |
| 75 |
MOVL (R0),(R1) |
| 76 |
ADDL2 I^#4,R0 |
| 77 |
ADDL2 I^#4,R1 |
| 78 |
MOVL (R0),(R1) |
| 79 |
ADDL2 I^#4,R0 |
| 80 |
ADDL2 I^#4,R1 |
| 81 |
MOVL (R0),(R1) |
| 82 |
|
| 83 |
$OPEN FAB=BDFFAB |
| 84 |
BLBC R0,20$ |
| 85 |
|
| 86 |
MOVL BDFFAB+FAB$L_ALQ,R2 ;save initial file-size |
| 87 |
MOVL 16(AP),BDFFAB+FAB$L_ALQ ;store EXALQ |
| 88 |
|
| 89 |
$EXTEND FAB=BDFFAB |
| 90 |
BLBC R0,20$ |
| 91 |
|
| 92 |
ADDL2 BDFFAB+FAB$L_ALQ,R2 ;determine new file-size |
| 93 |
MOVL R2,@20(AP) ;return NVB |
| 94 |
MOVL R2,BDFRAB+RAB$L_BKT ;store highest block # |
| 95 |
|
| 96 |
$CONNECT RAB=BDFRAB |
| 97 |
$WRITE RAB=BDFRAB |
| 98 |
|
| 99 |
20$: MOVL R0,@24(AP) ;return STATUS |
| 100 |
$CLOSE FAB=BDFFAB |
| 101 |
|
| 102 |
RET |
| 103 |
.END |