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.

808 lines
24 KiB

  1. /***
  2. *wchar.h - declarations for wide character functions
  3. *
  4. * Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file contains the types, macros and function declarations for
  8. * all wide character-related functions. They may also be declared in
  9. * individual header files on a functional basis.
  10. * [ISO]
  11. *
  12. * Note: keep in sync with ctype.h, stdio.h, stdlib.h, string.h, time.h.
  13. *
  14. * [Public]
  15. *
  16. ****/
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif
  20. #ifndef _INC_WCHAR
  21. #define _INC_WCHAR
  22. #if !defined(_WIN32)
  23. #error ERROR: Only Win32 target supported!
  24. #endif
  25. #ifdef _MSC_VER
  26. #pragma pack(push,8)
  27. #endif /* _MSC_VER */
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if !defined(_W64)
  32. #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
  33. #define _W64 __w64
  34. #else
  35. #define _W64
  36. #endif
  37. #endif
  38. /* Define _CRTIMP */
  39. #ifndef _CRTIMP
  40. #ifdef _DLL
  41. #define _CRTIMP __declspec(dllimport)
  42. #else /* ndef _DLL */
  43. #define _CRTIMP
  44. #endif /* _DLL */
  45. #endif /* _CRTIMP */
  46. /* Define _CRTIMP */
  47. #ifndef _CRTIMP
  48. #if defined(_DLL) && !defined(_STATIC_CPPLIB)
  49. #define _CRTIMP __declspec(dllimport)
  50. #else /* ndef _DLL && !STATIC_CPPLIB */
  51. #define _CRTIMP
  52. #endif /* _DLL && !STATIC_CPPLIB */
  53. #endif /* _CRTIMP */
  54. /* Define __cdecl for non-Microsoft compilers */
  55. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  56. #define __cdecl
  57. #endif
  58. #ifndef _SIZE_T_DEFINED
  59. #ifdef _WIN64
  60. typedef unsigned __int64 size_t;
  61. #else
  62. typedef _W64 unsigned int size_t;
  63. #endif
  64. #define _SIZE_T_DEFINED
  65. #endif
  66. #ifndef _TIME_T_DEFINED
  67. #ifdef _WIN64
  68. typedef __int64 time_t; /* time value */
  69. #else
  70. typedef _W64 long time_t; /* time value */
  71. #endif
  72. #define _TIME_T_DEFINED /* avoid multiple def's of time_t */
  73. #endif
  74. #ifndef _TIME64_T_DEFINED
  75. #if _INTEGRAL_MAX_BITS >= 64
  76. typedef __int64 __time64_t; /* 64-bit time value */
  77. #endif
  78. #define _TIME64_T_DEFINED
  79. #endif
  80. #ifndef _INTPTR_T_DEFINED
  81. #ifdef _WIN64
  82. typedef __int64 intptr_t;
  83. #else
  84. typedef _W64 int intptr_t;
  85. #endif
  86. #define _INTPTR_T_DEFINED
  87. #endif
  88. #ifndef _WCHAR_T_DEFINED
  89. typedef unsigned short wchar_t;
  90. #define _WCHAR_T_DEFINED
  91. #endif
  92. #define WCHAR_MIN 0
  93. #define WCHAR_MAX ((wchar_t)-1)
  94. #ifndef _WCTYPE_T_DEFINED
  95. typedef unsigned short wint_t;
  96. typedef unsigned short wctype_t;
  97. #define _WCTYPE_T_DEFINED
  98. #endif
  99. #ifndef _VA_LIST_DEFINED
  100. #ifdef _M_ALPHA
  101. typedef struct {
  102. char *a0; /* pointer to first homed integer argument */
  103. int offset; /* byte offset of next parameter */
  104. } va_list;
  105. #else
  106. typedef char * va_list;
  107. #endif
  108. #define _VA_LIST_DEFINED
  109. #endif
  110. #ifndef WEOF
  111. #define WEOF (wint_t)(0xFFFF)
  112. #endif
  113. #ifndef _FILE_DEFINED
  114. struct _iobuf {
  115. char *_ptr;
  116. int _cnt;
  117. char *_base;
  118. int _flag;
  119. int _file;
  120. int _charbuf;
  121. int _bufsiz;
  122. char *_tmpfname;
  123. };
  124. typedef struct _iobuf FILE;
  125. #define _FILE_DEFINED
  126. #endif
  127. /* Declare _iob[] array */
  128. #ifndef _STDIO_DEFINED
  129. _CRTIMP extern FILE _iob[];
  130. #endif /* _STDIO_DEFINED */
  131. #ifndef _FSIZE_T_DEFINED
  132. typedef unsigned long _fsize_t; /* Could be 64 bits for Win32 */
  133. #define _FSIZE_T_DEFINED
  134. #endif
  135. #ifndef _WFINDDATA_T_DEFINED
  136. struct _wfinddata_t {
  137. unsigned attrib;
  138. time_t time_create; /* -1 for FAT file systems */
  139. time_t time_access; /* -1 for FAT file systems */
  140. time_t time_write;
  141. _fsize_t size;
  142. wchar_t name[260];
  143. };
  144. #if _INTEGRAL_MAX_BITS >= 64
  145. struct _wfinddatai64_t {
  146. unsigned attrib;
  147. time_t time_create; /* -1 for FAT file systems */
  148. time_t time_access; /* -1 for FAT file systems */
  149. time_t time_write;
  150. __int64 size;
  151. wchar_t name[260];
  152. };
  153. struct __wfinddata64_t {
  154. unsigned attrib;
  155. __time64_t time_create; /* -1 for FAT file systems */
  156. __time64_t time_access; /* -1 for FAT file systems */
  157. __time64_t time_write;
  158. __int64 size;
  159. wchar_t name[260];
  160. };
  161. #endif
  162. #define _WFINDDATA_T_DEFINED
  163. #endif
  164. /* define NULL pointer value */
  165. #ifndef NULL
  166. #ifdef __cplusplus
  167. #define NULL 0
  168. #else
  169. #define NULL ((void *)0)
  170. #endif
  171. #endif
  172. #ifndef _CTYPE_DISABLE_MACROS
  173. _CRTIMP extern const unsigned short _ctype[];
  174. _CRTIMP extern const unsigned short _wctype[];
  175. _CRTIMP extern const unsigned short *_pctype;
  176. _CRTIMP extern const wctype_t *_pwctype;
  177. #endif /* _CTYPE_DISABLE_MACROS */
  178. /* set bit masks for the possible character types */
  179. #define _UPPER 0x1 /* upper case letter */
  180. #define _LOWER 0x2 /* lower case letter */
  181. #define _DIGIT 0x4 /* digit[0-9] */
  182. #define _SPACE 0x8 /* tab, carriage return, newline, */
  183. /* vertical tab or form feed */
  184. #define _PUNCT 0x10 /* punctuation character */
  185. #define _CONTROL 0x20 /* control character */
  186. #define _BLANK 0x40 /* space char */
  187. #define _HEX 0x80 /* hexadecimal digit */
  188. #define _LEADBYTE 0x8000 /* multibyte leadbyte */
  189. #define _ALPHA (0x0100|_UPPER|_LOWER) /* alphabetic character */
  190. /* Function prototypes */
  191. #ifndef _WCTYPE_DEFINED
  192. /* Character classification function prototypes */
  193. /* also declared in ctype.h */
  194. _CRTIMP int __cdecl iswalpha(wint_t);
  195. _CRTIMP int __cdecl iswupper(wint_t);
  196. _CRTIMP int __cdecl iswlower(wint_t);
  197. _CRTIMP int __cdecl iswdigit(wint_t);
  198. _CRTIMP int __cdecl iswxdigit(wint_t);
  199. _CRTIMP int __cdecl iswspace(wint_t);
  200. _CRTIMP int __cdecl iswpunct(wint_t);
  201. _CRTIMP int __cdecl iswalnum(wint_t);
  202. _CRTIMP int __cdecl iswprint(wint_t);
  203. _CRTIMP int __cdecl iswgraph(wint_t);
  204. _CRTIMP int __cdecl iswcntrl(wint_t);
  205. _CRTIMP int __cdecl iswascii(wint_t);
  206. _CRTIMP int __cdecl isleadbyte(int);
  207. _CRTIMP wchar_t __cdecl towupper(wchar_t);
  208. _CRTIMP wchar_t __cdecl towlower(wchar_t);
  209. _CRTIMP int __cdecl iswctype(wint_t, wctype_t);
  210. /* --------- The following functions are OBSOLETE --------- */
  211. _CRTIMP int __cdecl is_wctype(wint_t, wctype_t);
  212. /* --------- The preceding functions are OBSOLETE --------- */
  213. #define _WCTYPE_DEFINED
  214. #endif
  215. #ifndef _WDIRECT_DEFINED
  216. /* also declared in direct.h */
  217. _CRTIMP int __cdecl _wchdir(const wchar_t *);
  218. _CRTIMP wchar_t * __cdecl _wgetcwd(wchar_t *, int);
  219. _CRTIMP wchar_t * __cdecl _wgetdcwd(int, wchar_t *, int);
  220. _CRTIMP int __cdecl _wmkdir(const wchar_t *);
  221. _CRTIMP int __cdecl _wrmdir(const wchar_t *);
  222. #define _WDIRECT_DEFINED
  223. #endif
  224. #ifndef _WIO_DEFINED
  225. /* also declared in io.h */
  226. _CRTIMP int __cdecl _waccess(const wchar_t *, int);
  227. _CRTIMP int __cdecl _wchmod(const wchar_t *, int);
  228. _CRTIMP int __cdecl _wcreat(const wchar_t *, int);
  229. _CRTIMP intptr_t __cdecl _wfindfirst(wchar_t *, struct _wfinddata_t *);
  230. _CRTIMP int __cdecl _wfindnext(intptr_t, struct _wfinddata_t *);
  231. _CRTIMP int __cdecl _wunlink(const wchar_t *);
  232. _CRTIMP int __cdecl _wrename(const wchar_t *, const wchar_t *);
  233. _CRTIMP int __cdecl _wopen(const wchar_t *, int, ...);
  234. _CRTIMP int __cdecl _wsopen(const wchar_t *, int, int, ...);
  235. _CRTIMP wchar_t * __cdecl _wmktemp(wchar_t *);
  236. #if _INTEGRAL_MAX_BITS >= 64
  237. _CRTIMP intptr_t __cdecl _wfindfirsti64(wchar_t *, struct _wfinddatai64_t *);
  238. _CRTIMP intptr_t __cdecl _wfindfirst64(wchar_t *, struct __wfinddata64_t *);
  239. _CRTIMP int __cdecl _wfindnexti64(intptr_t, struct _wfinddatai64_t *);
  240. _CRTIMP int __cdecl _wfindnext64(intptr_t, struct __wfinddata64_t *);
  241. #endif
  242. #define _WIO_DEFINED
  243. #endif
  244. #ifndef _WLOCALE_DEFINED
  245. /* wide function prototypes, also declared in wchar.h */
  246. _CRTIMP wchar_t * __cdecl _wsetlocale(int, const wchar_t *);
  247. #define _WLOCALE_DEFINED
  248. #endif
  249. #ifndef _WPROCESS_DEFINED
  250. /* also declared in process.h */
  251. _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *, const wchar_t *, ...);
  252. _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *, const wchar_t *, ...);
  253. _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *, const wchar_t *, ...);
  254. _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *, const wchar_t *, ...);
  255. _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *, const wchar_t * const *);
  256. _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *, const wchar_t * const *, const wchar_t * const *);
  257. _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *, const wchar_t * const *);
  258. _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *, const wchar_t * const *, const wchar_t * const *);
  259. _CRTIMP intptr_t __cdecl _wspawnl(int, const wchar_t *, const wchar_t *, ...);
  260. _CRTIMP intptr_t __cdecl _wspawnle(int, const wchar_t *, const wchar_t *, ...);
  261. _CRTIMP intptr_t __cdecl _wspawnlp(int, const wchar_t *, const wchar_t *, ...);
  262. _CRTIMP intptr_t __cdecl _wspawnlpe(int, const wchar_t *, const wchar_t *, ...);
  263. _CRTIMP intptr_t __cdecl _wspawnv(int, const wchar_t *, const wchar_t * const *);
  264. _CRTIMP intptr_t __cdecl _wspawnve(int, const wchar_t *, const wchar_t * const *,
  265. const wchar_t * const *);
  266. _CRTIMP intptr_t __cdecl _wspawnvp(int, const wchar_t *, const wchar_t * const *);
  267. _CRTIMP intptr_t __cdecl _wspawnvpe(int, const wchar_t *, const wchar_t * const *,
  268. const wchar_t * const *);
  269. _CRTIMP int __cdecl _wsystem(const wchar_t *);
  270. #define _WPROCESS_DEFINED
  271. #endif
  272. #ifndef _WCTYPE_INLINE_DEFINED
  273. #ifndef __cplusplus
  274. #define iswalpha(_c) ( iswctype(_c,_ALPHA) )
  275. #define iswupper(_c) ( iswctype(_c,_UPPER) )
  276. #define iswlower(_c) ( iswctype(_c,_LOWER) )
  277. #define iswdigit(_c) ( iswctype(_c,_DIGIT) )
  278. #define iswxdigit(_c) ( iswctype(_c,_HEX) )
  279. #define iswspace(_c) ( iswctype(_c,_SPACE) )
  280. #define iswpunct(_c) ( iswctype(_c,_PUNCT) )
  281. #define iswalnum(_c) ( iswctype(_c,_ALPHA|_DIGIT) )
  282. #define iswprint(_c) ( iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT) )
  283. #define iswgraph(_c) ( iswctype(_c,_PUNCT|_ALPHA|_DIGIT) )
  284. #define iswcntrl(_c) ( iswctype(_c,_CONTROL) )
  285. #define iswascii(_c) ( (unsigned)(_c) < 0x80 )
  286. #ifndef _CTYPE_DISABLE_MACROS
  287. #define isleadbyte(_c) (_pctype[(unsigned char)(_c)] & _LEADBYTE)
  288. #endif /* _CTYPE_DISABLE_MACROS */
  289. #else /* __cplusplus */
  290. inline int __cdecl iswalpha(wint_t _C) {return (iswctype(_C,_ALPHA)); }
  291. inline int __cdecl iswupper(wint_t _C) {return (iswctype(_C,_UPPER)); }
  292. inline int __cdecl iswlower(wint_t _C) {return (iswctype(_C,_LOWER)); }
  293. inline int __cdecl iswdigit(wint_t _C) {return (iswctype(_C,_DIGIT)); }
  294. inline int __cdecl iswxdigit(wint_t _C) {return (iswctype(_C,_HEX)); }
  295. inline int __cdecl iswspace(wint_t _C) {return (iswctype(_C,_SPACE)); }
  296. inline int __cdecl iswpunct(wint_t _C) {return (iswctype(_C,_PUNCT)); }
  297. inline int __cdecl iswalnum(wint_t _C) {return (iswctype(_C,_ALPHA|_DIGIT)); }
  298. inline int __cdecl iswprint(wint_t _C)
  299. {return (iswctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)); }
  300. inline int __cdecl iswgraph(wint_t _C)
  301. {return (iswctype(_C,_PUNCT|_ALPHA|_DIGIT)); }
  302. inline int __cdecl iswcntrl(wint_t _C) {return (iswctype(_C,_CONTROL)); }
  303. inline int __cdecl iswascii(wint_t _C) {return ((unsigned)(_C) < 0x80); }
  304. #ifndef _CTYPE_DISABLE_MACROS
  305. inline int __cdecl isleadbyte(int _C)
  306. {return (_pctype[(unsigned char)(_C)] & _LEADBYTE); }
  307. #endif /* _CTYPE_DISABLE_MACROS */
  308. #endif /* __cplusplus */
  309. #define _WCTYPE_INLINE_DEFINED
  310. #endif /* _WCTYPE_INLINE_DEFINED */
  311. #ifndef _POSIX_
  312. /* define structure for returning status information */
  313. #ifndef _INO_T_DEFINED
  314. typedef unsigned short _ino_t; /* i-node number (not used on DOS) */
  315. #if !__STDC__
  316. /* Non-ANSI name for compatibility */
  317. typedef unsigned short ino_t;
  318. #endif
  319. #define _INO_T_DEFINED
  320. #endif
  321. #ifndef _DEV_T_DEFINED
  322. typedef unsigned int _dev_t; /* device code */
  323. #if !__STDC__
  324. /* Non-ANSI name for compatibility */
  325. typedef unsigned int dev_t;
  326. #endif
  327. #define _DEV_T_DEFINED
  328. #endif
  329. #ifndef _OFF_T_DEFINED
  330. typedef long _off_t; /* file offset value */
  331. #if !__STDC__
  332. /* Non-ANSI name for compatibility */
  333. typedef long off_t;
  334. #endif
  335. #define _OFF_T_DEFINED
  336. #endif
  337. #ifndef _STAT_DEFINED
  338. struct _stat {
  339. _dev_t st_dev;
  340. _ino_t st_ino;
  341. unsigned short st_mode;
  342. short st_nlink;
  343. short st_uid;
  344. short st_gid;
  345. _dev_t st_rdev;
  346. _off_t st_size;
  347. time_t st_atime;
  348. time_t st_mtime;
  349. time_t st_ctime;
  350. };
  351. #if !__STDC__
  352. /* Non-ANSI names for compatibility */
  353. struct stat {
  354. _dev_t st_dev;
  355. _ino_t st_ino;
  356. unsigned short st_mode;
  357. short st_nlink;
  358. short st_uid;
  359. short st_gid;
  360. _dev_t st_rdev;
  361. _off_t st_size;
  362. time_t st_atime;
  363. time_t st_mtime;
  364. time_t st_ctime;
  365. };
  366. #endif /* __STDC__ */
  367. #if _INTEGRAL_MAX_BITS >= 64
  368. struct _stati64 {
  369. _dev_t st_dev;
  370. _ino_t st_ino;
  371. unsigned short st_mode;
  372. short st_nlink;
  373. short st_uid;
  374. short st_gid;
  375. _dev_t st_rdev;
  376. __int64 st_size;
  377. time_t st_atime;
  378. time_t st_mtime;
  379. time_t st_ctime;
  380. };
  381. struct __stat64 {
  382. _dev_t st_dev;
  383. _ino_t st_ino;
  384. unsigned short st_mode;
  385. short st_nlink;
  386. short st_uid;
  387. short st_gid;
  388. _dev_t st_rdev;
  389. __int64 st_size;
  390. __time64_t st_atime;
  391. __time64_t st_mtime;
  392. __time64_t st_ctime;
  393. };
  394. #endif
  395. #define _STAT_DEFINED
  396. #endif
  397. #ifndef _WSTAT_DEFINED
  398. /* also declared in stat.h */
  399. _CRTIMP int __cdecl _wstat(const wchar_t *, struct _stat *);
  400. #if _INTEGRAL_MAX_BITS >= 64
  401. _CRTIMP int __cdecl _wstati64(const wchar_t *, struct _stati64 *);
  402. _CRTIMP int __cdecl _wstat64(const wchar_t *, struct __stat64 *);
  403. #endif
  404. #define _WSTAT_DEFINED
  405. #endif
  406. #endif /* !_POSIX_ */
  407. #ifndef _WCONIO_DEFINED
  408. _CRTIMP wchar_t * __cdecl _cgetws(wchar_t *);
  409. _CRTIMP wint_t __cdecl _getwch(void);
  410. _CRTIMP wint_t __cdecl _getwche(void);
  411. _CRTIMP wint_t __cdecl _putwch(wchar_t);
  412. _CRTIMP wint_t __cdecl _ungetwch(wint_t);
  413. _CRTIMP int __cdecl _cputws(const wchar_t *);
  414. _CRTIMP int __cdecl _cwprintf(const wchar_t *, ...);
  415. _CRTIMP int __cdecl _cwscanf(const wchar_t *, ...);
  416. #define _WCONIO_DEFINED
  417. #endif
  418. #ifndef _WSTDIO_DEFINED
  419. /* also declared in stdio.h */
  420. #ifdef _POSIX_
  421. _CRTIMP FILE * __cdecl _wfsopen(const wchar_t *, const wchar_t *);
  422. #else
  423. _CRTIMP FILE * __cdecl _wfsopen(const wchar_t *, const wchar_t *, int);
  424. #endif
  425. _CRTIMP wint_t __cdecl fgetwc(FILE *);
  426. _CRTIMP wint_t __cdecl _fgetwchar(void);
  427. _CRTIMP wint_t __cdecl fputwc(wchar_t, FILE *);
  428. _CRTIMP wint_t __cdecl _fputwchar(wchar_t);
  429. _CRTIMP wint_t __cdecl getwc(FILE *);
  430. _CRTIMP wint_t __cdecl getwchar(void);
  431. _CRTIMP wint_t __cdecl putwc(wchar_t, FILE *);
  432. _CRTIMP wint_t __cdecl putwchar(wchar_t);
  433. _CRTIMP wint_t __cdecl ungetwc(wint_t, FILE *);
  434. _CRTIMP wchar_t * __cdecl fgetws(wchar_t *, int, FILE *);
  435. _CRTIMP int __cdecl fputws(const wchar_t *, FILE *);
  436. _CRTIMP wchar_t * __cdecl _getws(wchar_t *);
  437. _CRTIMP int __cdecl _putws(const wchar_t *);
  438. _CRTIMP int __cdecl fwprintf(FILE *, const wchar_t *, ...);
  439. _CRTIMP int __cdecl wprintf(const wchar_t *, ...);
  440. _CRTIMP int __cdecl _snwprintf(wchar_t *, size_t, const wchar_t *, ...);
  441. _CRTIMP int __cdecl swprintf(wchar_t *, const wchar_t *, ...);
  442. _CRTIMP int __cdecl _scwprintf(const wchar_t *, ...);
  443. _CRTIMP int __cdecl vfwprintf(FILE *, const wchar_t *, va_list);
  444. _CRTIMP int __cdecl vwprintf(const wchar_t *, va_list);
  445. _CRTIMP int __cdecl _vsnwprintf(wchar_t *, size_t, const wchar_t *, va_list);
  446. _CRTIMP int __cdecl vswprintf(wchar_t *, const wchar_t *, va_list);
  447. _CRTIMP int __cdecl _vscwprintf(const wchar_t *, va_list);
  448. _CRTIMP int __cdecl fwscanf(FILE *, const wchar_t *, ...);
  449. _CRTIMP int __cdecl swscanf(const wchar_t *, const wchar_t *, ...);
  450. _CRTIMP int __cdecl _snwscanf(const wchar_t *, size_t, const wchar_t *, ...);
  451. _CRTIMP int __cdecl wscanf(const wchar_t *, ...);
  452. #ifndef __cplusplus
  453. #define getwchar() fgetwc(stdin)
  454. #define putwchar(_c) fputwc((_c),stdout)
  455. #else /* __cplusplus */
  456. inline wint_t __cdecl getwchar()
  457. {return (fgetwc(&_iob[0])); } // stdin
  458. inline wint_t __cdecl putwchar(wchar_t _C)
  459. {return (fputwc(_C, &_iob[1])); } // stdout
  460. #endif /* __cplusplus */
  461. #define getwc(_stm) fgetwc(_stm)
  462. #define putwc(_c,_stm) fputwc(_c,_stm)
  463. _CRTIMP FILE * __cdecl _wfdopen(int, const wchar_t *);
  464. _CRTIMP FILE * __cdecl _wfopen(const wchar_t *, const wchar_t *);
  465. _CRTIMP FILE * __cdecl _wfreopen(const wchar_t *, const wchar_t *, FILE *);
  466. _CRTIMP void __cdecl _wperror(const wchar_t *);
  467. _CRTIMP FILE * __cdecl _wpopen(const wchar_t *, const wchar_t *);
  468. _CRTIMP int __cdecl _wremove(const wchar_t *);
  469. _CRTIMP wchar_t * __cdecl _wtempnam(const wchar_t *, const wchar_t *);
  470. _CRTIMP wchar_t * __cdecl _wtmpnam(wchar_t *);
  471. #define _WSTDIO_DEFINED
  472. #endif
  473. #ifndef _WSTDLIB_DEFINED
  474. /* also declared in stdlib.h */
  475. _CRTIMP wchar_t * __cdecl _itow (int, wchar_t *, int);
  476. _CRTIMP wchar_t * __cdecl _ltow (long, wchar_t *, int);
  477. _CRTIMP wchar_t * __cdecl _ultow (unsigned long, wchar_t *, int);
  478. _CRTIMP double __cdecl wcstod(const wchar_t *, wchar_t **);
  479. _CRTIMP long __cdecl wcstol(const wchar_t *, wchar_t **, int);
  480. _CRTIMP unsigned long __cdecl wcstoul(const wchar_t *, wchar_t **, int);
  481. _CRTIMP wchar_t * __cdecl _wgetenv(const wchar_t *);
  482. _CRTIMP int __cdecl _wsystem(const wchar_t *);
  483. _CRTIMP double __cdecl _wtof(const wchar_t *);
  484. _CRTIMP int __cdecl _wtoi(const wchar_t *);
  485. _CRTIMP long __cdecl _wtol(const wchar_t *);
  486. #if _INTEGRAL_MAX_BITS >= 64
  487. _CRTIMP wchar_t * __cdecl _i64tow(__int64, wchar_t *, int);
  488. _CRTIMP wchar_t * __cdecl _ui64tow(unsigned __int64, wchar_t *, int);
  489. _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *);
  490. _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *, wchar_t **, int);
  491. _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *, wchar_t **, int);
  492. #endif
  493. #define _WSTDLIB_DEFINED
  494. #endif
  495. #ifndef _POSIX_
  496. #ifndef _WSTDLIBP_DEFINED
  497. /* also declared in stdlib.h */
  498. _CRTIMP wchar_t * __cdecl _wfullpath(wchar_t *, const wchar_t *, size_t);
  499. _CRTIMP void __cdecl _wmakepath(wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *,
  500. const wchar_t *);
  501. _CRTIMP void __cdecl _wperror(const wchar_t *);
  502. _CRTIMP int __cdecl _wputenv(const wchar_t *);
  503. _CRTIMP void __cdecl _wsearchenv(const wchar_t *, const wchar_t *, wchar_t *);
  504. _CRTIMP void __cdecl _wsplitpath(const wchar_t *, wchar_t *, wchar_t *, wchar_t *, wchar_t *);
  505. #define _WSTDLIBP_DEFINED
  506. #endif
  507. #endif /* _POSIX_ */
  508. #ifndef _WSTRING_DEFINED
  509. /* also declared in string.h */
  510. #ifdef __cplusplus
  511. #define _WConst_return const
  512. #else
  513. #define _WConst_return
  514. #endif
  515. _CRTIMP wchar_t * __cdecl wcscat(wchar_t *, const wchar_t *);
  516. _CRTIMP _WConst_return wchar_t * __cdecl wcschr(const wchar_t *, wchar_t);
  517. _CRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *);
  518. _CRTIMP wchar_t * __cdecl wcscpy(wchar_t *, const wchar_t *);
  519. _CRTIMP size_t __cdecl wcscspn(const wchar_t *, const wchar_t *);
  520. _CRTIMP size_t __cdecl wcslen(const wchar_t *);
  521. _CRTIMP wchar_t * __cdecl wcsncat(wchar_t *, const wchar_t *, size_t);
  522. _CRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t);
  523. _CRTIMP wchar_t * __cdecl wcsncpy(wchar_t *, const wchar_t *, size_t);
  524. _CRTIMP _WConst_return wchar_t * __cdecl wcspbrk(const wchar_t *, const wchar_t *);
  525. _CRTIMP _WConst_return wchar_t * __cdecl wcsrchr(const wchar_t *, wchar_t);
  526. _CRTIMP size_t __cdecl wcsspn(const wchar_t *, const wchar_t *);
  527. _CRTIMP _WConst_return wchar_t * __cdecl wcsstr(const wchar_t *, const wchar_t *);
  528. _CRTIMP wchar_t * __cdecl wcstok(wchar_t *, const wchar_t *);
  529. _CRTIMP wchar_t * __cdecl _wcserror(int);
  530. _CRTIMP wchar_t * __cdecl __wcserror(const wchar_t *);
  531. _CRTIMP wchar_t * __cdecl _wcsdup(const wchar_t *);
  532. _CRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *);
  533. _CRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t);
  534. _CRTIMP wchar_t * __cdecl _wcsnset(wchar_t *, wchar_t, size_t);
  535. _CRTIMP wchar_t * __cdecl _wcsrev(wchar_t *);
  536. _CRTIMP wchar_t * __cdecl _wcsset(wchar_t *, wchar_t);
  537. _CRTIMP wchar_t * __cdecl _wcslwr(wchar_t *);
  538. _CRTIMP wchar_t * __cdecl _wcsupr(wchar_t *);
  539. _CRTIMP size_t __cdecl wcsxfrm(wchar_t *, const wchar_t *, size_t);
  540. _CRTIMP int __cdecl wcscoll(const wchar_t *, const wchar_t *);
  541. _CRTIMP int __cdecl _wcsicoll(const wchar_t *, const wchar_t *);
  542. _CRTIMP int __cdecl _wcsncoll(const wchar_t *, const wchar_t *, size_t);
  543. _CRTIMP int __cdecl _wcsnicoll(const wchar_t *, const wchar_t *, size_t);
  544. #if !__STDC__
  545. /* old names */
  546. #define wcswcs wcsstr
  547. /* prototypes for oldnames.lib functions */
  548. _CRTIMP wchar_t * __cdecl wcsdup(const wchar_t *);
  549. _CRTIMP int __cdecl wcsicmp(const wchar_t *, const wchar_t *);
  550. _CRTIMP int __cdecl wcsnicmp(const wchar_t *, const wchar_t *, size_t);
  551. _CRTIMP wchar_t * __cdecl wcsnset(wchar_t *, wchar_t, size_t);
  552. _CRTIMP wchar_t * __cdecl wcsrev(wchar_t *);
  553. _CRTIMP wchar_t * __cdecl wcsset(wchar_t *, wchar_t);
  554. _CRTIMP wchar_t * __cdecl wcslwr(wchar_t *);
  555. _CRTIMP wchar_t * __cdecl wcsupr(wchar_t *);
  556. _CRTIMP int __cdecl wcsicoll(const wchar_t *, const wchar_t *);
  557. #endif /* !__STDC__ */
  558. #ifdef __cplusplus
  559. } /* end of extern "C" */
  560. extern "C++" {
  561. inline wchar_t *wcschr(wchar_t *_S, wchar_t _C)
  562. {return ((wchar_t *)wcschr((const wchar_t *)_S, _C)); }
  563. inline wchar_t *wcspbrk(wchar_t *_S, const wchar_t *_P)
  564. {return ((wchar_t *)wcspbrk((const wchar_t *)_S, _P)); }
  565. inline wchar_t *wcsrchr(wchar_t *_S, wchar_t _C)
  566. {return ((wchar_t *)wcsrchr((const wchar_t *)_S, _C)); }
  567. inline wchar_t *wcsstr(wchar_t *_S, const wchar_t *_P)
  568. {return ((wchar_t *)wcsstr((const wchar_t *)_S, _P)); }
  569. }
  570. extern "C" {
  571. #endif /* __cplusplus */
  572. #define _WSTRING_DEFINED
  573. #endif
  574. #ifndef _TM_DEFINED
  575. struct tm {
  576. int tm_sec; /* seconds after the minute - [0,59] */
  577. int tm_min; /* minutes after the hour - [0,59] */
  578. int tm_hour; /* hours since midnight - [0,23] */
  579. int tm_mday; /* day of the month - [1,31] */
  580. int tm_mon; /* months since January - [0,11] */
  581. int tm_year; /* years since 1900 */
  582. int tm_wday; /* days since Sunday - [0,6] */
  583. int tm_yday; /* days since January 1 - [0,365] */
  584. int tm_isdst; /* daylight savings time flag */
  585. };
  586. #define _TM_DEFINED
  587. #endif
  588. #ifndef _WTIME_DEFINED
  589. /* also declared in time.h */
  590. _CRTIMP wchar_t * __cdecl _wasctime(const struct tm *);
  591. _CRTIMP wchar_t * __cdecl _wctime(const time_t *);
  592. _CRTIMP size_t __cdecl wcsftime(wchar_t *, size_t, const wchar_t *,
  593. const struct tm *);
  594. _CRTIMP wchar_t * __cdecl _wstrdate(wchar_t *);
  595. _CRTIMP wchar_t * __cdecl _wstrtime(wchar_t *);
  596. #if _INTEGRAL_MAX_BITS >= 64
  597. _CRTIMP wchar_t * __cdecl _wctime64(const __time64_t *);
  598. #endif
  599. #define _WTIME_DEFINED
  600. #endif
  601. typedef int mbstate_t;
  602. typedef wchar_t _Wint_t;
  603. _CRTIMP wint_t __cdecl btowc(int);
  604. _CRTIMP size_t __cdecl mbrlen(const char *, size_t, mbstate_t *);
  605. _CRTIMP size_t __cdecl mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
  606. _CRTIMP size_t __cdecl mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);
  607. _CRTIMP size_t __cdecl wcrtomb(char *, wchar_t, mbstate_t *);
  608. _CRTIMP size_t __cdecl wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);
  609. _CRTIMP int __cdecl wctob(wint_t);
  610. #ifdef __cplusplus
  611. /* memcpy and memmove are defined just for use in wmemcpy and wmemmove */
  612. #if defined(_M_IA64) || defined(_M_ALPHA)
  613. void * __cdecl memmove(void *, const void *, size_t);
  614. #else
  615. _CRTIMP void * __cdecl memmove(void *, const void *, size_t);
  616. #endif
  617. void * __cdecl memcpy(void *, const void *, size_t);
  618. inline int fwide(FILE *, int _M)
  619. {return (_M); }
  620. inline int mbsinit(const mbstate_t *_P)
  621. {return (_P == NULL || *_P == 0); }
  622. inline const wchar_t *wmemchr(const wchar_t *_S, wchar_t _C, size_t _N)
  623. {for (; 0 < _N; ++_S, --_N)
  624. if (*_S == _C)
  625. return (_S);
  626. return (0); }
  627. inline int wmemcmp(const wchar_t *_S1, const wchar_t *_S2, size_t _N)
  628. {for (; 0 < _N; ++_S1, ++_S2, --_N)
  629. if (*_S1 != *_S2)
  630. return (*_S1 < *_S2 ? -1 : +1);
  631. return (0); }
  632. inline wchar_t *wmemcpy(wchar_t *_S1, const wchar_t *_S2, size_t _N)
  633. {
  634. return (wchar_t *)memcpy(_S1, _S2, _N*sizeof(wchar_t));
  635. }
  636. inline wchar_t *wmemmove(wchar_t *_S1, const wchar_t *_S2, size_t _N)
  637. {
  638. return (wchar_t *)memmove(_S1, _S2, _N*sizeof(wchar_t));
  639. }
  640. inline wchar_t *wmemset(wchar_t *_S, wchar_t _C, size_t _N)
  641. {wchar_t *_Su = _S;
  642. for (; 0 < _N; ++_Su, --_N)
  643. *_Su = _C;
  644. return (_S); }
  645. } /* end of extern "C" */
  646. extern "C++" {
  647. inline wchar_t *wmemchr(wchar_t *_S, wchar_t _C, size_t _N)
  648. {return ((wchar_t *)wmemchr((const wchar_t *)_S, _C, _N)); }
  649. }
  650. #endif
  651. #ifdef _MSC_VER
  652. #pragma pack(pop)
  653. #endif /* _MSC_VER */
  654. #endif /* _INC_WCHAR */