2009-02-05 21:28:18 +03:00
|
|
|
|
|
|
|
/** \file fs.h
|
|
|
|
* \brief Header: fs compatibility definitions
|
|
|
|
*/
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* Include file to use opendir/closedir/readdir */
|
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#ifndef MC_FS_H
|
|
|
|
#define MC_FS_H
|
2002-01-22 04:23:18 +03:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#include <sys/types.h>
|
2009-02-06 15:44:53 +03:00
|
|
|
#include <unistd.h>
|
1998-02-27 07:54:42 +03:00
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2002-01-22 04:23:18 +03:00
|
|
|
|
|
|
|
/* Replacement for permission bits missing in sys/stat.h */
|
|
|
|
#ifndef S_ISLNK
|
2002-09-06 23:23:45 +04:00
|
|
|
# define S_ISLNK(x) 0
|
2002-01-22 04:23:18 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef S_ISSOCK
|
2002-09-06 23:23:45 +04:00
|
|
|
# define S_ISSOCK(x) 0
|
2002-01-22 04:23:18 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef S_ISFIFO
|
2002-09-06 23:23:45 +04:00
|
|
|
# define S_ISFIFO(x) 0
|
2002-01-22 04:23:18 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef S_ISCHR
|
2002-09-06 23:23:45 +04:00
|
|
|
# define S_ISCHR(x) 0
|
2002-01-22 04:23:18 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef S_ISBLK
|
2002-09-06 23:23:45 +04:00
|
|
|
# define S_ISBLK(x) 0
|
2002-01-22 04:23:18 +03:00
|
|
|
#endif
|
|
|
|
|
2002-09-06 04:47:46 +04:00
|
|
|
/* Door is something that only exists on Solaris */
|
|
|
|
#ifndef S_ISDOOR
|
2002-09-06 23:23:45 +04:00
|
|
|
# define S_ISDOOR(x) 0
|
2002-09-06 04:47:46 +04:00
|
|
|
#endif
|
|
|
|
|
2004-11-03 23:31:59 +03:00
|
|
|
/* Special named files are widely used in QNX6 */
|
|
|
|
#ifndef S_ISNAM
|
|
|
|
# define S_ISNAM(x) 0
|
|
|
|
#endif
|
2002-09-06 04:47:46 +04:00
|
|
|
|
2002-01-22 04:23:18 +03:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#ifndef MAXPATHLEN
|
|
|
|
# define MC_MAXPATHLEN 4096
|
|
|
|
#else
|
|
|
|
# define MC_MAXPATHLEN MAXPATHLEN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */
|
2009-02-06 15:44:53 +03:00
|
|
|
#include <dirent.h>
|
|
|
|
#define NLENGTH(dirent) (strlen ((dirent)->d_name))
|
|
|
|
#define DIRENT_LENGTH_COMPUTED 1
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-10-07 12:29:36 +04:00
|
|
|
#ifndef MAXNAMLEN
|
|
|
|
# define MC_MAXFILENAMELEN 256
|
|
|
|
#else
|
|
|
|
# define MC_MAXFILENAMELEN MAXNAMLEN
|
|
|
|
#endif
|
|
|
|
|
2003-10-25 07:44:13 +04:00
|
|
|
static inline void
|
|
|
|
compute_namelen (struct dirent *dent __attribute__ ((unused)))
|
|
|
|
{
|
2002-08-15 23:35:53 +04:00
|
|
|
#ifdef DIRENT_LENGTH_COMPUTED
|
|
|
|
return;
|
|
|
|
#else
|
|
|
|
dent->d_namlen = strlen (dent);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#endif
|