Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / iffparse / findcollection.c
blobec175f4028a1bf0f4bdefbac075671fb7edfda5a
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 CollectionItem *, FindCollection,
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, 27, IFFParse)
23 /* FUNCTION
24 Returns a pointer to a list of CollectionItems the installed
25 CollectionChunk of that type and ID.
27 INPUTS
28 iff - pointer to an IFFHandle struct.
29 type - type code to search for.
30 id - id code to search for.
33 RESULT
34 ci - pointer to the last collection chunk encountered
35 with pointers to previous ones.
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
44 CollectionChunk(), CollectionChunks()
46 INTERNALS
48 *****************************************************************************/
50 AROS_LIBFUNC_INIT
52 struct LocalContextItem *lci;
54 DEBUG_FINDCOLLECTION(dprintf("FindCollection: iff 0x%lx type 0x%08lx (%c%c%c%c) id 0x%08lx (%c%c%c%c)\n",
55 iff, type, dmkid(type), id, dmkid(id)));
57 if (!(lci = FindLocalItem(
58 iff,
59 type,
60 id,
61 IFFLCI_COLLECTION)))
63 DEBUG_FINDCOLLECTION(dprintf("FindCollection: return NULL\n"));
64 return NULL;
67 /* The userdata of the found LCI contains a struct CIPtr,
68 which is just a pointer to the first CollectionItem */
70 return
72 ((struct CIPtr*)LocalItemData(lci) )->FirstCI
76 AROS_LIBFUNC_EXIT
77 } /* FindCollection */