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 * openiff.c - open an existing IFF
18 /****** c_iff/OpenIFF *******************************************************
21 * OpenIFF -- Open an existing IFF-file for reading
24 * TheHandle = NewIFF( Name )
26 * struct IFFHandle *NewIFF( char * )
29 * This is your function, if you want to read an existing IFF-file.
30 * It opens the existing file, allocates the IFFHandle and reads
31 * and confirms the IFF-header.
34 * Name - name of the IFF-file to be opened
37 * TheHandle - IFFHandle to read from
42 * IFF-files opened with OpenIFF() must be closed with CloseIFF() .
49 *****************************************************************************
54 struct IFFHandle
*OpenIFF(char *Name
)
56 struct IFFHandle
*Ret
;
63 Ret
=(struct IFFHandle
*) malloc(sizeof(struct IFFHandle
));
70 Ret
->TheFile
=fopen(Name
, "rb");
85 Ret
->ChunkID
=INVALID_ID
;
86 Ret
->BytesLeftInChunk
=0;