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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: freeiff.c,v 1.2 1997/02/04 14:09:18 digulla Exp $
  4.  
  5.     Desc:
  6.     Lang: english
  7. */
  8. #define AROS_ALMOST_COMPATIBLE
  9. #include "iffparse_intern.h"
  10.  
  11. /*****************************************************************************
  12.  
  13.     NAME */
  14. #include <proto/iffparse.h>
  15.  
  16.     AROS_LH1(void, FreeIFF,
  17.  
  18. /*  SYNOPSIS */
  19.     AROS_LHA(struct IFFHandle *, iff, A0),
  20.  
  21. /*  LOCATION */
  22.     struct Library *, IFFParseBase, 9, IFFParse)
  23.  
  24. /*  FUNCTION
  25.     Frees an IFFHandle struct previously allocated by AllocIFF.
  26.  
  27.     INPUTS
  28.     iff - pointer to an IFFHandle struct.
  29.     RESULT
  30.  
  31.     NOTES
  32.  
  33.     EXAMPLE
  34.  
  35.     BUGS
  36.  
  37.     SEE ALSO
  38.     AllocIFF(), CloseIFF()
  39.  
  40.     INTERNALS
  41.  
  42.     HISTORY
  43.  
  44. *****************************************************************************/
  45. {
  46.     AROS_LIBFUNC_INIT
  47.     AROS_LIBBASE_EXT_DECL(struct Library *,IFFParseBase)
  48.     struct IntContextNode   * cn;
  49.     struct LocalContextItem * node,
  50.                 * nextnode;
  51.  
  52.     /*
  53.     We should free the LCIs of the default context-node
  54.     ( CollectionItems and such )
  55.     */
  56.     cn = (struct IntContextNode*)RootChunk (iff);
  57.  
  58.     node = (struct LocalContextItem*)cn->cn_LCIList.mlh_Head;
  59.  
  60.     while ((nextnode = (struct LocalContextItem*)node->lci_Node.mln_Succ))
  61.     {
  62.     PurgeLCI (node, IPB(IFFParseBase));
  63.  
  64.     node = nextnode;
  65.     }
  66.  
  67.     FreeMem (iff, sizeof (struct IntIFFHandle));
  68.  
  69.     AROS_LIBFUNC_EXIT
  70. } /* FreeIFF */
  71.