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

Function mpqapi_new_block

Source/mpqapi.cpp:382–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380}
381
382_BLOCKENTRY *mpqapi_new_block(int *block_index)
383{
384 _BLOCKENTRY *blockEntry;
385 DWORD i;
386
387 blockEntry = cur_archive.sgpBlockTbl;
388
389 i = 0;
390 while (blockEntry->offset || blockEntry->sizealloc || blockEntry->flags || blockEntry->sizefile) {
391 i++;
392 blockEntry++;
393 if (i >= 2048) {
394 app_fatal("Out of free block entries");
395 return NULL;
396 }
397 }
398 if (block_index)
399 *block_index = i;
400
401 return blockEntry;
402}
403
404int FetchHandle(const char *pszName)
405{

Callers 2

mpqapi_alloc_blockFunction · 0.85
mpqapi_add_fileFunction · 0.85

Calls 1

app_fatalFunction · 0.85

Tested by

no test coverage detected