MCPcopy Create free account
hub / github.com/Kenix3/libultraship / SFileAddArbitraryListFile

Function SFileAddArbitraryListFile

extern/StormLib/src/SFileListFile.cpp:532–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530}
531
532static DWORD SFileAddArbitraryListFile(
533 TMPQArchive * ha,
534 HANDLE hMpq,
535 const TCHAR * szListFile,
536 DWORD dwMaxSize)
537{
538 TListFileCache * pCache = NULL;
539
540 // Create the listfile cache for that file
541 pCache = CreateListFileCache(hMpq, szListFile, NULL, dwMaxSize, ha->dwFlags);
542 if(pCache != NULL)
543 {
544 char * szFileName;
545 size_t nLength = 0;
546
547 // Get the next line
548 while((szFileName = ReadListFileLine(pCache, &nLength)) != NULL)
549 {
550 // Add the line to the MPQ
551 if(nLength != 0)
552 SListFileCreateNodeForAllLocales(ha, szFileName);
553 }
554
555 // Delete the cache
556 FreeListFileCache(pCache);
557 }
558
559 return (pCache != NULL) ? ERROR_SUCCESS : ERROR_FILE_CORRUPT;
560}
561
562static DWORD SFileAddInternalListFile(
563 TMPQArchive * ha,

Callers 2

SFileAddInternalListFileFunction · 0.85
SFileAddListFileFunction · 0.85

Calls 4

CreateListFileCacheFunction · 0.85
ReadListFileLineFunction · 0.85
FreeListFileCacheFunction · 0.85

Tested by

no test coverage detected