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

Function ParseFile_CdnConfig

src/External/CascLib/src/CascFiles.cpp:793–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

791}
792
793static DWORD ParseFile_CdnConfig(TCascStorage * hs, void * pvListFile)
794{
795 const char * szLineBegin;
796 const char * szLineEnd;
797 DWORD dwErrCode = ERROR_SUCCESS;
798
799 // Keep parsing the listfile while there is something in there
800 for(;;)
801 {
802 // Get the next line
803 if(!ListFile_GetNextLine(pvListFile, &szLineBegin, &szLineEnd))
804 break;
805
806 // CDN key of ARCHIVE-GROUP. Archive-group is actually a very special '.index' file.
807 // It is essentially a merger of all .index files, with a structure change
808 // When ".index" added after the ARCHIVE-GROUP, we get file name in "indices" folder
809 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "archive-group", LoadQueryKey, &hs->ArchiveGroup))
810 continue;
811
812 // CDN key of all archives. When ".index" added to the string, we get file name in "indices" folder
813 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "archives", LoadQueryKey, &hs->ArchivesKey))
814 continue;
815
816 // CDN keys of patch archives (needs research)
817 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "patch-archives", LoadQueryKey, &hs->PatchArchivesKey))
818 continue;
819
820 // CDN key of probably the combined patch index file (needs research)
821 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "patch-archive-group", LoadQueryKey, &hs->PatchArchivesGroup))
822 continue;
823
824 // List of build configs this config supports (optional)
825 // Points to file: "data\config\%02X\%02X\%s
826 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "builds", LoadQueryKey, &hs->BuildFiles))
827 continue;
828 }
829
830 // Check if all required fields are present
831 if(hs->ArchivesKey.pbData == NULL || hs->ArchivesKey.cbData == 0)
832 return ERROR_BAD_FORMAT;
833
834 return dwErrCode;
835}
836
837static DWORD ParseFile_CdnBuild(TCascStorage * hs, void * pvListFile)
838{

Callers

nothing calls this directly

Calls 2

ListFile_GetNextLineFunction · 0.85
CheckConfigFileVariableFunction · 0.85

Tested by

no test coverage detected