src/Commands.cpp
static bool findEntryAndPrint(std::FILE *hashfile, long offset, std::size_t blocksReadSoFar, std::size_t blockCount) {
	std::cout << "Reading entry in offset " << offset << '\n';
	
	if (!std::fseek(hashfile, offset, SEEK_SET)) {
		EntryBlock e;
		
		if (std::fread(reinterpret_cast<char*>(&e), sizeof(e), 1, hashfile) && e.var.valid) {
			++blocksReadSoFar; // +1 because the entry block has been read
			
			foundEntryMessage(e.var, blocksReadSoFar, blockCount);
			return true;
		}
		else {
			std::cout << "Read failure. ";
		}
	}
	else {
		std::cout << "Seek failure (" << offset << "). ";
	}
	
	return false;
}
//! Function that seeks an entry by offset in the hashfile and prints it if successful
/*!
 * In case of failure, it'll inform you
 *
 * @param hashfile File pointer to the hashfile
 * @param offset Entry offset
 * @param blocksReadSoFar Blocks read so far
 * @param blockCount Blocks in the file
 *
 * @return True in case of success, false otherwise
 */
Function that seeks an entry by offset in the hashfile and prints it if successful
In case of failure, it'll inform you

@param hashfile File pointer to the hashfile
@param offset Entry offset
@param blocksReadSoFar Blocks read so far
@param blockCount Blocks in the file

@return True in case of success, false otherwise
Function that seeks an entry by offset in the hashfile and prints it if successful In case of failure it ' ll inform you @param hashfile File pointer to the hashfile @param offset Entry offset @param blocksReadSoFar Blocks read so far @param blockCount Blocks in the file @return True in case of success false otherwise
static bool findEntryAndPrint(std::FILE *hashfile, long offset, std::size_t blocksReadSoFar, std::size_t blockCount) {
	std::cout << "Reading entry in offset " << offset << '\n';
	if (!std::fseek(hashfile, offset, SEEK_SET)) {
		EntryBlock e;
		if (std::fread(reinterpret_cast<char*>(&e), sizeof(e), 1, hashfile) && e.var.valid) {
			++blocksReadSoFar; 
			foundEntryMessage(e.var, blocksReadSoFar, blockCount);
			return true;
		}
		else {
			std::cout << "Read failure. ";
		}
	}
	else {
		std::cout << "Seek failure (" << offset << "). ";
	}
	return false;
}
static bool findEntryAndPrint ( std :: FILE * hashfile , long offset , std :: size_t blocksReadSoFar , std :: size_t blockCount ) { std :: cout << " " << offset << ' \n ' ; if ( ! std :: fseek ( hashfile , offset , SEEK_SET ) ) { EntryBlock e ; if ( std :: fread ( reinterpret_cast < char * > ( & e ) , sizeof ( e ) , 1 , hashfile ) && e . var . valid ) { ++ blocksReadSoFar ; foundEntryMessage ( e . var , blocksReadSoFar , blockCount ) ; return true ; } else { std :: cout << " " ; } } else { std :: cout << " " << offset << " " ; } return false ; }
Function that seeks an entry by offset in the hashfile and prints it if successful
 In case of failure, it'll inform you
Function that seeks an entry by offset in the hashfile and prints it if successful In case of failure it ' ll inform you
// +1 because the entry block has been read