* adfReadDirCBlock * */
| 563 | * |
| 564 | */ |
| 565 | RETCODE adfReadDirCBlock(struct Volume *vol, SECTNUM nSect, struct bDirCacheBlock *dirc) |
| 566 | { |
| 567 | uint8_t buf[512]; |
| 568 | |
| 569 | if (adfReadBlock(vol, nSect, buf)!=RC_OK) |
| 570 | return RC_ERROR; |
| 571 | |
| 572 | memcpy(dirc,buf,512); |
| 573 | #ifdef LITT_ENDIAN |
| 574 | swapEndian((uint8_t*)dirc,SWBL_CACHE); |
| 575 | #endif |
| 576 | if (dirc->checkSum!=adfNormalSum(buf,20,512)) |
| 577 | (*adfEnv.wFct)("adfReadDirCBlock : invalid checksum"); |
| 578 | if (dirc->type!=T_DIRC) |
| 579 | (*adfEnv.wFct)("adfReadDirCBlock : T_DIRC not found"); |
| 580 | if (dirc->headerKey!=nSect) |
| 581 | (*adfEnv.wFct)("adfReadDirCBlock : headerKey!=nSect"); |
| 582 | |
| 583 | return RC_OK; |
| 584 | } |
| 585 | |
| 586 | |
| 587 | /* |
no test coverage detected