tchar_amigaos4.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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 <[email protected]>
  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. * DISCLAMED. This includes but is not limited to warranties of
  30. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  31. *
  32. * $Revision: 1.1.1.1 $
  33. * $Author: brandon6684 $
  34. * $Date: 2001/12/18 22:54:08 $
  35. *
  36. */
  37. #ifndef _TCHAR_H_
  38. #define _TCHAR_H_
  39. /*
  40. * NOTE: This tests _UNICODE, which is different from the UNICODE define
  41. * used to differentiate Win32 API calls.
  42. */
  43. #ifdef __unix__
  44. #define _TCHAR char*
  45. #endif
  46. #ifdef _UNICODE
  47. /*
  48. * Use TCHAR instead of char or wchar_t. It will be appropriately translated
  49. * if _UNICODE is correctly defined (or not).
  50. */
  51. #ifndef _TCHAR_DEFINED
  52. #ifndef RC_INVOKED
  53. typedef wchar_t TCHAR;
  54. #endif /* Not RC_INVOKED */
  55. #define _TCHAR_DEFINED
  56. #endif
  57. /*
  58. * Enclose constant strings and literal characters in the _TEXT and _T macro to make
  59. * them unicode constant strings when _UNICODE is defined.
  60. */
  61. #define _TEXT(x) L ## x
  62. #define _T(x) L ## x
  63. /*
  64. * Unicode functions
  65. */
  66. #define _tprintf wprintf
  67. #define _ftprintf fwprintf
  68. #define _stprintf swprintf
  69. #define _sntprintf _snwprintf
  70. #define _vtprintf vwprintf
  71. #define _vftprintf vfwprintf
  72. #define _vstprintf vswprintf
  73. #define _vsntprintf _vsnwprintf
  74. #define _tscanf wscanf
  75. #define _ftscanf fwscanf
  76. #define _stscanf swscanf
  77. #define _fgettc fgetwc
  78. #define _fgettchar _fgetwchar
  79. #define _fgetts fgetws
  80. #define _fputtc fputwc
  81. #define _fputtchar _fputwchar
  82. #define _fputts fputws
  83. #define _gettc getwc
  84. #define _getts getws
  85. #define _puttc putwc
  86. #define _putts putws
  87. #define _ungettc ungetwc
  88. #define _tcstod wcstod
  89. #define _tcstol wcstol
  90. #define _tcstoul wcstoul
  91. #define _tcscat wcscat
  92. #define _tcschr wcschr
  93. #define _tcscmp wcscmp
  94. #define _tcscpy wcscpy
  95. #define _tcscspn wcscspn
  96. #define _tcslen wcslen
  97. #define _tcsncat wcsncat
  98. #define _tcsncmp wcsncmp
  99. #define _tcsncpy wcsncpy
  100. #define _tcspbrk wcspbrk
  101. #define _tcsrchr wcsrchr
  102. #define _tcsspn wcsspn
  103. #define _tcsstr wcsstr
  104. #define _tcstok wcstok
  105. #define _tcsdup _wcsdup
  106. #define _tcsicmp _wcsicmp
  107. #define _tcsnicmp _wcsnicmp
  108. #define _tcsnset _wcsnset
  109. #define _tcsrev _wcsrev
  110. #define _tcsset _wcsset
  111. #define _tcslwr _wcslwr
  112. #define _tcsupr _wcsupr
  113. #define _tcsxfrm wcsxfrm
  114. #define _tcscoll wcscoll
  115. #define _tcsicoll _wcsicoll
  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. #define _totupper towupper
  129. #define _totlower towlower
  130. #define _ttoi _wtoi
  131. #define _tcsftime wcsftime
  132. #else /* Not _UNICODE */
  133. /*
  134. * TCHAR, the type you should use instead of char.
  135. */
  136. #ifndef _TCHAR_DEFINED
  137. #ifndef RC_INVOKED
  138. typedef char TCHAR;
  139. #endif
  140. #define _TCHAR_DEFINED
  141. #endif
  142. /*
  143. * Enclose constant strings and characters in the _TEXT and _T macro.
  144. */
  145. #define _TEXT(x) x
  146. #define _T(x) x
  147. /*
  148. * Non-unicode (standard) functions
  149. */
  150. #define _tprintf printf
  151. #define _ftprintf fprintf
  152. #define _stprintf sprintf
  153. #define _sntprintf _snprintf
  154. #define _vtprintf vprintf
  155. #define _vftprintf vfprintf
  156. #define _vstprintf vsprintf
  157. #define _vsntprintf _vsnprintf
  158. #define _tscanf scanf
  159. #define _ftscanf fscanf
  160. #define _stscanf sscanf
  161. #define _fgettc fgetc
  162. #define _fgettchar _fgetchar
  163. #define _fgetts fgets
  164. #define _fputtc fputc
  165. #define _fputtchar _fputchar
  166. #define _fputts fputs
  167. #define _gettc getc
  168. #define _getts gets
  169. #define _puttc putc
  170. #define _putts puts
  171. #define _ungettc ungetc
  172. #define _tcstod strtod
  173. #define _tcstol strtol
  174. #define _tcstoul strtoul
  175. #define _tcscat strcat
  176. #define _tcschr strchr
  177. #define _tcscmp strcmp
  178. #define _tcscpy strcpy
  179. #define _tcscspn strcspn
  180. #define _tcslen strlen
  181. #define _tcsncat strncat
  182. #define _tcsncmp strncmp
  183. #define _tcsncpy strncpy
  184. #define _tcspbrk strpbrk
  185. #define _tcsrchr strrchr
  186. #define _tcsspn strspn
  187. #define _tcsstr strstr
  188. #define _tcstok strtok
  189. #define _tcsdup _strdup
  190. #define _tcsicmp _stricmp
  191. #define _tcsnicmp _strnicmp
  192. #define _tcsnset _strnset
  193. #define _tcsrev _strrev
  194. #define _tcsset _strset
  195. #define _tcslwr _strlwr
  196. #define _tcsupr _strupr
  197. #define _tcsxfrm strxfrm
  198. #define _tcscoll strcoll
  199. #define _tcsicoll _stricoll
  200. #define _istalpha isalpha
  201. #define _istupper isupper
  202. #define _istlower islower
  203. #define _istdigit isdigit
  204. #define _istxdigit isxdigit
  205. #define _istspace isspace
  206. #define _istpunct ispunct
  207. #define _istalnum isalnum
  208. #define _istprint isprint
  209. #define _istgraph isgraph
  210. #define _istcntrl iscntrl
  211. #define _istascii isascii
  212. #define _totupper toupper
  213. #define _totlower tolower
  214. #define _ttoi atoi
  215. #define _tcsftime strftime
  216. #ifdef __amigaos4__
  217. #define _TCHAR wchar_t
  218. #endif
  219. #endif /* Not _UNICODE */
  220. #endif /* Not _TCHAR_H_ */