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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: parentchunk.c,v 1.1 1997/02/03 16:44:27 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 *, ParentChunk,
  16.  
  17. /*  SYNOPSIS */
  18.     AROS_LHA(struct ContextNode *, contextNode, A0),
  19.  
  20. /*  LOCATION */
  21.     struct Library *, IFFParseBase, 30, IFFParse)
  22.  
  23. /*  FUNCTION
  24.     Returns a pointer to the parent context node to the given
  25.     one on the context node stack. The parent context node
  26.     represents the chunk enclosing the chunk given.
  27.     This can be use together with CurrentChunk() to iterate the
  28.     context node stack top-down.
  29.  
  30.     INPUTS
  31.     contextNode  - pointer to a context node.
  32.  
  33.     RESULT
  34.     parent        -  pointer to the parent context node or NULL if none.
  35.  
  36.     NOTES
  37.  
  38.     EXAMPLE
  39.  
  40.     BUGS
  41.  
  42.     SEE ALSO
  43.     CurrentChunk()
  44.  
  45.     INTERNALS
  46.  
  47.     HISTORY
  48.   27-11-96    digulla automatically created from
  49.       iffparse_lib.fd and clib/iffparse_protos.h
  50.  
  51. *****************************************************************************/
  52. {
  53.     AROS_LIBFUNC_INIT
  54.     AROS_LIBBASE_EXT_DECL(struct Library *,IFFParseBase)
  55.  
  56.     struct ContextNode *parentcn;
  57.  
  58.     /* Get the parent of this contextnode. The contextstack
  59.       is simulated via AddHead/RemHead so we should use
  60.       .mln_Succ to get the parent
  61.     */
  62.     parentcn = (struct ContextNode*)contextNode->cn_Node.mln_Succ;
  63.  
  64.     /* If the parent of the found node is 0 (mlh_Tail field
  65.        in struct MinList, then parentcn is the default contextnode,
  66.        which the user not should have access to
  67.     */
  68.  
  69.     if (!parentcn->cn_Node.mln_Succ)
  70.     parentcn = NULL;
  71.  
  72.     return (parentcn);
  73.  
  74.     AROS_LIBFUNC_EXIT
  75. } /* ParentChunk */
  76.