2000-02-18 03:38:33 +08:00
|
|
|
/*
|
|
|
|
* tchar.h
|
2004-04-21 06:49:32 +08:00
|
|
|
* This file has no copyright assigned and is placed in the Public Domain.
|
|
|
|
* This file is a part of the mingw-runtime package.
|
|
|
|
* No warranty is given; refer to the file DISCLAIMER within the package.
|
2000-02-18 03:38:33 +08:00
|
|
|
*
|
|
|
|
* Unicode mapping layer for the standard C library. By including this
|
|
|
|
* file and using the 't' names for string functions
|
|
|
|
* (eg. _tprintf) you can make code which can be easily adapted to both
|
|
|
|
* Unicode and non-unicode environments. In a unicode enabled compile define
|
|
|
|
* _UNICODE before including tchar.h, otherwise the standard non-unicode
|
|
|
|
* library functions will be used.
|
|
|
|
*
|
|
|
|
* Note that you still need to include string.h or stdlib.h etc. to define
|
|
|
|
* the appropriate functions. Also note that there are several defines
|
|
|
|
* included for non-ANSI functions which are commonly available (but using
|
|
|
|
* the convention of prepending an underscore to non-ANSI library function
|
|
|
|
* names).
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _TCHAR_H_
|
|
|
|
#define _TCHAR_H_
|
|
|
|
|
|
|
|
/* All the headers include this file. */
|
|
|
|
#include <_mingw.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NOTE: This tests _UNICODE, which is different from the UNICODE define
|
|
|
|
* used to differentiate Win32 API calls.
|
|
|
|
*/
|
|
|
|
#ifdef _UNICODE
|
|
|
|
|
2005-10-14 04:31:50 +08:00
|
|
|
/*
|
|
|
|
* Include <wchar.h> for wchar_t and WEOF if _UNICODE.
|
|
|
|
*/
|
|
|
|
#include <wchar.h>
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Use TCHAR instead of char or wchar_t. It will be appropriately translated
|
|
|
|
* if _UNICODE is correctly defined (or not).
|
|
|
|
*/
|
|
|
|
#ifndef _TCHAR_DEFINED
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
typedef wchar_t TCHAR;
|
2002-01-25 11:04:46 +08:00
|
|
|
typedef wchar_t _TCHAR;
|
2000-02-18 03:38:33 +08:00
|
|
|
#endif /* Not RC_INVOKED */
|
|
|
|
#define _TCHAR_DEFINED
|
|
|
|
#endif
|
|
|
|
|
2005-10-14 04:31:50 +08:00
|
|
|
/*
|
|
|
|
* Use _TEOF instead of EOF or WEOF. It will be appropriately translated if
|
|
|
|
* _UNICODE is correctly defined (or not).
|
|
|
|
*/
|
|
|
|
#define _TEOF WEOF
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
/*
|
2001-02-03 00:50:06 +08:00
|
|
|
* __TEXT is a private macro whose specific use is to force the expansion of a
|
|
|
|
* macro passed as an argument to the macros _T or _TEXT. DO NOT use this
|
|
|
|
* macro within your programs. It's name and function could change without
|
|
|
|
* notice.
|
2000-02-18 03:38:33 +08:00
|
|
|
*/
|
2002-04-20 13:13:20 +08:00
|
|
|
#define __TEXT(q) L##q
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2000-11-21 10:50:03 +08:00
|
|
|
/* for porting from other Windows compilers */
|
2003-03-17 06:15:19 +08:00
|
|
|
#if 0 /* no wide startup module */
|
2000-11-21 10:50:03 +08:00
|
|
|
#define _tmain wmain
|
|
|
|
#define _tWinMain wWinMain
|
|
|
|
#define _tenviron _wenviron
|
|
|
|
#define __targv __wargv
|
|
|
|
#endif
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
/*
|
|
|
|
* Unicode functions
|
|
|
|
*/
|
|
|
|
#define _tprintf wprintf
|
|
|
|
#define _ftprintf fwprintf
|
|
|
|
#define _stprintf swprintf
|
|
|
|
#define _sntprintf _snwprintf
|
|
|
|
#define _vtprintf vwprintf
|
|
|
|
#define _vftprintf vfwprintf
|
|
|
|
#define _vstprintf vswprintf
|
|
|
|
#define _vsntprintf _vsnwprintf
|
2010-03-07 11:08:35 +08:00
|
|
|
#define _vsctprintf _vscwprintf
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _tscanf wscanf
|
|
|
|
#define _ftscanf fwscanf
|
|
|
|
#define _stscanf swscanf
|
|
|
|
#define _fgettc fgetwc
|
|
|
|
#define _fgettchar _fgetwchar
|
|
|
|
#define _fgetts fgetws
|
|
|
|
#define _fputtc fputwc
|
|
|
|
#define _fputtchar _fputwchar
|
|
|
|
#define _fputts fputws
|
|
|
|
#define _gettc getwc
|
2002-06-19 04:48:57 +08:00
|
|
|
#define _getts _getws
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _puttc putwc
|
2004-01-14 15:53:43 +08:00
|
|
|
#define _puttchar putwchar
|
2002-06-19 04:48:57 +08:00
|
|
|
#define _putts _putws
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _ungettc ungetwc
|
|
|
|
#define _tcstod wcstod
|
|
|
|
#define _tcstol wcstol
|
|
|
|
#define _tcstoul wcstoul
|
|
|
|
#define _itot _itow
|
|
|
|
#define _ltot _ltow
|
|
|
|
#define _ultot _ultow
|
|
|
|
#define _ttoi _wtoi
|
|
|
|
#define _ttol _wtol
|
|
|
|
#define _tcscat wcscat
|
|
|
|
#define _tcschr wcschr
|
|
|
|
#define _tcscmp wcscmp
|
|
|
|
#define _tcscpy wcscpy
|
|
|
|
#define _tcscspn wcscspn
|
|
|
|
#define _tcslen wcslen
|
|
|
|
#define _tcsncat wcsncat
|
|
|
|
#define _tcsncmp wcsncmp
|
|
|
|
#define _tcsncpy wcsncpy
|
|
|
|
#define _tcspbrk wcspbrk
|
|
|
|
#define _tcsrchr wcsrchr
|
|
|
|
#define _tcsspn wcsspn
|
|
|
|
#define _tcsstr wcsstr
|
|
|
|
#define _tcstok wcstok
|
|
|
|
#define _tcsdup _wcsdup
|
|
|
|
#define _tcsicmp _wcsicmp
|
|
|
|
#define _tcsnicmp _wcsnicmp
|
|
|
|
#define _tcsnset _wcsnset
|
|
|
|
#define _tcsrev _wcsrev
|
|
|
|
#define _tcsset _wcsset
|
|
|
|
#define _tcslwr _wcslwr
|
|
|
|
#define _tcsupr _wcsupr
|
|
|
|
#define _tcsxfrm wcsxfrm
|
|
|
|
#define _tcscoll wcscoll
|
|
|
|
#define _tcsicoll _wcsicoll
|
|
|
|
#define _istalpha iswalpha
|
|
|
|
#define _istupper iswupper
|
|
|
|
#define _istlower iswlower
|
|
|
|
#define _istdigit iswdigit
|
|
|
|
#define _istxdigit iswxdigit
|
|
|
|
#define _istspace iswspace
|
|
|
|
#define _istpunct iswpunct
|
|
|
|
#define _istalnum iswalnum
|
|
|
|
#define _istprint iswprint
|
|
|
|
#define _istgraph iswgraph
|
|
|
|
#define _istcntrl iswcntrl
|
|
|
|
#define _istascii iswascii
|
|
|
|
#define _totupper towupper
|
|
|
|
#define _totlower towlower
|
2000-11-21 10:50:03 +08:00
|
|
|
#define _tcsftime wcsftime
|
|
|
|
/* Macro functions */
|
|
|
|
#define _tcsdec _wcsdec
|
|
|
|
#define _tcsinc _wcsinc
|
|
|
|
#define _tcsnbcnt _wcsncnt
|
|
|
|
#define _tcsnccnt _wcsncnt
|
|
|
|
#define _tcsnextc _wcsnextc
|
|
|
|
#define _tcsninc _wcsninc
|
|
|
|
#define _tcsspnp _wcsspnp
|
|
|
|
#define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1)
|
|
|
|
#define _wcsinc(_wcs) ((_wcs)+1)
|
|
|
|
#define _wcsnextc(_wcs) ((unsigned int) *(_wcs))
|
|
|
|
#define _wcsninc(_wcs, _inc) (((_wcs)+(_inc)))
|
|
|
|
#define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs))
|
|
|
|
#define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL)
|
|
|
|
|
2002-08-21 07:08:14 +08:00
|
|
|
#if 1 /* defined __MSVCRT__ */
|
2000-11-21 10:50:03 +08:00
|
|
|
/*
|
|
|
|
* These wide functions not in crtdll.dll.
|
|
|
|
* Define macros anyway so that _wfoo rather than _tfoo is undefined
|
|
|
|
*/
|
|
|
|
#define _ttoi64 _wtoi64
|
|
|
|
#define _i64tot _i64tow
|
|
|
|
#define _ui64tot _ui64tow
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _tasctime _wasctime
|
|
|
|
#define _tctime _wctime
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tctime32 _wctime32
|
|
|
|
#define _tctime64 _wctime64
|
|
|
|
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _tstrdate _wstrdate
|
|
|
|
#define _tstrtime _wstrtime
|
|
|
|
#define _tutime _wutime
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tutime64 _wutime64
|
|
|
|
#define _tutime32 _wutime32
|
|
|
|
#endif /* __MSVCRT_VERSION__ > 0x0800 */
|
2000-11-21 10:50:03 +08:00
|
|
|
#define _tcsnccoll _wcsncoll
|
|
|
|
#define _tcsncoll _wcsncoll
|
|
|
|
#define _tcsncicoll _wcsnicoll
|
|
|
|
#define _tcsnicoll _wcsnicoll
|
|
|
|
#define _taccess _waccess
|
|
|
|
#define _tchmod _wchmod
|
|
|
|
#define _tcreat _wcreat
|
|
|
|
#define _tfindfirst _wfindfirst
|
|
|
|
#define _tfindnext _wfindnext
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tfindfirst64 _wfindfirst64
|
|
|
|
#define _tfindfirst32 _wfindfirst32
|
|
|
|
#define _tfindnext64 _wfindnext64
|
|
|
|
#define _tfindnext32 _wfindnext32
|
|
|
|
#endif /* __MSVCRT_VERSION__ > 0x0800 */
|
2002-07-29 11:05:56 +08:00
|
|
|
#define _tfdopen _wfdopen
|
2001-06-12 02:13:15 +08:00
|
|
|
#define _tfopen _wfopen
|
2005-01-12 17:08:12 +08:00
|
|
|
#define _tfreopen _wfreopen
|
2004-03-26 04:30:19 +08:00
|
|
|
#define _tfsopen _wfsopen
|
2001-06-12 02:13:15 +08:00
|
|
|
#define _tgetenv _wgetenv
|
2002-04-20 13:13:20 +08:00
|
|
|
#define _tputenv _wputenv
|
|
|
|
#define _tsearchenv _wsearchenv
|
2007-07-12 17:38:17 +08:00
|
|
|
#define _tsystem _wsystem
|
2002-04-20 13:13:20 +08:00
|
|
|
#define _tmakepath _wmakepath
|
|
|
|
#define _tsplitpath _wsplitpath
|
|
|
|
#define _tfullpath _wfullpath
|
2000-11-21 10:50:03 +08:00
|
|
|
#define _tmktemp _wmktemp
|
|
|
|
#define _topen _wopen
|
|
|
|
#define _tremove _wremove
|
|
|
|
#define _trename _wrename
|
|
|
|
#define _tsopen _wsopen
|
2001-06-12 02:13:15 +08:00
|
|
|
#define _tsetlocale _wsetlocale
|
2000-11-21 10:50:03 +08:00
|
|
|
#define _tunlink _wunlink
|
|
|
|
#define _tfinddata_t _wfinddata_t
|
|
|
|
#define _tfindfirsti64 _wfindfirsti64
|
|
|
|
#define _tfindnexti64 _wfindnexti64
|
|
|
|
#define _tfinddatai64_t _wfinddatai64_t
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0601
|
|
|
|
#define _tfinddata64_t _wfinddata64_t
|
|
|
|
#endif
|
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tfinddata32_t _wfinddata32_t
|
|
|
|
#define _tfinddata32i64_t _wfinddata32i64_t
|
|
|
|
#define _tfinddata64i32_t _wfinddata64i32_t
|
|
|
|
#define _tfindfirst32i64 _wfindfirst32i64
|
|
|
|
#define _tfindfirst64i32 _wfindfirst64i32
|
|
|
|
#define _tfindnext32i64 _wfindnext32i64
|
|
|
|
#define _tfindnext64i32 _wfindnext64i32
|
|
|
|
#endif /* __MSVCRT_VERSION__ > 0x0800 */
|
2002-10-09 04:28:14 +08:00
|
|
|
#define _tchdir _wchdir
|
|
|
|
#define _tgetcwd _wgetcwd
|
|
|
|
#define _tgetdcwd _wgetdcwd
|
|
|
|
#define _tmkdir _wmkdir
|
|
|
|
#define _trmdir _wrmdir
|
|
|
|
#define _tstat _wstat
|
2005-02-11 15:23:44 +08:00
|
|
|
#define _tstati64 _wstati64
|
|
|
|
#define _tstat64 _wstat64
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tstat32 _wstat32
|
|
|
|
#define _tstat32i64 _wstat32i64
|
|
|
|
#define _tstat64i32 _wstat64i32
|
|
|
|
#endif /* __MSVCRT_VERSION__ > 0x0800 */
|
2000-11-21 10:50:03 +08:00
|
|
|
#endif /* __MSVCRT__ */
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2002-06-13 18:20:48 +08:00
|
|
|
/* dirent structures and functions */
|
|
|
|
#define _tdirent _wdirent
|
|
|
|
#define _TDIR _WDIR
|
|
|
|
#define _topendir _wopendir
|
|
|
|
#define _tclosedir _wclosedir
|
|
|
|
#define _treaddir _wreaddir
|
|
|
|
#define _trewinddir _wrewinddir
|
|
|
|
#define _ttelldir _wtelldir
|
|
|
|
#define _tseekdir _wseekdir
|
2005-10-14 04:31:50 +08:00
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
#else /* Not _UNICODE */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* TCHAR, the type you should use instead of char.
|
|
|
|
*/
|
|
|
|
#ifndef _TCHAR_DEFINED
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
typedef char TCHAR;
|
2002-01-25 11:00:36 +08:00
|
|
|
typedef char _TCHAR;
|
2000-02-18 03:38:33 +08:00
|
|
|
#endif
|
|
|
|
#define _TCHAR_DEFINED
|
|
|
|
#endif
|
|
|
|
|
2005-10-14 04:31:50 +08:00
|
|
|
/*
|
|
|
|
* _TEOF, the constant you should use instead of EOF.
|
|
|
|
*/
|
|
|
|
#define _TEOF EOF
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
/*
|
2001-02-03 00:50:06 +08:00
|
|
|
* __TEXT is a private macro whose specific use is to force the expansion of a
|
|
|
|
* macro passed as an argument to the macros _T or _TEXT. DO NOT use this
|
|
|
|
* macro within your programs. It's name and function could change without
|
|
|
|
* notice.
|
2000-02-18 03:38:33 +08:00
|
|
|
*/
|
2002-04-20 13:13:20 +08:00
|
|
|
#define __TEXT(q) q
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2000-11-21 10:50:03 +08:00
|
|
|
/* for porting from other Windows compilers */
|
|
|
|
#define _tmain main
|
|
|
|
#define _tWinMain WinMain
|
|
|
|
#define _tenviron _environ
|
|
|
|
#define __targv __argv
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
/*
|
|
|
|
* Non-unicode (standard) functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define _tprintf printf
|
|
|
|
#define _ftprintf fprintf
|
|
|
|
#define _stprintf sprintf
|
|
|
|
#define _sntprintf _snprintf
|
|
|
|
#define _vtprintf vprintf
|
|
|
|
#define _vftprintf vfprintf
|
|
|
|
#define _vstprintf vsprintf
|
|
|
|
#define _vsntprintf _vsnprintf
|
2010-03-07 11:08:35 +08:00
|
|
|
#define _vsctprintf _vscprintf
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _tscanf scanf
|
|
|
|
#define _ftscanf fscanf
|
|
|
|
#define _stscanf sscanf
|
|
|
|
#define _fgettc fgetc
|
|
|
|
#define _fgettchar _fgetchar
|
|
|
|
#define _fgetts fgets
|
|
|
|
#define _fputtc fputc
|
|
|
|
#define _fputtchar _fputchar
|
|
|
|
#define _fputts fputs
|
2002-06-18 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/_mingw.h (__MINGW_IMPORT): Check for prior definition before
defining.
* include/excpt.h (): Include windef.h not windows.h.
* include/fcntl.h (_O_SHORT_LIVED): Add define.
(_chmod): Add prototype.
(_creat): Correct prototype.
(SH_DENY*): Rename defines to _SH_DENY*.
(SH_DENY*): Add Non-ANSI names for _SH_DENY*.
include/stdio.h (_IOMYBUF, _IOEOF, _IOERR, _IOSTRG,
_IOAPPEND): Add defines.
(_wfindfirst): Correct prototype.
(_wfdopen): Add prototype.
* include/stdlib.h (_rotl, _rotr, _lrotl, _lrotr): Add
prototypes.
* include/string.h (_mbschr, _mbstok, _mbsncat): Remove
prototypes.
(_wcsdup): Correct prototype.
* include/mbstring.h: Remove comments about _mbschr, _mbstok,
_mbsncat being in string.h.
* include/wchar.h (_wfindfirst): Correct prototype.
* include/tchar.h (_tfdopen): Add _UNICODE mappings.
2002-06-18 12:13:18 +08:00
|
|
|
#define _tfdopen _fdopen
|
2001-06-12 02:13:15 +08:00
|
|
|
#define _tfopen fopen
|
2005-01-12 17:08:12 +08:00
|
|
|
#define _tfreopen freopen
|
2004-03-26 04:30:19 +08:00
|
|
|
#define _tfsopen _fsopen
|
2001-06-12 02:13:15 +08:00
|
|
|
#define _tgetenv getenv
|
2002-04-20 13:13:20 +08:00
|
|
|
#define _tputenv _putenv
|
|
|
|
#define _tsearchenv _searchenv
|
2007-07-12 17:38:17 +08:00
|
|
|
#define _tsystem system
|
2002-04-20 13:13:20 +08:00
|
|
|
#define _tmakepath _makepath
|
|
|
|
#define _tsplitpath _splitpath
|
|
|
|
#define _tfullpath _fullpath
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _gettc getc
|
|
|
|
#define _getts gets
|
|
|
|
#define _puttc putc
|
2004-01-14 15:53:43 +08:00
|
|
|
#define _puttchar putchar
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _putts puts
|
|
|
|
#define _ungettc ungetc
|
|
|
|
#define _tcstod strtod
|
|
|
|
#define _tcstol strtol
|
|
|
|
#define _tcstoul strtoul
|
|
|
|
#define _itot _itoa
|
|
|
|
#define _ltot _ltoa
|
|
|
|
#define _ultot _ultoa
|
|
|
|
#define _ttoi atoi
|
|
|
|
#define _ttol atol
|
|
|
|
#define _tcscat strcat
|
|
|
|
#define _tcschr strchr
|
|
|
|
#define _tcscmp strcmp
|
|
|
|
#define _tcscpy strcpy
|
|
|
|
#define _tcscspn strcspn
|
|
|
|
#define _tcslen strlen
|
|
|
|
#define _tcsncat strncat
|
|
|
|
#define _tcsncmp strncmp
|
|
|
|
#define _tcsncpy strncpy
|
|
|
|
#define _tcspbrk strpbrk
|
|
|
|
#define _tcsrchr strrchr
|
|
|
|
#define _tcsspn strspn
|
|
|
|
#define _tcsstr strstr
|
|
|
|
#define _tcstok strtok
|
|
|
|
#define _tcsdup _strdup
|
|
|
|
#define _tcsicmp _stricmp
|
|
|
|
#define _tcsnicmp _strnicmp
|
|
|
|
#define _tcsnset _strnset
|
|
|
|
#define _tcsrev _strrev
|
|
|
|
#define _tcsset _strset
|
|
|
|
#define _tcslwr _strlwr
|
|
|
|
#define _tcsupr _strupr
|
|
|
|
#define _tcsxfrm strxfrm
|
|
|
|
#define _tcscoll strcoll
|
|
|
|
#define _tcsicoll _stricoll
|
|
|
|
#define _istalpha isalpha
|
|
|
|
#define _istupper isupper
|
|
|
|
#define _istlower islower
|
|
|
|
#define _istdigit isdigit
|
|
|
|
#define _istxdigit isxdigit
|
|
|
|
#define _istspace isspace
|
|
|
|
#define _istpunct ispunct
|
|
|
|
#define _istalnum isalnum
|
|
|
|
#define _istprint isprint
|
|
|
|
#define _istgraph isgraph
|
|
|
|
#define _istcntrl iscntrl
|
|
|
|
#define _istascii isascii
|
|
|
|
#define _totupper toupper
|
|
|
|
#define _totlower tolower
|
|
|
|
#define _tasctime asctime
|
|
|
|
#define _tctime ctime
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tctime32 _ctime32
|
|
|
|
#define _tctime64 _ctime64
|
|
|
|
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _tstrdate _strdate
|
|
|
|
#define _tstrtime _strtime
|
|
|
|
#define _tutime _utime
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tutime64 _utime64
|
|
|
|
#define _tutime32 _utime32
|
|
|
|
#endif /* __MSVCRT_VERSION__ > 0x0800 */
|
2000-02-18 03:38:33 +08:00
|
|
|
#define _tcsftime strftime
|
2000-11-21 10:50:03 +08:00
|
|
|
/* Macro functions */
|
|
|
|
#define _tcsdec _strdec
|
|
|
|
#define _tcsinc _strinc
|
|
|
|
#define _tcsnbcnt _strncnt
|
|
|
|
#define _tcsnccnt _strncnt
|
|
|
|
#define _tcsnextc _strnextc
|
|
|
|
#define _tcsninc _strninc
|
|
|
|
#define _tcsspnp _strspnp
|
|
|
|
#define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1)
|
|
|
|
#define _strinc(_str) ((_str)+1)
|
|
|
|
#define _strnextc(_str) ((unsigned int) *(_str))
|
|
|
|
#define _strninc(_str, _inc) (((_str)+(_inc)))
|
|
|
|
#define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str))
|
|
|
|
#define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL)
|
|
|
|
|
|
|
|
#define _tchmod _chmod
|
|
|
|
#define _tcreat _creat
|
|
|
|
#define _tfindfirst _findfirst
|
|
|
|
#define _tfindnext _findnext
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tfindfirst64 _findfirst64
|
|
|
|
#define _tfindfirst32 _findfirst32
|
|
|
|
#define _tfindnext64 _findnext64
|
|
|
|
#define _tfindnext32 _findnext32
|
|
|
|
#endif /* __MSVCRT_VERSION__ > 0x0800 */
|
2000-11-21 10:50:03 +08:00
|
|
|
#define _tmktemp _mktemp
|
|
|
|
#define _topen _open
|
|
|
|
#define _taccess _access
|
|
|
|
#define _tremove remove
|
|
|
|
#define _trename rename
|
|
|
|
#define _tsopen _sopen
|
2001-06-12 02:13:15 +08:00
|
|
|
#define _tsetlocale setlocale
|
2000-11-21 10:50:03 +08:00
|
|
|
#define _tunlink _unlink
|
|
|
|
#define _tfinddata_t _finddata_t
|
2002-10-09 04:28:14 +08:00
|
|
|
#define _tchdir _chdir
|
|
|
|
#define _tgetcwd _getcwd
|
|
|
|
#define _tgetdcwd _getdcwd
|
|
|
|
#define _tmkdir _mkdir
|
|
|
|
#define _trmdir _rmdir
|
|
|
|
#define _tstat _stat
|
2000-11-21 10:50:03 +08:00
|
|
|
|
2002-08-21 07:08:14 +08:00
|
|
|
#if 1 /* defined __MSVCRT__ */
|
2000-11-21 10:50:03 +08:00
|
|
|
/* Not in crtdll.dll. Define macros anyway? */
|
|
|
|
#define _ttoi64 _atoi64
|
|
|
|
#define _i64tot _i64toa
|
|
|
|
#define _ui64tot _ui64toa
|
|
|
|
#define _tcsnccoll _strncoll
|
|
|
|
#define _tcsncoll _strncoll
|
|
|
|
#define _tcsncicoll _strnicoll
|
|
|
|
#define _tcsnicoll _strnicoll
|
|
|
|
#define _tfindfirsti64 _findfirsti64
|
|
|
|
#define _tfindnexti64 _findnexti64
|
|
|
|
#define _tfinddatai64_t _finddatai64_t
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0601
|
|
|
|
#define _tfinddata64_t _finddata64_t
|
|
|
|
#endif
|
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tfinddata32_t _finddata32_t
|
|
|
|
#define _tfinddata32i64_t _finddata32i64_t
|
|
|
|
#define _tfinddata64i32_t _finddata64i32_t
|
|
|
|
#define _tfindfirst32i64 _findfirst32i64
|
|
|
|
#define _tfindfirst64i32 _findfirst64i32
|
|
|
|
#define _tfindnext32i64 _findnext32i64
|
|
|
|
#define _tfindnext64i32 _findnext64i32
|
|
|
|
#endif /* __MSVCRT_VERSION__ > 0x0800 */
|
2005-02-11 15:23:44 +08:00
|
|
|
#define _tstati64 _stati64
|
|
|
|
#define _tstat64 _stat64
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#define _tstat32 _stat32
|
|
|
|
#define _tstat32i64 _stat32i64
|
|
|
|
#define _tstat64i32 _stat64i32
|
|
|
|
#endif /* __MSVCRT_VERSION__ > 0x0800 */
|
2000-11-21 10:50:03 +08:00
|
|
|
#endif /* __MSVCRT__ */
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2002-06-13 18:20:48 +08:00
|
|
|
/* dirent structures and functions */
|
|
|
|
#define _tdirent dirent
|
|
|
|
#define _TDIR DIR
|
|
|
|
#define _topendir opendir
|
|
|
|
#define _tclosedir closedir
|
|
|
|
#define _treaddir readdir
|
|
|
|
#define _trewinddir rewinddir
|
|
|
|
#define _ttelldir telldir
|
|
|
|
#define _tseekdir seekdir
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
#endif /* Not _UNICODE */
|
|
|
|
|
2001-02-03 00:50:06 +08:00
|
|
|
/*
|
|
|
|
* UNICODE a constant string when _UNICODE is defined else returns the string
|
|
|
|
* unmodified. Also defined in w32api/winnt.h.
|
|
|
|
*/
|
|
|
|
#define _TEXT(x) __TEXT(x)
|
|
|
|
#define _T(x) __TEXT(x)
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
#endif /* Not _TCHAR_H_ */
|
|
|
|
|