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

Function GetHashEntryExact

3rdParty/StormLib/src/SBaseFileTable.cpp:657–675  ·  view source on GitHub ↗

Returns a hash table entry in the following order: 1) A hash table entry with the preferred locale 2) NULL

Source from the content-addressed store, hash-verified

655// 1) A hash table entry with the preferred locale
656// 2) NULL
657static TMPQHash * GetHashEntryExact(TMPQArchive * ha, const char * szFileName, LCID lcLocale)
658{
659 TMPQHash * pFirstHash = GetFirstHashEntry(ha, szFileName);
660 TMPQHash * pHash = pFirstHash;
661
662 // Parse the found hashes
663 while(pHash != NULL)
664 {
665 // If the locales match, return it
666 if(pHash->lcLocale == lcLocale)
667 return pHash;
668
669 // Get the next hash entry for that file
670 pHash = GetNextHashEntry(ha, pFirstHash, pHash);
671 }
672
673 // Not found
674 return NULL;
675}
676
677// Defragment the file table so it does not contain any gaps
678// Note: As long as all values of all TMPQHash::dwBlockIndex

Callers 2

GetFileEntryExactFunction · 0.85
AllocateFileEntryFunction · 0.85

Calls 2

GetFirstHashEntryFunction · 0.85
GetNextHashEntryFunction · 0.85

Tested by

no test coverage detected