MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Load_FindChunk

Function Load_FindChunk

src/load.c:30–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29
30static uint32 Load_FindChunk(FILE *fp, uint32 chunk)
31{
32 uint32 header;
33 uint32 length;
34
35 while (fread(&header, sizeof(uint32), 1, fp) == 1) {
36 if (fread(&length, sizeof(uint32), 1, fp) != 1) return 0;
37 length = BETOH32(length);
38 if (BETOH32(header) != chunk) {
39 fseek(fp, length + (length & 1), SEEK_CUR);
40 continue;
41 }
42 return length;
43 }
44 return 0;
45}
46
47static bool Load_Main(FILE *fp)
48{

Callers 1

Load_MainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected