revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / iffparse / findprop.c
blobe9886ca901f03942972f36c028f2b57f15f5c8a0
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "iffparse_intern.h"
8 /*****************************************************************************
10 NAME */
11 #include <proto/iffparse.h>
13 AROS_LH3(struct StoredProperty *, FindProp,
15 /* SYNOPSIS */
16 AROS_LHA(struct IFFHandle *, iff, A0),
17 AROS_LHA(LONG , type, D0),
18 AROS_LHA(LONG , id, D1),
20 /* LOCATION */
21 struct Library *, IFFParseBase, 26, IFFParse)
23 /* FUNCTION
24 Searches for a StoredProperty that is valid in the given context.
25 Property chunks are automatically stored by ParseIFF() when pre-declared
26 by PropChunk() or PropChunks(). The returned storedproperty contains
27 a pointer to the data in the chunk.
29 INPUTS
30 iff - a pointer to a an IFFHandle struct.
31 type - type code of property to search for.
32 id - id code of property to search for.
34 RESULT
35 sp - pointer to a storedproperty if found, NULL if none are found.
37 NOTES
39 EXAMPLE
41 BUGS
44 SEE ALSO
45 PropChunk(), PropChunks()
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 struct LocalContextItem *lci;
55 DEBUG_FINDPROP(dprintf("FindProp: iff 0x%lx type 0x%08lx (%c%c%c%c) id 0x%08lx (%c%c%c%c)\n",
56 iff, type, dmkid(type), id, dmkid(id)));
58 if (!(lci = FindLocalItem(
59 iff,
60 type,
61 id,
62 IFFLCI_PROP)))
64 DEBUG_FINDPROP(dprintf("FindProp: reuturn NULL\n"));
65 return NULL;
68 /* The userdata of the found LCI is the StoredProperty */
70 return ( LocalItemData(lci) );
72 AROS_LIBFUNC_EXIT
73 } /* FindProp */