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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: findpropcontext.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_LH1(struct ContextNode *, FindPropContext,
  16.  
  17. /*  SYNOPSIS */
  18.     AROS_LHA(struct IFFHandle *, iff, A0),
  19.  
  20. /*  LOCATION */
  21.     struct Library *, IFFParseBase, 28, IFFParse)
  22.  
  23. /*  FUNCTION
  24.     Finds the proper context in which to store a property.
  25.     If we have installed a property entry handler via PropChunk()
  26.     and such a property chunk (for example id is "CMAP" and type is "ILBM"
  27.     inside a form, then the storedproperty will be stored in the enclosing
  28.     FORM chink. If the chunk was inside a PROP chunk inside a LIST, then
  29.     the storedproperty would be installed in the LIST context.
  30.  
  31.     INPUTS
  32.     iff - pointer to IFFHandle struct.
  33.  
  34.     RESULT
  35.     cn  -  pointer to contextnode where the property might be installed, or
  36.           NULL if no such context exists.
  37.  
  38.     NOTES
  39.     This function is most for internal use.
  40.  
  41.     EXAMPLE
  42.  
  43.     BUGS
  44.  
  45.     SEE ALSO
  46.     ParentChunk(), CurrentChunk(), StoreItemInContext(), PropChunk()
  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 ContextNode     *node;
  60.  
  61.     node = TopChunk(iff);
  62.  
  63.     /* Start at the parent of the top node */
  64.     while ((node = ParentChunk(node) ))
  65.     {
  66.     /* If this node is a FORM or a LIST, then we have acorrect property */
  67.     if
  68.     (
  69.         (node->cn_ID == ID_FORM)
  70.     &&
  71.         (node->cn_ID == ID_LIST)
  72.     )
  73.         return(node);
  74.  
  75.     }
  76.  
  77.     /* No proper context found */
  78.     return (NULL);
  79.  
  80.  
  81.     AROS_LIBFUNC_EXIT
  82. } /* FindPropContext */
  83.