other-licenses/nsis/Contrib/ExDLL/tchar.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /*
michael@0 2 * tchar.h
michael@0 3 *
michael@0 4 * This file is a part of NSIS.
michael@0 5 *
michael@0 6 * Copyright (C) 1999-2007 Nullsoft and Contributors
michael@0 7 *
michael@0 8 * This software is provided 'as-is', without any express or implied
michael@0 9 * warranty.
michael@0 10 *
michael@0 11 * For Unicode support by Jim Park -- 08/30/2007
michael@0 12 */
michael@0 13
michael@0 14 // Jim Park: Only those we use are listed here.
michael@0 15
michael@0 16 #pragma once
michael@0 17
michael@0 18 #ifdef _UNICODE
michael@0 19
michael@0 20 #ifndef _T
michael@0 21 #define __T(x) L ## x
michael@0 22 #define _T(x) __T(x)
michael@0 23 #define _TEXT(x) __T(x)
michael@0 24 #endif
michael@0 25 typedef wchar_t TCHAR;
michael@0 26 typedef wchar_t _TUCHAR;
michael@0 27
michael@0 28 // program
michael@0 29 #define _tmain wmain
michael@0 30 #define _tWinMain wWinMain
michael@0 31 #define _tenviron _wenviron
michael@0 32 #define __targv __wargv
michael@0 33
michael@0 34 // printfs
michael@0 35 #define _ftprintf fwprintf
michael@0 36 #define _sntprintf _snwprintf
michael@0 37 #define _stprintf _swprintf
michael@0 38 #define _tprintf wprintf
michael@0 39 #define _vftprintf vfwprintf
michael@0 40 #define _vsntprintf _vsnwprintf
michael@0 41 #define _vstprintf _vswprintf
michael@0 42
michael@0 43 // scanfs
michael@0 44 #define _tscanf wscanf
michael@0 45 #define _stscanf swscanf
michael@0 46
michael@0 47 // string manipulations
michael@0 48 #define _tcscat wcscat
michael@0 49 #define _tcschr wcschr
michael@0 50 #define _tcsclen wcslen
michael@0 51 #define _tcscpy wcscpy
michael@0 52 #define _tcsdup _wcsdup
michael@0 53 #define _tcslen wcslen
michael@0 54 #define _tcsnccpy wcsncpy
michael@0 55 #define _tcsncpy wcsncpy
michael@0 56 #define _tcsrchr wcsrchr
michael@0 57 #define _tcsstr wcsstr
michael@0 58 #define _tcstok wcstok
michael@0 59
michael@0 60 // string comparisons
michael@0 61 #define _tcscmp wcscmp
michael@0 62 #define _tcsicmp _wcsicmp
michael@0 63 #define _tcsncicmp _wcsnicmp
michael@0 64 #define _tcsncmp wcsncmp
michael@0 65 #define _tcsnicmp _wcsnicmp
michael@0 66
michael@0 67 // upper / lower
michael@0 68 #define _tcslwr _wcslwr
michael@0 69 #define _tcsupr _wcsupr
michael@0 70 #define _totlower towlower
michael@0 71 #define _totupper towupper
michael@0 72
michael@0 73 // conversions to numbers
michael@0 74 #define _tcstoi64 _wcstoi64
michael@0 75 #define _tcstol wcstol
michael@0 76 #define _tcstoul wcstoul
michael@0 77 #define _tstof _wtof
michael@0 78 #define _tstoi _wtoi
michael@0 79 #define _tstoi64 _wtoi64
michael@0 80 #define _ttoi _wtoi
michael@0 81 #define _ttoi64 _wtoi64
michael@0 82 #define _ttol _wtol
michael@0 83
michael@0 84 // conversion from numbers to strings
michael@0 85 #define _itot _itow
michael@0 86 #define _ltot _ltow
michael@0 87 #define _i64tot _i64tow
michael@0 88 #define _ui64tot _ui64tow
michael@0 89
michael@0 90 // file manipulations
michael@0 91 #define _tfopen _wfopen
michael@0 92 #define _topen _wopen
michael@0 93 #define _tremove _wremove
michael@0 94 #define _tunlink _wunlink
michael@0 95
michael@0 96 // reading and writing to i/o
michael@0 97 #define _fgettc fgetwc
michael@0 98 #define _fgetts fgetws
michael@0 99 #define _fputts fputws
michael@0 100 #define _gettchar getwchar
michael@0 101
michael@0 102 // directory
michael@0 103 #define _tchdir _wchdir
michael@0 104
michael@0 105 // environment
michael@0 106 #define _tgetenv _wgetenv
michael@0 107 #define _tsystem _wsystem
michael@0 108
michael@0 109 // time
michael@0 110 #define _tcsftime wcsftime
michael@0 111
michael@0 112 #else // ANSI
michael@0 113
michael@0 114 #ifndef _T
michael@0 115 #define _T(x) x
michael@0 116 #define _TEXT(x) x
michael@0 117 #endif
michael@0 118 typedef char TCHAR;
michael@0 119 typedef unsigned char _TUCHAR;
michael@0 120
michael@0 121 // program
michael@0 122 #define _tmain main
michael@0 123 #define _tWinMain WinMain
michael@0 124 #define _tenviron environ
michael@0 125 #define __targv __argv
michael@0 126
michael@0 127 // printfs
michael@0 128 #define _ftprintf fprintf
michael@0 129 #define _sntprintf _snprintf
michael@0 130 #define _stprintf sprintf
michael@0 131 #define _tprintf printf
michael@0 132 #define _vftprintf vfprintf
michael@0 133 #define _vsntprintf _vsnprintf
michael@0 134 #define _vstprintf vsprintf
michael@0 135
michael@0 136 // scanfs
michael@0 137 #define _tscanf scanf
michael@0 138 #define _stscanf sscanf
michael@0 139
michael@0 140 // string manipulations
michael@0 141 #define _tcscat strcat
michael@0 142 #define _tcschr strchr
michael@0 143 #define _tcsclen strlen
michael@0 144 #define _tcscnlen strnlen
michael@0 145 #define _tcscpy strcpy
michael@0 146 #define _tcsdup _strdup
michael@0 147 #define _tcslen strlen
michael@0 148 #define _tcsnccpy strncpy
michael@0 149 #define _tcsrchr strrchr
michael@0 150 #define _tcsstr strstr
michael@0 151 #define _tcstok strtok
michael@0 152
michael@0 153 // string comparisons
michael@0 154 #define _tcscmp strcmp
michael@0 155 #define _tcsicmp _stricmp
michael@0 156 #define _tcsncmp strncmp
michael@0 157 #define _tcsncicmp _strnicmp
michael@0 158 #define _tcsnicmp _strnicmp
michael@0 159
michael@0 160 // upper / lower
michael@0 161 #define _tcslwr _strlwr
michael@0 162 #define _tcsupr _strupr
michael@0 163
michael@0 164 #define _totupper toupper
michael@0 165 #define _totlower tolower
michael@0 166
michael@0 167 // conversions to numbers
michael@0 168 #define _tcstol strtol
michael@0 169 #define _tcstoul strtoul
michael@0 170 #define _tstof atof
michael@0 171 #define _tstoi atoi
michael@0 172 #define _tstoi64 _atoi64
michael@0 173 #define _tstoi64 _atoi64
michael@0 174 #define _ttoi atoi
michael@0 175 #define _ttoi64 _atoi64
michael@0 176 #define _ttol atol
michael@0 177
michael@0 178 // conversion from numbers to strings
michael@0 179 #define _i64tot _i64toa
michael@0 180 #define _itot _itoa
michael@0 181 #define _ltot _ltoa
michael@0 182 #define _ui64tot _ui64toa
michael@0 183
michael@0 184 // file manipulations
michael@0 185 #define _tfopen fopen
michael@0 186 #define _topen _open
michael@0 187 #define _tremove remove
michael@0 188 #define _tunlink _unlink
michael@0 189
michael@0 190 // reading and writing to i/o
michael@0 191 #define _fgettc fgetc
michael@0 192 #define _fgetts fgets
michael@0 193 #define _fputts fputs
michael@0 194 #define _gettchar getchar
michael@0 195
michael@0 196 // directory
michael@0 197 #define _tchdir _chdir
michael@0 198
michael@0 199 // environment
michael@0 200 #define _tgetenv getenv
michael@0 201 #define _tsystem system
michael@0 202
michael@0 203 // time
michael@0 204 #define _tcsftime strftime
michael@0 205
michael@0 206 #endif
michael@0 207
michael@0 208 // is functions (the same in Unicode / ANSI)
michael@0 209 #define _istgraph isgraph
michael@0 210 #define _istascii __isascii

mercurial