Update contrib.
2 **********************************************************************
3 * Copyright (C) 1997-2005, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
9 * Modification History:
11 * Date Name Description
12 * 07/06/2001 Ram Creation.
13 ******************************************************************************
17 #include "unicode/utypes.h"
21 * \brief C API: Unicode Script Information
25 * Constants for Unicode script values from ScriptNames.txt.
29 typedef enum UScriptCode {
30 USCRIPT_INVALID_CODE = -1,
31 USCRIPT_COMMON = 0 , /* Zyyy */
32 USCRIPT_INHERITED = 1, /* Qaai */
33 USCRIPT_ARABIC = 2, /* Arab */
34 USCRIPT_ARMENIAN = 3, /* Armn */
35 USCRIPT_BENGALI = 4, /* Beng */
36 USCRIPT_BOPOMOFO = 5, /* Bopo */
37 USCRIPT_CHEROKEE = 6, /* Cher */
38 USCRIPT_COPTIC = 7, /* Copt */
39 USCRIPT_CYRILLIC = 8, /* Cyrl (Cyrs) */
40 USCRIPT_DESERET = 9, /* Dsrt */
41 USCRIPT_DEVANAGARI = 10, /* Deva */
42 USCRIPT_ETHIOPIC = 11, /* Ethi */
43 USCRIPT_GEORGIAN = 12, /* Geor (Geon, Geoa) */
44 USCRIPT_GOTHIC = 13, /* Goth */
45 USCRIPT_GREEK = 14, /* Grek */
46 USCRIPT_GUJARATI = 15, /* Gujr */
47 USCRIPT_GURMUKHI = 16, /* Guru */
48 USCRIPT_HAN = 17, /* Hani */
49 USCRIPT_HANGUL = 18, /* Hang */
50 USCRIPT_HEBREW = 19, /* Hebr */
51 USCRIPT_HIRAGANA = 20, /* Hira */
52 USCRIPT_KANNADA = 21, /* Knda */
53 USCRIPT_KATAKANA = 22, /* Kana */
54 USCRIPT_KHMER = 23, /* Khmr */
55 USCRIPT_LAO = 24, /* Laoo */
56 USCRIPT_LATIN = 25, /* Latn (Latf, Latg) */
57 USCRIPT_MALAYALAM = 26, /* Mlym */
58 USCRIPT_MONGOLIAN = 27, /* Mong */
59 USCRIPT_MYANMAR = 28, /* Mymr */
60 USCRIPT_OGHAM = 29, /* Ogam */
61 USCRIPT_OLD_ITALIC = 30, /* Ital */
62 USCRIPT_ORIYA = 31, /* Orya */
63 USCRIPT_RUNIC = 32, /* Runr */
64 USCRIPT_SINHALA = 33, /* Sinh */
65 USCRIPT_SYRIAC = 34, /* Syrc (Syrj, Syrn, Syre) */
66 USCRIPT_TAMIL = 35, /* Taml */
67 USCRIPT_TELUGU = 36, /* Telu */
68 USCRIPT_THAANA = 37, /* Thaa */
69 USCRIPT_THAI = 38, /* Thai */
70 USCRIPT_TIBETAN = 39, /* Tibt */
71 /** Canadian_Aboriginal script. @stable ICU 2.6 */
72 USCRIPT_CANADIAN_ABORIGINAL = 40, /* Cans */
73 /** Canadian_Aboriginal script (alias). @stable ICU 2.2 */
74 USCRIPT_UCAS = USCRIPT_CANADIAN_ABORIGINAL,
75 USCRIPT_YI = 41, /* Yiii */
76 USCRIPT_TAGALOG = 42, /* Tglg */
77 USCRIPT_HANUNOO = 43, /* Hano */
78 USCRIPT_BUHID = 44, /* Buhd */
79 USCRIPT_TAGBANWA = 45, /* Tagb */
81 /* New scripts in Unicode 4 @stable ICU 2.6 */
82 USCRIPT_BRAILLE, /* Brai */
83 USCRIPT_CYPRIOT, /* Cprt */
84 USCRIPT_LIMBU, /* Limb */
85 USCRIPT_LINEAR_B, /* Linb */
86 USCRIPT_OSMANYA, /* Osma */
87 USCRIPT_SHAVIAN, /* Shaw */
88 USCRIPT_TAI_LE, /* Tale */
89 USCRIPT_UGARITIC, /* Ugar */
91 /** New script code in Unicode 4.0.1 @draft ICU 3.0 */
92 USCRIPT_KATAKANA_OR_HIRAGANA,/*Hrkt */
94 /* New scripts in Unicode 4.1 @draft ICU 3.4 */
95 USCRIPT_BUGINESE, /* Bugi */
96 USCRIPT_GLAGOLITIC, /* Glag */
97 USCRIPT_KHAROSHTHI, /* Khar */
98 USCRIPT_SYLOTI_NAGRI, /* Sylo */
99 USCRIPT_NEW_TAI_LUE, /* Talu */
100 USCRIPT_TIFINAGH, /* Tfng */
101 USCRIPT_OLD_PERSIAN, /* Xpeo */
107 * Gets script codes associated with the given locale or ISO 15924 abbreviation or name.
108 * Fills in USCRIPT_MALAYALAM given "Malayam" OR "Mlym".
109 * Fills in USCRIPT_LATIN given "en" OR "en_US"
110 * If required capacity is greater than capacity of the destination buffer then the error code
111 * is set to U_BUFFER_OVERFLOW_ERROR and the required capacity is returned
113 * <p>Note: To search by short or long script alias only, use
114 * u_getPropertyValueEnum(UCHAR_SCRIPT, alias) instead. This does
115 * a fast lookup with no access of the locale data.
116 * @param nameOrAbbrOrLocale name of the script, as given in
117 * PropertyValueAliases.txt, or ISO 15924 code or locale
118 * @param fillIn the UScriptCode buffer to fill in the script code
119 * @param capacity the capacity (size) fo UScriptCode buffer passed in.
120 * @param err the error status code.
121 * @return The number of script codes filled in the buffer passed in
124 U_STABLE int32_t U_EXPORT2
125 uscript_getCode(const char* nameOrAbbrOrLocale,UScriptCode* fillIn,int32_t capacity,UErrorCode *err);
128 * Gets a script name associated with the given script code.
129 * Returns "Malayam" given USCRIPT_MALAYALAM
130 * @param scriptCode UScriptCode enum
131 * @return script long name as given in
132 * PropertyValueAliases.txt, or NULL if scriptCode is invalid
135 U_STABLE const char* U_EXPORT2
136 uscript_getName(UScriptCode scriptCode);
139 * Gets a script name associated with the given script code.
140 * Returns "Mlym" given USCRIPT_MALAYALAM
141 * @param scriptCode UScriptCode enum
142 * @return script abbreviated name as given in
143 * PropertyValueAliases.txt, or NULL if scriptCode is invalid
146 U_STABLE const char* U_EXPORT2
147 uscript_getShortName(UScriptCode scriptCode);
150 * Gets the script code associated with the given codepoint.
151 * Returns USCRIPT_MALAYALAM given 0x0D02
152 * @param codepoint UChar32 codepoint
153 * @param err the error status code.
154 * @return The UScriptCode, or 0 if codepoint is invalid
157 U_STABLE UScriptCode U_EXPORT2
158 uscript_getScript(UChar32 codepoint, UErrorCode *err);