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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: findprop.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 StoredProperty *, FindProp,
  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, 26, IFFParse)
  24.  
  25. /*  FUNCTION
  26.     Searches for a StoredProperty that is valid in the given context.
  27.     Property chunks are automatically stored by ParseIFF() when pre-declared
  28.     by PropChunk() or PropChunks(). The returned storedproperty contains
  29.     a pointer to the data in the chunk.
  30.  
  31.     INPUTS
  32.     iff    - a pointer to a an IFFHandle struct.
  33.     type  - type code of property to search for.
  34.     id    -  id code of property to search for.
  35.  
  36.     RESULT
  37.     sp    - pointer to a storedproperty if found, NULL if none are found.
  38.  
  39.     NOTES
  40.  
  41.     EXAMPLE
  42.  
  43.     BUGS
  44.  
  45.  
  46.     SEE ALSO
  47.     PropChunk(), PropChunks()
  48.  
  49.     INTERNALS
  50.  
  51.     HISTORY
  52.   27-11-96    digulla automatically created from
  53.       iffparse_lib.fd and clib/iffparse_protos.h
  54.  
  55. *****************************************************************************/
  56. {
  57.     AROS_LIBFUNC_INIT
  58.     AROS_LIBBASE_EXT_DECL(struct Library *,IFFParseBase)
  59.  
  60.     struct LocalContextItem *lci;
  61.  
  62.     if
  63.     (
  64.     !(lci = FindLocalItem
  65.         (
  66.         iff,
  67.         type,
  68.         id,
  69.         IFFLCI_PROP
  70.         )
  71.     )
  72.     )
  73.     return (NULL);
  74.  
  75.     /* The userdata of the found LCI is the StoredProperty */
  76.  
  77.     return ( LocalItemData(lci) );
  78.  
  79.     AROS_LIBFUNC_EXIT
  80. } /* FindProp */
  81.