home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / Template / c / Find < prev    next >
Encoding:
Text File  |  1992-03-31  |  1.4 KB  |  54 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.Find.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.  
  20. #include "TempDefs.h"
  21.  
  22.  
  23. extern template_record *Template__FindTemplate(char *name)
  24. /* not intended for user-consumption! Use Template_Find instead */
  25. {
  26.   template_record *t;
  27.  
  28.   t = (template_record *) template_list.next;
  29.  
  30.   while (t != NULL)
  31.   {
  32.     if (!strncmp(name, t->identifier, wimp_MAXNAME))
  33.       return(t);
  34.  
  35.     t = (template_record *) t->header.next;
  36.   }
  37.  
  38.   return(NULL);
  39. }
  40.  
  41.  
  42.  
  43. extern window_block *Template_Find(char *name)
  44. {
  45.   template_record *t;
  46.  
  47.   t = Template__FindTemplate(name);
  48.   
  49.   if (t == NULL)
  50.     return(NULL);
  51.  
  52.   return(t->windowdef);
  53. }
  54.