blob: 69898510d5e0644a39aa8ac9acb767e62fe93f9b [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28#ifndef _LOCALE_H_
29#define _LOCALE_H_
30
31#include <sys/cdefs.h>
Elliott Hughesc4936e22014-04-08 17:05:05 -070032#include <xlocale.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080033
34__BEGIN_DECLS
35
36enum {
37 LC_CTYPE = 0,
38 LC_NUMERIC = 1,
39 LC_TIME = 2,
40 LC_COLLATE = 3,
41 LC_MONETARY = 4,
42 LC_MESSAGES = 5,
43 LC_ALL = 6,
44 LC_PAPER = 7,
45 LC_NAME = 8,
46 LC_ADDRESS = 9,
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080047 LC_TELEPHONE = 10,
48 LC_MEASUREMENT = 11,
49 LC_IDENTIFICATION = 12
50};
51
Elliott Hughesc4936e22014-04-08 17:05:05 -070052#define LC_CTYPE_MASK (1 << LC_CTYPE)
53#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
54#define LC_TIME_MASK (1 << LC_TIME)
55#define LC_COLLATE_MASK (1 << LC_COLLATE)
56#define LC_MONETARY_MASK (1 << LC_MONETARY)
57#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
58#define LC_PAPER_MASK (1 << LC_PAPER)
59#define LC_NAME_MASK (1 << LC_NAME)
60#define LC_ADDRESS_MASK (1 << LC_ADDRESS)
61#define LC_TELEPHONE_MASK (1 << LC_TELEPHONE)
62#define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT)
63#define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION)
64
65#define LC_ALL_MASK (LC_CTYPE_MASK | LC_NUMERIC_MASK | LC_TIME_MASK | LC_COLLATE_MASK | \
66 LC_MONETARY_MASK | LC_MESSAGES_MASK | LC_PAPER_MASK | LC_NAME_MASK | \
67 LC_ADDRESS_MASK | LC_TELEPHONE_MASK | LC_MEASUREMENT_MASK | \
68 LC_IDENTIFICATION_MASK)
69
Pavel Chupin50282f72014-03-25 13:43:04 +040070struct lconv {
71 char* decimal_point;
72 char* thousands_sep;
73 char* grouping;
74 char* int_curr_symbol;
75 char* currency_symbol;
76 char* mon_decimal_point;
77 char* mon_thousands_sep;
78 char* mon_grouping;
79 char* positive_sign;
80 char* negative_sign;
81 char int_frac_digits;
82 char frac_digits;
83 char p_cs_precedes;
84 char p_sep_by_space;
85 char n_cs_precedes;
86 char n_sep_by_space;
87 char p_sign_posn;
88 char n_sign_posn;
Pavel Chupin50282f72014-03-25 13:43:04 +040089 char int_p_cs_precedes;
90 char int_p_sep_by_space;
91 char int_n_cs_precedes;
92 char int_n_sep_by_space;
93 char int_p_sign_posn;
94 char int_n_sign_posn;
95};
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080096
Pavel Chupin50282f72014-03-25 13:43:04 +040097struct lconv* localeconv(void);
Elliott Hughesc4936e22014-04-08 17:05:05 -070098
99locale_t duplocale(locale_t);
100void freelocale(locale_t);
101locale_t newlocale(int, const char*, locale_t);
102char* setlocale(int, const char*);
103locale_t uselocale(locale_t);
104
105#define LC_GLOBAL_LOCALE ((locale_t) -1L)
Pavel Chupin50282f72014-03-25 13:43:04 +0400106
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800107__END_DECLS
108
109#endif /* _LOCALE_H_ */