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

Function adfWriteDirBlock

dep/adflib/src/adf_dir.c:1039–1062  ·  view source on GitHub ↗

* adfWriteDirBlock * */

Source from the content-addressed store, hash-verified

1037 *
1038 */
1039RETCODE adfWriteDirBlock(struct Volume* vol, SECTNUM nSect, struct bDirBlock *dir)
1040{
1041 uint8_t buf[512];
1042 uint32_t newSum;
1043
1044
1045/*printf("wdirblk=%d\n",nSect);*/
1046 dir->type = T_HEADER;
1047 dir->highSeq = 0;
1048 dir->hashTableSize = 0;
1049 dir->secType = ST_DIR;
1050
1051 memcpy(buf, dir, sizeof(struct bDirBlock));
1052#ifdef LITT_ENDIAN
1053 swapEndian(buf, SWBL_DIR);
1054#endif
1055 newSum = adfNormalSum(buf,20,sizeof(struct bDirBlock));
1056 swLong(buf+20, newSum);
1057
1058 if (adfWriteBlock(vol, nSect, buf)!=RC_OK)
1059 return RC_ERROR;
1060
1061 return RC_OK;
1062}
1063
1064
1065

Callers 5

adfRenameEntryFunction · 0.85
adfSetEntryCommentFunction · 0.85
adfSetEntryAccessFunction · 0.85
adfCreateEntryFunction · 0.85
adfCreateDirFunction · 0.85

Calls 4

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

Tested by

no test coverage detected