home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJDEV201.ZIP / include / dir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-26  |  2.9 KB  |  92 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_dir_h_
  3. #define __dj_include_dir_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #ifndef __STRICT_ANSI__
  12.  
  13. #ifndef _POSIX_SOURCE
  14.  
  15. /* ffblk is also enhanced for LFNs; the dos 21 byte reserved area is used to
  16.    hold the extra information.  Fields marked LFN are only valid if the magic
  17.    is set to LFN32 */
  18.  
  19. /* This is for g++ 2.7.2 and below */
  20. #pragma pack(1)
  21.   
  22. struct ffblk {
  23.   char lfn_magic[6] __attribute__((packed));            /* LFN */
  24.   short lfn_handle __attribute__((packed));            /* LFN */
  25.   unsigned short lfn_ctime __attribute__((packed));        /* LFN */
  26.   unsigned short lfn_cdate __attribute__((packed));        /* LFN */
  27.   unsigned short lfn_atime __attribute__((packed));        /* LFN */
  28.   unsigned short lfn_adate __attribute__((packed));        /* LFN */
  29.   char _ff_reserved[5] __attribute__((packed));
  30.   unsigned char  ff_attrib __attribute__((packed));
  31.   unsigned short ff_ftime __attribute__((packed));
  32.   unsigned short ff_fdate __attribute__((packed));
  33.   unsigned long  ff_fsize __attribute__((packed));
  34.   char ff_name[260] __attribute__((packed));
  35. };
  36.  
  37. struct ffblklfn {
  38.   unsigned long      fd_attrib __attribute__((packed));
  39.   unsigned long long fd_ctime __attribute__((packed));
  40.   unsigned long long fd_atime __attribute__((packed));
  41.   unsigned long long fd_mtime __attribute__((packed));
  42.   unsigned long      fd_sizehi __attribute__((packed));
  43.   unsigned long      fd_size __attribute__((packed));
  44.   unsigned long long fd_reserved __attribute__((packed));
  45.   char               fd_longname[260] __attribute__((packed));
  46.   char               fd_name[14] __attribute__((packed));
  47. };
  48.  
  49. #pragma pack(4)
  50.  
  51. #define FA_RDONLY       1
  52. #define FA_HIDDEN       2
  53. #define FA_SYSTEM       4
  54. #define FA_LABEL        8
  55. #define FA_DIREC        16
  56. #define FA_ARCH         32
  57.  
  58. /* for fnmerge/fnsplit */
  59. #define MAXPATH   80
  60. #define MAXDRIVE  3
  61. #define MAXDIR      66
  62. #define MAXFILE   9
  63. #define MAXEXT      5
  64.  
  65. #define WILDCARDS 0x01
  66. #define EXTENSION 0x02
  67. #define FILENAME  0x04
  68. #define DIRECTORY 0x08
  69. #define DRIVE      0x10
  70.  
  71. int    __file_tree_walk(const char *_dir, int (*_fn)(const char *_path, const struct ffblk *_ff));
  72. int    findfirst(const char *_pathname, struct ffblk *_ffblk, int _attrib);
  73. int    findnext(struct ffblk *_ffblk);
  74. void    fnmerge (char *_path, const char *_drive, const char *_dir, const char *_name, const char *_ext);
  75. int    fnsplit (const char *_path, char *_drive, char *_dir, char *_name, char *_ext);
  76. int    getdisk(void);
  77. char *    searchpath(const char *_program);
  78. int    setdisk(int _drive);
  79.  
  80. #endif /* !_POSIX_SOURCE */
  81. #endif /* !__STRICT_ANSI__ */
  82. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  83.  
  84. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  85. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  86.  
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90.  
  91. #endif /* !__dj_include_dir.h_ */
  92.