home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / Template / c / Delete < prev    next >
Encoding:
Text File  |  1992-03-31  |  1.2 KB  |  36 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.Delete.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_Delete(char *name)
  23. /* Attempts to delete the named template, and deallocate it's memory */
  24. {
  25.   template_record *t;
  26.  
  27.   t = Template__FindTemplate(name);
  28.   if (t == NULL)
  29.     return;
  30.  
  31.   Template_Free(&(t->windowdef));
  32.   free(t->indirectdata);
  33.  
  34.   LinkList_Unlink(&template_list, &(t->header));
  35. }
  36.