* Replaced <sys/cdefs.h> include with <aros/system.h> in most places (AROSTCP is...
[AROS.git] / compiler / clib / include / wchar.h
blob2d5c79be93a8349b4794d2a3715a804626072b2f
1 #ifndef _WCHAR_H_
2 #define _WCHAR_H_
3 /*
4 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 $Id$
7 Standard C Library: Extended multibyte and wide character utilities.
8 */
10 #include <aros/system.h>
12 #include <aros/types/wchar_t.h>
13 #include <aros/types/size_t.h>
14 #include <aros/types/mbstate_t.h>
15 #include <aros/types/wint_t.h>
16 #include <aros/types/null.h>
18 #include <stdarg.h>
19 #include <stdint.h>
21 __BEGIN_DECLS
23 struct tm;
25 #define WCHAR_MIN (-__WCHAR_MAX__ - 1l)
26 #define WCHAR_MAX __WCHAR_MAX__
28 #ifndef WEOF
29 #define WEOF ((wint_t)-1)
30 #endif
32 /* wchar.h should not include stdio.h */
33 struct __sFILE;
36 /* Formatted wide-character input/output functions */
37 int fwprintf(struct __sFILE * restrict stream,
38 const wchar_t * restrict format, ...);
39 int fwscanf(struct __sFILE * restrict stream,
40 const wchar_t * restrict format, ...);
41 int swprintf(wchar_t * restrict s, size_t n,
42 const wchar_t * restrict format, ...);
43 int swscanf(const wchar_t * restrict s,
44 const wchar_t * restrict format, ...);
45 int vfwprintf(struct __sFILE * restrict stream,
46 const wchar_t * restrict format, va_list arg);
47 int vfwscanf(struct __sFILE * restrict stream,
48 const wchar_t * restrict format, va_list arg);
49 int vswprintf(wchar_t * restrict s, size_t n,
50 const wchar_t * restrict format, va_list arg);
51 int vswscanf(const wchar_t * restrict s,
52 const wchar_t * restrict format, va_list arg);
53 int vwprintf(const wchar_t * restrict format,
54 va_list arg);
55 int vwscanf(const wchar_t * restrict format,
56 va_list arg);
57 int wprintf(const wchar_t * restrict format, ...);
58 int wscanf(const wchar_t * restrict format, ...);
60 /* Wide-character input/output functions. */
61 wint_t fgetwc(struct __sFILE *stream);
62 wchar_t *fgetws(wchar_t * restrict s,
63 int n, struct __sFILE * restrict stream);
64 wint_t fputwc(wchar_t c, struct __sFILE *stream);
65 int fputws(const wchar_t * restrict s,
66 struct __sFILE * restrict stream);
67 int fwide(struct __sFILE *stream, int mode);
68 wint_t getwc(struct __sFILE *stream);
69 wint_t getwchar(void);
70 wint_t putwc(wchar_t c, struct __sFILE *stream);
71 wint_t putwchar(wchar_t c);
72 wint_t ungetwc(wint_t c, struct __sFILE *stream);
74 /* General wide-string utilities */
75 double wcstod(const wchar_t * restrict nptr,
76 wchar_t ** restrict endptr);
77 float wcstof(const wchar_t * restrict nptr,
78 wchar_t ** restrict endptr);
79 #if C99
80 long double wcstold(const wchar_t * restrict nptr,
81 wchar_t ** restrict endptr);
82 #endif
84 long int wcstol(const wchar_t * restrict nptr,
85 wchar_t ** restrict endptr, int base);
86 unsigned long int wcstoul(const wchar_t * restrict nptr,
87 wchar_t ** restrict endptr,
88 int base);
89 #if C99
90 long long int wcstoll(const wchar_t * restrict nptr,
91 wchar_t ** restrict endptr, int base);
92 unsigned long long int wcstoull(const wchar_t * restrict nptr,
93 wchar_t ** restrict endptr, int base);
94 #endif
96 wchar_t *wcscat(wchar_t * restrict s1, const wchar_t * restrict s2);
97 wchar_t *wcsncat(wchar_t * restrict s1, const wchar_t * restrict s2, size_t n);
98 int wcscmp(const wchar_t *s1, const wchar_t *s2);
99 int wcscoll(const wchar_t *s1, const wchar_t *s2);
100 int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
101 size_t wcsxfrm(wchar_t * restrict s1, const wchar_t * restrict s2, size_t n);
102 wchar_t *wcschr(const wchar_t *s, wchar_t c);
103 size_t wcscspn(const wchar_t *s1, const wchar_t *s2);
104 size_t wcslen(const wchar_t *s);
105 wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2);
106 wchar_t *wcsrchr(const wchar_t *s, wchar_t c);
107 size_t wcsspn(const wchar_t *s1, const wchar_t *s2);
108 wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2);
109 wchar_t *wcstok(wchar_t * restrict s1, const wchar_t * restrict s2,
110 wchar_t ** restrict ptr);
111 wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n);
112 int wmemcmp(const wchar_t * s1, const wchar_t * s2, size_t n);
113 wchar_t *wmemcpy(wchar_t * restrict s1, const wchar_t * restrict s2, size_t n);
114 wchar_t *wmemmove(wchar_t *s1, const wchar_t *s2, size_t n);
115 wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n);
117 /* Wide-character time conversion utilities */
118 size_t wcsftime(wchar_t * restrict s, size_t maxsize,
119 const wchar_t * restrict format,
120 const struct tm * restrict timeptr);
122 /* Extended multibyte and wide character utilities */
123 wint_t btowc(int c);
124 int wctob(wint_t c);
125 int mbsinit(const mbstate_t *ps);
126 size_t mbrlen(const char * restrict s, size_t n, mbstate_t * restrict ps);
127 size_t mbrtowc(wchar_t * restrict pwc, const char * restrict s, size_t n,
128 mbstate_t * restrict ps);
129 size_t wcrtomb(char * restrict s, wchar_t wc, mbstate_t * restrict ps);
130 size_t mbsrtowcs(wchar_t * restrict dst, const char ** restrict src,
131 size_t len, mbstate_t * restrict ps);
132 size_t wcsrtombs(char * restrict dst, const wchar_t ** restrict src,
133 size_t len, mbstate_t * restrict ps);
135 __END_DECLS
137 #endif /* _WCHAR_T_ */