xref: /dragonfly/include/xlocale/_wchar.h (revision f7a8af04543bbe2c157bd55f040d72f8af090187)
1 /*-
2  * Copyright (c) 2011, 2012 The FreeBSD Foundation
3  * All rights reserved.
4  *
5  * This software was developed by David Chisnall under sponsorship from
6  * the FreeBSD Foundation.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * $FreeBSD: head/include/xlocale/_wchar.h 231673 2012-02-14 12:03:23Z theraven $
30  */
31 
32 #ifndef _LOCALE_T_DEFINED
33 #define _LOCALE_T_DEFINED
34 typedef struct      _xlocale *locale_t;
35 #endif
36 
37 #ifndef _XLOCALE_WCHAR1_H
38 #define _XLOCALE_WCHAR1_H
39 #if 0 /* not implemented */
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 #endif
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 size_t                         mbintowcr_l(wchar_t * __restrict,
82                                   const char * __restrict,
83                                   size_t dlen, size_t *,
84                                   locale_t, int);
85 wint_t                         putwc_l(wchar_t, FILE *, locale_t);
86 wint_t                         putwchar_l(wchar_t, locale_t);
87 int                            swprintf_l(wchar_t * __restrict, size_t n, locale_t,
88                                   const wchar_t * __restrict, ...);
89 int                            swscanf_l(const wchar_t * __restrict, locale_t,
90                                  const wchar_t * __restrict, ...);
91 wint_t                         ungetwc_l(wint_t, FILE *, locale_t);
92 int                            vfwprintf_l(FILE * __restrict, locale_t,
93                                   const wchar_t * __restrict, __va_list);
94 int                            vswprintf_l(wchar_t * __restrict, size_t n, locale_t,
95                                   const wchar_t * __restrict, __va_list);
96 int                            vwprintf_l(locale_t, const wchar_t * __restrict,
97                                   __va_list);
98 size_t                         wcrtomb_l(char * __restrict, wchar_t,
99                                   mbstate_t * __restrict, locale_t);
100 size_t                         wcsftime_l(wchar_t * __restrict, size_t,
101                                   const wchar_t * __restrict,
102                                   const struct tm * __restrict, locale_t);
103 size_t                         wcsrtombs_l(char * __restrict,
104                                   const wchar_t ** __restrict, size_t,
105                                   mbstate_t * __restrict, locale_t);
106 size_t                         wcrtombin_l(char * __restrict,
107                                   const wchar_t * __restrict,
108                                   size_t, size_t *,
109                                   locale_t, int);
110 double                         wcstod_l(const wchar_t * __restrict,
111                                   wchar_t ** __restrict, locale_t);
112 long                           wcstol_l(const wchar_t * __restrict,
113                                   wchar_t ** __restrict, int, locale_t);
114 unsigned long                  wcstoul_l(const wchar_t * __restrict,
115                                   wchar_t ** __restrict, int, locale_t);
116 int                            wcswidth_l(const wchar_t *, size_t, locale_t);
117 int                            wctob_l(wint_t, locale_t);
118 int                            wcwidth_l(wchar_t, locale_t);
119 int                            wprintf_l(locale_t, const wchar_t * __restrict, ...);
120 int                            wscanf_l(locale_t, const wchar_t * __restrict, ...);
121 int                            vfwscanf_l(FILE * __restrict, locale_t,
122                                   const wchar_t * __restrict, __va_list);
123 int                            vswscanf_l(const wchar_t * __restrict, locale_t,
124                                   const wchar_t *__restrict, __va_list);
125 int                            vwscanf_l(locale_t, const wchar_t * __restrict,
126                                   __va_list);
127 float                          wcstof_l(const wchar_t * __restrict,
128                                   wchar_t ** __restrict, locale_t);
129 long double                    wcstold_l(const wchar_t * __restrict,
130                                   wchar_t ** __restrict, locale_t);
131 long long            wcstoll_l(const wchar_t * __restrict,
132                                   wchar_t ** __restrict, int, locale_t);
133 unsigned long long   wcstoull_l(const wchar_t * __restrict,
134                                   wchar_t ** __restrict, int, locale_t);
135 size_t                         mbsnrtowcs_l(wchar_t * __restrict,
136                                   const char ** __restrict, size_t, size_t,
137                                   mbstate_t * __restrict, locale_t);
138 size_t                         wcsnrtombs_l(char * __restrict,
139                                   const wchar_t ** __restrict, size_t, size_t,
140                                   mbstate_t * __restrict, locale_t);
141 
142 #endif /* _XLOCALE_WCHAR_H */
143 #endif /* _XLOCALE_H_ */
144