3 This file is part of the Public Domain C Library (PDCLib).
\r
4 Permission is granted to use, modify, and / or redistribute at will.
\r
8 #ifndef _PDCLIB_WCHAR_H
\r
9 #define _PDCLIB_WCHAR_H
\r
10 #include <_PDCLIB_int.h>
\r
11 _PDCLIB_BEGIN_EXTERN_C
\r
13 #ifndef _PDCLIB_SIZE_T_DEFINED
\r
14 #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED
\r
15 typedef _PDCLIB_size_t size_t;
\r
19 #ifndef _PDCLIB_WCHAR_T_DEFINED
\r
20 #define _PDCLIB_WCHAR_T_DEFINED _PDCLIB_WCHAR_T_DEFINED
\r
21 typedef _PDCLIB_wchar_t wchar_t;
\r
25 #ifndef _PDCLIB_WINT_T_DEFINED
\r
26 #define _PDCLIB_WINT_T_DEFINED _PDCLIB_WINT_T_DEFINED
\r
27 typedef _PDCLIB_wint_t wint_t;
\r
30 #ifndef _PDCLIB_MBSTATE_T_DEFINED
\r
31 #define _PDCLIB_MBSTATE_T_DEFINED _PDCLIB_MBSTATE_T_DEFINED
\r
32 typedef _PDCLIB_mbstate_t mbstate_t;
\r
37 #ifndef _PDCLIB_NULL_DEFINED
\r
38 #define _PDCLIB_NULL_DEFINED _PDCLIB_NULL_DEFINED
\r
39 #define NULL _PDCLIB_NULL
\r
42 #ifndef _PDCLIB_WCHAR_MIN_MAX_DEFINED
\r
43 #define _PDCLIB_WCHAR_MIN_MAX_DEFINED
\r
44 #define WCHAR_MIN _PDCLIB_WCHAR_MIN
\r
45 #define WCHAR_MAX _PDCLIB_WCHAR_MAX
\r
49 #define WEOF ((wint_t) -1)
\r
52 /* Wide character string handling */
\r
53 wchar_t *wcscpy(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2);
\r
54 wchar_t *wcsncpy(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, size_t n);
\r
55 wchar_t *wmemcpy(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, size_t n);
\r
56 wchar_t *wmemmove(wchar_t *s1, const wchar_t *s2, size_t n);
\r
57 wchar_t *wcscat(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2);
\r
58 wchar_t *wcsncat(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, size_t n);
\r
59 int wcscmp(const wchar_t *s1, const wchar_t *s2);
\r
60 int wcscoll(const wchar_t *s1, const wchar_t *s2);
\r
61 int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
\r
62 size_t wcsxfrm(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, size_t n);
\r
63 int wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n);
\r
64 wchar_t *wcschr(const wchar_t *s, wchar_t c);
\r
65 size_t wcscspn(const wchar_t *s1, const wchar_t *s2);
\r
66 wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2);
\r
67 wchar_t *wcsrchr(const wchar_t *s, wchar_t c);
\r
68 size_t wcsspn(const wchar_t *s1, const wchar_t *s2);
\r
69 wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2);
\r
70 wchar_t *wcstok(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, wchar_t **_PDCLIB_restrict ptr);
\r
71 wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n);
\r
72 size_t wcslen(const wchar_t *s);
\r
73 wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n);
\r
76 size_t wcsftime(wchar_t *_PDCLIB_restrict s, size_t maxsize, const wchar_t *_PDCLIB_restrict format, const struct tm *_PDCLIB_restrict timeptr);
\r
79 /* Wide character I/O */
\r
80 int fwprintf(_PDCLIB_file_t *_PDCLIB_restrict stream, const wchar_t *_PDCLIB_restrict format, ...);
\r
81 int fwscanf(_PDCLIB_file_t *_PDCLIB_restrict stream, const wchar_t *_PDCLIB_restrict format, ...);
\r
82 int swprintf(wchar_t *_PDCLIB_restrict s, size_t n, const wchar_t *_PDCLIB_restrict format, ...);
\r
83 int swscanf(const wchar_t *_PDCLIB_restrict s, const wchar_t *_PDCLIB_restrict format, ...);
\r
84 int vfwprintf(_PDCLIB_file_t *_PDCLIB_restrict stream, const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
85 int vfwscanf(_PDCLIB_file_t *_PDCLIB_restrict stream, const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
86 int vswprintf(wchar_t *_PDCLIB_restrict s, size_t n, const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
87 int vswscanf(const wchar_t *_PDCLIB_restrict s, const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
88 int vwprintf(const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
89 int vwscanf(const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
90 int wprintf(const wchar_t *_PDCLIB_restrict format, ...);
\r
91 int wscanf(const wchar_t *_PDCLIB_restrict format, ...);
\r
92 wint_t fgetwc(_PDCLIB_file_t *stream);
\r
93 wchar_t *fgetws(wchar_t *_PDCLIB_restrict s, int n, _PDCLIB_file_t *_PDCLIB_restrict stream);
\r
94 wint_t fputwc(wchar_t c, _PDCLIB_file_t *stream);
\r
95 int fputws(const wchar_t *_PDCLIB_restrict s, _PDCLIB_file_t *_PDCLIB_restrict stream);
\r
96 int fwide(_PDCLIB_file_t *stream, int mode);
\r
97 wint_t getwc(_PDCLIB_file_t *stream);
\r
98 wint_t getwchar(void);
\r
99 wint_t putwc(wchar_t c, _PDCLIB_file_t *stream);
\r
100 wint_t putwchar(wchar_t c);
\r
101 wint_t ungetwc(wint_t c, _PDCLIB_file_t *stream);
\r
103 #if _PDCLIB_GNU_SOURCE
\r
104 wint_t getwc_unlocked(_PDCLIB_file_t *stream);
\r
105 wint_t getwchar_unlocked(void);
\r
106 wint_t fgetwc_unlocked(_PDCLIB_file_t *stream);
\r
107 wint_t fputwc_unlocked(wchar_t wc, _PDCLIB_file_t *stream);
\r
108 wint_t putwc_unlocked(wchar_t wc, _PDCLIB_file_t *stream);
\r
109 wint_t putwchar_unlocked(wchar_t wc);
\r
110 wchar_t *fgetws_unlocked(wchar_t *ws, int n, _PDCLIB_file_t *stream);
\r
111 int fputws_unlocked(const wchar_t *ws, _PDCLIB_file_t *stream);
\r
114 /* Wide character <-> Numeric conversions */
\r
116 double wcstod(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr);
\r
117 float wcstof(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr);
\r
118 long double wcstold(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr);
\r
120 long int wcstol(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr, int base);
\r
121 long long int wcstoll(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr, int base);
\r
122 unsigned long int wcstoul(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr, int base);
\r
123 unsigned long long int wcstoull(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr, int base);
\r
125 /* Character set conversion */
\r
126 wint_t btowc(int c);
\r
127 int wctob(wint_t c);
\r
128 int mbsinit(const mbstate_t *ps);
\r
129 size_t mbrlen(const char *_PDCLIB_restrict s, size_t n, mbstate_t *_PDCLIB_restrict ps);
\r
130 size_t mbrtowc(wchar_t *_PDCLIB_restrict pwc, const char *_PDCLIB_restrict s, size_t n, mbstate_t *_PDCLIB_restrict ps);
\r
131 size_t wcrtomb(char *_PDCLIB_restrict s, wchar_t wc, mbstate_t *_PDCLIB_restrict ps);
\r
132 size_t mbsrtowcs(wchar_t *_PDCLIB_restrict dst, const char **_PDCLIB_restrict src, size_t len, mbstate_t *_PDCLIB_restrict ps);
\r
133 size_t wcsrtombs(char *_PDCLIB_restrict dst, const wchar_t **_PDCLIB_restrict src, size_t len, mbstate_t *_PDCLIB_restrict ps);
\r
135 _PDCLIB_END_EXTERN_C
\r