GDBserver
dirent.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A GNU-like <dirent.h>.
3  Copyright (C) 2006-2016 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 of the License, or
8  (at your option) 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, see <http://www.gnu.org/licenses/>. */
17 
18 #ifndef _GL_DIRENT_H
19 
20 #if __GNUC__ >= 3
21 #pragma GCC system_header
22 #endif
23 
24 
25 /* The include_next requires a split double-inclusion guard. */
26 #if 1
27 # include_next <dirent.h>
28 #endif
29 
30 #ifndef _GL_DIRENT_H
31 #define _GL_DIRENT_H
32 
33 /* Get ino_t. Needed on some systems, including glibc 2.8. */
34 #include <sys/types.h>
35 
36 #if !1
37 /* Define types DIR and 'struct dirent'. */
38 # if !GNULIB_defined_struct_dirent
39 struct dirent
40 {
41  char d_type;
42  char d_name[1];
43 };
44 /* Possible values for 'd_type'. */
45 # define DT_UNKNOWN 0
46 # define DT_FIFO 1 /* FIFO */
47 # define DT_CHR 2 /* character device */
48 # define DT_DIR 4 /* directory */
49 # define DT_BLK 6 /* block device */
50 # define DT_REG 8 /* regular file */
51 # define DT_LNK 10 /* symbolic link */
52 # define DT_SOCK 12 /* socket */
53 # define DT_WHT 14 /* whiteout */
54 typedef struct gl_directory DIR;
55 # define GNULIB_defined_struct_dirent 1
56 # endif
57 #endif
58 
59 /* The __attribute__ feature is available in gcc versions 2.5 and later.
60  The attribute __pure__ was added in gcc 2.96. */
61 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
62 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
63 #else
64 # define _GL_ATTRIBUTE_PURE /* empty */
65 #endif
66 
67 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
68 #ifndef _GL_CXXDEFS_H
69 #define _GL_CXXDEFS_H
70 
71 /* Begin/end the GNULIB_NAMESPACE namespace. */
72 #if defined __cplusplus && defined GNULIB_NAMESPACE
73 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
74 # define _GL_END_NAMESPACE }
75 #else
76 # define _GL_BEGIN_NAMESPACE
77 # define _GL_END_NAMESPACE
78 #endif
79 
80 /* The three most frequent use cases of these macros are:
81 
82  * For providing a substitute for a function that is missing on some
83  platforms, but is declared and works fine on the platforms on which
84  it exists:
85 
86  #if @GNULIB_FOO@
87  # if !@HAVE_FOO@
88  _GL_FUNCDECL_SYS (foo, ...);
89  # endif
90  _GL_CXXALIAS_SYS (foo, ...);
91  _GL_CXXALIASWARN (foo);
92  #elif defined GNULIB_POSIXCHECK
93  ...
94  #endif
95 
96  * For providing a replacement for a function that exists on all platforms,
97  but is broken/insufficient and needs to be replaced on some platforms:
98 
99  #if @GNULIB_FOO@
100  # if @REPLACE_FOO@
101  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
102  # undef foo
103  # define foo rpl_foo
104  # endif
105  _GL_FUNCDECL_RPL (foo, ...);
106  _GL_CXXALIAS_RPL (foo, ...);
107  # else
108  _GL_CXXALIAS_SYS (foo, ...);
109  # endif
110  _GL_CXXALIASWARN (foo);
111  #elif defined GNULIB_POSIXCHECK
112  ...
113  #endif
114 
115  * For providing a replacement for a function that exists on some platforms
116  but is broken/insufficient and needs to be replaced on some of them and
117  is additionally either missing or undeclared on some other platforms:
118 
119  #if @GNULIB_FOO@
120  # if @REPLACE_FOO@
121  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
122  # undef foo
123  # define foo rpl_foo
124  # endif
125  _GL_FUNCDECL_RPL (foo, ...);
126  _GL_CXXALIAS_RPL (foo, ...);
127  # else
128  # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
129  _GL_FUNCDECL_SYS (foo, ...);
130  # endif
131  _GL_CXXALIAS_SYS (foo, ...);
132  # endif
133  _GL_CXXALIASWARN (foo);
134  #elif defined GNULIB_POSIXCHECK
135  ...
136  #endif
137 */
138 
139 /* _GL_EXTERN_C declaration;
140  performs the declaration with C linkage. */
141 #if defined __cplusplus
142 # define _GL_EXTERN_C extern "C"
143 #else
144 # define _GL_EXTERN_C extern
145 #endif
146 
147 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
148  declares a replacement function, named rpl_func, with the given prototype,
149  consisting of return type, parameters, and attributes.
150  Example:
151  _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
152  _GL_ARG_NONNULL ((1)));
153  */
154 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
155  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
156 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
157  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
158 
159 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
160  declares the system function, named func, with the given prototype,
161  consisting of return type, parameters, and attributes.
162  Example:
163  _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
164  _GL_ARG_NONNULL ((1)));
165  */
166 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
167  _GL_EXTERN_C rettype func parameters_and_attributes
168 
169 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
170  declares a C++ alias called GNULIB_NAMESPACE::func
171  that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
172  Example:
173  _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
174 
175  Wrapping rpl_func in an object with an inline conversion operator
176  avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
177  actually used in the program. */
178 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
179  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
180 #if defined __cplusplus && defined GNULIB_NAMESPACE
181 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
182  namespace GNULIB_NAMESPACE \
183  { \
184  static const struct _gl_ ## func ## _wrapper \
185  { \
186  typedef rettype (*type) parameters; \
187  inline type rpl () const { return ::rpl_func; } \
188  inline operator type () const { return rpl (); } \
189  } func = {}; \
190  } \
191  _GL_EXTERN_C int _gl_cxxalias_dummy
192 #else
193 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
194  _GL_EXTERN_C int _gl_cxxalias_dummy
195 #endif
196 
197 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
198  is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
199  except that the C function rpl_func may have a slightly different
200  declaration. A cast is used to silence the "invalid conversion" error
201  that would otherwise occur. */
202 #if defined __cplusplus && defined GNULIB_NAMESPACE
203 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
204  namespace GNULIB_NAMESPACE \
205  { \
206  static const struct _gl_ ## func ## _wrapper \
207  { \
208  typedef rettype (*type) parameters; \
209  inline type rpl () const \
210  { return reinterpret_cast<type>(::rpl_func); } \
211  inline operator type () const { return rpl (); } \
212  } func = {}; \
213  } \
214  _GL_EXTERN_C int _gl_cxxalias_dummy
215 #else
216 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
217  _GL_EXTERN_C int _gl_cxxalias_dummy
218 #endif
219 
220 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
221  declares a C++ alias called GNULIB_NAMESPACE::func
222  that redirects to the system provided function func, if GNULIB_NAMESPACE
223  is defined.
224  Example:
225  _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
226 
227  Wrapping func in an object with an inline conversion operator
228  avoids a reference to func unless GNULIB_NAMESPACE::func is
229  actually used in the program. */
230 #if defined __cplusplus && defined GNULIB_NAMESPACE
231 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
232  namespace GNULIB_NAMESPACE \
233  { \
234  static const struct _gl_ ## func ## _wrapper \
235  { \
236  typedef rettype (*type) parameters; \
237  inline type rpl () const { return ::func; } \
238  inline operator type () const { return rpl (); } \
239  } func = {}; \
240  } \
241  _GL_EXTERN_C int _gl_cxxalias_dummy
242 #else
243 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
244  _GL_EXTERN_C int _gl_cxxalias_dummy
245 #endif
246 
247 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
248  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
249  except that the C function func may have a slightly different declaration.
250  A cast is used to silence the "invalid conversion" error that would
251  otherwise occur. */
252 #if defined __cplusplus && defined GNULIB_NAMESPACE
253 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
254  namespace GNULIB_NAMESPACE \
255  { \
256  static const struct _gl_ ## func ## _wrapper \
257  { \
258  typedef rettype (*type) parameters; \
259  inline type rpl () const \
260  { return reinterpret_cast<type>(::func); } \
261  inline operator type () const { return rpl (); }\
262  } func = {}; \
263  } \
264  _GL_EXTERN_C int _gl_cxxalias_dummy
265 #else
266 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
267  _GL_EXTERN_C int _gl_cxxalias_dummy
268 #endif
269 
270 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
271  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
272  except that the C function is picked among a set of overloaded functions,
273  namely the one with rettype2 and parameters2. Two consecutive casts
274  are used to silence the "cannot find a match" and "invalid conversion"
275  errors that would otherwise occur. */
276 #if defined __cplusplus && defined GNULIB_NAMESPACE
277  /* The outer cast must be a reinterpret_cast.
278  The inner cast: When the function is defined as a set of overloaded
279  functions, it works as a static_cast<>, choosing the designated variant.
280  When the function is defined as a single variant, it works as a
281  reinterpret_cast<>. The parenthesized cast syntax works both ways. */
282 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
283  namespace GNULIB_NAMESPACE \
284  { \
285  static const struct _gl_ ## func ## _wrapper \
286  { \
287  typedef rettype (*type) parameters; \
288  \
289  inline type rpl () const \
290  { return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); }\
291  \
292  inline operator type () const { return rpl (); } \
293  } func = {}; \
294  } \
295  _GL_EXTERN_C int _gl_cxxalias_dummy
296 #else
297 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
298  _GL_EXTERN_C int _gl_cxxalias_dummy
299 #endif
300 
301 /* _GL_CXXALIASWARN (func);
302  causes a warning to be emitted when ::func is used but not when
303  GNULIB_NAMESPACE::func is used. func must be defined without overloaded
304  variants. */
305 #if defined __cplusplus && defined GNULIB_NAMESPACE
306 # define _GL_CXXALIASWARN(func) \
307  _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
308 # define _GL_CXXALIASWARN_1(func,namespace) \
309  _GL_CXXALIASWARN_2 (func, namespace)
310 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
311  we enable the warning only when not optimizing. */
312 # if !__OPTIMIZE__
313 # define _GL_CXXALIASWARN_2(func,namespace) \
314  _GL_WARN_ON_USE (func, \
315  "The symbol ::" #func " refers to the system function. " \
316  "Use " #namespace "::" #func " instead.")
317 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
318 # define _GL_CXXALIASWARN_2(func,namespace) \
319  extern __typeof__ (func) func
320 # else
321 # define _GL_CXXALIASWARN_2(func,namespace) \
322  _GL_EXTERN_C int _gl_cxxalias_dummy
323 # endif
324 #else
325 # define _GL_CXXALIASWARN(func) \
326  _GL_EXTERN_C int _gl_cxxalias_dummy
327 #endif
328 
329 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
330  causes a warning to be emitted when the given overloaded variant of ::func
331  is used but not when GNULIB_NAMESPACE::func is used. */
332 #if defined __cplusplus && defined GNULIB_NAMESPACE
333 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
334  _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
335  GNULIB_NAMESPACE)
336 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
337  _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
338 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
339  we enable the warning only when not optimizing. */
340 # if !__OPTIMIZE__
341 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
342  _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
343  "The symbol ::" #func " refers to the system function. " \
344  "Use " #namespace "::" #func " instead.")
345 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
346 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
347  extern __typeof__ (func) func
348 # else
349 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
350  _GL_EXTERN_C int _gl_cxxalias_dummy
351 # endif
352 #else
353 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
354  _GL_EXTERN_C int _gl_cxxalias_dummy
355 #endif
356 
357 #endif /* _GL_CXXDEFS_H */
358 
359 /* The definition of _GL_ARG_NONNULL is copied here. */
360 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
361  that the values passed as arguments n, ..., m must be non-NULL pointers.
362  n = 1 stands for the first argument, n = 2 for the second argument etc. */
363 #ifndef _GL_ARG_NONNULL
364 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
365 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
366 # else
367 # define _GL_ARG_NONNULL(params)
368 # endif
369 #endif
370 
371 /* The definition of _GL_WARN_ON_USE is copied here. */
372 #ifndef _GL_WARN_ON_USE
373 
374 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
375 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
376 # define _GL_WARN_ON_USE(function, message) \
377 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
378 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
379 /* Verify the existence of the function. */
380 # define _GL_WARN_ON_USE(function, message) \
381 extern __typeof__ (function) function
382 # else /* Unsupported. */
383 # define _GL_WARN_ON_USE(function, message) \
384 _GL_WARN_EXTERN_C int _gl_warn_on_use
385 # endif
386 #endif
387 
388 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
389  is like _GL_WARN_ON_USE (function, "string"), except that the function is
390  declared with the given prototype, consisting of return type, parameters,
391  and attributes.
392  This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
393  not work in this case. */
394 #ifndef _GL_WARN_ON_USE_CXX
395 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
396 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
397 extern rettype function parameters_and_attributes \
398  __attribute__ ((__warning__ (msg)))
399 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
400 /* Verify the existence of the function. */
401 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
402 extern rettype function parameters_and_attributes
403 # else /* Unsupported. */
404 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
405 _GL_WARN_EXTERN_C int _gl_warn_on_use
406 # endif
407 #endif
408 
409 /* _GL_WARN_EXTERN_C declaration;
410  performs the declaration with C linkage. */
411 #ifndef _GL_WARN_EXTERN_C
412 # if defined __cplusplus
413 # define _GL_WARN_EXTERN_C extern "C"
414 # else
415 # define _GL_WARN_EXTERN_C extern
416 # endif
417 #endif
418 
419 
420 /* Declare overridden functions. */
421 
422 #if 1
423 # if 0
424 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
425 # undef opendir
426 # define opendir rpl_opendir
427 # define GNULIB_defined_opendir 1
428 # endif
429 _GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
430 _GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
431 # else
432 # if !1
433 _GL_FUNCDECL_SYS (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
434 # endif
435 _GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
436 # endif
437 _GL_CXXALIASWARN (opendir);
438 #elif defined GNULIB_POSIXCHECK
439 # undef opendir
440 # if HAVE_RAW_DECL_OPENDIR
441 _GL_WARN_ON_USE (opendir, "opendir is not portable - "
442  "use gnulib module opendir for portability");
443 # endif
444 #endif
445 
446 #if 1
447 # if !1
448 _GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1)));
449 # endif
450 _GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp));
451 _GL_CXXALIASWARN (readdir);
452 #elif defined GNULIB_POSIXCHECK
453 # undef readdir
454 # if HAVE_RAW_DECL_READDIR
455 _GL_WARN_ON_USE (readdir, "readdir is not portable - "
456  "use gnulib module readdir for portability");
457 # endif
458 #endif
459 
460 #if 1
461 # if !1
462 _GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1)));
463 # endif
464 _GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp));
465 _GL_CXXALIASWARN (rewinddir);
466 #elif defined GNULIB_POSIXCHECK
467 # undef rewinddir
468 # if HAVE_RAW_DECL_REWINDDIR
469 _GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - "
470  "use gnulib module rewinddir for portability");
471 # endif
472 #endif
473 
474 #if 1
475 # if 0
476 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
477 # undef closedir
478 # define closedir rpl_closedir
479 # define GNULIB_defined_closedir 1
480 # endif
481 _GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
482 _GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
483 # else
484 # if !1
485 _GL_FUNCDECL_SYS (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
486 # endif
487 _GL_CXXALIAS_SYS (closedir, int, (DIR *dirp));
488 # endif
489 _GL_CXXALIASWARN (closedir);
490 #elif defined GNULIB_POSIXCHECK
491 # undef closedir
492 # if HAVE_RAW_DECL_CLOSEDIR
493 _GL_WARN_ON_USE (closedir, "closedir is not portable - "
494  "use gnulib module closedir for portability");
495 # endif
496 #endif
497 
498 #if 1
499 /* Return the file descriptor associated with the given directory stream,
500  or -1 if none exists. */
501 # if 0
502 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
503 # undef dirfd
504 # define dirfd rpl_dirfd
505 # endif
506 _GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
507 _GL_CXXALIAS_RPL (dirfd, int, (DIR *));
508 
509 # ifdef __KLIBC__
510 /* Gnulib internal hooks needed to maintain the dirfd metadata. */
511 _GL_EXTERN_C int _gl_register_dirp_fd (int fd, DIR *dirp)
512  _GL_ARG_NONNULL ((2));
513 _GL_EXTERN_C void _gl_unregister_dirp_fd (int fd);
514 # endif
515 # else
516 # if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
517  /* dirfd is defined as a macro and not as a function.
518  Turn it into a function and get rid of the macro. */
519 static inline int (dirfd) (DIR *dp) { return dirfd (dp); }
520 # undef dirfd
521 # endif
522 # if !(1 || defined dirfd)
523 _GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
524 # endif
525 _GL_CXXALIAS_SYS (dirfd, int, (DIR *));
526 # endif
527 _GL_CXXALIASWARN (dirfd);
528 #elif defined GNULIB_POSIXCHECK
529 # undef dirfd
530 # if HAVE_RAW_DECL_DIRFD
531 _GL_WARN_ON_USE (dirfd, "dirfd is unportable - "
532  "use gnulib module dirfd for portability");
533 # endif
534 #endif
535 
536 #if 1
537 /* Open a directory stream visiting the given directory file
538  descriptor. Return NULL and set errno if fd is not visiting a
539  directory. On success, this function consumes fd (it will be
540  implicitly closed either by this function or by a subsequent
541  closedir). */
542 # if 0
543 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
544 # undef fdopendir
545 # define fdopendir rpl_fdopendir
546 # endif
547 _GL_FUNCDECL_RPL (fdopendir, DIR *, (int fd));
548 _GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd));
549 # else
550 # if !1 || !1
551 _GL_FUNCDECL_SYS (fdopendir, DIR *, (int fd));
552 # endif
553 _GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));
554 # endif
555 _GL_CXXALIASWARN (fdopendir);
556 #elif defined GNULIB_POSIXCHECK
557 # undef fdopendir
558 # if HAVE_RAW_DECL_FDOPENDIR
559 _GL_WARN_ON_USE (fdopendir, "fdopendir is unportable - "
560  "use gnulib module fdopendir for portability");
561 # endif
562 #endif
563 
564 #if 0
565 /* Scan the directory DIR, calling FILTER on each directory entry.
566  Entries for which FILTER returns nonzero are individually malloc'd,
567  sorted using qsort with CMP, and collected in a malloc'd array in
568  *NAMELIST. Returns the number of entries selected, or -1 on error. */
569 # if !1
570 _GL_FUNCDECL_SYS (scandir, int,
571  (const char *dir, struct dirent ***namelist,
572  int (*filter) (const struct dirent *),
573  int (*cmp) (const struct dirent **, const struct dirent **))
574  _GL_ARG_NONNULL ((1, 2, 4)));
575 # endif
576 /* Need to cast, because on glibc systems, the fourth parameter is
577  int (*cmp) (const void *, const void *). */
578 _GL_CXXALIAS_SYS_CAST (scandir, int,
579  (const char *dir, struct dirent ***namelist,
580  int (*filter) (const struct dirent *),
581  int (*cmp) (const struct dirent **, const struct dirent **)));
582 _GL_CXXALIASWARN (scandir);
583 #elif defined GNULIB_POSIXCHECK
584 # undef scandir
585 # if HAVE_RAW_DECL_SCANDIR
586 _GL_WARN_ON_USE (scandir, "scandir is unportable - "
587  "use gnulib module scandir for portability");
588 # endif
589 #endif
590 
591 #if 0
592 /* Compare two 'struct dirent' entries alphabetically. */
593 # if !1
594 _GL_FUNCDECL_SYS (alphasort, int,
595  (const struct dirent **, const struct dirent **)
597  _GL_ARG_NONNULL ((1, 2)));
598 # endif
599 /* Need to cast, because on glibc systems, the parameters are
600  (const void *, const void *). */
601 _GL_CXXALIAS_SYS_CAST (alphasort, int,
602  (const struct dirent **, const struct dirent **));
603 _GL_CXXALIASWARN (alphasort);
604 #elif defined GNULIB_POSIXCHECK
605 # undef alphasort
606 # if HAVE_RAW_DECL_ALPHASORT
607 _GL_WARN_ON_USE (alphasort, "alphasort is unportable - "
608  "use gnulib module alphasort for portability");
609 # endif
610 #endif
611 
612 
613 #endif /* _GL_DIRENT_H */
614 #endif /* _GL_DIRENT_H */
#define _GL_CXXALIASWARN(func)
Definition: dirent.h:325
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: dirent.h:243
#define _GL_ATTRIBUTE_PURE
Definition: dirent.h:64
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: dirent.h:178
#define _GL_WARN_ON_USE(function, message)
Definition: dirent.h:383
#define _GL_ARG_NONNULL(params)
Definition: dirent.h:367
#define _GL_EXTERN_C
Definition: dirent.h:144
#define _GL_CXXALIAS_SYS_CAST(func, rettype, parameters)
Definition: dirent.h:266
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: dirent.h:166
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: dirent.h:154