1
/* @(#)dirdefs.h 1.14 03/06/15 Copyright 1987, 1998 J. Schilling */
3
* Copyright (c) 1987, 1998 J. Schilling
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2, or (at your option)
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along with
17
* this program; see the file COPYING. If not, write to the Free Software
18
* Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33
# ifndef _INCL_SYS_STYPES_H
34
# include <sys/stypes.h>
35
# define _INCL_SYS_STYPES_H
37
# ifndef _INCL_SYS_FILEDESC_H
38
# include <sys/filedesc.h>
39
# define _INCL_SYS_FILEDESC_H
43
# define FOUND_DIRSIZE
44
typedef struct dirent {
51
# ifndef _INCL_SYS_TYPES_H
52
# include <sys/types.h>
53
# define _INCL_SYS_TYPES_H
55
# ifndef _INCL_SYS_STAT_H
56
# include <sys/stat.h>
57
# define _INCL_SYS_STAT_H
60
# ifndef _INCL_LIMITS_H
62
# define _INCL_LIMITS_H
65
# ifdef HAVE_SYS_PARAM_H
66
# ifndef _INCL_SYS_PARAM_H
67
# include <sys/param.h>
68
# define _INCL_SYS_PARAM_H
72
# ifdef HAVE_DIRENT_H /* This a POSIX compliant system */
73
# ifndef _INCL_DIRENT_H
75
# define _INCL_DIRENT_H
77
# define DIR_NAMELEN(dirent) strlen((dirent)->d_name)
79
# else /* This is a Pre POSIX system */
81
# define dirent direct
82
# define DIR_NAMELEN(dirent) (dirent)->d_namlen
84
# if defined(HAVE_SYS_DIR_H)
85
# ifndef _INCL_SYS_DIR_H
87
# define _INCL_SYS_DIR_H
92
# if defined(HAVE_NDIR_H) && !defined(_FOUND_DIR_)
100
# if defined(HAVE_SYS_NDIR_H) && !defined(_FOUND_DIR_)
101
# ifndef _INCL_SYS_NDIR_H
102
# include <sys/ndir.h>
103
# define _INCL_SYS_NDIR_H
107
# endif /* HAVE_DIRENT_H */
109
# if defined(_FOUND_DIR_)
111
* Don't use defaults here to allow recognition of problems.
114
# define DIRSIZE MAXNAMELEN /* From sys/param.h */
115
# define FOUND_DIRSIZE
118
# define DIRSIZE MAXNAMLEN /* From dirent.h */
119
# define FOUND_DIRSIZE
122
# define DIRSIZE DIRSIZ /* From sys/dir.h */
123
# define FOUND_DIRSIZE
127
# else /* !_FOUND_DIR_ */
130
# define NEED_READDIR
132
# endif /* _FOUND_DIR_ */
137
#ifndef FOUND_DIRSIZE
138
#define DIRSIZE 14 /* The old UNIX standard value */
139
#define FOUND_DIRSIZE
142
typedef struct dirent {
147
#endif /* NEED_DIRENT */
152
typedef struct __dirdesc {
158
unsigned short d_reclen;
159
unsigned short d_namlen;
160
char d_name[DIRSIZE +1];
163
extern DIR *opendir();
165
extern struct direct *readdir();
167
#endif /* NEED_READDIR */
173
#endif /* _DIRDEFS_H */