xref: /freebsd/include/xlocale/_locale.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1a8ed63bbSDavid Chisnall /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3e58eb3c4SPedro F. Giffuni  *
4a8ed63bbSDavid Chisnall  * Copyright (c) 2011, 2012 The FreeBSD Foundation
5a8ed63bbSDavid Chisnall  *
6a8ed63bbSDavid Chisnall  * This software was developed by David Chisnall under sponsorship from
7a8ed63bbSDavid Chisnall  * the FreeBSD Foundation.
8a8ed63bbSDavid Chisnall  *
9a8ed63bbSDavid Chisnall  * Redistribution and use in source and binary forms, with or without
10a8ed63bbSDavid Chisnall  * modification, are permitted provided that the following conditions
11a8ed63bbSDavid Chisnall  * are met:
12a8ed63bbSDavid Chisnall  * 1. Redistributions of source code must retain the above copyright
13a8ed63bbSDavid Chisnall  *    notice, this list of conditions and the following disclaimer.
14a8ed63bbSDavid Chisnall  * 2. Redistributions in binary form must reproduce the above copyright
15a8ed63bbSDavid Chisnall  *    notice, this list of conditions and the following disclaimer in the
16a8ed63bbSDavid Chisnall  *    documentation and/or other materials provided with the distribution.
17a8ed63bbSDavid Chisnall  *
18a8ed63bbSDavid Chisnall  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19a8ed63bbSDavid Chisnall  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20a8ed63bbSDavid Chisnall  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21a8ed63bbSDavid Chisnall  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22a8ed63bbSDavid Chisnall  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23a8ed63bbSDavid Chisnall  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24a8ed63bbSDavid Chisnall  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25a8ed63bbSDavid Chisnall  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26a8ed63bbSDavid Chisnall  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27a8ed63bbSDavid Chisnall  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28a8ed63bbSDavid Chisnall  * SUCH DAMAGE.
29a8ed63bbSDavid Chisnall  */
30a8ed63bbSDavid Chisnall 
31a8ed63bbSDavid Chisnall #ifndef _XLOCALE_LOCALE_H
32a8ed63bbSDavid Chisnall #define _XLOCALE_LOCALE_H
33a8ed63bbSDavid Chisnall 
342f5007f6SAndrey A. Chernov /* Bit shifting order of LC_*_MASK should match XLC_* and LC_* order. */
35a8ed63bbSDavid Chisnall #define LC_COLLATE_MASK  (1<<0)
36a8ed63bbSDavid Chisnall #define LC_CTYPE_MASK    (1<<1)
372f5007f6SAndrey A. Chernov #define LC_MONETARY_MASK (1<<2)
382f5007f6SAndrey A. Chernov #define LC_NUMERIC_MASK  (1<<3)
392f5007f6SAndrey A. Chernov #define LC_TIME_MASK     (1<<4)
402f5007f6SAndrey A. Chernov #define LC_MESSAGES_MASK (1<<5)
41a8ed63bbSDavid Chisnall #define LC_ALL_MASK      (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \
42a8ed63bbSDavid Chisnall 			  LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK)
43cc7edd25SThomas Munro #define LC_VERSION_MASK  (1<<6)
44a8ed63bbSDavid Chisnall #define LC_GLOBAL_LOCALE ((locale_t)-1)
45a8ed63bbSDavid Chisnall 
46a8ed63bbSDavid Chisnall #ifndef _LOCALE_T_DEFINED
47a8ed63bbSDavid Chisnall #define _LOCALE_T_DEFINED
48a8ed63bbSDavid Chisnall typedef struct	_xlocale *locale_t;
49a8ed63bbSDavid Chisnall #endif
50a8ed63bbSDavid Chisnall 
51a8ed63bbSDavid Chisnall locale_t	 duplocale(locale_t base);
52718fe473SEd Schouten void		 freelocale(locale_t loc);
53a8ed63bbSDavid Chisnall locale_t	 newlocale(int mask, const char *locale, locale_t base);
54a8ed63bbSDavid Chisnall const char	*querylocale(int mask, locale_t loc);
55a8ed63bbSDavid Chisnall locale_t	 uselocale(locale_t loc);
56a8ed63bbSDavid Chisnall 
57a8ed63bbSDavid Chisnall #endif /* _XLOCALE_LOCALE_H */
58