]> pd.if.org Git - pdclib/blob - includes/wchar.h
2af21556aa7a38b2ac5541206002f93bb103a90d
[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 // TODO: Documentation
14
15 // ----------------------------------------------------------------------------
16 // MACROS
17
18 #include "__NULL.h"
19 #include "__WCHAR.h"
20
21 #define WEOF       // TODO - personality?
22
23 // ----------------------------------------------------------------------------
24 // TYPEDEFS
25
26 #include "__tm.h"
27 #include "__size_t.h"
28 #include "__wchar_t.h"
29 #include "__wint_t.h"
30
31 typedef mbstate_t; // TODO - personality?
32 typedef size_t;    // TODO - personality?
33 typedef wint_t;    // TODO - personality?
34
35 // ----------------------------------------------------------------------------
36 // FUNCTIONS
37
38 wint_t fgetwc( FILE * stream );
39 wchar_t * fgetws( wchar_t * restrict s, int n, FILE * restrict stream );
40 wint_t fputwc( wchar_t c, FILE * stream );
41 int fputws( const wchar_t * restrict s, FILE * restrict stream );
42 int fwide( FILE * stream, int mode );
43 wint_t getwc( FILE * stream );
44 wint_t getwchar( void );
45 wint_t putwc( wchar_t c, FILE * stream );
46 wint_t putwchar( wchar_t c );
47 wint_t ungetwc( wint_t c, FILE * stream );
48
49 int fwscanf( FILE * restrict stream, const wchar_t * restrict format, ... );
50 int swscanf( const wchar_t * restrict s, const wchar_t * restrict format, ... );
51 int wscanf( const wchar_t * restrict format, ... );
52 int fwprintf( FILE * restrict stream, const wchar_t * restrict format, ... );
53 int swprintf( wchar_t * restrict s, size_t n, const wchar_t * restrict format, ... );
54 int wprintf( const wchar_t * restrict format, ... );
55 int vfwscanf( FILE * restrict stream, const wchar_t * restrict format, va_list arg );
56 int vswscanf( const wchar_t * restrict s, size_t n, const wchar_t * restrict format, va_list arg );
57 int vwscanf( const wchar_t * restrict format, va_list arg );
58 int vfwprintf( FILE * restrict stream, const wchar_t * restrict format, va_list arg );
59 int vswprintf( wchar_t * restrict s, size_t n, const wchar_t * restrict format, va_list arg );
60 int vwprintf( const wchar_t * restrict format, va_list arg );
61
62 size_t wcsftime( wchar_t * restrict s, size_t maxsize, const wchar_t * restrict format, const struct tm * restrict timeptr );
63
64 wint_t btowc( int c );
65 size_t mbrlen( const char * restrict s, size_t n, mbstate_t * restrict ps );
66 size_t mbrtowc( wchar_t * restrict pwc, const char * restrict s, size_t n, mbstate_t * restrict ps );
67 int mbsinit( const mbstate_t * ps );
68 size_t mbsrtowcs( wchar_t * restrict dst, const char * * restrict src, size_t len, mbstate_t * restrict ps );
69 size_t wcrtomb( char * restrict s, wchar_t wc, mbstate_t * restrict ps );
70 size_t wcsrtombs(char * restrict dst, const wchar_t * * restrict src, size_t len, mbstate_t * restrict ps );
71 double wcstod( const wchar_t * restrict nptr, wchar_t * * restrict endptr );
72 float wcstof( const wchar_t * restrict nptr, wchar_t * * restrict endptr);
73 long double wcstold( const wchar_t * restrict nptr, wchar_t * * restrict endptr);
74 long long wcstoll( const wchar_t * restrict nptr, wchar_t * * restrict endptr, int base );
75 unsigned long long wcstoull( const wchar_t * restrict nptr, wchar_t * * restrict endptr, int base );
76 long wcstol( const wchar_t * restrict nptr, wchar_t * * restrict endptr, int base );
77 unsigned long wcstoul( const wchar_t * restrict nptr, wchar_t * * restrict endptr, int base );
78 int wctob( wint_t c );
79
80 wchar_t * wcscat( wchar_t * restrict s1, const wchar_t * restrict s2);
81 int wcscmp( const wchar_t * s1, const wchar_t * s2 );
82 int wcscoll( const wchar_t * s1, const wchar_t * s2 );
83 wchar_t * wcscpy( wchar_t * restrict s1, const wchar_t * restrict s2 );
84 size_t wcscspn( const wchar_t * s1, const wchar_t * s2 );
85 size_t wcslen( const wchar_t * s );
86 wchar_t * wcsncat( wchar_t * restrict s1, const wchar_t * restrict s2, size_t n );
87 int wcsncmp( const wchar_t * s1, const wchar_t * s2, size_t n );
88 wchar_t * wcsncpy( wchar_t * restrict s1, const wchar_t * restrict s2, size_t n );
89 size_t wcsspn( const wchar_t * s1, const wchar_t * s2 );
90 wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 );
91 wchar_t * wcstok( wchar_t * restrict s1, const wchar_t * restrict s2, wchar_t * * restrict ptr );
92 size_t wcsxfrm( wchar_t * restrict s1, const wchar_t * restrict s2, size_t n );
93 int wmemcmp( const wchar_t * s1, const wchar_t * s2, size_t n );
94 wchar_t * wmemcpy( wchar_t * restrict s1, const wchar_t * restrict s2, size_t n );
95 wchar_t * wmemmove( wchar_t * s1, const wchar_t * s2, size_t n );
96 wchar_t * wmemset( wchar_t * s, wchar_t c, size_t n );
97
98 wchar_t * wcschr( const wchar_t * s, wchar_t c ); 
99 wchar_t * wcspbrk( const wchar_t * s1, const wchar_t * s2 );
100 wchar_t * wcsrchr( const wchar_t * s, wchar_t c );
101 wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 );
102 wchar_t * wmemchr( const wchar_t * s, wchar_t c, size_t n);
103
104 #endif // __WCHAR_H