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

Function TranslateHashTable

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

Source from the content-addressed store, hash-verified

858}
859
860static TMPQHash * TranslateHashTable(
861 TMPQArchive * ha,
862 ULONGLONG * pcbTableSize)
863{
864 TMPQHash * pHashTable;
865 size_t HashTableSize;
866
867 // Allocate copy of the hash table
868 pHashTable = STORM_ALLOC(TMPQHash, ha->pHeader->dwHashTableSize);
869 if(pHashTable != NULL)
870 {
871 // Copy the hash table
872 HashTableSize = sizeof(TMPQHash) * ha->pHeader->dwHashTableSize;
873 memcpy(pHashTable, ha->pHashTable, HashTableSize);
874
875 // Give the size to the caller
876 if(pcbTableSize != NULL)
877 {
878 *pcbTableSize = (ULONGLONG)HashTableSize;
879 }
880 }
881
882 return pHashTable;
883}
884
885// Also used in SFileGetFileInfo
886TMPQBlock * TranslateBlockTable(

Callers 1

SaveMPQTablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected