|
1 | 1 | #ifndef LIBW32_DIRENT_H_INCLUDED
|
2 | 2 | #define LIBW32_DIRENT_H_INCLUDED
|
3 | 3 | #include <edidentifier.h>
|
4 |
| -__CIDENT_RCSID(gr_libw32_dirent_h,"$Id: dirent.h,v 1.20 2025/03/06 16:59:45 cvsuser Exp $") |
| 4 | +__CIDENT_RCSID(gr_libw32_dirent_h,"$Id: dirent.h,v 1.22 2025/03/12 16:08:09 cvsuser Exp $") |
5 | 5 | __CPRAGMA_ONCE
|
6 | 6 |
|
7 | 7 | /* -*- mode: c; indent-width: 4; -*- */
|
@@ -77,6 +77,12 @@ struct dirent {
|
77 | 77 | #define _DIRENT_HAVE_D_TYPE /* BSD extension */
|
78 | 78 | #endif
|
79 | 79 |
|
| 80 | +#ifndef _GENERIC_DIRSIZ |
| 81 | +#define _GENERIC_DIRLEN(__namlen) \ |
| 82 | + ((offsetof(struct dirent, d_name) + ((__namlen) * sizeof(char)) + 1 + 7) & ~7) |
| 83 | +#define _GENERIC_DIRSIZ(dp) _GENERIC_DIRLEN((dp)->d_namlen) |
| 84 | +#endif |
| 85 | + |
80 | 86 | #if defined(_POSIX_SOURCE) && !defined(_DIRENT_SOURCE)
|
81 | 87 | time_t d_reserved1;
|
82 | 88 | time_t d_reserved2;
|
@@ -109,6 +115,13 @@ struct _wdirent {
|
109 | 115 | unsigned long d_fileno; /* File number directory */
|
110 | 116 | unsigned short d_reclen; /* Length of this record, in bytes */
|
111 | 117 | unsigned short d_namlen; /* Length of string in d_name, excluding terminating null; in characters. */
|
| 118 | + |
| 119 | +#ifndef _GENERIC_WDIRSIZ |
| 120 | +#define _GENERIC_WDIRLEN(__namlen) \ |
| 121 | + ((offsetof(struct dirent, d_name) + ((__namlen) * sizeof(wchar_t)) + 1 + 7) & ~7) |
| 122 | +#define _GENERIC_WDIRSIZ(dp) _GENERIC_WDIRLEN((dp)->d_namlen) |
| 123 | +#endif |
| 124 | + |
112 | 125 | #if defined(_POSIX_SOURCE) && !defined(_DIRENT_SOURCE)
|
113 | 126 | time_t d_reserved1;
|
114 | 127 | time_t d_reserved2;
|
@@ -229,12 +242,12 @@ LIBW32_API void _wseekdir __P((_WDIR *, long));
|
229 | 242 | LIBW32_API long _wtelldir __P((_WDIR *));
|
230 | 243 | LIBW32_API int _wreaddir_r __P((_WDIR *, struct _wdirent *, struct _wdirent **)); /*deprecated*/
|
231 | 244 |
|
232 |
| -//LIBW32_API int alphasort __P((const void *, const void *)); |
233 |
| -//LIBW32_API int scandir __P((void)); |
234 |
| -//LIBW32_API int getdirentries __P((int, char *, int, long *)); |
| 245 | +LIBW32_API int alphasort __P((const struct dirent **, const struct dirent **)); |
| 246 | +LIBW32_API int scandir __P((const char *, struct dirent ***, |
| 247 | + int (*sel)(const struct dirent *), int (*compar)(const struct dirent **, const struct dirent **))); |
| 248 | + |
235 | 249 | #endif /*_POSIX_SOURCE*/
|
236 | 250 |
|
237 | 251 | __END_DECLS
|
238 | 252 |
|
239 | 253 | #endif /*LIBW32_DIRENT_H_INCLUDED*/
|
240 |
| - |
|
0 commit comments