| 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 | |
| 31 | #ifndef _LOCALE_T_DEFINED |
| 32 | #define _LOCALE_T_DEFINED |
| 33 | typedef struct	_xlocale *locale_t; |
| 34 | #endif |
| 35 | |
| 36 | #ifndef _XLOCALE_WCHAR1_H |
| 37 | #define _XLOCALE_WCHAR1_H |
| 38 | int			 wcscasecmp_l(const wchar_t *, const wchar_t *, |
| 39 | 			 locale_t); |
| 40 | int			 wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, |
| 41 | 			 locale_t); |
| 42 | int			 wcscoll_l(const wchar_t *, const wchar_t *, locale_t); |
| 43 | size_t			 wcsxfrm_l(wchar_t * __restrict, |
| 44 | 			 const wchar_t * __restrict, size_t, locale_t); |
| 45 | |
| 46 | #endif /* _XLOCALE_WCHAR1_H */ |
| 47 | |
| 48 | /* |
| 49 | * Only declare the non-POSIX functions if we're included from xlocale.h. |
| 50 | */ |
| 51 | |
| 52 | #ifdef _XLOCALE_H_ |
| 53 | #ifndef _XLOCALE_WCHAR2_H |
| 54 | #define _XLOCALE_WCHAR2_H |
| 55 | |
| 56 | wint_t			 btowc_l(int, locale_t); |
| 57 | wint_t			 fgetwc_l(FILE *, locale_t); |
| 58 | wchar_t			*fgetws_l(wchar_t * __restrict, int, FILE * __restrict, |
| 59 | 			 locale_t); |
| 60 | wint_t			 fputwc_l(wchar_t, FILE *, locale_t); |
| 61 | int			 fputws_l(const wchar_t * __restrict, FILE * __restrict, |
| 62 | 			 locale_t); |
| 63 | int			 fwprintf_l(FILE * __restrict, locale_t, |
| 64 | 			 const wchar_t * __restrict, ...); |
| 65 | int			 fwscanf_l(FILE * __restrict, locale_t, |
| 66 | 			 const wchar_t * __restrict, ...); |
| 67 | wint_t			 getwc_l(FILE *, locale_t); |
| 68 | wint_t			 getwchar_l(locale_t); |
| 69 | size_t			 mbrlen_l(const char * __restrict, size_t, |
| 70 | 			 mbstate_t * __restrict, locale_t); |
| 71 | size_t			 mbrtowc_l(wchar_t * __restrict, |
| 72 | 			 const char * __restrict, size_t, |
| 73 | 			 mbstate_t * __restrict, locale_t); |
| 74 | int			 mbsinit_l(const mbstate_t *, locale_t); |
| 75 | size_t			 mbsrtowcs_l(wchar_t * __restrict, |
| 76 | 			 const char ** __restrict, size_t, |
| 77 | 			 mbstate_t * __restrict, locale_t); |
| 78 | wint_t			 putwc_l(wchar_t, FILE *, locale_t); |
| 79 | wint_t			 putwchar_l(wchar_t, locale_t); |
| 80 | int			 swprintf_l(wchar_t * __restrict, size_t n, locale_t, |
| 81 | 			 const wchar_t * __restrict, ...); |
| 82 | int			 swscanf_l(const wchar_t * __restrict, locale_t, |
| 83 | 			 const wchar_t * __restrict, ...); |
| 84 | wint_t			 ungetwc_l(wint_t, FILE *, locale_t); |
| 85 | int			 vfwprintf_l(FILE * __restrict, locale_t, |
| 86 | 			 const wchar_t * __restrict, __va_list); |
| 87 | int			 vswprintf_l(wchar_t * __restrict, size_t n, locale_t, |
| 88 | 			 const wchar_t * __restrict, __va_list); |
| 89 | int			 vwprintf_l(locale_t, const wchar_t * __restrict, |
| 90 | 			 __va_list); |
| 91 | size_t			 wcrtomb_l(char * __restrict, wchar_t, |
| 92 | 			 mbstate_t * __restrict, locale_t); |
| 93 | size_t			 wcsftime_l(wchar_t * __restrict, size_t, |
| 94 | 			 const wchar_t * __restrict, |
| 95 | 			 const struct tm * __restrict, locale_t); |
| 96 | size_t			 wcsrtombs_l(char * __restrict, |
| 97 | 			 const wchar_t ** __restrict, size_t, |
| 98 | 			 mbstate_t * __restrict, locale_t); |
| 99 | double			 wcstod_l(const wchar_t * __restrict, |
| 100 | 			 wchar_t ** __restrict, locale_t); |
| 101 | long			 wcstol_l(const wchar_t * __restrict, |
| 102 | 			 wchar_t ** __restrict, int, locale_t); |
| 103 | unsigned long		 wcstoul_l(const wchar_t * __restrict, |
| 104 | 			 wchar_t ** __restrict, int, locale_t); |
| 105 | int			 wcswidth_l(const wchar_t *, size_t, locale_t); |
| 106 | int			 wctob_l(wint_t, locale_t); |
| 107 | int			 wcwidth_l(wchar_t, locale_t); |
| 108 | int			 wprintf_l(locale_t, const wchar_t * __restrict, ...); |
| 109 | int			 wscanf_l(locale_t, const wchar_t * __restrict, ...); |
| 110 | int			 vfwscanf_l(FILE * __restrict, locale_t, |
| 111 | 			 const wchar_t * __restrict, __va_list); |
| 112 | int			 vswscanf_l(const wchar_t * __restrict, locale_t, |
| 113 | 			 const wchar_t *__restrict, __va_list); |
| 114 | int			 vwscanf_l(locale_t, const wchar_t * __restrict, |
| 115 | 			 __va_list); |
| 116 | float			 wcstof_l(const wchar_t * __restrict, |
| 117 | 			 wchar_t ** __restrict, locale_t); |
| 118 | long double		 wcstold_l(const wchar_t * __restrict, |
| 119 | 			 wchar_t ** __restrict, locale_t); |
| 120 | long long		 wcstoll_l(const wchar_t * __restrict, |
| 121 | 			 wchar_t ** __restrict, int, locale_t); |
| 122 | unsigned long long	 wcstoull_l(const wchar_t * __restrict, |
| 123 | 			 wchar_t ** __restrict, int, locale_t); |
| 124 | size_t			 mbsnrtowcs_l(wchar_t * __restrict, |
| 125 | 			 const char ** __restrict, size_t, size_t, |
| 126 | 			 mbstate_t * __restrict, locale_t); |
| 127 | size_t			 wcsnrtombs_l(char * __restrict, |
| 128 | 			 const wchar_t ** __restrict, size_t, size_t, |
| 129 | 			 mbstate_t * __restrict, locale_t); |
| 130 | |
| 131 | #endif /* _XLOCALE_WCHAR_H */ |
| 132 | #endif /* _XLOCALE_H_ */ |