1
0
mirror of https://github.com/deadw00d/AROS.git synced 2025-12-08 06:20:50 +00:00
Files
AROS-v0/workbench/libs/iffparse/findcollection.c
Matthias Rustler 6b5a534ce3 workbench: detabbed
2021-05-02 13:55:14 +02:00

77 lines
1.8 KiB
C

/*
Copyright (C) 1995-2007, The AROS Development Team. All rights reserved.
*/
#include "iffparse_intern.h"
/*****************************************************************************
NAME */
#include <proto/iffparse.h>
AROS_LH3(struct CollectionItem *, FindCollection,
/* SYNOPSIS */
AROS_LHA(struct IFFHandle *, iff, A0),
AROS_LHA(LONG , type, D0),
AROS_LHA(LONG , id, D1),
/* LOCATION */
struct Library *, IFFParseBase, 27, IFFParse)
/* FUNCTION
Returns a pointer to a list of CollectionItems the installed
CollectionChunk of that type and ID.
INPUTS
iff - pointer to an IFFHandle struct.
type - type code to search for.
id - id code to search for.
RESULT
ci - pointer to the last collection chunk encountered
with pointers to previous ones.
NOTES
EXAMPLE
BUGS
SEE ALSO
CollectionChunk(), CollectionChunks()
INTERNALS
*****************************************************************************/
{
AROS_LIBFUNC_INIT
struct LocalContextItem *lci;
DEBUG_FINDCOLLECTION(dprintf("FindCollection: iff 0x%lx type 0x%08lx (%c%c%c%c) id 0x%08lx (%c%c%c%c)\n",
iff, type, dmkid(type), id, dmkid(id)));
if (!(lci = FindLocalItem(
iff,
type,
id,
IFFLCI_COLLECTION)))
{
DEBUG_FINDCOLLECTION(dprintf("FindCollection: return NULL\n"));
return NULL;
}
/* The userdata of the found LCI contains a struct CIPtr,
which is just a pointer to the first CollectionItem */
return
(
((struct CIPtr*)LocalItemData(lci) )->FirstCI
);
AROS_LIBFUNC_EXIT
} /* FindCollection */