* adfWriteDirCblock * */
| 589 | * |
| 590 | */ |
| 591 | RETCODE 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 | /*################################################################################*/ |
no test coverage detected