2 * \brief Header: fs compatibility definitions
5 /* Include file to use opendir/closedir/readdir */
10 #include <sys/types.h>
15 /*** typedefs(not structures) and defined constants **********************************************/
18 #define HAVE_S_ISREG 1
20 #define HAVE_S_ISREG 0
25 #define HAVE_S_ISDIR 1
27 #define HAVE_S_ISDIR 0
31 /* Replacement for permission bits missing in sys/stat.h */
33 #define HAVE_S_ISLNK 1
35 #define HAVE_S_ISLNK 0
40 #define HAVE_S_ISSOCK 1
42 #define HAVE_S_ISSOCK 0
47 #define HAVE_S_ISFIFO 1
49 #define HAVE_S_ISFIFO 0
54 #define HAVE_S_ISCHR 1
56 #define HAVE_S_ISCHR 0
61 #define HAVE_S_ISBLK 1
63 #define HAVE_S_ISBLK 0
67 /* Door is something that only exists on Solaris */
69 #define HAVE_S_ISDOOR 1
71 #define HAVE_S_ISDOOR 0
75 /* Special named files are widely used in QNX6 */
77 #define HAVE_S_ISNAM 1
79 #define HAVE_S_ISNAM 0
85 #define PATH_MAX _POSIX_PATH_MAX
88 #define PATH_MAX MAXPATHLEN
96 #define MC_MAXPATHLEN 4096
98 #define MC_MAXPATHLEN MAXPATHLEN
101 /* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */
102 #define NLENGTH(dirent) (strlen ((dirent)->d_name))
103 #define DIRENT_LENGTH_COMPUTED 1
105 /* DragonFlyBSD doesn't provide MAXNAMLEN macro */
107 #define MAXNAMLEN NAME_MAX
110 #define MC_MAXFILENAMELEN MAXNAMLEN
112 #define DIR_IS_DOT(x) ((x)[0] == '.' && (x)[1] == '\0')
113 #define DIR_IS_DOTDOT(x) ((x)[0] == '.' && (x)[1] == '.' && (x)[2] == '\0')
115 /*** enums ***************************************************************************************/
117 /*** structures declarations (and typedefs of structures)*****************************************/
119 /*** global variables defined in .c file *********************************************************/
121 /*** declarations of public functions ************************************************************/
123 /*** inline functions ****************************************************************************/
126 compute_namelen (struct dirent
*dent
__attribute__ ((unused
)))
128 #ifdef DIRENT_LENGTH_COMPUTED
132 dent
->d_namlen
= strlen (dent
);