0b5011eadd0ef0d3844a66866ff96efab0c07960
[reactos.git] / reactos / include / crt / tchar.h
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6 #include <crtdefs.h>
7
8 #ifndef _INC_TCHAR
9 #define _INC_TCHAR
10
11 #ifdef _STRSAFE_H_INCLUDED_
12 #error Need to include strsafe.h after tchar.h
13 #endif
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #define _ftcscat _tcscat
20 #define _ftcschr _tcschr
21 #define _ftcscpy _tcscpy
22 #define _ftcscspn _tcscspn
23 #define _ftcslen _tcslen
24 #define _ftcsncat _tcsncat
25 #define _ftcsncpy _tcsncpy
26 #define _ftcspbrk _tcspbrk
27 #define _ftcsrchr _tcsrchr
28 #define _ftcsspn _tcsspn
29 #define _ftcsstr _tcsstr
30 #define _ftcstok _tcstok
31
32 #define _ftcsdup _tcsdup
33 #define _ftcsnset _tcsnset
34 #define _ftcsrev _tcsrev
35 #define _ftcsset _tcsset
36
37 #define _ftcscmp _tcscmp
38 #define _ftcsicmp _tcsicmp
39 #define _ftcsnccmp _tcsnccmp
40 #define _ftcsncmp _tcsncmp
41 #define _ftcsncicmp _tcsncicmp
42 #define _ftcsnicmp _tcsnicmp
43
44 #define _ftcscoll _tcscoll
45 #define _ftcsicoll _tcsicoll
46 #define _ftcsnccoll _tcsnccoll
47 #define _ftcsncoll _tcsncoll
48 #define _ftcsncicoll _tcsncicoll
49 #define _ftcsnicoll _tcsnicoll
50
51 #define _ftcsclen _tcsclen
52 #define _ftcsnccat _tcsnccat
53 #define _ftcsnccpy _tcsnccpy
54 #define _ftcsncset _tcsncset
55
56 #define _ftcsdec _tcsdec
57 #define _ftcsinc _tcsinc
58 #define _ftcsnbcnt _tcsnbcnt
59 #define _ftcsnccnt _tcsnccnt
60 #define _ftcsnextc _tcsnextc
61 #define _ftcsninc _tcsninc
62 #define _ftcsspnp _tcsspnp
63
64 #define _ftcslwr _tcslwr
65 #define _ftcsupr _tcsupr
66
67 #define _ftclen _tclen
68 #define _ftccpy _tccpy
69 #define _ftccmp _tccmp
70
71 #ifndef _CONST_RETURN
72 #ifdef __cplusplus
73 #define _CONST_RETURN const
74 #define _CRT_CONST_CORRECT_OVERLOADS
75 #else
76 #define _CONST_RETURN
77 #endif
78 #endif
79
80 #define _WConst_return _CONST_RETURN
81
82 #ifdef __cplusplus
83 }
84 #endif
85
86
87 #ifdef _UNICODE
88 /** UNICODE ******************************************************************/
89
90 #include <wchar.h>
91
92 #ifdef __cplusplus
93 extern "C" {
94 #endif
95
96 #ifndef _WCTYPE_T_DEFINED
97 #define _WCTYPE_T_DEFINED
98 typedef unsigned short wint_t;
99 typedef unsigned short wctype_t;
100 #endif
101
102 #ifndef __TCHAR_DEFINED
103 #define __TCHAR_DEFINED
104 typedef wchar_t _TCHAR;
105 typedef wchar_t _TSCHAR;
106 typedef wchar_t _TUCHAR;
107 typedef wchar_t _TXCHAR;
108 typedef wint_t _TINT;
109 #endif
110
111 #ifndef NO_OLDNAMES
112 #ifndef _TCHAR_DEFINED
113 #define _TCHAR_DEFINED
114 typedef wchar_t TCHAR,*PTCHAR;
115 typedef wchar_t TBYTE,*PTBYTE;
116 #endif
117 #endif
118
119 #define _TEOF WEOF
120
121 #define __T(x) L##x
122
123 #define _tmain wmain
124 #define _tWinMain wWinMain
125 #define _tenviron _wenviron
126 #define __targv __wargv
127
128 #define _tprintf wprintf
129 #define _tprintf_l _wprintf_l
130 #define _tprintf_p _wprintf_p
131 #define _tprintf_p_l _wprintf_p_l
132 #define _tcprintf _cwprintf
133 #define _tcprintf_l _cwprintf_l
134 #define _tcprintf_p _cwprintf_p
135 #define _tcprintf_p_l _cwprintf_p_l
136 #define _vtcprintf _vcwprintf
137 #define _vtcprintf_l _vcwprintf_l
138 #define _vtcprintf_p _vcwprintf_p
139 #define _vtcprintf_p_l _vcwprintf_p_l
140 #define _ftprintf fwprintf
141 #define _ftprintf_l _fwprintf_l
142 #define _ftprintf_p _fwprintf_p
143 #define _ftprintf_p_l _fwprintf_p_l
144 #define _stprintf swprintf
145 #define _stprintf_l __swprintf_l
146 #define _stprintf_p _swprintf_p
147 #define _stprintf_p_l _swprintf_p_l
148 #define _sctprintf _scwprintf
149 #define _sctprintf_l _scwprintf_l
150 #define _sctprintf_p _scwprintf_p
151 #define _sctprintf_p_l _scwprintf_p_l
152 #define _sntprintf _snwprintf
153 #define _sntprintf_l _snwprintf_l
154 #define _vtprintf vwprintf
155 #define _vtprintf_l _vwprintf_l
156 #define _vtprintf_p _vwprintf_p
157 #define _vtprintf_p_l _vwprintf_p_l
158 #define _vftprintf vfwprintf
159 #define _vftprintf_l _vfwprintf_l
160 #define _vftprintf_p _vfwprintf_p
161 #define _vftprintf_p_l _vfwprintf_p_l
162 #define _vstprintf vswprintf
163 #define _vstprintf_l _vswprintf_l
164 #define _vstprintf_p _vswprintf_p
165 #define _vstprintf_p_l _vswprintf_p_l
166 #define _vsctprintf _vscwprintf
167 #define _vsctprintf_l _vscwprintf_l
168 #define _vsctprintf_p _vscwprintf_p
169 #define _vsctprintf_p_l _vscwprintf_p_l
170 #define _vsntprintf _vsnwprintf
171 #define _vsntprintf_l _vsnwprintf_l
172
173 #define _tscanf wscanf
174 #define _tscanf_l _wscanf_l
175 #define _tcscanf _cwscanf
176 #define _tcscanf_l _cwscanf_l
177 #define _ftscanf fwscanf
178 #define _ftscanf_l _fwscanf_l
179 #define _stscanf swscanf
180 #define _stscanf_l _swscanf_l
181 #define _sntscanf _snwscanf
182 #define _sntscanf_l _snwscanf_l
183
184 #define _fgettc fgetwc
185 #define _fgettc_nolock _fgetwc_nolock
186 #define _fgettchar _fgetwchar
187 #define _fgetts fgetws
188 #define _fputtc fputwc
189 #define _fputtc_nolock _fputwc_nolock
190 #define _fputtchar _fputwchar
191 #define _fputts fputws
192 #define _cputts _cputws
193 #define _cgetts _cgetws
194 #define _gettc getwc
195 #define _gettc_nolock _getwc_nolock
196 #define _gettch _getwch
197 #define _gettch_nolock _getwch_nolock
198 #define _gettche _getwche
199 #define _gettche_nolock _getwche_nolock
200 #define _gettchar getwchar
201 #define _gettchar_nolock _getwchar_nolock
202 #define _getts _getws
203 #define _puttc putwc
204 #define _puttc_nolock _putwc_nolock
205 #define _puttchar putwchar
206 #define _puttchar_nolock _putwchar_nolock
207 #define _puttch _putwch
208 #define _puttch_nolock _putwch_nolock
209 #define _putts _putws
210 #define _ungettc ungetwc
211 #define _ungettc_nolock _ungetwc_nolock
212 #define _ungettch _ungetwch
213 #define _ungettch_nolock _ungetwch_nolock
214
215 #define _tcstod wcstod
216 #define _tcstol wcstol
217 #define _tcstoul wcstoul
218 #define _tcstoi64 _wcstoi64
219 #define _tcstoui64 _wcstoui64
220 #define _tstof _wtof
221 #define _tstol _wtol
222 #define _tstoi _wtoi
223 #define _tstoi64 _wtoi64
224 #define _tcstod_l _wcstod_l
225 #define _tcstol_l _wcstol_l
226 #define _tcstoul_l _wcstoul_l
227 #define _tcstoi64_l _wcstoi64_l
228 #define _tcstoui64_l _wcstoui64_l
229 #define _tstof_l _wtof_l
230 #define _tstol_l _wtol_l
231 #define _tstoi_l _wtoi_l
232 #define _tstoi64_l _wtoi64_l
233
234 #define _itot _itow
235 #define _ltot _ltow
236 #define _ultot _ultow
237 #define _ttoi _wtoi
238 #define _ttol _wtol
239
240 #define _ttoi64 _wtoi64
241 #define _i64tot _i64tow
242 #define _ui64tot _ui64tow
243
244 #define _tcscat wcscat
245 #define _tcschr wcschr
246 #define _tcscpy wcscpy
247 #define _tcscpy_s wcscpy_s
248 #define _tcscspn wcscspn
249 #define _tcslen wcslen
250 #define _tcsnlen wcsnlen
251 #define _tcsncat wcsncat
252 #define _tcsncat_l _wcsncat_l
253 #define _tcsncpy wcsncpy
254 #define _tcsncpy_l _wcsncpy_l
255 #define _tcspbrk wcspbrk
256 #define _tcsrchr wcsrchr
257 #define _tcsspn wcsspn
258 #define _tcsstr wcsstr
259 #define _tcstok wcstok
260 #define _tcstok_l _wcstok_l
261 #define _tcserror _wcserror
262 #define __tcserror __wcserror
263
264 #define _tcsdup _wcsdup
265 #define _tcsnset _wcsnset
266 #define _tcsnset_l _wcsnset_l
267 #define _tcsrev _wcsrev
268 #define _tcsset _wcsset
269 #define _tcsset_l _wcsset_l
270
271 #define _tcscmp wcscmp
272 #define _tcsicmp _wcsicmp
273 #define _tcsicmp_l _wcsicmp_l
274 #define _tcsnccmp wcsncmp
275 #define _tcsncmp wcsncmp
276 #define _tcsncicmp _wcsnicmp
277 #define _tcsncicmp_l _wcsnicmp_l
278 #define _tcsnicmp _wcsnicmp
279 #define _tcsnicmp_l _wcsnicmp_l
280
281 #define _tcscoll wcscoll
282 #define _tcscoll_l _wcscoll_l
283 #define _tcsicoll _wcsicoll
284 #define _tcsicoll_l _wcsicoll_l
285 #define _tcsnccoll _wcsncoll
286 #define _tcsnccoll_l _wcsncoll_l
287 #define _tcsncoll _wcsncoll
288 #define _tcsncoll_l _wcsncoll_l
289 #define _tcsncicoll _wcsnicoll
290 #define _tcsncicoll_l _wcsnicoll_l
291 #define _tcsnicoll _wcsnicoll
292 #define _tcsnicoll_l _wcsnicoll_l
293
294 #define _texecl _wexecl
295 #define _texecle _wexecle
296 #define _texeclp _wexeclp
297 #define _texeclpe _wexeclpe
298 #define _texecv _wexecv
299 #define _texecve _wexecve
300 #define _texecvp _wexecvp
301 #define _texecvpe _wexecvpe
302
303 #define _tspawnl _wspawnl
304 #define _tspawnle _wspawnle
305 #define _tspawnlp _wspawnlp
306 #define _tspawnlpe _wspawnlpe
307 #define _tspawnv _wspawnv
308 #define _tspawnve _wspawnve
309 #define _tspawnvp _wspawnvp
310 #define _tspawnvp _wspawnvp
311 #define _tspawnvpe _wspawnvpe
312
313 #define _tsystem _wsystem
314
315 #define _tasctime _wasctime
316 #define _tctime _wctime
317 #define _tctime32 _wctime32
318 #define _tctime64 _wctime64
319 #define _tstrdate _wstrdate
320 #define _tstrtime _wstrtime
321 #define _tutime _wutime
322 #define _tutime32 _wutime32
323 #define _tutime64 _wutime64
324 #define _tcsftime wcsftime
325 #define _tcsftime_l _wcsftime_l
326
327 #define _tasctime_s _wasctime_s
328 #define _tctime_s _wctime_s
329 #define _tctime32_s _wctime32_s
330 #define _tctime64_s _wctime64_s
331 #define _tstrdate_s _wstrdate_s
332 #define _tstrtime_s _wstrtime_s
333
334 #define _tchdir _wchdir
335 #define _tgetcwd _wgetcwd
336 #define _tgetdcwd _wgetdcwd
337 #define _tgetdcwd_nolock _wgetdcwd_nolock
338 #define _tmkdir _wmkdir
339 #define _trmdir _wrmdir
340
341 #define _tfullpath _wfullpath
342 #define _tgetenv _wgetenv
343 #define _tmakepath _wmakepath
344 #define _tpgmptr _wpgmptr
345 #define _get_tpgmptr _get_wpgmptr
346 #define _tputenv _wputenv
347 #define _tsearchenv _wsearchenv
348 #define _tsplitpath _wsplitpath
349 #define _tsplitpath_s _wsplitpath_s
350
351 #define _tfdopen _wfdopen
352 #define _tfsopen _wfsopen
353 #define _tfopen _wfopen
354 #define _tfreopen _wfreopen
355 #define _tperror _wperror
356 #define _tpopen _wpopen
357 #define _ttempnam _wtempnam
358 #define _ttmpnam _wtmpnam
359
360 #define _taccess _waccess
361 #define _tchmod _wchmod
362 #define _tcreat _wcreat
363 #define _tfindfirst _wfindfirst
364 #define _tfindfirst32 _wfindfirst32
365 #define _tfindfirst64 _wfindfirst64
366 #define _tfindfirsti64 _wfindfirsti64
367 #define _tfindfirst32i64 _wfindfirst32i64
368 #define _tfindfirst64i32 _wfindfirst64i32
369 #define _tfindnext _wfindnext
370 #define _tfindnext32 _wfindnext32
371 #define _tfindnext64 _wfindnext64
372 #define _tfindnexti64 _wfindnexti64
373 #define _tfindnext32i64 _wfindnext32i64
374 #define _tfindnext64i32 _wfindnext64i32
375 #define _tmktemp _wmktemp
376 #define _topen _wopen
377 #define _tremove _wremove
378 #define _trename _wrename
379 #define _tsopen _wsopen
380 #define _tunlink _wunlink
381
382 #define _tfinddata_t _wfinddata_t
383 #define _tfinddata32_t _wfinddata32_t
384 #define _tfinddata64_t _wfinddata64_t
385 #define _tfinddatai64_t _wfinddatai64_t
386 #define _tfinddata32i64_t _wfinddata32i64_t
387 #define _tfinddata64i32_t _wfinddata64i32_t
388
389 #define _tstat _wstat
390 #define _tstat32 _wstat32
391 #define _tstat32i64 _wstat32i64
392 #define _tstat64 _wstat64
393 #define _tstat64i32 _wstat64i32
394 #define _tstati64 _wstati64
395
396 #define _tsetlocale _wsetlocale
397
398 #define _tcsclen wcslen
399 #define _tcscnlen wcsnlen
400 #define _tcsclen_l(_String,_Locale) wcslen(_String)
401 #define _tcscnlen_l(_String,_Max_count,_Locale) wcsnlen_l((_String),(_Max_count))
402 #define _tcsnccat wcsncat
403 #define _tcsnccat_l _wcsncat_l
404 #define _tcsnccpy wcsncpy
405 #define _tcsnccpy_l _wcsncpy_l
406 #define _tcsncset _wcsnset
407
408 #define _tcsdec _wcsdec
409 #define _tcsinc _wcsinc
410 #define _tcsnbcnt _wcsncnt
411 #define _tcsnccnt _wcsncnt
412 #define _tcsnextc _wcsnextc
413 #define _tcsninc _wcsninc
414 #define _tcsspnp _wcsspnp
415
416 #define _tcslwr _wcslwr
417 #define _tcslwr_l _wcslwr_l
418 #define _tcsupr _wcsupr
419 #define _tcsupr_l _wcsupr_l
420 #define _tcsxfrm wcsxfrm
421 #define _tcsxfrm_l _wcsxfrm_l
422
423 #define _tclen(_pc) (1)
424 #define _tccpy(_pc1,_cpc2) ((*(_pc1) = *(_cpc2)))
425 #define _tccmp(_cpc1,_cpc2) ((*(_cpc1))-(*(_cpc2)))
426
427 #define _istalnum iswalnum
428 #define _istalnum_l _iswalnum_l
429 #define _istalpha iswalpha
430 #define _istalpha_l _iswalpha_l
431 #define _istascii iswascii
432 #define _istcntrl iswcntrl
433 #define _istcntrl_l _iswcntrl_l
434 #define _istdigit iswdigit
435 #define _istdigit_l _iswdigit_l
436 #define _istgraph iswgraph
437 #define _istgraph_l _iswgraph_l
438 #define _istlower iswlower
439 #define _istlower_l _iswlower_l
440 #define _istprint iswprint
441 #define _istprint_l _iswprint_l
442 #define _istpunct iswpunct
443 #define _istpunct_l _iswpunct_l
444 #define _istspace iswspace
445 #define _istspace_l _iswspace_l
446 #define _istupper iswupper
447 #define _istupper_l _iswupper_l
448 #define _istxdigit iswxdigit
449 #define _istxdigit_l _iswxdigit_l
450
451 #define _totupper towupper
452 #define _totupper_l _towupper_l
453 #define _totlower towlower
454 #define _totlower_l _towlower_l
455
456 #define _istlegal(_Char) (1)
457 #define _istlead(_Char) (0)
458 #define _istleadbyte(_Char) (0)
459 #define _istleadbyte_l(_Char,_Locale) (0)
460
461 #define _wcsdec(_cpc1,_cpc2) ((_cpc1)>=(_cpc2) ? NULL : (_cpc2)-1)
462 #define _wcsinc(_pc) ((_pc)+1)
463 #define _wcsnextc(_cpc) ((unsigned int) *(_cpc))
464 #define _wcsninc(_pc,_sz) (((_pc)+(_sz)))
465 _CRTIMP size_t __cdecl __wcsncnt(const wchar_t *_Str,size_t _MaxCount);
466 #define _wcsncnt(_cpc,_sz) (__wcsncnt(_cpc,_sz))
467 #define _wcsspnp(_cpc1,_cpc2) (!_cpc1 ? NULL : ((*((_cpc1)+wcsspn(_cpc1,_cpc2))) ? ((_cpc1)+wcsspn(_cpc1,_cpc2)) : NULL))
468 #define _wcsncpy_l(_Destination,_Source,_Count,_Locale) (wcsncpy(_Destination,_Source,_Count))
469 #define _wcsncat_l(_Destination,_Source,_Count,_Locale) (wcsncat(_Destination,_Source,_Count))
470 #define _wcstok_l(_String,_Delimiters,_Locale) (wcstok(_String,_Delimiters))
471 #define _wcsnset_l(_Destination,_Value,_Count,_Locale) (_wcsnset(_Destination,_Value,_Count))
472 #define _wcsset_l(_Destination,_Value,_Locale) (_wcsset(_Destination,_Value))
473
474 /* dirent structures and functions */
475 #define _tdirent _wdirent
476 #define _TDIR _WDIR
477 #define _topendir _wopendir
478 #define _tclosedir _wclosedir
479 #define _treaddir _wreaddir
480 #define _trewinddir _wrewinddir
481 #define _ttelldir _wtelldir
482 #define _tseekdir _wseekdir
483
484 #else
485 /** ANSI *********************************************************************/
486
487 #include <string.h>
488
489 #ifdef __cplusplus
490 extern "C" {
491 #endif
492
493 #define _TEOF EOF
494
495 #define __T(x) x
496
497 #define _tmain main
498 #define _tWinMain WinMain
499 #ifdef _POSIX_
500 #define _tenviron environ
501 #else
502 #define _tenviron _environ
503 #endif
504 #define __targv __argv
505
506 #define _tprintf printf
507 #define _tprintf_l _printf_l
508 #define _tprintf_p _printf_p
509 #define _tprintf_p_l _printf_p_l
510 #define _tcprintf _cprintf
511 #define _tcprintf_l _cprintf_l
512 #define _tcprintf_p _cprintf_p
513 #define _tcprintf_p_l _cprintf_p_l
514 #define _vtcprintf _vcprintf
515 #define _vtcprintf_l _vcprintf_l
516 #define _vtcprintf_p _vcprintf_p
517 #define _vtcprintf_p_l _vcprintf_p_l
518 #define _ftprintf fprintf
519 #define _ftprintf_l _fprintf_l
520 #define _ftprintf_p _fprintf_p
521 #define _ftprintf_p_l _fprintf_p_l
522 #define _stprintf sprintf
523 #define _stprintf_l _sprintf_l
524 #define _stprintf_p _sprintf_p
525 #define _stprintf_p_l _sprintf_p_l
526 #define _sctprintf _scprintf
527 #define _sctprintf_l _scprintf_l
528 #define _sctprintf_p _scprintf_p
529 #define _sctprintf_p_l _scprintf_p_l
530 #define _sntprintf _snprintf
531 #define _sntprintf_l _snprintf_l
532 #define _vtprintf vprintf
533 #define _vtprintf_l _vprintf_l
534 #define _vtprintf_p _vprintf_p
535 #define _vtprintf_p_l _vprintf_p_l
536 #define _vftprintf vfprintf
537 #define _vftprintf_l _vfprintf_l
538 #define _vftprintf_p _vfprintf_p
539 #define _vftprintf_p_l _vfprintf_p_l
540 #define _vstprintf vsprintf
541 #define _vstprintf_l _vsprintf_l
542 #define _vstprintf_p _vsprintf_p
543 #define _vstprintf_p_l _vsprintf_p_l
544 #define _vsctprintf _vscprintf
545 #define _vsctprintf_l _vscprintf_l
546 #define _vsctprintf_p _vscprintf_p
547 #define _vsctprintf_p_l _vscprintf_p_l
548 #define _vsntprintf _vsnprintf
549 #define _vsntprintf_l _vsnprintf_l
550
551 #define _tscanf scanf
552 #define _tscanf_l _scanf_l
553 #define _tcscanf _cscanf
554 #define _tcscanf_l _cscanf_l
555 #define _ftscanf fscanf
556 #define _ftscanf_l _fscanf_l
557 #define _stscanf sscanf
558 #define _stscanf_l _sscanf_l
559 #define _sntscanf _snscanf
560 #define _sntscanf_l _snscanf_l
561
562 #define _fgettc fgetc
563 #define _fgettc_nolock _fgetc_nolock
564 #define _fgettchar _fgetchar
565 #define _fgetts fgets
566 #define _fputtc fputc
567 #define _fputtc_nolock _fputc_nolock
568 #define _fputtchar _fputchar
569 #define _fputts fputs
570 #define _cputts _cputs
571 #define _gettc getc
572 #define _gettc_nolock _getc_nolock
573 #define _gettch _getch
574 #define _gettch_nolock _getch_nolock
575 #define _gettche _getche
576 #define _gettche_nolock _getche_nolock
577 #define _gettchar getchar
578 #define _gettchar_nolock _getchar_nolock
579 #define _getts gets
580 #define _cgetts _cgets
581 #define _puttc putc
582 #define _puttc_nolock _putc_nolock
583 #define _puttchar putchar
584 #define _puttchar_nolock _putchar_nolock
585 #define _puttch _putch
586 #define _puttch_nolock _putch_nolock
587 #define _putts puts
588 #define _ungettc ungetc
589 #define _ungettc_nolock _ungetc_nolock
590 #define _ungettch _ungetch
591 #define _ungettch_nolock _ungetch_nolock
592
593 #define _tcstod strtod
594 #define _tcstol strtol
595 #define _tcstoul strtoul
596 #define _tstof atof
597 #define _tstol atol
598 #define _tstoi atoi
599 #define _tstoi64 _atoi64
600 #define _tcstod_l _strtod_l
601 #define _tcstol_l _strtol_l
602 #define _tcstoul_l _strtoul_l
603 #define _tstof_l _atof_l
604 #define _tstol_l _atol_l
605 #define _tstoi_l _atoi_l
606 #define _tstoi64_l _atoi64_l
607
608 #define _itot _itoa
609 #define _ltot _ltoa
610 #define _ultot _ultoa
611 #define _ttoi atoi
612 #define _ttol atol
613
614 #define _ttoi64 _atoi64
615 #define _tcstoi64 _strtoi64
616 #define _tcstoi64_l _strtoi64_l
617 #define _tcstoui64 _strtoui64
618 #define _tcstoui64_l _strtoui64_l
619 #define _i64tot _i64toa
620 #define _ui64tot _ui64toa
621
622 #define _tcscat strcat
623 #define _tcscpy strcpy
624 #define _tcscpy_s strcpy_s
625 #define _tcsdup _strdup
626 #define _tcslen strlen
627 #if 0
628 #define _tcsnlen strnlen
629 #endif
630 #define _tcsxfrm strxfrm
631 #define _tcsxfrm_l _strxfrm_l
632 #define _tcserror strerror
633 #define __tcserror _strerror
634
635 #define _texecl _execl
636 #define _texecle _execle
637 #define _texeclp _execlp
638 #define _texeclpe _execlpe
639 #define _texecv _execv
640 #define _texecve _execve
641 #define _texecvp _execvp
642 #define _texecvpe _execvpe
643
644 #define _tspawnl _spawnl
645 #define _tspawnle _spawnle
646 #define _tspawnlp _spawnlp
647 #define _tspawnlpe _spawnlpe
648 #define _tspawnv _spawnv
649 #define _tspawnve _spawnve
650 #define _tspawnvp _spawnvp
651 #define _tspawnvpe _spawnvpe
652
653 #define _tsystem system
654
655 #define _tasctime asctime
656 #define _tctime ctime
657 #define _tctime32 _ctime32
658 #define _tctime64 _ctime64
659 #define _tstrdate _strdate
660 #define _tstrtime _strtime
661 #define _tutime _utime
662 #define _tutime32 _utime32
663 #define _tutime64 _utime64
664 #define _tcsftime strftime
665 #define _tcsftime_l _strftime_l
666
667 #define _tasctime_s asctime_s
668 #define _tctime_s ctime_s
669 #define _tctime32_s _ctime32_s
670 #define _tctime64_s _ctime64_s
671 #define _tstrdate_s _strdate_s
672 #define _tstrtime_s _strtime_s
673
674 #define _tchdir _chdir
675 #define _tgetcwd _getcwd
676 #define _tgetdcwd _getdcwd
677 #define _tgetdcwd_nolock _getdcwd_nolock
678 #define _tmkdir _mkdir
679 #define _trmdir _rmdir
680
681 #define _tfullpath _fullpath
682 #define _tgetenv getenv
683 #define _tmakepath _makepath
684 #define _tpgmptr _pgmptr
685 #define _get_tpgmptr _get_pgmptr
686 #define _tputenv _putenv
687 #define _tsearchenv _searchenv
688 #define _tsplitpath _splitpath
689 #define _tsplitpath_s _splitpath_s
690
691 #ifdef _POSIX_
692 #define _tfdopen fdopen
693 #else
694 #define _tfdopen _fdopen
695 #endif
696 #define _tfsopen _fsopen
697 #define _tfopen fopen
698 #define _tfreopen freopen
699 #define _tperror perror
700 #define _tpopen _popen
701 #define _ttempnam _tempnam
702 #define _ttmpnam tmpnam
703
704 #define _tchmod _chmod
705 #define _tcreat _creat
706 #define _tfindfirst _findfirst
707 #define _tfindfirst32 _findfirst32
708 #define _tfindfirst64 _findfirst64
709 #define _tfindfirsti64 _findfirsti64
710 #define _tfindfirst32i64 _findfirst32i64
711 #define _tfindfirst64i32 _findfirst64i32
712 #define _tfindnext _findnext
713 #define _tfindnext32 _findnext32
714 #define _tfindnext64 _findnext64
715 #define _tfindnexti64 _findnexti64
716 #define _tfindnext32i64 _findnext32i64
717 #define _tfindnext64i32 _findnext64i32
718 #define _tmktemp _mktemp
719
720 #ifdef _POSIX_
721 #define _topen open
722 #define _taccess access
723 #else
724 #define _topen _open
725 #define _taccess _access
726 #endif
727
728 #define _tremove remove
729 #define _trename rename
730 #define _tsopen _sopen
731 #define _tunlink _unlink
732
733 #define _tfinddata_t _finddata_t
734 #define _tfinddata32_t _finddata32_t
735 #define _tfinddata64_t __finddata64_t
736 #define _tfinddatai64_t _finddatai64_t
737 #define _tfinddata32i64_t _finddata32i64_t
738 #define _tfinddata64i32_t _finddata64i32_t
739
740 #define _istascii __isascii
741 #define _istcntrl iscntrl
742 #define _istcntrl_l _iscntrl_l
743 #define _istxdigit isxdigit
744 #define _istxdigit_l _isxdigit_l
745
746 #define _tstat _stat
747 #define _tstat32 _stat32
748 #define _tstat32i64 _stat32i64
749 #define _tstat64 _stat64
750 #define _tstat64i32 _stat64i32
751 #define _tstati64 _stati64
752
753 #define _tsetlocale setlocale
754
755 #ifdef _MBCS
756 /** MBCS *********************************************************************/
757
758 #ifdef __cplusplus
759 }
760 #endif
761
762 #include <mbstring.h>
763
764 #ifdef __cplusplus
765 extern "C" {
766 #endif
767
768 #ifndef __TCHAR_DEFINED
769 typedef char _TCHAR;
770 typedef signed char _TSCHAR;
771 typedef unsigned char _TUCHAR;
772 typedef unsigned char _TXCHAR;
773 typedef unsigned int _TINT;
774 #define __TCHAR_DEFINED
775 #endif
776
777 #ifndef NO_OLDNAMES
778 #ifndef _TCHAR_DEFINED
779 #define _TCHAR_DEFINED
780 typedef char TCHAR,*PTCHAR;
781 typedef unsigned char TBYTE,*PTBYTE;
782 #endif
783 #endif
784
785 #ifdef _MB_MAP_DIRECT
786
787 #define _tcschr _mbschr
788 #define _tcscspn _mbscspn
789 #define _tcsncat _mbsnbcat
790 #define _tcsncat_l _mbsnbcat_l
791 #define _tcsncpy _mbsnbcpy
792 #define _tcsncpy_l _mbsnbcpy_l
793 #define _tcspbrk _mbspbrk
794 #define _tcsrchr _mbsrchr
795 #define _tcsspn _mbsspn
796 #define _tcsstr _mbsstr
797 #define _tcstok _mbstok
798 #define _tcstok_l _mbstok_l
799
800 #define _tcsnset _mbsnbset
801 #define _tcsnset_l _mbsnbset_l
802 #define _tcsrev _mbsrev
803 #define _tcsset _mbsset
804 #define _tcsset_l _mbsset_l
805
806 #define _tcscmp _mbscmp
807 #define _tcsicmp _mbsicmp
808 #define _tcsicmp_l _mbsicmp_l
809 #define _tcsnccmp _mbsncmp
810 #define _tcsncmp _mbsnbcmp
811 #define _tcsncicmp _mbsnicmp
812 #define _tcsncicmp_l _mbsnicmp_l
813 #define _tcsnicmp _mbsnbicmp
814 #define _tcsnicmp_l _mbsnbicmp_l
815
816 #define _tcscoll _mbscoll
817 #define _tcscoll_l _mbscoll_l
818 #define _tcsicoll _mbsicoll
819 #define _tcsicoll_l _mbsicoll_l
820 #define _tcsnccoll _mbsncoll
821 #define _tcsnccoll_l _mbsncoll_l
822 #define _tcsncoll _mbsnbcoll
823 #define _tcsncoll_l _mbsnbcoll_l
824 #define _tcsncicoll _mbsnicoll
825 #define _tcsncicoll_l _mbsnicoll_l
826 #define _tcsnicoll _mbsnbicoll
827 #define _tcsnicoll_l _mbsnbicoll_l
828
829 #define _tcsclen _mbslen
830 #define _tcscnlen _mbsnlen
831 #define _tcsclen_l _mbslen_l
832 #define _tcscnlen_l _mbsnlen_l
833 #define _tcsnccat _mbsncat
834 #define _tcsnccat_l _mbsncat_l
835 #define _tcsnccpy _mbsncpy
836 #define _tcsnccpy_l _mbsncpy_l
837 #define _tcsncset _mbsnset
838 #define _tcsncset_l _mbsnset_l
839
840 #define _tcsdec _mbsdec
841 #define _tcsinc _mbsinc
842 #define _tcsnbcnt _mbsnbcnt
843 #define _tcsnccnt _mbsnccnt
844 #define _tcsnextc _mbsnextc
845 #define _tcsninc _mbsninc
846 #define _tcsspnp _mbsspnp
847
848 #define _tcslwr _mbslwr
849 #define _tcslwr_l _mbslwr_l
850 #define _tcsupr _mbsupr
851 #define _tcsupr_l _mbsupr_l
852
853 #define _tclen _mbclen
854 #define _tccpy _mbccpy
855 #define _tccpy_l _mbccpy_l
856
857
858 #else /* !_MB_MAP_DIRECT */
859
860 _CRTIMP _CONST_RETURN char *__cdecl _tcschr(const char *_Str,unsigned int _Val);
861 _CRTIMP size_t __cdecl _tcscspn(const char *_Str,const char *_Control);
862 _CRTIMP char *__cdecl _tcsncat(char *_Dst,const char *_Src,size_t _MaxCount);
863 _CRTIMP char *__cdecl _tcsncat_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
864 _CRTIMP char *__cdecl _tcsncpy(char *_Dst,const char *_Src,size_t _MaxCount);
865 _CRTIMP char *__cdecl _tcsncpy_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
866 _CRTIMP _CONST_RETURN char *__cdecl _tcspbrk(const char *_Str,const char *_Control);
867 _CRTIMP _CONST_RETURN char *__cdecl _tcsrchr(const char *_Str,unsigned int _Ch);
868 _CRTIMP size_t __cdecl _tcsspn(const char *_Str,const char *_Control);
869 _CRTIMP _CONST_RETURN char *__cdecl _tcsstr(const char *_Str,const char *_Substr);
870 _CRTIMP char *__cdecl _tcstok(char *_Str,const char *_Delim);
871 _CRTIMP char *__cdecl _tcstok_l(char *_Str,const char *_Delim,_locale_t _Locale);
872 _CRTIMP char *__cdecl _tcsnset(char *_Str,unsigned int _Val,size_t _MaxCount);
873 _CRTIMP char *__cdecl _tcsrev(char *_Str);
874 _CRTIMP char *__cdecl _tcsset(char *_Str,unsigned int _Val);
875 _CRTIMP char *__cdecl _tcsset_l(char *_Str,unsigned int _Val,_locale_t _Locale);
876 _CRTIMP int __cdecl _tcscmp(const char *_Str1,const char *_Str);
877 _CRTIMP int __cdecl _tcsicmp(const char *_Str1,const char *_Str2);
878 _CRTIMP int __cdecl _tcsicmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
879 _CRTIMP int __cdecl _tcsnccmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
880 _CRTIMP int __cdecl _tcsncmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
881 _CRTIMP int __cdecl _tcsncicmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
882 _CRTIMP int __cdecl _tcsncicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
883 _CRTIMP int __cdecl _tcsnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
884 _CRTIMP int __cdecl _tcsnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
885 _CRTIMP int __cdecl _tcscoll(const char *_Str1,const char *_Str2);
886 _CRTIMP int __cdecl _tcscoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
887 _CRTIMP int __cdecl _tcsicoll(const char *_Str1,const char *_Str2);
888 _CRTIMP int __cdecl _tcsicoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
889 _CRTIMP int __cdecl _tcsnccoll(const char *_Str1,const char *_Str2,size_t _MaxCount);
890 _CRTIMP int __cdecl _tcsnccoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
891 _CRTIMP int __cdecl _tcsncoll(const char *_Str1,const char *_Str2,size_t _MaxCount);
892 _CRTIMP int __cdecl _tcsncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
893 _CRTIMP int __cdecl _tcsncicoll(const char *_Str1,const char *_Str2,size_t _MaxCount);
894 _CRTIMP int __cdecl _tcsncicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
895 _CRTIMP int __cdecl _tcsnicoll(const char *_Str1,const char *_Str2,size_t _MaxCount);
896 _CRTIMP int __cdecl _tcsnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
897 _CRTIMP size_t __cdecl _tcsclen(const char *_Str);
898 _CRTIMP size_t __cdecl _tcscnlen(const char *_Str,size_t _MaxCount);
899 _CRTIMP size_t __cdecl _tcsclen_l(const char *_Str,_locale_t _Locale);
900 _CRTIMP size_t __cdecl _tcscnlen_l(const char *_Str,size_t _MaxCount,_locale_t _Locale);
901 _CRTIMP char *__cdecl _tcsnccat(char *_Dst,const char *_Src,size_t _MaxCount);
902 _CRTIMP char *__cdecl _tcsnccat_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
903 _CRTIMP char *__cdecl _tcsnccpy(char *_Dst,const char *_Src,size_t _MaxCount);
904 _CRTIMP char *__cdecl _tcsnccpy_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
905 _CRTIMP char *__cdecl _tcsncset(char *_Str,unsigned int _Val,size_t _MaxCount);
906 _CRTIMP char *__cdecl _tcsdec(const char *_Start,const char *_Pos);
907 _CRTIMP char *__cdecl _tcsinc(const char *_Ptr);
908 _CRTIMP size_t __cdecl _tcsnbcnt(const char *_Str,size_t _MaxCount);
909 _CRTIMP size_t __cdecl _tcsnccnt(const char *_Str,size_t _MaxCount);
910 _CRTIMP unsigned int __cdecl _tcsnextc (const char *_Str);
911 _CRTIMP char *__cdecl _tcsninc(const char *_Ptr,size_t _Count);
912 _CRTIMP char *__cdecl _tcsspnp(const char *_Str1,const char *_Str2);
913 _CRTIMP char *__cdecl _tcslwr(char *_Str);
914 _CRTIMP char *__cdecl _tcslwr_l(char *_Str,_locale_t _Locale);
915 _CRTIMP char *__cdecl _tcsupr(char *_Str);
916 _CRTIMP char *__cdecl _tcsupr_l(char *_Str,_locale_t _Locale);
917 _CRTIMP size_t __cdecl _tclen(const char *_Str);
918 _CRTIMP void __cdecl _tccpy(char *_DstCh,const char *_SrcCh);
919
920 #ifdef __cplusplus
921 #ifndef _CPP_TCHAR_INLINES_DEFINED
922 #define _CPP_TCHAR_INLINES_DEFINED
923 extern "C++" {
924 extern inline char *__cdecl _tcschr(char *_S,unsigned int _C) { return ((char *)_tcschr((const char *)_S,_C)); }
925 extern inline char *__cdecl _tcspbrk(char *_S,const char *_P) { return ((char *)_tcspbrk((const char *)_S,_P)); }
926 extern inline char *__cdecl _tcsrchr(char *_S,unsigned int _C) { return ((char *)_tcsrchr((const char *)_S,_C)); }
927 extern inline char *__cdecl _tcsstr(char *_S,const char *_P) { return ((char *)_tcsstr((const char *)_S,_P)); }
928 }
929 #endif
930 #endif
931 #endif
932
933 #define _tccmp(_cp1,_cp2) _tcsnccmp(_cp1,_cp2,1)
934
935 #define _istalnum _ismbcalnum
936 #define _istalnum_l _ismbcalnum_l
937 #define _istalpha _ismbcalpha
938 #define _istalpha_l _ismbcalpha_l
939 #define _istdigit _ismbcdigit
940 #define _istdigit_l _ismbcdigit_l
941 #define _istgraph _ismbcgraph
942 #define _istgraph_l _ismbcgraph_l
943 #define _istlegal _ismbclegal
944 #define _istlegal_l _ismbclegal_l
945 #define _istlower _ismbclower
946 #define _istlower_l _ismbclower_l
947 #define _istprint _ismbcprint
948 #define _istprint_l _ismbcprint_l
949 #define _istpunct _ismbcpunct
950 #define _istpunct_l _ismbcpunct_l
951 #define _istspace _ismbcspace
952 #define _istspace_l _ismbcspace_l
953 #define _istupper _ismbcupper
954 #define _istupper_l _ismbcupper_l
955
956 #define _totupper _mbctoupper
957 #define _totupper_l _mbctoupper_l
958 #define _totlower _mbctolower
959 #define _totlower_l _mbctolower_l
960
961 #define _istlead _ismbblead
962 #define _istleadbyte isleadbyte
963 #define _istleadbyte_l _isleadbyte_l
964
965 #else /* !_MBCS */
966 /** SBCS *********************************************************************/
967
968 #ifndef __TCHAR_DEFINED
969 #define __TCHAR_DEFINED
970 typedef char _TCHAR;
971 typedef signed char _TSCHAR;
972 typedef unsigned char _TUCHAR;
973 typedef char _TXCHAR;
974 typedef int _TINT;
975 #endif
976
977 #ifndef _TCHAR_DEFINED
978 #define _TCHAR_DEFINED
979 #ifndef NO_OLDNAMES
980 typedef char TCHAR;
981 #endif
982 #endif
983
984 #define _tcschr strchr
985 #define _tcscspn strcspn
986 #define _tcsncat strncat
987 #define _tcsncat_l _strncat_l
988 #define _tcsncpy strncpy
989 #define _tcsncpy_l _strncpy_l
990 #define _tcspbrk strpbrk
991 #define _tcsrchr strrchr
992 #define _tcsspn strspn
993 #define _tcsstr strstr
994 #define _tcstok strtok
995 #define _tcstok_l _strtok_l
996
997 #define _tcsnset _strnset
998 #define _tcsnset_l _strnset_l
999 #define _tcsrev _strrev
1000 #define _tcsset _strset
1001
1002 #define _tcscmp strcmp
1003 #define _tcsicmp _stricmp
1004 #define _tcsicmp_l _stricmp_l
1005 #define _tcsnccmp strncmp
1006 #define _tcsncmp strncmp
1007 #define _tcsncicmp _strnicmp
1008 #define _tcsncicmp_l _strnicmp_l
1009 #define _tcsnicmp _strnicmp
1010 #define _tcsnicmp_l _strnicmp_l
1011
1012 #define _tcscoll strcoll
1013 #define _tcscoll_l _strcoll_l
1014 #define _tcsicoll _stricoll
1015 #define _tcsicoll_l _stricoll_l
1016 #define _tcsnccoll _strncoll
1017 #define _tcsnccoll_l _strncoll_l
1018 #define _tcsncoll _strncoll
1019 #define _tcsncoll_l _strncoll_l
1020 #define _tcsncicoll _strnicoll
1021 #define _tcsncicoll_l _strnicoll_l
1022 #define _tcsnicoll _strnicoll
1023 #define _tcsnicoll_l _strnicoll_l
1024
1025 #define _tcsclen strlen
1026 #define _tcscnlen strnlen
1027 #define _tcsclen_l(_String,_Locale) strlen(_String)
1028 #define _tcscnlen_l(_String,_Max_count,_Locale) strnlen_l((_String),(_Max_count))
1029 #define _tcsnccat strncat
1030 #define _tcsnccat_l _strncat_l
1031 #define _tcsnccpy strncpy
1032 #define _tcsnccpy_l _strncpy_l
1033 #define _tcsncset _strnset
1034
1035 #define _tcsdec _strdec
1036 #define _tcsinc _strinc
1037 #define _tcsnbcnt _strncnt
1038 #define _tcsnccnt _strncnt
1039 #define _tcsnextc _strnextc
1040 #define _tcsninc _strninc
1041 #define _tcsspnp _strspnp
1042
1043 #define _tcslwr _strlwr
1044 #define _tcslwr_l _strlwr_l
1045 #define _tcsupr _strupr
1046 #define _tcsupr_l _strupr_l
1047 #define _tcsxfrm strxfrm
1048 #define _tcsxfrm_l _strxfrm_l
1049
1050 #define _istlead(_Char) (0)
1051 #define _istleadbyte(_Char) (0)
1052 #define _istleadbyte_l(_Char,_Locale) (0)
1053
1054 #define _tclen(_pc) (1)
1055 #define _tccpy(_pc1,_cpc2) (*(_pc1) = *(_cpc2))
1056 #define _tccmp(_cpc1,_cpc2) (((unsigned char)*(_cpc1))-((unsigned char)*(_cpc2)))
1057
1058 /* dirent structures and functions */
1059 #define _tdirent dirent
1060 #define _TDIR DIR
1061 #define _topendir opendir
1062 #define _tclosedir closedir
1063 #define _treaddir readdir
1064 #define _trewinddir rewinddir
1065 #define _ttelldir telldir
1066 #define _tseekdir seekdir
1067
1068 #define _istalnum isalnum
1069 #define _istalnum_l _isalnum_l
1070 #define _istalpha isalpha
1071 #define _istalpha_l _isalpha_l
1072 #define _istdigit isdigit
1073 #define _istdigit_l _isdigit_l
1074 #define _istgraph isgraph
1075 #define _istgraph_l _isgraph_l
1076 #define _istlower islower
1077 #define _istlower_l _islower_l
1078 #define _istprint isprint
1079 #define _istprint_l _isprint_l
1080 #define _istpunct ispunct
1081 #define _istpunct_l _ispunct_l
1082 #define _istspace isspace
1083 #define _istspace_l _isspace_l
1084 #define _istupper isupper
1085 #define _istupper_l _isupper_l
1086
1087 #define _totupper toupper
1088 #define _totupper_l _toupper_l
1089 #define _totlower tolower
1090 #define _totlower_l _tolower_l
1091
1092 #define _istlegal(_c) (1)
1093
1094 #ifndef NULL
1095 #ifdef __cplusplus
1096 #define NULL 0
1097 #else
1098 #define NULL ((void *)0)
1099 #endif
1100 #endif
1101
1102 #define _strdec(_cpc1,_cpc2) ((_cpc1)>=(_cpc2) ? NULL : (_cpc2)-1)
1103 #define _strinc(_pc) ((_pc)+1)
1104 #define _strnextc(_cpc) ((unsigned int) *(const unsigned char *)(_cpc))
1105 #define _strninc(_pc,_sz) (((_pc)+(_sz)))
1106 _CRTIMP size_t __cdecl __strncnt(const char *_Str,size_t _Cnt);
1107 #define _strncnt(_cpc,_sz) (__strncnt(_cpc,_sz))
1108 #define _strspnp(_cpc1,_cpc2) (!_cpc1 ? NULL : ((*((_cpc1)+strspn(_cpc1,_cpc2))) ? ((_cpc1)+strspn(_cpc1,_cpc2)) : NULL))
1109
1110 #define _strncpy_l(_Destination,_Source,_Count,_Locale) (strncpy(_Destination,_Source,_Count))
1111 #define _strncat_l(_Destination,_Source,_Count,_Locale) (strncat(_Destination,_Source,_Count))
1112 #define _strtok_l(_String,_Delimiters,_Locale) (strtok(_String,_Delimiters))
1113 #define _strnset_l(_Destination,_Value,_Count,_Locale) (_strnset(_Destination,_Value,_Count))
1114 #define _strset_l(_Destination,_Value,_Locale) (_strset(_Destination,_Value))
1115
1116 #endif /* !_MBCS */
1117 #endif /* !UNICODE */
1118 /*****************************************************************************/
1119
1120 #define _T(x) __T(x)
1121 #define _TEXT(x) __T(x)
1122
1123 #ifdef __cplusplus
1124 }
1125 #endif
1126
1127 #include <sec_api/tchar_s.h>
1128 #endif