home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / DIR / TOADADEL.ZIP / FILESRCH.H < prev   
Encoding:
C/C++ Source or Header  |  1989-05-16  |  1.5 KB  |  68 lines

  1. /* Support code from Micro Cornucopia Magazine Issue #48
  2.  
  3. Micro Cornucopia
  4. PO Box 223
  5. Bend, OR 97709 */
  6.  
  7.  
  8.  
  9. /* FILESRCH.H */
  10. /*
  11.      Header:      FileSrch (File Search)
  12.      Version:      1.00  02-Apr-1989
  13.      Language:    ANSI C with MS-DOS extensions
  14.  
  15.      This module will search subdirectories for files to be deleted. It can
  16.      query the user as to which files selected should be deleted.
  17.  
  18.      Written by Scott Robert Ladd. No rights reserved.
  19. */
  20.  
  21. #if !defined(FILESRCH_H)
  22. #define FILESRCH_H 1
  23.  
  24. #if defined(_MSC) || defined(_QC) || defined(__WATCOMC__)
  25.     #pragma pack(1)
  26. #endif
  27.  
  28. typedef
  29.   struct
  30.     {
  31.     char     reserved[21];
  32.     char     attrib;
  33.     unsigned time;
  34.     unsigned date;
  35.     long     size;
  36.     char     name[13];
  37.     }
  38.   FILE_DATA;
  39.  
  40. #if defined(_MSC) || defined(_QC) || defined(__WATCOMC__)
  41.     #pragma pack()
  42. #endif
  43.  
  44. /* attribute bit masks */
  45.  
  46. #define ATTR_READONLY    0x01 /* read only */
  47. #define ATTR_HIDDEN    0x02 /* hidden */
  48. #define ATTR_SYSTEM    0x04 /* system */
  49. #define ATTR_VOLABEL    0x08 /* volume label */
  50. #define ATTR_DIRECTORY  0x10 /* directory */
  51. #define ATTR_ARCHIVE    0x20 /* archive */
  52. #define ATTR_ALL    0x3F /* all files */
  53.  
  54. /* prototypes */
  55.  
  56. void sub_find(char * spec,
  57.           char attrib,
  58.           char * top_dir,
  59.           void (* handler)(char * dir, FILE_DATA * fd));
  60.  
  61. int wild_match(char * name, char * tmpl);
  62.  
  63. int find_first(char * spec, char attrib, FILE_DATA * fd);
  64.  
  65. int find_next(FILE_DATA * fd);
  66.  
  67. #endif
  68.