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
12 /* This is VASTLY incomplete. Functions being implemented as required by other
\r
13 portions of the library
\r
16 #ifndef _PDCLIB_SIZE_T_DEFINED
\r
17 #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED
\r
18 typedef _PDCLIB_size_t size_t;
\r
22 #ifndef _PDCLIB_WCHAR_T_DEFINED
\r
23 #define _PDCLIB_WCHAR_T_DEFINED _PDCLIB_WCHAR_T_DEFINED
\r
24 typedef _PDCLIB_wchar_t wchar_t;
\r
28 #ifndef _PDCLIB_WINT_T_DEFINED
\r
29 #define _PDCLIB_WINT_T_DEFINED _PDCLIB_WINT_T_DEFINED
\r
30 typedef _PDCLIB_wint_t wint_t;
\r
33 #ifndef _PDCLIB_MBSTATE_T_DEFINED
\r
34 #define _PDCLIB_MBSTATE_T_DEFINED _PDCLIB_MBSTATE_T_DEFINED
\r
35 typedef _PDCLIB_mbstate_t mbstate_t;
\r
40 #ifndef _PDCLIB_NULL_DEFINED
\r
41 #define _PDCLIB_NULL_DEFINED _PDCLIB_NULL_DEFINED
\r
42 #define NULL _PDCLIB_NULL
\r
45 #ifndef _PDCLIB_WCHAR_MIN_MAX_DEFINED
\r
46 #define _PDCLIB_WCHAR_MIN_MAX_DEFINED
\r
47 #define WCHAR_MIN _PDCLIB_WCHAR_MIN
\r
48 #define WCHAR_MAX _PDCLIB_WCHAR_MAX
\r
51 #define WEOF ((wint_t) -1)
\r
53 /* Wide character string handling */
\r
54 wchar_t *wcscpy(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2);
\r
55 wchar_t *wcsncpy(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, size_t n);
\r
56 wchar_t *wmemcpy(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, size_t n);
\r
57 wchar_t *wmemmove(wchar_t *s1, const wchar_t *s2, size_t n);
\r
58 wchar_t *wcscat(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2);
\r
59 wchar_t *wcsncat(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, size_t n);
\r
60 int wcscmp(const wchar_t *s1, const wchar_t *s2);
\r
61 int wcscoll(const wchar_t *s1, const wchar_t *s2);
\r
62 int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
\r
63 size_t wcsxfrm(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, size_t n);
\r
64 int wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n);
\r
65 wchar_t *wcschr(const wchar_t *s, wchar_t c);
\r
66 size_t wcscspn(const wchar_t *s1, const wchar_t *s2);
\r
67 wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2);
\r
68 wchar_t *wcsrchr(const wchar_t *s, wchar_t c);
\r
69 size_t wcsspn(const wchar_t *s1, const wchar_t *s2);
\r
70 wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2);
\r
71 wchar_t *wcstok(wchar_t *_PDCLIB_restrict s1, const wchar_t *_PDCLIB_restrict s2, wchar_t **_PDCLIB_restrict ptr);
\r
72 wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n);
\r
73 size_t wcslen(const wchar_t *s);
\r
74 wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n);
\r
77 size_t wcsftime(wchar_t *_PDCLIB_restrict s, size_t maxsize, const wchar_t *_PDCLIB_restrict format, const struct tm *_PDCLIB_restrict timeptr);
\r
80 /* Wide character I/O */
\r
81 int fwprintf(_PDCLIB_file_t *_PDCLIB_restrict stream, const wchar_t *_PDCLIB_restrict format, ...);
\r
82 int fwscanf(_PDCLIB_file_t *_PDCLIB_restrict stream, const wchar_t *_PDCLIB_restrict format, ...);
\r
83 int swprintf(wchar_t *_PDCLIB_restrict s, size_t n, const wchar_t *_PDCLIB_restrict format, ...);
\r
84 int swscanf(const wchar_t *_PDCLIB_restrict s, const wchar_t *_PDCLIB_restrict format, ...);
\r
85 int vfwprintf(_PDCLIB_file_t *_PDCLIB_restrict stream, const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
86 int vfwscanf(_PDCLIB_file_t *_PDCLIB_restrict stream, const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
87 int vswprintf(wchar_t *_PDCLIB_restrict s, size_t n, const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
88 int vswscanf(const wchar_t *_PDCLIB_restrict s, const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
89 int vwprintf(const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
90 int vwscanf(const wchar_t *_PDCLIB_restrict format, _PDCLIB_va_list arg);
\r
91 int wprintf(const wchar_t *_PDCLIB_restrict format, ...);
\r
92 int wscanf(const wchar_t *_PDCLIB_restrict format, ...);
\r
93 wint_t fgetwc(_PDCLIB_file_t *stream);
\r
94 wchar_t *fgetws(wchar_t *_PDCLIB_restrict s, int n, _PDCLIB_file_t *_PDCLIB_restrict stream);
\r
95 wint_t fputwc(wchar_t c, _PDCLIB_file_t *stream);
\r
96 int fputws(const wchar_t *_PDCLIB_restrict s, _PDCLIB_file_t *_PDCLIB_restrict stream);
\r
97 int fwide(_PDCLIB_file_t *stream, int mode);
\r
98 wint_t getwc(_PDCLIB_file_t *stream);
\r
99 wint_t getwchar(void);
\r
100 wint_t putwc(wchar_t c, _PDCLIB_file_t *stream);
\r
101 wint_t putwchar(wchar_t c);
\r
102 wint_t ungetwc(wint_t c, _PDCLIB_file_t *stream);
\r
104 #if _PDCLIB_GNU_SOURCE
\r
105 wint_t getwc_unlocked(_PDCLIB_file_t *stream);
\r
106 wint_t getwchar_unlocked(void);
\r
107 wint_t fgetwc_unlocked(_PDCLIB_file_t *stream);
\r
108 wint_t fputwc_unlocked(wchar_t wc, _PDCLIB_file_t *stream);
\r
109 wint_t putwc_unlocked(wchar_t wc, _PDCLIB_file_t *stream);
\r
110 wint_t putwchar_unlocked(wchar_t wc);
\r
111 wchar_t *fgetws_unlocked(wchar_t *ws, int n, _PDCLIB_file_t *stream);
\r
112 int fputws_unlocked(const wchar_t *ws, _PDCLIB_file_t *stream);
\r
115 /* Wide character <-> Numeric conversions */
\r
117 double wcstod(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr);
\r
118 float wcstof(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr);
\r
119 long double wcstold(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr);
\r
121 long int wcstol(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr, int base);
\r
122 long long int wcstoll(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr, int base);
\r
123 unsigned long int wcstoul(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr, int base);
\r
124 unsigned long long int wcstoull(const wchar_t *_PDCLIB_restrict nptr, wchar_t **_PDCLIB_restrict endptr, int base);
\r
126 /* Character set conversion */
\r
127 wint_t btowc(int c);
\r
128 int wctob(wint_t c);
\r
129 int mbsinit(const mbstate_t *ps);
\r
130 size_t mbrlen(const char *_PDCLIB_restrict s, size_t n, mbstate_t *_PDCLIB_restrict ps);
\r
131 size_t mbrtowc(wchar_t *_PDCLIB_restrict pwc, const char *_PDCLIB_restrict s, size_t n, mbstate_t *_PDCLIB_restrict ps);
\r
132 size_t wcrtomb(char *_PDCLIB_restrict s, wchar_t wc, mbstate_t *_PDCLIB_restrict ps);
\r
133 size_t mbsrtowcs(wchar_t *_PDCLIB_restrict dst, const char **_PDCLIB_restrict src, size_t len, mbstate_t *_PDCLIB_restrict ps);
\r
134 size_t wcsrtombs(char *_PDCLIB_restrict dst, const wchar_t **_PDCLIB_restrict src, size_t len, mbstate_t *_PDCLIB_restrict ps);
\r
136 _PDCLIB_END_EXTERN_C
\r