.TITLE FSY_EXTBDF ; @(#)fsyalphc.mar 17.1.1.1 (ESO-IPG) 01/25/02 17:36:20 ;++ ; EXTBDF - Extend Bulk Data File ; ; This routine is used to extend an EXISTING Bulk Data File. The ; file is opened using RMS NAM block; the calling program supplies ; the FILES-11 file identification and the device name string. ; (i.e. it is assumed that the file has been opened previously on ; another channel, probably by FSY_OPNBDF). ; ; If the file is opened successfully, the initial file size ; (measured in virtual blocks) is saved and the file extended ; by the specified number of blocks; the new file size is then ; calculated and returned to the calling program. ; (Note that this value is rounded to the next cluster boundary). ; The file's end-of-file marker is NOT automatically updated ; by the RMS $EXTEND macro, ; therefore, a RMS block I/O write is performed on the ; highest virtual block number to accomplish this. ; ; +++ ; This is the version of MID_EXTBDF for C modules, ; so character strings are handled more directly. ; +++ ; ; use as FSY_EXTBDF(FILEIDA,FILEIDB,DEVICE,EXALQ,NVB,STATUS) ; ; Input parameters: ; ---------------- ; FILEIDA: INTEGER variable: FILES-11 File Identification (part A) ; FILEIDB: INTEGER variable: FILES-11 File Identification (part B) ; DEVICE: char. string Device Identification. ; EXALQ: I*4 Extension Allocation Quantity, ; (measured in virtual blocks). ; ; Output parameters: ; ----------------- ; NVB: I*4 Total number of Virtual Blocks ; now allocated to file. ; STATUS: I*4 Status return. ; ; ; K. Banse version 2.3 860128 ; K. Banse version 2.40 930115, for Alpha Open VMS ; K. Banse version 1.30 980616, W_FID is 6 bytes! ;-- .PSECT FSYVMSC_1,WRT,NOEXE BDFFAB: $FAB FOP=, - FAC=, - RFM=FIX, - MRS=512, - SHR=, - NAM=BDFNAM BDFNAM: $NAM BDFRAB: $RAB FAB=BDFFAB, - RBF=BUFFER, - RSZ=512, - ROP=BIO BUFFER: .BLKB 512 .PSECT FSYVMSC_2,EXE FSY_EXTBDF:: .CALL_ENTRY ; .WORD ^M MOVL 04(AP),BDFNAM+NAM$W_FID ;store FILEIDA MOVW 08(AP),BDFNAM+NAM$W_FID+4 ;store FILEIDB MOVL 12(AP),R0 ;addr of DEVICE descr MOVAL BDFNAM+NAM$T_DVI,R1 ;move to DEVICE field in NAM block MOVL (R0),(R1) ADDL2 I^#4,R0 ADDL2 I^#4,R1 MOVL (R0),(R1) ADDL2 I^#4,R0 ADDL2 I^#4,R1 MOVL (R0),(R1) ADDL2 I^#4,R0 ADDL2 I^#4,R1 MOVL (R0),(R1) $OPEN FAB=BDFFAB BLBC R0,20$ MOVL BDFFAB+FAB$L_ALQ,R2 ;save initial file-size MOVL 16(AP),BDFFAB+FAB$L_ALQ ;store EXALQ $EXTEND FAB=BDFFAB BLBC R0,20$ ADDL2 BDFFAB+FAB$L_ALQ,R2 ;determine new file-size MOVL R2,@20(AP) ;return NVB MOVL R2,BDFRAB+RAB$L_BKT ;store highest block # $CONNECT RAB=BDFRAB $WRITE RAB=BDFRAB 20$: MOVL R0,@24(AP) ;return STATUS $CLOSE FAB=BDFFAB RET .END