summaryrefslogtreecommitdiff
path: root/shells/pdksh/files/ksh_dir.h
diff options
context:
space:
mode:
authortnn <tnn@pkgsrc.org>2008-05-23 17:15:14 +0000
committertnn <tnn@pkgsrc.org>2008-05-23 17:15:14 +0000
commit8ca66f5d839af263bb04b4bc1e281dfc372043b5 (patch)
treea7ba750f0b8b832b526df15d6fa2caa48e8927e0 /shells/pdksh/files/ksh_dir.h
parent8a311b3069ee79731eec38ca13eb13772cc49223 (diff)
downloadpkgsrc-MRENDEL.tar.gz
Import subset of pdksh-5.2.14 distribution.MRENDEL
Only the files required to build it, for pkgsrc bootstrap purposes.
Diffstat (limited to 'shells/pdksh/files/ksh_dir.h')
-rw-r--r--shells/pdksh/files/ksh_dir.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/shells/pdksh/files/ksh_dir.h b/shells/pdksh/files/ksh_dir.h
new file mode 100644
index 00000000000..f08be16c790
--- /dev/null
+++ b/shells/pdksh/files/ksh_dir.h
@@ -0,0 +1,25 @@
+/* Wrapper around the ugly dir includes/ifdefs */
+/* $Id: ksh_dir.h,v 1.1.1.1 2008/05/23 17:15:20 tnn Exp $ */
+
+#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
+extern DIR *ksh_opendir ARGS((const char *d));
+#else /* OPENDIR_DOES_NONDIR */
+# define ksh_opendir(d) opendir(d)
+#endif /* OPENDIR_DOES_NONDIR */