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

  1. /*
  2. **  Figure 1 - DIRENT.H
  3. */
  4.  
  5. #ifndef DIRENT_H
  6. #define DIRENT_H
  7.  
  8. #include <stdio.h>                      /* For FILENAME_MAX     */
  9. #include <dos.h>
  10.  
  11. #if defined(__ZTC__)
  12.  #define DSTRUCT        FIND            /* ZTC/C++              */
  13.  #define ATTRIBUTE      attribute
  14.  #define NAME           name
  15.  #pragma pack(1)
  16.  #include <direct.h>
  17. #elif defined(__TURBOC__)
  18.  #define DSTRUCT        ffblk           /* TC/C++               */
  19.  #define ATTRIBUTE      ff_attrib
  20.  #define NAME           ff_name
  21.  #include <dir.h>
  22. #else
  23.  #define DSTRUCT        find_t          /* Assume MSC/QC        */
  24.  #define ATTRIBUTE      attrib
  25.  #define NAME           name
  26.  #pragma pack(1)
  27.  #include <direct.h>
  28. #endif
  29.  
  30. #define FA_ANY 0xff
  31. #undef FA_DIREC
  32. #define FA_DIREC 0x10
  33.  
  34. struct DSTRUCT *rfind_1st(char *, unsigned, struct DSTRUCT *);
  35. struct DSTRUCT *rfind_nxt(struct DSTRUCT *);
  36.  
  37. typedef struct
  38. {
  39.         int             dd_fd;
  40.         unsigned        dd_loc,
  41.                         dd_size;
  42.         struct DSTRUCT  dd_buf;
  43.         char            dd_dirname[FILENAME_MAX];
  44. } DOS_DIR;
  45.  
  46. DOS_DIR        *opendir(char *);
  47. int             closedir(DOS_DIR *),
  48.                 rewinddir(DOS_DIR *);
  49. struct DSTRUCT *readdir(DOS_DIR *),
  50.                *seekdir(DOS_DIR *, int, int);
  51. #define         telldir(dd) dd->loc
  52.  
  53. int             patmat(const char *, const char *);
  54. int             dirmask(struct DSTRUCT *,char *,char *,unsigned,unsigned);
  55.  
  56. extern int DFerr;
  57.  
  58. extern DOS_DIR _DIRS[];
  59.  
  60. #endif /* DIRENT_H */
  61.