Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/waterbox/libc/includes/wchar.h
2 views
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
size_t wcsftime( wchar_t * _PDCLIB_restrict s, size_t maxsize, const wchar_t * _PDCLIB_restrict format, const struct tm * _PDCLIB_restrict timeptr );
81
82
/* Wide character I/O */
83
int fwprintf( _PDCLIB_file_t * _PDCLIB_restrict stream, const wchar_t * _PDCLIB_restrict format, ... );
84
int fwscanf( _PDCLIB_file_t * _PDCLIB_restrict stream, const wchar_t * _PDCLIB_restrict format, ... );
85
int swprintf( wchar_t * _PDCLIB_restrict s, size_t n, const wchar_t * _PDCLIB_restrict format, ... );
86
int swscanf( const wchar_t * _PDCLIB_restrict s, const wchar_t * _PDCLIB_restrict format, ... );
87
int vfwprintf( _PDCLIB_file_t * _PDCLIB_restrict stream, const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
88
int vfwscanf( _PDCLIB_file_t * _PDCLIB_restrict stream, const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
89
int vswprintf( wchar_t * _PDCLIB_restrict s, size_t n, const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
90
int vswscanf( const wchar_t * _PDCLIB_restrict s, const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
91
int vwprintf( const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
92
int vwscanf( const wchar_t * _PDCLIB_restrict format, _PDCLIB_va_list arg );
93
int wprintf( const wchar_t * _PDCLIB_restrict format, ... );
94
int wscanf( const wchar_t * _PDCLIB_restrict format, ... );
95
wint_t fgetwc( _PDCLIB_file_t * stream );
96
wchar_t * fgetws( wchar_t * _PDCLIB_restrict s, int n, _PDCLIB_file_t * _PDCLIB_restrict stream );
97
wint_t fputwc( wchar_t c, _PDCLIB_file_t * stream );
98
int fputws( const wchar_t * _PDCLIB_restrict s, _PDCLIB_file_t * _PDCLIB_restrict stream );
99
int fwide( _PDCLIB_file_t * stream, int mode );
100
wint_t getwc( _PDCLIB_file_t * stream );
101
wint_t getwchar( void );
102
wint_t putwc( wchar_t c, _PDCLIB_file_t * stream );
103
wint_t putwchar( wchar_t c );
104
wint_t ungetwc( wint_t c, _PDCLIB_file_t * stream );
105
106
#if _PDCLIB_GNU_SOURCE
107
wint_t getwc_unlocked( _PDCLIB_file_t * stream );
108
wint_t getwchar_unlocked( void );
109
wint_t fgetwc_unlocked( _PDCLIB_file_t * stream );
110
wint_t fputwc_unlocked( wchar_t wc, _PDCLIB_file_t * stream );
111
wint_t putwc_unlocked( wchar_t wc, _PDCLIB_file_t * stream );
112
wint_t putwchar_unlocked( wchar_t wc );
113
wchar_t * fgetws_unlocked( wchar_t * ws, int n, _PDCLIB_file_t * stream );
114
int fputws_unlocked( const wchar_t * ws, _PDCLIB_file_t * stream );
115
#endif
116
117
/* Wide character <-> Numeric conversions */
118
119
double wcstod( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr );
120
float wcstof( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr );
121
long double wcstold( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr );
122
123
long int wcstol( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
124
long long int wcstoll( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
125
unsigned long int wcstoul( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
126
unsigned long long int wcstoull( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
127
128
/* Character set conversion */
129
wint_t btowc( int c );
130
int wctob( wint_t c );
131
int mbsinit( const mbstate_t * ps );
132
size_t mbrlen( const char * _PDCLIB_restrict s, size_t n, mbstate_t * _PDCLIB_restrict ps );
133
size_t mbrtowc( wchar_t * _PDCLIB_restrict pwc, const char * _PDCLIB_restrict s, size_t n, mbstate_t * _PDCLIB_restrict ps );
134
size_t wcrtomb( char * _PDCLIB_restrict s, wchar_t wc, mbstate_t * _PDCLIB_restrict ps );
135
size_t mbsrtowcs( wchar_t * _PDCLIB_restrict dst, const char * * _PDCLIB_restrict src, size_t len, mbstate_t * _PDCLIB_restrict ps );
136
size_t mbsnrtowcs( wchar_t * _PDCLIB_restrict dst, const char * * _PDCLIB_restrict src, size_t nms, size_t len, mbstate_t * _PDCLIB_restrict ps ); // NYI
137
size_t wcsrtombs( char * _PDCLIB_restrict dst, const wchar_t * * _PDCLIB_restrict src, size_t len, mbstate_t * _PDCLIB_restrict ps );
138
size_t wcsnrtombs( char * _PDCLIB_restrict dst, const wchar_t * * _PDCLIB_restrict src, size_t nwc, size_t len, mbstate_t * _PDCLIB_restrict ps ); // NYI
139
140
#ifdef __cplusplus
141
}
142
#endif
143
144
#endif
145
146