]> pd.if.org Git - pdclib/blob - includes/wchar.h
PDCLib includes with quotes, not <>.
[pdclib] / includes / wchar.h
1 /* Extended multibyte and wide character utilities <wchar.h>
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #ifndef _PDCLIB_WCHAR_H
8 #define _PDCLIB_WCHAR_H _PDCLIB_WCHAR_H
9 #include "_PDCLIB_int.h"
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 #ifndef _PDCLIB_SIZE_T_DEFINED
16 #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED
17 typedef _PDCLIB_size_t size_t;
18 #endif
19
20 #ifndef __cplusplus
21
22 #ifndef _PDCLIB_WCHAR_T_DEFINED
23 #define _PDCLIB_WCHAR_T_DEFINED _PDCLIB_WCHAR_T_DEFINED
24 typedef _PDCLIB_wchar_t wchar_t;
25 #endif
26
27 #endif
28
29 #ifndef _PDCLIB_WINT_T_DEFINED
30 #define _PDCLIB_WINT_T_DEFINED _PDCLIB_WINT_T_DEFINED
31 typedef _PDCLIB_wint_t wint_t;
32 #endif
33
34 #ifndef _PDCLIB_MBSTATE_T_DEFINED
35 #define _PDCLIB_MBSTATE_T_DEFINED _PDCLIB_MBSTATE_T_DEFINED
36 typedef _PDCLIB_mbstate_t mbstate_t;
37 #endif
38
39 struct tm;
40
41 #ifndef _PDCLIB_NULL_DEFINED
42 #define _PDCLIB_NULL_DEFINED _PDCLIB_NULL_DEFINED
43 #define NULL _PDCLIB_NULL
44 #endif
45
46 #ifndef _PDCLIB_WCHAR_MIN_MAX_DEFINED
47 #define _PDCLIB_WCHAR_MIN_MAX_DEFINED _PDCLIB_WCHAR_MIN_MAX_DEFINED
48 #define WCHAR_MIN _PDCLIB_WCHAR_MIN
49 #define WCHAR_MAX _PDCLIB_WCHAR_MAX
50 #endif
51
52 #ifndef _PDCLIB_WEOF_DEFINED
53 #define _PDCLIB_WEOF_DEFINED _PDCLIB_WEOF_DEFINED
54 #define WEOF _PDCLIB_WEOF
55 #endif
56
57 /* Wide character string handling */
58 wchar_t * wcscpy( wchar_t * _PDCLIB_restrict s1, const wchar_t * _PDCLIB_restrict s2 );
59 wchar_t * wcsncpy( wchar_t * _PDCLIB_restrict s1, const wchar_t * _PDCLIB_restrict s2, size_t n );
60 wchar_t * wmemcpy( wchar_t * _PDCLIB_restrict s1, const wchar_t * _PDCLIB_restrict s2, size_t n );
61 wchar_t * wmemmove( wchar_t * s1, const wchar_t * s2, size_t n );
62 wchar_t * wcscat( wchar_t * _PDCLIB_restrict s1, const wchar_t * _PDCLIB_restrict s2 );
63 wchar_t * wcsncat( wchar_t * _PDCLIB_restrict s1, const wchar_t * _PDCLIB_restrict s2, size_t n );
64 int wcscmp( const wchar_t * s1, const wchar_t * s2 );
65 int wcscoll( const wchar_t * s1, const wchar_t * s2 );
66 int wcsncmp( const wchar_t * s1, const wchar_t * s2, size_t n );
67 size_t wcsxfrm( wchar_t * _PDCLIB_restrict s1, const wchar_t * _PDCLIB_restrict s2, size_t n );
68 int wmemcmp( const wchar_t * s1, const wchar_t * s2, size_t n );
69 wchar_t * wcschr( const wchar_t * s, wchar_t c );
70 size_t wcscspn( const wchar_t * s1, const wchar_t * s2 );
71 wchar_t * wcspbrk( const wchar_t * s1, const wchar_t * s2 );
72 wchar_t * wcsrchr( const wchar_t * s, wchar_t c );
73 size_t wcsspn( const wchar_t * s1, const wchar_t * s2 );
74 wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 );
75 wchar_t * wcstok( wchar_t * _PDCLIB_restrict s1, const wchar_t * _PDCLIB_restrict s2, wchar_t * * _PDCLIB_restrict ptr );
76 wchar_t * wmemchr( const wchar_t * s, wchar_t c, size_t n );
77 size_t wcslen( const wchar_t * s );
78 wchar_t * wmemset( wchar_t * s, wchar_t c, size_t n );
79
80 #if 0
81 size_t wcsftime( wchar_t * _PDCLIB_restrict s, size_t maxsize, const wchar_t * _PDCLIB_restrict format, const struct tm * _PDCLIB_restrict timeptr );
82 #endif
83
84 /* Wide character I/O */
85 int fwprintf( _PDCLIB_file_t * _PDCLIB_restrict stream, const wchar_t * _PDCLIB_restrict format, ... );
86 int fwscanf( _PDCLIB_file_t * _PDCLIB_restrict stream, const wchar_t * _PDCLIB_restrict format, ... );
87 int swprintf( wchar_t * _PDCLIB_restrict s, size_t n, const wchar_t * _PDCLIB_restrict format, ... );
88 int swscanf( const wchar_t * _PDCLIB_restrict s, const wchar_t * _PDCLIB_restrict format, ... );
89 int vfwprintf( _PDCLIB_file_t * _PDCLIB_restrict stream, const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
90 int vfwscanf( _PDCLIB_file_t * _PDCLIB_restrict stream, const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
91 int vswprintf( wchar_t * _PDCLIB_restrict s, size_t n, const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
92 int vswscanf( const wchar_t * _PDCLIB_restrict s, const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
93 int vwprintf( const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
94 int vwscanf( const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
95 int wprintf( const wchar_t * _PDCLIB_restrict format, ... );
96 int wscanf( const wchar_t * _PDCLIB_restrict format, ... );
97 wint_t fgetwc( _PDCLIB_file_t * stream );
98 wchar_t * fgetws( wchar_t * _PDCLIB_restrict s, int n, _PDCLIB_file_t * _PDCLIB_restrict stream );
99 wint_t fputwc( wchar_t c, _PDCLIB_file_t * stream );
100 int fputws( const wchar_t * _PDCLIB_restrict s, _PDCLIB_file_t * _PDCLIB_restrict stream );
101 int fwide( _PDCLIB_file_t * stream, int mode );
102 wint_t getwc( _PDCLIB_file_t * stream );
103 wint_t getwchar( void );
104 wint_t putwc( wchar_t c, _PDCLIB_file_t * stream );
105 wint_t putwchar( wchar_t c );
106 wint_t ungetwc( wint_t c, _PDCLIB_file_t * stream );
107
108 #if _PDCLIB_GNU_SOURCE
109 wint_t getwc_unlocked( _PDCLIB_file_t * stream );
110 wint_t getwchar_unlocked( void );
111 wint_t fgetwc_unlocked( _PDCLIB_file_t * stream );
112 wint_t fputwc_unlocked( wchar_t wc, _PDCLIB_file_t * stream );
113 wint_t putwc_unlocked( wchar_t wc, _PDCLIB_file_t * stream );
114 wint_t putwchar_unlocked( wchar_t wc );
115 wchar_t * fgetws_unlocked( wchar_t * ws, int n, _PDCLIB_file_t * stream );
116 int fputws_unlocked( const wchar_t * ws, _PDCLIB_file_t * stream );
117 #endif
118
119 /* Wide character <-> Numeric conversions */
120
121 /*
122 double wcstod( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr );
123 float wcstof( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr );
124 long double wcstold( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr );
125 */
126
127 long int wcstol( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
128 long long int wcstoll( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
129 unsigned long int wcstoul( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
130 unsigned long long int wcstoull( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
131
132 /* Character set conversion */
133 wint_t btowc( int c );
134 int wctob( wint_t c );
135 int mbsinit( const mbstate_t * ps );
136 size_t mbrlen( const char * _PDCLIB_restrict s, size_t n, mbstate_t * _PDCLIB_restrict ps );
137 size_t mbrtowc( wchar_t * _PDCLIB_restrict pwc, const char * _PDCLIB_restrict s, size_t n, mbstate_t * _PDCLIB_restrict ps );
138 size_t wcrtomb( char * _PDCLIB_restrict s, wchar_t wc, mbstate_t * _PDCLIB_restrict ps );
139 size_t mbsrtowcs( wchar_t * _PDCLIB_restrict dst, const char * * _PDCLIB_restrict src, size_t len, mbstate_t * _PDCLIB_restrict ps );
140 size_t wcsrtombs( char * _PDCLIB_restrict dst, const wchar_t * * _PDCLIB_restrict src, size_t len, mbstate_t * _PDCLIB_restrict ps );
141
142 #ifdef __cplusplus
143 }
144 #endif
145
146 #endif