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_LH4(struct LocalContextItem
*, FindLocalItem
,
18 AROS_LHA(struct IFFHandle
*, iff
, A0
),
19 AROS_LHA(LONG
, type
, D0
),
20 AROS_LHA(LONG
, id
, D1
),
21 AROS_LHA(LONG
, ident
, D2
),
24 struct Library
*, IFFParseBase
, 35, IFFParse
)
27 Goes through the whole context node stack starting at the top
28 searching the contecnodes for attached LocalContextItems with the
29 specified type, id and ident codes.
32 iff - pointer to an IFFHandle struct.
33 type - type code for item to find.
34 id - identifier code for item to find.
35 ident - ident code for the class of context item to find.
38 lci - pointer to a local context item if found, or NULL if
52 *****************************************************************************/
55 struct IntContextNode
*cn_node
,
57 struct LocalContextItem
*lci_node
,
62 DEBUG_FINDLOCALITEM(dprintf("FindLocalItem: iff 0x%lx type 0x%08lx (%c%c%c%c) id 0x%08lx (%c%c%c%c) ident 0x%08lx (%c%c%c%c)\n",
63 iff
, type
, dmkid(type
), id
, dmkid(id
), ident
, dmkid(ident
)));
65 D(bug("FindLocalItem (iff=%p, type=%c%c%c%c, id=%c%c%c%c, ident=%c%c%c%c)\n",
72 /* Get contextnode at top */
73 cn_node
= (struct IntContextNode
*)TopChunk(iff
);
75 while ((cn_nextnode
= (struct IntContextNode
*)cn_node
->CN
.cn_Node
.mln_Succ
))
80 DB2(bug(" node=%p (%c%c%c%c)\n",
82 dmkid(cn_node
->CN
.cn_Type
)
87 DB2(bug(" node=%p (----)\n", cn_node
));
91 /* Get LCI at top inside contextnode */
92 lci_node
= (struct LocalContextItem
*)cn_node
->cn_LCIList
.mlh_Head
;
94 while ((lci_nextnode
= (struct LocalContextItem
*)lci_node
->lci_Node
.mln_Succ
))
99 DB2(bug(" lci_node=%p (%c%c%c%c, %c%c%c%c, %c%c%c%c)\n",
101 dmkid(lci_node
->lci_Type
),
102 dmkid(lci_node
->lci_ID
),
103 dmkid(lci_node
->lci_Ident
)
108 DB2(bug(" lci_node=%p (----, ----, ----)\n",
114 /* Do we have a match ? */
117 (lci_node
->lci_Type
== type
)
119 (lci_node
->lci_ID
== id
)
121 (lci_node
->lci_Ident
== ident
)
123 ReturnPtr ("FindLocalItem",struct LocalContextItem
*,lci_node
);
125 lci_node
= lci_nextnode
;
128 cn_node
= cn_nextnode
;
131 ReturnPtr ("FindLocalItem",struct LocalContextItem
*,NULL
);
133 } /* FindLocalItem */