wchar.h (4608B)
1 #ifndef _WCHAR_H 2 #define _WCHAR_H 3 4 /* TODO: This is only a placeholder */ 5 typedef long wchar_t; 6 /* typedef long size_t; */ 7 typedef long mbstate_t; 8 typedef long wint_t; 9 struct tm; 10 11 /* #define WCHAR_MAX 1 */ 12 /* #define WCHAR_MIN 1 */ 13 /* #define WEOF -1 */ 14 /* #define NULL 0 */ 15 16 #ifdef _STDARG_H 17 extern int vswscanf(const wchar_t * restrict s, const wchar_t * restrict format, va_list arg); 18 extern int vwprintf(const wchar_t * restrict format, va_list arg); 19 extern int vwscanf(const wchar_t * restrict format, va_list arg); 20 #endif 21 22 #ifdef _STDIO_H 23 extern int fwprintf(FILE * restrict stream, const wchar_t * restrict format, ...); 24 extern int fwscanf(FILE * restrict stream, const wchar_t * restrict format, ...); 25 26 #ifdef _STDARG_H 27 extern int vfwprintf(FILE * restrict stream, const wchar_t * restrict format, va_list arg); 28 extern int vfwscanf(FILE * restrict stream, const wchar_t * restrict format, va_list arg); 29 extern int vswprintf(wchar_t * restrict s, size_t n, const wchar_t * restrict format, va_list arg); 30 #endif 31 32 extern wint_t fgetwc(FILE *stream); 33 extern wint_t fputwc(wchar_t c, FILE *stream); 34 extern wint_t getwc(FILE *stream); 35 extern wint_t putwc(wchar_t c, FILE *stream); 36 extern int fwide(FILE *stream, int mode); 37 extern wint_t ungetwc(wint_t c, FILE *stream); 38 extern wchar_t *fgetws(wchar_t * restrict s, int n, FILE * restrict stream); 39 extern int fputws(const wchar_t * restrict s, FILE * restrict stream); 40 #endif 41 42 extern int swprintf(wchar_t * restrict s, size_t n, const wchar_t * restrict format, ...); 43 extern int swscanf(const wchar_t * restrict s, const wchar_t * restrict format, ...); 44 extern int wprintf(const wchar_t * restrict format, ...); 45 extern int wscanf(const wchar_t * restrict format, ...); 46 47 extern wint_t getwchar(void); 48 extern wint_t putwchar(wchar_t c); 49 50 extern double wcstod(const wchar_t * restrict nptr, wchar_t ** restrict endptr); 51 extern float wcstof(const wchar_t * restrict nptr, wchar_t ** restrict endptr); 52 extern long double wcstold(const wchar_t * restrict nptr, wchar_t ** restrict endptr); 53 54 extern long int wcstol(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); 55 extern long long int wcstoll(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); 56 extern unsigned long int wcstoul(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); 57 extern unsigned long long int wcstoull(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); 58 59 extern wchar_t *wcscpy(wchar_t * restrict s1, const wchar_t * restrict s2); 60 extern wchar_t *wcsncpy(wchar_t * restrict s1, const wchar_t * restrict s2, size_t n); 61 62 extern wchar_t *wmemcpy(wchar_t * restrict s1, const wchar_t * restrict s2, size_t n); 63 extern wchar_t *wmemmove(wchar_t *s1, const wchar_t *s2, size_t n); 64 extern wchar_t *wcscat(wchar_t * restrict s1, const wchar_t * restrict s2); 65 extern wchar_t *wcsncat(wchar_t * restrict s1, const wchar_t * restrict s2, size_t n); 66 extern int wcscmp(const wchar_t *s1, const wchar_t *s2); 67 extern int wcscoll(const wchar_t *s1, const wchar_t *s2); 68 extern int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n); 69 extern size_t wcsxfrm(wchar_t * restrict s1, const wchar_t * restrict s2, size_t n); 70 extern int wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n); 71 extern wchar_t *wcschr(const wchar_t *s, wchar_t c); 72 extern size_t wcscspn(const wchar_t *s1, const wchar_t *s2); 73 extern wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2); 74 extern wchar_t *wcsrchr(const wchar_t *s, wchar_t c); 75 extern size_t wcsspn(const wchar_t *s1, const wchar_t *s2); 76 extern wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2); 77 extern wchar_t *wcstok(wchar_t * restrict s1, const wchar_t * restrict s2, wchar_t ** restrict ptr); 78 extern wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n); 79 extern size_t wcslen(const wchar_t *s); 80 extern wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n); 81 extern size_t wcsftime(wchar_t * restrict s, size_t maxsize, const wchar_t * restrict format, const struct tm * restrict timeptr); 82 extern wint_t btowc(int c); 83 extern int wctob(wint_t c); 84 extern int mbsinit(const mbstate_t *ps); 85 extern size_t mbrlen(const char * restrict s, size_t n, mbstate_t * restrict ps); 86 extern size_t mbrtowc(wchar_t * restrict pwc, const char * restrict s, size_t n, mbstate_t * restrict ps); 87 extern size_t wcrtomb(char * restrict s, wchar_t wc, mbstate_t * restrict ps); 88 extern size_t mbsrtowcs(wchar_t * restrict dst, const char ** restrict src, size_t len, mbstate_t * restrict ps); 89 extern size_t wcsrtombs(char * restrict dst, const wchar_t ** restrict src, size_t len, mbstate_t * restrict ps); 90 91 92 #endif