2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
7 #include <aros/debug.h>
8 #include "iffparse_intern.h"
10 /*****************************************************************************
13 #include <proto/iffparse.h>
15 AROS_LH1(struct ContextNode
*, FindPropContext
,
18 AROS_LHA(struct IFFHandle
*, iff
, A0
),
21 struct Library
*, IFFParseBase
, 28, IFFParse
)
24 Finds the proper context in which to store a property.
25 If we have installed a property entry handler via PropChunk()
26 and such a property chunk (for example id is "CMAP" and type is "ILBM"
27 inside a form, then the storedproperty will be stored in the enclosing
28 FORM chink. If the chunk was inside a PROP chunk inside a LIST, then
29 the storedproperty would be installed in the LIST context.
32 iff - pointer to IFFHandle struct.
35 cn - pointer to contextnode where the property might be installed, or
36 NULL if no such context exists.
39 This function is most for internal use.
46 ParentChunk(), CurrentChunk(), StoreItemInContext(), PropChunk()
50 *****************************************************************************/
54 struct ContextNode
*node
;
56 D(bug ("FindPropContext (iff=%p)\n", iff
));
60 /* Start at the parent of the top node */
63 DB2(bug(" node=%p (%c%c%c%c)\n",
68 /* If this node is a FORM or a LIST, then we have acorrect property */
69 if ( (node
->cn_ID
== ID_FORM
) || (node
->cn_ID
== ID_LIST
) )
70 ReturnPtr ("FindPropContext",struct ContextNode
*,node
);
73 while ((node
= ParentChunk(node
) ));
75 /* No proper context found */
76 ReturnPtr ("FindPropContext",struct ContextNode
*,NULL
);
78 } /* FindPropContext */