* adfWriteFileHdrBlock * */
| 201 | * |
| 202 | */ |
| 203 | RETCODE adfWriteFileHdrBlock(struct Volume *vol, SECTNUM nSect, struct bFileHeaderBlock* fhdr) |
| 204 | { |
| 205 | uint8_t buf[512]; |
| 206 | uint32_t newSum; |
| 207 | RETCODE rc = RC_OK; |
| 208 | /*printf("adfWriteFileHdrBlock %ld\n",nSect);*/ |
| 209 | fhdr->type = T_HEADER; |
| 210 | fhdr->dataSize = 0; |
| 211 | fhdr->secType = ST_FILE; |
| 212 | |
| 213 | memcpy(buf, fhdr, sizeof(struct bFileHeaderBlock)); |
| 214 | #ifdef LITT_ENDIAN |
| 215 | swapEndian(buf, SWBL_FILE); |
| 216 | #endif |
| 217 | newSum = adfNormalSum(buf,20,sizeof(struct bFileHeaderBlock)); |
| 218 | swLong(buf+20, newSum); |
| 219 | /* *(uint32_t*)(buf+20) = swapLong((uint8_t*)&newSum);*/ |
| 220 | |
| 221 | adfWriteBlock(vol, nSect, buf); |
| 222 | |
| 223 | return rc; |
| 224 | } |
| 225 | |
| 226 | |
| 227 | /* |
no test coverage detected