xref: /plan9/sys/src/ape/cmd/pdksh/ksh_dir.h (revision 7dd7cddf99dd7472612f1413b4da293630e6b1bc)
1 /* Wrapper around the ugly dir includes/ifdefs */
2 /* $Id$ */
3 
4 #if defined(HAVE_DIRENT_H)
5 # include <dirent.h>
6 # define NLENGTH(dirent)	(strlen(dirent->d_name))
7 #else
8 # define dirent direct
9 # define NLENGTH(dirent)	(dirent->d_namlen)
10 # ifdef HAVE_SYS_NDIR_H
11 #  include <sys/ndir.h>
12 # endif /* HAVE_SYS_NDIR_H */
13 # ifdef HAVE_SYS_DIR_H
14 #  include <sys/dir.h>
15 # endif /* HAVE_SYSDIR_H */
16 # ifdef HAVE_NDIR_H
17 #  include <ndir.h>
18 # endif /* HAVE_NDIR_H */
19 #endif /* HAVE_DIRENT_H */
20 
21 #ifdef OPENDIR_DOES_NONDIR
22 extern DIR *ksh_opendir ARGS((const char *d));
23 #else /* OPENDIR_DOES_NONDIR */
24 # define ksh_opendir(d)	opendir(d)
25 #endif /* OPENDIR_DOES_NONDIR */
26