2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
6 #include "iffparse_intern.h"
8 /*****************************************************************************
11 #include <proto/iffparse.h>
13 AROS_LH0(struct IFFHandle
*, AllocIFF
,
19 struct Library
*, IFFParseBase
, 5, IFFParse
)
22 Allocates an IFFHandle struct.
28 An unitialized IFFHandle structure.
31 The default context-node is created in AllocIFF() and persists until
42 Since the default contextnode persistes from AllocIFF until FreeIFF, it
43 is built-in into the internal IFFHandle structure
45 *****************************************************************************/
49 struct IntIFFHandle
*intiff
;
51 DEBUG_ALLOCIFF(dprintf("AllocIff: entry\n"));
53 if ( (intiff
=(struct IntIFFHandle
*)AllocMem (sizeof(struct IntIFFHandle
),
58 GetIH(intiff
)->iff_Flags
= (0L|IFFF_READ
);
61 /* No need for buffering yet */
62 intiff
->iff_BufferStartDepth
= 0;
64 /* Initialize the context-stack list */
65 NewList ((struct List
*)&(intiff
->iff_CNStack
));
68 /* Initialize the default context node */
69 NewList ((struct List
*)&(intiff
->iff_DefaultCN
.cn_LCIList
));
71 /* And add it to the stack */
74 (struct List
*)&(intiff
->iff_CNStack
),
75 (struct Node
*)&(intiff
->iff_DefaultCN
)
78 /* Depth is 0 even if we have a default contextnode */
79 GetIH(intiff
)->iff_Depth
= 0;
83 DEBUG_ALLOCIFF(dprintf("AllocIff: return %p\n", intiff
));
84 return ((struct IFFHandle
*)intiff
);