• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2013 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 NDK_ANDROID_SUPPORT_LANGINFO_H
29 #define NDK_ANDROID_SUPPORT_LANGINFO_H
30 
31 #include <nl_types.h>
32 
33 #define _NL_ITEM(category,index)  (((category) << 10) | (index))
34 
35 #define _NL_ITEM_CATEGORY(nl)  ((nl) >> 10)
36 #define _NL_ITEM_INDEX(nl)     ((nl) & 0x3ff)
37 
38 #define CODESET _NL_ITEM(LC_CTYPE, 0)
39 
40 /* Abbreviated days of the week */
41 #define ABDAY_1 _NL_ITEM(LC_TIME,1)
42 #define ABDAY_2 _NL_ITEM(LC_TIME,2)
43 #define ABDAY_3 _NL_ITEM(LC_TIME,3)
44 #define ABDAY_4 _NL_ITEM(LC_TIME,4)
45 #define ABDAY_5 _NL_ITEM(LC_TIME,5)
46 #define ABDAY_6 _NL_ITEM(LC_TIME,6)
47 #define ABDAY_7 _NL_ITEM(LC_TIME,7)
48 
49 /* Long names of the week */
50 #define DAY_1   _NL_ITEM(LC_TIME,11)
51 #define DAY_2   _NL_ITEM(LC_TIME,12)
52 #define DAY_3   _NL_ITEM(LC_TIME,13)
53 #define DAY_4   _NL_ITEM(LC_TIME,14)
54 #define DAY_5   _NL_ITEM(LC_TIME,15)
55 #define DAY_6   _NL_ITEM(LC_TIME,16)
56 #define DAY_7   _NL_ITEM(LC_TIME,17)
57 
58 /* Abbreviated month names */
59 #define ABMON_1  _NL_ITEM(LC_TIME,21)
60 #define ABMON_2  _NL_ITEM(LC_TIME,22)
61 #define ABMON_3  _NL_ITEM(LC_TIME,23)
62 #define ABMON_4  _NL_ITEM(LC_TIME,24)
63 #define ABMON_5  _NL_ITEM(LC_TIME,25)
64 #define ABMON_6  _NL_ITEM(LC_TIME,26)
65 #define ABMON_7  _NL_ITEM(LC_TIME,27)
66 #define ABMON_8  _NL_ITEM(LC_TIME,28)
67 #define ABMON_9  _NL_ITEM(LC_TIME,29)
68 #define ABMON_10 _NL_ITEM(LC_TIME,30)
69 #define ABMON_11 _NL_ITEM(LC_TIME,31)
70 #define ABMON_12 _NL_ITEM(LC_TIME,32)
71 
72 /* Long month names */
73 #define MON_1    _NL_ITEM(LC_TIME,41)
74 #define MON_2    _NL_ITEM(LC_TIME,42)
75 #define MON_3    _NL_ITEM(LC_TIME,43)
76 #define MON_4    _NL_ITEM(LC_TIME,44)
77 #define MON_5    _NL_ITEM(LC_TIME,45)
78 #define MON_6    _NL_ITEM(LC_TIME,46)
79 #define MON_7    _NL_ITEM(LC_TIME,47)
80 #define MON_8    _NL_ITEM(LC_TIME,48)
81 #define MON_9    _NL_ITEM(LC_TIME,49)
82 #define MON_10   _NL_ITEM(LC_TIME,50)
83 #define MON_11   _NL_ITEM(LC_TIME,51)
84 #define MON_12   _NL_ITEM(LC_TIME,52)
85 
86 #define AM_STR      _NL_ITEM(LC_TIME,53)
87 #define PM_STR      _NL_ITEM(LC_TIME,54)
88 #define D_T_FMT     _NL_ITEM(LC_TIME,55)
89 #define D_FMT       _NL_ITEM(LC_TIME,56)
90 #define T_FMT       _NL_ITEM(LC_TIME,57)
91 #define T_FMT_AMPM  _NL_ITEM(LC_TIME,58)
92 #define ERA         _NL_ITEM(LC_TIME,59)
93 #define ERA_D_FMT   _NL_ITEM(LC_TIME,60)
94 #define ERA_D_T_FMT _NL_ITEM(LC_TIME,61)
95 #define ERA_T_FMT   _NL_ITEM(LC_TIME,62)
96 #define ALT_DIGITS  _NL_ITEM(LC_TIME,70)
97 
98 #define INT_CURRENCY_SYMBOL     _NL_ITEM(LC_MONETARY,0)
99 #define CURRENCY_SYMBOL         _NL_ITEM(LC_MONETARY,1)
100 #define MON_DECIMAL_POINT       _NL_ITEM(LC_MONETARY,2)
101 #define MON_THOUSANDS_SEP       _NL_ITEM(LC_MONETARY,3)
102 #define MON_GROUPING            _NL_ITEM(LC_MONETARY,4)
103 #define POSITIVE_SIGN           _NL_ITEM(LC_MONETARY,5)
104 #define NEGATIVE_SIGN           _NL_ITEM(LC_MONETARY,6)
105 #define INT_FRAC_DIGITS         _NL_ITEM(LC_MONETARY,7)
106 #define FRAC_DIGITS             _NL_ITEM(LC_MONETARY,8)
107 
108 #ifdef __cplusplus
109 extern "C" {
110 #endif
111 
112 char *nl_langinfo(nl_item);
113 char *nl_langinfo_l(nl_item, locale_t);
114 
115 #ifdef __cplusplus
116 }  // extern "C"
117 #endif
118 
119 #endif  /* NDK_ANDROID_SUPPORT_LANGINFO_H */
120 
121