xref: /freebsd/include/xlocale/_wchar.h (revision d91f8db5f1822c43cd256f19aae1d059e4b25a26)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2011, 2012 The FreeBSD Foundation
5  *
6  * This software was developed by David Chisnall under sponsorship from
7  * the FreeBSD Foundation.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  * $FreeBSD$
31  */
32 
33 #ifndef _LOCALE_T_DEFINED
34 #define _LOCALE_T_DEFINED
35 typedef struct	_xlocale *locale_t;
36 #endif
37 
38 #ifndef _XLOCALE_WCHAR1_H
39 #define _XLOCALE_WCHAR1_H
40 int			 wcscasecmp_l(const wchar_t *, const wchar_t *,
41 			   locale_t);
42 int			 wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t,
43 			   locale_t);
44 int			 wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
45 size_t			 wcsxfrm_l(wchar_t * __restrict,
46 			   const wchar_t * __restrict, size_t, locale_t);
47 
48 #endif /* _XLOCALE_WCHAR1_H */
49 
50 /*
51  * Only declare the non-POSIX functions if we're included from xlocale.h.
52  */
53 
54 #ifdef _XLOCALE_H_
55 #ifndef _XLOCALE_WCHAR2_H
56 #define _XLOCALE_WCHAR2_H
57 
58 wint_t			 btowc_l(int, locale_t);
59 wint_t			 fgetwc_l(FILE *, locale_t);
60 wchar_t			*fgetws_l(wchar_t * __restrict, int, FILE * __restrict,
61 			    locale_t);
62 wint_t			 fputwc_l(wchar_t, FILE *, locale_t);
63 int			 fputws_l(const wchar_t * __restrict, FILE * __restrict,
64 			   locale_t);
65 int			 fwprintf_l(FILE * __restrict, locale_t,
66 			    const wchar_t * __restrict, ...);
67 int			 fwscanf_l(FILE * __restrict, locale_t,
68 			    const wchar_t * __restrict, ...);
69 wint_t			 getwc_l(FILE *, locale_t);
70 wint_t			 getwchar_l(locale_t);
71 size_t			 mbrlen_l(const char * __restrict, size_t,
72 			   mbstate_t * __restrict, locale_t);
73 size_t			 mbrtowc_l(wchar_t * __restrict,
74 			    const char * __restrict, size_t,
75 			    mbstate_t * __restrict, locale_t);
76 int			 mbsinit_l(const mbstate_t *, locale_t);
77 size_t			 mbsrtowcs_l(wchar_t * __restrict,
78 			    const char ** __restrict, size_t,
79 			    mbstate_t * __restrict, locale_t);
80 wint_t			 putwc_l(wchar_t, FILE *, locale_t);
81 wint_t			 putwchar_l(wchar_t, locale_t);
82 int			 swprintf_l(wchar_t * __restrict, size_t n, locale_t,
83 			    const wchar_t * __restrict, ...);
84 int			 swscanf_l(const wchar_t * __restrict, locale_t,
85 			   const wchar_t * __restrict, ...);
86 wint_t			 ungetwc_l(wint_t, FILE *, locale_t);
87 int			 vfwprintf_l(FILE * __restrict, locale_t,
88 			    const wchar_t * __restrict, __va_list);
89 int			 vswprintf_l(wchar_t * __restrict, size_t n, locale_t,
90 			    const wchar_t * __restrict, __va_list);
91 int			 vwprintf_l(locale_t, const wchar_t * __restrict,
92 			    __va_list);
93 size_t			 wcrtomb_l(char * __restrict, wchar_t,
94 			    mbstate_t * __restrict, locale_t);
95 size_t			 wcsftime_l(wchar_t * __restrict, size_t,
96 			    const wchar_t * __restrict,
97 			    const struct tm * __restrict, locale_t);
98 size_t			 wcsrtombs_l(char * __restrict,
99 			    const wchar_t ** __restrict, size_t,
100 			    mbstate_t * __restrict, locale_t);
101 double			 wcstod_l(const wchar_t * __restrict,
102 			    wchar_t ** __restrict, locale_t);
103 long			 wcstol_l(const wchar_t * __restrict,
104 			    wchar_t ** __restrict, int, locale_t);
105 unsigned long		 wcstoul_l(const wchar_t * __restrict,
106 			    wchar_t ** __restrict, int, locale_t);
107 int			 wcswidth_l(const wchar_t *, size_t, locale_t);
108 int			 wctob_l(wint_t, locale_t);
109 int			 wcwidth_l(wchar_t, locale_t);
110 int			 wprintf_l(locale_t, const wchar_t * __restrict, ...);
111 int			 wscanf_l(locale_t, const wchar_t * __restrict, ...);
112 int			 vfwscanf_l(FILE * __restrict, locale_t,
113 			    const wchar_t * __restrict, __va_list);
114 int			 vswscanf_l(const wchar_t * __restrict, locale_t,
115 			    const wchar_t *__restrict, __va_list);
116 int			 vwscanf_l(locale_t, const wchar_t * __restrict,
117 			    __va_list);
118 float			 wcstof_l(const wchar_t * __restrict,
119 			    wchar_t ** __restrict, locale_t);
120 long double		 wcstold_l(const wchar_t * __restrict,
121 			    wchar_t ** __restrict, locale_t);
122 long long		 wcstoll_l(const wchar_t * __restrict,
123 			    wchar_t ** __restrict, int, locale_t);
124 unsigned long long	 wcstoull_l(const wchar_t * __restrict,
125 			    wchar_t ** __restrict, int, locale_t);
126 size_t			 mbsnrtowcs_l(wchar_t * __restrict,
127 			    const char ** __restrict, size_t, size_t,
128 			    mbstate_t * __restrict, locale_t);
129 size_t			 wcsnrtombs_l(char * __restrict,
130 			    const wchar_t ** __restrict, size_t, size_t,
131 			    mbstate_t * __restrict, locale_t);
132 
133 #endif /* _XLOCALE_WCHAR_H */
134 #endif /* _XLOCALE_H_ */
135