MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / adfWriteFileHdrBlock

Function adfWriteFileHdrBlock

dep/adflib/src/adf_file.c:203–224  ·  view source on GitHub ↗

* adfWriteFileHdrBlock * */

Source from the content-addressed store, hash-verified

201 *
202 */
203RETCODE 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/*

Callers 6

adfFlushFileFunction · 0.85
adfRenameEntryFunction · 0.85
adfSetEntryCommentFunction · 0.85
adfSetEntryAccessFunction · 0.85
adfCreateEntryFunction · 0.85
adfCreateFileFunction · 0.85

Calls 4

swapEndianFunction · 0.85
adfNormalSumFunction · 0.85
swLongFunction · 0.85
adfWriteBlockFunction · 0.85

Tested by

no test coverage detected