MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / adfReadBitmapBlock

Function adfReadBitmapBlock

dep/adflib/src/adf_bitm.c:443–462  ·  view source on GitHub ↗

* adfReadBitmapBlock * * ENDIAN DEPENDENT */

Source from the content-addressed store, hash-verified

441 * ENDIAN DEPENDENT
442 */
443RETCODE
444adfReadBitmapBlock(struct Volume* vol, SECTNUM nSect, struct bBitmapBlock* bitm)
445{
446 uint8_t buf[LOGICAL_BLOCK_SIZE];
447
448/*printf("bitmap %ld\n",nSect);*/
449 if (adfReadBlock(vol, nSect, buf)!=RC_OK)
450 return RC_ERROR;
451
452 memcpy(bitm, buf, LOGICAL_BLOCK_SIZE);
453#ifdef LITT_ENDIAN
454 /* big to little = 68000 to x86 */
455 swapEndian((uint8_t*)bitm, SWBL_BITMAP);
456#endif
457
458 if (bitm->checkSum!=adfNormalSum(buf,0,LOGICAL_BLOCK_SIZE))
459 (*adfEnv.wFct)("adfReadBitmapBlock : invalid checksum");
460
461 return RC_OK;
462}
463
464
465/*

Callers 1

adfReadBitmapFunction · 0.85

Calls 3

adfReadBlockFunction · 0.85
swapEndianFunction · 0.85
adfNormalSumFunction · 0.85

Tested by

no test coverage detected