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