4 * @(#)msd_dir.h 1.4 87/11/06 Public Domain.
6 * A public domain implementation of BSD directory routines for
7 * MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield),
10 * Extended by Peter Lim (lim@mullian.oz) to overcome some MS DOS quirks
11 * and returns 2 more pieces of information - file size & attribute.
12 * Plus a little reshuffling of some #define's positions December 1987
14 * Some modifications by Martin Junius 02-14-89
17 * AK910410 abs_path - make absolute path
22 #include <sys/param.h>
24 #if defined(__IBMC__) || defined(__IBMCPP__) || defined(XP_W32_MSVC)
29 #define MAXPATHLEN (FILENAME_MAX*4)
30 #define MAXNAMLEN FILENAME_MAX
44 # define A_HIDDEN 0x02
45 # define A_SYSTEM 0x04
48 # define A_ARCHIVE 0x20
52 #if defined(OS2) || defined(WIN32) /* use the layout of EMX to avoid trouble */
53 int d_ino
; /* Dummy */
54 int d_reclen
; /* Dummy, same as d_namlen */
55 int d_namlen
; /* length of name */
56 char d_name
[MAXNAMLEN
+ 1];
58 unsigned short d_attribute
; /* attributes (see above) */
59 unsigned short d_time
; /* modification time */
60 unsigned short d_date
; /* modification date */
62 char d_name
[MAXNAMLEN
+ 1]; /* garentee null termination */
63 char d_attribute
; /* .. extension .. */
64 unsigned long d_size
; /* .. extension .. */
68 typedef struct _dirdescr
DIR;
69 /* the structs do not have to be defined here */
71 extern DIR *opendir(const char *);
72 extern DIR *openxdir(const char *, unsigned);
73 extern struct dirent
*readdir(DIR *);
74 extern void seekdir(DIR *, long);
75 extern long telldir(DIR *);
76 extern void closedir(DIR *);
77 #define rewinddir(dirp) seekdir(dirp, 0L)
79 extern char * abs_path(const char *name
, char *buffer
, int len
);
82 #define S_IFMT ( S_IFDIR | S_IFREG )
86 #define S_ISDIR( m ) (((m) & S_IFMT) == S_IFDIR)
90 #define S_ISREG( m ) (((m) & S_IFMT) == S_IFREG)