MCPcopy Create free account
hub / github.com/diasurgical/devilution / DoMPQSearch_HashTable

Function DoMPQSearch_HashTable

3rdParty/StormLib/src/SFileFindFile.cpp:290–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290static int DoMPQSearch_HashTable(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData, TMPQArchive * ha)
291{
292 TMPQHash * pHashTableEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
293 TMPQHash * pHash;
294
295 // Parse the file table
296 for(pHash = ha->pHashTable + hs->dwNextIndex; pHash < pHashTableEnd; pHash++)
297 {
298 // Increment the next index for subsequent search
299 hs->dwNextIndex++;
300
301 // Does this hash table entry point to a proper block table entry?
302 if(IsValidHashEntry(ha, pHash))
303 {
304 // Check if this file entry should be included in the search result
305 if(DoMPQSearch_FileEntry(hs, lpFindFileData, ha, pHash, ha->pFileTable + MPQ_BLOCK_INDEX(pHash)))
306 return ERROR_SUCCESS;
307 }
308 }
309
310 // No more files
311 return ERROR_NO_MORE_FILES;
312}
313
314static int DoMPQSearch_FileTable(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData, TMPQArchive * ha)
315{

Callers 1

DoMPQSearchFunction · 0.85

Calls 2

IsValidHashEntryFunction · 0.85
DoMPQSearch_FileEntryFunction · 0.85

Tested by

no test coverage detected