| 1 | /* The header wchar.h declares input and output operations on
|
|---|
| 2 | * wide streams or manipulate wide strings.
|
|---|
| 3 | */
|
|---|
| 4 | #ifndef _WCHAR_
|
|---|
| 5 | #define _WCHAR_
|
|---|
| 6 |
|
|---|
| 7 | #include <stdio.h> /* for FILE* */
|
|---|
| 8 | #include <stddef.h> /* two types defined in this header */
|
|---|
| 9 |
|
|---|
| 10 | /* Types */
|
|---|
| 11 | typedef struct mbstate_t mbstate_t;
|
|---|
| 12 | typedef long int wint_t;
|
|---|
| 13 | typedef struct wctype_t wctype_t;
|
|---|
| 14 |
|
|---|
| 15 | /* Macros */
|
|---|
| 16 | #ifndef NULL
|
|---|
| 17 | #define NULL 0
|
|---|
| 18 | #endif
|
|---|
| 19 |
|
|---|
| 20 | #ifndef WCHAR_MIN
|
|---|
| 21 | #define WCHAR_MIN 0
|
|---|
| 22 | #endif
|
|---|
| 23 |
|
|---|
| 24 | #ifndef WCHAR_MAX
|
|---|
| 25 | #define WCHAR_MAX 0x7fffffff
|
|---|
| 26 | #endif
|
|---|
| 27 |
|
|---|
| 28 | #ifndef WEOF
|
|---|
| 29 | #define WEOF ((wint_t)-1)
|
|---|
| 30 | #endif
|
|---|
| 31 |
|
|---|
| 32 | /* Functions */
|
|---|
| 33 | wint_t btowc(int);
|
|---|
| 34 | wint_t fgetwc(FILE *);
|
|---|
| 35 | wchar_t *fgetws(wchar_t *restrict, int, FILE *restrict);
|
|---|
| 36 | wint_t fputwc(wchar_t, FILE *);
|
|---|
| 37 | int fputws(const wchar_t *restrict, FILE *restrict);
|
|---|
| 38 | int fwide(FILE *, int);
|
|---|
| 39 | int fwprintf(FILE *restrict, const wchar_t *restrict, ...);
|
|---|
| 40 | int fwscanf(FILE *restrict, const wchar_t *restrict, ...);
|
|---|
| 41 | wint_t getwc(FILE *);
|
|---|
| 42 | wint_t getwchar(void);
|
|---|
| 43 |
|
|---|
| 44 | int iswalnum(wint_t);
|
|---|
| 45 | int iswalpha(wint_t);
|
|---|
| 46 | int iswcntrl(wint_t);
|
|---|
| 47 | int iswctype(wint_t, wctype_t);
|
|---|
| 48 | int iswdigit(wint_t);
|
|---|
| 49 | int iswgraph(wint_t);
|
|---|
| 50 | int iswlower(wint_t);
|
|---|
| 51 | int iswprint(wint_t);
|
|---|
| 52 | int iswpunct(wint_t);
|
|---|
| 53 | int iswspace(wint_t);
|
|---|
| 54 | int iswupper(wint_t);
|
|---|
| 55 | int iswxdigit(wint_t);
|
|---|
| 56 |
|
|---|
| 57 | size_t mbrlen(const char *restrict, size_t, mbstate_t *restrict);
|
|---|
| 58 | size_t mbrtowc(wchar_t *restrict, const char *restrict, size_t,
|
|---|
| 59 | mbstate_t *restrict);
|
|---|
| 60 | int mbsinit(const mbstate_t *);
|
|---|
| 61 |
|
|---|
| 62 | size_t mbsnrtowcs(wchar_t *restrict, const char **restrict,
|
|---|
| 63 | size_t, size_t, mbstate_t *restrict);
|
|---|
| 64 |
|
|---|
| 65 | size_t mbsrtowcs(wchar_t *restrict, const char **restrict, size_t,
|
|---|
| 66 | mbstate_t *restrict);
|
|---|
| 67 |
|
|---|
| 68 | FILE *open_wmemstream(wchar_t **, size_t *);
|
|---|
| 69 |
|
|---|
| 70 | wint_t putwc(wchar_t, FILE *);
|
|---|
| 71 | wint_t putwchar(wchar_t);
|
|---|
| 72 | int swprintf(wchar_t *restrict, size_t,
|
|---|
| 73 | const wchar_t *restrict, ...);
|
|---|
| 74 | int swscanf(const wchar_t *restrict,
|
|---|
| 75 | const wchar_t *restrict, ...);
|
|---|
| 76 |
|
|---|
| 77 | wint_t towlower(wint_t);
|
|---|
| 78 | wint_t towupper(wint_t);
|
|---|
| 79 |
|
|---|
| 80 | wint_t ungetwc(wint_t, FILE *);
|
|---|
| 81 | int vfwprintf(FILE *restrict, const wchar_t *restrict, va_list);
|
|---|
| 82 | int vfwscanf(FILE *restrict, const wchar_t *restrict, va_list);
|
|---|
| 83 | int vswprintf(wchar_t *restrict, size_t,
|
|---|
| 84 | const wchar_t *restrict, va_list);
|
|---|
| 85 | int vswscanf(const wchar_t *restrict, const wchar_t *restrict,
|
|---|
| 86 | va_list);
|
|---|
| 87 | int vwprintf(const wchar_t *restrict, va_list);
|
|---|
| 88 | int vwscanf(const wchar_t *restrict, va_list);
|
|---|
| 89 |
|
|---|
| 90 | wchar_t *wcpcpy(wchar_t *restrict, const wchar_t *restrict);
|
|---|
| 91 | wchar_t *wcpncpy(wchar_t *restrict, const wchar_t *restrict, size_t);
|
|---|
| 92 |
|
|---|
| 93 | size_t wcrtomb(char *restrict, wchar_t, mbstate_t *restrict);
|
|---|
| 94 |
|
|---|
| 95 | wchar_t *wcscat(wchar_t *restrict, const wchar_t *restrict);
|
|---|
| 96 | wchar_t *wcschr(const wchar_t *, wchar_t);
|
|---|
| 97 | int wcscmp(const wchar_t *, const wchar_t *);
|
|---|
| 98 | int wcscoll(const wchar_t *, const wchar_t *);
|
|---|
| 99 | wchar_t *wcscpy(wchar_t *restrict, const wchar_t *restrict);
|
|---|
| 100 | size_t wcscspn(const wchar_t *, const wchar_t *);
|
|---|
| 101 |
|
|---|
| 102 | wchar_t *wcsdup(const wchar_t *);
|
|---|
| 103 | size_t wcsftime(wchar_t *restrict, size_t,
|
|---|
| 104 | const wchar_t *restrict, const struct tm *restrict);
|
|---|
| 105 | size_t wcslen(const wchar_t *);
|
|---|
| 106 | int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
|
|---|
| 107 |
|
|---|
| 108 | wchar_t *wcsncat(wchar_t *restrict, const wchar_t *restrict, size_t);
|
|---|
| 109 | int wcsncmp(const wchar_t *, const wchar_t *, size_t);
|
|---|
| 110 | wchar_t *wcsncpy(wchar_t *restrict, const wchar_t *restrict, size_t);
|
|---|
| 111 | size_t wcsnlen(const wchar_t *, size_t);
|
|---|
| 112 | size_t wcsnrtombs(char *restrict, const wchar_t **restrict, size_t,
|
|---|
| 113 | size_t, mbstate_t *restrict);
|
|---|
| 114 | wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
|
|---|
| 115 | wchar_t *wcsrchr(const wchar_t *, wchar_t);
|
|---|
| 116 | size_t wcsrtombs(char *restrict, const wchar_t **restrict,
|
|---|
| 117 | size_t, mbstate_t *restrict);
|
|---|
| 118 | size_t wcsspn(const wchar_t *, const wchar_t *);
|
|---|
| 119 | wchar_t *wcsstr(const wchar_t *restrict, const wchar_t *restrict);
|
|---|
| 120 | double wcstod(const wchar_t *restrict, wchar_t **restrict);
|
|---|
| 121 | float wcstof(const wchar_t *restrict, wchar_t **restrict);
|
|---|
| 122 | wchar_t *wcstok(wchar_t *restrict, const wchar_t *restrict,
|
|---|
| 123 | wchar_t **restrict);
|
|---|
| 124 | long wcstol(const wchar_t *restrict, wchar_t **restrict, int);
|
|---|
| 125 | long double wcstold(const wchar_t *restrict, wchar_t **restrict);
|
|---|
| 126 | long long wcstoll(const wchar_t *restrict, wchar_t **restrict, int);
|
|---|
| 127 | unsigned long wcstoul(const wchar_t *restrict, wchar_t **restrict, int);
|
|---|
| 128 | unsigned long long
|
|---|
| 129 | wcstoull(const wchar_t *restrict, wchar_t **restrict, int);
|
|---|
| 130 | int wcswidth(const wchar_t *, size_t);
|
|---|
| 131 | size_t wcsxfrm(wchar_t *restrict, const wchar_t *restrict, size_t);
|
|---|
| 132 |
|
|---|
| 133 | int wctob(wint_t);
|
|---|
| 134 | wctype_t wctype(const char *);
|
|---|
| 135 | int wcwidth(wchar_t);
|
|---|
| 136 | wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
|
|---|
| 137 | int wmemcmp(const wchar_t *, const wchar_t *, size_t);
|
|---|
| 138 | wchar_t *wmemcpy(wchar_t *restrict, const wchar_t *restrict, size_t);
|
|---|
| 139 | wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
|
|---|
| 140 | wchar_t *wmemset(wchar_t *, wchar_t, size_t);
|
|---|
| 141 | int wprintf(const wchar_t *restrict, ...);
|
|---|
| 142 | int wscanf(const wchar_t *restrict, ...);
|
|---|
| 143 |
|
|---|
| 144 | #endif
|
|---|