home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_01_04 / 1n04008a < prev    next >
Text File  |  1990-03-03  |  1KB  |  60 lines

  1. /*
  2.     Header:     FileSrch
  3.     Version:    1.00    03-Mar-1990
  4.  
  5.     Language:   ANSI C with MS-DOS extensions
  6.     Environ:    MS-DOS
  7.  
  8.     Purpose:    This module will search subdirectories for files.
  9.  
  10.     Written by: Scott Robert Ladd
  11. */
  12.  
  13. #if !defined(FILESRCH_H)
  14. #define FILESRCH_H 1
  15.  
  16. #if defined(_MSC_VER) || defined(_QC) || defined(__WATCOMC__)
  17.     #pragma pack(1)
  18. #endif
  19.  
  20. typedef
  21.   struct
  22.     {
  23.     char     reserved[21];
  24.     char     attrib;
  25.     unsigned time;
  26.     unsigned date;
  27.     long     size;
  28.     char     name[13];
  29.     }
  30.   FILE_DATA;
  31.  
  32. #if defined(_MSC) || defined(_QC) || defined(__WATCOMC__)
  33.     #pragma pack()
  34. #endif
  35.  
  36. /* attribute bit masks */
  37.  
  38. #define ATTR_READONLY   0x01 /* read only */
  39. #define ATTR_HIDDEN     0x02 /* hidden */
  40. #define ATTR_SYSTEM     0x04 /* system */
  41. #define ATTR_VOLABEL    0x08 /* volume label */
  42. #define ATTR_DIRECTORY  0x10 /* directory */
  43. #define ATTR_ARCHIVE    0x20 /* archive */
  44. #define ATTR_ALL        0x3F /* all files */
  45.  
  46. /* prototypes */
  47.  
  48. void TreeFind(char * spec,
  49.               char attrib,
  50.               char * top_dir,
  51.               void (* handler)(char * dir, FILE_DATA * fd));
  52.  
  53. int WildMatch(char * name, char * tmpl);
  54.  
  55. int FindFirst(char * spec, char attrib, FILE_DATA * fd);
  56.  
  57. int FindNext(FILE_DATA * fd);
  58.  
  59. #endif
  60.