groff: Remove info page
[dragonfly.git] / gnu / usr.bin / texinfo / libgnu / sys / stat.h
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* Provide a more complete sys/stat header file.
3    Copyright (C) 2006-2008 Free Software Foundation, Inc.
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3, or (at your option)
8    any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software Foundation,
17    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
18
19 /* Written by Eric Blake, Paul Eggert, and Jim Meyering.  */
20
21 /* This file is supposed to be used on platforms where <sys/stat.h> is
22    incomplete.  It is intended to provide definitions and prototypes
23    needed by an application.  Start with what the system provides.  */
24
25 #ifndef _GL_SYS_STAT_H
26
27 /* The include_next requires a split double-inclusion guard.  */
28 #include_next <sys/stat.h>
29
30 #ifndef _GL_SYS_STAT_H
31 #define _GL_SYS_STAT_H
32
33 /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
34    headers that may declare mkdir().  */
35 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
36 # include <io.h>
37 #endif
38
39 #ifndef S_IFMT
40 # define S_IFMT 0170000
41 #endif
42
43 #if STAT_MACROS_BROKEN
44 # undef S_ISBLK
45 # undef S_ISCHR
46 # undef S_ISDIR
47 # undef S_ISFIFO
48 # undef S_ISLNK
49 # undef S_ISNAM
50 # undef S_ISMPB
51 # undef S_ISMPC
52 # undef S_ISNWK
53 # undef S_ISREG
54 # undef S_ISSOCK
55 #endif
56
57 #ifndef S_ISBLK
58 # ifdef S_IFBLK
59 #  define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
60 # else
61 #  define S_ISBLK(m) 0
62 # endif
63 #endif
64
65 #ifndef S_ISCHR
66 # ifdef S_IFCHR
67 #  define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
68 # else
69 #  define S_ISCHR(m) 0
70 # endif
71 #endif
72
73 #ifndef S_ISDIR
74 # ifdef S_IFDIR
75 #  define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
76 # else
77 #  define S_ISDIR(m) 0
78 # endif
79 #endif
80
81 #ifndef S_ISDOOR /* Solaris 2.5 and up */
82 # define S_ISDOOR(m) 0
83 #endif
84
85 #ifndef S_ISFIFO
86 # ifdef S_IFIFO
87 #  define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
88 # else
89 #  define S_ISFIFO(m) 0
90 # endif
91 #endif
92
93 #ifndef S_ISLNK
94 # ifdef S_IFLNK
95 #  define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
96 # else
97 #  define S_ISLNK(m) 0
98 # endif
99 #endif
100
101 #ifndef S_ISMPB /* V7 */
102 # ifdef S_IFMPB
103 #  define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
104 #  define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
105 # else
106 #  define S_ISMPB(m) 0
107 #  define S_ISMPC(m) 0
108 # endif
109 #endif
110
111 #ifndef S_ISNAM /* Xenix */
112 # ifdef S_IFNAM
113 #  define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
114 # else
115 #  define S_ISNAM(m) 0
116 # endif
117 #endif
118
119 #ifndef S_ISNWK /* HP/UX */
120 # ifdef S_IFNWK
121 #  define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
122 # else
123 #  define S_ISNWK(m) 0
124 # endif
125 #endif
126
127 #ifndef S_ISPORT /* Solaris 10 and up */
128 # define S_ISPORT(m) 0
129 #endif
130
131 #ifndef S_ISREG
132 # ifdef S_IFREG
133 #  define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
134 # else
135 #  define S_ISREG(m) 0
136 # endif
137 #endif
138
139 #ifndef S_ISSOCK
140 # ifdef S_IFSOCK
141 #  define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
142 # else
143 #  define S_ISSOCK(m) 0
144 # endif
145 #endif
146
147
148 #ifndef S_TYPEISMQ
149 # define S_TYPEISMQ(p) 0
150 #endif
151
152 #ifndef S_TYPEISTMO
153 # define S_TYPEISTMO(p) 0
154 #endif
155
156
157 #ifndef S_TYPEISSEM
158 # ifdef S_INSEM
159 #  define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM)
160 # else
161 #  define S_TYPEISSEM(p) 0
162 # endif
163 #endif
164
165 #ifndef S_TYPEISSHM
166 # ifdef S_INSHD
167 #  define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD)
168 # else
169 #  define S_TYPEISSHM(p) 0
170 # endif
171 #endif
172
173 /* high performance ("contiguous data") */
174 #ifndef S_ISCTG
175 # define S_ISCTG(p) 0
176 #endif
177
178 /* Cray DMF (data migration facility): off line, with data  */
179 #ifndef S_ISOFD
180 # define S_ISOFD(p) 0
181 #endif
182
183 /* Cray DMF (data migration facility): off line, with no data  */
184 #ifndef S_ISOFL
185 # define S_ISOFL(p) 0
186 #endif
187
188 /* 4.4BSD whiteout */
189 #ifndef S_ISWHT
190 # define S_ISWHT(m) 0
191 #endif
192
193 /* If any of the following are undefined,
194    define them to their de facto standard values.  */
195 #if !S_ISUID
196 # define S_ISUID 04000
197 #endif
198 #if !S_ISGID
199 # define S_ISGID 02000
200 #endif
201
202 /* S_ISVTX is a common extension to POSIX.  */
203 #ifndef S_ISVTX
204 # define S_ISVTX 01000
205 #endif
206
207 #if !S_IRUSR && S_IREAD
208 # define S_IRUSR S_IREAD
209 #endif
210 #if !S_IRUSR
211 # define S_IRUSR 00400
212 #endif
213 #if !S_IRGRP
214 # define S_IRGRP (S_IRUSR >> 3)
215 #endif
216 #if !S_IROTH
217 # define S_IROTH (S_IRUSR >> 6)
218 #endif
219
220 #if !S_IWUSR && S_IWRITE
221 # define S_IWUSR S_IWRITE
222 #endif
223 #if !S_IWUSR
224 # define S_IWUSR 00200
225 #endif
226 #if !S_IWGRP
227 # define S_IWGRP (S_IWUSR >> 3)
228 #endif
229 #if !S_IWOTH
230 # define S_IWOTH (S_IWUSR >> 6)
231 #endif
232
233 #if !S_IXUSR && S_IEXEC
234 # define S_IXUSR S_IEXEC
235 #endif
236 #if !S_IXUSR
237 # define S_IXUSR 00100
238 #endif
239 #if !S_IXGRP
240 # define S_IXGRP (S_IXUSR >> 3)
241 #endif
242 #if !S_IXOTH
243 # define S_IXOTH (S_IXUSR >> 6)
244 #endif
245
246 #if !S_IRWXU
247 # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
248 #endif
249 #if !S_IRWXG
250 # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
251 #endif
252 #if !S_IRWXO
253 # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
254 #endif
255
256 /* S_IXUGO is a common extension to POSIX.  */
257 #if !S_IXUGO
258 # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
259 #endif
260
261 #ifndef S_IRWXUGO
262 # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
263 #endif
264
265 /* mingw does not support symlinks, therefore it does not have lstat.  But
266    without links, stat does just fine.  */
267 #if ! 1
268 # define lstat stat
269 #endif
270
271 #if 0
272 # undef mkdir
273 # define mkdir rpl_mkdir
274 extern int mkdir (char const *name, mode_t mode);
275 #else
276 /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
277    Additionally, it declares _mkdir (and depending on compile flags, an
278    alias mkdir), only in the nonstandard <io.h>, which is included above.  */
279 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
280
281 static inline int
282 rpl_mkdir (char const *name, mode_t mode)
283 {
284   return _mkdir (name);
285 }
286
287 #  define mkdir rpl_mkdir
288 # endif
289 #endif
290
291 #endif /* _GL_SYS_STAT_H */
292 #endif /* _GL_SYS_STAT_H */