2004-12-10 19:12:32 +01:00
|
|
|
/** $MirBSD: src/bin/ksh/ksh_dir.h,v 2.1 2004/12/10 18:09:41 tg Exp $ */
|
2004-09-21 13:57:17 +02:00
|
|
|
/* $OpenBSD: ksh_dir.h,v 1.1.1.1 1996/08/14 06:19:11 downsj Exp $ */
|
2003-03-22 18:35:03 +01:00
|
|
|
|
2004-10-28 13:53:44 +02:00
|
|
|
#ifndef KSH_DIR_H
|
|
|
|
#define KSH_DIR_H
|
|
|
|
|
2003-03-22 18:35:03 +01:00
|
|
|
/* Wrapper around the ugly dir includes/ifdefs */
|
|
|
|
|
|
|
|
#if defined(HAVE_DIRENT_H)
|
|
|
|
# include <dirent.h>
|
|
|
|
# define NLENGTH(dirent) (strlen(dirent->d_name))
|
|
|
|
#else
|
|
|
|
# define dirent direct
|
|
|
|
# define NLENGTH(dirent) (dirent->d_namlen)
|
|
|
|
# ifdef HAVE_SYS_NDIR_H
|
|
|
|
# include <sys/ndir.h>
|
|
|
|
# endif /* HAVE_SYS_NDIR_H */
|
|
|
|
# ifdef HAVE_SYS_DIR_H
|
|
|
|
# include <sys/dir.h>
|
|
|
|
# endif /* HAVE_SYSDIR_H */
|
|
|
|
# ifdef HAVE_NDIR_H
|
|
|
|
# include <ndir.h>
|
|
|
|
# endif /* HAVE_NDIR_H */
|
|
|
|
#endif /* HAVE_DIRENT_H */
|
|
|
|
|
|
|
|
#ifdef OPENDIR_DOES_NONDIR
|
2004-10-28 13:11:19 +02:00
|
|
|
extern DIR *ksh_opendir(const char *d);
|
2003-03-22 18:35:03 +01:00
|
|
|
#else /* OPENDIR_DOES_NONDIR */
|
|
|
|
# define ksh_opendir(d) opendir(d)
|
|
|
|
#endif /* OPENDIR_DOES_NONDIR */
|
2004-10-28 13:53:44 +02:00
|
|
|
|
|
|
|
#endif /* ndef KSH_DIR_H */
|