home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume27 / genmake / part01 / valid.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-17  |  410 b   |  26 lines

  1. /* valid.c */
  2.  
  3. #include <stdio.h>
  4. #include "types.h"
  5.  
  6. valid_source_file(name)
  7. char        *name;
  8. {
  9.     int        i;
  10.  
  11.     for (i = 0; name[i] != NULL && name[i] != '.'; i++)
  12.         ;
  13.     if (name[i] == '.') {
  14.         if (!strcmp(&name[i+1],"c"))
  15.             return(CSOURCE);
  16.         if (!strcmp(&name[i+1],"h"))
  17.             return(CHEADER);
  18.         if (!strcmp(&name[i+1],"y"))
  19.             return(YACCSOURCE);
  20.         if (!strcmp(&name[i+1],"l"))
  21.             return(LEXSOURCE);
  22.     }
  23.     return(0);
  24. }
  25.  
  26.