|
2 | 2 | #define _WCHAR_H |
3 | 3 |
|
4 | 4 | #include <__wchar_def.h> |
| 5 | +#include <stdio.h> |
| 6 | +#include <time.h> |
| 7 | + |
| 8 | +typedef struct { |
| 9 | + int __count; |
| 10 | + union { |
| 11 | + wint_t __value; |
| 12 | + unsigned char __bytes[sizeof(wint_t)]; |
| 13 | + }; |
| 14 | +} mbstate_t; |
5 | 15 |
|
6 | 16 | __BEGIN_DECLS |
7 | 17 |
|
@@ -65,6 +75,86 @@ int wcscmp(const wchar_t *s1, const wchar_t *s2) |
65 | 75 | int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n) |
66 | 76 | __attribute__((nonnull(1, 2))); |
67 | 77 |
|
| 78 | +int wprintf(const wchar_t *__restrict format, ...); |
| 79 | + |
| 80 | +int vwprintf(const wchar_t *__restrict format, va_list va); |
| 81 | + |
| 82 | +int swprintf(wchar_t *__restrict buffer, size_t count, const wchar_t *__restrict format, ...); |
| 83 | + |
| 84 | +int vswprintf(wchar_t *__restrict buffer, size_t count, const wchar_t *__restrict format, va_list va); |
| 85 | + |
| 86 | +int fwprintf(FILE *__restrict stream, const wchar_t *__restrict format, ...); |
| 87 | + |
| 88 | +int vfwprintf(FILE *__restrict stream, const wchar_t *__restrict format, va_list va); |
| 89 | + |
| 90 | +int wscanf(const wchar_t *__restrict format, ...); |
| 91 | + |
| 92 | +int vwscanf(const wchar_t *__restrict format, va_list arg); |
| 93 | + |
| 94 | +int swscanf(const wchar_t *__restrict s, const wchar_t *__restrict format, ...); |
| 95 | + |
| 96 | +int vswscanf(const wchar_t *__restrict s, const wchar_t *__restrict format, va_list arg); |
| 97 | + |
| 98 | +int fwscanf(FILE *__restrict stream, const wchar_t *__restrict format, ...); |
| 99 | + |
| 100 | +int vfwscanf(FILE *__restrict stream, const wchar_t *__restrict format, va_list arg); |
| 101 | + |
| 102 | +wint_t fgetwc(FILE *stream); |
| 103 | + |
| 104 | +wchar_t *fgetws(wchar_t *__restrict s, int n, FILE *__restrict stream); |
| 105 | + |
| 106 | +wint_t fputwc(wchar_t c, FILE *stream); |
| 107 | + |
| 108 | +int fputws(const wchar_t *__restrict s, FILE *__restrict stream); |
| 109 | + |
| 110 | +int fwide(FILE *stream, int mode); |
| 111 | + |
| 112 | +wint_t getwc(FILE *stream); |
| 113 | + |
| 114 | +wint_t getwchar(void); |
| 115 | + |
| 116 | +wint_t putwc(wchar_t c, FILE *stream); |
| 117 | + |
| 118 | +wint_t putwchar(wchar_t c); |
| 119 | + |
| 120 | +wint_t ungetwc(wint_t c, FILE *stream); |
| 121 | + |
| 122 | +float wcstof(const wchar_t *__restrict nptr, wchar_t * *__restrict endptr); |
| 123 | + |
| 124 | +double wcstod(const wchar_t *__restrict nptr, wchar_t **__restrict endptr); |
| 125 | + |
| 126 | +long double wcstold(const wchar_t *__restrict nptr, wchar_t **__restrict endptr); |
| 127 | + |
| 128 | +long wcstol(const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base); |
| 129 | + |
| 130 | +long long wcstoll(const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base); |
| 131 | + |
| 132 | +unsigned long wcstoul(const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base); |
| 133 | + |
| 134 | +unsigned long long wcstoull(const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base); |
| 135 | + |
| 136 | +size_t wcsftime(wchar_t *__restrict s, size_t maxsize, const wchar_t *__restrict format, const struct tm *__restrict timeptr); |
| 137 | + |
| 138 | +int wcscoll(const wchar_t* s1, const wchar_t* s2); |
| 139 | + |
| 140 | +size_t wcsxfrm(wchar_t *__restrict s1, const wchar_t *__restrict s2, size_t n); |
| 141 | + |
| 142 | +wint_t btowc(int c); |
| 143 | + |
| 144 | +int wctob(wint_t c); |
| 145 | + |
| 146 | +int mbsinit(const mbstate_t* ps); |
| 147 | + |
| 148 | +size_t mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps); |
| 149 | + |
| 150 | +size_t mbrtowc(wchar_t *__restrict pwc, const char *__restrict s, size_t n, mbstate_t *__restrict ps); |
| 151 | + |
| 152 | +size_t wcrtomb(char *__restrict s, wchar_t wc, mbstate_t *__restrict ps); |
| 153 | + |
| 154 | +size_t mbsrtowcs(wchar_t *__restrict dst, const char* *__restrict src, size_t len, mbstate_t *__restrict ps); |
| 155 | + |
| 156 | +size_t wcsrtombs(char *__restrict dst, const wchar_t **__restrict src, size_t len, mbstate_t *__restrict ps); |
| 157 | + |
68 | 158 | __END_DECLS |
69 | 159 |
|
70 | 160 | #endif /* _WCHAR_H */ |
0 commit comments