home *** CD-ROM | disk | FTP | other *** search
/ norge.freeshell.org (192.94.73.8) / 192.94.73.8.tar / 192.94.73.8 / pub / computers / pcjr / arc / PAKUTL12.LZH / DIRFN.H < prev    next >
Text File  |  1988-08-20  |  2KB  |  60 lines

  1. /*
  2.     DIRFN.H:    Definitions for DIRFN.C routines
  3.  
  4.     Copyright 1987,1988 Michael J. Housky
  5.     Released to the public domain: Aug. 20, 1988 by Michael J. Housky
  6. */
  7.  
  8. /* ------------    CONSTANTS, MACROS: */
  9.  
  10. /*    DOS Directory Attribute Bit Definitions: */
  11.  
  12. #define DATR_RDONLY    0x01    /* File is read-only */
  13. #define DATR_HIDDEN    0x02    /* File is hidden */
  14. #define DATR_SYSTEM    0x04    /* File is a system file */
  15. #define DATR_VLABEL    0x08    /* Volume label entry, not a file */
  16. #define DATR_SUBDIR    0x10    /* File is a subdirectory */
  17. #define DATR_ARCHIV    0x20    /* File selected for archive. */
  18.  
  19. /* ------------    TYPE DEFINITIONS: */
  20.  
  21. typedef struct        /* structure of DOS FIND DTA, used by  */
  22. {            /* used by dir_sscan/dir_cscan functions */
  23.     char    resv[21];    /* reserved for DOS */
  24.     unsigned char
  25.         attr;        /* attribute byte */
  26.     unsigned    time;        /* time word */
  27.     unsigned    date;        /* date word */
  28.     long    size;        /* file size in bytes */
  29.     char    name[13];    /* file name */
  30. } FIND_DTA;
  31.  
  32. typedef struct {        /* filename entry of array returned by */
  33.                 /* get_files() function */
  34.     char          filename[13];
  35.     } FILE_TYPE;
  36.  
  37. /* ------------    GETFILE.C Functions: */
  38.  
  39. int get_files(
  40. char *,int,FILE_TYPE **);
  41.  
  42.  
  43. /* ------------    DIRFN.C Functions: */
  44.  
  45. char far *cur_dta(    /* Return far pointer to current DTA */
  46.     void);
  47.  
  48. void set_dta(        /* Set DOS Disk Transfer Address */
  49.     char far *);        /* pdta: far pointer to new DTA */
  50.  
  51. FIND_DTA *dir_sscan(    /* Start a directory scan */
  52.     FIND_DTA*,        /* pdta: pointer to caller's DTA struct, or */
  53.                 /*     NULL to malloc and return pointer. */
  54.     char*,            /* fn:   drive:path\filename to match */
  55.     int);            /* attr: attribute bits to match */
  56.  
  57. FIND_DTA *dir_cscan(    /* Continue a directory scan. */
  58.     FIND_DTA*);        /* pdta: pointer to caller's DTA struct, */
  59.                 /*   previously established by a dir_sscan. */
  60.