michael@0: /* michael@0: * tchar.h michael@0: * michael@0: * This file is a part of NSIS. michael@0: * michael@0: * Copyright (C) 1999-2007 Nullsoft and Contributors michael@0: * michael@0: * This software is provided 'as-is', without any express or implied michael@0: * warranty. michael@0: * michael@0: * For Unicode support by Jim Park -- 08/30/2007 michael@0: */ michael@0: michael@0: // Jim Park: Only those we use are listed here. michael@0: michael@0: #pragma once michael@0: michael@0: #ifdef _UNICODE michael@0: michael@0: #ifndef _T michael@0: #define __T(x) L ## x michael@0: #define _T(x) __T(x) michael@0: #define _TEXT(x) __T(x) michael@0: #endif michael@0: typedef wchar_t TCHAR; michael@0: typedef wchar_t _TUCHAR; michael@0: michael@0: // program michael@0: #define _tmain wmain michael@0: #define _tWinMain wWinMain michael@0: #define _tenviron _wenviron michael@0: #define __targv __wargv michael@0: michael@0: // printfs michael@0: #define _ftprintf fwprintf michael@0: #define _sntprintf _snwprintf michael@0: #define _stprintf _swprintf michael@0: #define _tprintf wprintf michael@0: #define _vftprintf vfwprintf michael@0: #define _vsntprintf _vsnwprintf michael@0: #define _vstprintf _vswprintf michael@0: michael@0: // scanfs michael@0: #define _tscanf wscanf michael@0: #define _stscanf swscanf michael@0: michael@0: // string manipulations michael@0: #define _tcscat wcscat michael@0: #define _tcschr wcschr michael@0: #define _tcsclen wcslen michael@0: #define _tcscpy wcscpy michael@0: #define _tcsdup _wcsdup michael@0: #define _tcslen wcslen michael@0: #define _tcsnccpy wcsncpy michael@0: #define _tcsncpy wcsncpy michael@0: #define _tcsrchr wcsrchr michael@0: #define _tcsstr wcsstr michael@0: #define _tcstok wcstok michael@0: michael@0: // string comparisons michael@0: #define _tcscmp wcscmp michael@0: #define _tcsicmp _wcsicmp michael@0: #define _tcsncicmp _wcsnicmp michael@0: #define _tcsncmp wcsncmp michael@0: #define _tcsnicmp _wcsnicmp michael@0: michael@0: // upper / lower michael@0: #define _tcslwr _wcslwr michael@0: #define _tcsupr _wcsupr michael@0: #define _totlower towlower michael@0: #define _totupper towupper michael@0: michael@0: // conversions to numbers michael@0: #define _tcstoi64 _wcstoi64 michael@0: #define _tcstol wcstol michael@0: #define _tcstoul wcstoul michael@0: #define _tstof _wtof michael@0: #define _tstoi _wtoi michael@0: #define _tstoi64 _wtoi64 michael@0: #define _ttoi _wtoi michael@0: #define _ttoi64 _wtoi64 michael@0: #define _ttol _wtol michael@0: michael@0: // conversion from numbers to strings michael@0: #define _itot _itow michael@0: #define _ltot _ltow michael@0: #define _i64tot _i64tow michael@0: #define _ui64tot _ui64tow michael@0: michael@0: // file manipulations michael@0: #define _tfopen _wfopen michael@0: #define _topen _wopen michael@0: #define _tremove _wremove michael@0: #define _tunlink _wunlink michael@0: michael@0: // reading and writing to i/o michael@0: #define _fgettc fgetwc michael@0: #define _fgetts fgetws michael@0: #define _fputts fputws michael@0: #define _gettchar getwchar michael@0: michael@0: // directory michael@0: #define _tchdir _wchdir michael@0: michael@0: // environment michael@0: #define _tgetenv _wgetenv michael@0: #define _tsystem _wsystem michael@0: michael@0: // time michael@0: #define _tcsftime wcsftime michael@0: michael@0: #else // ANSI michael@0: michael@0: #ifndef _T michael@0: #define _T(x) x michael@0: #define _TEXT(x) x michael@0: #endif michael@0: typedef char TCHAR; michael@0: typedef unsigned char _TUCHAR; michael@0: michael@0: // program michael@0: #define _tmain main michael@0: #define _tWinMain WinMain michael@0: #define _tenviron environ michael@0: #define __targv __argv michael@0: michael@0: // printfs michael@0: #define _ftprintf fprintf michael@0: #define _sntprintf _snprintf michael@0: #define _stprintf sprintf michael@0: #define _tprintf printf michael@0: #define _vftprintf vfprintf michael@0: #define _vsntprintf _vsnprintf michael@0: #define _vstprintf vsprintf michael@0: michael@0: // scanfs michael@0: #define _tscanf scanf michael@0: #define _stscanf sscanf michael@0: michael@0: // string manipulations michael@0: #define _tcscat strcat michael@0: #define _tcschr strchr michael@0: #define _tcsclen strlen michael@0: #define _tcscnlen strnlen michael@0: #define _tcscpy strcpy michael@0: #define _tcsdup _strdup michael@0: #define _tcslen strlen michael@0: #define _tcsnccpy strncpy michael@0: #define _tcsrchr strrchr michael@0: #define _tcsstr strstr michael@0: #define _tcstok strtok michael@0: michael@0: // string comparisons michael@0: #define _tcscmp strcmp michael@0: #define _tcsicmp _stricmp michael@0: #define _tcsncmp strncmp michael@0: #define _tcsncicmp _strnicmp michael@0: #define _tcsnicmp _strnicmp michael@0: michael@0: // upper / lower michael@0: #define _tcslwr _strlwr michael@0: #define _tcsupr _strupr michael@0: michael@0: #define _totupper toupper michael@0: #define _totlower tolower michael@0: michael@0: // conversions to numbers michael@0: #define _tcstol strtol michael@0: #define _tcstoul strtoul michael@0: #define _tstof atof michael@0: #define _tstoi atoi michael@0: #define _tstoi64 _atoi64 michael@0: #define _tstoi64 _atoi64 michael@0: #define _ttoi atoi michael@0: #define _ttoi64 _atoi64 michael@0: #define _ttol atol michael@0: michael@0: // conversion from numbers to strings michael@0: #define _i64tot _i64toa michael@0: #define _itot _itoa michael@0: #define _ltot _ltoa michael@0: #define _ui64tot _ui64toa michael@0: michael@0: // file manipulations michael@0: #define _tfopen fopen michael@0: #define _topen _open michael@0: #define _tremove remove michael@0: #define _tunlink _unlink michael@0: michael@0: // reading and writing to i/o michael@0: #define _fgettc fgetc michael@0: #define _fgetts fgets michael@0: #define _fputts fputs michael@0: #define _gettchar getchar michael@0: michael@0: // directory michael@0: #define _tchdir _chdir michael@0: michael@0: // environment michael@0: #define _tgetenv getenv michael@0: #define _tsystem system michael@0: michael@0: // time michael@0: #define _tcsftime strftime michael@0: michael@0: #endif michael@0: michael@0: // is functions (the same in Unicode / ANSI) michael@0: #define _istgraph isgraph michael@0: #define _istascii __isascii