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