home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / Template / c / ClearAll next >
Encoding:
Text File  |  1992-03-31  |  1.4 KB  |  44 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Template.ClearAll.c
  12.     Author:  Copyright © 1992 Jason Williams
  13.              Thanks to John Winters for supplying the code that I hacked
  14.              changed, hacked, rewrote, and then wrote again from scratch!
  15.     Version: 1.10 (29 Mar 1992)
  16.     Purpose: Loading, cacheing, and retrieval of window templates
  17. */
  18.  
  19. #include "TempDefs.h"
  20.  
  21.  
  22. extern void Template_ClearAll(void)
  23. /* Wipes all templates currently known to the system.
  24.  * Deallocates ALL memory used by these templates
  25.  */
  26. {
  27.   template_record *t, *n;
  28.  
  29.   t = (template_record *) template_list.next;
  30.  
  31.   while (t != NULL)
  32.   {
  33.     Template_Free(&(t->windowdef));
  34.     free(t->indirectdata);
  35.  
  36.     n = (template_record *) t->header.next;
  37.     LinkList_Unlink(&template_list, &(t->header));
  38.     free(t);
  39.     t = n;
  40.   }
  41.  
  42.   LinkList_Init(&template_list);         /* just to be on the safe side! */
  43. }
  44.