standalone-ruby 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -16
  3. data/bin/standalone-ruby +1 -1
  4. data/lib/data/bat-cmd/default_bat_cmd.txt +9 -9
  5. data/lib/data/c_compilers/tcc/include/_mingw.h +54 -0
  6. data/lib/data/c_compilers/tcc/include/assert.h +71 -0
  7. data/lib/data/c_compilers/tcc/include/conio.h +159 -0
  8. data/lib/data/c_compilers/tcc/include/ctype.h +232 -0
  9. data/lib/data/c_compilers/tcc/include/dir.h +26 -0
  10. data/lib/data/c_compilers/tcc/include/direct.h +95 -0
  11. data/lib/data/c_compilers/tcc/include/dirent.h +96 -0
  12. data/lib/data/c_compilers/tcc/include/dos.h +110 -0
  13. data/lib/data/c_compilers/tcc/include/errno.h +117 -0
  14. data/lib/data/c_compilers/tcc/include/excpt.h +20 -0
  15. data/lib/data/c_compilers/tcc/include/fcntl.h +135 -0
  16. data/lib/data/c_compilers/tcc/include/fenv.h +85 -0
  17. data/lib/data/c_compilers/tcc/include/float.h +224 -0
  18. data/lib/data/c_compilers/tcc/include/inttypes.h +275 -0
  19. data/lib/data/c_compilers/tcc/include/io.h +296 -0
  20. data/lib/data/c_compilers/tcc/include/limits.h +115 -0
  21. data/lib/data/c_compilers/tcc/include/locale.h +100 -0
  22. data/lib/data/c_compilers/tcc/include/malloc.h +87 -0
  23. data/lib/data/c_compilers/tcc/include/math.h +438 -0
  24. data/lib/data/c_compilers/tcc/include/mem.h +8 -0
  25. data/lib/data/c_compilers/tcc/include/memory.h +9 -0
  26. data/lib/data/c_compilers/tcc/include/process.h +158 -0
  27. data/lib/data/c_compilers/tcc/include/setjmp.h +72 -0
  28. data/lib/data/c_compilers/tcc/include/share.h +44 -0
  29. data/lib/data/c_compilers/tcc/include/signal.h +111 -0
  30. data/lib/data/c_compilers/tcc/include/stdarg.h +16 -0
  31. data/lib/data/c_compilers/tcc/include/stdbool.h +10 -0
  32. data/lib/data/c_compilers/tcc/include/stddef.h +26 -0
  33. data/lib/data/c_compilers/tcc/include/stdint.h +184 -0
  34. data/lib/data/c_compilers/tcc/include/stdio.h +413 -0
  35. data/lib/data/c_compilers/tcc/include/stdlib.h +482 -0
  36. data/lib/data/c_compilers/tcc/include/string.h +206 -0
  37. data/lib/data/c_compilers/tcc/include/sys/fcntl.h +8 -0
  38. data/lib/data/c_compilers/tcc/include/sys/file.h +9 -0
  39. data/lib/data/c_compilers/tcc/include/sys/locking.h +52 -0
  40. data/lib/data/c_compilers/tcc/include/sys/stat.h +190 -0
  41. data/lib/data/c_compilers/tcc/include/sys/time.h +3 -0
  42. data/lib/data/c_compilers/tcc/include/sys/timeb.h +82 -0
  43. data/lib/data/c_compilers/tcc/include/sys/types.h +118 -0
  44. data/lib/data/c_compilers/tcc/include/sys/unistd.h +9 -0
  45. data/lib/data/c_compilers/tcc/include/sys/utime.h +89 -0
  46. data/lib/data/c_compilers/tcc/include/tchar.h +367 -0
  47. data/lib/data/c_compilers/tcc/include/time.h +219 -0
  48. data/lib/data/c_compilers/tcc/include/unistd.h +10 -0
  49. data/lib/data/c_compilers/tcc/include/values.h +4 -0
  50. data/lib/data/c_compilers/tcc/include/varargs.h +11 -0
  51. data/lib/data/c_compilers/tcc/include/wchar.h +318 -0
  52. data/lib/data/c_compilers/tcc/include/wctype.h +127 -0
  53. data/lib/data/c_compilers/tcc/include/winapi/basetsd.h +119 -0
  54. data/lib/data/c_compilers/tcc/include/winapi/basetyps.h +144 -0
  55. data/lib/data/c_compilers/tcc/include/winapi/winbase.h +1852 -0
  56. data/lib/data/c_compilers/tcc/include/winapi/wincon.h +207 -0
  57. data/lib/data/c_compilers/tcc/include/winapi/windef.h +240 -0
  58. data/lib/data/c_compilers/tcc/include/winapi/windows.h +176 -0
  59. data/lib/data/c_compilers/tcc/include/winapi/winerror.h +1054 -0
  60. data/lib/data/c_compilers/tcc/include/winapi/wingdi.h +2843 -0
  61. data/lib/data/c_compilers/tcc/include/winapi/winnetwk.h +346 -0
  62. data/lib/data/c_compilers/tcc/include/winapi/winnls.h +651 -0
  63. data/lib/data/c_compilers/tcc/include/winapi/winnt.h +2667 -0
  64. data/lib/data/c_compilers/tcc/include/winapi/winreg.h +159 -0
  65. data/lib/data/c_compilers/tcc/include/winapi/winsvc.h +309 -0
  66. data/lib/data/c_compilers/tcc/include/winapi/winuser.h +3472 -0
  67. data/lib/data/c_compilers/tcc/include/winapi/winver.h +133 -0
  68. data/lib/data/c_compilers/tcc/lib/gdi32.def +337 -0
  69. data/lib/data/c_compilers/tcc/lib/kernel32.def +763 -0
  70. data/lib/data/c_compilers/tcc/lib/libtcc1.a +0 -0
  71. data/lib/data/c_compilers/tcc/lib/msvcrt.def +782 -0
  72. data/lib/data/c_compilers/tcc/lib/user32.def +654 -0
  73. data/lib/data/c_compilers/tcc/tcc.exe +0 -0
  74. data/lib/data/exe_templates/launcher_stub.c +30 -0
  75. data/lib/data/exe_templates/launcher_stub.cpp +31 -0
  76. data/lib/data/launcher_templates/vbs/default_vbs.txt +7 -0
  77. data/lib/data/launcher_templates/vbs/vbs_gui.txt +8 -0
  78. data/lib/data/resource_files/default.rc +17 -0
  79. data/lib/data/tcc/include/_mingw.h +54 -54
  80. data/lib/data/tcc/include/assert.h +71 -71
  81. data/lib/data/tcc/include/conio.h +159 -159
  82. data/lib/data/tcc/include/ctype.h +232 -232
  83. data/lib/data/tcc/include/dir.h +26 -26
  84. data/lib/data/tcc/include/direct.h +95 -95
  85. data/lib/data/tcc/include/dirent.h +96 -96
  86. data/lib/data/tcc/include/dos.h +110 -110
  87. data/lib/data/tcc/include/errno.h +117 -117
  88. data/lib/data/tcc/include/excpt.h +20 -20
  89. data/lib/data/tcc/include/fcntl.h +135 -135
  90. data/lib/data/tcc/include/fenv.h +85 -85
  91. data/lib/data/tcc/include/float.h +224 -224
  92. data/lib/data/tcc/include/inttypes.h +275 -275
  93. data/lib/data/tcc/include/io.h +296 -296
  94. data/lib/data/tcc/include/limits.h +115 -115
  95. data/lib/data/tcc/include/locale.h +100 -100
  96. data/lib/data/tcc/include/malloc.h +87 -87
  97. data/lib/data/tcc/include/math.h +438 -438
  98. data/lib/data/tcc/include/mem.h +8 -8
  99. data/lib/data/tcc/include/memory.h +9 -9
  100. data/lib/data/tcc/include/process.h +158 -158
  101. data/lib/data/tcc/include/setjmp.h +72 -72
  102. data/lib/data/tcc/include/share.h +44 -44
  103. data/lib/data/tcc/include/signal.h +111 -111
  104. data/lib/data/tcc/include/stdarg.h +16 -16
  105. data/lib/data/tcc/include/stdbool.h +10 -10
  106. data/lib/data/tcc/include/stddef.h +26 -26
  107. data/lib/data/tcc/include/stdint.h +184 -184
  108. data/lib/data/tcc/include/stdio.h +413 -413
  109. data/lib/data/tcc/include/stdlib.h +482 -482
  110. data/lib/data/tcc/include/string.h +206 -206
  111. data/lib/data/tcc/include/sys/fcntl.h +8 -8
  112. data/lib/data/tcc/include/sys/file.h +9 -9
  113. data/lib/data/tcc/include/sys/locking.h +52 -52
  114. data/lib/data/tcc/include/sys/stat.h +190 -190
  115. data/lib/data/tcc/include/sys/time.h +3 -3
  116. data/lib/data/tcc/include/sys/timeb.h +82 -82
  117. data/lib/data/tcc/include/sys/types.h +118 -118
  118. data/lib/data/tcc/include/sys/unistd.h +9 -9
  119. data/lib/data/tcc/include/sys/utime.h +89 -89
  120. data/lib/data/tcc/include/tchar.h +367 -367
  121. data/lib/data/tcc/include/time.h +219 -219
  122. data/lib/data/tcc/include/unistd.h +10 -10
  123. data/lib/data/tcc/include/values.h +4 -4
  124. data/lib/data/tcc/include/varargs.h +11 -11
  125. data/lib/data/tcc/include/wchar.h +318 -318
  126. data/lib/data/tcc/include/wctype.h +127 -127
  127. data/lib/data/tcc/include/winapi/basetsd.h +119 -119
  128. data/lib/data/tcc/include/winapi/basetyps.h +144 -144
  129. data/lib/data/tcc/include/winapi/winbase.h +1852 -1852
  130. data/lib/data/tcc/include/winapi/wincon.h +207 -207
  131. data/lib/data/tcc/include/winapi/windef.h +240 -240
  132. data/lib/data/tcc/include/winapi/windows.h +176 -176
  133. data/lib/data/tcc/include/winapi/winerror.h +1054 -1054
  134. data/lib/data/tcc/include/winapi/wingdi.h +2843 -2843
  135. data/lib/data/tcc/include/winapi/winnetwk.h +346 -346
  136. data/lib/data/tcc/include/winapi/winnls.h +651 -651
  137. data/lib/data/tcc/include/winapi/winnt.h +2667 -2667
  138. data/lib/data/tcc/include/winapi/winreg.h +159 -159
  139. data/lib/data/tcc/include/winapi/winsvc.h +309 -309
  140. data/lib/data/tcc/include/winapi/winuser.h +3472 -3472
  141. data/lib/data/tcc/include/winapi/winver.h +133 -133
  142. data/lib/data/tcc/lib/gdi32.def +337 -337
  143. data/lib/data/tcc/lib/kernel32.def +763 -763
  144. data/lib/data/tcc/lib/msvcrt.def +782 -782
  145. data/lib/data/tcc/lib/user32.def +654 -654
  146. data/lib/data/vbs/default_vbs.txt +7 -7
  147. data/lib/data/vbs/vbs_gui.txt +8 -8
  148. data/lib/displayer.rb +66 -0
  149. data/lib/exe_packer.rb +82 -0
  150. data/lib/launcher.rb +84 -0
  151. data/lib/launcher_handler.rb +53 -0
  152. data/lib/logger_helper.rb +24 -0
  153. data/lib/parameter_parser.rb +210 -0
  154. data/lib/ruby_copy.rb +26 -0
  155. data/lib/sfx_generator.rb +11 -0
  156. data/lib/standalone_ruby.rb +2 -2
  157. data/lib/utils/displayer.rb +20 -17
  158. data/lib/utils/exe_packer.rb +5 -1
  159. data/lib/utils/launcher.rb +1 -1
  160. data/lib/utils/launcher_handler.rb +110 -110
  161. data/lib/utils/parameter_parser.rb +7 -2
  162. data/lib/utils/ruby_copy.rb +0 -1
  163. data/lib/version/version.rb +3 -0
  164. metadata +87 -4
@@ -1,367 +1,367 @@
1
- /*
2
- * tchar.h
3
- *
4
- * Unicode mapping layer for the standard C library. By including this
5
- * file and using the 't' names for string functions
6
- * (eg. _tprintf) you can make code which can be easily adapted to both
7
- * Unicode and non-unicode environments. In a unicode enabled compile define
8
- * _UNICODE before including tchar.h, otherwise the standard non-unicode
9
- * library functions will be used.
10
- *
11
- * Note that you still need to include string.h or stdlib.h etc. to define
12
- * the appropriate functions. Also note that there are several defines
13
- * included for non-ANSI functions which are commonly available (but using
14
- * the convention of prepending an underscore to non-ANSI library function
15
- * names).
16
- *
17
- * This file is part of the Mingw32 package.
18
- *
19
- * Contributors:
20
- * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
21
- *
22
- * THIS SOFTWARE IS NOT COPYRIGHTED
23
- *
24
- * This source code is offered for use in the public domain. You may
25
- * use, modify or distribute it freely.
26
- *
27
- * This code is distributed in the hope that it will be useful but
28
- * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
29
- * DISCLAIMED. This includes but is not limited to warranties of
30
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31
- *
32
- * $Revision: 1.2 $
33
- * $Author: bellard $
34
- * $Date: 2005/04/17 13:14:29 $
35
- *
36
- */
37
-
38
- #ifndef _TCHAR_H_
39
- #define _TCHAR_H_
40
-
41
- /* All the headers include this file. */
42
- #include <_mingw.h>
43
-
44
- /*
45
- * NOTE: This tests _UNICODE, which is different from the UNICODE define
46
- * used to differentiate Win32 API calls.
47
- */
48
- #ifdef _UNICODE
49
-
50
-
51
- /*
52
- * Use TCHAR instead of char or wchar_t. It will be appropriately translated
53
- * if _UNICODE is correctly defined (or not).
54
- */
55
- #ifndef _TCHAR_DEFINED
56
- #ifndef RC_INVOKED
57
- typedef wchar_t TCHAR;
58
- typedef wchar_t _TCHAR;
59
- #endif /* Not RC_INVOKED */
60
- #define _TCHAR_DEFINED
61
- #endif
62
-
63
-
64
- /*
65
- * __TEXT is a private macro whose specific use is to force the expansion of a
66
- * macro passed as an argument to the macros _T or _TEXT. DO NOT use this
67
- * macro within your programs. It's name and function could change without
68
- * notice.
69
- */
70
- #define __TEXT(x) L##x
71
-
72
- /* for porting from other Windows compilers */
73
- #if 0 // no wide startup module
74
- #define _tmain wmain
75
- #define _tWinMain wWinMain
76
- #define _tenviron _wenviron
77
- #define __targv __wargv
78
- #endif
79
-
80
- /*
81
- * Unicode functions
82
- */
83
- #define _tprintf wprintf
84
- #define _ftprintf fwprintf
85
- #define _stprintf swprintf
86
- #define _sntprintf _snwprintf
87
- #define _vtprintf vwprintf
88
- #define _vftprintf vfwprintf
89
- #define _vstprintf vswprintf
90
- #define _vsntprintf _vsnwprintf
91
- #define _tscanf wscanf
92
- #define _ftscanf fwscanf
93
- #define _stscanf swscanf
94
- #define _fgettc fgetwc
95
- #define _fgettchar _fgetwchar
96
- #define _fgetts fgetws
97
- #define _fputtc fputwc
98
- #define _fputtchar _fputwchar
99
- #define _fputts fputws
100
- #define _gettc getwc
101
- #define _getts getws
102
- #define _puttc putwc
103
- #define _putts putws
104
- #define _ungettc ungetwc
105
- #define _tcstod wcstod
106
- #define _tcstol wcstol
107
- #define _tcstoul wcstoul
108
- #define _itot _itow
109
- #define _ltot _ltow
110
- #define _ultot _ultow
111
- #define _ttoi _wtoi
112
- #define _ttol _wtol
113
- #define _tcscat wcscat
114
- #define _tcschr wcschr
115
- #define _tcscmp wcscmp
116
- #define _tcscpy wcscpy
117
- #define _tcscspn wcscspn
118
- #define _tcslen wcslen
119
- #define _tcsncat wcsncat
120
- #define _tcsncmp wcsncmp
121
- #define _tcsncpy wcsncpy
122
- #define _tcspbrk wcspbrk
123
- #define _tcsrchr wcsrchr
124
- #define _tcsspn wcsspn
125
- #define _tcsstr wcsstr
126
- #define _tcstok wcstok
127
- #define _tcsdup _wcsdup
128
- #define _tcsicmp _wcsicmp
129
- #define _tcsnicmp _wcsnicmp
130
- #define _tcsnset _wcsnset
131
- #define _tcsrev _wcsrev
132
- #define _tcsset _wcsset
133
- #define _tcslwr _wcslwr
134
- #define _tcsupr _wcsupr
135
- #define _tcsxfrm wcsxfrm
136
- #define _tcscoll wcscoll
137
- #define _tcsicoll _wcsicoll
138
- #define _istalpha iswalpha
139
- #define _istupper iswupper
140
- #define _istlower iswlower
141
- #define _istdigit iswdigit
142
- #define _istxdigit iswxdigit
143
- #define _istspace iswspace
144
- #define _istpunct iswpunct
145
- #define _istalnum iswalnum
146
- #define _istprint iswprint
147
- #define _istgraph iswgraph
148
- #define _istcntrl iswcntrl
149
- #define _istascii iswascii
150
- #define _totupper towupper
151
- #define _totlower towlower
152
- #define _tcsftime wcsftime
153
- /* Macro functions */
154
- #define _tcsdec _wcsdec
155
- #define _tcsinc _wcsinc
156
- #define _tcsnbcnt _wcsncnt
157
- #define _tcsnccnt _wcsncnt
158
- #define _tcsnextc _wcsnextc
159
- #define _tcsninc _wcsninc
160
- #define _tcsspnp _wcsspnp
161
- #define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1)
162
- #define _wcsinc(_wcs) ((_wcs)+1)
163
- #define _wcsnextc(_wcs) ((unsigned int) *(_wcs))
164
- #define _wcsninc(_wcs, _inc) (((_wcs)+(_inc)))
165
- #define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs))
166
- #define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL)
167
-
168
- #if 1 // defined __MSVCRT__
169
- /*
170
- * These wide functions not in crtdll.dll.
171
- * Define macros anyway so that _wfoo rather than _tfoo is undefined
172
- */
173
- #define _ttoi64 _wtoi64
174
- #define _i64tot _i64tow
175
- #define _ui64tot _ui64tow
176
- #define _tasctime _wasctime
177
- #define _tctime _wctime
178
- #define _tstrdate _wstrdate
179
- #define _tstrtime _wstrtime
180
- #define _tutime _wutime
181
- #define _tcsnccoll _wcsncoll
182
- #define _tcsncoll _wcsncoll
183
- #define _tcsncicoll _wcsnicoll
184
- #define _tcsnicoll _wcsnicoll
185
- #define _taccess _waccess
186
- #define _tchmod _wchmod
187
- #define _tcreat _wcreat
188
- #define _tfindfirst _wfindfirst
189
- #define _tfindnext _wfindnext
190
- #define _tfopen _wfopen
191
- #define _tgetenv _wgetenv
192
- #define _tmktemp _wmktemp
193
- #define _topen _wopen
194
- #define _tremove _wremove
195
- #define _trename _wrename
196
- #define _tsopen _wsopen
197
- #define _tsetlocale _wsetlocale
198
- #define _tunlink _wunlink
199
- #define _tfinddata_t _wfinddata_t
200
- #define _tfindfirsti64 _wfindfirsti64
201
- #define _tfindnexti64 _wfindnexti64
202
- #define _tfinddatai64_t _wfinddatai64_t
203
- #endif /* __MSVCRT__ */
204
-
205
- #else /* Not _UNICODE */
206
-
207
- /*
208
- * TCHAR, the type you should use instead of char.
209
- */
210
- #ifndef _TCHAR_DEFINED
211
- #ifndef RC_INVOKED
212
- typedef char TCHAR;
213
- typedef char _TCHAR;
214
- #endif
215
- #define _TCHAR_DEFINED
216
- #endif
217
-
218
- /*
219
- * __TEXT is a private macro whose specific use is to force the expansion of a
220
- * macro passed as an argument to the macros _T or _TEXT. DO NOT use this
221
- * macro within your programs. It's name and function could change without
222
- * notice.
223
- */
224
- #define __TEXT(x) x
225
-
226
- /* for porting from other Windows compilers */
227
- #define _tmain main
228
- #define _tWinMain WinMain
229
- #define _tenviron _environ
230
- #define __targv __argv
231
-
232
- /*
233
- * Non-unicode (standard) functions
234
- */
235
-
236
- #define _tprintf printf
237
- #define _ftprintf fprintf
238
- #define _stprintf sprintf
239
- #define _sntprintf _snprintf
240
- #define _vtprintf vprintf
241
- #define _vftprintf vfprintf
242
- #define _vstprintf vsprintf
243
- #define _vsntprintf _vsnprintf
244
- #define _tscanf scanf
245
- #define _ftscanf fscanf
246
- #define _stscanf sscanf
247
- #define _fgettc fgetc
248
- #define _fgettchar _fgetchar
249
- #define _fgetts fgets
250
- #define _fputtc fputc
251
- #define _fputtchar _fputchar
252
- #define _fputts fputs
253
- #define _tfopen fopen
254
- #define _tgetenv getenv
255
- #define _gettc getc
256
- #define _getts gets
257
- #define _puttc putc
258
- #define _putts puts
259
- #define _ungettc ungetc
260
- #define _tcstod strtod
261
- #define _tcstol strtol
262
- #define _tcstoul strtoul
263
- #define _itot _itoa
264
- #define _ltot _ltoa
265
- #define _ultot _ultoa
266
- #define _ttoi atoi
267
- #define _ttol atol
268
- #define _tcscat strcat
269
- #define _tcschr strchr
270
- #define _tcscmp strcmp
271
- #define _tcscpy strcpy
272
- #define _tcscspn strcspn
273
- #define _tcslen strlen
274
- #define _tcsncat strncat
275
- #define _tcsncmp strncmp
276
- #define _tcsncpy strncpy
277
- #define _tcspbrk strpbrk
278
- #define _tcsrchr strrchr
279
- #define _tcsspn strspn
280
- #define _tcsstr strstr
281
- #define _tcstok strtok
282
- #define _tcsdup _strdup
283
- #define _tcsicmp _stricmp
284
- #define _tcsnicmp _strnicmp
285
- #define _tcsnset _strnset
286
- #define _tcsrev _strrev
287
- #define _tcsset _strset
288
- #define _tcslwr _strlwr
289
- #define _tcsupr _strupr
290
- #define _tcsxfrm strxfrm
291
- #define _tcscoll strcoll
292
- #define _tcsicoll _stricoll
293
- #define _istalpha isalpha
294
- #define _istupper isupper
295
- #define _istlower islower
296
- #define _istdigit isdigit
297
- #define _istxdigit isxdigit
298
- #define _istspace isspace
299
- #define _istpunct ispunct
300
- #define _istalnum isalnum
301
- #define _istprint isprint
302
- #define _istgraph isgraph
303
- #define _istcntrl iscntrl
304
- #define _istascii isascii
305
- #define _totupper toupper
306
- #define _totlower tolower
307
- #define _tasctime asctime
308
- #define _tctime ctime
309
- #define _tstrdate _strdate
310
- #define _tstrtime _strtime
311
- #define _tutime _utime
312
- #define _tcsftime strftime
313
- /* Macro functions */
314
- #define _tcsdec _strdec
315
- #define _tcsinc _strinc
316
- #define _tcsnbcnt _strncnt
317
- #define _tcsnccnt _strncnt
318
- #define _tcsnextc _strnextc
319
- #define _tcsninc _strninc
320
- #define _tcsspnp _strspnp
321
- #define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1)
322
- #define _strinc(_str) ((_str)+1)
323
- #define _strnextc(_str) ((unsigned int) *(_str))
324
- #define _strninc(_str, _inc) (((_str)+(_inc)))
325
- #define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str))
326
- #define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL)
327
-
328
- #define _tchmod _chmod
329
- #define _tcreat _creat
330
- #define _tfindfirst _findfirst
331
- #define _tfindnext _findnext
332
- #define _tmktemp _mktemp
333
- #define _topen _open
334
- #define _taccess _access
335
- #define _tremove remove
336
- #define _trename rename
337
- #define _tsopen _sopen
338
- #define _tsetlocale setlocale
339
- #define _tunlink _unlink
340
- #define _tfinddata_t _finddata_t
341
-
342
-
343
- #if 1 // defined __MSVCRT__
344
- /* Not in crtdll.dll. Define macros anyway? */
345
- #define _ttoi64 _atoi64
346
- #define _i64tot _i64toa
347
- #define _ui64tot _ui64toa
348
- #define _tcsnccoll _strncoll
349
- #define _tcsncoll _strncoll
350
- #define _tcsncicoll _strnicoll
351
- #define _tcsnicoll _strnicoll
352
- #define _tfindfirsti64 _findfirsti64
353
- #define _tfindnexti64 _findnexti64
354
- #define _tfinddatai64_t _finddatai64_t
355
- #endif /* __MSVCRT__ */
356
-
357
- #endif /* Not _UNICODE */
358
-
359
- /*
360
- * UNICODE a constant string when _UNICODE is defined else returns the string
361
- * unmodified. Also defined in w32api/winnt.h.
362
- */
363
- #define _TEXT(x) __TEXT(x)
364
- #define _T(x) __TEXT(x)
365
-
366
- #endif /* Not _TCHAR_H_ */
367
-
1
+ /*
2
+ * tchar.h
3
+ *
4
+ * Unicode mapping layer for the standard C library. By including this
5
+ * file and using the 't' names for string functions
6
+ * (eg. _tprintf) you can make code which can be easily adapted to both
7
+ * Unicode and non-unicode environments. In a unicode enabled compile define
8
+ * _UNICODE before including tchar.h, otherwise the standard non-unicode
9
+ * library functions will be used.
10
+ *
11
+ * Note that you still need to include string.h or stdlib.h etc. to define
12
+ * the appropriate functions. Also note that there are several defines
13
+ * included for non-ANSI functions which are commonly available (but using
14
+ * the convention of prepending an underscore to non-ANSI library function
15
+ * names).
16
+ *
17
+ * This file is part of the Mingw32 package.
18
+ *
19
+ * Contributors:
20
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
21
+ *
22
+ * THIS SOFTWARE IS NOT COPYRIGHTED
23
+ *
24
+ * This source code is offered for use in the public domain. You may
25
+ * use, modify or distribute it freely.
26
+ *
27
+ * This code is distributed in the hope that it will be useful but
28
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
29
+ * DISCLAIMED. This includes but is not limited to warranties of
30
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31
+ *
32
+ * $Revision: 1.2 $
33
+ * $Author: bellard $
34
+ * $Date: 2005/04/17 13:14:29 $
35
+ *
36
+ */
37
+
38
+ #ifndef _TCHAR_H_
39
+ #define _TCHAR_H_
40
+
41
+ /* All the headers include this file. */
42
+ #include <_mingw.h>
43
+
44
+ /*
45
+ * NOTE: This tests _UNICODE, which is different from the UNICODE define
46
+ * used to differentiate Win32 API calls.
47
+ */
48
+ #ifdef _UNICODE
49
+
50
+
51
+ /*
52
+ * Use TCHAR instead of char or wchar_t. It will be appropriately translated
53
+ * if _UNICODE is correctly defined (or not).
54
+ */
55
+ #ifndef _TCHAR_DEFINED
56
+ #ifndef RC_INVOKED
57
+ typedef wchar_t TCHAR;
58
+ typedef wchar_t _TCHAR;
59
+ #endif /* Not RC_INVOKED */
60
+ #define _TCHAR_DEFINED
61
+ #endif
62
+
63
+
64
+ /*
65
+ * __TEXT is a private macro whose specific use is to force the expansion of a
66
+ * macro passed as an argument to the macros _T or _TEXT. DO NOT use this
67
+ * macro within your programs. It's name and function could change without
68
+ * notice.
69
+ */
70
+ #define __TEXT(x) L##x
71
+
72
+ /* for porting from other Windows compilers */
73
+ #if 0 // no wide startup module
74
+ #define _tmain wmain
75
+ #define _tWinMain wWinMain
76
+ #define _tenviron _wenviron
77
+ #define __targv __wargv
78
+ #endif
79
+
80
+ /*
81
+ * Unicode functions
82
+ */
83
+ #define _tprintf wprintf
84
+ #define _ftprintf fwprintf
85
+ #define _stprintf swprintf
86
+ #define _sntprintf _snwprintf
87
+ #define _vtprintf vwprintf
88
+ #define _vftprintf vfwprintf
89
+ #define _vstprintf vswprintf
90
+ #define _vsntprintf _vsnwprintf
91
+ #define _tscanf wscanf
92
+ #define _ftscanf fwscanf
93
+ #define _stscanf swscanf
94
+ #define _fgettc fgetwc
95
+ #define _fgettchar _fgetwchar
96
+ #define _fgetts fgetws
97
+ #define _fputtc fputwc
98
+ #define _fputtchar _fputwchar
99
+ #define _fputts fputws
100
+ #define _gettc getwc
101
+ #define _getts getws
102
+ #define _puttc putwc
103
+ #define _putts putws
104
+ #define _ungettc ungetwc
105
+ #define _tcstod wcstod
106
+ #define _tcstol wcstol
107
+ #define _tcstoul wcstoul
108
+ #define _itot _itow
109
+ #define _ltot _ltow
110
+ #define _ultot _ultow
111
+ #define _ttoi _wtoi
112
+ #define _ttol _wtol
113
+ #define _tcscat wcscat
114
+ #define _tcschr wcschr
115
+ #define _tcscmp wcscmp
116
+ #define _tcscpy wcscpy
117
+ #define _tcscspn wcscspn
118
+ #define _tcslen wcslen
119
+ #define _tcsncat wcsncat
120
+ #define _tcsncmp wcsncmp
121
+ #define _tcsncpy wcsncpy
122
+ #define _tcspbrk wcspbrk
123
+ #define _tcsrchr wcsrchr
124
+ #define _tcsspn wcsspn
125
+ #define _tcsstr wcsstr
126
+ #define _tcstok wcstok
127
+ #define _tcsdup _wcsdup
128
+ #define _tcsicmp _wcsicmp
129
+ #define _tcsnicmp _wcsnicmp
130
+ #define _tcsnset _wcsnset
131
+ #define _tcsrev _wcsrev
132
+ #define _tcsset _wcsset
133
+ #define _tcslwr _wcslwr
134
+ #define _tcsupr _wcsupr
135
+ #define _tcsxfrm wcsxfrm
136
+ #define _tcscoll wcscoll
137
+ #define _tcsicoll _wcsicoll
138
+ #define _istalpha iswalpha
139
+ #define _istupper iswupper
140
+ #define _istlower iswlower
141
+ #define _istdigit iswdigit
142
+ #define _istxdigit iswxdigit
143
+ #define _istspace iswspace
144
+ #define _istpunct iswpunct
145
+ #define _istalnum iswalnum
146
+ #define _istprint iswprint
147
+ #define _istgraph iswgraph
148
+ #define _istcntrl iswcntrl
149
+ #define _istascii iswascii
150
+ #define _totupper towupper
151
+ #define _totlower towlower
152
+ #define _tcsftime wcsftime
153
+ /* Macro functions */
154
+ #define _tcsdec _wcsdec
155
+ #define _tcsinc _wcsinc
156
+ #define _tcsnbcnt _wcsncnt
157
+ #define _tcsnccnt _wcsncnt
158
+ #define _tcsnextc _wcsnextc
159
+ #define _tcsninc _wcsninc
160
+ #define _tcsspnp _wcsspnp
161
+ #define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1)
162
+ #define _wcsinc(_wcs) ((_wcs)+1)
163
+ #define _wcsnextc(_wcs) ((unsigned int) *(_wcs))
164
+ #define _wcsninc(_wcs, _inc) (((_wcs)+(_inc)))
165
+ #define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs))
166
+ #define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL)
167
+
168
+ #if 1 // defined __MSVCRT__
169
+ /*
170
+ * These wide functions not in crtdll.dll.
171
+ * Define macros anyway so that _wfoo rather than _tfoo is undefined
172
+ */
173
+ #define _ttoi64 _wtoi64
174
+ #define _i64tot _i64tow
175
+ #define _ui64tot _ui64tow
176
+ #define _tasctime _wasctime
177
+ #define _tctime _wctime
178
+ #define _tstrdate _wstrdate
179
+ #define _tstrtime _wstrtime
180
+ #define _tutime _wutime
181
+ #define _tcsnccoll _wcsncoll
182
+ #define _tcsncoll _wcsncoll
183
+ #define _tcsncicoll _wcsnicoll
184
+ #define _tcsnicoll _wcsnicoll
185
+ #define _taccess _waccess
186
+ #define _tchmod _wchmod
187
+ #define _tcreat _wcreat
188
+ #define _tfindfirst _wfindfirst
189
+ #define _tfindnext _wfindnext
190
+ #define _tfopen _wfopen
191
+ #define _tgetenv _wgetenv
192
+ #define _tmktemp _wmktemp
193
+ #define _topen _wopen
194
+ #define _tremove _wremove
195
+ #define _trename _wrename
196
+ #define _tsopen _wsopen
197
+ #define _tsetlocale _wsetlocale
198
+ #define _tunlink _wunlink
199
+ #define _tfinddata_t _wfinddata_t
200
+ #define _tfindfirsti64 _wfindfirsti64
201
+ #define _tfindnexti64 _wfindnexti64
202
+ #define _tfinddatai64_t _wfinddatai64_t
203
+ #endif /* __MSVCRT__ */
204
+
205
+ #else /* Not _UNICODE */
206
+
207
+ /*
208
+ * TCHAR, the type you should use instead of char.
209
+ */
210
+ #ifndef _TCHAR_DEFINED
211
+ #ifndef RC_INVOKED
212
+ typedef char TCHAR;
213
+ typedef char _TCHAR;
214
+ #endif
215
+ #define _TCHAR_DEFINED
216
+ #endif
217
+
218
+ /*
219
+ * __TEXT is a private macro whose specific use is to force the expansion of a
220
+ * macro passed as an argument to the macros _T or _TEXT. DO NOT use this
221
+ * macro within your programs. It's name and function could change without
222
+ * notice.
223
+ */
224
+ #define __TEXT(x) x
225
+
226
+ /* for porting from other Windows compilers */
227
+ #define _tmain main
228
+ #define _tWinMain WinMain
229
+ #define _tenviron _environ
230
+ #define __targv __argv
231
+
232
+ /*
233
+ * Non-unicode (standard) functions
234
+ */
235
+
236
+ #define _tprintf printf
237
+ #define _ftprintf fprintf
238
+ #define _stprintf sprintf
239
+ #define _sntprintf _snprintf
240
+ #define _vtprintf vprintf
241
+ #define _vftprintf vfprintf
242
+ #define _vstprintf vsprintf
243
+ #define _vsntprintf _vsnprintf
244
+ #define _tscanf scanf
245
+ #define _ftscanf fscanf
246
+ #define _stscanf sscanf
247
+ #define _fgettc fgetc
248
+ #define _fgettchar _fgetchar
249
+ #define _fgetts fgets
250
+ #define _fputtc fputc
251
+ #define _fputtchar _fputchar
252
+ #define _fputts fputs
253
+ #define _tfopen fopen
254
+ #define _tgetenv getenv
255
+ #define _gettc getc
256
+ #define _getts gets
257
+ #define _puttc putc
258
+ #define _putts puts
259
+ #define _ungettc ungetc
260
+ #define _tcstod strtod
261
+ #define _tcstol strtol
262
+ #define _tcstoul strtoul
263
+ #define _itot _itoa
264
+ #define _ltot _ltoa
265
+ #define _ultot _ultoa
266
+ #define _ttoi atoi
267
+ #define _ttol atol
268
+ #define _tcscat strcat
269
+ #define _tcschr strchr
270
+ #define _tcscmp strcmp
271
+ #define _tcscpy strcpy
272
+ #define _tcscspn strcspn
273
+ #define _tcslen strlen
274
+ #define _tcsncat strncat
275
+ #define _tcsncmp strncmp
276
+ #define _tcsncpy strncpy
277
+ #define _tcspbrk strpbrk
278
+ #define _tcsrchr strrchr
279
+ #define _tcsspn strspn
280
+ #define _tcsstr strstr
281
+ #define _tcstok strtok
282
+ #define _tcsdup _strdup
283
+ #define _tcsicmp _stricmp
284
+ #define _tcsnicmp _strnicmp
285
+ #define _tcsnset _strnset
286
+ #define _tcsrev _strrev
287
+ #define _tcsset _strset
288
+ #define _tcslwr _strlwr
289
+ #define _tcsupr _strupr
290
+ #define _tcsxfrm strxfrm
291
+ #define _tcscoll strcoll
292
+ #define _tcsicoll _stricoll
293
+ #define _istalpha isalpha
294
+ #define _istupper isupper
295
+ #define _istlower islower
296
+ #define _istdigit isdigit
297
+ #define _istxdigit isxdigit
298
+ #define _istspace isspace
299
+ #define _istpunct ispunct
300
+ #define _istalnum isalnum
301
+ #define _istprint isprint
302
+ #define _istgraph isgraph
303
+ #define _istcntrl iscntrl
304
+ #define _istascii isascii
305
+ #define _totupper toupper
306
+ #define _totlower tolower
307
+ #define _tasctime asctime
308
+ #define _tctime ctime
309
+ #define _tstrdate _strdate
310
+ #define _tstrtime _strtime
311
+ #define _tutime _utime
312
+ #define _tcsftime strftime
313
+ /* Macro functions */
314
+ #define _tcsdec _strdec
315
+ #define _tcsinc _strinc
316
+ #define _tcsnbcnt _strncnt
317
+ #define _tcsnccnt _strncnt
318
+ #define _tcsnextc _strnextc
319
+ #define _tcsninc _strninc
320
+ #define _tcsspnp _strspnp
321
+ #define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1)
322
+ #define _strinc(_str) ((_str)+1)
323
+ #define _strnextc(_str) ((unsigned int) *(_str))
324
+ #define _strninc(_str, _inc) (((_str)+(_inc)))
325
+ #define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str))
326
+ #define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL)
327
+
328
+ #define _tchmod _chmod
329
+ #define _tcreat _creat
330
+ #define _tfindfirst _findfirst
331
+ #define _tfindnext _findnext
332
+ #define _tmktemp _mktemp
333
+ #define _topen _open
334
+ #define _taccess _access
335
+ #define _tremove remove
336
+ #define _trename rename
337
+ #define _tsopen _sopen
338
+ #define _tsetlocale setlocale
339
+ #define _tunlink _unlink
340
+ #define _tfinddata_t _finddata_t
341
+
342
+
343
+ #if 1 // defined __MSVCRT__
344
+ /* Not in crtdll.dll. Define macros anyway? */
345
+ #define _ttoi64 _atoi64
346
+ #define _i64tot _i64toa
347
+ #define _ui64tot _ui64toa
348
+ #define _tcsnccoll _strncoll
349
+ #define _tcsncoll _strncoll
350
+ #define _tcsncicoll _strnicoll
351
+ #define _tcsnicoll _strnicoll
352
+ #define _tfindfirsti64 _findfirsti64
353
+ #define _tfindnexti64 _findnexti64
354
+ #define _tfinddatai64_t _finddatai64_t
355
+ #endif /* __MSVCRT__ */
356
+
357
+ #endif /* Not _UNICODE */
358
+
359
+ /*
360
+ * UNICODE a constant string when _UNICODE is defined else returns the string
361
+ * unmodified. Also defined in w32api/winnt.h.
362
+ */
363
+ #define _TEXT(x) __TEXT(x)
364
+ #define _T(x) __TEXT(x)
365
+
366
+ #endif /* Not _TCHAR_H_ */
367
+