1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
26 // ----------------------------------------------------------------------------
27 // This file defines the generic-text routine mappings found in TCHAR.H on windows
28 // ----------------------------------------------------------------------------
38 #define _tWinMain WinMain
39 #define _tenviron environ
45 #define _tprintf printf
46 #define _ftprintf fprintf
47 #define _stprintf sprintf
48 #define _sntprintf snprintf
49 #define _vtprintf vprintf
50 #define _vftprintf vfprintf
51 #define _vstprintf vsprintf
52 #define _vsntprintf vsnprintf
54 #define _ftscanf fscanf
55 #define _stscanf sscanf
61 #define _fgettchar fgetchar
64 #define _fputtchar fputchar
67 #define _gettchar getchar
70 #define _puttchar putchar
72 #define _ungettc ungetc
75 /* String conversion functions */
77 #define _tcstod strtod
78 #define _tcstol strtol
79 #define _tcstoul strtoul
87 #define _ttoi64 atoi64
88 #define _i64tot i64toa
89 #define _ui64tot ui64toa
91 /* String functions */
93 /* Note that _mbscat, _mbscpy and _mbsdup are functionally equivalent to
94 strcat, strcpy and strdup, respectively. */
96 #define _tcscat strcat
97 #define _tcscpy strcpy
98 #define _tcsdup strdup
100 #define _tcslen strlen
101 #define _tcsxfrm strxfrm
104 /* Execute functions */
106 #define _texecl execl
107 #define _texecle execle
108 #define _texeclp execlp
109 #define _texeclpe execlpe
110 #define _texecv execv
111 #define _texecve execve
112 #define _texecvp execvp
113 #define _texecvpe execvpe
115 #define _tspawnl spawnl
116 #define _tspawnle spawnle
117 #define _tspawnlp spawnlp
118 #define _tspawnlpe spawnlpe
119 #define _tspawnv spawnv
120 #define _tspawnve spawnve
121 #define _tspawnvp spawnvp
122 #define _tspawnvpe spawnvpe
124 #define _tsystem system
129 #define _tasctime asctime
130 #define _tctime ctime
131 #define _tstrdate strdate
132 #define _tstrtime strtime
133 #define _tutime utime
134 #define _tcsftime strftime
137 /* Directory functions */
139 #define _tchdir chdir
140 #define _tgetcwd getcwd
141 #define _tgetdcwd getdcwd
142 #define _tmkdir(x) mkdir(x,00700)
143 #define _trmdir rmdir
146 /* Environment/Path functions */
148 #define _tfullpath fullpath
149 #define _tgetenv getenv
150 #define _tmakepath makepath
151 // Yuck - /usr/include/stdlib.h defines it as char*, not const char*
152 #define _tputenv(s) putenv((char*)(s.c_str()))
153 #define _tsearchenv searchenv
154 #define _tsplitpath splitpath
157 /* Stdio functions */
159 #define _tfdopen fdopen
160 #define _tfsopen fsopen
161 #define _tfopen fopen
162 #define _tfreopen freopen
163 #define _tperror perror
164 #define _tpopen popen
165 #define _ttempnam tempnam
166 #define _ttmpnam tmpnam
171 #define _tchmod chmod
172 #define _tcreat creat
173 #define _tfindfirst findfirst
174 #define _tfindfirsti64 findfirsti64
175 #define _tfindnext findnext
176 #define _tfindnexti64 findnexti64
177 #define _tmktemp mktemp
180 #define _taccess access
182 #define _tremove remove
183 #define _trename rename
184 #define _tsopen sopen
185 #define _tunlink unlink
187 #define _tfinddata_t finddata_t
188 #define _tfinddatai64_t finddatai64_t
191 /* ctype functions */
193 #define _istascii isascii
194 #define _istcntrl iscntrl
195 #define _istxdigit isxdigit
201 #define _tstati64 stati64
205 /* ++++++++++++++++++++ SBCS ++++++++++++++++++++ */
209 typedef signed char _TSCHAR;
210 typedef unsigned char _TUCHAR;
211 typedef char _TXCHAR;
214 /* String functions */
216 #define _tcschr strchr
217 #define _tcscspn strcspn
218 #define _tcsncat strncat
219 #define _tcsncpy strncpy
220 #define _tcspbrk strpbrk
221 #define _tcsrchr strrchr
222 #define _tcsspn strspn
223 #define _tcsstr strstr
224 #define _tcstok strtok
226 #define _tcsnset strnset
227 #define _tcsrev strrev
228 #define _tcsset strset
230 #define _tcscmp strcmp
231 #define _tcsicmp strcasecmp
232 #define _tcsnccmp strncmp
233 #define _tcsncmp strncmp
234 #define _tcsncicmp strnicmp
235 #define _tcsnicmp strncasecmp
237 #define _tcscoll strcoll
238 #define _tcsicoll stricoll
239 #define _tcsnccoll strncoll
240 #define _tcsncoll strncoll
241 #define _tcsncicoll strnicoll
242 #define _tcsnicoll strnicoll
245 /* "logical-character" mappings */
247 #define _tcsclen strlen
248 #define _tcsnccat strncat
249 #define _tcsnccpy strncpy
250 #define _tcsncset strnset
253 /* MBCS-specific functions */
255 #define _tcsdec strdec
256 #define _tcsinc strinc
257 #define _tcsnbcnt strncnt
258 #define _tcsnccnt strncnt
259 #define _tcsnextc strnextc
260 #define _tcsninc strninc
261 #define _tcsspnp strspnp
263 #define _tcslwr strlwr
264 #define _tcsupr strupr
265 #define _tcsxfrm strxfrm
267 #define _istlead(_c) (0)
268 #define _istleadbyte(_c) (0)
270 /* ctype-functions */
272 #define _istalnum isalnum
273 #define _istalpha isalpha
274 #define _istdigit isdigit
275 #define _istgraph isgraph
276 #define _istlower islower
277 #define _istprint isprint
278 #define _istpunct ispunct
279 #define _istspace isspace
280 #define _istupper isupper
282 #define _totupper toupper
283 #define _totlower tolower
285 #define _istlegal(_c) (1)
287 typedef char *LPTSTR;
288 typedef const char *LPCTSTR;