Visual C++ backend for rbuild (for now just a hacked mingw backend) and related compi...
[reactos.git] / include / crt / wchar.h
1 /*
2 * wchar.h
3 * This file has no copyright assigned and is placed in the Public Domain.
4 * This file is a part of the mingw-runtime package.
5 * No warranty is given; refer to the file DISCLAIMER within the package.
6 *
7 * Defines of all functions for supporting wide characters. Actually it
8 * just includes all those headers, which is not a good thing to do from a
9 * processing time point of view, but it does mean that everything will be
10 * in sync.
11 *
12 */
13
14 #ifndef _WCHAR_H_
15 #define _WCHAR_H_
16
17 /* All the headers include this file. */
18 #include <_mingw.h>
19
20 #ifndef RC_INVOKED
21
22 #define __need_size_t
23 #define __need_wint_t
24 #define __need_wchar_t
25 #define __need_NULL
26 #include <stddef.h>
27
28 #ifndef __VALIST
29 #if defined __GNUC__ && __GNUC__ >= 3
30 #define __need___va_list
31 #include <stdarg.h>
32 #define __VALIST __builtin_va_list
33 #else
34 #define __VALIST char*
35 #endif
36 #endif
37
38 #endif /* Not RC_INVOKED */
39
40 /*
41 * MSDN says that isw* char classifications are in wchar.h and wctype.h.
42 * Although the wctype names are ANSI, their exposure in this header is
43 * not.
44 */
45 #include <wctype.h>
46
47 #ifndef __STRICT_ANSI__
48 /* This is necessary to support the the non-ANSI wchar declarations
49 here. */
50 #include <sys/types.h>
51 #endif /* __STRICT_ANSI__ */
52
53 #define WCHAR_MIN 0
54 #define WCHAR_MAX 0xffff
55
56 #ifndef WEOF
57 #define WEOF (wchar_t)(0xFFFF)
58 #endif
59
60 #ifndef RC_INVOKED
61
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65
66 #ifndef _FILE_DEFINED /* Also in stdio.h */
67 #define _FILE_DEFINED
68 typedef struct _iobuf
69 {
70 char* _ptr;
71 int _cnt;
72 char* _base;
73 int _flag;
74 int _file;
75 int _charbuf;
76 int _bufsiz;
77 char* _tmpfname;
78 } FILE;
79 #endif /* Not _FILE_DEFINED */
80
81 #ifndef _TIME_T_DEFINED /* Also in time.h */
82 typedef long time_t;
83 #define _TIME_T_DEFINED
84 #endif
85
86 #ifndef _TM_DEFINED /* Also in time.h */
87 struct tm {
88 int tm_sec; /* seconds after the minute - [0,59] */
89 int tm_min; /* minutes after the hour - [0,59] */
90 int tm_hour; /* hours since midnight - [0,23] */
91 int tm_mday; /* day of the month - [1,31] */
92 int tm_mon; /* months since January - [0,11] */
93 int tm_year; /* years since 1900 */
94 int tm_wday; /* days since Sunday - [0,6] */
95 int tm_yday; /* days since January 1 - [0,365] */
96 int tm_isdst; /* daylight savings time flag */
97 };
98 #define _TM_DEFINED
99 #endif
100
101 #ifndef _WSTDIO_DEFINED
102 /* Also in stdio.h - keep in sync */
103 _CRTIMP int __cdecl __MINGW_NOTHROW fwprintf (FILE*, const wchar_t*, ...);
104 _CRTIMP int __cdecl __MINGW_NOTHROW wprintf (const wchar_t*, ...);
105 _CRTIMP int __cdecl __MINGW_NOTHROW swprintf (wchar_t*, const wchar_t*, ...);
106 _CRTIMP int __cdecl __MINGW_NOTHROW _snwprintf (wchar_t*, size_t, const wchar_t*, ...);
107 _CRTIMP int __cdecl __MINGW_NOTHROW vfwprintf (FILE*, const wchar_t*, __VALIST);
108 _CRTIMP int __cdecl __MINGW_NOTHROW vwprintf (const wchar_t*, __VALIST);
109 _CRTIMP int __cdecl __MINGW_NOTHROW vswprintf (wchar_t*, const wchar_t*, __VALIST);
110 _CRTIMP int __cdecl __MINGW_NOTHROW _vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST);
111 _CRTIMP int __cdecl __MINGW_NOTHROW fwscanf (FILE*, const wchar_t*, ...);
112 _CRTIMP int __cdecl __MINGW_NOTHROW wscanf (const wchar_t*, ...);
113 _CRTIMP int __cdecl __MINGW_NOTHROW swscanf (const wchar_t*, const wchar_t*, ...);
114 _CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwc (FILE*);
115 _CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwc (wchar_t, FILE*);
116 _CRTIMP wint_t __cdecl __MINGW_NOTHROW ungetwc (wchar_t, FILE*);
117
118 #ifdef __MSVCRT__
119 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*);
120 _CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*);
121 _CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*);
122 _CRTIMP wint_t __cdecl __MINGW_NOTHROW getwchar (void);
123 _CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*);
124 _CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t);
125 #ifndef __STRICT_ANSI__
126 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*);
127 _CRTIMP int __cdecl __MINGW_NOTHROW _putws (const wchar_t*);
128 _CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfdopen(int, wchar_t *);
129 _CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfopen (const wchar_t*, const wchar_t*);
130 _CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfreopen (const wchar_t*, const wchar_t*, FILE*);
131 _CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfsopen (const wchar_t*, const wchar_t*, int);
132 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtmpnam (wchar_t*);
133 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtempnam (const wchar_t*, const wchar_t*);
134 _CRTIMP int __cdecl __MINGW_NOTHROW _wrename (const wchar_t*, const wchar_t*);
135 _CRTIMP int __cdecl __MINGW_NOTHROW _wremove (const wchar_t*);
136 _CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*);
137 _CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*);
138 #endif /* __STRICT_ANSI__ */
139 #endif /* __MSVCRT__ */
140
141 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
142 int __cdecl __MINGW_NOTHROW snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...);
143 __CRT_INLINE int __cdecl __MINGW_NOTHROW
144 vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg)
145 { return _vsnwprintf ( s, n, format, arg);}
146 int __cdecl __MINGW_NOTHROW vwscanf (const wchar_t * __restrict__, __VALIST);
147 int __cdecl __MINGW_NOTHROW vfwscanf (FILE * __restrict__,
148 const wchar_t * __restrict__, __VALIST);
149 int __cdecl __MINGW_NOTHROW vswscanf (const wchar_t * __restrict__,
150 const wchar_t * __restrict__, __VALIST);
151 #endif
152
153 #define _WSTDIO_DEFINED
154 #endif /* _WSTDIO_DEFINED */
155 #ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */
156 _CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int);
157 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int);
158 _CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**);
159 #if !defined __NO_ISOCEXT /* in libmingwex.a */
160 float __cdecl __MINGW_NOTHROW wcstof (const wchar_t * __restrict__, wchar_t ** __restrict__);
161 long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
162 #endif /* __NO_ISOCEXT */
163 #ifdef __MSVCRT__
164 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*);
165 _CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*);
166 _CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
167 _CRTIMP int __cdecl __MINGW_NOTHROW _wsystem(const wchar_t*);
168 _CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
169 _CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
170 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t);
171 #endif
172 #define _WSTDLIB_DEFINED
173 #endif /* _WSTDLIB_DEFINED */
174
175 #ifndef _WTIME_DEFINED
176 #ifndef __STRICT_ANSI__
177 #ifdef __MSVCRT__
178 /* wide function prototypes, also declared in time.h */
179 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wasctime (const struct tm*);
180 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t*);
181 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrdate (wchar_t*);
182 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrtime (wchar_t*);
183 #if __MSVCRT_VERSION__ >= 0x601
184 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime64 (const __time64_t*);
185 #endif
186 #endif /* __MSVCRT__ */
187 #endif /* __STRICT_ANSI__ */
188 _CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
189 #define _WTIME_DEFINED
190 #endif /* _WTIME_DEFINED */
191
192
193 #ifndef _WSTRING_DEFINED
194 /*
195 * Unicode versions of the standard string calls.
196 * Also in string.h.
197 */
198 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscat (wchar_t*, const wchar_t*);
199 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcschr (const wchar_t*, wchar_t);
200 _CRTIMP int __cdecl __MINGW_NOTHROW wcscmp (const wchar_t*, const wchar_t*);
201 _CRTIMP int __cdecl __MINGW_NOTHROW wcscoll (const wchar_t*, const wchar_t*);
202 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscpy (wchar_t*, const wchar_t*);
203 _CRTIMP size_t __cdecl __MINGW_NOTHROW wcscspn (const wchar_t*, const wchar_t*);
204 /* Note: _wcserror requires __MSVCRT_VERSION__ >= 0x0700. */
205 _CRTIMP size_t __cdecl __MINGW_NOTHROW wcslen (const wchar_t*);
206 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncat (wchar_t*, const wchar_t*, size_t);
207 _CRTIMP int __cdecl __MINGW_NOTHROW wcsncmp(const wchar_t*, const wchar_t*, size_t);
208 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncpy(wchar_t*, const wchar_t*, size_t);
209 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcspbrk(const wchar_t*, const wchar_t*);
210 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrchr(const wchar_t*, wchar_t);
211 _CRTIMP size_t __cdecl __MINGW_NOTHROW wcsspn(const wchar_t*, const wchar_t*);
212 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsstr(const wchar_t*, const wchar_t*);
213 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcstok(wchar_t*, const wchar_t*);
214 _CRTIMP size_t __cdecl __MINGW_NOTHROW wcsxfrm(wchar_t*, const wchar_t*, size_t);
215
216 #ifndef __STRICT_ANSI__
217 /*
218 * Unicode versions of non-ANSI functions provided by CRTDLL.
219 */
220
221 /* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
222 #define _wcscmpi _wcsicmp
223
224 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsdup (const wchar_t*);
225 _CRTIMP int __cdecl __MINGW_NOTHROW _wcsicmp (const wchar_t*, const wchar_t*);
226 _CRTIMP int __cdecl __MINGW_NOTHROW _wcsicoll (const wchar_t*, const wchar_t*);
227 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcslwr (wchar_t*);
228 _CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
229 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsnset (wchar_t*, wchar_t, size_t);
230 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsrev (wchar_t*);
231 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsset (wchar_t*, wchar_t);
232 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsupr (wchar_t*);
233
234 #ifdef __MSVCRT__
235 _CRTIMP int __cdecl __MINGW_NOTHROW _wcsncoll(const wchar_t*, const wchar_t*, size_t);
236 _CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
237 #if __MSVCRT_VERSION__ >= 0x0700
238 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcserror(int);
239 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW __wcserror(const wchar_t*);
240 #endif
241 #endif
242
243 #ifndef _NO_OLDNAMES
244 /* NOTE: There is no _wcscmpi, but this is for compatibility. */
245 __CRT_INLINE int __cdecl __MINGW_NOTHROW
246 wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2)
247 {return _wcsicmp (__ws1, __ws2);}
248 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsdup (const wchar_t*);
249 _CRTIMP int __cdecl __MINGW_NOTHROW wcsicmp (const wchar_t*, const wchar_t*);
250 _CRTIMP int __cdecl __MINGW_NOTHROW wcsicoll (const wchar_t*, const wchar_t*);
251 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcslwr (wchar_t*);
252 _CRTIMP int __cdecl __MINGW_NOTHROW wcsnicmp (const wchar_t*, const wchar_t*, size_t);
253 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsnset (wchar_t*, wchar_t, size_t);
254 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrev (wchar_t*);
255 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsset (wchar_t*, wchar_t);
256 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsupr (wchar_t*);
257 #endif /* Not _NO_OLDNAMES */
258
259 #endif /* Not strict ANSI */
260
261 #define _WSTRING_DEFINED
262 #endif /* _WSTRING_DEFINED */
263
264 /* These are resolved by -lmingwex. Alternatively, they can be resolved by
265 adding -lmsvcp60 to your command line, which will give you the VC++
266 versions of these functions. If you want the latter and don't have
267 msvcp60.dll in your windows system directory, you can easily obtain
268 it with a search from your favorite search engine. */
269 #ifndef __STRICT_ANSI__
270 typedef wchar_t _Wint_t;
271 #endif
272
273 typedef int mbstate_t;
274
275 wint_t __cdecl __MINGW_NOTHROW btowc(int);
276 size_t __cdecl __MINGW_NOTHROW mbrlen(const char * __restrict__, size_t,
277 mbstate_t * __restrict__);
278 size_t __cdecl __MINGW_NOTHROW mbrtowc(wchar_t * __restrict__, const char * __restrict__,
279 size_t, mbstate_t * __restrict__);
280 size_t __cdecl __MINGW_NOTHROW mbsrtowcs(wchar_t * __restrict__, const char ** __restrict__,
281 size_t, mbstate_t * __restrict__);
282 size_t __cdecl __MINGW_NOTHROW wcrtomb(char * __restrict__, wchar_t,
283 mbstate_t * __restrict__);
284 size_t __cdecl __MINGW_NOTHROW wcsrtombs(char * __restrict__, const wchar_t ** __restrict__,
285 size_t, mbstate_t * __restrict__);
286 int __cdecl __MINGW_NOTHROW wctob(wint_t);
287
288 #ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */
289 __CRT_INLINE int __cdecl __MINGW_NOTHROW fwide(FILE* __UNUSED_PARAM(stream),
290 int __UNUSED_PARAM(mode))
291 {return -1;} /* limited to byte orientation */
292 __CRT_INLINE int __cdecl __MINGW_NOTHROW mbsinit(const mbstate_t* __UNUSED_PARAM(ps))
293 {return 1;}
294 wchar_t* __cdecl __MINGW_NOTHROW wmemset(wchar_t *, wchar_t, size_t);
295 wchar_t* __cdecl __MINGW_NOTHROW wmemchr(const wchar_t*, wchar_t, size_t);
296 int wmemcmp(const wchar_t*, const wchar_t *, size_t);
297 wchar_t* __cdecl __MINGW_NOTHROW wmemcpy(wchar_t* __restrict__,
298 const wchar_t* __restrict__,
299 size_t);
300 wchar_t* __cdecl __MINGW_NOTHROW wmemmove(wchar_t* s1, const wchar_t *, size_t);
301 long long __cdecl __MINGW_NOTHROW wcstoll(const wchar_t * __restrict__,
302 wchar_t** __restrict__, int);
303 unsigned long long __cdecl __MINGW_NOTHROW wcstoull(const wchar_t * __restrict__,
304 wchar_t ** __restrict__, int);
305 #endif /* __NO_ISOCEXT */
306
307 #ifndef __STRICT_ANSI__
308 /* non-ANSI wide char functions from io.h, direct.h, sys/stat.h and locale.h. */
309
310 #ifndef _FSIZE_T_DEFINED
311 typedef unsigned long _fsize_t;
312 #define _FSIZE_T_DEFINED
313 #endif
314
315 #ifndef _WFINDDATA_T_DEFINED
316 struct _wfinddata_t {
317 unsigned attrib;
318 time_t time_create; /* -1 for FAT file systems */
319 time_t time_access; /* -1 for FAT file systems */
320 time_t time_write;
321 _fsize_t size;
322 wchar_t name[260]; /* may include spaces. */
323 };
324 struct _wfinddatai64_t {
325 unsigned attrib;
326 time_t time_create;
327 time_t time_access;
328 time_t time_write;
329 __int64 size;
330 wchar_t name[260];
331 };
332 struct __wfinddata64_t {
333 unsigned attrib;
334 __time64_t time_create;
335 __time64_t time_access;
336 __time64_t time_write;
337 _fsize_t size;
338 wchar_t name[260];
339 };
340 #define _WFINDDATA_T_DEFINED
341 #endif
342
343 /* Wide character versions. Also defined in io.h. */
344 /* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also
345 applies to other wide character versions? */
346 #if !defined (_WIO_DEFINED)
347 #if defined (__MSVCRT__)
348 #include <stdint.h> /* For intptr_t. */
349 _CRTIMP int __cdecl __MINGW_NOTHROW _waccess (const wchar_t*, int);
350 _CRTIMP int __cdecl __MINGW_NOTHROW _wchmod (const wchar_t*, int);
351 _CRTIMP int __cdecl __MINGW_NOTHROW _wcreat (const wchar_t*, int);
352 _CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t*, struct _wfinddata_t *);
353 _CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext (long, struct _wfinddata_t *);
354 _CRTIMP int __cdecl __MINGW_NOTHROW _wunlink (const wchar_t*);
355 _CRTIMP int __cdecl __MINGW_NOTHROW _wopen (const wchar_t*, int, ...);
356 _CRTIMP int __cdecl __MINGW_NOTHROW _wsopen (const wchar_t*, int, int, ...);
357 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wmktemp (wchar_t*);
358 _CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*);
359 _CRTIMP int __cdecl __MINGW_NOTHROW _wfindnexti64 (long, struct _wfinddatai64_t*);
360 #if __MSVCRT_VERSION__ >= 0x0601
361 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct __wfinddata64_t*);
362 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*);
363 #endif /* __MSVCRT_VERSION__ >= 0x0601 */
364 #endif /* defined (__MSVCRT__) */
365 #define _WIO_DEFINED
366 #endif /* _WIO_DEFINED */
367
368 #ifndef _WDIRECT_DEFINED
369 /* Also in direct.h */
370 #ifdef __MSVCRT__
371 _CRTIMP int __cdecl __MINGW_NOTHROW _wchdir (const wchar_t*);
372 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetcwd (wchar_t*, int);
373 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetdcwd (int, wchar_t*, int);
374 _CRTIMP int __cdecl __MINGW_NOTHROW _wmkdir (const wchar_t*);
375 _CRTIMP int __cdecl __MINGW_NOTHROW _wrmdir (const wchar_t*);
376 #endif /* __MSVCRT__ */
377 #define _WDIRECT_DEFINED
378 #endif /* _WDIRECT_DEFINED */
379
380 #ifndef _STAT_DEFINED
381 /*
382 * The structure manipulated and returned by stat and fstat.
383 *
384 * NOTE: If called on a directory the values in the time fields are not only
385 * invalid, they will cause localtime et. al. to return NULL. And calling
386 * asctime with a NULL pointer causes an Invalid Page Fault. So watch it!
387 */
388 struct _stat
389 {
390 _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
391 _ino_t st_ino; /* Always zero ? */
392 _mode_t st_mode; /* See above constants */
393 short st_nlink; /* Number of links. */
394 short st_uid; /* User: Maybe significant on NT ? */
395 short st_gid; /* Group: Ditto */
396 _dev_t st_rdev; /* Seems useless (not even filled in) */
397 _off_t st_size; /* File size in bytes */
398 time_t st_atime; /* Accessed date (always 00:00 hrs local
399 * on FAT) */
400 time_t st_mtime; /* Modified time */
401 time_t st_ctime; /* Creation time */
402 };
403
404 #ifndef _NO_OLDNAMES
405 /* NOTE: Must be the same as _stat above. */
406 struct stat
407 {
408 _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
409 _ino_t st_ino; /* Always zero ? */
410 _mode_t st_mode; /* See above constants */
411 short st_nlink; /* Number of links. */
412 short st_uid; /* User: Maybe significant on NT ? */
413 short st_gid; /* Group: Ditto */
414 _dev_t st_rdev; /* Seems useless (not even filled in) */
415 _off_t st_size; /* File size in bytes */
416 time_t st_atime; /* Accessed date (always 00:00 hrs local
417 * on FAT) */
418 time_t st_mtime; /* Modified time */
419 time_t st_ctime; /* Creation time */
420 };
421 #endif /* _NO_OLDNAMES */
422
423 #if defined (__MSVCRT__)
424 struct _stati64 {
425 _dev_t st_dev;
426 _ino_t st_ino;
427 unsigned short st_mode;
428 short st_nlink;
429 short st_uid;
430 short st_gid;
431 _dev_t st_rdev;
432 __int64 st_size;
433 time_t st_atime;
434 time_t st_mtime;
435 time_t st_ctime;
436 };
437
438 struct __stat64
439 {
440 _dev_t st_dev;
441 _ino_t st_ino;
442 _mode_t st_mode;
443 short st_nlink;
444 short st_uid;
445 short st_gid;
446 _dev_t st_rdev;
447 __int64 st_size;
448 __time64_t st_atime;
449 __time64_t st_mtime;
450 __time64_t st_ctime;
451 };
452 #endif /* __MSVCRT__ */
453 #define _STAT_DEFINED
454 #endif /* _STAT_DEFINED */
455
456 #if !defined ( _WSTAT_DEFINED)
457 /* also declared in sys/stat.h */
458 #if defined __MSVCRT__
459 _CRTIMP int __cdecl __MINGW_NOTHROW _wstat (const wchar_t*, struct _stat*);
460 _CRTIMP int __cdecl __MINGW_NOTHROW _wstati64 (const wchar_t*, struct _stati64*);
461 #if __MSVCRT_VERSION__ >= 0x0601
462 _CRTIMP int __cdecl __MINGW_NOTHROW _wstat64 (const wchar_t*, struct __stat64*);
463 #endif /* __MSVCRT_VERSION__ >= 0x0601 */
464 #endif /* __MSVCRT__ */
465 #define _WSTAT_DEFINED
466 #endif /* ! _WSTAT_DEFIND */
467
468 #ifndef _WLOCALE_DEFINED /* also declared in locale.h */
469 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wsetlocale (int, const wchar_t*);
470 #define _WLOCALE_DEFINED
471 #endif
472
473 #endif /* not __STRICT_ANSI__ */
474
475 #ifdef __cplusplus
476 } /* end of extern "C" */
477 #endif
478
479 #endif /* Not RC_INVOKED */
480
481 #endif /* not _WCHAR_H_ */
482
483