BOOL inadb(adb_id,set_name)
unsigned char *set_name ;
ADB_CNTRL_BLOCK **adb_id ;
Opens the input ADB set specified by set_name and allocates an ADB control block for controlling the ADB set.
set_name
name of ADB set
adb_id
ADB control block for controlling the ADB set
true if the ADB set was opened successfully, false otherwise. If the result is true adb_id will be set to point to the ADB control block. Adb_id is undefined if the result is false.
BOOL inadb(adb_id,set_name) ADB_CNTRL_BLOCK **adb_id ; unsigned char *set_name ; create a new ADB_CNTRL_BLOCK adb_id is the ADB_CNTRL_BLOCK for the ADB set ADB mode = input IF the name of the ADB cannot be set THEN return NO IF the ADB is a tape ADB THEN set the file identification to 0 get the length of the name return ( (qioasn(name, length, channel) AND (qiogef(event_flag_1) ) ELSE set the channel to 0 set the event_flag to 0 set the file identification = open(name, READ, ADB_DISK_BLOCK_SIZE) return (file_identification >= 0)
/* FILE: INADB.C */ #include #include #include "air.h" BOOLE inadb(adb_id,set_name) ADB_CNTRL_BLOCK **adb_id ; unsigned char *set_name ; { ADB_CNTRL_BLOCK *temp_adb_id ; temp_adb_id = (ADB_CNTRL_BLOCK *)malloc(ADB_CB_SIZE) ; *adb_id = temp_adb_id ; temp_adb_id->set_name = set_name; temp_adb_id->output = NO ; if (!(temp_adb_id->file_id = fopen(temp_adb_id->set_name,"rb"))) return(NO) ; return(YES) ; }