MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / GetNextFindData

Function GetNextFindData

src/External/CascLib/test/CascTest.cpp:505–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505static PCASC_FIND_DATA GetNextFindData(PCASC_FIND_DATA_ARRAY pFiles)
506{
507 TLogHelper * pLogHelper = pFiles->pLogHelper;
508 DWORD ItemIndex;
509
510 // Atomically increment the value in the file array
511 ItemIndex = CascInterlockedIncrement(&pFiles->ItemIndex) - 1;
512 if(ItemIndex < pFiles->ItemCount)
513 {
514 if(pLogHelper->TimeElapsed(1000))
515 pLogHelper->PrintProgress("Extracting file %u of %u", ItemIndex, pFiles->ItemCount);
516 return &pFiles->cf[ItemIndex];
517 }
518
519 // If we overflowed the total number of files, it means that we are done
520 return NULL;
521}
522
523static DWORD WINAPI Worker_ExtractFiles(PCASC_FIND_DATA_ARRAY pFiles)
524{

Callers 1

Worker_ExtractFilesFunction · 0.85

Calls 3

CascInterlockedIncrementFunction · 0.85
TimeElapsedMethod · 0.80
PrintProgressMethod · 0.80

Tested by

no test coverage detected