rdadb

RdADB -- read one ADB

BOOL rdadb(adb_id,buffer)

ADB_CNTRL_BLOCK *adb_id

ADB *buffer ;

PURPOSE

Reads one ADB from the input ADB set specified in adb_id into buffer.

INPUTS

adb_id

pointer to ADB control block

OUTPUTS

buffer

ADB

true if it was successful, false otherwise.

PARACODE

BOOL rdadbd(adb_id,buffer) while there is more to return while not a new_entry or at the last byte of the ADB if the next_block of the ADB can be read then set next_block to the address of the next_block to be read else return NO return YES

CODE

/* FILE: RDADB.C */ #include #include "air.h" BOOLE rdadb(adb_id,buffer) ADB_CNTRL_BLOCK *adb_id ; char *buffer ; { BOOLE fulADB() ; int length ; /* number of bytes in buffer */ length = 0 ; do if (fread(buffer+length,ADB_DISK_BLOCK_SIZE,1,adb_id->file_id)) length += ADB_DISK_BLOCK_SIZE ; else return(NO) ; while (!fulADB(buffer,length)) ; return(YES) ; }