Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

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