home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / workbench / libs / iffparse / findcollection.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-03  |  1.6 KB  |  85 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: findcollection.c,v 1.1 1997/02/03 16:44:23 digulla Exp $
  4.  
  5.     Desc:
  6.     Lang: english
  7. */
  8. #include "iffparse_intern.h"
  9.  
  10. /*****************************************************************************
  11.  
  12.     NAME */
  13. #include <proto/iffparse.h>
  14.  
  15.     AROS_LH3(struct CollectionItem *, FindCollection,
  16.  
  17. /*  SYNOPSIS */
  18.     AROS_LHA(struct IFFHandle *, iff, A0),
  19.     AROS_LHA(LONG              , type, D0),
  20.     AROS_LHA(LONG              , id, D1),
  21.  
  22. /*  LOCATION */
  23.     struct Library *, IFFParseBase, 27, IFFParse)
  24.  
  25. /*  FUNCTION
  26.     Returns a pointer to a list of CollectionItems the installed
  27.     CollectionChunk of that type and ID.
  28.  
  29.     INPUTS
  30.     iff   - pointer to an IFFHandle struct.
  31.     type  - type code to search for.
  32.     id    -  id code to search for.
  33.  
  34.  
  35.     RESULT
  36.     ci - pointer to the last collection chunk encountered
  37.          with pointers to previous ones.
  38.  
  39.     NOTES
  40.  
  41.     EXAMPLE
  42.  
  43.     BUGS
  44.  
  45.     SEE ALSO
  46.     CollectionChunk(), CollectionChunks()
  47.  
  48.     INTERNALS
  49.  
  50.     HISTORY
  51.   27-11-96    digulla automatically created from
  52.       iffparse_lib.fd and clib/iffparse_protos.h
  53.  
  54. *****************************************************************************/
  55. {
  56.     AROS_LIBFUNC_INIT
  57.     AROS_LIBBASE_EXT_DECL(struct Library *,IFFParseBase)
  58.  
  59.     struct LocalContextItem *lci;
  60.  
  61.     if
  62.     (
  63.     !(lci = FindLocalItem
  64.         (
  65.         iff,
  66.         type,
  67.         id,
  68.         IFFLCI_COLLECTION
  69.         )
  70.     )
  71.     )
  72.     return (NULL);
  73.  
  74.     /* The userdata of the found LCI contains a struct CIPtr,
  75.     which is just a pointer to the first CollectionItem  */
  76.  
  77.    return
  78.    (
  79.        ((struct CIPtr*)LocalItemData(lci) )->FirstCI
  80.    );
  81.  
  82.  
  83.     AROS_LIBFUNC_EXIT
  84. } /* FindCollection */
  85.