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

Function adfWriteDirCBlock

dep/adflib/src/adf_cache.c:591–613  ·  view source on GitHub ↗

* adfWriteDirCblock * */

Source from the content-addressed store, hash-verified

589 *
590 */
591RETCODE adfWriteDirCBlock(struct Volume* vol, int32_t nSect, struct bDirCacheBlock* dirc)
592{
593 uint8_t buf[LOGICAL_BLOCK_SIZE];
594 uint32_t newSum;
595
596 dirc->type = T_DIRC;
597 dirc->headerKey = nSect;
598
599 memcpy(buf, dirc, LOGICAL_BLOCK_SIZE);
600#ifdef LITT_ENDIAN
601 swapEndian(buf, SWBL_CACHE);
602#endif
603
604 newSum = adfNormalSum(buf, 20, LOGICAL_BLOCK_SIZE);
605 swLong(buf+20,newSum);
606/* *(int32_t*)(buf+20) = swapLong((uint8_t*)&newSum);*/
607
608 if (adfWriteBlock(vol, nSect, buf)!=RC_OK)
609 return RC_ERROR;
610/*puts("adfWriteDirCBlock");*/
611
612 return RC_OK;
613}
614
615/*################################################################################*/

Callers 4

adfDelFromCacheFunction · 0.85
adfAddInCacheFunction · 0.85
adfUpdateCacheFunction · 0.85
adfCreateEmptyCacheFunction · 0.85

Calls 4

swapEndianFunction · 0.85
adfNormalSumFunction · 0.85
swLongFunction · 0.85
adfWriteBlockFunction · 0.85

Tested by

no test coverage detected