Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

311 lines
6.4 KiB

  1. /***
  2. *tchar.h - definitions for generic international text functions (16-bit)
  3. *
  4. * Copyright (c) 1991-1994, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Definitions for generic international functions, mostly defines
  8. * which map string/formatted-io/ctype functions to char, wchar_t, or
  9. * MBCS versions. To be used for compatibility between single-byte,
  10. * multi-byte and Unicode text models.
  11. *
  12. * NOTE: This is a stripped-down version for use with 16-bit libraries.
  13. * It maps to SBCS only, not to MBCS or Unicode.
  14. *
  15. ****/
  16. #ifndef _INC_TCHAR
  17. #ifdef _MSC_VER
  18. #pragma warning(disable:4505) /* disable unwanted C++ /W4 warning */
  19. /* #pragma warning(default:4505) */ /* use this to reenable, if necessary */
  20. #endif /* _MSC_VER */
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Define __cdecl for non-Microsoft compilers */
  25. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  26. #define __cdecl
  27. #endif
  28. #define _TEOF EOF
  29. #define __T(x) x
  30. #ifndef __TCHAR_DEFINED
  31. typedef char _TCHAR;
  32. typedef signed char _TSCHAR;
  33. typedef unsigned char _TUCHAR;
  34. typedef char _TXCHAR;
  35. typedef int _TINT;
  36. #define __TCHAR_DEFINED
  37. #endif
  38. #ifndef _TCHAR_DEFINED
  39. #if !__STDC__
  40. typedef char TCHAR;
  41. #endif
  42. #define _TCHAR_DEFINED
  43. #endif
  44. /* ++++++++++++++++++++ SBCS FUNCTIONS ++++++++++++++++++++ */
  45. /* Program */
  46. #define _tmain main
  47. #ifdef _POSIX_
  48. #define _tenviron environ
  49. #else
  50. #define _tenviron _environ
  51. #endif
  52. /* Far functions */
  53. #define _ftcscat _fstrcat
  54. #define _ftcschr _fstrchr
  55. #define _ftcscmp _fstrcmp
  56. #define _ftcscpy _fstrcpy
  57. #define _ftcscspn _fstrcspn
  58. #define _ftcslen _fstrlen
  59. #define _ftcsncat _fstrncat
  60. #define _ftcsncmp _fstrncmp
  61. #define _ftcsncpy _fstrncpy
  62. #define _ftcspbrk _fstrpbrk
  63. #define _ftcsrchr _fstrrchr
  64. #define _ftcsspn _fstrspn
  65. #define _ftcsstr _fstrstr
  66. #define _ftcstok _fstrtok
  67. #define _ftcsdup _fstrdup
  68. #define _ftcsicmp _fstricmp
  69. #define _ftcsnicmp _fstrnicmp
  70. #define _ftcsnset _fstrnset
  71. #define _ftcsrev _fstrrev
  72. #define _ftcsset _fstrset
  73. #define _ftcslwr _fstrlwr
  74. #define _ftcsupr _fstrupr
  75. /* Formatted i/o */
  76. #define _tprintf printf
  77. #define _ftprintf fprintf
  78. #define _stprintf sprintf
  79. #define _sntprintf _snprintf
  80. #define _vtprintf vprintf
  81. #define _vftprintf vfprintf
  82. #define _vstprintf vsprintf
  83. #define _vsntprintf _vsnprintf
  84. #define _tscanf scanf
  85. #define _ftscanf fscanf
  86. #define _stscanf sscanf
  87. /* Unformatted i/o */
  88. #define _fgettc fgetc
  89. #define _fgettchar _fgetchar
  90. #define _fgetts fgets
  91. #define _fputtc fputc
  92. #define _fputtchar _fputchar
  93. #define _fputts fputs
  94. #define _gettc getc
  95. #define _gettchar getchar
  96. #define _getts gets
  97. #define _puttc putc
  98. #define _puttchar putchar
  99. #define _putts puts
  100. #define _ungettc ungetc
  101. /* Execute functions */
  102. #define _texecl _execl
  103. #define _texecle _execle
  104. #define _texeclp _execlp
  105. #define _texeclpe _execlpe
  106. #define _texecv _execv
  107. #define _texecve _execve
  108. #define _texecvp _execvp
  109. #define _texecvpe _execvpe
  110. #define _tspawnl _spawnl
  111. #define _tspawnle _spawnle
  112. #define _tspawnlp _spawnlp
  113. #define _tspawnlpe _spawnlpe
  114. #define _tspawnv _spawnv
  115. #define _tspawnve _spawnve
  116. #define _tspawnvp _spawnvp
  117. #define _tspawnvpe _spawnvpe
  118. #define _tsystem system
  119. /* Time functions */
  120. #define _tasctime asctime
  121. #define _tctime ctime
  122. #define _tstrdate _strdate
  123. #define _tstrtime _strtime
  124. #define _tutime _utime
  125. #define _tcsftime strftime
  126. /* Directory functions */
  127. #define _tchdir _chdir
  128. #define _tgetcwd _getcwd
  129. #define _tgetdcwd _getdcwd
  130. #define _tmkdir _mkdir
  131. #define _trmdir _rmdir
  132. /* Environment/Path functions */
  133. #define _tfullpath _fullpath
  134. #define _tgetenv getenv
  135. #define _tmakepath _makepath
  136. #define _tputenv _putenv
  137. #define _tsearchenv _searchenv
  138. #define _tsplitpath _splitpath
  139. /* Stdio functions */
  140. #ifdef _POSIX_
  141. #define _tfdopen fdopen
  142. #else
  143. #define _tfdopen _fdopen
  144. #endif
  145. #define _tfsopen _fsopen
  146. #define _tfopen fopen
  147. #define _tfreopen freopen
  148. #define _tperror perror
  149. #define _tpopen _popen
  150. #define _tsetbuf setbuf
  151. #define _tsetvbuf setvbuf
  152. #define _ttempnam _tempnam
  153. #define _ttmpnam tmpnam
  154. /* Io functions */
  155. #define _taccess _access
  156. #define _tchmod _chmod
  157. #define _tcreat _creat
  158. #define _tfindfirst _findfirst
  159. #define _tfindnext _findnext
  160. #define _tmktemp _mktemp
  161. #define _topen _open
  162. #define _tremove remove
  163. #define _trename rename
  164. #define _tsopen _sopen
  165. #define _tunlink _unlink
  166. #define _tfinddata_t _finddata_t
  167. /* Stat functions */
  168. #define _tstat _stat
  169. /* Setlocale functions */
  170. #define _tsetlocale setlocale
  171. /* String conversion functions */
  172. #define _tcstod strtod
  173. #define _tcstol strtol
  174. #define _tcstoul strtoul
  175. #define _itot _itoa
  176. #define _ltot _ltoa
  177. #define _ultot _ultoa
  178. #define _ttoi atoi
  179. #define _ttol atol
  180. /* String functions */
  181. #define _tcscat strcat
  182. #define _tcscpy strcpy
  183. #define _tcslen strlen
  184. #define _tcsxfrm strxfrm
  185. #define _tcscoll strcoll
  186. #define _tcsdup _strdup
  187. #define _tcschr strchr
  188. #define _tcscmp strcmp
  189. #define _tcscspn strcspn
  190. #define _tcsncat strncat
  191. #define _tcsncmp strncmp
  192. #define _tcsncpy strncpy
  193. #define _tcspbrk strpbrk
  194. #define _tcsrchr strrchr
  195. #define _tcsspn strspn
  196. #define _tcsstr strstr
  197. #define _tcstok strtok
  198. #define _tcsicmp _stricmp
  199. #define _tcsnicmp _strnicmp
  200. #define _tcsnset _strnset
  201. #define _tcsrev _strrev
  202. #define _tcsset _strset
  203. /* "logical-character" mappings */
  204. #define _tcsclen strlen
  205. #define _tcsnccat strncat
  206. #define _tcsnccpy strncpy
  207. #define _tcsnccmp strncmp
  208. #define _tcsncicmp _strnicmp
  209. #define _tcsncset _strnset
  210. /* Ctype functions */
  211. #define _istascii isascii
  212. #define _istcntrl iscntrl
  213. #define _istxdigit isxdigit
  214. #define _istalnum isalnum
  215. #define _istalpha isalpha
  216. #define _istdigit isdigit
  217. #define _istgraph isgraph
  218. #define _istlower islower
  219. #define _istprint isprint
  220. #define _istpunct ispunct
  221. #define _istspace isspace
  222. #define _istupper isupper
  223. #define _totupper toupper
  224. #define _totlower tolower
  225. /* Generic text macros to be used with string literals and character constants.
  226. Will also allow symbolic constants that resolve to same. */
  227. #define _T(x) __T(x)
  228. #define _TEXT(x) __T(x)
  229. #ifdef __cplusplus
  230. }
  231. #endif
  232. #define _INC_TCHAR
  233. #endif /* _INC_TCHAR */