Provides the mappings. MBCS and Unicode functions are not implemented.
[wine] / include / tchar.h
1 #ifndef __WINE_TCHAR_H
2 #define __WINE_TCHAR_H
3
4
5 /* FIXME: this should be in direct.h but since it's a standard C library include (on some systems)... */
6 #define _chdir chdir
7 #define _rmdir rmdir
8
9 /* FIXME: this should be in io.h but I believe it's a standard include on some systems... */
10 /* would need unistd.h */
11 #define _access access
12 /* would need sys/stat.h */
13 #define _chmod chmod
14 /* would need fcntl.h */
15 #define _creat creat
16 #define _open open
17 /* FIXME: we need _S_IWRITE, _O_CREAT ... */
18 /* FIXME: _fsopen is not implemented */
19 #define sopen _sopen
20 /* FIXME: _sopen is not implemented */
21
22 /* FIXME: this should be in stdio.h but since it's a standard C library include... */
23 #define fgetchar getchar
24 #define fputchar putchar
25 #define _popen popen
26 #define _tempnam tempnam
27 #define _vsnprintf vsnprintf
28
29 /* FIXME: this should be in stdlib.h but since it's a standard C library include... */
30 /* FIXME: itoa and ltoa are missing */
31 /* FIXME: _makepath is not implemented */
32 /* FIXME: _searchenv is not implemented */
33 /* FIXME: _splitpath is not implemented */
34
35 /* FIXME: this should be in string.h but since it's a standard C library include... */
36 #define _stricmp strcasecmp
37 #define _strnicmp strncasecmp
38 #define _strdup strdup
39 /* FIXME: stricoll is not implemented but strcasecmp is probably close enough in most cases */
40 #define _stricoll strcasecmp
41 #define stricoll _stricoll
42 #define strlwr _strlwr
43 /* FIXME: _strlwr is not implemented */
44 #define strnset _strnset
45 /* FIXME: _strnset is not implemented */
46 #define strrev _strrev
47 /* FIXME: _strrev is not implemented */
48 #define strset _strset
49 /* FIXME: _strset is not implemented */
50 #define strupr _strupr
51 /* FIXME: _strupr is not implemented */
52 #define ultoa _ultoa
53 /* FIXME: _ultoa is not implemented */
54
55 /* FIXME: this should be in sys/stat.h but since it's a standard C library include... */
56 #define _stat stat
57
58 /* FIXME: this should be in time.h but since it's a standard C library include... */
59 /* FIXME: _strdate is not implemented */
60 /* FIXME: _strtime is not implemented */
61
62 /* FIXME: this should be in utime.h but since it's a standard C library include... */
63 #define _utime utime
64
65
66 /*****************************************************************************
67  * tchar routines
68  */
69 #define _strdec(start,current)  (start<current?(current)-1:NULL)
70 #define _strinc(current) ((current)+1)
71 /* FIXME: _strncnt ans strncnt are missing */
72 /* FIXME: _strspnp is not implemented */
73
74
75 /*****************************************************************************
76  * tchar mappings
77  */
78 #ifndef _UNICODE
79 #include <string.h>
80 #ifndef _MBCS
81 #define WINE_tchar_routine(std,mbcs,unicode) std
82 #else /* _MBCS defined */
83 #define WINE_tchar_routine(std,mbcs,unicode) mbcs
84 #endif
85 #else /* _UNICODE defined */
86 #define WINE_tchar_routine(std,mbcs,unicode) unicode
87 #endif
88
89 #define WINE_tchar_true(a) (1)
90 #define WINE_tchar_false(a) (0)
91 #define WINE_tchar_tclen(a) (1)
92 #define WINE_tchar_tccpy(a,b) do { *(a)=*(b); } while (0)
93
94 #define _fgettc       WINE_tchar_routine(fgetc,           fgetc,       fgetwc)
95 #define _fgettchar    WINE_tchar_routine(fgetchar,        fgetchar,    _fgetwchar)
96 #define _fgetts       WINE_tchar_routine(fgets,           fgets,       fgetws)
97 #define _fputtc       WINE_tchar_routine(fputc,           fputc,       fputwc)
98 #define _fputtchar    WINE_tchar_routine(fputchar,        fputchar,    _fputwchar)
99 #define _fputts       WINE_tchar_routine(fputs,           fputs,       fputws)
100 #define _ftprintf     WINE_tchar_routine(fprintf,         fprintf,     fwprintf)
101 #define _ftscanf      WINE_tchar_routine(fscanf,          fscanf,      fwscanf)
102 #define _gettc        WINE_tchar_routine(getc,            getc,        getwc)
103 #define _gettchar     WINE_tchar_routine(getchar,         getchar,     getwchar)
104 #define _getts        WINE_tchar_routine(gets,            gets,        getws)
105 #define _isalnum      WINE_tchar_routine(isalnum,         _ismbcalnum, iswalnum)
106 #define _istalpha     WINE_tchar_routine(isalpha,         _ismbcalpha, iswalpha)
107 #define _istascii     WINE_tchar_routine(__isascii,       __isascii,   iswascii)
108 #define _istcntrl     WINE_tchar_routine(iscntrl,         iscntrl,     iswcntrl)
109 #define _istdigit     WINE_tchar_routine(isdigit,         _ismbcdigit, iswdigit)
110 #define _istgraph     WINE_tchar_routine(isgraph,         _ismbcgraph, iswgraph)
111 #define _istlead      WINE_tchar_routine(WINE_tchar_false,_ismbblead,  WINE_tchar_false)
112 #define _istleadbyte  WINE_tchar_routine(WINE_tchar_false,isleadbyte,  WINE_tchar_false)
113 #define _istlegal     WINE_tchar_routine(WINE_tchar_true, _ismbclegal, WINE_tchar_true)
114 #define _istlower     WINE_tchar_routine(islower,         _ismbcslower,iswlower)
115 #define _istprint     WINE_tchar_routine(isprint,         _ismbcprint, iswprint)
116 #define _istpunct     WINE_tchar_routine(ispunct,         _ismbcpunct, iswpunct)
117 #define _istspace     WINE_tchar_routine(isspace,         _ismbcspace, iswspace)
118 #define _istupper     WINE_tchar_routine(isupper,         _ismbcupper, iswupper)
119 #define _istxdigit    WINE_tchar_routine(isxdigit,        isxdigit,    iswxdigit)
120 #define _itot         WINE_tchar_routine(_itoa,           _itoa,       _itow)
121 #define _ltot         WINE_tchar_routine(_ltoa,           _ltoa,       _ltow)
122 #define _puttc        WINE_tchar_routine(putc,            putc,        putwc)
123 #define _puttchar     WINE_tchar_routine(putchar,         putchar,     putwchar)
124 #define _putts        WINE_tchar_routine(puts,            puts,        putws)
125 #define _tmain        WINE_tchar_routine(main,            main,        wmain)
126 #define _sntprintf    WINE_tchar_routine(sprintf,         sprintf,     swprintf)
127 #define _stscanf      WINE_tchar_routine(sscanf,          sscanf,      swscanf)
128 #define _taccess      WINE_tchar_routine(_access,         _access,     _waccess)
129 #define _tasctime     WINE_tchar_routine(asctime,         asctime,     _wasctime)
130 #define _tccpy        WINE_tchar_routine(WINE_tchar_tccpy,_mbccpy,     WINE_tchar_tccpy)
131 #define _tchdir       WINE_tchar_routine(_chdir,          _chdir,      _wchdir)
132 #define _tclen        WINE_tchar_routine(WINE_tchar_tclen,_mbclen,     WINE_tchar_tclen)
133 #define _tchmod       WINE_tchar_routine(_chmod,          _chmod,      _wchmod)
134 #define _tcreat       WINE_tchar_routine(_creat,          _creat,      _wcreat)
135 #define _tcscat       WINE_tchar_routine(strcat,          _mbscat,     wcscat)
136 #define _tcschr       WINE_tchar_routine(strchr,          _mbschr,     wcschr)
137 #define _tcsclen      WINE_tchar_routine(strlen,          _mbslen,     wcslen)
138 #define _tcscmp       WINE_tchar_routine(strcmp,          _mbscmp,     wcscmp)
139 #define _tcscoll      WINE_tchar_routine(strcoll,         _mbscoll,    wcscoll)
140 #define _tcscpy       WINE_tchar_routine(strcpy,          _mbscpy,     wcscpy)
141 #define _tcscspn      WINE_tchar_routine(strcspn,         _mbscspn,    wcscspn)
142 #define _tcsdec       WINE_tchar_routine(_strdec,         _mbsdec,     _wcsdec)
143 #define _tcsdup       WINE_tchar_routine(_strdup,         _mbsdup,     _wcsdup)
144 #define _tcsftime     WINE_tchar_routine(strftime,        strftime,    wcsftime)
145 #define _tcsicmp      WINE_tchar_routine(_stricmp,        _mbsicmp,    _wcsicmp)
146 #define _tcsicoll     WINE_tchar_routine(_stricoll,       _stricoll,   _wcsicoll)
147 #define _tcsinc       WINE_tchar_routine(_strinc,         _mbsinc,     _wcsinc)
148 #define _tcslen       WINE_tchar_routine(strlen,          strlen,      wcslen)
149 #define _tcslwr       WINE_tchar_routine(_strlwr,         _mbslwr,     _wcslwr)
150 #define _tcsnbcnt     WINE_tchar_routine(_strncnt,        _mbsnbcnt,   _wcnscnt)
151 #define _tcsncat      WINE_tchar_routine(strncat,         _mbsnbcat,   wcsncat)
152 #define _tcsnccat     WINE_tchar_routine(strncat,         _mbsncat,    wcsncat)
153 #define _tcsncmp      WINE_tchar_routine(strncmp,         _mbsnbcmp,   wcsncmp)
154 #define _tcsnccmp     WINE_tchar_routine(strncmp,         _mbsncmp,    wcsncmp)
155 #define _tcsnccnt     WINE_tchar_routine(_strncnt,        _mbsnccnt,   _wcsncnt)
156 #define _tcsnccpy     WINE_tchar_routine(strncpy,         _mbsncpy,    wcsncpy)
157 #define _tcsncicmp    WINE_tchar_routine(_strnicmp,       _mbsnicmp,   _wcsnicmp)
158 #define _tcsncpy      WINE_tchar_routine(strncpy,         _mbsnbcpy,   wcsncpy)
159 #define _tcsncset     WINE_tchar_routine(_strnset,        _mbsnset,    _wcsnset)
160 #define _tcsnextc     WINE_tchar_routine(_strnextc,       _mbsnextc,   _wcsnextc)
161 #define _tcsnicmp     WINE_tchar_routine(_strnicmp,       _mbsnicmp,   _wcsnicmp)
162 #define _tcsnicoll    WINE_tchar_routine(_strnicoll,      _strnicoll   _wcsnicoll)
163 #define _tcsninc      WINE_tchar_routine(_strninc,        _mbsninc,    _wcsninc)
164 #define _tcsnccnt     WINE_tchar_routine(_strncnt,        _mbsnccnt,   _wcsncnt)
165 #define _tcsnset      WINE_tchar_routine(_strnset,        _mbsnbset,   _wcsnset)
166 #define _tcspbrk      WINE_tchar_routine(strpbrk,         _mbspbrk,    wcspbrk)
167 #define _tcsspnp      WINE_tchar_routine(_strspnp,        _mbsspnp,    _wcsspnp)
168 #define _tcsrchr      WINE_tchar_routine(strrchr,         _mbsrchr,    wcsrchr)
169 #define _tcsrev       WINE_tchar_routine(_strrev,         _mbsrev,     _wcsrev)
170 #define _tcsset       WINE_tchar_routine(_strset,         _mbsset,     _wcsset)
171 #define _tcsspn       WINE_tchar_routine(strspn,          _mbsspn,     wcsspn)
172 #define _tcsstr       WINE_tchar_routine(strstr,          _mbsstr,     wcsstr)
173 #define _tcstod       WINE_tchar_routine(strtod,          strtod,      wcstod)
174 #define _tcstok       WINE_tchar_routine(strtok,          _mbstok,     wcstok)
175 #define _tcstol       WINE_tchar_routine(strtol,          strtol,      wcstol)
176 #define _tcstoul      WINE_tchar_routine(strtoul,         strtoul,     wcstoul)
177 #define _tcsupr       WINE_tchar_routine(_strupr,         _mbsupr,     _wcsupr)
178 #define _tcsxfrm      WINE_tchar_routine(strxfrm,         strxfrm,     wcsxfrm)
179 #define _tctime       WINE_tchar_routine(ctime,           ctime,       _wctime)
180 #define _texecl       WINE_tchar_routine(_execl,          _execl,      _wexecl)
181 #define _texecle      WINE_tchar_routine(_execle,         _execle,     _wexecle)
182 #define _texeclp      WINE_tchar_routine(_execlp,         _execlp,     _wexeclp)
183 #define _texeclpe     WINE_tchar_routine(_execlpe,        _execlpe,    _wexeclpe)
184 #define _texecv       WINE_tchar_routine(_execv,          _execv,      _wexecv)
185 #define _texecve      WINE_tchar_routine(_execve,         _execve,     _wexecve)
186 #define _texecvp      WINE_tchar_routine(_execvp,         _execvp,     _wexecvp)
187 #define _texecvpe     WINE_tchar_routine(_execvpe,        _execvpe,    _wexecvpe)
188 #define _tfdopen      WINE_tchar_routine(_fdopen,         _fdopen,     _wfdopen)
189 #define _tfindfirst   WINE_tchar_routine(_findfirst,      _findfirst,  _wfindfirst)
190 #define _tfindnext    WINE_tchar_routine(_findnext,       _findnext,   _wfindnext)
191 #define _tfopen       WINE_tchar_routine(fopen,           fopen,       _wfopen)
192 #define _tfreopen     WINE_tchar_routine(freopen,         freopen,     _wfreopen)
193 #define _tfsopen      WINE_tchar_routine(_fsopen,         _fsopen,     _wfsopen)
194 #define _tfullpath    WINE_tchar_routine(_fullpath,       _fullpath,   _wfullpath)
195 #define _tgetcwd      WINE_tchar_routine(_getcwd,         _getcwd,     _wgetcwd)
196 #define _tgetenv      WINE_tchar_routine(getenv,          getenv,      _wgetenv)
197 #define _tmain        WINE_tchar_routine(main,            main,        wmain)
198 #define _tmakepath    WINE_tchar_routine(_makepath,       _makepath,   _wmakepath)
199 #define _tmkdir       WINE_tchar_routine(_mkdir,          _mkdir,      _wmkdir)
200 #define _tmktemp      WINE_tchar_routine(_mktemp,         _mktemp,     _wmktemp)
201 #define _tperror      WINE_tchar_routine(perror,          perror,      _wperror)
202 #define _topen        WINE_tchar_routine(_open,           _open,       _wopen)
203 #define _totlower     WINE_tchar_routine(tolower,         _mbctolower, towlower)
204 #define _totupper     WINE_tchar_routine(toupper,         _mbctoupper, towupper)
205 #define _tpopen       WINE_tchar_routine(_popen,          _popen,      _wpopen)
206 #define _tprintf      WINE_tchar_routine(printf,          printf,      wprintf)
207 #define _tremove      WINE_tchar_routine(remove,          remove,      _wremove)
208 #define _trename      WINE_tchar_routine(rename,          rename,      _wrename)
209 #define _trmdir       WINE_tchar_routine(_rmdir,          _rmdir,      _wrmdir)
210 #define _tsearchenv   WINE_tchar_routine(_searchenv,      _searchenv,  _wsearchenv)
211 #define _tscanf       WINE_tchar_routine(scanf,           scanf,       wscanf)
212 #define _tsetlocale   WINE_tchar_routine(setlocale,       setlocale,   _wsetlocale)
213 #define _tsopen       WINE_tchar_routine(_sopen,          _sopen,      _wsopen)
214 #define _tspawnl      WINE_tchar_routine(_spawnl,         _spawnl,     _wspawnl)
215 #define _tspawnle     WINE_tchar_routine(_spawnle,        _spawnle,    _wspawnle)
216 #define _tspawnlp     WINE_tchar_routine(_spawnlp,        _spawnlp,    _wspawnlp)
217 #define _tspawnlpe    WINE_tchar_routine(_spawnlpe,       _spawnlpe,   _wspawnlpe)
218 #define _tspawnv      WINE_tchar_routine(_spawnv,         _spawnv,     _wspawnv)
219 #define _tspawnve     WINE_tchar_routine(_spawnve,        _spawnve,    _wspawnve)
220 #define _tspawnvp     WINE_tchar_routine(_spawnvp,        _spawnvp,    _tspawnvp)
221 #define _tspawnvpe    WINE_tchar_routine(_spawnvpe,       _spawnvpe,   _tspawnvpe)
222 #define _tsplitpath   WINE_tchar_routine(_splitpath,      _splitpath,  _wsplitpath)
223 #define _tstat        WINE_tchar_routine(_stat,           _stat,       _wstat)
224 #define _tstrdate     WINE_tchar_routine(_strdate,        _strdate,    _wstrdate)
225 #define _tstrtime     WINE_tchar_routine(_strtime,        _strtime,    _wstrtime)
226 #define _tsystem      WINE_tchar_routine(system,          system,      _wsystem)
227 #define _ttempnam     WINE_tchar_routine(_tempnam,        _tempnam,    _wtempnam)
228 #define _ttmpnam      WINE_tchar_routine(tmpnam,          tmpnam,      _wtmpnam)
229 #define _ttoi         WINE_tchar_routine(atoi,            atoi,        _wtoi)
230 #define _ttol         WINE_tchar_routine(atol,            atol,        _wtol)
231 #define _tutime       WINE_tchar_routine(_utime,          _utime,      _wutime)
232 #define _tWinMain     WINE_tchar_routine(WinMain,         WinMain,     wWinMain)
233 #define _ultot        WINE_tchar_routine(_ultoa,          _ultoa,      _ultow)
234 #define _ungettc      WINE_tchar_routine(ungetc,          ungetc,      ungetwc)
235 #define _vftprintf    WINE_tchar_routine(vfprintf,        vfprintf,    vfwprintf)
236 #define _vsntprintf   WINE_tchar_routine(_vsnprintf,      _vsnprintf,  _vsnwprintf)
237 #define _vstprintf    WINE_tchar_routine(vsprintf,        vsprintf,    vswprintf)
238 #define _vtprintf     WINE_tchar_routine(vprintf,         vprintf,     vwprintf)
239
240 #endif /* __WINE_TCHAR_H */