2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
6 #include "iffparse_intern.h"
8 /*****************************************************************************
11 #include <proto/iffparse.h>
13 AROS_LH1(struct ContextNode
*, ParentChunk
,
16 AROS_LHA(struct ContextNode
*, contextNode
, A0
),
19 struct Library
*, IFFParseBase
, 30, IFFParse
)
22 Returns a pointer to the parent context node to the given
23 one on the context node stack. The parent context node
24 represents the chunk enclosing the chunk given.
25 This can be use together with CurrentChunk() to iterate the
26 context node stack top-down.
29 contextNode - pointer to a context node.
32 parent - pointer to the parent context node or NULL if none.
45 *****************************************************************************/
48 AROS_LIBBASE_EXT_DECL(struct Library
*,IFFParseBase
)
50 struct ContextNode
*parentcn
;
54 /* Get the parent of this contextnode. The contextstack
55 is simulated via AddHead/RemHead so we should use
56 .mln_Succ to get the parent
58 parentcn
= (struct ContextNode
*)contextNode
->cn_Node
.mln_Succ
;
60 /* If the parent of the found node is 0 (mlh_Tail field
61 in struct MinList, then parentcn is the default contextnode,
62 which the user not should have access to
65 if (!parentcn
->cn_Node
.mln_Succ
)