ee45e4d69efce23f30f1bf226a3d00da985f322b
[staging/basesystem.git] / video_in_hal / vehicleservice / positioning_base_library / library / include / tchar.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18
19 #ifndef POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TCHAR_H_
20 #define POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TCHAR_H_
21
22 #include <stdlib.h>
23
24 #ifdef    __cplusplus
25 extern "C" {
26 #endif
27
28 #define _T(x)       __TEXT(x)
29
30 #ifdef  UNICODE
31     /* ++++++++++++++++++++ UNICODE ++++++++++++++++++++ */
32
33 #define _TEOF       WEOF
34
35 #define _tmain      wmain
36
37 #ifdef UNDER_CE
38 #    define _tWinMain   WinMain
39 #else
40 #    define _tWinMain   wWinMain
41 #endif
42
43     /* Formatted i/o */
44 #define _tprintf    wprintf
45 #define _ftprintf   fwprintf
46 #define _stprintf   swprintf
47 #define _sntprintf  _snwprintf
48 #define _vtprintf   vwprintf
49 #define _vftprintf  vfwprintf
50 #define _vstprintf  vswprintf
51 #define _vsntprintf _vsnwprintf
52 #define _tscanf     wscanf
53 #define _ftscanf    fwscanf
54 #define _stscanf    swscanf
55
56     /* Unformatted i/o */
57 #define _fgettc     fgetwc
58 #define _fgetts     fgetws
59 #define _fputtc     fputwc
60 #define _fputts     fputws
61 #define _gettc      getwc
62 #define _gettchar   getwchar
63 #define _getts      _getws
64 #define _puttc      putwc
65 #define _puttchar   putwchar
66 #define _putts      _putws
67 #define _ungettc    ungetwc
68
69 #define _tfopen     _wfopen
70 #define _tfreopen   _wfreopen
71
72     /* String conversion functions */
73 #define _tcstod     wcstod
74 #define _tcstol     wcstol
75 #define _tcstoul    wcstoul
76
77 #define _itot       _itow
78 #define _ltot       _ltow
79 #define _ultot      _ultow
80 #define _ttoi       _wtoi
81 #define _ttol       _wtol
82 #define _ttoi64     _wtoi64
83
84     /* String functions */
85 #define _tcscat     wcscat
86 #define _tcschr     wcschr
87 #define _tcscmp     wcscmp
88 #define _tcscpy     wcscpy
89 #define _tcscspn    wcscspn
90 #define _tcslen     wcslen
91 #define _tcsclen    wcslen
92
93 #define _tcsncat    wcsncat
94 #define _tcsnccat   wcsncat
95 #define _tcsnccmp   wcsncmp
96 #define _tcsncmp    wcsncmp
97 #define _tcsncpy    wcsncpy
98 #define _tcsnccpy   wcsncpy
99 #define _tcspbrk    wcspbrk
100 #define _tcsrchr    wcsrchr
101 #define _tcsspn     wcsspn
102 #define _tcsstr     wcsstr
103 #define _tcstok     wcstok
104 #define _tcsdup     _wcsdup
105 #define _tcsicmp    _wcsicmp
106 #define _tcsncicmp  _wcsnicmp
107 #define _tcsnicmp   _wcsnicmp
108 #define _tcsnset    _wcsnset
109 #define _tcsncset   _wcsnset
110 #define _tcsrev     _wcsrev
111 #define _tcsset     _wcsset
112
113 #define _tcslwr     _wcslwr
114 #define _tcsupr     _wcsupr
115
116 #define _istalpha   iswalpha
117 #define _istupper   iswupper
118 #define _istlower   iswlower
119 #define _istdigit   iswdigit
120 #define _istxdigit  iswxdigit
121 #define _istspace   iswspace
122 #define _istpunct   iswpunct
123 #define _istalnum   iswalnum
124 #define _istprint   iswprint
125 #define _istgraph   iswgraph
126 #define _istcntrl   iswcntrl
127 #define _istascii   iswascii
128
129 #define _totupper   towupper
130 #define _totlower   towlower
131
132 #define _istlegal(_c)       (1)
133 #define _istlead(_c)        (0)
134 #define _istleadbyte(_c)    (0)
135
136 #else   /* ndef UNICODE */
137
138     /* ++++++++++++++++++++ SBCS (MBCS in Not supported) ++++++++++++++++++++ */
139
140 #define _TEOF       EOF
141
142     /* Program */
143 #define _tmain      main
144 #define _tWinMain   WinMain
145
146     /* Formatted i/o */
147 #define _tprintf    printf
148 #define _ftprintf   fprintf
149 #define _stprintf   sprintf
150 #define _sntprintf  _snprintf
151 #define _vtprintf   vprintf
152 #define _vftprintf  vfprintf
153 #define _vstprintf  vsprintf
154 #define _vsntprintf _vsnprintf
155 #define _tscanf     scanf
156 #define _ftscanf    fscanf
157 #define _stscanf    sscanf
158
159     /* Unformatted i/o */
160 #define _fgettc     fgetc
161 #define _fgetts     fgets
162 #define _fputtc     fputc
163 #define _fputts     fputs
164 #define _gettc      getc
165 #define _gettchar   getchar
166 #define _getts      gets
167 #define _puttc      putc
168 #define _puttchar   putchar
169 #define _putts      puts
170 #define _ungettc    ungetc
171
172 #define _tfopen     _wfopen
173 #define _tfreopen   _wfreopen
174
175 #ifndef UNDER_CE
176
177 #define _tcstod     strtod
178 #define _tcstol     strtol
179 #define _tcstoul    strtoul
180 #endif
181
182 #define _itot       _itoa
183 #define _ltot       _ltoa
184 #define _ultot      _ultoa
185 #define _ttoi       atoi
186 #define _ttol       atol
187
188 #ifndef UNDER_CE
189 #define _ttoi64   atoi64
190 #endif
191
192     /* String functions */
193 #define _tcscat     strcat
194 #define _tcschr     strchr
195 #define _tcscmp     strcmp
196 #define _tcscpy     strcpy
197 #define _tcscspn    strcspn
198 #define _tcslen     strlen
199 #define _tcsclen    strlen
200
201 #define _tcsncat    strncat
202 #define _tcsnccat   strncat
203 #define _tcsnccmp   strncmp
204 #define _tcsncmp    strncmp
205 #define _tcsncpy    strncpy
206 #define _tcsnccpy   strncpy
207
208 #ifndef UNDER_CE
209
210 #define _tcspbrk    strpbrk
211 #define _tcsrchr    strrchr
212 #define _tcsspn     strspn
213 #endif
214
215 #define _tcsstr     strstr
216 #define _tcstok     strtok
217
218 #ifndef UNDER_CE
219
220 #define _tcsdup     _strdup
221 #define _tcsicmp    _stricmp
222 #define _tcsncicmp  _strnicmp
223 #define _tcsnicmp   _strnicmp
224 #define _tcsnset    _strnset
225 #define _tcsncset   _strnset
226 #define _tcsrev     _strrev
227 #define _tcsset     _strset
228 #define _tcslwr     _strlwr
229 #define _tcsupr     _strupr
230 #endif
231
232 #ifndef UNDER_CE
233
234 #define _istalpha   isalpha
235 #define _istupper   isupper
236 #define _istlower   islower
237 #define _istdigit   isdigit
238 #define _istxdigit  isxdigit
239 #define _istspace   isspace
240 #define _istpunct   ispunct
241 #define _istalnum   isalnum
242 #define _istprint   isprint
243 #define _istgraph   isgraph
244 #define _istcntrl   iscntrl
245 #define _istascii   isascii
246 #define _totupper   toupper
247 #define _totlower   tolower
248 #endif
249
250 #endif  /* UNICODE */
251
252 #ifdef __cplusplus
253 }
254 #endif
255
256 #endif  // POSITIONING_BASE_LIBRARY_LIBRARY_INCLUDE_TCHAR_H_