wchar.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. #ifndef _WCHAR_H
  2. #define _WCHAR_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #define __NEED_FILE
  8. #define __NEED___isoc_va_list
  9. #define __NEED_size_t
  10. #define __NEED_wchar_t
  11. #define __NEED_wint_t
  12. #define __NEED_mbstate_t
  13. #if __STDC_VERSION__ < 201112L
  14. #define __NEED_struct__IO_FILE
  15. #endif
  16. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  17. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  18. #define __NEED_locale_t
  19. #define __NEED_va_list
  20. #endif
  21. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  22. #define __NEED_wctype_t
  23. #endif
  24. #include <bits/alltypes.h>
  25. #if L'\0'-1 > 0
  26. #define WCHAR_MAX (0xffffffffu+L'\0')
  27. #define WCHAR_MIN (0+L'\0')
  28. #else
  29. #define WCHAR_MAX (0x7fffffff+L'\0')
  30. #define WCHAR_MIN (-1-0x7fffffff+L'\0')
  31. #endif
  32. #if __cplusplus >= 201103L
  33. #define NULL nullptr
  34. #elif defined(__cplusplus)
  35. #define NULL 0L
  36. #else
  37. #define NULL ((void*)0)
  38. #endif
  39. #undef WEOF
  40. #define WEOF 0xffffffffU
  41. wchar_t *wcscpy (wchar_t *__restrict, const wchar_t *__restrict);
  42. wchar_t *wcsncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
  43. wchar_t *wcscat (wchar_t *__restrict, const wchar_t *__restrict);
  44. wchar_t *wcsncat (wchar_t *__restrict, const wchar_t *__restrict, size_t);
  45. int wcscmp (const wchar_t *, const wchar_t *);
  46. int wcsncmp (const wchar_t *, const wchar_t *, size_t);
  47. int wcscoll(const wchar_t *, const wchar_t *);
  48. size_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, size_t);
  49. wchar_t *wcschr (const wchar_t *, wchar_t);
  50. wchar_t *wcsrchr (const wchar_t *, wchar_t);
  51. size_t wcscspn (const wchar_t *, const wchar_t *);
  52. size_t wcsspn (const wchar_t *, const wchar_t *);
  53. wchar_t *wcspbrk (const wchar_t *, const wchar_t *);
  54. wchar_t *wcstok (wchar_t *__restrict, const wchar_t *__restrict, wchar_t **__restrict);
  55. size_t wcslen (const wchar_t *);
  56. wchar_t *wcsstr (const wchar_t *__restrict, const wchar_t *__restrict);
  57. wchar_t *wcswcs (const wchar_t *, const wchar_t *);
  58. wchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
  59. int wmemcmp (const wchar_t *, const wchar_t *, size_t);
  60. wchar_t *wmemcpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
  61. wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
  62. wchar_t *wmemset (wchar_t *, wchar_t, size_t);
  63. wint_t btowc (int);
  64. int wctob (wint_t);
  65. int mbsinit (const mbstate_t *);
  66. size_t mbrtowc (wchar_t *__restrict, const char *__restrict, size_t, mbstate_t *__restrict);
  67. size_t wcrtomb (char *__restrict, wchar_t, mbstate_t *__restrict);
  68. size_t mbrlen (const char *__restrict, size_t, mbstate_t *__restrict);
  69. size_t mbsrtowcs (wchar_t *__restrict, const char **__restrict, size_t, mbstate_t *__restrict);
  70. size_t wcsrtombs (char *__restrict, const wchar_t **__restrict, size_t, mbstate_t *__restrict);
  71. float wcstof (const wchar_t *__restrict, wchar_t **__restrict);
  72. double wcstod (const wchar_t *__restrict, wchar_t **__restrict);
  73. long double wcstold (const wchar_t *__restrict, wchar_t **__restrict);
  74. long wcstol (const wchar_t *__restrict, wchar_t **__restrict, int);
  75. unsigned long wcstoul (const wchar_t *__restrict, wchar_t **__restrict, int);
  76. long long wcstoll (const wchar_t *__restrict, wchar_t **__restrict, int);
  77. unsigned long long wcstoull (const wchar_t *__restrict, wchar_t **__restrict, int);
  78. int fwide (FILE *, int);
  79. int wprintf (const wchar_t *__restrict, ...);
  80. int fwprintf (FILE *__restrict, const wchar_t *__restrict, ...);
  81. int swprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, ...);
  82. int vwprintf (const wchar_t *__restrict, __isoc_va_list);
  83. int vfwprintf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list);
  84. int vswprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, __isoc_va_list);
  85. int wscanf (const wchar_t *__restrict, ...);
  86. int fwscanf (FILE *__restrict, const wchar_t *__restrict, ...);
  87. int swscanf (const wchar_t *__restrict, const wchar_t *__restrict, ...);
  88. int vwscanf (const wchar_t *__restrict, __isoc_va_list);
  89. int vfwscanf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list);
  90. int vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, __isoc_va_list);
  91. wint_t fgetwc (FILE *);
  92. wint_t getwc (FILE *);
  93. wint_t getwchar (void);
  94. wint_t fputwc (wchar_t, FILE *);
  95. wint_t putwc (wchar_t, FILE *);
  96. wint_t putwchar (wchar_t);
  97. wchar_t *fgetws (wchar_t *__restrict, int, FILE *__restrict);
  98. int fputws (const wchar_t *__restrict, FILE *__restrict);
  99. wint_t ungetwc (wint_t, FILE *);
  100. struct tm;
  101. size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict);
  102. #undef iswdigit
  103. #if defined(_GNU_SOURCE)
  104. wint_t fgetwc_unlocked (FILE *);
  105. wint_t getwc_unlocked (FILE *);
  106. wint_t getwchar_unlocked (void);
  107. wint_t fputwc_unlocked (wchar_t, FILE *);
  108. wint_t putwc_unlocked (wchar_t, FILE *);
  109. wint_t putwchar_unlocked (wchar_t);
  110. wchar_t *fgetws_unlocked (wchar_t *__restrict, int, FILE *__restrict);
  111. int fputws_unlocked (const wchar_t *__restrict, FILE *__restrict);
  112. #endif
  113. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  114. size_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t);
  115. #endif
  116. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  117. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  118. FILE *open_wmemstream(wchar_t **, size_t *);
  119. size_t mbsnrtowcs(wchar_t *__restrict, const char **__restrict, size_t, size_t, mbstate_t *__restrict);
  120. size_t wcsnrtombs(char *__restrict, const wchar_t **__restrict, size_t, size_t, mbstate_t *__restrict);
  121. wchar_t *wcsdup(const wchar_t *);
  122. size_t wcsnlen (const wchar_t *, size_t);
  123. wchar_t *wcpcpy (wchar_t *__restrict, const wchar_t *__restrict);
  124. wchar_t *wcpncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t);
  125. int wcscasecmp(const wchar_t *, const wchar_t *);
  126. int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
  127. int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
  128. int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
  129. int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
  130. size_t wcsxfrm_l(wchar_t *__restrict, const wchar_t *__restrict, size_t, locale_t);
  131. #endif
  132. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  133. int wcwidth (wchar_t);
  134. int wcswidth (const wchar_t *, size_t);
  135. int iswalnum(wint_t);
  136. int iswalpha(wint_t);
  137. int iswblank(wint_t);
  138. int iswcntrl(wint_t);
  139. int iswdigit(wint_t);
  140. int iswgraph(wint_t);
  141. int iswlower(wint_t);
  142. int iswprint(wint_t);
  143. int iswpunct(wint_t);
  144. int iswspace(wint_t);
  145. int iswupper(wint_t);
  146. int iswxdigit(wint_t);
  147. int iswctype(wint_t, wctype_t);
  148. wint_t towlower(wint_t);
  149. wint_t towupper(wint_t);
  150. wctype_t wctype(const char *);
  151. #ifndef __cplusplus
  152. #undef iswdigit
  153. #define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10)
  154. #endif
  155. #endif
  156. #ifdef __cplusplus
  157. }
  158. #endif
  159. #endif