* adfReadFileExtBlock * */
| 722 | * |
| 723 | */ |
| 724 | RETCODE adfReadFileExtBlock(struct Volume *vol, SECTNUM nSect, struct bFileExtBlock* fext) |
| 725 | { |
| 726 | uint8_t buf[sizeof(struct bFileExtBlock)]; |
| 727 | RETCODE rc = RC_OK; |
| 728 | |
| 729 | adfReadBlock(vol, nSect,buf); |
| 730 | /*printf("read fext=%d\n",nSect);*/ |
| 731 | memcpy(fext,buf,sizeof(struct bFileExtBlock)); |
| 732 | #ifdef LITT_ENDIAN |
| 733 | swapEndian((uint8_t*)fext, SWBL_FEXT); |
| 734 | #endif |
| 735 | if (fext->checkSum!=adfNormalSum(buf,20,sizeof(struct bFileExtBlock))) |
| 736 | (*adfEnv.wFct)("adfReadFileExtBlock : invalid checksum"); |
| 737 | if (fext->type!=T_LIST) |
| 738 | (*adfEnv.wFct)("adfReadFileExtBlock : type T_LIST not found"); |
| 739 | if (fext->secType!=ST_FILE) |
| 740 | (*adfEnv.wFct)("adfReadFileExtBlock : stype ST_FILE not found"); |
| 741 | if (fext->headerKey!=nSect) |
| 742 | (*adfEnv.wFct)("adfReadFileExtBlock : headerKey!=nSect"); |
| 743 | if (fext->highSeq<0 || fext->highSeq>MAX_DATABLK) |
| 744 | (*adfEnv.wFct)("adfReadFileExtBlock : highSeq out of range"); |
| 745 | if ( !isSectNumValid(vol, fext->parent) ) |
| 746 | (*adfEnv.wFct)("adfReadFileExtBlock : parent out of range"); |
| 747 | if ( fext->extension!=0 && !isSectNumValid(vol, fext->extension) ) |
| 748 | (*adfEnv.wFct)("adfReadFileExtBlock : extension out of range"); |
| 749 | |
| 750 | return rc; |
| 751 | } |
| 752 | |
| 753 | |
| 754 | /* |
no test coverage detected