tchar_s.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the w64 mingw-runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER within this package.
  5. */
  6. #ifndef _INC_TCHAR_S
  7. #define _INC_TCHAR_S
  8. #include <tchar.h>
  9. #if defined(MINGW_HAS_SECURE_API)
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #ifdef _UNICODE
  14. #define _tprintf_s wprintf_s
  15. #define _tprintf_s_l _wprintf_s_l
  16. #define _tcprintf_s _cwprintf_s
  17. #define _tcprintf_s_l _cwprintf_s_l
  18. #define _vtcprintf_s _vcwprintf_s
  19. #define _vtcprintf_s_l _vcwprintf_s_l
  20. #define _ftprintf_s fwprintf_s
  21. #define _ftprintf_s_l _fwprintf_s_l
  22. #define _stprintf_s swprintf_s
  23. #define _stprintf_s_l _swprintf_s_l
  24. #define _sntprintf_s _snwprintf_s
  25. #define _sntprintf_s_l _snwprintf_s_l
  26. #define _vtprintf_s vwprintf_s
  27. #define _vtprintf_s_l _vwprintf_s_l
  28. #define _vftprintf_s vfwprintf_s
  29. #define _vftprintf_s_l _vfwprintf_s_l
  30. #define _vstprintf_s vswprintf_s
  31. #define _vstprintf_s_l _vswprintf_s_l
  32. #define _vsntprintf_s _vsnwprintf_s
  33. #define _vsntprintf_s_l _vsnwprintf_s_l
  34. #define _tscanf_s wscanf_s
  35. #define _tscanf_s_l _wscanf_s_l
  36. #define _tcscanf_s _cwscanf_s
  37. #define _tcscanf_s_l _cwscanf_s_l
  38. #define _ftscanf_s fwscanf_s
  39. #define _ftscanf_s_l _fwscanf_s_l
  40. #define _stscanf_s swscanf_s
  41. #define _stscanf_s_l _swscanf_s_l
  42. #define _sntscanf_s _snwscanf_s
  43. #define _sntscanf_s_l _snwscanf_s_l
  44. #define _cgetts_s _cgetws_s
  45. #define _getts_s _getws_s
  46. #define _itot_s _itow_s
  47. #define _ltot_s _ltow_s
  48. #define _ultot_s _ultow_s
  49. #define _i64tot_s _i64tow_s
  50. #define _ui64tot_s _ui64tow_s
  51. #define _tcscat_s wcscat_s
  52. #define _tcscpy_s wcscpy_s
  53. #define _tcsncat_s wcsncat_s
  54. #define _tcsncat_s_l _wcsncat_s_l
  55. #define _tcsncpy_s wcsncpy_s
  56. #define _tcsncpy_s_l _wcsncpy_s_l
  57. #define _tcstok_s wcstok_s
  58. #define _tcstok_s_l _wcstok_s_l
  59. #define _tcserror_s _wcserror_s
  60. #define __tcserror_s __wcserror_s
  61. #define _tcsnset_s _wcsnset_s
  62. #define _tcsnset_s_l _wcsnset_s_l
  63. #define _tcsset_s _wcsset_s
  64. #define _tcsset_s_l _wcsset_s_l
  65. #define _tasctime_s _wasctime_s
  66. #define _tctime_s _wctime_s
  67. #define _tctime32_s _wctime32_s
  68. #define _tctime64_s _wctime64_s
  69. #define _tstrdate_s _wstrdate_s
  70. #define _tstrtime_s _wstrtime_s
  71. #define _tgetenv_s _wgetenv_s
  72. #define _tdupenv_s _wdupenv_s
  73. #define _tmakepath_s _wmakepath_s
  74. #define _tputenv_s _wputenv_s
  75. #define _tsearchenv_s _wsearchenv_s
  76. #define _tsplitpath_s _wsplitpath_s
  77. #define _tfopen_s _wfopen_s
  78. #define _tfreopen_s _wfreopen_s
  79. #define _ttmpnam_s _wtmpnam_s
  80. #define _taccess_s _waccess_s
  81. #define _tmktemp_s _wmktemp_s
  82. #define _tcsnccat_s wcsncat_s
  83. #define _tcsnccat_s_l _wcsncat_s_l
  84. #define _tcsnccpy_s wcsncpy_s
  85. #define _tcsnccpy_s_l _wcsncpy_s_l
  86. #define _tcslwr_s _wcslwr_s
  87. #define _tcslwr_s_l _wcslwr_s_l
  88. #define _tcsupr_s _wcsupr_s
  89. #define _tcsupr_s_l _wcsupr_s_l
  90. #define _wcstok_s_l(_String,_Delimiters,_Current_position,_Locale) (wcstok_s(_String,_Delimiters,_Current_position))
  91. #define _wcsnset_s_l(_Destination,_Destination_size_chars,_Value,_Count,_Locale) (_wcsnset_s(_Destination,_Destination_size_chars,_Value,_Count))
  92. #define _wcsset_s_l(_Destination,_Destination_size_chars,_Value,_Locale) (_wcsset_s(_Destination,_Destination_size_chars,_Value))
  93. #else
  94. #define _tprintf_s printf_s
  95. #define _tprintf_s_l _printf_s_l
  96. #define _tcprintf_s _cprintf_s
  97. #define _tcprintf_s_l _cprintf_s_l
  98. #define _vtcprintf_s _vcprintf_s
  99. #define _vtcprintf_s_l _vcprintf_s_l
  100. #define _ftprintf_s fprintf_s
  101. #define _ftprintf_s_l _fprintf_s_l
  102. #define _stprintf_s sprintf_s
  103. #define _stprintf_s_l _sprintf_s_l
  104. #define _sntprintf_s _snprintf_s
  105. #define _sntprintf_s_l _snprintf_s_l
  106. #define _vtprintf_s vprintf_s
  107. #define _vtprintf_s_l _vprintf_s_l
  108. #define _vftprintf_s vfprintf_s
  109. #define _vftprintf_s_l _vfprintf_s_l
  110. #define _vstprintf_s vsprintf_s
  111. #define _vstprintf_s_l _vsprintf_s_l
  112. #define _vsntprintf_s _vsnprintf_s
  113. #define _vsntprintf_s_l _vsnprintf_s_l
  114. #define _tscanf_s scanf_s
  115. #define _tscanf_s_l _scanf_s_l
  116. #define _tcscanf_s _cscanf_s
  117. #define _tcscanf_s_l _cscanf_s_l
  118. #define _ftscanf_s fscanf_s
  119. #define _ftscanf_s_l _fscanf_s_l
  120. #define _stscanf_s sscanf_s
  121. #define _stscanf_s_l _sscanf_s_l
  122. #define _sntscanf_s _snscanf_s
  123. #define _sntscanf_s_l _snscanf_s_l
  124. #define _getts_s gets_s
  125. #define _cgetts_s _cgets_s
  126. #define _itot_s _itoa_s
  127. #define _ltot_s _ltoa_s
  128. #define _ultot_s _ultoa_s
  129. #define _i64tot_s _i64toa_s
  130. #define _ui64tot_s _ui64toa_s
  131. #define _tcscat_s strcat_s
  132. #define _tcscpy_s strcpy_s
  133. #define _tcserror_s strerror_s
  134. #define __tcserror_s _strerror_s
  135. #define _tasctime_s asctime_s
  136. #define _tctime_s ctime_s
  137. #define _tctime32_s _ctime32_s
  138. #define _tctime64_s _ctime64_s
  139. #define _tstrdate_s _strdate_s
  140. #define _tstrtime_s _strtime_s
  141. #define _tgetenv_s getenv_s
  142. #define _tdupenv_s _dupenv_s
  143. #define _tmakepath_s _makepath_s
  144. #define _tputenv_s _putenv_s
  145. #define _tsearchenv_s _searchenv_s
  146. #define _tsplitpath_s _splitpath_s
  147. #define _tfopen_s fopen_s
  148. #define _tfreopen_s freopen_s
  149. #define _ttmpnam_s tmpnam_s
  150. #define _tmktemp_s _mktemp_s
  151. #ifndef _POSIX_
  152. #define _taccess_s _access_s
  153. #endif
  154. #define _tsopen_s _sopen_s
  155. #ifdef _MBCS
  156. #ifdef _MB_MAP_DIRECT
  157. #define _tcsncat_s _mbsnbcat_s
  158. #define _tcsncat_s_l _mbsnbcat_s_l
  159. #define _tcsncpy_s _mbsnbcpy_s
  160. #define _tcsncpy_s_l _mbsnbcpy_s_l
  161. #define _tcstok_s _mbstok_s
  162. #define _tcstok_s_l _mbstok_s_l
  163. #define _tcsnset_s _mbsnbset_s
  164. #define _tcsnset_s_l _mbsnbset_s_l
  165. #define _tcsset_s _mbsset_s
  166. #define _tcsset_s_l _mbsset_s_l
  167. #define _tcsnccat_s _mbsncat_s
  168. #define _tcsnccat_s_l _mbsncat_s_l
  169. #define _tcsnccpy_s _mbsncpy_s
  170. #define _tcsnccpy_s_l _mbsncpy_s_l
  171. #define _tcsncset_s _mbsnset_s
  172. #define _tcsncset_s_l _mbsnset_s_l
  173. #define _tcslwr_s _mbslwr_s
  174. #define _tcslwr_s_l _mbslwr_s_l
  175. #define _tcsupr_s _mbsupr_s
  176. #define _tcsupr_s_l _mbsupr_s_l
  177. #define _tccpy_s _mbccpy_s
  178. #define _tccpy_s_l _mbccpy_s_l
  179. #else
  180. _CRTIMP char *__cdecl _tcsncat_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
  181. _CRTIMP char *__cdecl _tcsncat_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
  182. _CRTIMP char *__cdecl _tcsncpy_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
  183. _CRTIMP char *__cdecl _tcsncpy_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
  184. _CRTIMP char *__cdecl _tcstok_s(char *_Str,const char *_Delim,char **_Context);
  185. _CRTIMP char *__cdecl _tcstok_s_l(char *_Str,const char *_Delim,char **_Context,_locale_t _Locale);
  186. _CRTIMP errno_t __cdecl _tcsset_s(char *_Str,size_t _SizeInChars,unsigned int _Val);
  187. _CRTIMP errno_t __cdecl _tcsset_s_l(char *_Str,size_t _SizeInChars,unsigned int,_locale_t _Locale);
  188. _CRTIMP char *__cdecl _tcsnccat_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
  189. _CRTIMP char *__cdecl _tcsnccat_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
  190. _CRTIMP char *__cdecl _tcsnccpy_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
  191. _CRTIMP char *__cdecl _tcsnccpy_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
  192. _CRTIMP char *__cdecl _tcslwr_s(char *_Str,size_t _SizeInChars);
  193. _CRTIMP char *__cdecl _tcslwr_s_l(char *_Str,size_t _SizeInChars,_locale_t _Locale);
  194. _CRTIMP char *__cdecl _tcsupr_s(char *_Str,size_t _SizeInChars);
  195. _CRTIMP char *__cdecl _tcsupr_s_l(char *_Str,size_t _SizeInChars,_locale_t _Locale);
  196. #endif
  197. #else
  198. #define _tcsncat_s strncat_s
  199. #define _tcsncat_s_l _strncat_s_l
  200. #define _tcsncpy_s strncpy_s
  201. #define _tcsncpy_s_l _strncpy_s_l
  202. #define _tcstok_s strtok_s
  203. #define _tcstok_s_l _strtok_s_l
  204. #define _tcsnset_s _strnset_s
  205. #define _tcsnset_s_l _strnset_s_l
  206. #define _tcsset_s _strset_s
  207. #define _tcsset_s _strset_s
  208. #define _tcsset_s_l _strset_s_l
  209. #define _tcsnccat_s strncat_s
  210. #define _tcsnccat_s_l _strncat_s_l
  211. #define _tcsnccpy_s strncpy_s
  212. #define _tcsnccpy_s_l _strncpy_s_l
  213. #define _tcslwr_s _strlwr_s
  214. #define _tcslwr_s_l _strlwr_s_l
  215. #define _tcsupr_s _strupr_s
  216. #define _tcsupr_s_l _strupr_s_l
  217. #define _strnset_s_l(_Destination,_Destination_size_chars,_Value,_Count,_Locale) (_strnset_s(_Destination,_Destination_size_chars,_Value,_Count))
  218. #define _strset_s_l(_Destination,_Destination_size_chars,_Value,_Locale) (_strset_s(_Destination,_Destination_size_chars,_Value))
  219. #endif
  220. #endif
  221. #ifdef __cplusplus
  222. }
  223. #endif
  224. #endif
  225. #endif