static uint SrcRead( void ) { //=============================== uint len; file_handle fp; char msg[81]; fp = CurrFile->fileptr; if( CurrFile->flags & INC_LIB_MEMBER ) { len = LibRead( fp ); if( LibEof( fp ) ) { ProgSw |= PS_INC_EOF; } else if( LibError( fp, msg ) ) { InfoError( SM_IO_READ_ERR, CurrFile->name, msg ); ProgSw |= PS_INC_EOF; } } else { len = SDRead( fp, SrcBuff, SRCLEN ); if( SDEof( fp ) ) { ProgSw |= PS_INC_EOF; } else if( SDError( fp, msg ) ) { InfoError( SM_IO_READ_ERR, CurrFile->name, msg ); ProgSw |= PS_INC_EOF; } } return( len ); }
bool LibEof( lib_handle lp ) { //=============================== // Check for EOF on library read (source only). return( SDEof( lp ) ); }
static void LoadPage( unsigned_16 page ) { //============================================ // Load a page into memory. if( page != CurrPage ) { DumpCurrPage(); SDSeek( PageFile, page, PAGE_SIZE ); ChkIOErr( PageFile, SM_IO_READ_ERR ); SDRead( PageFile, ObjCode, PAGE_SIZE ); // If we seek to the end of the last page in the disk // file (which is the start of a non-existent page file), // we will get end-of-file when we do the read. if( !SDEof( PageFile ) ) { ChkIOErr( PageFile, SM_IO_READ_ERR ); } CurrPage = page; PageFlags = PF_INIT; } }