2 * c_iff - a portable IFF-parser
4 * Copyright (C) 2000, 2001 Joerg Dietrich
6 * This is the AROS-version of c_iff.
7 * It is distributed under the AROS Public License.
8 * But I reserve the right to distribute
9 * my own version under other licenses.
13 * fixiffsize.c - fix the size when closing the iff
18 /****** c_iff/FixIFFSize ****************************************************
21 * FixIFFSize -- Set the internal size of the IFF-file
24 * FixIFFSize( TheHandle )
26 * void FixIFFSize( struct IFFHandle * )
29 * This internal function is called shortly before closing the IFF-file.
30 * It fixes the internal size (offset 4) of the IFF-file.
33 * TheHandle - IFFHandle to fix
40 * This function ignores IFFHandles opened for reading.
47 *****************************************************************************
52 void FixIFFSize(struct IFFHandle
*TheHandle
)
61 if(!TheHandle
->NewIFF
)
66 if(fseek(TheHandle
->TheFile
, sizeof(uint32_t), SEEK_SET
))
71 Buffer
=TheHandle
->IFFSize
;
72 Buffer
=Swap32IfLE(Buffer
);
74 fwrite((void *) &Buffer
, sizeof(uint32_t), 1, TheHandle
->TheFile
);