New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / workbench / libs / iffparse / findpropcontext.c
blobdf1b8a224a4f16af17c87f5dcaacacf8d52f21c2
1 /*
2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
8 #include "iffparse_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <proto/iffparse.h>
15 AROS_LH1(struct ContextNode *, FindPropContext,
17 /* SYNOPSIS */
18 AROS_LHA(struct IFFHandle *, iff, A0),
20 /* LOCATION */
21 struct Library *, IFFParseBase, 28, IFFParse)
23 /* FUNCTION
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.
31 INPUTS
32 iff - pointer to IFFHandle struct.
34 RESULT
35 cn - pointer to contextnode where the property might be installed, or
36 NULL if no such context exists.
38 NOTES
39 This function is most for internal use.
41 EXAMPLE
43 BUGS
45 SEE ALSO
46 ParentChunk(), CurrentChunk(), StoreItemInContext(), PropChunk()
48 INTERNALS
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
53 AROS_LIBBASE_EXT_DECL(struct Library *,IFFParseBase)
55 struct ContextNode *node;
57 D(bug ("FindPropContext (iff=%p)\n", iff));
59 node = TopChunk(iff);
61 /* Start at the parent of the top node */
64 DB2(bug(" node=%p (%c%c%c%c)\n",
65 node,
66 dmkid(node->cn_ID)
67 ));
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);
78 AROS_LIBFUNC_EXIT
79 } /* FindPropContext */