Added -g, --oldmouse option to support of NORMAL/BUTTON_EVENT mouse type.
[midnight-commander.git] / lib / fs.h
blob11111c92670c7ccaee9e357ea1863fd41748bbfa
1 /** \file fs.h
2 * \brief Header: fs compatibility definitions
3 */
5 /* Include file to use opendir/closedir/readdir */
7 #ifndef MC_FS_H
8 #define MC_FS_H
10 #include <sys/types.h>
11 #include <unistd.h>
12 #include <sys/stat.h>
13 #include <dirent.h>
15 /*** typedefs(not structures) and defined constants **********************************************/
17 /* Replacement for permission bits missing in sys/stat.h */
18 #ifndef S_ISLNK
19 #define S_ISLNK(x) 0
20 #endif
22 #ifndef S_ISSOCK
23 #define S_ISSOCK(x) 0
24 #endif
26 #ifndef S_ISFIFO
27 #define S_ISFIFO(x) 0
28 #endif
30 #ifndef S_ISCHR
31 #define S_ISCHR(x) 0
32 #endif
34 #ifndef S_ISBLK
35 #define S_ISBLK(x) 0
36 #endif
38 /* Door is something that only exists on Solaris */
39 #ifndef S_ISDOOR
40 #define S_ISDOOR(x) 0
41 #endif
43 /* Special named files are widely used in QNX6 */
44 #ifndef S_ISNAM
45 #define S_ISNAM(x) 0
46 #endif
48 #ifndef PATH_MAX
49 #ifdef _POSIX_VERSION
50 #define PATH_MAX _POSIX_PATH_MAX
51 #else
52 #ifdef MAXPATHLEN
53 #define PATH_MAX MAXPATHLEN
54 #else
55 #define PATH_MAX 1024
56 #endif
57 #endif
58 #endif
60 #ifndef MAXPATHLEN
61 #define MC_MAXPATHLEN 4096
62 #else
63 #define MC_MAXPATHLEN MAXPATHLEN
64 #endif
66 /* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */
67 #define NLENGTH(dirent) (strlen ((dirent)->d_name))
68 #define DIRENT_LENGTH_COMPUTED 1
70 /* DragonFlyBSD doesn't provide MAXNAMLEN macro */
71 #ifndef MAXNAMLEN
72 #define MAXNAMLEN NAME_MAX
73 #endif
75 #define MC_MAXFILENAMELEN MAXNAMLEN
77 /*** enums ***************************************************************************************/
79 /*** structures declarations (and typedefs of structures)*****************************************/
81 /*** global variables defined in .c file *********************************************************/
83 /*** declarations of public functions ************************************************************/
85 /*** inline functions ****************************************************************************/
87 static inline void
88 compute_namelen (struct dirent *dent __attribute__ ((unused)))
90 #ifdef DIRENT_LENGTH_COMPUTED
91 return;
92 #else
93 dent->d_namlen = strlen (dent);
94 #endif
97 #endif