2 Copyright © 1995-2004, 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 *****************************************************************************/
53 AROS_LIBBASE_EXT_DECL(struct Library
*,IFFParseBase
)
55 struct ContextNode
*node
;
57 D(bug ("FindPropContext (iff=%p)\n", iff
));
61 /* Start at the parent of the top node */
64 DB2(bug(" node=%p (%c%c%c%c)\n",
69 /* If this node is a FORM or a LIST, then we have acorrect property */
70 if ( (node
->cn_ID
== ID_FORM
) || (node
->cn_ID
== ID_LIST
) )
71 ReturnPtr ("FindPropContext",struct ContextNode
*,node
);
74 while ((node
= ParentChunk(node
) ));
76 /* No proper context found */
77 ReturnPtr ("FindPropContext",struct ContextNode
*,NULL
);
79 } /* FindPropContext */