* adfWriteDirBlock * */
| 1037 | * |
| 1038 | */ |
| 1039 | RETCODE 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 |
no test coverage detected