]> pd.if.org Git - pdclib/blob - includes/wchar.h
Some cleanup.
[pdclib] / includes / wchar.h
1 // ----------------------------------------------------------------------------
2 // $Id$
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
7 // Extended multibyte and wide character utilities
8 // ----------------------------------------------------------------------------
9
10 #ifndef __WCHAR_H
11 #define __WCHAR_H __WCHAR_H
12
13 // ----------------------------------------------------------------------------
14 // MACROS
15
16 #define NULL       0
17 #define WCHAR_MAX  // TODO
18 #define WCHAR_MIN  // TODO
19 #define WEOF       // TODO
20
21 // ----------------------------------------------------------------------------
22 // TYPEDEFS
23
24 typedef mbstate_t;
25 typedef size_t;
26 typedef wint_t;
27 struct tm;
28
29 #ifndef __cplusplus
30 typedef wchar_t;
31 #endif // __cplusplus
32
33 // ----------------------------------------------------------------------------
34 // FUNCTIONS
35
36 wint_t fgetwc( FILE * stream );
37 wchar_t * fgetws( wchar_t * restrict s, int n, FILE * restrict stream );
38 wint_t fputwc( wchar_t c, FILE * stream );
39 int fputws( const wchar_t * restrict s, FILE * restrict stream );
40 int fwide( FILE * stream, int mode );
41 wint_t getwc( FILE * stream );
42 wint_t getwchar( void );
43 wint_t putwc( wchar_t c, FILE * stream );
44 wint_t putwchar( wchar_t c );
45 wint_t ungetwc( wint_t c, FILE * stream );
46
47 int fwscanf( FILE * restrict stream, const wchar_t * restrict format, ... );
48 int swscanf( const wchar_t * restrict s, const wchar_t * restrict format, ... );
49 int wscanf( const wchar_t * restrict format, ... );
50 int fwprintf( FILE * restrict stream, const wchar_t * restrict format, ... );
51 int swprintf( wchar_t * restrict s, size_t n, const wchar_t * restrict format, ... );
52 int wprintf( const wchar_t * restrict format, ... );
53 int vfwscanf( FILE * restrict stream, const wchar_t * restrict format, va_list arg );
54 int vswscanf( const wchar_t * restrict s, size_t n, const wchar_t * restrict format, va_list arg );
55 int vwscanf( const wchar_t * restrict format, va_list arg );
56 int vfwprintf( FILE * restrict stream, const wchar_t * restrict format, va_list arg );
57 int vswprintf( wchar_t * restrict s, size_t n, const wchar_t * restrict format, va_list arg );
58 int vwprintf( const wchar_t * restrict format, va_list arg );
59
60 size_t wcsftime( wchar_t * restrict s, size_t maxsize, const wchar_t * restrict format, const struct tm * restrict timeptr );
61
62 wint_t btowc( int c );
63 size_t mbrlen( const char * restrict s, size_t n, mbstate_t * restrict ps );
64 size_t mbrtowc( wchar_t * restrict pwc, const char * restrict s, size_t n, mbstate_t * restrict ps );
65 int mbsinit( const mbstate_t * ps );
66 size_t mbsrtowcs( wchar_t * restrict dst, const char * * restrict src, size_t len, mbstate_t * restrict ps );
67 size_t wcrtomb( char * restrict s, wchar_t wc, mbstate_t * restrict ps );
68 size_t wcsrtombs(char * restrict dst, const wchar_t * * restrict src, size_t len, mbstate_t * restrict ps );
69 double wcstod( const wchar_t * restrict nptr, wchar_t * * restrict endptr );
70 float wcstof( const wchar_t * restrict nptr, wchar_t * * restrict endptr);
71 long double wcstold( const wchar_t * restrict nptr, wchar_t * * restrict endptr);
72 long long wcstoll( const wchar_t * restrict nptr, wchar_t * * restrict endptr, int base );
73 unsigned long long wcstoull( const wchar_t * restrict nptr, wchar_t * * restrict endptr, int base );
74 long wcstol( const wchar_t * restrict nptr, wchar_t * * restrict endptr, int base );
75 unsigned long wcstoul( const wchar_t * restrict nptr, wchar_t * * restrict endptr, int base );
76 int wctob( wint_t c );
77
78 wchar_t * wcscat( wchar_t * restrict s1, const wchar_t * restrict s2);
79 int wcscmp( const wchar_t * s1, const wchar_t * s2 );
80 int wcscoll( const wchar_t * s1, const wchar_t * s2 );
81 wchar_t * wcscpy( wchar_t * restrict s1, const wchar_t * restrict s2 );
82 size_t wcscspn( const wchar_t * s1, const wchar_t * s2 );
83 size_t wcslen( const wchar_t * s );
84 wchar_t * wcsncat( wchar_t * restrict s1, const wchar_t * restrict s2, size_t n );
85 int wcsncmp( const wchar_t * s1, const wchar_t * s2, size_t n );
86 wchar_t * wcsncpy( wchar_t * restrict s1, const wchar_t * restrict s2, size_t n );
87 size_t wcsspn( const wchar_t * s1, const wchar_t * s2 );
88 wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 );
89 wchar_t * wcstok( wchar_t * restrict s1, const wchar_t * restrict s2, wchar_t * * restrict ptr );
90 size_t wcsxfrm( wchar_t * restrict s1, const wchar_t * restrict s2, size_t n );
91 int wmemcmp( const wchar_t * s1, const wchar_t * s2, size_t n );
92 wchar_t * wmemcpy( wchar_t * restrict s1, const wchar_t * restrict s2, size_t n );
93 wchar_t * wmemmove( wchar_t * s1, const wchar_t * s2, size_t n );
94 wchar_t * wmemset( wchar_t * s, wchar_t c, size_t n );
95
96 #ifdef __cplusplus
97
98 const wchar_t * wcschr( const wchar_t * s, wchar_t c );
99 wchar_t * wcschr( wchar_t * s, wchar_t c );
100 const wchar_t * wcspbrk( const wchar_t * s1, const wchar_t * s2 );
101 wchar_t * wcspbrk( wchar_t * s1, const wchar_t * s2 );
102 const wchar_t * wcsrchr( const wchar_t * s, wchar_t c );
103 wchar_t * wcsrchr( wchar_t * s, wchar_t c );
104 const wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 );
105 wchar_t * wcsstr( wchar_t * s1, const wchar_t * s2 );
106 const wchar_t * wmemchr( const wchar_t * s, wchar_t c, size_t n );
107 wchar_t * wmemchr( wchar_t * s, wchar_t c, size_t n );
108
109 #else
110
111 wchar_t * wcschr( const wchar_t * s, wchar_t c ); 
112 wchar_t * wcspbrk( const wchar_t * s1, const wchar_t * s2 );
113 wchar_t * wcsrchr( const wchar_t * s, wchar_t c );
114 wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 );
115 wchar_t * wmemchr( const wchar_t * s, wchar_t c, size_t n);
116
117 #endif // __cplusplus
118
119 #endif // __WCHAR_H