.title dopen ; ; this routine implements the following fortran interface ; ; status = dopen(lun, dsc, dev, unt, fdb) ; ; where lun is the logical unit to use for this directory ; dsc is the data-set descriptor for the directory name ; dev is an integer to return the 2-char device mnemonic ; unt is an integer to return the device unit ; fdb has the fdb address returned in it for successful open ; ; status = OK if directory exists ; ERR if it does not exist ; .mcall fdop$r, fdof$l, nbof$l fdof$l nbof$l ap=%5 lun=2 dsc=4 dev=6 unt=10 fdb=12 ok=0 err=-3 dopen:: mov @lun(ap),r2 ; place lun in r2 for gtfdb call gtfdb ; get an fdb from the linked list tst r0 ; see if got one beq operr ; if == 0, no more left 10$: fdop$r ,@lun(ap) ; assign lun to this fdb mov r0,r1 ; fdb address in r1 add #f.fnb,r1 ; fnb address in r1 mov dsc(ap),r2 ; data-set descriptor address in r2 clr r3 ; no default name block call .parse ; parse the file name bcs retfdb ; if c set, then directory does not exist mov r0,@fdb(ap) ; return fdb address for future use mov n.dvnm(r1),@dev(ap) ; return the device-name mov n.unit(r1),@unt(ap) ; return the device-unit mov #ok,r0 ; return value of OK return retfdb: operr: mov #err,r0 ; return value of ERR return .end