2
; @(#)fsyalphd.mar 19.1 (ESO-IPG) 02/25/03 13:57:16
4
; OPNBDF - Open Bulk Data File
6
; This routine is used to open an EXISTING Bulk Data File for
7
; subsequent processing. The filename, logical or physical, is
8
; supplied by the calling program and the file is opened by RMS
9
; using the User File Open option. This restricts the access to
10
; the file (on the assigned channel) to the QIO and file-mapping
11
; system services; no RMS routines can be used. However, the
12
; file can still be accessed on another channel for RMS process-
13
; -ing, (see FSY_EXTBDF), as it is opened for file sharing.
15
; The file will be opened for read/only access if the protection
16
; does not allow read/write operations to be performed.
18
; If the bulk data file is opened successfully, the I/O channel
19
; number, FILES-11 file identification and device name string are
20
; returned to the calling program. These can be used subsequently
21
; to re-open the file, using the RMS NAM block, for any ancillary
22
; processing that may be required.
25
; This is the version of MID_OPNBDF for C modules,
26
; so character strings are handled more directly.
28
; use as FSY_OPNBDF(NAME,LEN,IOCHAN,FILEIDA,FILEIDB,DEVICE,STATUS)
32
; NAME: CHARACTER expression: Name of Bulk Data File.
33
; LEN: I*4 Length of NAME
37
; IOCHAN: INTEGER variable: I/O channel assigned to file.
38
; FILEIDA: INTEGER variable: FILES-11 File Identification (part A)
39
; FILEIDB: INTEGER variable: FILES-11 File Identification (part B)
40
; DEVICE: CHARACTER variable: Device Identification (20 chars)
41
; STATUS: INTEGER variable: Status return.
44
; K. Banse version 1.00 851120
45
; K. Banse version 1.10 910917
46
; K. Banse version 1.20 930115, for Alpha Open VMS
47
; K. Banse version 1.30 980616, W_FID is 6 bytes!
50
.PSECT FSYVMSD_1,WRT,NOEXE
54
BDFFAB: $FAB FOP=<UFO>, -
59
BDFFABR: $FAB FOP=<UFO>, -
68
FSY_OPNBDF:: .CALL_ENTRY
71
MOVL 04(AP),BDFFAB+FAB$L_FNA ;addr of NAME string
72
MOVB 08(AP),BDFFAB+FAB$B_FNS ;size of NAME string
74
$OPEN FAB=BDFFAB ;attempt to open file
75
BLBC R0,50$ ;try to open with read only...
78
MOVL BDFFAB+FAB$L_STV,@12(AP) ;return IOCHAN
79
MOVL BDFNAM+NAM$W_FID,@16(AP) ;return FILEIDA
80
MOVW BDFNAM+NAM$W_FID+4,@20(AP) ;return FILEIDB
81
MOVAL BDFNAM+NAM$T_DVI,R0 ;move to DEVICE string
94
20$: MOVL BDFFAB+FAB$L_STS,@28(AP) ;return STATUS
99
50$: MOVL 04(AP),BDFFABR+FAB$L_FNA ;addr of NAME string
100
MOVB 08(AP),BDFFABR+FAB$B_FNS ;size of NAME string
102
$OPEN FAB=BDFFABR ;attempt to open file
103
BLBC R0,60$ ;abort if open failed
105
MOVL BDFFABR+FAB$L_STV,@12(AP) ;return IOCHAN
106
MOVL BDFNAM+NAM$W_FID,@16(AP) ;return FILEIDA
107
MOVW BDFNAM+NAM$W_FID+4,@20(AP) ;return FILEIDB
108
MOVAL BDFNAM+NAM$T_DVI,R0 ;move to DEVICE string
121
60$: MOVL BDFFABR+FAB$L_STS,@28(AP) ;return STATUS