From 6f5936e1e8a24544cd45799ab45f7e205be6c642 Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Mon, 24 Aug 2015 10:24:15 +0900 Subject: [PATCH 01/16] Modify api description Change-Id: Ibf79691553cf3a062a64a3b3c82e75158712c9bf --- src/include/mobile/utils_i18n_timezone.h | 4 ++-- src/include/mobile/utils_i18n_ucalendar.h | 2 +- src/include/mobile/utils_i18n_udate.h | 13 ++++++++----- src/include/wearable/utils_i18n_timezone.h | 4 ++-- src/include/wearable/utils_i18n_ucalendar.h | 2 +- src/include/wearable/utils_i18n_udate.h | 13 ++++++++----- src/utils_i18n_timezone.cpp | 5 ++--- 7 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/include/mobile/utils_i18n_timezone.h b/src/include/mobile/utils_i18n_timezone.h index a33865b..b34e617 100755 --- a/src/include/mobile/utils_i18n_timezone.h +++ b/src/include/mobile/utils_i18n_timezone.h @@ -289,8 +289,8 @@ int i18n_timezone_get_offset_with_date(i18n_timezone_h timezone, i18n_udate date int i18n_timezone_set_raw_offset(i18n_timezone_h timezone, int32_t offset_milliseconds); /** - * @brief Gets the region code associated with the given system time zone ID. - * @details The region code is either ISO 3166 2-letter country code or UN M.49 3-digit area code. When the time zone is not associated with a specific location, for example - "Etc/UTC", "EST5EDT", then this method returns "001" (UN M.49 area code for World). + * @brief Gets the i18n_timezone_h's raw GMT offset (i.e., the number of milliseconds + * to add to GMT to get local time, before taking daylight savings time into account). * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @param[in] timezone The i18n_timezone_h to get a raw offset. diff --git a/src/include/mobile/utils_i18n_ucalendar.h b/src/include/mobile/utils_i18n_ucalendar.h index 8dae458..7de77be 100644 --- a/src/include/mobile/utils_i18n_ucalendar.h +++ b/src/include/mobile/utils_i18n_ucalendar.h @@ -67,7 +67,7 @@ i18n_ustring_copy_ua(_tzid, tzid); // gets length of '_tzid' - i18n_ustring_get_length(_tzid, &len); + len = i18n_ustring_get_length(_tzid); // creates i18n_ucalendar_h ret = i18n_ucalendar_create(_tzid, len, "en_US", I18N_UCALENDAR_TRADITIONAL, &ucal); if (ret) { diff --git a/src/include/mobile/utils_i18n_udate.h b/src/include/mobile/utils_i18n_udate.h index f5eb738..d6504bb 100644 --- a/src/include/mobile/utils_i18n_udate.h +++ b/src/include/mobile/utils_i18n_udate.h @@ -172,19 +172,22 @@ extern "C" { * @brief Creates a new #i18n_udate_format_h for formatting and parsing dates and times. * @details A #i18n_udate_format_h may be used to format dates in calls to {@link i18n_udate_create()}. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Must release @a format using i18n_udate_destroy(). + * @remarks Must release @a format using i18n_udate_destroy().\n + * If @a pattern parameter is used, pass in #I18N_UDATE_PATTERN for @a time_style and @a date_style. \n + * #I18N_UDATE_PATTERN can only be used in this case, and has to be set for both @a time_style and @a date_style. * * @param[in] time_style The style used to format times\n One of #I18N_UDATE_FULL, #I18N_UDATE_LONG, - * #I18N_UDATE_MEDIUM, #I18N_UDATE_SHORT, #I18N_UDATE_DEFAULT, or #I18N_UDATE_NONE (relative time styles + * #I18N_UDATE_MEDIUM, #I18N_UDATE_SHORT, #I18N_UDATE_DEFAULT, #I18N_UDATE_PATTERN (see remarks) or #I18N_UDATE_NONE (relative time styles * are not currently supported). * @param[in] date_style The style used to format dates\n One of #I18N_UDATE_FULL, #I18N_UDATE_LONG, * #I18N_UDATE_MEDIUM, #I18N_UDATE_SHORT, #I18N_UDATE_DEFAULT, #I18N_UDATE_RELATIVE, #I18N_UDATE_LONG_RELATIVE, - * #I18N_UDATE_MEDIUM_RELATIVE, #I18N_UDATE_SHORT_RELATIVE, #I18N_UDATE_PATTERN, or #I18N_UDATE_NONE + * #I18N_UDATE_MEDIUM_RELATIVE, #I18N_UDATE_SHORT_RELATIVE, #I18N_UDATE_PATTERN (see remarks) or #I18N_UDATE_NONE * @param[in] locale The locale specifying the formatting conventions. * @param[in] tz_id A timezone ID specifying the timezone to use\n If @c 0, use the default timezone. * @param[in] tz_id_len The length of @a tz_id, otherwise @c -1 if NULL-terminated. - * @param[in] pattern A pattern specifying the format to use. The pattern is generated by Udatepg module. - * When the pattern parameter is used, pass in #I18N_UDATE_PATTERN for both time_style and date_style. + * @param[in] pattern A pattern specifying the format to use. The pattern is generated by Udatepg module.\n + * When the pattern parameter is used, pass in #I18N_UDATE_PATTERN for both time_style and date_style.\n + * See remarks for additional conditions. * @param[in] pattern_len The number of characters in the pattern, or otherwise @c -1 if NULL-terminated. * @param[out] format A pointer to an #i18n_udate_format_h to use for formatting dates and times, otherwise @c 0 if an error occurs. * diff --git a/src/include/wearable/utils_i18n_timezone.h b/src/include/wearable/utils_i18n_timezone.h index f049329..b10955a 100755 --- a/src/include/wearable/utils_i18n_timezone.h +++ b/src/include/wearable/utils_i18n_timezone.h @@ -289,8 +289,8 @@ int i18n_timezone_get_offset_with_date(i18n_timezone_h timezone, i18n_udate date int i18n_timezone_set_raw_offset(i18n_timezone_h timezone, int32_t offset_milliseconds); /** - * @brief Gets the region code associated with the given system time zone ID. - * @details The region code is either ISO 3166 2-letter country code or UN M.49 3-digit area code. When the time zone is not associated with a specific location, for example - "Etc/UTC", "EST5EDT", then this method returns "001" (UN M.49 area code for World). + * @brief Gets the i18n_timezone_h's raw GMT offset (i.e., the number of milliseconds + * to add to GMT to get local time, before taking daylight savings time into account). * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @param[in] timezone The i18n_timezone_h to get a raw offset. diff --git a/src/include/wearable/utils_i18n_ucalendar.h b/src/include/wearable/utils_i18n_ucalendar.h index 8dae458..7de77be 100644 --- a/src/include/wearable/utils_i18n_ucalendar.h +++ b/src/include/wearable/utils_i18n_ucalendar.h @@ -67,7 +67,7 @@ i18n_ustring_copy_ua(_tzid, tzid); // gets length of '_tzid' - i18n_ustring_get_length(_tzid, &len); + len = i18n_ustring_get_length(_tzid); // creates i18n_ucalendar_h ret = i18n_ucalendar_create(_tzid, len, "en_US", I18N_UCALENDAR_TRADITIONAL, &ucal); if (ret) { diff --git a/src/include/wearable/utils_i18n_udate.h b/src/include/wearable/utils_i18n_udate.h index f5eb738..d6504bb 100644 --- a/src/include/wearable/utils_i18n_udate.h +++ b/src/include/wearable/utils_i18n_udate.h @@ -172,19 +172,22 @@ extern "C" { * @brief Creates a new #i18n_udate_format_h for formatting and parsing dates and times. * @details A #i18n_udate_format_h may be used to format dates in calls to {@link i18n_udate_create()}. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Must release @a format using i18n_udate_destroy(). + * @remarks Must release @a format using i18n_udate_destroy().\n + * If @a pattern parameter is used, pass in #I18N_UDATE_PATTERN for @a time_style and @a date_style. \n + * #I18N_UDATE_PATTERN can only be used in this case, and has to be set for both @a time_style and @a date_style. * * @param[in] time_style The style used to format times\n One of #I18N_UDATE_FULL, #I18N_UDATE_LONG, - * #I18N_UDATE_MEDIUM, #I18N_UDATE_SHORT, #I18N_UDATE_DEFAULT, or #I18N_UDATE_NONE (relative time styles + * #I18N_UDATE_MEDIUM, #I18N_UDATE_SHORT, #I18N_UDATE_DEFAULT, #I18N_UDATE_PATTERN (see remarks) or #I18N_UDATE_NONE (relative time styles * are not currently supported). * @param[in] date_style The style used to format dates\n One of #I18N_UDATE_FULL, #I18N_UDATE_LONG, * #I18N_UDATE_MEDIUM, #I18N_UDATE_SHORT, #I18N_UDATE_DEFAULT, #I18N_UDATE_RELATIVE, #I18N_UDATE_LONG_RELATIVE, - * #I18N_UDATE_MEDIUM_RELATIVE, #I18N_UDATE_SHORT_RELATIVE, #I18N_UDATE_PATTERN, or #I18N_UDATE_NONE + * #I18N_UDATE_MEDIUM_RELATIVE, #I18N_UDATE_SHORT_RELATIVE, #I18N_UDATE_PATTERN (see remarks) or #I18N_UDATE_NONE * @param[in] locale The locale specifying the formatting conventions. * @param[in] tz_id A timezone ID specifying the timezone to use\n If @c 0, use the default timezone. * @param[in] tz_id_len The length of @a tz_id, otherwise @c -1 if NULL-terminated. - * @param[in] pattern A pattern specifying the format to use. The pattern is generated by Udatepg module. - * When the pattern parameter is used, pass in #I18N_UDATE_PATTERN for both time_style and date_style. + * @param[in] pattern A pattern specifying the format to use. The pattern is generated by Udatepg module.\n + * When the pattern parameter is used, pass in #I18N_UDATE_PATTERN for both time_style and date_style.\n + * See remarks for additional conditions. * @param[in] pattern_len The number of characters in the pattern, or otherwise @c -1 if NULL-terminated. * @param[out] format A pointer to an #i18n_udate_format_h to use for formatting dates and times, otherwise @c 0 if an error occurs. * diff --git a/src/utils_i18n_timezone.cpp b/src/utils_i18n_timezone.cpp index e3dad20..42c4d1f 100755 --- a/src/utils_i18n_timezone.cpp +++ b/src/utils_i18n_timezone.cpp @@ -393,12 +393,11 @@ int i18n_timezone_in_daylight_time(i18n_timezone_h timezone, i18n_udate date, i1 UErrorCode status = U_ZERO_ERROR; *daylight_time = ((TimeZone*)timezone)->inDaylightTime(date, status); - i18n_error_code_e i18n_error; + i18n_error_code_e i18n_error = I18N_ERROR_NONE; ERR_MAPPING(status, i18n_error); I18N_ERR(i18n_error); - return _i18n_error_mapping(status); - + return i18n_error; } int i18n_timezone_has_same_rule(i18n_timezone_h timezone, i18n_timezone_h other, i18n_ubool *same_rule) -- 2.7.4 From ad0de30adaa47560b5efa74fb638e1236cfa6630 Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Mon, 7 Sep 2015 10:40:48 +0900 Subject: [PATCH 02/16] Update version - 1.0.8 - Remove unnecessary codes and descriptions - Add UScriptCode enum Change-Id: I1038e9d9b6147b5713224ab95ea3e25f9262357c --- packaging/capi-base-utils.spec | 2 +- src/include/mobile/utils_i18n.h | 9 + src/include/mobile/utils_i18n_types.h | 1336 ++++++++++++++++++----------- src/include/wearable/utils_i18n.h | 9 + src/include/wearable/utils_i18n_types.h | 1336 ++++++++++++++++++----------- src/include/wearable/utils_i18n_usearch.h | 2 +- src/include/wearable/utils_i18n_ustring.h | 1 - 7 files changed, 1726 insertions(+), 969 deletions(-) mode change 100644 => 100755 src/include/wearable/utils_i18n_ustring.h diff --git a/packaging/capi-base-utils.spec b/packaging/capi-base-utils.spec index 83d1cb4..ae1b44c 100755 --- a/packaging/capi-base-utils.spec +++ b/packaging/capi-base-utils.spec @@ -1,6 +1,6 @@ Name: capi-base-utils Summary: Base Utils -Version: 1.0.7 +Version: 1.0.8 Release: 1 Group: Base License: Apache-2.0 and ICU diff --git a/src/include/mobile/utils_i18n.h b/src/include/mobile/utils_i18n.h index 94a07bd..36345bd 100755 --- a/src/include/mobile/utils_i18n.h +++ b/src/include/mobile/utils_i18n.h @@ -48,6 +48,15 @@ extern "C" { * @defgroup CAPI_BASE_UTILS_I18N_MODULE i18n * @brief The i18n module contains uchar, ucollator, unormalization, usearch, ustring, ucalendar, udate, udatepg, ulocale and unumber. * This module provides flexible generation of number or date format patterns and helps you format and parse dates/number for any locale. + * The i18n module provides various features based on data from ICU. The following table shows the version of ICU used in each Tizen platform. + * + * + * + * + * + * + * + *
Tizen 2.3, 2.3.1, 2.4ICU 51CLDR 23Unicode 6.2
* @section CAPI_BASE_UTILS_I18N_MODULE_HEADER Required Header * \#include * @section CAPI_BASE_UTILS_I18N_MODULE_OVERVIEW Overview diff --git a/src/include/mobile/utils_i18n_types.h b/src/include/mobile/utils_i18n_types.h index a833e08..cf2dde8 100644 --- a/src/include/mobile/utils_i18n_types.h +++ b/src/include/mobile/utils_i18n_types.h @@ -99,48 +99,48 @@ typedef enum { #define I18N_U_MASK(x) ((uint32_t)1<<(x)) /**< Get a single-bit bit set (a flag) from a bit number 0..31. @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif*/ -#define I18N_U_GC_CN_MASK I18N_U_MASK(I18N_UCHAR_U_GENERAL_OTHER_TYPES) /**in the target of a case mapping. Not the same as the general category Cased_Letter. + */ + I18N_UCHAR_S_TERM, + /**< Binary property STerm (new in Unicode 4.0.1). \n + */ + I18N_UCHAR_VARIATION_SELECTOR, + /**< Binary property Variation_Selector (new in Unicode 4.0.1). \n + Indicates all those characters that qualify as Variation Selectors. + */ + I18N_UCHAR_NFD_INERT, + /**< Binary property NFD_Inert. \n + ICU-specific property for characters that are inert under NFD, i.e., they do not interact with adjacent characters. + */ + I18N_UCHAR_NFKD_INERT, + /**< Binary property NFKD_Inert. \n + ICU-specific property for characters that are inert under NFKD, i.e., they do not interact with adjacent characters. + */ + I18N_UCHAR_NFC_INERT, + /**< Binary property NFC_Inert. \n + ICU-specific property for characters that are inert under NFC, i.e., they do not interact with adjacent characters. + */ + I18N_UCHAR_NFKC_INERT, + /**< Binary property NFKC_Inert. \n + ICU-specific property for characters that are inert under NFKC, i.e., they do not interact with adjacent characters. + */ + I18N_UCHAR_SEGMENT_STARTER, + /**< Binary Property Segment_Starter. \n + Property for characters that are starters in terms of Unicode normalization and combining character sequences. + They have ccc=0 and do not occur in non-initial position of the canonical decomposition of any character + (like a-umlaut in NFD and a Jamo T in an NFD(Hangul LVT)). + */ + I18N_UCHAR_PATTERN_SYNTAX, + /**< Binary property Pattern_Syntax (new in Unicode 4.1). \n + */ + I18N_UCHAR_PATTERN_WHITE_SPACE, + /**< Binary property Pattern_White_Space (new in Unicode 4.1). \n + */ + I18N_UCHAR_POSIX_ALNUM, + /**< Binary property alnum (a C/POSIX character class).*/ + I18N_UCHAR_POSIX_BLANK, + /**< Binary property blank (a C/POSIX character class).*/ + I18N_UCHAR_POSIX_GRAPH, + /**< Binary property graph (a C/POSIX character class). */ + I18N_UCHAR_POSIX_PRINT, + /**< Binary property print (a C/POSIX character class). */ + I18N_UCHAR_POSIX_XDIGIT, + /**< Binary property xdigit (a C/POSIX character class). */ + I18N_UCHAR_CASED, + /**< Binary property Cased. \n + For Lowercase, Uppercase and Titlecase characters. + */ + I18N_UCHAR_CASE_IGNORABLE, + /**< Binary property Case_Ignorable. \n + Used in context-sensitive case mappings. + */ + I18N_UCHAR_CHANGES_WHEN_LOWERCASED, + /**< Binary property Changes_When_Lowercased. */ + I18N_UCHAR_CHANGES_WHEN_UPPERCASED, + /**< Binary property Changes_When_Uppercased. */ + I18N_UCHAR_CHANGES_WHEN_TITLECASED, + /**< Binary property Changes_When_Titlecased. */ + I18N_UCHAR_CHANGES_WHEN_CASEFOLDED, + /**< Binary property Changes_When_Casefolded. */ + I18N_UCHAR_CHANGES_WHEN_CASEMAPPED, + /**< Binary property Changes_When_Casemapped. */ + I18N_UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED, + /**< Binary property Changes_When_NFKC_Casefolded. */ + I18N_UCHAR_BINARY_LIMIT, + /**< One more than the last constant for binary Unicode properties. */ + I18N_UCHAR_BIDI_CLASS = 0x1000, + /**< Enumerated property Bidi_Class. \n + Same as u_charDirection, returns #i18n_uchar_direction_e values. + */ + I18N_UCHAR_INT_START = I18N_UCHAR_BIDI_CLASS, + /**< First constant for enumerated/integer Unicode properties. */ + I18N_UCHAR_BLOCK, + /**< Enumerated property Block. \n + Returns #i18n_uchar_ublock_code_e values. + */ + I18N_UCHAR_CANONICAL_COMBINING_CLASS, + /**< Enumerated property Canonical_Combining_Class. \n + Returns 8-bit numeric values. + */ + I18N_UCHAR_DECOMPOSITION_TYPE, + /**< Enumerated property Decomposition_Type. \n + Returns #i18n_uchar_u_decomposition_type_e values. + */ + I18N_UCHAR_EAST_ASIAN_WIDTH, + /**< Enumerated property East_Asian_Width. \n + Returns #i18n_uchar_u_east_asian_width_e values. + */ + I18N_UCHAR_GENERAL_CATEGORY, + /**< Enumerated property General_Category. \n + Returns #i18n_uchar_category_e values. + */ + I18N_UCHAR_JOINING_GROUP, + /**< Enumerated property Joining_Group. \n + Returns #i18n_uchar_u_joining_group_e values. + */ + I18N_UCHAR_JOINING_TYPE, + /**< Enumerated property Joining_Type. \n + Returns #i18n_uchar_u_joining_type_e values. + */ + I18N_UCHAR_LINE_BREAK, + /**< Enumerated property Line_Break. \n + Returns #i18n_uchar_u_line_break_e values. + */ + I18N_UCHAR_NUMERIC_TYPE, + /**< Enumerated property Numeric_Type. \n + Returns #i18n_uchar_u_numeric_type_e values. + */ + I18N_UCHAR_SCRIPT, + /**< Enumerated property Script. \n + Returns #i18n_uscript_code_e values. + */ + I18N_UCHAR_HANGUL_SYLLABLE_TYPE, + /**< Enumerated property Hangul_Syllable_Type, new in Unicode 4. \n + Returns #i18n_uchar_u_hangul_syllable_type_e values. + */ + I18N_UCHAR_NFD_QUICK_CHECK, + /**< Enumerated property NFD_Quick_Check. \n + Returns #i18n_unormalization_check_result_e values. + */ + I18N_UCHAR_NFKD_QUICK_CHECK, + /**< Enumerated property NFKD_Quick_Check. \n + Returns #i18n_unormalization_check_result_e values. + */ + I18N_UCHAR_NFC_QUICK_CHECK, + /**< Enumerated property NFC_Quick_Check. \n + Returns #i18n_unormalization_check_result_e values. + */ + I18N_UCHAR_NFKC_QUICK_CHECK, + /**< Enumerated property NFKC_Quick_Check. \n + Returns #i18n_unormalization_check_result_e values. + */ + I18N_UCHAR_LEAD_CANONICAL_COMBINING_CLASS, + /**< Enumerated property Lead_Canonical_Combining_Class. \n + Returns 8-bit numeric values like #UCHAR_CANONICAL_COMBINING_CLASS. + */ + I18N_UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, + /**< Enumerated property Trail_Canonical_Combining_Class. \n + Returns 8-bit numeric values like #UCHAR_CANONICAL_COMBINING_CLASS. + */ + I18N_UCHAR_GRAPHEME_CLUSTER_BREAK, + /**< Enumerated property Grapheme_Cluster_Break (new in Unicode 4.1). \n + Returns #i18n_uchar_u_grapheme_cluster_break_e values. + */ + I18N_UCHAR_SENTENCE_BREAK, + /**< Enumerated property Sentence_Break (new in Unicode 4.1). \n + Returns #i18n_uchar_u_sentence_break_e values. + */ + I18N_UCHAR_WORD_BREAK, + /**< Enumerated property Word_Break (new in Unicode 4.1). \n + Returns #i18n_uchar_u_word_break_values_e values. + */ + I18N_UCHAR_BIDI_PAIRED_BRACKET_TYPE, + /**< Unsupported yet. Please do not use. */ + I18N_UCHAR_INT_LIMIT, + /**< One more than the last constant for enumerated/integer Unicode properties. */ + I18N_UCHAR_GENERAL_CATEGORY_MASK = 0x2000, + /**< Bitmask property General_Category_Mask. \n + Mask values should be cast to uint32_t. + */ + I18N_UCHAR_MASK_START = I18N_UCHAR_GENERAL_CATEGORY_MASK, + /**< First constant for bit-mask Unicode properties. */ + I18N_UCHAR_MASK_LIMIT, + /**< One more than the last constant for bit-mask Unicode properties. */ + I18N_UCHAR_NUMERIC_VALUE = 0x3000, + /**< Double property Numeric_Value. */ + I18N_UCHAR_DOUBLE_START = I18N_UCHAR_NUMERIC_VALUE, + /**< First constant for double Unicode properties. */ + I18N_UCHAR_DOUBLE_LIMIT, + /**< One more than the last constant for double Unicode properties. */ + I18N_UCHAR_AGE = 0x4000, + /**< String property Age. */ + I18N_UCHAR_STRING_START = I18N_UCHAR_AGE, + /**< First constant for string Unicode properties. */ + I18N_UCHAR_BIDI_MIRRORING_GLYPH, + /**< String property Bidi_Mirroring_Glyph. */ + I18N_UCHAR_CASE_FOLDING, + /**< String property Case_Folding. */ + I18N_UCHAR_LOWERCASE_MAPPING = 0x4004, + /**< String property Lowercase_Mapping. */ + I18N_UCHAR_NAME, + /**< String property Name. */ + I18N_UCHAR_SIMPLE_CASE_FOLDING, + /**< String property Simple_Case_Folding. */ + I18N_UCHAR_SIMPLE_LOWERCASE_MAPPING, + /**< String property Simple_Lowercase_Mapping. */ + I18N_UCHAR_SIMPLE_TITLECASE_MAPPING, + /**< String property Simple_Titlecase_Mapping. */ + I18N_UCHAR_SIMPLE_UPPERCASE_MAPPING, + /**< String property Simple_Uppercase_Mapping. */ + I18N_UCHAR_TITLECASE_MAPPING, + /**< String property Titlecase_Mapping. */ + I18N_UCHAR_UPPERCASE_MAPPING = 0x400C, + /**< String property Uppercase_Mapping. */ + I18N_UCHAR_BIDI_PAIRED_BRACKET, + /**< Unsupported yet. Please do not use. */ + I18N_UCHAR_STRING_LIMIT, + /**< One more than the last constant for string Unicode properties. */ + I18N_UCHAR_SCRIPT_EXTENSIONS = 0x7000, + /**< Provisional property Script_Extensions (new in Unicode 6.0). */ + I18N_UCHAR_OTHER_PROPERTY_START = I18N_UCHAR_SCRIPT_EXTENSIONS, + /**< First constant for Unicode properties with unusual value types. */ + I18N_UCHAR_OTHER_PROPERTY_LIMIT, + /**< One more than the last constant for Unicode properties with unusual value types. */ + I18N_UCHAR_INVALID_CODE = -1 + /**< Represents a nonexistent or invalid property or property value. */ } i18n_uchar_uproperty_e; /** @@ -351,235 +585,228 @@ typedef enum { * */ typedef enum { - I18N_UCHAR_UBLOCK_NO_BLOCK, /**< */ - I18N_UCHAR_UBLOCK_BASIC_LATIN, /**< */ - I18N_UCHAR_UBLOCK_LATIN_1_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_B, /**< */ - I18N_UCHAR_UBLOCK_IPA_EXTENSIONS, /**< */ - I18N_UCHAR_UBLOCK_SPACING_MODIFIER_LETTERS, /**< */ - I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS, /**< */ - I18N_UCHAR_UBLOCK_GREEK, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC, /**< */ - I18N_UCHAR_UBLOCK_ARMENIAN, /**< */ - I18N_UCHAR_UBLOCK_HEBREW, /**< */ - I18N_UCHAR_UBLOCK_ARABIC, /**< */ - I18N_UCHAR_UBLOCK_SYRIAC, /**< */ - I18N_UCHAR_UBLOCK_THAANA, /**< */ - I18N_UCHAR_UBLOCK_DEVANAGARI, /**< */ - I18N_UCHAR_UBLOCK_BENGALI, /**< */ - I18N_UCHAR_UBLOCK_GURMUKHI, /**< */ - I18N_UCHAR_UBLOCK_GUJARATI, /**< */ - I18N_UCHAR_UBLOCK_ORIYA, /**< */ - I18N_UCHAR_UBLOCK_TAMIL, /**< */ - I18N_UCHAR_UBLOCK_TELUGU, /**< */ - I18N_UCHAR_UBLOCK_KANNADA, /**< */ - I18N_UCHAR_UBLOCK_MALAYALAM, /**< */ - I18N_UCHAR_UBLOCK_SINHALA, /**< */ - I18N_UCHAR_UBLOCK_THAI, /**< */ - I18N_UCHAR_UBLOCK_LAO, /**< */ - I18N_UCHAR_UBLOCK_TIBETAN, /**< */ - I18N_UCHAR_UBLOCK_MYANMAR, /**< */ - I18N_UCHAR_UBLOCK_GEORGIAN, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_JAMO, /**< */ - I18N_UCHAR_UBLOCK_ETHIOPIC, /**< */ - I18N_UCHAR_UBLOCK_CHEROKEE, /**< */ - I18N_UCHAR_UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS, /**< */ - I18N_UCHAR_UBLOCK_OGHAM, /**< */ - I18N_UCHAR_UBLOCK_RUNIC, /**< */ - I18N_UCHAR_UBLOCK_KHMER, /**< */ - I18N_UCHAR_UBLOCK_MONGOLIAN, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_ADDITIONAL, /**< */ - I18N_UCHAR_UBLOCK_GREEK_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_GENERAL_PUNCTUATION, /**< */ - I18N_UCHAR_UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS, /**< */ - I18N_UCHAR_UBLOCK_CURRENCY_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_COMBINING_MARKS_FOR_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_LETTERLIKE_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_NUMBER_FORMS, /**< */ - I18N_UCHAR_UBLOCK_ARROWS, /**< */ - I18N_UCHAR_UBLOCK_MATHEMATICAL_OPERATORS, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_TECHNICAL, /**< */ - I18N_UCHAR_UBLOCK_CONTROL_PICTURES, /**< */ - I18N_UCHAR_UBLOCK_OPTICAL_CHARACTER_RECOGNITION, /**< */ - I18N_UCHAR_UBLOCK_ENCLOSED_ALPHANUMERICS, /**< */ - I18N_UCHAR_UBLOCK_BOX_DRAWING, /**< */ - I18N_UCHAR_UBLOCK_BLOCK_ELEMENTS, /**< */ - I18N_UCHAR_UBLOCK_GEOMETRIC_SHAPES, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_DINGBATS, /**< */ - I18N_UCHAR_UBLOCK_BRAILLE_PATTERNS, /**< */ - I18N_UCHAR_UBLOCK_CJK_RADICALS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_KANGXI_RADICALS, /**< */ - I18N_UCHAR_UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS, /**< */ - I18N_UCHAR_UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION, /**< */ - I18N_UCHAR_UBLOCK_HIRAGANA, /**< */ - I18N_UCHAR_UBLOCK_KATAKANA, /**< */ - I18N_UCHAR_UBLOCK_BOPOMOFO, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_COMPATIBILITY_JAMO, /**< */ - I18N_UCHAR_UBLOCK_KANBUN, /**< */ - I18N_UCHAR_UBLOCK_BOPOMOFO_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS, /**< */ - I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS, /**< */ - I18N_UCHAR_UBLOCK_YI_SYLLABLES, /**< */ - I18N_UCHAR_UBLOCK_YI_RADICALS, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_SYLLABLES, /**< */ - I18N_UCHAR_UBLOCK_HIGH_SURROGATES, /**< */ - I18N_UCHAR_UBLOCK_HIGH_PRIVATE_USE_SURROGATES, /**< */ - I18N_UCHAR_UBLOCK_LOW_SURROGATES, /**< */ - I18N_UCHAR_UBLOCK_PRIVATE_USE_AREA, /**< */ - I18N_UCHAR_UBLOCK_PRIVATE_USE, /**< */ - I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, /**< */ - - I18N_UCHAR_UBLOCK_ALPHABETIC_PRESENTATION_FORMS, /**< */ - I18N_UCHAR_UBLOCK_ARABIC_PRESENTATION_FORMS_A, /**< */ - I18N_UCHAR_UBLOCK_COMBINING_HALF_MARKS, /**< */ - I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_FORMS, /**< */ - I18N_UCHAR_UBLOCK_SMALL_FORM_VARIANTS, /**< */ - I18N_UCHAR_UBLOCK_ARABIC_PRESENTATION_FORMS_B, /**< */ - I18N_UCHAR_UBLOCK_SPECIALS, /**< */ - I18N_UCHAR_UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, /**< */ - I18N_UCHAR_UBLOCK_OLD_ITALIC, /**< */ - I18N_UCHAR_UBLOCK_GOTHIC, /**< */ - I18N_UCHAR_UBLOCK_DESERET, /**< */ - I18N_UCHAR_UBLOCK_BYZANTINE_MUSICAL_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_MUSICAL_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, /**< */ - I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_TAGS, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC_SUPPLEMENTARY, /**< */ - I18N_UCHAR_UBLOCK_TAGALOG, /**< */ - I18N_UCHAR_UBLOCK_HANUNOO, /**< */ - I18N_UCHAR_UBLOCK_BUHID, /**< */ - I18N_UCHAR_UBLOCK_TAGBANWA, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_A, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_B, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS, /**< */ - I18N_UCHAR_UBLOCK_KATAKANA_PHONETIC_EXTENSIONS, /**< */ - I18N_UCHAR_UBLOCK_VARIATION_SELECTORS, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B, /**< */ - I18N_UCHAR_UBLOCK_LIMBU, /**< */ - I18N_UCHAR_UBLOCK_TAI_LE, /**< */ - I18N_UCHAR_UBLOCK_KHMER_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_PHONETIC_EXTENSIONS, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS, /**< */ - I18N_UCHAR_UBLOCK_YIJING_HEXAGRAM_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_LINEAR_B_SYLLABARY, /**< */ - I18N_UCHAR_UBLOCK_LINEAR_B_IDEOGRAMS, /**< */ - I18N_UCHAR_UBLOCK_AEGEAN_NUMBERS, /**< */ - I18N_UCHAR_UBLOCK_UGARITIC, /**< */ - I18N_UCHAR_UBLOCK_SHAVIAN, /**< */ - I18N_UCHAR_UBLOCK_OSMANYA, /**< */ - I18N_UCHAR_UBLOCK_CYPRIOT_SYLLABARY, /**< */ - I18N_UCHAR_UBLOCK_TAI_XUAN_JING_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_VARIATION_SELECTORS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION, /**< */ - I18N_UCHAR_UBLOCK_ANCIENT_GREEK_NUMBERS, /**< */ - I18N_UCHAR_UBLOCK_ARABIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_BUGINESE, /**< */ - I18N_UCHAR_UBLOCK_CJK_STROKES, /**< */ - I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_COPTIC, /**< */ - I18N_UCHAR_UBLOCK_ETHIOPIC_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_ETHIOPIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_GEORGIAN_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_GLAGOLITIC, /**< */ - I18N_UCHAR_UBLOCK_KHAROSHTHI, /**< */ - I18N_UCHAR_UBLOCK_MODIFIER_TONE_LETTERS, /**< */ - I18N_UCHAR_UBLOCK_NEW_TAI_LUE, /**< */ - I18N_UCHAR_UBLOCK_OLD_PERSIAN, /**< */ - I18N_UCHAR_UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTAL_PUNCTUATION, /**< */ - I18N_UCHAR_UBLOCK_SYLOTI_NAGRI, /**< */ - I18N_UCHAR_UBLOCK_TIFINAGH, /**< */ - I18N_UCHAR_UBLOCK_VERTICAL_FORMS, /**< */ - I18N_UCHAR_UBLOCK_NKO, /**< */ - I18N_UCHAR_UBLOCK_BALINESE, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_C, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_D, /**< */ - I18N_UCHAR_UBLOCK_PHAGS_PA, /**< */ - I18N_UCHAR_UBLOCK_PHOENICIAN, /**< */ - I18N_UCHAR_UBLOCK_CUNEIFORM, /**< */ - I18N_UCHAR_UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION, /**< */ - I18N_UCHAR_UBLOCK_COUNTING_ROD_NUMERALS, /**< */ - I18N_UCHAR_UBLOCK_SUNDANESE, /**< */ - I18N_UCHAR_UBLOCK_LEPCHA, /**< */ - I18N_UCHAR_UBLOCK_OL_CHIKI, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_VAI, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC_EXTENDED_B, /**< */ - I18N_UCHAR_UBLOCK_SAURASHTRA, /**< */ - I18N_UCHAR_UBLOCK_KAYAH_LI, /**< */ - I18N_UCHAR_UBLOCK_REJANG, /**< */ - I18N_UCHAR_UBLOCK_CHAM, /**< */ - I18N_UCHAR_UBLOCK_ANCIENT_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_PHAISTOS_DISC, /**< */ - I18N_UCHAR_UBLOCK_LYCIAN, /**< */ - I18N_UCHAR_UBLOCK_CARIAN, /**< */ - I18N_UCHAR_UBLOCK_LYDIAN, /**< */ - I18N_UCHAR_UBLOCK_MAHJONG_TILES, /**< */ - I18N_UCHAR_UBLOCK_DOMINO_TILES, /**< */ - I18N_UCHAR_UBLOCK_SAMARITAN, /**< */ - I18N_UCHAR_UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_TAI_THAM, /**< */ - I18N_UCHAR_UBLOCK_VEDIC_EXTENSIONS, /**< */ - I18N_UCHAR_UBLOCK_LISU, /**< */ - I18N_UCHAR_UBLOCK_BAMUM, /**< */ - I18N_UCHAR_UBLOCK_COMMON_INDIC_NUMBER_FORMS, /**< */ - I18N_UCHAR_UBLOCK_DEVANAGARI_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_JAVANESE, /**< */ - I18N_UCHAR_UBLOCK_MYANMAR_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_TAI_VIET, /**< */ - I18N_UCHAR_UBLOCK_MEETEI_MAYEK, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_B, /**< */ - I18N_UCHAR_UBLOCK_IMPERIAL_ARAMAIC, /**< */ - I18N_UCHAR_UBLOCK_OLD_SOUTH_ARABIAN, /**< */ - I18N_UCHAR_UBLOCK_AVESTAN, /**< */ - I18N_UCHAR_UBLOCK_INSCRIPTIONAL_PARTHIAN, /**< */ - I18N_UCHAR_UBLOCK_INSCRIPTIONAL_PAHLAVI, /**< */ - I18N_UCHAR_UBLOCK_OLD_TURKIC, /**< */ - I18N_UCHAR_UBLOCK_RUMI_NUMERAL_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_KAITHI, /**< */ - I18N_UCHAR_UBLOCK_EGYPTIAN_HIEROGLYPHS, /**< */ - I18N_UCHAR_UBLOCK_ENCLOSED_ALPHANUMERIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C, /**< */ - I18N_UCHAR_UBLOCK_MANDAIC, /**< */ - I18N_UCHAR_UBLOCK_BATAK, /**< */ - I18N_UCHAR_UBLOCK_ETHIOPIC_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_BRAHMI, /**< */ - I18N_UCHAR_UBLOCK_BAMUM_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_KANA_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_PLAYING_CARDS, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS, /**< */ - I18N_UCHAR_UBLOCK_EMOTICONS, /**< */ - I18N_UCHAR_UBLOCK_TRANSPORT_AND_MAP_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_ALCHEMICAL_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D, /**< */ - I18N_UCHAR_UBLOCK_COUNT, /**< */ - I18N_UCHAR_UBLOCK_INVALID_CODE = -1 /**< */ + I18N_UCHAR_UBLOCK_NO_BLOCK, /**< No Block */ + I18N_UCHAR_UBLOCK_BASIC_LATIN, /**< Basic Latin */ + I18N_UCHAR_UBLOCK_LATIN_1_SUPPLEMENT, /**< Latin_1 Supplement */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_A, /**< Latin Extended A */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_B, /**< Latin Extended B */ + I18N_UCHAR_UBLOCK_IPA_EXTENSIONS, /**< IPA Extensions */ + I18N_UCHAR_UBLOCK_SPACING_MODIFIER_LETTERS, /**< Spacing Modifier Letters */ + I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS, /**< Combining Diacritical Marks */ + I18N_UCHAR_UBLOCK_GREEK, /**< Greek */ + I18N_UCHAR_UBLOCK_CYRILLIC, /**< Cyrillic */ + I18N_UCHAR_UBLOCK_ARMENIAN, /**< Armenian */ + I18N_UCHAR_UBLOCK_HEBREW, /**< Hebrew */ + I18N_UCHAR_UBLOCK_ARABIC, /**< Arabic */ + I18N_UCHAR_UBLOCK_SYRIAC, /**< Syriac */ + I18N_UCHAR_UBLOCK_THAANA, /**< Thaana */ + I18N_UCHAR_UBLOCK_DEVANAGARI, /**< Devanagari */ + I18N_UCHAR_UBLOCK_BENGALI, /**< Bengali */ + I18N_UCHAR_UBLOCK_GURMUKHI, /**< Gurmukhi */ + I18N_UCHAR_UBLOCK_GUJARATI, /**< Gujarati */ + I18N_UCHAR_UBLOCK_ORIYA, /**< Oriya */ + I18N_UCHAR_UBLOCK_TAMIL, /**< Tamil */ + I18N_UCHAR_UBLOCK_TELUGU, /**< Telugu */ + I18N_UCHAR_UBLOCK_KANNADA, /**< Kannada */ + I18N_UCHAR_UBLOCK_MALAYALAM, /**< Malayalam */ + I18N_UCHAR_UBLOCK_SINHALA, /**< Sinhala */ + I18N_UCHAR_UBLOCK_THAI, /**< Thai */ + I18N_UCHAR_UBLOCK_LAO, /**< Lao */ + I18N_UCHAR_UBLOCK_TIBETAN, /**< Tibetan */ + I18N_UCHAR_UBLOCK_MYANMAR, /**< Myanmar */ + I18N_UCHAR_UBLOCK_GEORGIAN, /**< Georgian */ + I18N_UCHAR_UBLOCK_HANGUL_JAMO, /**< Hangul Jamo */ + I18N_UCHAR_UBLOCK_ETHIOPIC, /**< Ethiopic */ + I18N_UCHAR_UBLOCK_CHEROKEE, /**< Cherokee */ + I18N_UCHAR_UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS, /**< Unified Canadian Aboriginal Syllabics */ + I18N_UCHAR_UBLOCK_OGHAM, /**< Ogham */ + I18N_UCHAR_UBLOCK_RUNIC, /**< Runic */ + I18N_UCHAR_UBLOCK_KHMER, /**< Khmer */ + I18N_UCHAR_UBLOCK_MONGOLIAN, /**< Mongolian */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_ADDITIONAL, /**< Latin Extended Additional */ + I18N_UCHAR_UBLOCK_GREEK_EXTENDED, /**< Greek Extended */ + I18N_UCHAR_UBLOCK_GENERAL_PUNCTUATION, /**< General Punctuation */ + I18N_UCHAR_UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS, /**< Superscripts And Subscripts */ + I18N_UCHAR_UBLOCK_CURRENCY_SYMBOLS, /**< Currency Symbols */ + I18N_UCHAR_UBLOCK_COMBINING_MARKS_FOR_SYMBOLS, /**< Combining Marks For Symbols */ + I18N_UCHAR_UBLOCK_LETTERLIKE_SYMBOLS, /**< Letterlike Symbols */ + I18N_UCHAR_UBLOCK_NUMBER_FORMS, /**< Number Forms */ + I18N_UCHAR_UBLOCK_ARROWS, /**< Arrows */ + I18N_UCHAR_UBLOCK_MATHEMATICAL_OPERATORS, /**< Mathematical Operators */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_TECHNICAL, /**< Miscellaneous Technical */ + I18N_UCHAR_UBLOCK_CONTROL_PICTURES, /**< Control Pictures */ + I18N_UCHAR_UBLOCK_OPTICAL_CHARACTER_RECOGNITION, /**< Optical Character Recognition */ + I18N_UCHAR_UBLOCK_ENCLOSED_ALPHANUMERICS, /**< Enclosed Alphanumerics */ + I18N_UCHAR_UBLOCK_BOX_DRAWING, /**< Box Drawing */ + I18N_UCHAR_UBLOCK_BLOCK_ELEMENTS, /**< Block Elements */ + I18N_UCHAR_UBLOCK_GEOMETRIC_SHAPES, /**< Geometric Shapes */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS, /**< Miscellaneous Symbols */ + I18N_UCHAR_UBLOCK_DINGBATS, /**< Dingbats */ + I18N_UCHAR_UBLOCK_BRAILLE_PATTERNS, /**< Braille Patterns */ + I18N_UCHAR_UBLOCK_CJK_RADICALS_SUPPLEMENT, /**< CJK Radicals Supplement */ + I18N_UCHAR_UBLOCK_KANGXI_RADICALS, /**< Kangxi Radicals */ + I18N_UCHAR_UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS, /**< Ideographic Description Characters */ + I18N_UCHAR_UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION, /**< CJK Symbols And Punctuation */ + I18N_UCHAR_UBLOCK_HIRAGANA, /**< Hiragana */ + I18N_UCHAR_UBLOCK_KATAKANA, /**< Katakana */ + I18N_UCHAR_UBLOCK_BOPOMOFO, /**< Bopomofo */ + I18N_UCHAR_UBLOCK_HANGUL_COMPATIBILITY_JAMO, /**< Hangul Compatibility Jamo */ + I18N_UCHAR_UBLOCK_KANBUN, /**< Kanbun */ + I18N_UCHAR_UBLOCK_BOPOMOFO_EXTENDED, /**< Bopomofo Extended */ + I18N_UCHAR_UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS, /**< Enclosed CJK Letters And Months */ + I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY, /**< CJK Compatibility */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A, /**< CJK Unified Ideographs Extension A */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS, /**< CJK Unified Ideographs */ + I18N_UCHAR_UBLOCK_YI_SYLLABLES, /**< Yi Syllables */ + I18N_UCHAR_UBLOCK_YI_RADICALS, /**< Yi Radicals */ + I18N_UCHAR_UBLOCK_HANGUL_SYLLABLES, /**< Hangul Syllables */ + I18N_UCHAR_UBLOCK_HIGH_SURROGATES, /**< High Surrogates */ + I18N_UCHAR_UBLOCK_HIGH_PRIVATE_USE_SURROGATES, /**< High Private Use Surrogates */ + I18N_UCHAR_UBLOCK_LOW_SURROGATES, /**< Low Surrogates */ + I18N_UCHAR_UBLOCK_PRIVATE_USE_AREA, /**< Private Use Area */ + I18N_UCHAR_UBLOCK_PRIVATE_USE, /**< Private Use */ + I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, /**< CJK Compatibility Ideographs */ + + I18N_UCHAR_UBLOCK_ALPHABETIC_PRESENTATION_FORMS, /**< Alphabetic Presentation Forms */ + I18N_UCHAR_UBLOCK_ARABIC_PRESENTATION_FORMS_A, /**< Arabic Presentation Forms A */ + I18N_UCHAR_UBLOCK_COMBINING_HALF_MARKS, /**< Combining Half Marks */ + I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_FORMS, /**< CJK Compatibility Forms */ + I18N_UCHAR_UBLOCK_SMALL_FORM_VARIANTS, /**< Small Form Variants */ + I18N_UCHAR_UBLOCK_ARABIC_PRESENTATION_FORMS_B, /**< Arabic Presentation Forms B */ + I18N_UCHAR_UBLOCK_SPECIALS, /**< Specials */ + I18N_UCHAR_UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, /**< Halfwidth And Fullwidth Forms */ + I18N_UCHAR_UBLOCK_OLD_ITALIC, /**< Old Italic */ + I18N_UCHAR_UBLOCK_GOTHIC, /**< Gothic */ + I18N_UCHAR_UBLOCK_DESERET, /**< Deseret */ + I18N_UCHAR_UBLOCK_BYZANTINE_MUSICAL_SYMBOLS, /**< Byzantine Musical Symbols */ + I18N_UCHAR_UBLOCK_MUSICAL_SYMBOLS, /**< Musical Symbols */ + I18N_UCHAR_UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS, /**< Mathematical Alphanumeric Symbols */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, /**< CJK Unified Ideographs Extension B */ + I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, /**< CJK Compatibility Ideographs Supplement */ + I18N_UCHAR_UBLOCK_TAGS, /**< Tags */ + I18N_UCHAR_UBLOCK_CYRILLIC_SUPPLEMENT, /**< Cyrillic Supplement */ + I18N_UCHAR_UBLOCK_CYRILLIC_SUPPLEMENTARY, /**< Cyrillic Supplementary */ + I18N_UCHAR_UBLOCK_TAGALOG, /**< Tagalog */ + I18N_UCHAR_UBLOCK_HANUNOO, /**< Hanunoo */ + I18N_UCHAR_UBLOCK_BUHID, /**< Buhid */ + I18N_UCHAR_UBLOCK_TAGBANWA, /**< Tagbanwa */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A, /**< Miscellaneous Mathematical Symbols A */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_A, /**< Supplemental Arrows A */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_B, /**< Supplemental Arrows B */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B, /**< Miscellaneous Mathematical Symbols B */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS, /**< Supplemental Mathematical Operators */ + I18N_UCHAR_UBLOCK_KATAKANA_PHONETIC_EXTENSIONS, /**< Katakana Phonetic Extensions */ + I18N_UCHAR_UBLOCK_VARIATION_SELECTORS, /**< Variation Selectors */ + I18N_UCHAR_UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A, /**< Supplementary Private Use Area A */ + I18N_UCHAR_UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B, /**< Supplementary Private Use Area B */ + I18N_UCHAR_UBLOCK_LIMBU, /**< Limbu */ + I18N_UCHAR_UBLOCK_TAI_LE, /**< Tai Le */ + I18N_UCHAR_UBLOCK_KHMER_SYMBOLS, /**< Khmer Symbols */ + I18N_UCHAR_UBLOCK_PHONETIC_EXTENSIONS, /**< Phonetic Extensions */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS, /**< Miscellaneous Symbols And Arrows */ + I18N_UCHAR_UBLOCK_YIJING_HEXAGRAM_SYMBOLS, /**< Yijing Hexagram Symbols */ + I18N_UCHAR_UBLOCK_LINEAR_B_SYLLABARY, /**< Linear B Syllabary */ + I18N_UCHAR_UBLOCK_LINEAR_B_IDEOGRAMS, /**< Linear B Ideograms */ + I18N_UCHAR_UBLOCK_AEGEAN_NUMBERS, /**< Aegean Numbers */ + I18N_UCHAR_UBLOCK_UGARITIC, /**< Ugaritic */ + I18N_UCHAR_UBLOCK_SHAVIAN, /**< Shavian */ + I18N_UCHAR_UBLOCK_OSMANYA, /**< Osmanya */ + I18N_UCHAR_UBLOCK_CYPRIOT_SYLLABARY, /**< Cypriot Syllabary */ + I18N_UCHAR_UBLOCK_TAI_XUAN_JING_SYMBOLS, /**< Tai Xuan Jing Symbols */ + I18N_UCHAR_UBLOCK_VARIATION_SELECTORS_SUPPLEMENT, /**< Variation Selectors Supplement */ + I18N_UCHAR_UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION, /**< Ancient Greek Musical Notation */ + I18N_UCHAR_UBLOCK_ANCIENT_GREEK_NUMBERS, /**< Ancient Greek Numbers */ + I18N_UCHAR_UBLOCK_ARABIC_SUPPLEMENT, /**< Arabic Supplement */ + I18N_UCHAR_UBLOCK_BUGINESE, /**< Buginese */ + I18N_UCHAR_UBLOCK_CJK_STROKES, /**< CJK Strokes */ + I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT, /**< Combining Diacritical Marks Supplement */ + I18N_UCHAR_UBLOCK_COPTIC, /**< Coptic */ + I18N_UCHAR_UBLOCK_ETHIOPIC_EXTENDED, /**< Ethiopic Extended */ + I18N_UCHAR_UBLOCK_ETHIOPIC_SUPPLEMENT, /**< Ethiopic Supplement */ + I18N_UCHAR_UBLOCK_GEORGIAN_SUPPLEMENT, /**< Georgian Supplement */ + I18N_UCHAR_UBLOCK_GLAGOLITIC, /**< Glagolitic */ + I18N_UCHAR_UBLOCK_KHAROSHTHI, /**< Kharoshthi */ + I18N_UCHAR_UBLOCK_MODIFIER_TONE_LETTERS, /**< Modifier Tone Letters */ + I18N_UCHAR_UBLOCK_NEW_TAI_LUE, /**< New Tai Lue */ + I18N_UCHAR_UBLOCK_OLD_PERSIAN, /**< Old Persian */ + I18N_UCHAR_UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT, /**< Phonetic Extensions Supplement */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_PUNCTUATION, /**< Supplemental Punctuation */ + I18N_UCHAR_UBLOCK_SYLOTI_NAGRI, /**< Syloti Nagri */ + I18N_UCHAR_UBLOCK_TIFINAGH, /**< Tifinagh */ + I18N_UCHAR_UBLOCK_VERTICAL_FORMS, /**< Vertical Forms */ + I18N_UCHAR_UBLOCK_NKO, /**< Nko */ + I18N_UCHAR_UBLOCK_BALINESE, /**< Balinese */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_C, /**< Latin Extended C */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_D, /**< Latin Extended D */ + I18N_UCHAR_UBLOCK_PHAGS_PA, /**< Phags Pa */ + I18N_UCHAR_UBLOCK_PHOENICIAN, /**< Phoenician */ + I18N_UCHAR_UBLOCK_CUNEIFORM, /**< Cuneiform */ + I18N_UCHAR_UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION, /**< Cuneiform Numbers And Punctuation */ + I18N_UCHAR_UBLOCK_COUNTING_ROD_NUMERALS, /**< Counting Rod Numerals */ + I18N_UCHAR_UBLOCK_SUNDANESE, /**< Sundanese */ + I18N_UCHAR_UBLOCK_LEPCHA, /**< Lepcha */ + I18N_UCHAR_UBLOCK_OL_CHIKI, /**< Ol Chiki */ + I18N_UCHAR_UBLOCK_CYRILLIC_EXTENDED_A, /**< Cyrillic Extended A */ + I18N_UCHAR_UBLOCK_VAI, /**< Vai */ + I18N_UCHAR_UBLOCK_CYRILLIC_EXTENDED_B, /**< Cyrillic Extended B */ + I18N_UCHAR_UBLOCK_SAURASHTRA, /**< Saurashtra */ + I18N_UCHAR_UBLOCK_KAYAH_LI, /**< Kayah Li */ + I18N_UCHAR_UBLOCK_REJANG, /**< Rejang */ + I18N_UCHAR_UBLOCK_CHAM, /**< Cham */ + I18N_UCHAR_UBLOCK_ANCIENT_SYMBOLS, /**< Ancient Symbols */ + I18N_UCHAR_UBLOCK_PHAISTOS_DISC, /**< Phaistos Disc */ + I18N_UCHAR_UBLOCK_LYCIAN, /**< Lycian */ + I18N_UCHAR_UBLOCK_CARIAN, /**< Carian */ + I18N_UCHAR_UBLOCK_LYDIAN, /**< Lydian */ + I18N_UCHAR_UBLOCK_MAHJONG_TILES, /**< Mahjong Tiles */ + I18N_UCHAR_UBLOCK_DOMINO_TILES, /**< Domino Tiles */ + I18N_UCHAR_UBLOCK_SAMARITAN, /**< Samaritan */ + I18N_UCHAR_UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED, /**< Unified Canadian Aboriginal Syllabics Extended */ + I18N_UCHAR_UBLOCK_TAI_THAM, /**< Tai Tham */ + I18N_UCHAR_UBLOCK_VEDIC_EXTENSIONS, /**< Vedic Extensions */ + I18N_UCHAR_UBLOCK_LISU, /**< Lisu */ + I18N_UCHAR_UBLOCK_BAMUM, /**< Bamum */ + I18N_UCHAR_UBLOCK_COMMON_INDIC_NUMBER_FORMS, /**< Common Indic Number Forms */ + I18N_UCHAR_UBLOCK_DEVANAGARI_EXTENDED, /**< Devanagari Extended */ + I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_A, /**< Hangul Jamo Extended A */ + I18N_UCHAR_UBLOCK_JAVANESE, /**< Javanese */ + I18N_UCHAR_UBLOCK_MYANMAR_EXTENDED_A, /**< Myanmar Extended A */ + I18N_UCHAR_UBLOCK_TAI_VIET, /**< Tai Viet */ + I18N_UCHAR_UBLOCK_MEETEI_MAYEK, /**< Meetei Mayek */ + I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_B, /**< Hangul Jamo Extended B */ + I18N_UCHAR_UBLOCK_IMPERIAL_ARAMAIC, /**< Imperial Aramaic */ + I18N_UCHAR_UBLOCK_OLD_SOUTH_ARABIAN, /**< Old South Arabian */ + I18N_UCHAR_UBLOCK_AVESTAN, /**< Avestan */ + I18N_UCHAR_UBLOCK_INSCRIPTIONAL_PARTHIAN, /**< Inscriptional Parthian */ + I18N_UCHAR_UBLOCK_INSCRIPTIONAL_PAHLAVI, /**< Inscriptional Pahlavi */ + I18N_UCHAR_UBLOCK_OLD_TURKIC, /**< Old Turkic */ + I18N_UCHAR_UBLOCK_RUMI_NUMERAL_SYMBOLS, /**< Rumi Numeral Symbols */ + I18N_UCHAR_UBLOCK_KAITHI, /**< Kaithi */ + I18N_UCHAR_UBLOCK_EGYPTIAN_HIEROGLYPHS, /**< Egyptian Hieroglyphs */ + I18N_UCHAR_UBLOCK_ENCLOSED_ALPHANUMERIC_SUPPLEMENT, /**< Enclosed Alphanumeric Supplement */ + I18N_UCHAR_UBLOCK_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT, /**< Enclosed Ideographic Supplement */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C, /**< CJK Unified Ideographs Extension C */ + I18N_UCHAR_UBLOCK_MANDAIC, /**< Mandaic */ + I18N_UCHAR_UBLOCK_BATAK, /**< Batak */ + I18N_UCHAR_UBLOCK_ETHIOPIC_EXTENDED_A, /**< Ethiopic Extended A */ + I18N_UCHAR_UBLOCK_BRAHMI, /**< Brahmi */ + I18N_UCHAR_UBLOCK_BAMUM_SUPPLEMENT, /**< Bamum Supplement */ + I18N_UCHAR_UBLOCK_KANA_SUPPLEMENT, /**< Kana Supplement */ + I18N_UCHAR_UBLOCK_PLAYING_CARDS, /**< Playing Cards */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS, /**< Miscellaneous Symbols And Pictographs */ + I18N_UCHAR_UBLOCK_EMOTICONS, /**< Emoticons */ + I18N_UCHAR_UBLOCK_TRANSPORT_AND_MAP_SYMBOLS, /**< Transport And Map Symbols */ + I18N_UCHAR_UBLOCK_ALCHEMICAL_SYMBOLS, /**< Alchemical Symbols */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D, /**< CJK Unified Ideographs Extension D */ + I18N_UCHAR_UBLOCK_COUNT, /**< Count */ + I18N_UCHAR_UBLOCK_INVALID_CODE = -1 /**< Invalid Code */ } i18n_uchar_ublock_code_e; /** * @brief Enumeration for the language directional property of a character set. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * */ typedef enum { -/* - * Note: UCharDirection constants and their API comments are parsed by preparseucd.py. - * It matches pairs of lines like - * / ** comment... * / - * U_<[A-Z_]+> = , - */ I18N_UCHAR_U_LEFT_TO_RIGHT, /**< L */ I18N_UCHAR_U_RIGHT_TO_LEFT, /**< R */ I18N_UCHAR_U_EUROPEAN_NUMBER, /**< EN */ @@ -599,7 +826,7 @@ typedef enum { I18N_UCHAR_U_POP_DIRECTIONAL_FORMAT, /**< PDF */ I18N_UCHAR_U_DIR_NON_SPACING_MARK, /**< NSM */ I18N_UCHAR_U_BOUNDARY_NEUTRAL, /**< BN */ - I18N_UCHAR_U_CHAR_DIRECTION_COUNT /**< */ + I18N_UCHAR_U_CHAR_DIRECTION_COUNT /**< Count */ } i18n_uchar_direction_e; /** @@ -607,11 +834,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: UDecompositionType constants are parsed by preparseucd.py. - * It matches lines like - * U_DT_ - */ I18N_UCHAR_U_DT_NONE, /**< [none] */ I18N_UCHAR_U_DT_CANONICAL, /**< [can] */ I18N_UCHAR_U_DT_COMPAT, /**< [com] */ @@ -691,71 +913,66 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: UJoiningGroup constants are parsed by preparseucd.py. - * It matches lines like - * U_JG_ - */ - I18N_UCHAR_U_JG_NO_JOINING_GROUP, /**< */ - I18N_UCHAR_U_JG_AIN, /**< */ - I18N_UCHAR_U_JG_ALAPH, /**< */ - I18N_UCHAR_U_JG_ALEF, /**< */ - I18N_UCHAR_U_JG_BEH, /**< */ - I18N_UCHAR_U_JG_BETH, /**< */ - I18N_UCHAR_U_JG_DAL, /**< */ - I18N_UCHAR_U_JG_DALATH_RISH, /**< */ - I18N_UCHAR_U_JG_E, /**< */ - I18N_UCHAR_U_JG_FEH, /**< */ - I18N_UCHAR_U_JG_FINAL_SEMKATH, /**< */ - I18N_UCHAR_U_JG_GAF, /**< */ - I18N_UCHAR_U_JG_GAMAL, /**< */ - I18N_UCHAR_U_JG_HAH, /**< */ - I18N_UCHAR_U_JG_TEH_MARBUTA_GOAL, /**< */ - I18N_UCHAR_U_JG_HAMZA_ON_HEH_GOAL = I18N_UCHAR_U_JG_TEH_MARBUTA_GOAL, /**< */ - I18N_UCHAR_U_JG_HE, /**< */ - I18N_UCHAR_U_JG_HEH, /**< */ - I18N_UCHAR_U_JG_HEH_GOAL, /**< */ - I18N_UCHAR_U_JG_HETH, /**< */ - I18N_UCHAR_U_JG_KAF, /**< */ - I18N_UCHAR_U_JG_KAPH, /**< */ - I18N_UCHAR_U_JG_KNOTTED_HEH, /**< */ - I18N_UCHAR_U_JG_LAM, /**< */ - I18N_UCHAR_U_JG_LAMADH, /**< */ - I18N_UCHAR_U_JG_MEEM, /**< */ - I18N_UCHAR_U_JG_MIM, /**< */ - I18N_UCHAR_U_JG_NOON, /**< */ - I18N_UCHAR_U_JG_NUN, /**< */ - I18N_UCHAR_U_JG_PE, /**< */ - I18N_UCHAR_U_JG_QAF, /**< */ - I18N_UCHAR_U_JG_QAPH, /**< */ - I18N_UCHAR_U_JG_REH, /**< */ - I18N_UCHAR_U_JG_REVERSED_PE, /**< */ - I18N_UCHAR_U_JG_SAD, /**< */ - I18N_UCHAR_U_JG_SADHE, /**< */ - I18N_UCHAR_U_JG_SEEN, /**< */ - I18N_UCHAR_U_JG_SEMKATH, /**< */ - I18N_UCHAR_U_JG_SHIN, /**< */ - I18N_UCHAR_U_JG_SWASH_KAF, /**< */ - I18N_UCHAR_U_JG_SYRIAC_WAW, /**< */ - I18N_UCHAR_U_JG_TAH, /**< */ - I18N_UCHAR_U_JG_TAW, /**< */ - I18N_UCHAR_U_JG_TEH_MARBUTA, /**< */ - I18N_UCHAR_U_JG_TETH, /**< */ - I18N_UCHAR_U_JG_WAW, /**< */ - I18N_UCHAR_U_JG_YEH, /**< */ - I18N_UCHAR_U_JG_YEH_BARREE, /**< */ - I18N_UCHAR_U_JG_YEH_WITH_TAIL, /**< */ - I18N_UCHAR_U_JG_YUDH, /**< */ - I18N_UCHAR_U_JG_YUDH_HE, /**< */ - I18N_UCHAR_U_JG_ZAIN, /**< */ - I18N_UCHAR_U_JG_FE, /**< */ - I18N_UCHAR_U_JG_KHAPH, /**< */ - I18N_UCHAR_U_JG_ZHAIN, /**< */ - I18N_UCHAR_U_JG_BURUSHASKI_YEH_BARREE, /**< */ - I18N_UCHAR_U_JG_FARSI_YEH, /**< */ - I18N_UCHAR_U_JG_NYA, /**< */ - I18N_UCHAR_U_JG_ROHINGYA_YEH, - I18N_UCHAR_U_JG_COUNT /**< */ + I18N_UCHAR_U_JG_NO_JOINING_GROUP, /**< No Joining Group */ + I18N_UCHAR_U_JG_AIN, /**< Ain */ + I18N_UCHAR_U_JG_ALAPH, /**< Alaph */ + I18N_UCHAR_U_JG_ALEF, /**< Alef */ + I18N_UCHAR_U_JG_BEH, /**< Beh */ + I18N_UCHAR_U_JG_BETH, /**< Beth */ + I18N_UCHAR_U_JG_DAL, /**< Dal */ + I18N_UCHAR_U_JG_DALATH_RISH, /**< Dalath Rish */ + I18N_UCHAR_U_JG_E, /**< E */ + I18N_UCHAR_U_JG_FEH, /**< Feh */ + I18N_UCHAR_U_JG_FINAL_SEMKATH, /**< Final Semkath */ + I18N_UCHAR_U_JG_GAF, /**< Gaf */ + I18N_UCHAR_U_JG_GAMAL, /**< Gamal */ + I18N_UCHAR_U_JG_HAH, /**< Hah */ + I18N_UCHAR_U_JG_TEH_MARBUTA_GOAL, /**< Teh Marbuta Goal */ + I18N_UCHAR_U_JG_HAMZA_ON_HEH_GOAL = I18N_UCHAR_U_JG_TEH_MARBUTA_GOAL, /**< Hamza On Heh Goal */ + I18N_UCHAR_U_JG_HE, /**< He */ + I18N_UCHAR_U_JG_HEH, /**< Heh */ + I18N_UCHAR_U_JG_HEH_GOAL, /**< Heh Goal */ + I18N_UCHAR_U_JG_HETH, /**< Heth */ + I18N_UCHAR_U_JG_KAF, /**< Kaf */ + I18N_UCHAR_U_JG_KAPH, /**< Kaph */ + I18N_UCHAR_U_JG_KNOTTED_HEH, /**< Knotted Heh */ + I18N_UCHAR_U_JG_LAM, /**< Lam */ + I18N_UCHAR_U_JG_LAMADH, /**< Lamadh */ + I18N_UCHAR_U_JG_MEEM, /**< Meem */ + I18N_UCHAR_U_JG_MIM, /**< Mim */ + I18N_UCHAR_U_JG_NOON, /**< Noon */ + I18N_UCHAR_U_JG_NUN, /**< Nun */ + I18N_UCHAR_U_JG_PE, /**< Pe */ + I18N_UCHAR_U_JG_QAF, /**< Qaf */ + I18N_UCHAR_U_JG_QAPH, /**< Qaph */ + I18N_UCHAR_U_JG_REH, /**< Reh */ + I18N_UCHAR_U_JG_REVERSED_PE, /**< Reversed Pe */ + I18N_UCHAR_U_JG_SAD, /**< Sad */ + I18N_UCHAR_U_JG_SADHE, /**< Sadhe */ + I18N_UCHAR_U_JG_SEEN, /**< Seen */ + I18N_UCHAR_U_JG_SEMKATH, /**< Semkath */ + I18N_UCHAR_U_JG_SHIN, /**< Shin */ + I18N_UCHAR_U_JG_SWASH_KAF, /**< Swash Kaf */ + I18N_UCHAR_U_JG_SYRIAC_WAW, /**< Syriac Waw */ + I18N_UCHAR_U_JG_TAH, /**< Tah */ + I18N_UCHAR_U_JG_TAW, /**< Taw */ + I18N_UCHAR_U_JG_TEH_MARBUTA, /**< Teh Marbuta */ + I18N_UCHAR_U_JG_TETH, /**< Teth */ + I18N_UCHAR_U_JG_WAW, /**< Waw */ + I18N_UCHAR_U_JG_YEH, /**< Yeh */ + I18N_UCHAR_U_JG_YEH_BARREE, /**< Yeh Barree */ + I18N_UCHAR_U_JG_YEH_WITH_TAIL, /**< Yeh With Tail */ + I18N_UCHAR_U_JG_YUDH, /**< Yudh */ + I18N_UCHAR_U_JG_YUDH_HE, /**< Yudh He */ + I18N_UCHAR_U_JG_ZAIN, /**< Zain */ + I18N_UCHAR_U_JG_FE, /**< Fe */ + I18N_UCHAR_U_JG_KHAPH, /**< Khaph */ + I18N_UCHAR_U_JG_ZHAIN, /**< Zhain */ + I18N_UCHAR_U_JG_BURUSHASKI_YEH_BARREE, /**< Burushaski Yeh Barree */ + I18N_UCHAR_U_JG_FARSI_YEH, /**< Farsi Yeh */ + I18N_UCHAR_U_JG_NYA, /**< Nya */ + I18N_UCHAR_U_JG_ROHINGYA_YEH, /**< Rohingya Yeh */ + I18N_UCHAR_U_JG_COUNT /**< Count */ } i18n_uchar_u_joining_group_e; /** @@ -763,11 +980,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_joining_type_e constants are parsed by preparseucd.py. - * It matches lines like - * U_JT_ - */ I18N_UCHAR_U_JT_NON_JOINING, /**< [U] */ I18N_UCHAR_U_JT_JOIN_CAUSING, /**< [C] */ I18N_UCHAR_U_JT_DUAL_JOINING, /**< [D] */ @@ -782,11 +994,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_line_break_e constants are parsed by preparseucd.py. - * It matches lines like - * U_LB_ - */ I18N_UCHAR_U_LB_UNKNOWN, /**< [XX] */ I18N_UCHAR_U_LB_AMBIGUOUS, /**< [AI] */ I18N_UCHAR_U_LB_ALPHABETIC, /**< [AL] */ @@ -833,11 +1040,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_numeric_type_e constants are parsed by preparseucd.py. - * It matches lines like - * U_NT_ - */ I18N_UCHAR_U_NT_NONE, /**< [None] */ I18N_UCHAR_U_NT_DECIMAL, /**< [de] */ I18N_UCHAR_U_NT_DIGIT, /**< [di] */ @@ -850,11 +1052,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_hangul_syllable_type_e constants are parsed by preparseucd.py. - * It matches lines like - * U_HST_ - */ I18N_UCHAR_U_HST_NOT_APPLICABLE, /**< [NA] */ I18N_UCHAR_U_HST_LEADING_JAMO, /**< [L] */ I18N_UCHAR_U_HST_VOWEL_JAMO, /**< [V] */ @@ -869,11 +1066,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_sentence_break_e constants are parsed by preparseucd.py. - * It matches lines like - * U_SB_ - */ I18N_UCHAR_U_SB_OTHER, /**< [XX] */ I18N_UCHAR_U_SB_ATERM, /**< [AT] */ I18N_UCHAR_U_SB_CLOSE, /**< [CL] */ @@ -897,11 +1089,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_word_break_values_e constants are parsed by preparseucd.py. - * It matches lines like - * U_WB_ - */ I18N_UCHAR_U_WB_OTHER, /**< [XX] */ I18N_UCHAR_U_WB_ALETTER, /**< [LE] */ I18N_UCHAR_U_WB_FORMAT, /**< [FO] */ @@ -923,11 +1110,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_grapheme_cluster_break_e constants are parsed by preparseucd.py. - * It matches lines like - * U_GCB_ - */ I18N_UCHAR_U_GCB_OTHER, /**< [XX] */ I18N_UCHAR_U_GCB_CONTROL, /**< [CN] */ I18N_UCHAR_U_GCB_CR, /**< [CR] */ @@ -1066,6 +1248,17 @@ typedef enum { } i18n_unormalization_mode_e; /** + * @brief Result values for normalization quick check functions. + * + * @since_tizen 2.4 + */ +typedef enum { + I18N_UNORMALIZATION_NO, /**< The input string is not in the normalization form. */ + I18N_UNORMALIZATION_YES, /**< The input string is in the normalization form. */ + I18N_UNORMALIZATION_MAYBE /**< The input string may or may not be in the normalization form. */ +} i18n_unormalization_check_result_e; + +/** * @} * @} */ @@ -1982,6 +2175,183 @@ typedef void* i18n_uenumeration_h; * @} */ + +/** + * @addtogroup CAPI_BASE_UTILS_I18N_UCHAR_MODULE + * @{ + */ + +/** + * @brief Constants for ISO 15924 script codes. + * @since_tizen 2.4 + */ +typedef enum { + I18N_USCRIPT_INVALID_CODE = -1, + I18N_USCRIPT_COMMON = 0, /**< Zyyy */ + I18N_USCRIPT_INHERITED = 1, /**< Zinh, "Code for inherited script", for non-spacing combining marks; also Qaai */ + I18N_USCRIPT_ARABIC = 2, /**< Arab */ + I18N_USCRIPT_ARMENIAN = 3, /**< Armn */ + I18N_USCRIPT_BENGALI = 4, /**< Beng */ + I18N_USCRIPT_BOPOMOFO = 5, /**< Bopo */ + I18N_USCRIPT_CHEROKEE = 6, /**< Cher */ + I18N_USCRIPT_COPTIC = 7, /**< Copt */ + I18N_USCRIPT_CYRILLIC = 8, /**< Cyrl */ + I18N_USCRIPT_DESERET = 9, /**< Dsrt */ + I18N_USCRIPT_DEVANAGARI = 10, /**< Deva */ + I18N_USCRIPT_ETHIOPIC = 11, /**< Ethi */ + I18N_USCRIPT_GEORGIAN = 12, /**< Geor */ + I18N_USCRIPT_GOTHIC = 13, /**< Goth */ + I18N_USCRIPT_GREEK = 14, /**< Grek */ + I18N_USCRIPT_GUJARATI = 15, /**< Gujr */ + I18N_USCRIPT_GURMUKHI = 16, /**< Guru */ + I18N_USCRIPT_HAN = 17, /**< Hani */ + I18N_USCRIPT_HANGUL = 18, /**< Hang */ + I18N_USCRIPT_HEBREW = 19, /**< Hebr */ + I18N_USCRIPT_HIRAGANA = 20, /**< Hira */ + I18N_USCRIPT_KANNADA = 21, /**< Knda */ + I18N_USCRIPT_KATAKANA = 22, /**< Kana */ + I18N_USCRIPT_KHMER = 23, /**< Khmr */ + I18N_USCRIPT_LAO = 24, /**< Laoo */ + I18N_USCRIPT_LATIN = 25, /**< Latn */ + I18N_USCRIPT_MALAYALAM = 26, /**< Mlym */ + I18N_USCRIPT_MONGOLIAN = 27, /**< Mong */ + I18N_USCRIPT_MYANMAR = 28, /**< Mymr */ + I18N_USCRIPT_OGHAM = 29, /**< Ogam */ + I18N_USCRIPT_OLD_ITALIC = 30, /**< Ital */ + I18N_USCRIPT_ORIYA = 31, /**< Orya */ + I18N_USCRIPT_RUNIC = 32, /**< Runr */ + I18N_USCRIPT_SINHALA = 33, /**< Sinh */ + I18N_USCRIPT_SYRIAC = 34, /**< Syrc */ + I18N_USCRIPT_TAMIL = 35, /**< Taml */ + I18N_USCRIPT_TELUGU = 36, /**< Telu */ + I18N_USCRIPT_THAANA = 37, /**< Thaa */ + I18N_USCRIPT_THAI = 38, /**< Thai */ + I18N_USCRIPT_TIBETAN = 39, /**< Tibt */ + I18N_USCRIPT_CANADIAN_ABORIGINAL = 40, /**< Cans, Canadian_Aboriginal script. */ + I18N_USCRIPT_UCAS = I18N_USCRIPT_CANADIAN_ABORIGINAL, /**< Canadian_Aboriginal script (alias). */ + I18N_USCRIPT_YI = 41, /**< Yiii */ + I18N_USCRIPT_TAGALOG = 42, /**< Tglg */ + I18N_USCRIPT_HANUNOO = 43, /**< Hano */ + I18N_USCRIPT_BUHID = 44, /**< Buhd */ + I18N_USCRIPT_TAGBANWA = 45, /**< Tagb */ + I18N_USCRIPT_BRAILLE = 46, /**< Brai */ + I18N_USCRIPT_CYPRIOT = 47, /**< Cprt */ + I18N_USCRIPT_LIMBU = 48, /**< Limb */ + I18N_USCRIPT_LINEAR_B = 49, /**< Linb */ + I18N_USCRIPT_OSMANYA = 50, /**< Osma */ + I18N_USCRIPT_SHAVIAN = 51, /**< Shaw */ + I18N_USCRIPT_TAI_LE = 52, /**< Tale */ + I18N_USCRIPT_UGARITIC = 53, /**< Ugar */ + I18N_USCRIPT_KATAKANA_OR_HIRAGANA = 54,/** + * + * Tizen 2.3, 2.3.1, 2.4 + * ICU 51 + * CLDR 23 + * Unicode 6.2 + * + * * @section CAPI_BASE_UTILS_I18N_MODULE_HEADER Required Header * \#include * @section CAPI_BASE_UTILS_I18N_MODULE_OVERVIEW Overview diff --git a/src/include/wearable/utils_i18n_types.h b/src/include/wearable/utils_i18n_types.h index a833e08..cf2dde8 100644 --- a/src/include/wearable/utils_i18n_types.h +++ b/src/include/wearable/utils_i18n_types.h @@ -99,48 +99,48 @@ typedef enum { #define I18N_U_MASK(x) ((uint32_t)1<<(x)) /**< Get a single-bit bit set (a flag) from a bit number 0..31. @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif*/ -#define I18N_U_GC_CN_MASK I18N_U_MASK(I18N_UCHAR_U_GENERAL_OTHER_TYPES) /**in the target of a case mapping. Not the same as the general category Cased_Letter. + */ + I18N_UCHAR_S_TERM, + /**< Binary property STerm (new in Unicode 4.0.1). \n + */ + I18N_UCHAR_VARIATION_SELECTOR, + /**< Binary property Variation_Selector (new in Unicode 4.0.1). \n + Indicates all those characters that qualify as Variation Selectors. + */ + I18N_UCHAR_NFD_INERT, + /**< Binary property NFD_Inert. \n + ICU-specific property for characters that are inert under NFD, i.e., they do not interact with adjacent characters. + */ + I18N_UCHAR_NFKD_INERT, + /**< Binary property NFKD_Inert. \n + ICU-specific property for characters that are inert under NFKD, i.e., they do not interact with adjacent characters. + */ + I18N_UCHAR_NFC_INERT, + /**< Binary property NFC_Inert. \n + ICU-specific property for characters that are inert under NFC, i.e., they do not interact with adjacent characters. + */ + I18N_UCHAR_NFKC_INERT, + /**< Binary property NFKC_Inert. \n + ICU-specific property for characters that are inert under NFKC, i.e., they do not interact with adjacent characters. + */ + I18N_UCHAR_SEGMENT_STARTER, + /**< Binary Property Segment_Starter. \n + Property for characters that are starters in terms of Unicode normalization and combining character sequences. + They have ccc=0 and do not occur in non-initial position of the canonical decomposition of any character + (like a-umlaut in NFD and a Jamo T in an NFD(Hangul LVT)). + */ + I18N_UCHAR_PATTERN_SYNTAX, + /**< Binary property Pattern_Syntax (new in Unicode 4.1). \n + */ + I18N_UCHAR_PATTERN_WHITE_SPACE, + /**< Binary property Pattern_White_Space (new in Unicode 4.1). \n + */ + I18N_UCHAR_POSIX_ALNUM, + /**< Binary property alnum (a C/POSIX character class).*/ + I18N_UCHAR_POSIX_BLANK, + /**< Binary property blank (a C/POSIX character class).*/ + I18N_UCHAR_POSIX_GRAPH, + /**< Binary property graph (a C/POSIX character class). */ + I18N_UCHAR_POSIX_PRINT, + /**< Binary property print (a C/POSIX character class). */ + I18N_UCHAR_POSIX_XDIGIT, + /**< Binary property xdigit (a C/POSIX character class). */ + I18N_UCHAR_CASED, + /**< Binary property Cased. \n + For Lowercase, Uppercase and Titlecase characters. + */ + I18N_UCHAR_CASE_IGNORABLE, + /**< Binary property Case_Ignorable. \n + Used in context-sensitive case mappings. + */ + I18N_UCHAR_CHANGES_WHEN_LOWERCASED, + /**< Binary property Changes_When_Lowercased. */ + I18N_UCHAR_CHANGES_WHEN_UPPERCASED, + /**< Binary property Changes_When_Uppercased. */ + I18N_UCHAR_CHANGES_WHEN_TITLECASED, + /**< Binary property Changes_When_Titlecased. */ + I18N_UCHAR_CHANGES_WHEN_CASEFOLDED, + /**< Binary property Changes_When_Casefolded. */ + I18N_UCHAR_CHANGES_WHEN_CASEMAPPED, + /**< Binary property Changes_When_Casemapped. */ + I18N_UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED, + /**< Binary property Changes_When_NFKC_Casefolded. */ + I18N_UCHAR_BINARY_LIMIT, + /**< One more than the last constant for binary Unicode properties. */ + I18N_UCHAR_BIDI_CLASS = 0x1000, + /**< Enumerated property Bidi_Class. \n + Same as u_charDirection, returns #i18n_uchar_direction_e values. + */ + I18N_UCHAR_INT_START = I18N_UCHAR_BIDI_CLASS, + /**< First constant for enumerated/integer Unicode properties. */ + I18N_UCHAR_BLOCK, + /**< Enumerated property Block. \n + Returns #i18n_uchar_ublock_code_e values. + */ + I18N_UCHAR_CANONICAL_COMBINING_CLASS, + /**< Enumerated property Canonical_Combining_Class. \n + Returns 8-bit numeric values. + */ + I18N_UCHAR_DECOMPOSITION_TYPE, + /**< Enumerated property Decomposition_Type. \n + Returns #i18n_uchar_u_decomposition_type_e values. + */ + I18N_UCHAR_EAST_ASIAN_WIDTH, + /**< Enumerated property East_Asian_Width. \n + Returns #i18n_uchar_u_east_asian_width_e values. + */ + I18N_UCHAR_GENERAL_CATEGORY, + /**< Enumerated property General_Category. \n + Returns #i18n_uchar_category_e values. + */ + I18N_UCHAR_JOINING_GROUP, + /**< Enumerated property Joining_Group. \n + Returns #i18n_uchar_u_joining_group_e values. + */ + I18N_UCHAR_JOINING_TYPE, + /**< Enumerated property Joining_Type. \n + Returns #i18n_uchar_u_joining_type_e values. + */ + I18N_UCHAR_LINE_BREAK, + /**< Enumerated property Line_Break. \n + Returns #i18n_uchar_u_line_break_e values. + */ + I18N_UCHAR_NUMERIC_TYPE, + /**< Enumerated property Numeric_Type. \n + Returns #i18n_uchar_u_numeric_type_e values. + */ + I18N_UCHAR_SCRIPT, + /**< Enumerated property Script. \n + Returns #i18n_uscript_code_e values. + */ + I18N_UCHAR_HANGUL_SYLLABLE_TYPE, + /**< Enumerated property Hangul_Syllable_Type, new in Unicode 4. \n + Returns #i18n_uchar_u_hangul_syllable_type_e values. + */ + I18N_UCHAR_NFD_QUICK_CHECK, + /**< Enumerated property NFD_Quick_Check. \n + Returns #i18n_unormalization_check_result_e values. + */ + I18N_UCHAR_NFKD_QUICK_CHECK, + /**< Enumerated property NFKD_Quick_Check. \n + Returns #i18n_unormalization_check_result_e values. + */ + I18N_UCHAR_NFC_QUICK_CHECK, + /**< Enumerated property NFC_Quick_Check. \n + Returns #i18n_unormalization_check_result_e values. + */ + I18N_UCHAR_NFKC_QUICK_CHECK, + /**< Enumerated property NFKC_Quick_Check. \n + Returns #i18n_unormalization_check_result_e values. + */ + I18N_UCHAR_LEAD_CANONICAL_COMBINING_CLASS, + /**< Enumerated property Lead_Canonical_Combining_Class. \n + Returns 8-bit numeric values like #UCHAR_CANONICAL_COMBINING_CLASS. + */ + I18N_UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, + /**< Enumerated property Trail_Canonical_Combining_Class. \n + Returns 8-bit numeric values like #UCHAR_CANONICAL_COMBINING_CLASS. + */ + I18N_UCHAR_GRAPHEME_CLUSTER_BREAK, + /**< Enumerated property Grapheme_Cluster_Break (new in Unicode 4.1). \n + Returns #i18n_uchar_u_grapheme_cluster_break_e values. + */ + I18N_UCHAR_SENTENCE_BREAK, + /**< Enumerated property Sentence_Break (new in Unicode 4.1). \n + Returns #i18n_uchar_u_sentence_break_e values. + */ + I18N_UCHAR_WORD_BREAK, + /**< Enumerated property Word_Break (new in Unicode 4.1). \n + Returns #i18n_uchar_u_word_break_values_e values. + */ + I18N_UCHAR_BIDI_PAIRED_BRACKET_TYPE, + /**< Unsupported yet. Please do not use. */ + I18N_UCHAR_INT_LIMIT, + /**< One more than the last constant for enumerated/integer Unicode properties. */ + I18N_UCHAR_GENERAL_CATEGORY_MASK = 0x2000, + /**< Bitmask property General_Category_Mask. \n + Mask values should be cast to uint32_t. + */ + I18N_UCHAR_MASK_START = I18N_UCHAR_GENERAL_CATEGORY_MASK, + /**< First constant for bit-mask Unicode properties. */ + I18N_UCHAR_MASK_LIMIT, + /**< One more than the last constant for bit-mask Unicode properties. */ + I18N_UCHAR_NUMERIC_VALUE = 0x3000, + /**< Double property Numeric_Value. */ + I18N_UCHAR_DOUBLE_START = I18N_UCHAR_NUMERIC_VALUE, + /**< First constant for double Unicode properties. */ + I18N_UCHAR_DOUBLE_LIMIT, + /**< One more than the last constant for double Unicode properties. */ + I18N_UCHAR_AGE = 0x4000, + /**< String property Age. */ + I18N_UCHAR_STRING_START = I18N_UCHAR_AGE, + /**< First constant for string Unicode properties. */ + I18N_UCHAR_BIDI_MIRRORING_GLYPH, + /**< String property Bidi_Mirroring_Glyph. */ + I18N_UCHAR_CASE_FOLDING, + /**< String property Case_Folding. */ + I18N_UCHAR_LOWERCASE_MAPPING = 0x4004, + /**< String property Lowercase_Mapping. */ + I18N_UCHAR_NAME, + /**< String property Name. */ + I18N_UCHAR_SIMPLE_CASE_FOLDING, + /**< String property Simple_Case_Folding. */ + I18N_UCHAR_SIMPLE_LOWERCASE_MAPPING, + /**< String property Simple_Lowercase_Mapping. */ + I18N_UCHAR_SIMPLE_TITLECASE_MAPPING, + /**< String property Simple_Titlecase_Mapping. */ + I18N_UCHAR_SIMPLE_UPPERCASE_MAPPING, + /**< String property Simple_Uppercase_Mapping. */ + I18N_UCHAR_TITLECASE_MAPPING, + /**< String property Titlecase_Mapping. */ + I18N_UCHAR_UPPERCASE_MAPPING = 0x400C, + /**< String property Uppercase_Mapping. */ + I18N_UCHAR_BIDI_PAIRED_BRACKET, + /**< Unsupported yet. Please do not use. */ + I18N_UCHAR_STRING_LIMIT, + /**< One more than the last constant for string Unicode properties. */ + I18N_UCHAR_SCRIPT_EXTENSIONS = 0x7000, + /**< Provisional property Script_Extensions (new in Unicode 6.0). */ + I18N_UCHAR_OTHER_PROPERTY_START = I18N_UCHAR_SCRIPT_EXTENSIONS, + /**< First constant for Unicode properties with unusual value types. */ + I18N_UCHAR_OTHER_PROPERTY_LIMIT, + /**< One more than the last constant for Unicode properties with unusual value types. */ + I18N_UCHAR_INVALID_CODE = -1 + /**< Represents a nonexistent or invalid property or property value. */ } i18n_uchar_uproperty_e; /** @@ -351,235 +585,228 @@ typedef enum { * */ typedef enum { - I18N_UCHAR_UBLOCK_NO_BLOCK, /**< */ - I18N_UCHAR_UBLOCK_BASIC_LATIN, /**< */ - I18N_UCHAR_UBLOCK_LATIN_1_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_B, /**< */ - I18N_UCHAR_UBLOCK_IPA_EXTENSIONS, /**< */ - I18N_UCHAR_UBLOCK_SPACING_MODIFIER_LETTERS, /**< */ - I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS, /**< */ - I18N_UCHAR_UBLOCK_GREEK, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC, /**< */ - I18N_UCHAR_UBLOCK_ARMENIAN, /**< */ - I18N_UCHAR_UBLOCK_HEBREW, /**< */ - I18N_UCHAR_UBLOCK_ARABIC, /**< */ - I18N_UCHAR_UBLOCK_SYRIAC, /**< */ - I18N_UCHAR_UBLOCK_THAANA, /**< */ - I18N_UCHAR_UBLOCK_DEVANAGARI, /**< */ - I18N_UCHAR_UBLOCK_BENGALI, /**< */ - I18N_UCHAR_UBLOCK_GURMUKHI, /**< */ - I18N_UCHAR_UBLOCK_GUJARATI, /**< */ - I18N_UCHAR_UBLOCK_ORIYA, /**< */ - I18N_UCHAR_UBLOCK_TAMIL, /**< */ - I18N_UCHAR_UBLOCK_TELUGU, /**< */ - I18N_UCHAR_UBLOCK_KANNADA, /**< */ - I18N_UCHAR_UBLOCK_MALAYALAM, /**< */ - I18N_UCHAR_UBLOCK_SINHALA, /**< */ - I18N_UCHAR_UBLOCK_THAI, /**< */ - I18N_UCHAR_UBLOCK_LAO, /**< */ - I18N_UCHAR_UBLOCK_TIBETAN, /**< */ - I18N_UCHAR_UBLOCK_MYANMAR, /**< */ - I18N_UCHAR_UBLOCK_GEORGIAN, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_JAMO, /**< */ - I18N_UCHAR_UBLOCK_ETHIOPIC, /**< */ - I18N_UCHAR_UBLOCK_CHEROKEE, /**< */ - I18N_UCHAR_UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS, /**< */ - I18N_UCHAR_UBLOCK_OGHAM, /**< */ - I18N_UCHAR_UBLOCK_RUNIC, /**< */ - I18N_UCHAR_UBLOCK_KHMER, /**< */ - I18N_UCHAR_UBLOCK_MONGOLIAN, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_ADDITIONAL, /**< */ - I18N_UCHAR_UBLOCK_GREEK_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_GENERAL_PUNCTUATION, /**< */ - I18N_UCHAR_UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS, /**< */ - I18N_UCHAR_UBLOCK_CURRENCY_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_COMBINING_MARKS_FOR_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_LETTERLIKE_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_NUMBER_FORMS, /**< */ - I18N_UCHAR_UBLOCK_ARROWS, /**< */ - I18N_UCHAR_UBLOCK_MATHEMATICAL_OPERATORS, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_TECHNICAL, /**< */ - I18N_UCHAR_UBLOCK_CONTROL_PICTURES, /**< */ - I18N_UCHAR_UBLOCK_OPTICAL_CHARACTER_RECOGNITION, /**< */ - I18N_UCHAR_UBLOCK_ENCLOSED_ALPHANUMERICS, /**< */ - I18N_UCHAR_UBLOCK_BOX_DRAWING, /**< */ - I18N_UCHAR_UBLOCK_BLOCK_ELEMENTS, /**< */ - I18N_UCHAR_UBLOCK_GEOMETRIC_SHAPES, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_DINGBATS, /**< */ - I18N_UCHAR_UBLOCK_BRAILLE_PATTERNS, /**< */ - I18N_UCHAR_UBLOCK_CJK_RADICALS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_KANGXI_RADICALS, /**< */ - I18N_UCHAR_UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS, /**< */ - I18N_UCHAR_UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION, /**< */ - I18N_UCHAR_UBLOCK_HIRAGANA, /**< */ - I18N_UCHAR_UBLOCK_KATAKANA, /**< */ - I18N_UCHAR_UBLOCK_BOPOMOFO, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_COMPATIBILITY_JAMO, /**< */ - I18N_UCHAR_UBLOCK_KANBUN, /**< */ - I18N_UCHAR_UBLOCK_BOPOMOFO_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS, /**< */ - I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS, /**< */ - I18N_UCHAR_UBLOCK_YI_SYLLABLES, /**< */ - I18N_UCHAR_UBLOCK_YI_RADICALS, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_SYLLABLES, /**< */ - I18N_UCHAR_UBLOCK_HIGH_SURROGATES, /**< */ - I18N_UCHAR_UBLOCK_HIGH_PRIVATE_USE_SURROGATES, /**< */ - I18N_UCHAR_UBLOCK_LOW_SURROGATES, /**< */ - I18N_UCHAR_UBLOCK_PRIVATE_USE_AREA, /**< */ - I18N_UCHAR_UBLOCK_PRIVATE_USE, /**< */ - I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, /**< */ - - I18N_UCHAR_UBLOCK_ALPHABETIC_PRESENTATION_FORMS, /**< */ - I18N_UCHAR_UBLOCK_ARABIC_PRESENTATION_FORMS_A, /**< */ - I18N_UCHAR_UBLOCK_COMBINING_HALF_MARKS, /**< */ - I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_FORMS, /**< */ - I18N_UCHAR_UBLOCK_SMALL_FORM_VARIANTS, /**< */ - I18N_UCHAR_UBLOCK_ARABIC_PRESENTATION_FORMS_B, /**< */ - I18N_UCHAR_UBLOCK_SPECIALS, /**< */ - I18N_UCHAR_UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, /**< */ - I18N_UCHAR_UBLOCK_OLD_ITALIC, /**< */ - I18N_UCHAR_UBLOCK_GOTHIC, /**< */ - I18N_UCHAR_UBLOCK_DESERET, /**< */ - I18N_UCHAR_UBLOCK_BYZANTINE_MUSICAL_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_MUSICAL_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, /**< */ - I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_TAGS, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC_SUPPLEMENTARY, /**< */ - I18N_UCHAR_UBLOCK_TAGALOG, /**< */ - I18N_UCHAR_UBLOCK_HANUNOO, /**< */ - I18N_UCHAR_UBLOCK_BUHID, /**< */ - I18N_UCHAR_UBLOCK_TAGBANWA, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_A, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_B, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS, /**< */ - I18N_UCHAR_UBLOCK_KATAKANA_PHONETIC_EXTENSIONS, /**< */ - I18N_UCHAR_UBLOCK_VARIATION_SELECTORS, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B, /**< */ - I18N_UCHAR_UBLOCK_LIMBU, /**< */ - I18N_UCHAR_UBLOCK_TAI_LE, /**< */ - I18N_UCHAR_UBLOCK_KHMER_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_PHONETIC_EXTENSIONS, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS, /**< */ - I18N_UCHAR_UBLOCK_YIJING_HEXAGRAM_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_LINEAR_B_SYLLABARY, /**< */ - I18N_UCHAR_UBLOCK_LINEAR_B_IDEOGRAMS, /**< */ - I18N_UCHAR_UBLOCK_AEGEAN_NUMBERS, /**< */ - I18N_UCHAR_UBLOCK_UGARITIC, /**< */ - I18N_UCHAR_UBLOCK_SHAVIAN, /**< */ - I18N_UCHAR_UBLOCK_OSMANYA, /**< */ - I18N_UCHAR_UBLOCK_CYPRIOT_SYLLABARY, /**< */ - I18N_UCHAR_UBLOCK_TAI_XUAN_JING_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_VARIATION_SELECTORS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION, /**< */ - I18N_UCHAR_UBLOCK_ANCIENT_GREEK_NUMBERS, /**< */ - I18N_UCHAR_UBLOCK_ARABIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_BUGINESE, /**< */ - I18N_UCHAR_UBLOCK_CJK_STROKES, /**< */ - I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_COPTIC, /**< */ - I18N_UCHAR_UBLOCK_ETHIOPIC_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_ETHIOPIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_GEORGIAN_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_GLAGOLITIC, /**< */ - I18N_UCHAR_UBLOCK_KHAROSHTHI, /**< */ - I18N_UCHAR_UBLOCK_MODIFIER_TONE_LETTERS, /**< */ - I18N_UCHAR_UBLOCK_NEW_TAI_LUE, /**< */ - I18N_UCHAR_UBLOCK_OLD_PERSIAN, /**< */ - I18N_UCHAR_UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_SUPPLEMENTAL_PUNCTUATION, /**< */ - I18N_UCHAR_UBLOCK_SYLOTI_NAGRI, /**< */ - I18N_UCHAR_UBLOCK_TIFINAGH, /**< */ - I18N_UCHAR_UBLOCK_VERTICAL_FORMS, /**< */ - I18N_UCHAR_UBLOCK_NKO, /**< */ - I18N_UCHAR_UBLOCK_BALINESE, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_C, /**< */ - I18N_UCHAR_UBLOCK_LATIN_EXTENDED_D, /**< */ - I18N_UCHAR_UBLOCK_PHAGS_PA, /**< */ - I18N_UCHAR_UBLOCK_PHOENICIAN, /**< */ - I18N_UCHAR_UBLOCK_CUNEIFORM, /**< */ - I18N_UCHAR_UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION, /**< */ - I18N_UCHAR_UBLOCK_COUNTING_ROD_NUMERALS, /**< */ - I18N_UCHAR_UBLOCK_SUNDANESE, /**< */ - I18N_UCHAR_UBLOCK_LEPCHA, /**< */ - I18N_UCHAR_UBLOCK_OL_CHIKI, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_VAI, /**< */ - I18N_UCHAR_UBLOCK_CYRILLIC_EXTENDED_B, /**< */ - I18N_UCHAR_UBLOCK_SAURASHTRA, /**< */ - I18N_UCHAR_UBLOCK_KAYAH_LI, /**< */ - I18N_UCHAR_UBLOCK_REJANG, /**< */ - I18N_UCHAR_UBLOCK_CHAM, /**< */ - I18N_UCHAR_UBLOCK_ANCIENT_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_PHAISTOS_DISC, /**< */ - I18N_UCHAR_UBLOCK_LYCIAN, /**< */ - I18N_UCHAR_UBLOCK_CARIAN, /**< */ - I18N_UCHAR_UBLOCK_LYDIAN, /**< */ - I18N_UCHAR_UBLOCK_MAHJONG_TILES, /**< */ - I18N_UCHAR_UBLOCK_DOMINO_TILES, /**< */ - I18N_UCHAR_UBLOCK_SAMARITAN, /**< */ - I18N_UCHAR_UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_TAI_THAM, /**< */ - I18N_UCHAR_UBLOCK_VEDIC_EXTENSIONS, /**< */ - I18N_UCHAR_UBLOCK_LISU, /**< */ - I18N_UCHAR_UBLOCK_BAMUM, /**< */ - I18N_UCHAR_UBLOCK_COMMON_INDIC_NUMBER_FORMS, /**< */ - I18N_UCHAR_UBLOCK_DEVANAGARI_EXTENDED, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_JAVANESE, /**< */ - I18N_UCHAR_UBLOCK_MYANMAR_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_TAI_VIET, /**< */ - I18N_UCHAR_UBLOCK_MEETEI_MAYEK, /**< */ - I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_B, /**< */ - I18N_UCHAR_UBLOCK_IMPERIAL_ARAMAIC, /**< */ - I18N_UCHAR_UBLOCK_OLD_SOUTH_ARABIAN, /**< */ - I18N_UCHAR_UBLOCK_AVESTAN, /**< */ - I18N_UCHAR_UBLOCK_INSCRIPTIONAL_PARTHIAN, /**< */ - I18N_UCHAR_UBLOCK_INSCRIPTIONAL_PAHLAVI, /**< */ - I18N_UCHAR_UBLOCK_OLD_TURKIC, /**< */ - I18N_UCHAR_UBLOCK_RUMI_NUMERAL_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_KAITHI, /**< */ - I18N_UCHAR_UBLOCK_EGYPTIAN_HIEROGLYPHS, /**< */ - I18N_UCHAR_UBLOCK_ENCLOSED_ALPHANUMERIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C, /**< */ - I18N_UCHAR_UBLOCK_MANDAIC, /**< */ - I18N_UCHAR_UBLOCK_BATAK, /**< */ - I18N_UCHAR_UBLOCK_ETHIOPIC_EXTENDED_A, /**< */ - I18N_UCHAR_UBLOCK_BRAHMI, /**< */ - I18N_UCHAR_UBLOCK_BAMUM_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_KANA_SUPPLEMENT, /**< */ - I18N_UCHAR_UBLOCK_PLAYING_CARDS, /**< */ - I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS, /**< */ - I18N_UCHAR_UBLOCK_EMOTICONS, /**< */ - I18N_UCHAR_UBLOCK_TRANSPORT_AND_MAP_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_ALCHEMICAL_SYMBOLS, /**< */ - I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D, /**< */ - I18N_UCHAR_UBLOCK_COUNT, /**< */ - I18N_UCHAR_UBLOCK_INVALID_CODE = -1 /**< */ + I18N_UCHAR_UBLOCK_NO_BLOCK, /**< No Block */ + I18N_UCHAR_UBLOCK_BASIC_LATIN, /**< Basic Latin */ + I18N_UCHAR_UBLOCK_LATIN_1_SUPPLEMENT, /**< Latin_1 Supplement */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_A, /**< Latin Extended A */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_B, /**< Latin Extended B */ + I18N_UCHAR_UBLOCK_IPA_EXTENSIONS, /**< IPA Extensions */ + I18N_UCHAR_UBLOCK_SPACING_MODIFIER_LETTERS, /**< Spacing Modifier Letters */ + I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS, /**< Combining Diacritical Marks */ + I18N_UCHAR_UBLOCK_GREEK, /**< Greek */ + I18N_UCHAR_UBLOCK_CYRILLIC, /**< Cyrillic */ + I18N_UCHAR_UBLOCK_ARMENIAN, /**< Armenian */ + I18N_UCHAR_UBLOCK_HEBREW, /**< Hebrew */ + I18N_UCHAR_UBLOCK_ARABIC, /**< Arabic */ + I18N_UCHAR_UBLOCK_SYRIAC, /**< Syriac */ + I18N_UCHAR_UBLOCK_THAANA, /**< Thaana */ + I18N_UCHAR_UBLOCK_DEVANAGARI, /**< Devanagari */ + I18N_UCHAR_UBLOCK_BENGALI, /**< Bengali */ + I18N_UCHAR_UBLOCK_GURMUKHI, /**< Gurmukhi */ + I18N_UCHAR_UBLOCK_GUJARATI, /**< Gujarati */ + I18N_UCHAR_UBLOCK_ORIYA, /**< Oriya */ + I18N_UCHAR_UBLOCK_TAMIL, /**< Tamil */ + I18N_UCHAR_UBLOCK_TELUGU, /**< Telugu */ + I18N_UCHAR_UBLOCK_KANNADA, /**< Kannada */ + I18N_UCHAR_UBLOCK_MALAYALAM, /**< Malayalam */ + I18N_UCHAR_UBLOCK_SINHALA, /**< Sinhala */ + I18N_UCHAR_UBLOCK_THAI, /**< Thai */ + I18N_UCHAR_UBLOCK_LAO, /**< Lao */ + I18N_UCHAR_UBLOCK_TIBETAN, /**< Tibetan */ + I18N_UCHAR_UBLOCK_MYANMAR, /**< Myanmar */ + I18N_UCHAR_UBLOCK_GEORGIAN, /**< Georgian */ + I18N_UCHAR_UBLOCK_HANGUL_JAMO, /**< Hangul Jamo */ + I18N_UCHAR_UBLOCK_ETHIOPIC, /**< Ethiopic */ + I18N_UCHAR_UBLOCK_CHEROKEE, /**< Cherokee */ + I18N_UCHAR_UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS, /**< Unified Canadian Aboriginal Syllabics */ + I18N_UCHAR_UBLOCK_OGHAM, /**< Ogham */ + I18N_UCHAR_UBLOCK_RUNIC, /**< Runic */ + I18N_UCHAR_UBLOCK_KHMER, /**< Khmer */ + I18N_UCHAR_UBLOCK_MONGOLIAN, /**< Mongolian */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_ADDITIONAL, /**< Latin Extended Additional */ + I18N_UCHAR_UBLOCK_GREEK_EXTENDED, /**< Greek Extended */ + I18N_UCHAR_UBLOCK_GENERAL_PUNCTUATION, /**< General Punctuation */ + I18N_UCHAR_UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS, /**< Superscripts And Subscripts */ + I18N_UCHAR_UBLOCK_CURRENCY_SYMBOLS, /**< Currency Symbols */ + I18N_UCHAR_UBLOCK_COMBINING_MARKS_FOR_SYMBOLS, /**< Combining Marks For Symbols */ + I18N_UCHAR_UBLOCK_LETTERLIKE_SYMBOLS, /**< Letterlike Symbols */ + I18N_UCHAR_UBLOCK_NUMBER_FORMS, /**< Number Forms */ + I18N_UCHAR_UBLOCK_ARROWS, /**< Arrows */ + I18N_UCHAR_UBLOCK_MATHEMATICAL_OPERATORS, /**< Mathematical Operators */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_TECHNICAL, /**< Miscellaneous Technical */ + I18N_UCHAR_UBLOCK_CONTROL_PICTURES, /**< Control Pictures */ + I18N_UCHAR_UBLOCK_OPTICAL_CHARACTER_RECOGNITION, /**< Optical Character Recognition */ + I18N_UCHAR_UBLOCK_ENCLOSED_ALPHANUMERICS, /**< Enclosed Alphanumerics */ + I18N_UCHAR_UBLOCK_BOX_DRAWING, /**< Box Drawing */ + I18N_UCHAR_UBLOCK_BLOCK_ELEMENTS, /**< Block Elements */ + I18N_UCHAR_UBLOCK_GEOMETRIC_SHAPES, /**< Geometric Shapes */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS, /**< Miscellaneous Symbols */ + I18N_UCHAR_UBLOCK_DINGBATS, /**< Dingbats */ + I18N_UCHAR_UBLOCK_BRAILLE_PATTERNS, /**< Braille Patterns */ + I18N_UCHAR_UBLOCK_CJK_RADICALS_SUPPLEMENT, /**< CJK Radicals Supplement */ + I18N_UCHAR_UBLOCK_KANGXI_RADICALS, /**< Kangxi Radicals */ + I18N_UCHAR_UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS, /**< Ideographic Description Characters */ + I18N_UCHAR_UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION, /**< CJK Symbols And Punctuation */ + I18N_UCHAR_UBLOCK_HIRAGANA, /**< Hiragana */ + I18N_UCHAR_UBLOCK_KATAKANA, /**< Katakana */ + I18N_UCHAR_UBLOCK_BOPOMOFO, /**< Bopomofo */ + I18N_UCHAR_UBLOCK_HANGUL_COMPATIBILITY_JAMO, /**< Hangul Compatibility Jamo */ + I18N_UCHAR_UBLOCK_KANBUN, /**< Kanbun */ + I18N_UCHAR_UBLOCK_BOPOMOFO_EXTENDED, /**< Bopomofo Extended */ + I18N_UCHAR_UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS, /**< Enclosed CJK Letters And Months */ + I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY, /**< CJK Compatibility */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A, /**< CJK Unified Ideographs Extension A */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS, /**< CJK Unified Ideographs */ + I18N_UCHAR_UBLOCK_YI_SYLLABLES, /**< Yi Syllables */ + I18N_UCHAR_UBLOCK_YI_RADICALS, /**< Yi Radicals */ + I18N_UCHAR_UBLOCK_HANGUL_SYLLABLES, /**< Hangul Syllables */ + I18N_UCHAR_UBLOCK_HIGH_SURROGATES, /**< High Surrogates */ + I18N_UCHAR_UBLOCK_HIGH_PRIVATE_USE_SURROGATES, /**< High Private Use Surrogates */ + I18N_UCHAR_UBLOCK_LOW_SURROGATES, /**< Low Surrogates */ + I18N_UCHAR_UBLOCK_PRIVATE_USE_AREA, /**< Private Use Area */ + I18N_UCHAR_UBLOCK_PRIVATE_USE, /**< Private Use */ + I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, /**< CJK Compatibility Ideographs */ + + I18N_UCHAR_UBLOCK_ALPHABETIC_PRESENTATION_FORMS, /**< Alphabetic Presentation Forms */ + I18N_UCHAR_UBLOCK_ARABIC_PRESENTATION_FORMS_A, /**< Arabic Presentation Forms A */ + I18N_UCHAR_UBLOCK_COMBINING_HALF_MARKS, /**< Combining Half Marks */ + I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_FORMS, /**< CJK Compatibility Forms */ + I18N_UCHAR_UBLOCK_SMALL_FORM_VARIANTS, /**< Small Form Variants */ + I18N_UCHAR_UBLOCK_ARABIC_PRESENTATION_FORMS_B, /**< Arabic Presentation Forms B */ + I18N_UCHAR_UBLOCK_SPECIALS, /**< Specials */ + I18N_UCHAR_UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, /**< Halfwidth And Fullwidth Forms */ + I18N_UCHAR_UBLOCK_OLD_ITALIC, /**< Old Italic */ + I18N_UCHAR_UBLOCK_GOTHIC, /**< Gothic */ + I18N_UCHAR_UBLOCK_DESERET, /**< Deseret */ + I18N_UCHAR_UBLOCK_BYZANTINE_MUSICAL_SYMBOLS, /**< Byzantine Musical Symbols */ + I18N_UCHAR_UBLOCK_MUSICAL_SYMBOLS, /**< Musical Symbols */ + I18N_UCHAR_UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS, /**< Mathematical Alphanumeric Symbols */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, /**< CJK Unified Ideographs Extension B */ + I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, /**< CJK Compatibility Ideographs Supplement */ + I18N_UCHAR_UBLOCK_TAGS, /**< Tags */ + I18N_UCHAR_UBLOCK_CYRILLIC_SUPPLEMENT, /**< Cyrillic Supplement */ + I18N_UCHAR_UBLOCK_CYRILLIC_SUPPLEMENTARY, /**< Cyrillic Supplementary */ + I18N_UCHAR_UBLOCK_TAGALOG, /**< Tagalog */ + I18N_UCHAR_UBLOCK_HANUNOO, /**< Hanunoo */ + I18N_UCHAR_UBLOCK_BUHID, /**< Buhid */ + I18N_UCHAR_UBLOCK_TAGBANWA, /**< Tagbanwa */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A, /**< Miscellaneous Mathematical Symbols A */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_A, /**< Supplemental Arrows A */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_B, /**< Supplemental Arrows B */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B, /**< Miscellaneous Mathematical Symbols B */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS, /**< Supplemental Mathematical Operators */ + I18N_UCHAR_UBLOCK_KATAKANA_PHONETIC_EXTENSIONS, /**< Katakana Phonetic Extensions */ + I18N_UCHAR_UBLOCK_VARIATION_SELECTORS, /**< Variation Selectors */ + I18N_UCHAR_UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A, /**< Supplementary Private Use Area A */ + I18N_UCHAR_UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B, /**< Supplementary Private Use Area B */ + I18N_UCHAR_UBLOCK_LIMBU, /**< Limbu */ + I18N_UCHAR_UBLOCK_TAI_LE, /**< Tai Le */ + I18N_UCHAR_UBLOCK_KHMER_SYMBOLS, /**< Khmer Symbols */ + I18N_UCHAR_UBLOCK_PHONETIC_EXTENSIONS, /**< Phonetic Extensions */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS, /**< Miscellaneous Symbols And Arrows */ + I18N_UCHAR_UBLOCK_YIJING_HEXAGRAM_SYMBOLS, /**< Yijing Hexagram Symbols */ + I18N_UCHAR_UBLOCK_LINEAR_B_SYLLABARY, /**< Linear B Syllabary */ + I18N_UCHAR_UBLOCK_LINEAR_B_IDEOGRAMS, /**< Linear B Ideograms */ + I18N_UCHAR_UBLOCK_AEGEAN_NUMBERS, /**< Aegean Numbers */ + I18N_UCHAR_UBLOCK_UGARITIC, /**< Ugaritic */ + I18N_UCHAR_UBLOCK_SHAVIAN, /**< Shavian */ + I18N_UCHAR_UBLOCK_OSMANYA, /**< Osmanya */ + I18N_UCHAR_UBLOCK_CYPRIOT_SYLLABARY, /**< Cypriot Syllabary */ + I18N_UCHAR_UBLOCK_TAI_XUAN_JING_SYMBOLS, /**< Tai Xuan Jing Symbols */ + I18N_UCHAR_UBLOCK_VARIATION_SELECTORS_SUPPLEMENT, /**< Variation Selectors Supplement */ + I18N_UCHAR_UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION, /**< Ancient Greek Musical Notation */ + I18N_UCHAR_UBLOCK_ANCIENT_GREEK_NUMBERS, /**< Ancient Greek Numbers */ + I18N_UCHAR_UBLOCK_ARABIC_SUPPLEMENT, /**< Arabic Supplement */ + I18N_UCHAR_UBLOCK_BUGINESE, /**< Buginese */ + I18N_UCHAR_UBLOCK_CJK_STROKES, /**< CJK Strokes */ + I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT, /**< Combining Diacritical Marks Supplement */ + I18N_UCHAR_UBLOCK_COPTIC, /**< Coptic */ + I18N_UCHAR_UBLOCK_ETHIOPIC_EXTENDED, /**< Ethiopic Extended */ + I18N_UCHAR_UBLOCK_ETHIOPIC_SUPPLEMENT, /**< Ethiopic Supplement */ + I18N_UCHAR_UBLOCK_GEORGIAN_SUPPLEMENT, /**< Georgian Supplement */ + I18N_UCHAR_UBLOCK_GLAGOLITIC, /**< Glagolitic */ + I18N_UCHAR_UBLOCK_KHAROSHTHI, /**< Kharoshthi */ + I18N_UCHAR_UBLOCK_MODIFIER_TONE_LETTERS, /**< Modifier Tone Letters */ + I18N_UCHAR_UBLOCK_NEW_TAI_LUE, /**< New Tai Lue */ + I18N_UCHAR_UBLOCK_OLD_PERSIAN, /**< Old Persian */ + I18N_UCHAR_UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT, /**< Phonetic Extensions Supplement */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_PUNCTUATION, /**< Supplemental Punctuation */ + I18N_UCHAR_UBLOCK_SYLOTI_NAGRI, /**< Syloti Nagri */ + I18N_UCHAR_UBLOCK_TIFINAGH, /**< Tifinagh */ + I18N_UCHAR_UBLOCK_VERTICAL_FORMS, /**< Vertical Forms */ + I18N_UCHAR_UBLOCK_NKO, /**< Nko */ + I18N_UCHAR_UBLOCK_BALINESE, /**< Balinese */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_C, /**< Latin Extended C */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_D, /**< Latin Extended D */ + I18N_UCHAR_UBLOCK_PHAGS_PA, /**< Phags Pa */ + I18N_UCHAR_UBLOCK_PHOENICIAN, /**< Phoenician */ + I18N_UCHAR_UBLOCK_CUNEIFORM, /**< Cuneiform */ + I18N_UCHAR_UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION, /**< Cuneiform Numbers And Punctuation */ + I18N_UCHAR_UBLOCK_COUNTING_ROD_NUMERALS, /**< Counting Rod Numerals */ + I18N_UCHAR_UBLOCK_SUNDANESE, /**< Sundanese */ + I18N_UCHAR_UBLOCK_LEPCHA, /**< Lepcha */ + I18N_UCHAR_UBLOCK_OL_CHIKI, /**< Ol Chiki */ + I18N_UCHAR_UBLOCK_CYRILLIC_EXTENDED_A, /**< Cyrillic Extended A */ + I18N_UCHAR_UBLOCK_VAI, /**< Vai */ + I18N_UCHAR_UBLOCK_CYRILLIC_EXTENDED_B, /**< Cyrillic Extended B */ + I18N_UCHAR_UBLOCK_SAURASHTRA, /**< Saurashtra */ + I18N_UCHAR_UBLOCK_KAYAH_LI, /**< Kayah Li */ + I18N_UCHAR_UBLOCK_REJANG, /**< Rejang */ + I18N_UCHAR_UBLOCK_CHAM, /**< Cham */ + I18N_UCHAR_UBLOCK_ANCIENT_SYMBOLS, /**< Ancient Symbols */ + I18N_UCHAR_UBLOCK_PHAISTOS_DISC, /**< Phaistos Disc */ + I18N_UCHAR_UBLOCK_LYCIAN, /**< Lycian */ + I18N_UCHAR_UBLOCK_CARIAN, /**< Carian */ + I18N_UCHAR_UBLOCK_LYDIAN, /**< Lydian */ + I18N_UCHAR_UBLOCK_MAHJONG_TILES, /**< Mahjong Tiles */ + I18N_UCHAR_UBLOCK_DOMINO_TILES, /**< Domino Tiles */ + I18N_UCHAR_UBLOCK_SAMARITAN, /**< Samaritan */ + I18N_UCHAR_UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED, /**< Unified Canadian Aboriginal Syllabics Extended */ + I18N_UCHAR_UBLOCK_TAI_THAM, /**< Tai Tham */ + I18N_UCHAR_UBLOCK_VEDIC_EXTENSIONS, /**< Vedic Extensions */ + I18N_UCHAR_UBLOCK_LISU, /**< Lisu */ + I18N_UCHAR_UBLOCK_BAMUM, /**< Bamum */ + I18N_UCHAR_UBLOCK_COMMON_INDIC_NUMBER_FORMS, /**< Common Indic Number Forms */ + I18N_UCHAR_UBLOCK_DEVANAGARI_EXTENDED, /**< Devanagari Extended */ + I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_A, /**< Hangul Jamo Extended A */ + I18N_UCHAR_UBLOCK_JAVANESE, /**< Javanese */ + I18N_UCHAR_UBLOCK_MYANMAR_EXTENDED_A, /**< Myanmar Extended A */ + I18N_UCHAR_UBLOCK_TAI_VIET, /**< Tai Viet */ + I18N_UCHAR_UBLOCK_MEETEI_MAYEK, /**< Meetei Mayek */ + I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_B, /**< Hangul Jamo Extended B */ + I18N_UCHAR_UBLOCK_IMPERIAL_ARAMAIC, /**< Imperial Aramaic */ + I18N_UCHAR_UBLOCK_OLD_SOUTH_ARABIAN, /**< Old South Arabian */ + I18N_UCHAR_UBLOCK_AVESTAN, /**< Avestan */ + I18N_UCHAR_UBLOCK_INSCRIPTIONAL_PARTHIAN, /**< Inscriptional Parthian */ + I18N_UCHAR_UBLOCK_INSCRIPTIONAL_PAHLAVI, /**< Inscriptional Pahlavi */ + I18N_UCHAR_UBLOCK_OLD_TURKIC, /**< Old Turkic */ + I18N_UCHAR_UBLOCK_RUMI_NUMERAL_SYMBOLS, /**< Rumi Numeral Symbols */ + I18N_UCHAR_UBLOCK_KAITHI, /**< Kaithi */ + I18N_UCHAR_UBLOCK_EGYPTIAN_HIEROGLYPHS, /**< Egyptian Hieroglyphs */ + I18N_UCHAR_UBLOCK_ENCLOSED_ALPHANUMERIC_SUPPLEMENT, /**< Enclosed Alphanumeric Supplement */ + I18N_UCHAR_UBLOCK_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT, /**< Enclosed Ideographic Supplement */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C, /**< CJK Unified Ideographs Extension C */ + I18N_UCHAR_UBLOCK_MANDAIC, /**< Mandaic */ + I18N_UCHAR_UBLOCK_BATAK, /**< Batak */ + I18N_UCHAR_UBLOCK_ETHIOPIC_EXTENDED_A, /**< Ethiopic Extended A */ + I18N_UCHAR_UBLOCK_BRAHMI, /**< Brahmi */ + I18N_UCHAR_UBLOCK_BAMUM_SUPPLEMENT, /**< Bamum Supplement */ + I18N_UCHAR_UBLOCK_KANA_SUPPLEMENT, /**< Kana Supplement */ + I18N_UCHAR_UBLOCK_PLAYING_CARDS, /**< Playing Cards */ + I18N_UCHAR_UBLOCK_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS, /**< Miscellaneous Symbols And Pictographs */ + I18N_UCHAR_UBLOCK_EMOTICONS, /**< Emoticons */ + I18N_UCHAR_UBLOCK_TRANSPORT_AND_MAP_SYMBOLS, /**< Transport And Map Symbols */ + I18N_UCHAR_UBLOCK_ALCHEMICAL_SYMBOLS, /**< Alchemical Symbols */ + I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D, /**< CJK Unified Ideographs Extension D */ + I18N_UCHAR_UBLOCK_COUNT, /**< Count */ + I18N_UCHAR_UBLOCK_INVALID_CODE = -1 /**< Invalid Code */ } i18n_uchar_ublock_code_e; /** * @brief Enumeration for the language directional property of a character set. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * */ typedef enum { -/* - * Note: UCharDirection constants and their API comments are parsed by preparseucd.py. - * It matches pairs of lines like - * / ** comment... * / - * U_<[A-Z_]+> = , - */ I18N_UCHAR_U_LEFT_TO_RIGHT, /**< L */ I18N_UCHAR_U_RIGHT_TO_LEFT, /**< R */ I18N_UCHAR_U_EUROPEAN_NUMBER, /**< EN */ @@ -599,7 +826,7 @@ typedef enum { I18N_UCHAR_U_POP_DIRECTIONAL_FORMAT, /**< PDF */ I18N_UCHAR_U_DIR_NON_SPACING_MARK, /**< NSM */ I18N_UCHAR_U_BOUNDARY_NEUTRAL, /**< BN */ - I18N_UCHAR_U_CHAR_DIRECTION_COUNT /**< */ + I18N_UCHAR_U_CHAR_DIRECTION_COUNT /**< Count */ } i18n_uchar_direction_e; /** @@ -607,11 +834,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: UDecompositionType constants are parsed by preparseucd.py. - * It matches lines like - * U_DT_ - */ I18N_UCHAR_U_DT_NONE, /**< [none] */ I18N_UCHAR_U_DT_CANONICAL, /**< [can] */ I18N_UCHAR_U_DT_COMPAT, /**< [com] */ @@ -691,71 +913,66 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: UJoiningGroup constants are parsed by preparseucd.py. - * It matches lines like - * U_JG_ - */ - I18N_UCHAR_U_JG_NO_JOINING_GROUP, /**< */ - I18N_UCHAR_U_JG_AIN, /**< */ - I18N_UCHAR_U_JG_ALAPH, /**< */ - I18N_UCHAR_U_JG_ALEF, /**< */ - I18N_UCHAR_U_JG_BEH, /**< */ - I18N_UCHAR_U_JG_BETH, /**< */ - I18N_UCHAR_U_JG_DAL, /**< */ - I18N_UCHAR_U_JG_DALATH_RISH, /**< */ - I18N_UCHAR_U_JG_E, /**< */ - I18N_UCHAR_U_JG_FEH, /**< */ - I18N_UCHAR_U_JG_FINAL_SEMKATH, /**< */ - I18N_UCHAR_U_JG_GAF, /**< */ - I18N_UCHAR_U_JG_GAMAL, /**< */ - I18N_UCHAR_U_JG_HAH, /**< */ - I18N_UCHAR_U_JG_TEH_MARBUTA_GOAL, /**< */ - I18N_UCHAR_U_JG_HAMZA_ON_HEH_GOAL = I18N_UCHAR_U_JG_TEH_MARBUTA_GOAL, /**< */ - I18N_UCHAR_U_JG_HE, /**< */ - I18N_UCHAR_U_JG_HEH, /**< */ - I18N_UCHAR_U_JG_HEH_GOAL, /**< */ - I18N_UCHAR_U_JG_HETH, /**< */ - I18N_UCHAR_U_JG_KAF, /**< */ - I18N_UCHAR_U_JG_KAPH, /**< */ - I18N_UCHAR_U_JG_KNOTTED_HEH, /**< */ - I18N_UCHAR_U_JG_LAM, /**< */ - I18N_UCHAR_U_JG_LAMADH, /**< */ - I18N_UCHAR_U_JG_MEEM, /**< */ - I18N_UCHAR_U_JG_MIM, /**< */ - I18N_UCHAR_U_JG_NOON, /**< */ - I18N_UCHAR_U_JG_NUN, /**< */ - I18N_UCHAR_U_JG_PE, /**< */ - I18N_UCHAR_U_JG_QAF, /**< */ - I18N_UCHAR_U_JG_QAPH, /**< */ - I18N_UCHAR_U_JG_REH, /**< */ - I18N_UCHAR_U_JG_REVERSED_PE, /**< */ - I18N_UCHAR_U_JG_SAD, /**< */ - I18N_UCHAR_U_JG_SADHE, /**< */ - I18N_UCHAR_U_JG_SEEN, /**< */ - I18N_UCHAR_U_JG_SEMKATH, /**< */ - I18N_UCHAR_U_JG_SHIN, /**< */ - I18N_UCHAR_U_JG_SWASH_KAF, /**< */ - I18N_UCHAR_U_JG_SYRIAC_WAW, /**< */ - I18N_UCHAR_U_JG_TAH, /**< */ - I18N_UCHAR_U_JG_TAW, /**< */ - I18N_UCHAR_U_JG_TEH_MARBUTA, /**< */ - I18N_UCHAR_U_JG_TETH, /**< */ - I18N_UCHAR_U_JG_WAW, /**< */ - I18N_UCHAR_U_JG_YEH, /**< */ - I18N_UCHAR_U_JG_YEH_BARREE, /**< */ - I18N_UCHAR_U_JG_YEH_WITH_TAIL, /**< */ - I18N_UCHAR_U_JG_YUDH, /**< */ - I18N_UCHAR_U_JG_YUDH_HE, /**< */ - I18N_UCHAR_U_JG_ZAIN, /**< */ - I18N_UCHAR_U_JG_FE, /**< */ - I18N_UCHAR_U_JG_KHAPH, /**< */ - I18N_UCHAR_U_JG_ZHAIN, /**< */ - I18N_UCHAR_U_JG_BURUSHASKI_YEH_BARREE, /**< */ - I18N_UCHAR_U_JG_FARSI_YEH, /**< */ - I18N_UCHAR_U_JG_NYA, /**< */ - I18N_UCHAR_U_JG_ROHINGYA_YEH, - I18N_UCHAR_U_JG_COUNT /**< */ + I18N_UCHAR_U_JG_NO_JOINING_GROUP, /**< No Joining Group */ + I18N_UCHAR_U_JG_AIN, /**< Ain */ + I18N_UCHAR_U_JG_ALAPH, /**< Alaph */ + I18N_UCHAR_U_JG_ALEF, /**< Alef */ + I18N_UCHAR_U_JG_BEH, /**< Beh */ + I18N_UCHAR_U_JG_BETH, /**< Beth */ + I18N_UCHAR_U_JG_DAL, /**< Dal */ + I18N_UCHAR_U_JG_DALATH_RISH, /**< Dalath Rish */ + I18N_UCHAR_U_JG_E, /**< E */ + I18N_UCHAR_U_JG_FEH, /**< Feh */ + I18N_UCHAR_U_JG_FINAL_SEMKATH, /**< Final Semkath */ + I18N_UCHAR_U_JG_GAF, /**< Gaf */ + I18N_UCHAR_U_JG_GAMAL, /**< Gamal */ + I18N_UCHAR_U_JG_HAH, /**< Hah */ + I18N_UCHAR_U_JG_TEH_MARBUTA_GOAL, /**< Teh Marbuta Goal */ + I18N_UCHAR_U_JG_HAMZA_ON_HEH_GOAL = I18N_UCHAR_U_JG_TEH_MARBUTA_GOAL, /**< Hamza On Heh Goal */ + I18N_UCHAR_U_JG_HE, /**< He */ + I18N_UCHAR_U_JG_HEH, /**< Heh */ + I18N_UCHAR_U_JG_HEH_GOAL, /**< Heh Goal */ + I18N_UCHAR_U_JG_HETH, /**< Heth */ + I18N_UCHAR_U_JG_KAF, /**< Kaf */ + I18N_UCHAR_U_JG_KAPH, /**< Kaph */ + I18N_UCHAR_U_JG_KNOTTED_HEH, /**< Knotted Heh */ + I18N_UCHAR_U_JG_LAM, /**< Lam */ + I18N_UCHAR_U_JG_LAMADH, /**< Lamadh */ + I18N_UCHAR_U_JG_MEEM, /**< Meem */ + I18N_UCHAR_U_JG_MIM, /**< Mim */ + I18N_UCHAR_U_JG_NOON, /**< Noon */ + I18N_UCHAR_U_JG_NUN, /**< Nun */ + I18N_UCHAR_U_JG_PE, /**< Pe */ + I18N_UCHAR_U_JG_QAF, /**< Qaf */ + I18N_UCHAR_U_JG_QAPH, /**< Qaph */ + I18N_UCHAR_U_JG_REH, /**< Reh */ + I18N_UCHAR_U_JG_REVERSED_PE, /**< Reversed Pe */ + I18N_UCHAR_U_JG_SAD, /**< Sad */ + I18N_UCHAR_U_JG_SADHE, /**< Sadhe */ + I18N_UCHAR_U_JG_SEEN, /**< Seen */ + I18N_UCHAR_U_JG_SEMKATH, /**< Semkath */ + I18N_UCHAR_U_JG_SHIN, /**< Shin */ + I18N_UCHAR_U_JG_SWASH_KAF, /**< Swash Kaf */ + I18N_UCHAR_U_JG_SYRIAC_WAW, /**< Syriac Waw */ + I18N_UCHAR_U_JG_TAH, /**< Tah */ + I18N_UCHAR_U_JG_TAW, /**< Taw */ + I18N_UCHAR_U_JG_TEH_MARBUTA, /**< Teh Marbuta */ + I18N_UCHAR_U_JG_TETH, /**< Teth */ + I18N_UCHAR_U_JG_WAW, /**< Waw */ + I18N_UCHAR_U_JG_YEH, /**< Yeh */ + I18N_UCHAR_U_JG_YEH_BARREE, /**< Yeh Barree */ + I18N_UCHAR_U_JG_YEH_WITH_TAIL, /**< Yeh With Tail */ + I18N_UCHAR_U_JG_YUDH, /**< Yudh */ + I18N_UCHAR_U_JG_YUDH_HE, /**< Yudh He */ + I18N_UCHAR_U_JG_ZAIN, /**< Zain */ + I18N_UCHAR_U_JG_FE, /**< Fe */ + I18N_UCHAR_U_JG_KHAPH, /**< Khaph */ + I18N_UCHAR_U_JG_ZHAIN, /**< Zhain */ + I18N_UCHAR_U_JG_BURUSHASKI_YEH_BARREE, /**< Burushaski Yeh Barree */ + I18N_UCHAR_U_JG_FARSI_YEH, /**< Farsi Yeh */ + I18N_UCHAR_U_JG_NYA, /**< Nya */ + I18N_UCHAR_U_JG_ROHINGYA_YEH, /**< Rohingya Yeh */ + I18N_UCHAR_U_JG_COUNT /**< Count */ } i18n_uchar_u_joining_group_e; /** @@ -763,11 +980,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_joining_type_e constants are parsed by preparseucd.py. - * It matches lines like - * U_JT_ - */ I18N_UCHAR_U_JT_NON_JOINING, /**< [U] */ I18N_UCHAR_U_JT_JOIN_CAUSING, /**< [C] */ I18N_UCHAR_U_JT_DUAL_JOINING, /**< [D] */ @@ -782,11 +994,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_line_break_e constants are parsed by preparseucd.py. - * It matches lines like - * U_LB_ - */ I18N_UCHAR_U_LB_UNKNOWN, /**< [XX] */ I18N_UCHAR_U_LB_AMBIGUOUS, /**< [AI] */ I18N_UCHAR_U_LB_ALPHABETIC, /**< [AL] */ @@ -833,11 +1040,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_numeric_type_e constants are parsed by preparseucd.py. - * It matches lines like - * U_NT_ - */ I18N_UCHAR_U_NT_NONE, /**< [None] */ I18N_UCHAR_U_NT_DECIMAL, /**< [de] */ I18N_UCHAR_U_NT_DIGIT, /**< [di] */ @@ -850,11 +1052,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_hangul_syllable_type_e constants are parsed by preparseucd.py. - * It matches lines like - * U_HST_ - */ I18N_UCHAR_U_HST_NOT_APPLICABLE, /**< [NA] */ I18N_UCHAR_U_HST_LEADING_JAMO, /**< [L] */ I18N_UCHAR_U_HST_VOWEL_JAMO, /**< [V] */ @@ -869,11 +1066,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_sentence_break_e constants are parsed by preparseucd.py. - * It matches lines like - * U_SB_ - */ I18N_UCHAR_U_SB_OTHER, /**< [XX] */ I18N_UCHAR_U_SB_ATERM, /**< [AT] */ I18N_UCHAR_U_SB_CLOSE, /**< [CL] */ @@ -897,11 +1089,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_word_break_values_e constants are parsed by preparseucd.py. - * It matches lines like - * U_WB_ - */ I18N_UCHAR_U_WB_OTHER, /**< [XX] */ I18N_UCHAR_U_WB_ALETTER, /**< [LE] */ I18N_UCHAR_U_WB_FORMAT, /**< [FO] */ @@ -923,11 +1110,6 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { -/* - * Note: i18n_uchar_u_grapheme_cluster_break_e constants are parsed by preparseucd.py. - * It matches lines like - * U_GCB_ - */ I18N_UCHAR_U_GCB_OTHER, /**< [XX] */ I18N_UCHAR_U_GCB_CONTROL, /**< [CN] */ I18N_UCHAR_U_GCB_CR, /**< [CR] */ @@ -1066,6 +1248,17 @@ typedef enum { } i18n_unormalization_mode_e; /** + * @brief Result values for normalization quick check functions. + * + * @since_tizen 2.4 + */ +typedef enum { + I18N_UNORMALIZATION_NO, /**< The input string is not in the normalization form. */ + I18N_UNORMALIZATION_YES, /**< The input string is in the normalization form. */ + I18N_UNORMALIZATION_MAYBE /**< The input string may or may not be in the normalization form. */ +} i18n_unormalization_check_result_e; + +/** * @} * @} */ @@ -1982,6 +2175,183 @@ typedef void* i18n_uenumeration_h; * @} */ + +/** + * @addtogroup CAPI_BASE_UTILS_I18N_UCHAR_MODULE + * @{ + */ + +/** + * @brief Constants for ISO 15924 script codes. + * @since_tizen 2.4 + */ +typedef enum { + I18N_USCRIPT_INVALID_CODE = -1, + I18N_USCRIPT_COMMON = 0, /**< Zyyy */ + I18N_USCRIPT_INHERITED = 1, /**< Zinh, "Code for inherited script", for non-spacing combining marks; also Qaai */ + I18N_USCRIPT_ARABIC = 2, /**< Arab */ + I18N_USCRIPT_ARMENIAN = 3, /**< Armn */ + I18N_USCRIPT_BENGALI = 4, /**< Beng */ + I18N_USCRIPT_BOPOMOFO = 5, /**< Bopo */ + I18N_USCRIPT_CHEROKEE = 6, /**< Cher */ + I18N_USCRIPT_COPTIC = 7, /**< Copt */ + I18N_USCRIPT_CYRILLIC = 8, /**< Cyrl */ + I18N_USCRIPT_DESERET = 9, /**< Dsrt */ + I18N_USCRIPT_DEVANAGARI = 10, /**< Deva */ + I18N_USCRIPT_ETHIOPIC = 11, /**< Ethi */ + I18N_USCRIPT_GEORGIAN = 12, /**< Geor */ + I18N_USCRIPT_GOTHIC = 13, /**< Goth */ + I18N_USCRIPT_GREEK = 14, /**< Grek */ + I18N_USCRIPT_GUJARATI = 15, /**< Gujr */ + I18N_USCRIPT_GURMUKHI = 16, /**< Guru */ + I18N_USCRIPT_HAN = 17, /**< Hani */ + I18N_USCRIPT_HANGUL = 18, /**< Hang */ + I18N_USCRIPT_HEBREW = 19, /**< Hebr */ + I18N_USCRIPT_HIRAGANA = 20, /**< Hira */ + I18N_USCRIPT_KANNADA = 21, /**< Knda */ + I18N_USCRIPT_KATAKANA = 22, /**< Kana */ + I18N_USCRIPT_KHMER = 23, /**< Khmr */ + I18N_USCRIPT_LAO = 24, /**< Laoo */ + I18N_USCRIPT_LATIN = 25, /**< Latn */ + I18N_USCRIPT_MALAYALAM = 26, /**< Mlym */ + I18N_USCRIPT_MONGOLIAN = 27, /**< Mong */ + I18N_USCRIPT_MYANMAR = 28, /**< Mymr */ + I18N_USCRIPT_OGHAM = 29, /**< Ogam */ + I18N_USCRIPT_OLD_ITALIC = 30, /**< Ital */ + I18N_USCRIPT_ORIYA = 31, /**< Orya */ + I18N_USCRIPT_RUNIC = 32, /**< Runr */ + I18N_USCRIPT_SINHALA = 33, /**< Sinh */ + I18N_USCRIPT_SYRIAC = 34, /**< Syrc */ + I18N_USCRIPT_TAMIL = 35, /**< Taml */ + I18N_USCRIPT_TELUGU = 36, /**< Telu */ + I18N_USCRIPT_THAANA = 37, /**< Thaa */ + I18N_USCRIPT_THAI = 38, /**< Thai */ + I18N_USCRIPT_TIBETAN = 39, /**< Tibt */ + I18N_USCRIPT_CANADIAN_ABORIGINAL = 40, /**< Cans, Canadian_Aboriginal script. */ + I18N_USCRIPT_UCAS = I18N_USCRIPT_CANADIAN_ABORIGINAL, /**< Canadian_Aboriginal script (alias). */ + I18N_USCRIPT_YI = 41, /**< Yiii */ + I18N_USCRIPT_TAGALOG = 42, /**< Tglg */ + I18N_USCRIPT_HANUNOO = 43, /**< Hano */ + I18N_USCRIPT_BUHID = 44, /**< Buhd */ + I18N_USCRIPT_TAGBANWA = 45, /**< Tagb */ + I18N_USCRIPT_BRAILLE = 46, /**< Brai */ + I18N_USCRIPT_CYPRIOT = 47, /**< Cprt */ + I18N_USCRIPT_LIMBU = 48, /**< Limb */ + I18N_USCRIPT_LINEAR_B = 49, /**< Linb */ + I18N_USCRIPT_OSMANYA = 50, /**< Osma */ + I18N_USCRIPT_SHAVIAN = 51, /**< Shaw */ + I18N_USCRIPT_TAI_LE = 52, /**< Tale */ + I18N_USCRIPT_UGARITIC = 53, /**< Ugar */ + I18N_USCRIPT_KATAKANA_OR_HIRAGANA = 54,/** Date: Mon, 14 Dec 2015 11:07:54 +0100 Subject: [PATCH 03/16] [i18n] Coding style fixed. Change-Id: I6952aef679df8fa094bded1adcb544f4a680c76a Signed-off-by: Radoslaw Czerski --- src/utils_i18n_private.c | 13 +- src/utils_i18n_timezone.cpp | 153 +++++++----- src/utils_i18n_ubrk.c | 111 +++++---- src/utils_i18n_ucalendar.c | 223 ++++++++++------- src/utils_i18n_uchar.c | 17 +- src/utils_i18n_ucollator.c | 50 ++-- src/utils_i18n_udate.c | 182 +++++++------- src/utils_i18n_udatepg.c | 193 ++++++++------- src/utils_i18n_uenumeration.c | 47 ++-- src/utils_i18n_ulocale.c | 191 ++++++++------- src/utils_i18n_unormalization.c | 21 +- src/utils_i18n_unumber.c | 206 ++++++++++------ src/utils_i18n_usearch.c | 51 ++-- src/utils_i18n_uset.c | 527 ++++++++++++++++++++++------------------ src/utils_i18n_ustring.c | 376 ++++++++++++++++------------ 15 files changed, 1318 insertions(+), 1043 deletions(-) diff --git a/src/utils_i18n_private.c b/src/utils_i18n_private.c index b7331f6..13e93d4 100755 --- a/src/utils_i18n_private.c +++ b/src/utils_i18n_private.c @@ -16,11 +16,14 @@ #include -int _i18n_error_mapping ( int err ) +int _i18n_error_mapping(int err) { - if(err == U_STRING_NOT_TERMINATED_WARNING) return I18N_WARNING_STRING_NOT_TERMINATED; - else if(err == U_SORT_KEY_TOO_SHORT_WARNING) return I18N_WARNING_SORT_KEY_TOO_SHORT; - else if(err <= U_ZERO_ERROR) return I18N_ERROR_NONE; + if (err == U_STRING_NOT_TERMINATED_WARNING) + return I18N_WARNING_STRING_NOT_TERMINATED; + else if (err == U_SORT_KEY_TOO_SHORT_WARNING) + return I18N_WARNING_SORT_KEY_TOO_SHORT; + else if (err <= U_ZERO_ERROR) + return I18N_ERROR_NONE; switch (err) { case U_ILLEGAL_ARGUMENT_ERROR : return I18N_ERROR_INVALID_PARAMETER; @@ -60,7 +63,7 @@ int _i18n_error_mapping ( int err ) } } -int _i18n_error_mapping_reverse ( int err ) +int _i18n_error_mapping_reverse(int err) { switch (err) { case I18N_ERROR_NONE : return U_ZERO_ERROR; diff --git a/src/utils_i18n_timezone.cpp b/src/utils_i18n_timezone.cpp index 42c4d1f..fdd706f 100755 --- a/src/utils_i18n_timezone.cpp +++ b/src/utils_i18n_timezone.cpp @@ -30,7 +30,7 @@ #include #include -int i18n_timezone_create_unknown ( i18n_timezone_h *timezone ) +int i18n_timezone_create_unknown(i18n_timezone_h *timezone) { retv_if(timezone == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -40,23 +40,24 @@ int i18n_timezone_create_unknown ( i18n_timezone_h *timezone ) return I18N_ERROR_NONE; } -int i18n_timezone_create_gmt ( i18n_timezone_h *timezone ) +int i18n_timezone_create_gmt(i18n_timezone_h *timezone) { retv_if(timezone == NULL, I18N_ERROR_INVALID_PARAMETER); - const TimeZone* gmt = TimeZone::getGMT(); + const TimeZone *gmt = TimeZone::getGMT(); retv_if(gmt == NULL, I18N_ERROR_OUT_OF_MEMORY); *timezone = gmt->clone(); - if(gmt != NULL) { + + if (gmt != NULL) delete gmt; - } + retv_if(timezone == NULL, I18N_ERROR_OUT_OF_MEMORY); return I18N_ERROR_NONE; } -int i18n_timezone_create ( i18n_timezone_h *timezone, const char *timezone_id ) +int i18n_timezone_create(i18n_timezone_h *timezone, const char *timezone_id) { retv_if(timezone == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -71,80 +72,89 @@ int i18n_timezone_destroy(i18n_timezone_h timezone) { retv_if(timezone == NULL, I18N_ERROR_INVALID_PARAMETER); - delete((TimeZone*)timezone); + delete((TimeZone *) timezone); return I18N_ERROR_NONE; } -int i18n_timezone_foreach_timezone_id_by_region(i18n_system_timezone_type_e timezone_type, const char *region, const int32_t *raw_offset, - i18n_timezone_id_cb cb, void* user_data) +int i18n_timezone_foreach_timezone_id_by_region(i18n_system_timezone_type_e timezone_type, + const char *region, const int32_t *raw_offset, + i18n_timezone_id_cb cb, void *user_data) { retv_if(cb == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode err = U_ZERO_ERROR; - StringEnumeration *s = TimeZone::createTimeZoneIDEnumeration((USystemTimeZoneType)timezone_type, region, raw_offset, err); + StringEnumeration *s = + TimeZone::createTimeZoneIDEnumeration((USystemTimeZoneType) timezone_type, region, + raw_offset, err); - UErrorCode status=U_ZERO_ERROR; + UErrorCode status = U_ZERO_ERROR; int32_t count = s->count(status); + for (int i = 0; i < count; i++) { int32_t resultLength = 0; - if( cb(s->next(&resultLength, status), user_data) == false ) { + + if (cb(s->next(&resultLength, status), user_data) == false) break; - } } delete s; return _i18n_error_mapping(err); } -int i18n_timezone_foreach_timezone_id(i18n_timezone_id_cb cb, void* user_data) +int i18n_timezone_foreach_timezone_id(i18n_timezone_id_cb cb, void *user_data) { retv_if(cb == NULL, I18N_ERROR_INVALID_PARAMETER); StringEnumeration *s = TimeZone::createEnumeration(); UErrorCode status = U_ZERO_ERROR; int32_t count = s->count(status); + for (int i = 0; i < count; i++) { int32_t resultLength = 0; - if( cb(s->next(&resultLength, status), user_data) == false ) { + + if (cb(s->next(&resultLength, status), user_data) == false) break; - } } delete s; return I18N_ERROR_NONE; } -int i18n_timezone_foreach_timezone_id_with_offset(int32_t raw_offset, i18n_timezone_id_cb cb, void* user_data) +int i18n_timezone_foreach_timezone_id_with_offset(int32_t raw_offset, i18n_timezone_id_cb cb, + void *user_data) { retv_if(cb == NULL, I18N_ERROR_INVALID_PARAMETER); StringEnumeration *s = TimeZone::createEnumeration(raw_offset); UErrorCode status = U_ZERO_ERROR; int32_t count = s->count(status); + for (int i = 0; i < count; i++) { int32_t resultLength = 0; - if( cb(s->next(&resultLength, status), user_data) == false ) { + + if (cb(s->next(&resultLength, status), user_data) == false) break; - } } delete s; return I18N_ERROR_NONE; } -int i18n_timezone_foreach_timezone_id_by_country(const char *country, i18n_timezone_id_cb cb, void* user_data) +int i18n_timezone_foreach_timezone_id_by_country(const char *country, i18n_timezone_id_cb cb, + void *user_data) { retv_if(cb == NULL, I18N_ERROR_INVALID_PARAMETER); StringEnumeration *s = TimeZone::createEnumeration(country); UErrorCode status = U_ZERO_ERROR; int32_t count = s->count(status); + for (int i = 0; i < count; i++) { int32_t resultLength = 0; - if( cb(s->next(&resultLength, status), user_data) == false ) { + + if (cb(s->next(&resultLength, status), user_data) == false) break; - } } delete s; @@ -160,7 +170,8 @@ int i18n_timezone_count_equivalent_ids(const char *timezone_id, int32_t *count) return I18N_ERROR_NONE; } -int i18n_timezone_get_equivalent_id(const char *timezone_id, int32_t index, char **equivalent_timezone_id) +int i18n_timezone_get_equivalent_id(const char *timezone_id, int32_t index, + char **equivalent_timezone_id) { retv_if(timezone_id == NULL || equivalent_timezone_id == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -168,13 +179,13 @@ int i18n_timezone_get_equivalent_id(const char *timezone_id, int32_t index, char const UnicodeString id(timezone_id); UnicodeString equivalentTimezoneId = TimeZone::getEquivalentID(id, index); - const UChar * equivalent_tid = equivalentTimezoneId.getTerminatedBuffer(); + const UChar *equivalent_tid = equivalentTimezoneId.getTerminatedBuffer(); retv_if(equivalent_tid == NULL, I18N_ERROR_INVALID_PARAMETER); int32_t ulen = u_strlen(equivalent_tid); retv_if(ulen <= 0, I18N_ERROR_INVALID_PARAMETER); - *equivalent_timezone_id = (char*)malloc(ulen + 1); + *equivalent_timezone_id = (char *)malloc(ulen + 1); retv_if(*equivalent_timezone_id == NULL, I18N_ERROR_OUT_OF_MEMORY); @@ -183,7 +194,7 @@ int i18n_timezone_get_equivalent_id(const char *timezone_id, int32_t index, char return I18N_ERROR_NONE; } -int i18n_timezone_create_default ( i18n_timezone_h *timezone ) +int i18n_timezone_create_default(i18n_timezone_h *timezone) { retv_if(timezone == NULL, I18N_ERROR_INVALID_PARAMETER); *timezone = TimeZone::createDefault(); @@ -191,28 +202,30 @@ int i18n_timezone_create_default ( i18n_timezone_h *timezone ) return I18N_ERROR_NONE; } -int i18n_timezone_set_default( i18n_timezone_h timezone ) +int i18n_timezone_set_default(i18n_timezone_h timezone) { retv_if(timezone == NULL, I18N_ERROR_INVALID_PARAMETER); - TimeZone::setDefault(*(TimeZone*)timezone); + TimeZone::setDefault(*(TimeZone *) timezone); return I18N_ERROR_NONE; } -const char* i18n_timezone_get_tzdata_version(void) +const char *i18n_timezone_get_tzdata_version(void) { UErrorCode status = U_ZERO_ERROR; - const char* tzver = TimeZone::getTZDataVersion(status); + const char *tzver = TimeZone::getTZDataVersion(status); set_last_result(_i18n_error_mapping(status)); return tzver; } -int i18n_timezone_get_region(const char *timezone_id, char *region, int32_t *region_len, int32_t region_capacity) +int i18n_timezone_get_region(const char *timezone_id, char *region, int32_t *region_len, + int32_t region_capacity) { - retv_if(timezone_id == NULL || region == NULL || region_len == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(timezone_id == NULL || region == NULL + || region_len == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode status = U_ZERO_ERROR; const UnicodeString id(timezone_id); @@ -222,12 +235,14 @@ int i18n_timezone_get_region(const char *timezone_id, char *region, int32_t *reg } -int i18n_timezone_get_offset_with_date(i18n_timezone_h timezone, i18n_udate date, i18n_ubool local, int32_t *raw_offset, int32_t *dst_offset) +int i18n_timezone_get_offset_with_date(i18n_timezone_h timezone, i18n_udate date, i18n_ubool local, + int32_t *raw_offset, int32_t *dst_offset) { - retv_if(timezone == NULL || raw_offset == NULL || dst_offset == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(timezone == NULL || raw_offset == NULL + || dst_offset == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode status = U_ZERO_ERROR; - ((TimeZone*)timezone)->getOffset( date, local, *raw_offset, *dst_offset, status ); + ((TimeZone *) timezone)->getOffset(date, local, *raw_offset, *dst_offset, status); return _i18n_error_mapping(status); @@ -236,7 +251,7 @@ int i18n_timezone_get_offset_with_date(i18n_timezone_h timezone, i18n_udate date int i18n_timezone_set_raw_offset(i18n_timezone_h timezone, int32_t offset_milliseconds) { retv_if(timezone == NULL, I18N_ERROR_INVALID_PARAMETER); - ((TimeZone*)timezone)->setRawOffset(offset_milliseconds); + ((TimeZone *) timezone)->setRawOffset(offset_milliseconds); return I18N_ERROR_NONE; } @@ -245,7 +260,7 @@ int i18n_timezone_get_raw_offset(i18n_timezone_h timezone, int32_t *offset_milli { retv_if(timezone == NULL || offset_milliseconds == NULL, I18N_ERROR_INVALID_PARAMETER); - *offset_milliseconds = ((TimeZone*)timezone)->getRawOffset(); + *offset_milliseconds = ((TimeZone *) timezone)->getRawOffset(); return I18N_ERROR_NONE; } @@ -257,14 +272,14 @@ int i18n_timezone_get_id(i18n_timezone_h timezone, char **timezone_id) *timezone_id = NULL; UnicodeString TimezoneID; - ((TimeZone*)timezone)->getID(TimezoneID); - const UChar * tid = TimezoneID.getTerminatedBuffer(); + ((TimeZone *) timezone)->getID(TimezoneID); + const UChar *tid = TimezoneID.getTerminatedBuffer(); retv_if(tid == NULL, I18N_ERROR_INVALID_PARAMETER); int32_t ulen = u_strlen(tid); retv_if(ulen <= 0, I18N_ERROR_INVALID_PARAMETER); - *timezone_id = (char*)malloc(ulen+1); + *timezone_id = (char *)malloc(ulen + 1); retv_if(*timezone_id == NULL, I18N_ERROR_OUT_OF_MEMORY); u_austrcpy(*timezone_id, tid); @@ -276,7 +291,7 @@ int i18n_timezone_set_id(i18n_timezone_h timezone, const char *timezone_id) { retv_if(timezone == NULL || timezone_id == NULL, I18N_ERROR_INVALID_PARAMETER); const UnicodeString id(timezone_id); - ((TimeZone*)timezone)->setID(id); + ((TimeZone *) timezone)->setID(id); return I18N_ERROR_NONE; } @@ -288,14 +303,14 @@ int i18n_timezone_get_display_name(i18n_timezone_h timezone, char **display_name *display_name = NULL; UnicodeString displayName; - ((TimeZone*)timezone)->getDisplayName(displayName); - const UChar * dn = displayName.getTerminatedBuffer(); + ((TimeZone *) timezone)->getDisplayName(displayName); + const UChar *dn = displayName.getTerminatedBuffer(); retv_if(dn == NULL, I18N_ERROR_INVALID_PARAMETER); int32_t ulen = u_strlen(dn); retv_if(ulen <= 0, I18N_ERROR_INVALID_PARAMETER); - *display_name = (char*)malloc(ulen + 1); + *display_name = (char *)malloc(ulen + 1); retv_if(*display_name == NULL, I18N_ERROR_OUT_OF_MEMORY); @@ -304,7 +319,8 @@ int i18n_timezone_get_display_name(i18n_timezone_h timezone, char **display_name return I18N_ERROR_NONE; } -int i18n_timezone_get_display_name_with_locale(i18n_timezone_h timezone, const char *language, const char *country , char **display_name) +int i18n_timezone_get_display_name_with_locale(i18n_timezone_h timezone, const char *language, + const char *country, char **display_name) { retv_if(timezone == NULL || display_name == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -312,14 +328,14 @@ int i18n_timezone_get_display_name_with_locale(i18n_timezone_h timezone, const c *display_name = NULL; UnicodeString displayName; - ((TimeZone*)timezone)->getDisplayName(locale, displayName); - const UChar * dn = displayName.getTerminatedBuffer(); + ((TimeZone *) timezone)->getDisplayName(locale, displayName); + const UChar *dn = displayName.getTerminatedBuffer(); retv_if(dn == NULL, I18N_ERROR_INVALID_PARAMETER); int32_t ulen = u_strlen(dn); retv_if(ulen <= 0, I18N_ERROR_INVALID_PARAMETER); - *display_name = (char*)malloc(ulen + 1); + *display_name = (char *)malloc(ulen + 1); retv_if(*display_name == NULL, I18N_ERROR_OUT_OF_MEMORY); @@ -328,22 +344,24 @@ int i18n_timezone_get_display_name_with_locale(i18n_timezone_h timezone, const c return I18N_ERROR_NONE; } -int i18n_timezone_get_display_name_with_type(i18n_timezone_h timezone, i18n_ubool daylight, i18n_timezone_display_type_e style, - char **display_name) +int i18n_timezone_get_display_name_with_type(i18n_timezone_h timezone, i18n_ubool daylight, + i18n_timezone_display_type_e style, + char **display_name) { retv_if(timezone == NULL || display_name == NULL, I18N_ERROR_INVALID_PARAMETER); *display_name = NULL; UnicodeString displayName; - ((TimeZone*)timezone)->getDisplayName((UBool)daylight, (TimeZone::EDisplayType)style, displayName); - const UChar * dn = displayName.getTerminatedBuffer(); + ((TimeZone *) timezone)->getDisplayName((UBool) daylight, (TimeZone::EDisplayType) style, + displayName); + const UChar *dn = displayName.getTerminatedBuffer(); retv_if(dn == NULL, I18N_ERROR_INVALID_PARAMETER); int32_t ulen = u_strlen(dn); retv_if(ulen <= 0, I18N_ERROR_INVALID_PARAMETER); - *display_name = (char*)malloc(ulen + 1); + *display_name = (char *)malloc(ulen + 1); retv_if(*display_name == NULL, I18N_ERROR_OUT_OF_MEMORY); @@ -352,8 +370,10 @@ int i18n_timezone_get_display_name_with_type(i18n_timezone_h timezone, i18n_uboo return I18N_ERROR_NONE; } -int i18n_timezone_get_display_name_with_type_locale(i18n_timezone_h timezone, i18n_ubool daylight, i18n_timezone_display_type_e style, - const char *language, const char *country, char **display_name) +int i18n_timezone_get_display_name_with_type_locale(i18n_timezone_h timezone, i18n_ubool daylight, + i18n_timezone_display_type_e style, + const char *language, const char *country, + char **display_name) { retv_if(timezone == NULL || display_name == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -361,14 +381,15 @@ int i18n_timezone_get_display_name_with_type_locale(i18n_timezone_h timezone, i1 *display_name = NULL; UnicodeString displayName; - ((TimeZone*)timezone)->getDisplayName((UBool)daylight, (TimeZone::EDisplayType)style, locale, displayName); - const UChar * dn = displayName.getTerminatedBuffer(); + ((TimeZone *) timezone)->getDisplayName((UBool) daylight, (TimeZone::EDisplayType) style, + locale, displayName); + const UChar *dn = displayName.getTerminatedBuffer(); retv_if(dn == NULL, I18N_ERROR_INVALID_PARAMETER); int32_t ulen = u_strlen(dn); retv_if(ulen <= 0, I18N_ERROR_INVALID_PARAMETER); - *display_name = (char*)malloc(ulen + 1); + *display_name = (char *)malloc(ulen + 1); retv_if(*display_name == NULL, I18N_ERROR_OUT_OF_MEMORY); @@ -381,18 +402,19 @@ int i18n_timezone_use_daylight_time(i18n_timezone_h timezone, i18n_ubool *daylig { retv_if(timezone == NULL || daylight_time == NULL, I18N_ERROR_INVALID_PARAMETER); - *daylight_time = ((TimeZone*)timezone)->useDaylightTime(); + *daylight_time = ((TimeZone *) timezone)->useDaylightTime(); return I18N_ERROR_NONE; } -int i18n_timezone_in_daylight_time(i18n_timezone_h timezone, i18n_udate date, i18n_ubool *daylight_time) +int i18n_timezone_in_daylight_time(i18n_timezone_h timezone, i18n_udate date, + i18n_ubool *daylight_time) { retv_if(timezone == NULL || daylight_time == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode status = U_ZERO_ERROR; - *daylight_time = ((TimeZone*)timezone)->inDaylightTime(date, status); + *daylight_time = ((TimeZone *) timezone)->inDaylightTime(date, status); i18n_error_code_e i18n_error = I18N_ERROR_NONE; ERR_MAPPING(status, i18n_error); I18N_ERR(i18n_error); @@ -400,11 +422,12 @@ int i18n_timezone_in_daylight_time(i18n_timezone_h timezone, i18n_udate date, i1 return i18n_error; } -int i18n_timezone_has_same_rule(i18n_timezone_h timezone, i18n_timezone_h other, i18n_ubool *same_rule) +int i18n_timezone_has_same_rule(i18n_timezone_h timezone, i18n_timezone_h other, + i18n_ubool *same_rule) { retv_if(timezone == NULL || other == NULL || same_rule == NULL, I18N_ERROR_INVALID_PARAMETER); - *same_rule = ((TimeZone*)timezone)->hasSameRules(*(TimeZone*)other); + *same_rule = ((TimeZone *) timezone)->hasSameRules(*(TimeZone *) other); return I18N_ERROR_NONE; } @@ -413,7 +436,7 @@ int i18n_timezone_clone(i18n_timezone_h timezone, i18n_timezone_h *clone) { retv_if(timezone == NULL || clone == NULL, I18N_ERROR_INVALID_PARAMETER); - *clone = ((TimeZone*)timezone)->clone(); + *clone = ((TimeZone *) timezone)->clone(); return I18N_ERROR_NONE; } @@ -422,7 +445,7 @@ int i18n_timezone_get_dst_savings(i18n_timezone_h timezone, int32_t *dst_savings { retv_if(timezone == NULL || dst_savings == NULL, I18N_ERROR_INVALID_PARAMETER); - *dst_savings = ((TimeZone*)timezone)->getDSTSavings(); + *dst_savings = ((TimeZone *) timezone)->getDSTSavings(); return I18N_ERROR_NONE; } diff --git a/src/utils_i18n_ubrk.c b/src/utils_i18n_ubrk.c index 79b86d7..cefa08b 100644 --- a/src/utils_i18n_ubrk.c +++ b/src/utils_i18n_ubrk.c @@ -18,17 +18,19 @@ #include #include - -int i18n_ubrk_create (i18n_ubreak_iterator_type_e type, const char *locale, const i18n_uchar *text, int32_t text_length, i18n_ubreak_iterator_h *break_iter) +int i18n_ubrk_create(i18n_ubreak_iterator_type_e type, const char *locale, const i18n_uchar *text, + int32_t text_length, i18n_ubreak_iterator_h *break_iter) { - if (type < I18N_UBRK_CHARACTER || type > I18N_UBRK_SENTENCE || NULL == break_iter) { + if (type < I18N_UBRK_CHARACTER || type > I18N_UBRK_SENTENCE || NULL == break_iter) return I18N_ERROR_INVALID_PARAMETER; - } - if (text_length < -1) { + + if (text_length < -1) return I18N_ERROR_INVALID_PARAMETER; - } + UErrorCode icu_error = U_ZERO_ERROR; - *break_iter = (i18n_ubreak_iterator_h) ubrk_open((UBreakIteratorType)type, locale, text, text_length, &icu_error); + *break_iter = + (i18n_ubreak_iterator_h) ubrk_open((UBreakIteratorType) type, locale, text, text_length, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); @@ -36,14 +38,17 @@ int i18n_ubrk_create (i18n_ubreak_iterator_type_e type, const char *locale, cons return i18n_error; } -int i18n_ubrk_create_rules (const i18n_uchar *rules, int32_t rules_length, const i18n_uchar *text, int32_t text_length, i18n_ubreak_iterator_h *break_iter, i18n_uparse_error_s *parse_err) +int i18n_ubrk_create_rules(const i18n_uchar *rules, int32_t rules_length, const i18n_uchar *text, + int32_t text_length, i18n_ubreak_iterator_h *break_iter, + i18n_uparse_error_s *parse_err) { - if (rules == NULL || rules_length < -1 || text_length < -1 || break_iter == NULL) { + if (rules == NULL || rules_length < -1 || text_length < -1 || break_iter == NULL) return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - *break_iter = (i18n_ubreak_iterator_h) ubrk_openRules (rules, rules_length, text, text_length, (UParseError*)parse_err, &icu_error); + *break_iter = + (i18n_ubreak_iterator_h) ubrk_openRules(rules, rules_length, text, text_length, + (UParseError *) parse_err, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -52,13 +57,16 @@ int i18n_ubrk_create_rules (const i18n_uchar *rules, int32_t rules_length, const return i18n_error; } -int i18n_ubrk_safe_clone (const i18n_ubreak_iterator_h break_iter, void *stack_buffer, int32_t *p_buffer_size, i18n_ubreak_iterator_h *break_iter_clone) +int i18n_ubrk_safe_clone(const i18n_ubreak_iterator_h break_iter, void *stack_buffer, + int32_t *p_buffer_size, i18n_ubreak_iterator_h *break_iter_clone) { - if (break_iter == NULL || break_iter_clone == NULL) { + if (break_iter == NULL || break_iter_clone == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + UErrorCode icu_error = U_ZERO_ERROR; - *break_iter_clone = (i18n_ubreak_iterator_h) ubrk_safeClone((const UBreakIterator*)break_iter, stack_buffer, p_buffer_size, &icu_error); + *break_iter_clone = + (i18n_ubreak_iterator_h) ubrk_safeClone((const UBreakIterator *)break_iter, stack_buffer, + p_buffer_size, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -67,24 +75,23 @@ int i18n_ubrk_safe_clone (const i18n_ubreak_iterator_h break_iter, void *stack_b return i18n_error; } -int i18n_ubrk_destroy (i18n_ubreak_iterator_h break_iter) +int i18n_ubrk_destroy(i18n_ubreak_iterator_h break_iter) { - if (break_iter == NULL) { + if (break_iter == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - ubrk_close((UBreakIterator*)break_iter); + ubrk_close((UBreakIterator *) break_iter); return I18N_ERROR_NONE; } -int i18n_ubrk_set_text (i18n_ubreak_iterator_h break_iter, const i18n_uchar *text, int32_t text_length) +int i18n_ubrk_set_text(i18n_ubreak_iterator_h break_iter, const i18n_uchar *text, + int32_t text_length) { - if(text == NULL || break_iter == NULL || text_length < 0){ + if (text == NULL || break_iter == NULL || text_length < 0) return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - ubrk_setText((UBreakIterator*)break_iter, text, text_length, &icu_error); + ubrk_setText((UBreakIterator *) break_iter, text, text_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -93,17 +100,18 @@ int i18n_ubrk_set_text (i18n_ubreak_iterator_h break_iter, const i18n_uchar *tex return i18n_error; } -int32_t i18n_ubrk_current (const i18n_ubreak_iterator_h break_iter) +int32_t i18n_ubrk_current(const i18n_ubreak_iterator_h break_iter) { if (break_iter == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } + set_last_result(I18N_ERROR_NONE); - return ubrk_current ((const UBreakIterator*)break_iter); + return ubrk_current((const UBreakIterator *)break_iter); } -int32_t i18n_ubrk_next (i18n_ubreak_iterator_h break_iter) +int32_t i18n_ubrk_next(i18n_ubreak_iterator_h break_iter) { if (break_iter == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -111,10 +119,10 @@ int32_t i18n_ubrk_next (i18n_ubreak_iterator_h break_iter) } set_last_result(I18N_ERROR_NONE); - return ubrk_next((UBreakIterator*)break_iter); + return ubrk_next((UBreakIterator *) break_iter); } -int32_t i18n_ubrk_previous (i18n_ubreak_iterator_h break_iter) +int32_t i18n_ubrk_previous(i18n_ubreak_iterator_h break_iter) { if (break_iter == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -122,10 +130,10 @@ int32_t i18n_ubrk_previous (i18n_ubreak_iterator_h break_iter) } set_last_result(I18N_ERROR_NONE); - return ubrk_previous ((UBreakIterator*)break_iter); + return ubrk_previous((UBreakIterator *) break_iter); } -int32_t i18n_ubrk_first (i18n_ubreak_iterator_h break_iter) +int32_t i18n_ubrk_first(i18n_ubreak_iterator_h break_iter) { if (break_iter == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -133,21 +141,21 @@ int32_t i18n_ubrk_first (i18n_ubreak_iterator_h break_iter) } set_last_result(I18N_ERROR_NONE); - return ubrk_first ((UBreakIterator*)break_iter); + return ubrk_first((UBreakIterator *) break_iter); } -int32_t i18n_ubrk_last (i18n_ubreak_iterator_h break_iter) +int32_t i18n_ubrk_last(i18n_ubreak_iterator_h break_iter) { - if( break_iter == NULL) { + if (break_iter == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } set_last_result(I18N_ERROR_NONE); - return ubrk_last ((UBreakIterator*)break_iter); + return ubrk_last((UBreakIterator *) break_iter); } -int32_t i18n_ubrk_preceding (i18n_ubreak_iterator_h break_iter, int32_t offset) +int32_t i18n_ubrk_preceding(i18n_ubreak_iterator_h break_iter, int32_t offset) { if (break_iter == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -155,10 +163,10 @@ int32_t i18n_ubrk_preceding (i18n_ubreak_iterator_h break_iter, int32_t offset) } set_last_result(I18N_ERROR_NONE); - return ubrk_preceding((UBreakIterator*)break_iter, offset); + return ubrk_preceding((UBreakIterator *) break_iter, offset); } -int32_t i18n_ubrk_following (i18n_ubreak_iterator_h break_iter, int32_t offset) +int32_t i18n_ubrk_following(i18n_ubreak_iterator_h break_iter, int32_t offset) { if (break_iter == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -166,12 +174,12 @@ int32_t i18n_ubrk_following (i18n_ubreak_iterator_h break_iter, int32_t offset) } set_last_result(I18N_ERROR_NONE); - return ubrk_following((UBreakIterator*)break_iter, offset); + return ubrk_following((UBreakIterator *) break_iter, offset); } -const char *i18n_ubrk_get_available (int32_t index) +const char *i18n_ubrk_get_available(int32_t index) { - if(index < 0) { + if (index < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -180,13 +188,13 @@ const char *i18n_ubrk_get_available (int32_t index) return ubrk_getAvailable(index); } -int32_t i18n_ubrk_count_available (void) +int32_t i18n_ubrk_count_available(void) { set_last_result(I18N_ERROR_NONE); return ubrk_countAvailable(); } -i18n_ubool i18n_ubrk_is_boundary (i18n_ubreak_iterator_h break_iter, int32_t offset) +i18n_ubool i18n_ubrk_is_boundary(i18n_ubreak_iterator_h break_iter, int32_t offset) { if (break_iter == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -194,10 +202,10 @@ i18n_ubool i18n_ubrk_is_boundary (i18n_ubreak_iterator_h break_iter, int32_t off } set_last_result(I18N_ERROR_NONE); - return ubrk_isBoundary((UBreakIterator*)break_iter, offset); + return ubrk_isBoundary((UBreakIterator *) break_iter, offset); } -int32_t i18n_ubrk_get_rule_status (i18n_ubreak_iterator_h break_iter) +int32_t i18n_ubrk_get_rule_status(i18n_ubreak_iterator_h break_iter) { if (break_iter == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -205,10 +213,11 @@ int32_t i18n_ubrk_get_rule_status (i18n_ubreak_iterator_h break_iter) } set_last_result(I18N_ERROR_NONE); - return ubrk_getRuleStatus((UBreakIterator*)break_iter); + return ubrk_getRuleStatus((UBreakIterator *) break_iter); } -int32_t i18n_ubrk_get_rule_status_vec (i18n_ubreak_iterator_h break_iter, int32_t *fill_in_vec, int32_t capacity) +int32_t i18n_ubrk_get_rule_status_vec(i18n_ubreak_iterator_h break_iter, int32_t *fill_in_vec, + int32_t capacity) { if (break_iter == NULL || capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -216,7 +225,8 @@ int32_t i18n_ubrk_get_rule_status_vec (i18n_ubreak_iterator_h break_iter, int32_ } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_ubrk_getRuleStatusVec = ubrk_getRuleStatusVec((UBreakIterator*)break_iter, fill_in_vec, capacity, &icu_error); + int32_t result_ubrk_getRuleStatusVec = + ubrk_getRuleStatusVec((UBreakIterator *) break_iter, fill_in_vec, capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -226,15 +236,18 @@ int32_t i18n_ubrk_get_rule_status_vec (i18n_ubreak_iterator_h break_iter, int32_ return result_ubrk_getRuleStatusVec; } -const char *i18n_ubrk_get_locale_by_type (const i18n_ubreak_iterator_h break_iter, i18n_ulocale_data_locale_type_e type) +const char *i18n_ubrk_get_locale_by_type(const i18n_ubreak_iterator_h break_iter, + i18n_ulocale_data_locale_type_e type) { if (type < I18N_ULOCALE_DATA_LOCALE_TYPE_ACTUAL_LOCALE || type > I18N_ULOCALE_DATA_LOCALE_TYPE_LIMIT) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + UErrorCode icu_error = U_ZERO_ERROR; - const char * result_ubrk_getLocaleByType = ubrk_getLocaleByType((const UBreakIterator*)break_iter, type, &icu_error); + const char *result_ubrk_getLocaleByType = + ubrk_getLocaleByType((const UBreakIterator *)break_iter, type, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); diff --git a/src/utils_i18n_ucalendar.c b/src/utils_i18n_ucalendar.c index 8cdb38f..b866fdb 100644 --- a/src/utils_i18n_ucalendar.c +++ b/src/utils_i18n_ucalendar.c @@ -18,7 +18,8 @@ #include #include -int i18n_ucalendar_create ( const i18n_uchar *zone_id, int32_t len, const char *locale, i18n_ucalendar_type_e type, i18n_ucalendar_h *calendar ) +int i18n_ucalendar_create(const i18n_uchar *zone_id, int32_t len, const char *locale, + i18n_ucalendar_type_e type, i18n_ucalendar_h *calendar) { retv_if(calendar == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -31,7 +32,7 @@ int i18n_ucalendar_create ( const i18n_uchar *zone_id, int32_t len, const char * return i18n_error; } -int i18n_ucalendar_destroy ( i18n_ucalendar_h calendar ) +int i18n_ucalendar_destroy(i18n_ucalendar_h calendar) { retv_if(calendar == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -39,20 +40,21 @@ int i18n_ucalendar_destroy ( i18n_ucalendar_h calendar ) return I18N_ERROR_NONE; } -int i18n_ucalendar_clone ( const i18n_ucalendar_h cal, i18n_ucalendar_h *identical_to_cal ) +int i18n_ucalendar_clone(const i18n_ucalendar_h cal, i18n_ucalendar_h *identical_to_cal) { retv_if(cal == NULL || identical_to_cal == NULL, I18N_ERROR_INVALID_PARAMETER); i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - *identical_to_cal = ucal_clone(cal, &icu_error); + *identical_to_cal = ucal_clone(cal, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); return i18n_error; } -int i18n_ucalendar_add ( i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount ) +int i18n_ucalendar_add(i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, + int32_t amount) { retv_if(calendar == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -65,7 +67,8 @@ int i18n_ucalendar_add ( i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e return i18n_error; } -int i18n_ucalendar_is_equivalent_to ( const i18n_ucalendar_h calendar1, const i18n_ucalendar_h calendar2, i18n_ubool *equiv ) +int i18n_ucalendar_is_equivalent_to(const i18n_ucalendar_h calendar1, + const i18n_ucalendar_h calendar2, i18n_ubool *equiv) { retv_if(equiv == NULL || calendar1 == NULL || calendar2 == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -73,7 +76,7 @@ int i18n_ucalendar_is_equivalent_to ( const i18n_ucalendar_h calendar1, const i1 return I18N_ERROR_NONE; } -int i18n_ucalendar_get_milliseconds ( const i18n_ucalendar_h calendar, i18n_udate *date ) +int i18n_ucalendar_get_milliseconds(const i18n_ucalendar_h calendar, i18n_udate *date) { retv_if(calendar == NULL || date == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -86,7 +89,8 @@ int i18n_ucalendar_get_milliseconds ( const i18n_ucalendar_h calendar, i18n_udat return i18n_error; } -int i18n_ucalendar_get ( const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t *val ) +int i18n_ucalendar_get(const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, + int32_t *val) { retv_if(calendar == NULL || val == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -99,7 +103,8 @@ int i18n_ucalendar_get ( const i18n_ucalendar_h calendar, i18n_ucalendar_date_fi return i18n_error; } -int i18n_ucalendar_get_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t *val) +int i18n_ucalendar_get_attribute(i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, + int32_t *val) { retv_if(calendar == NULL || val == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -107,21 +112,25 @@ int i18n_ucalendar_get_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_att return I18N_ERROR_NONE; } -int i18n_ucalendar_get_timezone_displayname ( const i18n_ucalendar_h calendar, i18n_ucalendar_displayname_type_e type, const char *locale, - i18n_uchar *result, int32_t result_len, int32_t *buf_size_needed ) +int i18n_ucalendar_get_timezone_displayname(const i18n_ucalendar_h calendar, + i18n_ucalendar_displayname_type_e type, + const char *locale, i18n_uchar *result, + int32_t result_len, int32_t *buf_size_needed) { - retv_if(calendar == NULL || result == NULL || buf_size_needed == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(calendar == NULL || result == NULL + || buf_size_needed == NULL, I18N_ERROR_INVALID_PARAMETER); i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - *buf_size_needed = ucal_getTimeZoneDisplayName(calendar, type, locale, result, result_len, &icu_error); + *buf_size_needed = + ucal_getTimeZoneDisplayName(calendar, type, locale, result, result_len, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); - + return i18n_error; } -int i18n_ucalendar_is_in_daylight_time ( const i18n_ucalendar_h calendar, i18n_ubool *is_in ) +int i18n_ucalendar_is_in_daylight_time(const i18n_ucalendar_h calendar, i18n_ubool *is_in) { retv_if(calendar == NULL || is_in == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -134,7 +143,7 @@ int i18n_ucalendar_is_in_daylight_time ( const i18n_ucalendar_h calendar, i18n_u return i18n_error; } -int i18n_ucalendar_set ( i18n_ucalendar_h cal, i18n_ucalendar_date_fields_e field, int32_t val ) +int i18n_ucalendar_set(i18n_ucalendar_h cal, i18n_ucalendar_date_fields_e field, int32_t val) { retv_if(cal == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -142,7 +151,8 @@ int i18n_ucalendar_set ( i18n_ucalendar_h cal, i18n_ucalendar_date_fields_e fiel return I18N_ERROR_NONE; } -int i18n_ucalendar_set_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t val ) +int i18n_ucalendar_set_attribute(i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, + int32_t val) { retv_if(calendar == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -150,7 +160,8 @@ int i18n_ucalendar_set_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_att return I18N_ERROR_NONE; } -int i18n_ucalendar_set_date_time ( i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date, int32_t hour, int32_t min, int32_t sec ) +int i18n_ucalendar_set_date_time(i18n_ucalendar_h calendar, int32_t year, int32_t month, + int32_t date, int32_t hour, int32_t min, int32_t sec) { retv_if(calendar == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -163,7 +174,7 @@ int i18n_ucalendar_set_date_time ( i18n_ucalendar_h calendar, int32_t year, int3 return i18n_error; } -int i18n_ucalendar_set_milliseconds ( i18n_ucalendar_h calendar, i18n_udate milliseconds ) +int i18n_ucalendar_set_milliseconds(i18n_ucalendar_h calendar, i18n_udate milliseconds) { retv_if(calendar == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -176,7 +187,7 @@ int i18n_ucalendar_set_milliseconds ( i18n_ucalendar_h calendar, i18n_udate mill return i18n_error; } -int i18n_ucalendar_set_default_timezone ( const i18n_uchar *zone_id ) +int i18n_ucalendar_set_default_timezone(const i18n_uchar *zone_id) { retv_if(zone_id == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -189,20 +200,21 @@ int i18n_ucalendar_set_default_timezone ( const i18n_uchar *zone_id ) return i18n_error; } -int32_t i18n_ucalendar_get_field_difference ( i18n_ucalendar_h calendar, i18n_udate target, i18n_ucalendar_date_fields_e field, i18n_error_code_e *status ) +int32_t i18n_ucalendar_get_field_difference(i18n_ucalendar_h calendar, i18n_udate target, + i18n_ucalendar_date_fields_e field, + i18n_error_code_e *status) { - if(calendar == NULL) - { - if(NULL != status) { + if (calendar == NULL) { + if (NULL != status) *status = I18N_ERROR_INVALID_PARAMETER; - } + return 0; } UErrorCode icu_error = U_ZERO_ERROR; int32_t result = ucal_getFieldDifference(calendar, target, field, &icu_error); - if(NULL != status) { + if (NULL != status) { ERR_MAPPING(icu_error, *status); I18N_ERR(*status); } @@ -210,7 +222,7 @@ int32_t i18n_ucalendar_get_field_difference ( i18n_ucalendar_h calendar, i18n_ud return result; } -int i18n_ucalendar_get_now ( i18n_udate *date ) +int i18n_ucalendar_get_now(i18n_udate *date) { retv_if(date == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -219,64 +231,70 @@ int i18n_ucalendar_get_now ( i18n_udate *date ) } // Newly Added APIs -int i18n_ucalendar_timezone_id_enumeration_create ( i18n_system_timezone_type_e zone_type, const char *region, const int32_t *raw_offset, i18n_uenumeration_h *enumeration ) +int i18n_ucalendar_timezone_id_enumeration_create(i18n_system_timezone_type_e zone_type, + const char *region, const int32_t *raw_offset, + i18n_uenumeration_h *enumeration) { - if(region == NULL || enumeration == NULL){ + if (region == NULL || enumeration == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - *enumeration = (i18n_uenumeration_h)ucal_openTimeZoneIDEnumeration (zone_type, region, raw_offset, &icu_error); + *enumeration = + (i18n_uenumeration_h) ucal_openTimeZoneIDEnumeration(zone_type, region, raw_offset, + &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); return i18n_error; } -int i18n_ucalendar_timezones_create (i18n_uenumeration_h *enumeration) +int i18n_ucalendar_timezones_create(i18n_uenumeration_h *enumeration) { - if(enumeration == NULL){ + if (enumeration == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - *enumeration = (i18n_uenumeration_h)ucal_openTimeZones(&icu_error); + *enumeration = (i18n_uenumeration_h) ucal_openTimeZones(&icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); return i18n_error; } -int i18n_ucalendar_country_timezones_create (const char *country, i18n_uenumeration_h *enumeration) +int i18n_ucalendar_country_timezones_create(const char *country, i18n_uenumeration_h *enumeration) { - if (country == NULL || enumeration == NULL) { + if (country == NULL || enumeration == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - *enumeration = (i18n_uenumeration_h)ucal_openCountryTimeZones(country, &icu_error); + *enumeration = (i18n_uenumeration_h) ucal_openCountryTimeZones(country, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); return i18n_error; } -int32_t i18n_ucalendar_get_default_timezone (i18n_uchar *result, int32_t result_capacity) +int32_t i18n_ucalendar_get_default_timezone(i18n_uchar *result, int32_t result_capacity) { i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_ucal_getDefaultTimeZone = ucal_getDefaultTimeZone(result, result_capacity, &icu_error); + int32_t result_ucal_getDefaultTimeZone = + ucal_getDefaultTimeZone(result, result_capacity, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); set_last_result(i18n_error); return result_ucal_getDefaultTimeZone; } -int i18n_ucalendar_set_timezone ( i18n_ucalendar_h calendar, const i18n_uchar *zone_id, int32_t length) +int i18n_ucalendar_set_timezone(i18n_ucalendar_h calendar, const i18n_uchar *zone_id, + int32_t length) { - if (calendar == NULL) { + if (calendar == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; ucal_setTimeZone(calendar, zone_id, length, &icu_error); @@ -286,15 +304,18 @@ int i18n_ucalendar_set_timezone ( i18n_ucalendar_h calendar, const i18n_uchar *z return i18n_error; } -int32_t i18n_ucalendar_get_timezone_id (const i18n_ucalendar_h calendar, i18n_uchar *result, int32_t result_length) +int32_t i18n_ucalendar_get_timezone_id(const i18n_ucalendar_h calendar, i18n_uchar *result, + int32_t result_length) { if (calendar == NULL || result == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_ucal_getTimeZoneID = ucal_getTimeZoneID(calendar, result, result_length, &icu_error); + int32_t result_ucal_getTimeZoneID = + ucal_getTimeZoneID(calendar, result, result_length, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); @@ -302,11 +323,11 @@ int32_t i18n_ucalendar_get_timezone_id (const i18n_ucalendar_h calendar, i18n_u return result_ucal_getTimeZoneID; } -int i18n_ucalendar_set_gregorian_change ( i18n_ucalendar_h calendar, i18n_udate date) +int i18n_ucalendar_set_gregorian_change(i18n_ucalendar_h calendar, i18n_udate date) { - if (calendar == NULL) { + if (calendar == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; ucal_setGregorianChange(calendar, date, &icu_error); @@ -317,11 +338,11 @@ int i18n_ucalendar_set_gregorian_change ( i18n_ucalendar_h calendar, i18n_udate } -int i18n_ucalendar_get_gregorian_change ( const i18n_ucalendar_h calendar, i18n_udate *date) +int i18n_ucalendar_get_gregorian_change(const i18n_ucalendar_h calendar, i18n_udate *date) { - if (calendar == NULL || date == NULL) { + if (calendar == NULL || date == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; *date = ucal_getGregorianChange(calendar, &icu_error); @@ -331,7 +352,7 @@ int i18n_ucalendar_get_gregorian_change ( const i18n_ucalendar_h calendar, i18n return i18n_error; } -const char * i18n_ucalendar_get_available ( int32_t locale_index ) +const char *i18n_ucalendar_get_available(int32_t locale_index) { if (locale_index < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -342,17 +363,17 @@ const char * i18n_ucalendar_get_available ( int32_t locale_index ) return ucal_getAvailable(locale_index); } -int32_t i18n_ucalendar_count_available ( void ) +int32_t i18n_ucalendar_count_available(void) { set_last_result(I18N_ERROR_NONE); return ucal_countAvailable(); } -int i18n_ucalendar_set_date ( i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date) +int i18n_ucalendar_set_date(i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date) { - if (calendar == NULL) { + if (calendar == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; ucal_setDate(calendar, year, month, date, &icu_error); @@ -362,11 +383,12 @@ int i18n_ucalendar_set_date ( i18n_ucalendar_h calendar, int32_t year, int32_t m return i18n_error; } -int i18n_ucalendar_roll ( i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount) +int i18n_ucalendar_roll(i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, + int32_t amount) { - if (calendar == NULL) { + if (calendar == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; ucal_roll(calendar, field, amount, &icu_error); @@ -376,7 +398,8 @@ int i18n_ucalendar_roll ( i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_ return i18n_error; } -i18n_ubool i18n_ucalendar_is_set ( const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field ) +i18n_ubool i18n_ucalendar_is_set(const i18n_ucalendar_h calendar, + i18n_ucalendar_date_fields_e field) { if (calendar == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -384,27 +407,30 @@ i18n_ubool i18n_ucalendar_is_set ( const i18n_ucalendar_h calendar, i18n_ucalend } set_last_result(I18N_ERROR_NONE); - return ucal_isSet (calendar, field); + return ucal_isSet(calendar, field); } -int i18n_ucalendar_clear_field ( i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field ) + +int i18n_ucalendar_clear_field(i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field) { - if (calendar == NULL) { + if (calendar == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - ucal_clearField (calendar, field); + + ucal_clearField(calendar, field); return I18N_ERROR_NONE; } -int i18n_ucalendar_clear ( i18n_ucalendar_h calendar ) +int i18n_ucalendar_clear(i18n_ucalendar_h calendar) { - if (calendar == NULL) { + if (calendar == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + ucal_clear(calendar); return I18N_ERROR_NONE; } -int32_t i18n_ucalendar_get_limit ( const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, i18n_ucalendar_limit_type_e type) +int32_t i18n_ucalendar_get_limit(const i18n_ucalendar_h calendar, + i18n_ucalendar_date_fields_e field, + i18n_ucalendar_limit_type_e type) { if (calendar == NULL || field < I18N_UCALENDAR_ERA || field >= I18N_UCALENDAR_FIELD_COUNT) { set_last_result(I18N_ERROR_INVALID_PARAMETER); @@ -422,12 +448,14 @@ int32_t i18n_ucalendar_get_limit ( const i18n_ucalendar_h calendar, i18n_ucalend return result_ucal_getLimit; } -const char *i18n_ucalendar_get_locale_by_type ( const i18n_ucalendar_h calendar, i18n_ulocale_data_locale_type_e type ) +const char *i18n_ucalendar_get_locale_by_type(const i18n_ucalendar_h calendar, + i18n_ulocale_data_locale_type_e type) { if (calendar == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; const char *result_ucal_getLocaleByType = ucal_getLocaleByType(calendar, type, &icu_error); @@ -438,7 +466,7 @@ const char *i18n_ucalendar_get_locale_by_type ( const i18n_ucalendar_h calendar, return result_ucal_getLocaleByType; } -const char *i18n_ucalendar_get_tz_data_version (void) +const char *i18n_ucalendar_get_tz_data_version(void) { i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; @@ -450,28 +478,33 @@ const char *i18n_ucalendar_get_tz_data_version (void) return result_ucal_getTZDataVersion; } -int32_t i18n_ucalendar_get_canonical_timezone_id ( const i18n_uchar *id, int32_t length, i18n_uchar *result, int32_t result_capacity, i18n_ubool *is_system_id ) +int32_t i18n_ucalendar_get_canonical_timezone_id(const i18n_uchar *id, int32_t length, + i18n_uchar *result, int32_t result_capacity, + i18n_ubool *is_system_id) { if (id == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_ucal_getCanonicalTimeZoneID = ucal_getCanonicalTimeZoneID(id, length, result, result_capacity, is_system_id, &icu_error); + int32_t result_ucal_getCanonicalTimeZoneID = + ucal_getCanonicalTimeZoneID(id, length, result, result_capacity, is_system_id, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); set_last_result(i18n_error); - return result_ucal_getCanonicalTimeZoneID ; + return result_ucal_getCanonicalTimeZoneID; } -const char *i18n_ucalendar_get_type ( const i18n_ucalendar_h calendar ) +const char *i18n_ucalendar_get_type(const i18n_ucalendar_h calendar) { if (calendar == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; const char *result_ucal_getType = ucal_getType(calendar, &icu_error); @@ -482,25 +515,31 @@ const char *i18n_ucalendar_get_type ( const i18n_ucalendar_h calendar ) return result_ucal_getType; } -int i18n_ucalendar_get_keyword_values_for_locale ( const char *key, const char *locale, i18n_ubool commonly_used, i18n_uenumeration_h * enumeration ) +int i18n_ucalendar_get_keyword_values_for_locale(const char *key, const char *locale, + i18n_ubool commonly_used, + i18n_uenumeration_h *enumeration) { - if (key == NULL || enumeration == NULL) { + if (key == NULL || enumeration == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - *enumeration = (i18n_uenumeration_h )ucal_getKeywordValuesForLocale(key, locale, commonly_used, &icu_error); + *enumeration = + (i18n_uenumeration_h) ucal_getKeywordValuesForLocale(key, locale, commonly_used, + &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); return i18n_error; } -int i18n_ucalendar_get_day_of_week_type ( const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week, i18n_ucalendar_weekday_type_e *weekday_type ) +int i18n_ucalendar_get_day_of_week_type(const i18n_ucalendar_h calendar, + i18n_ucalendar_days_of_week_e day_of_week, + i18n_ucalendar_weekday_type_e *weekday_type) { - if (calendar == NULL || weekday_type == NULL) { + if (calendar == NULL || weekday_type == NULL) return I18N_ERROR_INVALID_PARAMETER; - } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; *weekday_type = ucal_getDayOfWeekType(calendar, day_of_week, &icu_error); @@ -510,15 +549,18 @@ int i18n_ucalendar_get_day_of_week_type ( const i18n_ucalendar_h calendar, i18n_ return i18n_error; } -int32_t i18n_ucalendar_get_weekend_transition ( const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week ) +int32_t i18n_ucalendar_get_weekend_transition(const i18n_ucalendar_h calendar, + i18n_ucalendar_days_of_week_e day_of_week) { if (calendar == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_ucal_getWeekendTransition = ucal_getWeekendTransition(calendar, day_of_week, &icu_error); + int32_t result_ucal_getWeekendTransition = + ucal_getWeekendTransition(calendar, day_of_week, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); @@ -526,12 +568,13 @@ int32_t i18n_ucalendar_get_weekend_transition ( const i18n_ucalendar_h calendar, return result_ucal_getWeekendTransition; } -i18n_ubool i18n_ucalendar_is_weekend ( i18n_ucalendar_h calendar, i18n_udate date ) +i18n_ubool i18n_ucalendar_is_weekend(i18n_ucalendar_h calendar, i18n_udate date) { if (calendar == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; i18n_ubool result_ucal_isWeekend = ucal_isWeekend(calendar, date, &icu_error); @@ -542,15 +585,19 @@ i18n_ubool i18n_ucalendar_is_weekend ( i18n_ucalendar_h calendar, i18n_udate dat return result_ucal_isWeekend; } -i18n_ubool i18n_ucalendar_get_timezone_transition_date ( const i18n_ucalendar_h calendar, i18n_utimezone_transition_type_e type, i18n_udate *transition) +i18n_ubool i18n_ucalendar_get_timezone_transition_date(const i18n_ucalendar_h calendar, + i18n_utimezone_transition_type_e type, + i18n_udate *transition) { if (calendar == NULL || transition == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + i18n_error_code_e i18n_error; UErrorCode icu_error = U_ZERO_ERROR; - i18n_ubool result_ucal_getTimeZoneTransitionDate = ucal_getTimeZoneTransitionDate(calendar, type, transition, &icu_error); + i18n_ubool result_ucal_getTimeZoneTransitionDate = + ucal_getTimeZoneTransitionDate(calendar, type, transition, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); diff --git a/src/utils_i18n_uchar.c b/src/utils_i18n_uchar.c index eedb1c8..3756dad 100755 --- a/src/utils_i18n_uchar.c +++ b/src/utils_i18n_uchar.c @@ -18,18 +18,19 @@ #include #include -int i18n_uchar_get_int_property_value ( i18n_uchar32 c, i18n_uchar_uproperty_e which, int32_t *property_val ) +int i18n_uchar_get_int_property_value(i18n_uchar32 c, i18n_uchar_uproperty_e which, + int32_t *property_val) { - retv_if (property_val == NULL, I18N_ERROR_INVALID_PARAMETER); - *property_val = u_getIntPropertyValue(c, which); + retv_if(property_val == NULL, I18N_ERROR_INVALID_PARAMETER); + *property_val = u_getIntPropertyValue(c, which); - return I18N_ERROR_NONE; + return I18N_ERROR_NONE; } -int i18n_uchar_get_ublock_code ( i18n_uchar32 c, i18n_uchar_ublock_code_e *block_val ) +int i18n_uchar_get_ublock_code(i18n_uchar32 c, i18n_uchar_ublock_code_e *block_val) { - retv_if (block_val == NULL, I18N_ERROR_INVALID_PARAMETER); - *block_val = ublock_getCode(c); + retv_if(block_val == NULL, I18N_ERROR_INVALID_PARAMETER); + *block_val = ublock_getCode(c); - return I18N_ERROR_NONE; + return I18N_ERROR_NONE; } diff --git a/src/utils_i18n_ucollator.c b/src/utils_i18n_ucollator.c index 7cf1b01..1b42fcd 100755 --- a/src/utils_i18n_ucollator.c +++ b/src/utils_i18n_ucollator.c @@ -18,60 +18,64 @@ #include #include -int i18n_ucollator_destroy ( i18n_ucollator_h collator ) +int i18n_ucollator_destroy(i18n_ucollator_h collator) { retv_if(collator == NULL, I18N_ERROR_INVALID_PARAMETER); - ucol_close(collator); + ucol_close(collator); - return I18N_ERROR_NONE; + return I18N_ERROR_NONE; } -int i18n_ucollator_equal ( const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ubool *equal ) +int i18n_ucollator_equal(const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, + const i18n_uchar *target, int32_t target_len, i18n_ubool *equal) { retv_if(collator == NULL, I18N_ERROR_INVALID_PARAMETER); - *equal = ucol_equal(collator, src, src_len, target, target_len); + *equal = ucol_equal(collator, src, src_len, target, target_len); - return I18N_ERROR_NONE; + return I18N_ERROR_NONE; } -int i18n_ucollator_create ( const char *locale, i18n_ucollator_h *collator ) +int i18n_ucollator_create(const char *locale, i18n_ucollator_h *collator) { - retv_if (collator == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(collator == NULL, I18N_ERROR_INVALID_PARAMETER); - i18n_error_code_e err = I18N_ERROR_NONE; - *collator = ucol_open(locale, (UErrorCode*)&err); - int result = _i18n_error_mapping(err); + i18n_error_code_e err = I18N_ERROR_NONE; + *collator = ucol_open(locale, (UErrorCode *) & err); + int result = _i18n_error_mapping(err); - return result; + return result; } -int i18n_ucollator_set_attribute( i18n_ucollator_h collator, i18n_ucollator_attribute_e attr, i18n_ucollator_attribute_value_e val ) +int i18n_ucollator_set_attribute(i18n_ucollator_h collator, i18n_ucollator_attribute_e attr, + i18n_ucollator_attribute_value_e val) { retv_if(collator == NULL, I18N_ERROR_INVALID_PARAMETER); - i18n_error_code_e err = I18N_ERROR_NONE; - ucol_setAttribute(collator, attr, val, (UErrorCode*)&err); - int result = _i18n_error_mapping(err); + i18n_error_code_e err = I18N_ERROR_NONE; + ucol_setAttribute(collator, attr, val, (UErrorCode *) & err); + int result = _i18n_error_mapping(err); - return result; + return result; } -int i18n_ucollator_set_strength ( i18n_ucollator_h collator, i18n_ucollator_strength_e strength ) +int i18n_ucollator_set_strength(i18n_ucollator_h collator, i18n_ucollator_strength_e strength) { retv_if(collator == NULL, I18N_ERROR_INVALID_PARAMETER); - ucol_setStrength(collator, strength); + ucol_setStrength(collator, strength); - return I18N_ERROR_NONE; + return I18N_ERROR_NONE; } -int i18n_ucollator_str_collator ( const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ucollator_result_e *result ) +int i18n_ucollator_str_collator(const i18n_ucollator_h collator, const i18n_uchar *src, + int32_t src_len, const i18n_uchar *target, int32_t target_len, + i18n_ucollator_result_e *result) { retv_if(collator == NULL, I18N_ERROR_INVALID_PARAMETER); - *result = ucol_strcoll(collator, src, src_len, target, target_len); + *result = ucol_strcoll(collator, src, src_len, target, target_len); - return I18N_ERROR_NONE; + return I18N_ERROR_NONE; } diff --git a/src/utils_i18n_udate.c b/src/utils_i18n_udate.c index 54c2bdb..c0f3e8c 100644 --- a/src/utils_i18n_udate.c +++ b/src/utils_i18n_udate.c @@ -18,12 +18,16 @@ #include #include -int i18n_udate_create ( i18n_udate_format_style_e time_style, i18n_udate_format_style_e date_style, const char *locale, const i18n_uchar *tz_id, int32_t tz_id_len, const i18n_uchar *pattern, int32_t pattern_len, i18n_udate_format_h *format ) +int i18n_udate_create(i18n_udate_format_style_e time_style, i18n_udate_format_style_e date_style, + const char *locale, const i18n_uchar *tz_id, int32_t tz_id_len, + const i18n_uchar *pattern, int32_t pattern_len, i18n_udate_format_h *format) { - retv_if( format == NULL, I18N_ERROR_INVALID_PARAMETER ); + retv_if(format == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode icu_error = U_ZERO_ERROR; - *format = udat_open(time_style, date_style, locale, tz_id, tz_id_len, pattern, pattern_len, &icu_error); + *format = + udat_open(time_style, date_style, locale, tz_id, tz_id_len, pattern, pattern_len, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -32,20 +36,23 @@ int i18n_udate_create ( i18n_udate_format_style_e time_style, i18n_udate_format_ return i18n_error; } -int i18n_udate_destroy ( i18n_udate_format_h format ) +int i18n_udate_destroy(i18n_udate_format_h format) { - retv_if( format == NULL, I18N_ERROR_INVALID_PARAMETER ); + retv_if(format == NULL, I18N_ERROR_INVALID_PARAMETER); udat_close(format); return I18N_ERROR_NONE; } -int i18n_udate_format_date ( const i18n_udate_format_h format, i18n_udate date_to_format, i18n_uchar *result, int32_t result_len, i18n_ufield_position_h pos, int32_t *buf_size_needed ) +int i18n_udate_format_date(const i18n_udate_format_h format, i18n_udate date_to_format, + i18n_uchar *result, int32_t result_len, i18n_ufield_position_h pos, + int32_t *buf_size_needed) { - retv_if( format == NULL || buf_size_needed == NULL, I18N_ERROR_INVALID_PARAMETER ); + retv_if(format == NULL || buf_size_needed == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode icu_error = U_ZERO_ERROR; - *buf_size_needed = udat_format(format, date_to_format, result, result_len, (UFieldPosition*)pos, &icu_error); + *buf_size_needed = + udat_format(format, date_to_format, result, result_len, (UFieldPosition *) pos, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -55,36 +62,34 @@ int i18n_udate_format_date ( const i18n_udate_format_h format, i18n_udate date_t } // Newly Added APIs -int i18n_udate_to_calendar_date_field ( i18n_udate_format_field_e field, i18n_ucalendar_date_fields_e *date_field_type ) +int i18n_udate_to_calendar_date_field(i18n_udate_format_field_e field, + i18n_ucalendar_date_fields_e *date_field_type) { if (date_field_type == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } switch (field) { - case I18N_UDATE_FORMAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD: - case I18N_UDATE_FORMAT_TIMEZONE_ISO_FIELD: - case I18N_UDATE_FORMAT_TIMEZONE_ISO_LOCAL_FIELD: - case I18N_UDATE_FORMAT_FIELD_COUNT: - LOGE("Unsupported field"); - return I18N_ERROR_INVALID_PARAMETER; - default: - *date_field_type = (i18n_ucalendar_date_fields_e)udat_toCalendarDateField(field); + case I18N_UDATE_FORMAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD: + case I18N_UDATE_FORMAT_TIMEZONE_ISO_FIELD: + case I18N_UDATE_FORMAT_TIMEZONE_ISO_LOCAL_FIELD: + case I18N_UDATE_FORMAT_FIELD_COUNT: + LOGE("Unsupported field"); + return I18N_ERROR_INVALID_PARAMETER; + + default: + *date_field_type = (i18n_ucalendar_date_fields_e) udat_toCalendarDateField(field); } return I18N_ERROR_NONE; } -int i18n_udate_clone ( const i18n_udate_format_h format, i18n_udate_format_h *format_clone ) +int i18n_udate_clone(const i18n_udate_format_h format, i18n_udate_format_h *format_clone) { if (format == NULL || format_clone == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - *format_clone = (i18n_udate_format_h)udat_clone((const UDateFormat *)format, &icu_error); + *format_clone = (i18n_udate_format_h) udat_clone((const UDateFormat *)format, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -93,15 +98,15 @@ int i18n_udate_clone ( const i18n_udate_format_h format, i18n_udate_format_h *fo return i18n_error; } -int i18n_udate_parse ( const i18n_udate_format_h format, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_udate *parsed_date ) +int i18n_udate_parse(const i18n_udate_format_h format, const i18n_uchar *text, int32_t text_length, + int32_t *parse_pos, i18n_udate *parsed_date) { if (format == NULL || text == NULL || text_length < -1 || parsed_date == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - *parsed_date = udat_parse((const UDateFormat *)format, text, text_length, parse_pos, &icu_error); + *parsed_date = + udat_parse((const UDateFormat *)format, text, text_length, parse_pos, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -110,15 +115,15 @@ int i18n_udate_parse ( const i18n_udate_format_h format, const i18n_uchar *text, return i18n_error; } -int i18n_udate_parse_calendar (const i18n_udate_format_h format, i18n_ucalendar_h * calendar, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos ) +int i18n_udate_parse_calendar(const i18n_udate_format_h format, i18n_ucalendar_h *calendar, + const i18n_uchar *text, int32_t text_length, int32_t *parse_pos) { if (format == NULL || calendar == NULL || text == NULL || text_length < -1) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - udat_parseCalendar((const UDateFormat *)format, calendar, text, text_length, parse_pos, &icu_error); + udat_parseCalendar((const UDateFormat *)format, calendar, text, text_length, parse_pos, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -127,10 +132,9 @@ int i18n_udate_parse_calendar (const i18n_udate_format_h format, i18n_ucalendar_ return i18n_error; } -i18n_ubool i18n_udate_is_lenient ( const i18n_udate_format_h format ) +i18n_ubool i18n_udate_is_lenient(const i18n_udate_format_h format) { - if (format == NULL) - { + if (format == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } @@ -139,83 +143,79 @@ i18n_ubool i18n_udate_is_lenient ( const i18n_udate_format_h format ) return udat_isLenient((const UDateFormat *)format); } -int i18n_udate_set_lenient ( i18n_udate_format_h format, i18n_ubool is_lenient ) +int i18n_udate_set_lenient(i18n_udate_format_h format, i18n_ubool is_lenient) { if (format == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } - udat_setLenient((UDateFormat *)format, is_lenient); + + udat_setLenient((UDateFormat *) format, is_lenient); return I18N_ERROR_NONE; } -int i18n_udate_get_calendar ( const i18n_udate_format_h format, i18n_ucalendar_h *calendar) +int i18n_udate_get_calendar(const i18n_udate_format_h format, i18n_ucalendar_h *calendar) { if (format == NULL || calendar == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } - *calendar = (i18n_ucalendar_h)udat_getCalendar((const UDateFormat *)format); + + *calendar = (i18n_ucalendar_h) udat_getCalendar((const UDateFormat *)format); return I18N_ERROR_NONE; } -int i18n_udate_set_calendar ( i18n_udate_format_h format, const i18n_ucalendar_h calendar_to_set ) +int i18n_udate_set_calendar(i18n_udate_format_h format, const i18n_ucalendar_h calendar_to_set) { if (format == NULL || calendar_to_set == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } - udat_setCalendar((UDateFormat *)format, (const UCalendar *)calendar_to_set); + + udat_setCalendar((UDateFormat *) format, (const UCalendar *)calendar_to_set); return I18N_ERROR_NONE; } -int i18n_udate_get_number_format ( const i18n_udate_format_h format, i18n_unumber_format_h *number_format ) +int i18n_udate_get_number_format(const i18n_udate_format_h format, + i18n_unumber_format_h *number_format) { if (format == NULL || number_format == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } + set_last_result(I18N_ERROR_NONE); - *number_format = (i18n_unumber_format_h)udat_getNumberFormat((const UDateFormat *)format); + *number_format = (i18n_unumber_format_h) udat_getNumberFormat((const UDateFormat *)format); return I18N_ERROR_NONE; } -int i18n_udate_set_number_format ( i18n_udate_format_h format, const i18n_unumber_format_h number_format_to_set ) +int i18n_udate_set_number_format(i18n_udate_format_h format, + const i18n_unumber_format_h number_format_to_set) { if (format == NULL || number_format_to_set == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } - udat_setNumberFormat((UDateFormat *)format, (const UNumberFormat *)number_format_to_set); + + udat_setNumberFormat((UDateFormat *) format, (const UNumberFormat *)number_format_to_set); return I18N_ERROR_NONE; } -const char *i18n_udate_get_available ( int32_t locale_index ) +const char *i18n_udate_get_available(int32_t locale_index) { - if(locale_index < 0) { + if (locale_index < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } + set_last_result(I18N_ERROR_NONE); return udat_getAvailable(locale_index); } -int32_t i18n_udate_count_available ( void ) +int32_t i18n_udate_count_available(void) { set_last_result(I18N_ERROR_NONE); return udat_countAvailable(); } -int i18n_udate_get_2digit_year_start ( const i18n_udate_format_h format, i18n_udate *year ) +int i18n_udate_get_2digit_year_start(const i18n_udate_format_h format, i18n_udate *year) { if (format == NULL || year == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - *year = (i18n_udate)udat_get2DigitYearStart((const UDateFormat *)format, &icu_error); + *year = (i18n_udate) udat_get2DigitYearStart((const UDateFormat *)format, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -224,15 +224,13 @@ int i18n_udate_get_2digit_year_start ( const i18n_udate_format_h format, i18n_ud return i18n_error; } -int i18n_udate_set_2digit_year_start ( i18n_udate_format_h format, i18n_udate date ) +int i18n_udate_set_2digit_year_start(i18n_udate_format_h format, i18n_udate date) { if (format == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - udat_set2DigitYearStart((UDateFormat *)format, date, &icu_error); + udat_set2DigitYearStart((UDateFormat *) format, date, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -241,16 +239,17 @@ int i18n_udate_set_2digit_year_start ( i18n_udate_format_h format, i18n_udate da return i18n_error; } -int32_t i18n_udate_to_pattern ( const i18n_udate_format_h format, i18n_ubool localized, i18n_uchar *result, int32_t result_length ) +int32_t i18n_udate_to_pattern(const i18n_udate_format_h format, i18n_ubool localized, + i18n_uchar *result, int32_t result_length) { - if (format == NULL) - { + if (format == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = udat_toPattern((const UDateFormat *)format, localized, result, result_length, &icu_error); + int32_t needed_buffer_size = + udat_toPattern((const UDateFormat *)format, localized, result, result_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -260,26 +259,30 @@ int32_t i18n_udate_to_pattern ( const i18n_udate_format_h format, i18n_ubool loc return needed_buffer_size; } -int i18n_udate_apply_pattern ( i18n_udate_format_h format, i18n_ubool localized, const i18n_uchar *pattern, int32_t pattern_length ) +int i18n_udate_apply_pattern(i18n_udate_format_h format, i18n_ubool localized, + const i18n_uchar *pattern, int32_t pattern_length) { if (format == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } - udat_applyPattern((UDateFormat *)format, localized, pattern, pattern_length); + + udat_applyPattern((UDateFormat *) format, localized, pattern, pattern_length); return I18N_ERROR_NONE; } -int32_t i18n_udate_get_symbols ( const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, i18n_uchar *result, int32_t result_length ) +int32_t i18n_udate_get_symbols(const i18n_udate_format_h format, + i18n_udate_format_symbol_type_e type, int32_t symbol_index, + i18n_uchar *result, int32_t result_length) { - if (format == NULL || type < I18N_UDATE_FORMAT_SYMBOL_TYPE_ERAS || type > I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_SHORTER_WEEKDAYS || symbol_index < 0) - { + if (format == NULL || type < I18N_UDATE_FORMAT_SYMBOL_TYPE_ERAS + || type > I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_SHORTER_WEEKDAYS || symbol_index < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = udat_getSymbols((const UDateFormat *)format, type, symbol_index, result, result_length, &icu_error); + int32_t needed_buffer_size = + udat_getSymbols((const UDateFormat *)format, type, symbol_index, result, result_length, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -289,10 +292,10 @@ int32_t i18n_udate_get_symbols ( const i18n_udate_format_h format, i18n_udate_fo return needed_buffer_size; } -int32_t i18n_udate_count_symbols ( const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type ) +int32_t i18n_udate_count_symbols(const i18n_udate_format_h format, + i18n_udate_format_symbol_type_e type) { - if (format == NULL) - { + if (format == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -301,15 +304,14 @@ int32_t i18n_udate_count_symbols ( const i18n_udate_format_h format, i18n_udate_ return udat_countSymbols((const UDateFormat *)format, type); } -int i18n_udate_set_symbols ( i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, i18n_uchar *value, int32_t value_length ) +int i18n_udate_set_symbols(i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, + int32_t symbol_index, i18n_uchar *value, int32_t value_length) { if (format == NULL || symbol_index < 0 || value_length < -1) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - udat_setSymbols((UDateFormat *)format, type, symbol_index, value, value_length, &icu_error); + udat_setSymbols((UDateFormat *) format, type, symbol_index, value, value_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -318,10 +320,10 @@ int i18n_udate_set_symbols ( i18n_udate_format_h format, i18n_udate_format_symbo return i18n_error; } -const char *i18n_udate_get_locale_by_type ( const i18n_udate_format_h format, i18n_ulocale_data_locale_type_e type ) +const char *i18n_udate_get_locale_by_type(const i18n_udate_format_h format, + i18n_ulocale_data_locale_type_e type) { - if (format == NULL) - { + if (format == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -337,15 +339,13 @@ const char *i18n_udate_get_locale_by_type ( const i18n_udate_format_h format, i1 return locale_name; } -int i18n_udate_set_context ( i18n_udate_format_h format, i18n_udisplay_context_e value ) +int i18n_udate_set_context(i18n_udate_format_h format, i18n_udisplay_context_e value) { if (format == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - udat_setContext((UDateFormat *)format, value, &icu_error); + udat_setContext((UDateFormat *) format, value, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); diff --git a/src/utils_i18n_udatepg.c b/src/utils_i18n_udatepg.c index 15952f9..8078f22 100755 --- a/src/utils_i18n_udatepg.c +++ b/src/utils_i18n_udatepg.c @@ -18,7 +18,7 @@ #include #include -int i18n_udatepg_create ( const char *locale, i18n_udatepg_h *dtpg ) +int i18n_udatepg_create(const char *locale, i18n_udatepg_h *dtpg) { retv_if(dtpg == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -28,7 +28,7 @@ int i18n_udatepg_create ( const char *locale, i18n_udatepg_h *dtpg ) return _i18n_error_mapping(icu_error); } -int i18n_udatepg_destroy ( i18n_udatepg_h dtpg ) +int i18n_udatepg_destroy(i18n_udatepg_h dtpg) { retv_if(dtpg == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -37,7 +37,9 @@ int i18n_udatepg_destroy ( i18n_udatepg_h dtpg ) return I18N_ERROR_NONE; } -int i18n_udatepg_get_best_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t len, i18n_uchar *best_pattern, int32_t capacity, int32_t *best_pattern_len ) +int i18n_udatepg_get_best_pattern(i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t len, + i18n_uchar *best_pattern, int32_t capacity, + int32_t *best_pattern_len) { retv_if(dtpg == NULL, I18N_ERROR_INVALID_PARAMETER); retv_if(skeleton == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -45,21 +47,21 @@ int i18n_udatepg_get_best_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *skele retv_if(capacity < 0, I18N_ERROR_INVALID_PARAMETER); UErrorCode icu_error = U_ZERO_ERROR; - *best_pattern_len = udatpg_getBestPattern(dtpg, skeleton, len, best_pattern, capacity, &icu_error); + *best_pattern_len = + udatpg_getBestPattern(dtpg, skeleton, len, best_pattern, capacity, &icu_error); return _i18n_error_mapping(icu_error); } // Newly Added APIs -int i18n_udatepg_create_empty (i18n_udatepg_h *dtpg) +int i18n_udatepg_create_empty(i18n_udatepg_h *dtpg) { if (dtpg == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } + UErrorCode icu_error = U_ZERO_ERROR; - *dtpg = (i18n_udatepg_h)udatpg_openEmpty(&icu_error); + *dtpg = (i18n_udatepg_h) udatpg_openEmpty(&icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -68,15 +70,13 @@ int i18n_udatepg_create_empty (i18n_udatepg_h *dtpg) return i18n_error; } -int i18n_udatepg_clone ( const i18n_udatepg_h dtpg, i18n_udatepg_h *dtpg_clone ) +int i18n_udatepg_clone(const i18n_udatepg_h dtpg, i18n_udatepg_h *dtpg_clone) { if (dtpg == NULL || NULL == dtpg_clone) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - *dtpg_clone = (i18n_udatepg_h)udatpg_clone((UDateTimePatternGenerator *)dtpg, &icu_error); + *dtpg_clone = (i18n_udatepg_h) udatpg_clone((UDateTimePatternGenerator *) dtpg, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -84,17 +84,21 @@ int i18n_udatepg_clone ( const i18n_udatepg_h dtpg, i18n_udatepg_h *dtpg_clone ) return i18n_error; } -int32_t i18n_udatepg_get_best_pattern_with_options ( i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t length, - i18n_udatepg_date_time_pattern_match_options_e options, i18n_uchar *best_pattern, int32_t capacity ) +int32_t i18n_udatepg_get_best_pattern_with_options(i18n_udatepg_h dtpg, const i18n_uchar *skeleton, + int32_t length, + i18n_udatepg_date_time_pattern_match_options_e + options, i18n_uchar *best_pattern, + int32_t capacity) { - if (dtpg == NULL || skeleton == NULL || length < 0 || capacity < 0) - { + if (dtpg == NULL || skeleton == NULL || length < 0 || capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t length_of_best_pattern = udatpg_getBestPatternWithOptions((UDateTimePatternGenerator *)dtpg, skeleton, length, options, best_pattern, capacity, &icu_error); + int32_t length_of_best_pattern = + udatpg_getBestPatternWithOptions((UDateTimePatternGenerator *) dtpg, skeleton, length, + options, best_pattern, capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -103,17 +107,18 @@ int32_t i18n_udatepg_get_best_pattern_with_options ( i18n_udatepg_h dtpg, const return length_of_best_pattern; } -int32_t i18n_udatepg_get_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, - i18n_uchar *skeleton, int32_t capacity ) +int32_t i18n_udatepg_get_skeleton(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, + i18n_uchar *skeleton, int32_t capacity) { - if (dtpg == NULL || pattern == NULL || length < 0 || capacity < 0) - { + if (dtpg == NULL || pattern == NULL || length < 0 || capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t length_of_skeleton = udatpg_getSkeleton((UDateTimePatternGenerator *)dtpg, pattern, length, skeleton, capacity, &icu_error); + int32_t length_of_skeleton = + udatpg_getSkeleton((UDateTimePatternGenerator *) dtpg, pattern, length, skeleton, capacity, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -122,17 +127,18 @@ int32_t i18n_udatepg_get_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar *patte return length_of_skeleton; } -int32_t i18n_udatepg_get_base_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, - i18n_uchar *base_skeleton, int32_t capacity ) +int32_t i18n_udatepg_get_base_skeleton(i18n_udatepg_h dtpg, const i18n_uchar *pattern, + int32_t length, i18n_uchar *base_skeleton, int32_t capacity) { - if (dtpg == NULL || pattern == NULL || length < -1 || capacity < 0) - { + if (dtpg == NULL || pattern == NULL || length < -1 || capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t length_of_skeleton = udatpg_getBaseSkeleton((UDateTimePatternGenerator *)dtpg, pattern, length, base_skeleton, capacity, &icu_error); + int32_t length_of_skeleton = + udatpg_getBaseSkeleton((UDateTimePatternGenerator *) dtpg, pattern, length, base_skeleton, + capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -141,17 +147,21 @@ int32_t i18n_udatepg_get_base_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar * return length_of_skeleton; } -int32_t i18n_udatepg_add_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, - i18n_ubool override, i18n_uchar *conflicting_pattern, int32_t capacity, i18n_udatepg_date_time_pattern_conflict_e *conflict_status ) +int32_t i18n_udatepg_add_pattern(i18n_udatepg_h dtpg, const i18n_uchar *pattern, + int32_t pattern_length, i18n_ubool override, + i18n_uchar *conflicting_pattern, int32_t capacity, + i18n_udatepg_date_time_pattern_conflict_e *conflict_status) { - if (dtpg == NULL || pattern == NULL || pattern_length < 0 || capacity < 0) - { + if (dtpg == NULL || pattern == NULL || pattern_length < 0 || capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } + int32_t confliction_pattern_length; UErrorCode icu_error = U_ZERO_ERROR; - *conflict_status = udatpg_addPattern((UDateTimePatternGenerator *)dtpg, pattern, pattern_length, override, conflicting_pattern, capacity, &confliction_pattern_length, &icu_error); + *conflict_status = + udatpg_addPattern((UDateTimePatternGenerator *) dtpg, pattern, pattern_length, override, + conflicting_pattern, capacity, &confliction_pattern_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -160,117 +170,113 @@ int32_t i18n_udatepg_add_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *patter return confliction_pattern_length; } -int i18n_udatepg_set_append_item_format ( i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, - const i18n_uchar *value, int32_t length ) +int i18n_udatepg_set_append_item_format(i18n_udatepg_h dtpg, + i18n_udatepg_date_time_pattern_field_e field, + const i18n_uchar *value, int32_t length) { if (dtpg == NULL || field < I18N_UDATEPG_ERA_FIELD || field >= I18N_UDATEPG_FIELD_COUNT || value == NULL || length < 0) - { return I18N_ERROR_INVALID_PARAMETER; - } - udatpg_setAppendItemFormat((UDateTimePatternGenerator *)dtpg, field, value, length); + udatpg_setAppendItemFormat((UDateTimePatternGenerator *) dtpg, field, value, length); return I18N_ERROR_NONE; } -const i18n_uchar *i18n_udatepg_get_append_item_format ( const i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, - int32_t *pattern_length ) +const i18n_uchar *i18n_udatepg_get_append_item_format(const i18n_udatepg_h dtpg, + i18n_udatepg_date_time_pattern_field_e field, + int32_t *pattern_length) { - if (dtpg == NULL || field < I18N_UDATEPG_ERA_FIELD || field >= I18N_UDATEPG_FIELD_COUNT) - { + if (dtpg == NULL || field < I18N_UDATEPG_ERA_FIELD || field >= I18N_UDATEPG_FIELD_COUNT) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return udatpg_getAppendItemFormat((UDateTimePatternGenerator *)dtpg, field, pattern_length); + return udatpg_getAppendItemFormat((UDateTimePatternGenerator *) dtpg, field, pattern_length); } -int i18n_udatepg_set_append_item_name ( i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, - const i18n_uchar *value, int32_t length ) +int i18n_udatepg_set_append_item_name(i18n_udatepg_h dtpg, + i18n_udatepg_date_time_pattern_field_e field, + const i18n_uchar *value, int32_t length) { if (dtpg == NULL || field < I18N_UDATEPG_ERA_FIELD || field >= I18N_UDATEPG_FIELD_COUNT || value == NULL || length < 0) - { return I18N_ERROR_INVALID_PARAMETER; - } - udatpg_setAppendItemName((UDateTimePatternGenerator *)dtpg, field, value, length); + udatpg_setAppendItemName((UDateTimePatternGenerator *) dtpg, field, value, length); return I18N_ERROR_NONE; } -const i18n_uchar *i18n_udatepg_get_append_item_name ( const i18n_udatepg_h dtpg, - i18n_udatepg_date_time_pattern_field_e field, int32_t *pattern_length ) +const i18n_uchar *i18n_udatepg_get_append_item_name(const i18n_udatepg_h dtpg, + i18n_udatepg_date_time_pattern_field_e field, + int32_t *pattern_length) { - if (dtpg == NULL || field < I18N_UDATEPG_ERA_FIELD || field >= I18N_UDATEPG_FIELD_COUNT) - { + if (dtpg == NULL || field < I18N_UDATEPG_ERA_FIELD || field >= I18N_UDATEPG_FIELD_COUNT) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return udatpg_getAppendItemName((UDateTimePatternGenerator *)dtpg, field, pattern_length); + return udatpg_getAppendItemName((UDateTimePatternGenerator *) dtpg, field, pattern_length); } -int i18n_udatepg_set_date_time_format ( const i18n_udatepg_h dtpg, const i18n_uchar *date_time_format, int32_t length ) +int i18n_udatepg_set_date_time_format(const i18n_udatepg_h dtpg, + const i18n_uchar *date_time_format, int32_t length) { if (dtpg == NULL || date_time_format == NULL || length < 0) - { return I18N_ERROR_INVALID_PARAMETER; - } - udatpg_setDateTimeFormat((UDateTimePatternGenerator *)dtpg, date_time_format, length); + udatpg_setDateTimeFormat((UDateTimePatternGenerator *) dtpg, date_time_format, length); return I18N_ERROR_NONE; } -const i18n_uchar *i18n_udatepg_get_date_time_format ( const i18n_udatepg_h dtpg, int32_t *pattern_length ) +const i18n_uchar *i18n_udatepg_get_date_time_format(const i18n_udatepg_h dtpg, + int32_t *pattern_length) { - if (dtpg == NULL) - { + if (dtpg == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return udatpg_getDateTimeFormat((UDateTimePatternGenerator *)dtpg, pattern_length); + return udatpg_getDateTimeFormat((UDateTimePatternGenerator *) dtpg, pattern_length); } -int i18n_udatepg_set_decimal ( i18n_udatepg_h dtpg, const i18n_uchar *decimal, int32_t length ) +int i18n_udatepg_set_decimal(i18n_udatepg_h dtpg, const i18n_uchar *decimal, int32_t length) { if (dtpg == NULL || decimal == NULL || length < 0) - { return I18N_ERROR_INVALID_PARAMETER; - } - udatpg_setDecimal((UDateTimePatternGenerator *)dtpg, decimal, length); + udatpg_setDecimal((UDateTimePatternGenerator *) dtpg, decimal, length); return I18N_ERROR_NONE; } -const i18n_uchar *i18n_udatepg_get_decimal ( const i18n_udatepg_h dtpg, int32_t *pattern_length ) +const i18n_uchar *i18n_udatepg_get_decimal(const i18n_udatepg_h dtpg, int32_t *pattern_length) { - if (dtpg == NULL) - { + if (dtpg == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return udatpg_getDecimal((UDateTimePatternGenerator *)dtpg, pattern_length); + return udatpg_getDecimal((UDateTimePatternGenerator *) dtpg, pattern_length); } -int32_t i18n_udatepg_replace_field_types ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, - const i18n_uchar *skeleton, int32_t skeleton_length, i18n_uchar *dest, - int32_t dest_capacity ) +int32_t i18n_udatepg_replace_field_types(i18n_udatepg_h dtpg, const i18n_uchar *pattern, + int32_t pattern_length, const i18n_uchar *skeleton, + int32_t skeleton_length, i18n_uchar *dest, + int32_t dest_capacity) { if (dtpg == NULL || pattern == NULL || pattern_length < 0 || skeleton == NULL - || skeleton_length < 0 || dest_capacity < 0) - { + || skeleton_length < 0 || dest_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t length_of_dest = udatpg_replaceFieldTypes((UDateTimePatternGenerator *)dtpg, pattern, pattern_length, skeleton, skeleton_length, dest, dest_capacity, &icu_error); + int32_t length_of_dest = + udatpg_replaceFieldTypes((UDateTimePatternGenerator *) dtpg, pattern, pattern_length, + skeleton, skeleton_length, dest, dest_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -279,19 +285,26 @@ int32_t i18n_udatepg_replace_field_types ( i18n_udatepg_h dtpg, const i18n_uchar return length_of_dest; } -int32_t i18n_udatepg_replace_field_types_with_options ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, - const i18n_uchar *skeleton, int32_t skeleton_length, i18n_udatepg_date_time_pattern_match_options_e options, - i18n_uchar *dest, int32_t dest_capacity ) +int32_t i18n_udatepg_replace_field_types_with_options(i18n_udatepg_h dtpg, + const i18n_uchar *pattern, + int32_t pattern_length, + const i18n_uchar *skeleton, + int32_t skeleton_length, + i18n_udatepg_date_time_pattern_match_options_e + options, i18n_uchar *dest, + int32_t dest_capacity) { if (dtpg == NULL || pattern == NULL || pattern_length < 0 || skeleton == NULL - || skeleton_length < 0 || dest_capacity < 0) - { + || skeleton_length < 0 || dest_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t length_of_dest = udatpg_replaceFieldTypesWithOptions((UDateTimePatternGenerator *)dtpg, pattern, pattern_length, skeleton, skeleton_length, options, dest, dest_capacity, &icu_error); + int32_t length_of_dest = + udatpg_replaceFieldTypesWithOptions((UDateTimePatternGenerator *) dtpg, pattern, + pattern_length, skeleton, skeleton_length, options, + dest, dest_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -300,12 +313,10 @@ int32_t i18n_udatepg_replace_field_types_with_options ( i18n_udatepg_h dtpg, con return length_of_dest; } -int i18n_udatepg_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration ) +int i18n_udatepg_skeletons_create(const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration) { if (dtpg == NULL || NULL == enumeration) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; *enumeration = udatpg_openSkeletons((const UDateTimePatternGenerator *)dtpg, &icu_error); @@ -316,12 +327,10 @@ int i18n_udatepg_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumeration return i18n_error; } -int i18n_udatepg_base_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration ) +int i18n_udatepg_base_skeletons_create(const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration) { if (dtpg == NULL || NULL == enumeration) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; *enumeration = udatpg_openBaseSkeletons((const UDateTimePatternGenerator *)dtpg, &icu_error); @@ -332,15 +341,17 @@ int i18n_udatepg_base_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumer return i18n_error; } -const i18n_uchar *i18n_udatepg_get_pattern_for_skeleton ( const i18n_udatepg_h dtpg, const i18n_uchar *skeleton, - int32_t skeleton_length, int32_t *pattern_length ) +const i18n_uchar *i18n_udatepg_get_pattern_for_skeleton(const i18n_udatepg_h dtpg, + const i18n_uchar *skeleton, + int32_t skeleton_length, + int32_t *pattern_length) { - if (dtpg == NULL || skeleton == NULL || skeleton_length < 0) - { + if (dtpg == NULL || skeleton == NULL || skeleton_length < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return udatpg_getPatternForSkeleton((const UDateTimePatternGenerator *)dtpg, skeleton, skeleton_length, pattern_length); + return udatpg_getPatternForSkeleton((const UDateTimePatternGenerator *)dtpg, skeleton, + skeleton_length, pattern_length); } diff --git a/src/utils_i18n_uenumeration.c b/src/utils_i18n_uenumeration.c index 2c74487..8f9e982 100755 --- a/src/utils_i18n_uenumeration.c +++ b/src/utils_i18n_uenumeration.c @@ -18,27 +18,24 @@ #include #include -int i18n_uenumeration_destroy ( i18n_uenumeration_h enumeration ) +int i18n_uenumeration_destroy(i18n_uenumeration_h enumeration) { if (enumeration == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } - uenum_close((UEnumeration *)enumeration); + uenum_close((UEnumeration *) enumeration); return I18N_ERROR_NONE; } -int32_t i18n_uenumeration_count ( i18n_uenumeration_h enumeration ) +int32_t i18n_uenumeration_count(i18n_uenumeration_h enumeration) { - if (enumeration == NULL) - { + if (enumeration == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t number_of_elements = uenum_count((UEnumeration *)enumeration, &icu_error); + int32_t number_of_elements = uenum_count((UEnumeration *) enumeration, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -47,16 +44,15 @@ int32_t i18n_uenumeration_count ( i18n_uenumeration_h enumeration ) return number_of_elements; } -const i18n_uchar *i18n_uenumeration_unext ( i18n_uenumeration_h enumeration, int32_t *result_length ) +const i18n_uchar *i18n_uenumeration_unext(i18n_uenumeration_h enumeration, int32_t *result_length) { - if (enumeration == NULL) - { + if (enumeration == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } UErrorCode icu_error = U_ZERO_ERROR; - const UChar *ustring = uenum_unext((UEnumeration *)enumeration, result_length, &icu_error); + const UChar *ustring = uenum_unext((UEnumeration *) enumeration, result_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -65,16 +61,15 @@ const i18n_uchar *i18n_uenumeration_unext ( i18n_uenumeration_h enumeration, int return ustring; } -const char *i18n_uenumeration_next ( i18n_uenumeration_h enumeration, int32_t *result_length ) +const char *i18n_uenumeration_next(i18n_uenumeration_h enumeration, int32_t *result_length) { - if (enumeration == NULL) - { + if (enumeration == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } UErrorCode icu_error = U_ZERO_ERROR; - const char *string = uenum_next((UEnumeration *)enumeration, result_length, &icu_error); + const char *string = uenum_next((UEnumeration *) enumeration, result_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -83,15 +78,13 @@ const char *i18n_uenumeration_next ( i18n_uenumeration_h enumeration, int32_t *r return string; } -int i18n_uenumeration_reset ( i18n_uenumeration_h enumeration ) +int i18n_uenumeration_reset(i18n_uenumeration_h enumeration) { if (enumeration == NULL) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - uenum_reset((UEnumeration *)enumeration, &icu_error); + uenum_reset((UEnumeration *) enumeration, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -99,12 +92,12 @@ int i18n_uenumeration_reset ( i18n_uenumeration_h enumeration ) return i18n_error; } -int i18n_uenumeration_uchar_strings_enumeration_create ( const i18n_uchar *const strings[], int32_t count, i18n_uenumeration_h *enumeration ) +int i18n_uenumeration_uchar_strings_enumeration_create(const i18n_uchar *const strings[], + int32_t count, + i18n_uenumeration_h *enumeration) { if (count < 0 || NULL == enumeration) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; *enumeration = uenum_openUCharStringsEnumeration(strings, count, &icu_error); @@ -115,15 +108,15 @@ int i18n_uenumeration_uchar_strings_enumeration_create ( const i18n_uchar *const return i18n_error; } -int i18n_uenumeration_char_strings_enumeration_create ( const char *const strings[], int32_t count, i18n_uenumeration_h *enumeration ) +int i18n_uenumeration_char_strings_enumeration_create(const char *const strings[], int32_t count, + i18n_uenumeration_h *enumeration) { if (count < 0 || NULL == enumeration) - { return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - *enumeration = (i18n_uenumeration_h)uenum_openCharStringsEnumeration(strings, count, &icu_error); + *enumeration = + (i18n_uenumeration_h) uenum_openCharStringsEnumeration(strings, count, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); diff --git a/src/utils_i18n_ulocale.c b/src/utils_i18n_ulocale.c index e6339e8..8570cc1 100755 --- a/src/utils_i18n_ulocale.c +++ b/src/utils_i18n_ulocale.c @@ -18,16 +18,16 @@ #include #include -int i18n_ulocale_get_default (const char **locale) +int i18n_ulocale_get_default(const char **locale) { - retv_if (locale == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(locale == NULL, I18N_ERROR_INVALID_PARAMETER); *locale = uloc_getDefault(); return I18N_ERROR_NONE; } -int i18n_ulocale_set_default (const char *locale_id) +int i18n_ulocale_set_default(const char *locale_id) { UErrorCode icu_error = U_ZERO_ERROR; uloc_setDefault(locale_id, &icu_error); @@ -35,7 +35,8 @@ int i18n_ulocale_set_default (const char *locale_id) return _i18n_error_mapping(icu_error); } -int i18n_ulocale_get_language (const char *locale_id, char *language, int32_t language_capacity, int32_t *buf_size_language) +int i18n_ulocale_get_language(const char *locale_id, char *language, int32_t language_capacity, + int32_t *buf_size_language) { retv_if(buf_size_language == NULL || language == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -45,45 +46,50 @@ int i18n_ulocale_get_language (const char *locale_id, char *language, int32_t la return _i18n_error_mapping(icu_error); } -int32_t i18n_ulocale_get_country (const char *locale_id, char *country, int32_t country_capacity, int *error) +int32_t i18n_ulocale_get_country(const char *locale_id, char *country, int32_t country_capacity, + int *error) { - if(NULL == country || country_capacity < 0) { - if(NULL != error) { + if (NULL == country || country_capacity < 0) { + if (NULL != error) *error = I18N_ERROR_INVALID_PARAMETER; - } + return 0; } UErrorCode icu_error = U_ZERO_ERROR; int32_t result = uloc_getCountry(locale_id, country, country_capacity, &icu_error); - if(NULL != error) { + + if (NULL != error) *error = _i18n_error_mapping(icu_error); - } return result; } -int i18n_ulocale_get_display_name (const char *locale_id, const char *in_locale_id, i18n_uchar *result_w, int32_t max_result_size, int32_t *buf_size_display_name) +int i18n_ulocale_get_display_name(const char *locale_id, const char *in_locale_id, + i18n_uchar *result_w, int32_t max_result_size, + int32_t *buf_size_display_name) { retv_if(buf_size_display_name == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode icu_error = U_ZERO_ERROR; - *buf_size_display_name = uloc_getDisplayName(locale_id, in_locale_id, result_w, max_result_size, &icu_error); + *buf_size_display_name = + uloc_getDisplayName(locale_id, in_locale_id, result_w, max_result_size, &icu_error); return _i18n_error_mapping(icu_error); } -const char* i18n_ulocale_get_available (int32_t n) +const char *i18n_ulocale_get_available(int32_t n) { - if(n < 0){ + if (n < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } + set_last_result(I18N_ERROR_NONE); return uloc_getAvailable(n); } -int32_t i18n_ulocale_count_available (void) +int32_t i18n_ulocale_count_available(void) { set_last_result(I18N_ERROR_NONE); return uloc_countAvailable(); @@ -91,9 +97,9 @@ int32_t i18n_ulocale_count_available (void) // Newly Added APIs -int32_t i18n_ulocale_get_script (const char *locale_id, char *script, int32_t script_capacity) +int32_t i18n_ulocale_get_script(const char *locale_id, char *script, int32_t script_capacity) { - if(NULL == script || script_capacity < 0){ + if (NULL == script || script_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } @@ -108,9 +114,9 @@ int32_t i18n_ulocale_get_script (const char *locale_id, char *script, int32_t sc return needed_buffer_size; } -int32_t i18n_ulocale_get_variant (const char *locale_id, char *variant, int32_t variant_capacity) +int32_t i18n_ulocale_get_variant(const char *locale_id, char *variant, int32_t variant_capacity) { - if(NULL == variant || variant_capacity < 0){ + if (NULL == variant || variant_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } @@ -125,7 +131,7 @@ int32_t i18n_ulocale_get_variant (const char *locale_id, char *variant, int32_t return needed_buffer_size; } -int32_t i18n_ulocale_get_name (const char *locale_id, char *name, int32_t name_capacity) +int32_t i18n_ulocale_get_name(const char *locale_id, char *name, int32_t name_capacity) { UErrorCode icu_error = U_ZERO_ERROR; int32_t needed_buffer_size = uloc_getName(locale_id, name, name_capacity, &icu_error); @@ -137,7 +143,7 @@ int32_t i18n_ulocale_get_name (const char *locale_id, char *name, int32_t name_c return needed_buffer_size; } -int32_t i18n_ulocale_canonicalize (const char *locale_id, char *name, int32_t name_capacity) +int32_t i18n_ulocale_canonicalize(const char *locale_id, char *name, int32_t name_capacity) { UErrorCode icu_error = U_ZERO_ERROR; int32_t needed_buffer_size = uloc_canonicalize(locale_id, name, name_capacity, &icu_error); @@ -149,29 +155,30 @@ int32_t i18n_ulocale_canonicalize (const char *locale_id, char *name, int32_t na return needed_buffer_size; } -const char *i18n_ulocale_get_iso3_language (const char *locale_id) +const char *i18n_ulocale_get_iso3_language(const char *locale_id) { set_last_result(I18N_ERROR_NONE); return uloc_getISO3Language(locale_id); } -const char *i18n_ulocale_get_iso3_country (const char *locale_id) +const char *i18n_ulocale_get_iso3_country(const char *locale_id) { set_last_result(I18N_ERROR_NONE); return uloc_getISO3Country(locale_id); } -uint32_t i18n_ulocale_get_lcid (const char *locale_id) +uint32_t i18n_ulocale_get_lcid(const char *locale_id) { set_last_result(I18N_ERROR_NONE); return uloc_getLCID(locale_id); } -int32_t i18n_ulocale_get_display_language (const char *locale, const char *display_locale, i18n_uchar *language, - int32_t language_capacity) +int32_t i18n_ulocale_get_display_language(const char *locale, const char *display_locale, + i18n_uchar *language, int32_t language_capacity) { UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_getDisplayLanguage(locale, display_locale, language, language_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_getDisplayLanguage(locale, display_locale, language, language_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -180,11 +187,12 @@ int32_t i18n_ulocale_get_display_language (const char *locale, const char *displ return needed_buffer_size; } -int32_t i18n_ulocale_get_display_script (const char *locale, const char *display_locale, i18n_uchar *script, - int32_t script_capacity) +int32_t i18n_ulocale_get_display_script(const char *locale, const char *display_locale, + i18n_uchar *script, int32_t script_capacity) { UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_getDisplayScript(locale, display_locale, script, script_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_getDisplayScript(locale, display_locale, script, script_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -193,11 +201,12 @@ int32_t i18n_ulocale_get_display_script (const char *locale, const char *display return needed_buffer_size; } -int32_t i18n_ulocale_get_display_country (const char *locale, const char *display_locale, i18n_uchar *country, - int32_t country_capacity) +int32_t i18n_ulocale_get_display_country(const char *locale, const char *display_locale, + i18n_uchar *country, int32_t country_capacity) { UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_getDisplayCountry(locale, display_locale, country, country_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_getDisplayCountry(locale, display_locale, country, country_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -206,11 +215,12 @@ int32_t i18n_ulocale_get_display_country (const char *locale, const char *displa return needed_buffer_size; } -int32_t i18n_ulocale_get_display_variant (const char *locale, const char *display_locale, i18n_uchar *variant, - int32_t variant_capacity) +int32_t i18n_ulocale_get_display_variant(const char *locale, const char *display_locale, + i18n_uchar *variant, int32_t variant_capacity) { UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_getDisplayVariant(locale, display_locale, variant, variant_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_getDisplayVariant(locale, display_locale, variant, variant_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -219,11 +229,12 @@ int32_t i18n_ulocale_get_display_variant (const char *locale, const char *displa return needed_buffer_size; } -int32_t i18n_ulocale_get_display_keyword (const char *keyword, const char *display_locale, i18n_uchar *dest, - int32_t dest_capacity) +int32_t i18n_ulocale_get_display_keyword(const char *keyword, const char *display_locale, + i18n_uchar *dest, int32_t dest_capacity) { UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_getDisplayKeyword(keyword, display_locale, dest, dest_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_getDisplayKeyword(keyword, display_locale, dest, dest_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -232,11 +243,14 @@ int32_t i18n_ulocale_get_display_keyword (const char *keyword, const char *displ return needed_buffer_size; } -int32_t i18n_ulocale_get_display_keyword_value (const char *locale, const char *keyword, const char *display_locale, - i18n_uchar *dest, int32_t dest_capacity) +int32_t i18n_ulocale_get_display_keyword_value(const char *locale, const char *keyword, + const char *display_locale, i18n_uchar *dest, + int32_t dest_capacity) { UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_getDisplayKeywordValue(locale, keyword, display_locale, dest, dest_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_getDisplayKeywordValue(locale, keyword, display_locale, dest, dest_capacity, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -245,21 +259,21 @@ int32_t i18n_ulocale_get_display_keyword_value (const char *locale, const char * return needed_buffer_size; } -const char * const *i18n_ulocale_get_iso_languages (void) +const char *const *i18n_ulocale_get_iso_languages(void) { set_last_result(I18N_ERROR_NONE); return uloc_getISOLanguages(); } -const char * const *i18n_ulocale_get_iso_countries (void) +const char *const *i18n_ulocale_get_iso_countries(void) { set_last_result(I18N_ERROR_NONE); return uloc_getISOCountries(); } -int32_t i18n_ulocale_get_parent (const char *locale_id, char *parent, int32_t parent_capacity) +int32_t i18n_ulocale_get_parent(const char *locale_id, char *parent, int32_t parent_capacity) { - if(NULL == parent || parent_capacity < 0){ + if (NULL == parent || parent_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } @@ -274,7 +288,7 @@ int32_t i18n_ulocale_get_parent (const char *locale_id, char *parent, int32_t pa return len_of_loc; } -int32_t i18n_ulocale_get_base_name (const char *locale_id, char *name, int32_t name_capacity) +int32_t i18n_ulocale_get_base_name(const char *locale_id, char *name, int32_t name_capacity) { UErrorCode icu_error = U_ZERO_ERROR; int32_t needed_buffer_size = uloc_getBaseName(locale_id, name, name_capacity, &icu_error); @@ -286,29 +300,30 @@ int32_t i18n_ulocale_get_base_name (const char *locale_id, char *name, int32_t n return needed_buffer_size; } -int i18n_ulocale_keywords_create (const char *locale_id, i18n_uenumeration_h *enumeration ) +int i18n_ulocale_keywords_create(const char *locale_id, i18n_uenumeration_h *enumeration) { - if (NULL == enumeration){ + if (NULL == enumeration) return I18N_ERROR_INVALID_PARAMETER; - } + UErrorCode icu_error = U_ZERO_ERROR; - *enumeration = (i18n_uenumeration_h)uloc_openKeywords(locale_id, &icu_error); + *enumeration = (i18n_uenumeration_h) uloc_openKeywords(locale_id, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); return i18n_error; } -int32_t i18n_ulocale_get_keyword_value (const char *locale_id, const char *keyword_name, char *buffer, - int32_t buffer_capacity) +int32_t i18n_ulocale_get_keyword_value(const char *locale_id, const char *keyword_name, + char *buffer, int32_t buffer_capacity) { - if(NULL == locale_id || NULL == keyword_name || NULL == buffer || buffer_capacity < 0){ + if (NULL == locale_id || NULL == keyword_name || NULL == buffer || buffer_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t len_of_keyword = uloc_getKeywordValue(locale_id, keyword_name, buffer, buffer_capacity, &icu_error); + int32_t len_of_keyword = + uloc_getKeywordValue(locale_id, keyword_name, buffer, buffer_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -317,16 +332,17 @@ int32_t i18n_ulocale_get_keyword_value (const char *locale_id, const char *keywo return len_of_keyword; } -int32_t i18n_ulocale_set_keyword_value (const char *keyword_name, const char *keyword_value, char *buffer, - int32_t buffer_capacity) +int32_t i18n_ulocale_set_keyword_value(const char *keyword_name, const char *keyword_value, + char *buffer, int32_t buffer_capacity) { - if(NULL == keyword_name || NULL == buffer || buffer_capacity < 0){ + if (NULL == keyword_name || NULL == buffer || buffer_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_setKeywordValue(keyword_name, keyword_value, buffer, buffer_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_setKeywordValue(keyword_name, keyword_value, buffer, buffer_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -335,11 +351,12 @@ int32_t i18n_ulocale_set_keyword_value (const char *keyword_name, const char *ke return needed_buffer_size; } -int i18n_ulocale_get_character_orientation (const char *locale_id, i18n_ulocale_layout_type_e *layout_type) +int i18n_ulocale_get_character_orientation(const char *locale_id, + i18n_ulocale_layout_type_e *layout_type) { - if (NULL == layout_type){ + if (NULL == layout_type) return I18N_ERROR_INVALID_PARAMETER; - } + UErrorCode icu_error = U_ZERO_ERROR; *layout_type = uloc_getCharacterOrientation(locale_id, &icu_error); @@ -349,13 +366,14 @@ int i18n_ulocale_get_character_orientation (const char *locale_id, i18n_ulocale_ return i18n_error; } -int i18n_ulocale_get_line_orientation (const char *locale_id, i18n_ulocale_layout_type_e *layout_type) +int i18n_ulocale_get_line_orientation(const char *locale_id, + i18n_ulocale_layout_type_e *layout_type) { - if (NULL == layout_type){ + if (NULL == layout_type) return I18N_ERROR_INVALID_PARAMETER; - } + UErrorCode icu_error = U_ZERO_ERROR; - *layout_type = uloc_getLineOrientation(locale_id, &icu_error); + *layout_type = uloc_getLineOrientation(locale_id, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -363,15 +381,16 @@ int i18n_ulocale_get_line_orientation (const char *locale_id, i18n_ulocale_layou return i18n_error; } -int32_t i18n_ulocale_get_locale_for_lcid (uint32_t host_id, char *locale, int32_t locale_capacity) +int32_t i18n_ulocale_get_locale_for_lcid(uint32_t host_id, char *locale, int32_t locale_capacity) { - if(NULL == locale || locale_capacity < 0){ + if (NULL == locale || locale_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_getLocaleForLCID(host_id, locale, locale_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_getLocaleForLCID(host_id, locale, locale_capacity, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -380,11 +399,13 @@ int32_t i18n_ulocale_get_locale_for_lcid (uint32_t host_id, char *locale, int32_ return needed_buffer_size; } -int32_t i18n_ulocale_add_likely_subtags (const char *locale_id, char *maximized_locale_id, - int32_t maximized_locale_id_capacity) +int32_t i18n_ulocale_add_likely_subtags(const char *locale_id, char *maximized_locale_id, + int32_t maximized_locale_id_capacity) { UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_addLikelySubtags(locale_id, maximized_locale_id, maximized_locale_id_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_addLikelySubtags(locale_id, maximized_locale_id, maximized_locale_id_capacity, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -393,11 +414,13 @@ int32_t i18n_ulocale_add_likely_subtags (const char *locale_id, char *maximized_ return needed_buffer_size; } -int32_t i18n_ulocale_minimize_subtags (const char *locale_id, char *minimized_locale_id, - int32_t minimized_locale_id_capacity) +int32_t i18n_ulocale_minimize_subtags(const char *locale_id, char *minimized_locale_id, + int32_t minimized_locale_id_capacity) { UErrorCode icu_error = U_ZERO_ERROR; - int32_t needed_buffer_size = uloc_minimizeSubtags(locale_id, minimized_locale_id, minimized_locale_id_capacity, &icu_error); + int32_t needed_buffer_size = + uloc_minimizeSubtags(locale_id, minimized_locale_id, minimized_locale_id_capacity, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -406,16 +429,17 @@ int32_t i18n_ulocale_minimize_subtags (const char *locale_id, char *minimized_lo return needed_buffer_size; } -int32_t i18n_ulocale_for_language_tag (const char *langtag, char *locale_id, int32_t locale_id_capacity, - int32_t *parsed_length) +int32_t i18n_ulocale_for_language_tag(const char *langtag, char *locale_id, + int32_t locale_id_capacity, int32_t *parsed_length) { - if(NULL == langtag || NULL == locale_id || locale_id_capacity < 0){ + if (NULL == langtag || NULL == locale_id || locale_id_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t len_of_loc = uloc_forLanguageTag(langtag, locale_id, locale_id_capacity, parsed_length, &icu_error); + int32_t len_of_loc = + uloc_forLanguageTag(langtag, locale_id, locale_id_capacity, parsed_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -424,16 +448,17 @@ int32_t i18n_ulocale_for_language_tag (const char *langtag, char *locale_id, int return len_of_loc; } -int32_t i18n_ulocale_to_language_tag (const char *locale_id, char *langtag, int32_t langtag_capacity, - i18n_ubool strict) +int32_t i18n_ulocale_to_language_tag(const char *locale_id, char *langtag, int32_t langtag_capacity, + i18n_ubool strict) { - if(NULL == locale_id || NULL == langtag || langtag_capacity < 0){ + if (NULL == locale_id || NULL == langtag || langtag_capacity < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return -1; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t len_of_loc = uloc_toLanguageTag(locale_id, langtag, langtag_capacity, strict, &icu_error); + int32_t len_of_loc = + uloc_toLanguageTag(locale_id, langtag, langtag_capacity, strict, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); diff --git a/src/utils_i18n_unormalization.c b/src/utils_i18n_unormalization.c index 92fe656..39563a2 100755 --- a/src/utils_i18n_unormalization.c +++ b/src/utils_i18n_unormalization.c @@ -18,22 +18,27 @@ #include #include -int i18n_unormalization_get_instance ( const char *package_name, const char *name, i18n_unormalization_mode_e mode, - i18n_unormalizer_h *normalizer ) +int i18n_unormalization_get_instance(const char *package_name, const char *name, + i18n_unormalization_mode_e mode, + i18n_unormalizer_h *normalizer) { i18n_error_code_e err = I18N_ERROR_NONE; - *normalizer = unorm2_getInstance(package_name, name, mode, (UErrorCode*)&err); + *normalizer = unorm2_getInstance(package_name, name, mode, (UErrorCode *) & err); int result = _i18n_error_mapping(err); - - return result; + + return result; } -int i18n_unormalization_normalize ( i18n_unormalizer_h normalizer, const i18n_uchar *src, int32_t len, i18n_uchar *dest, int32_t capacity, int32_t *len_deststr ) +int i18n_unormalization_normalize(i18n_unormalizer_h normalizer, const i18n_uchar *src, + int32_t len, i18n_uchar *dest, int32_t capacity, + int32_t *len_deststr) { - retv_if( normalizer == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(normalizer == NULL, I18N_ERROR_INVALID_PARAMETER); i18n_error_code_e err = I18N_ERROR_NONE; - *len_deststr = unorm2_normalize((UNormalizer2*)normalizer, src, len, dest, capacity, (UErrorCode*)&err); + *len_deststr = + unorm2_normalize((UNormalizer2 *) normalizer, src, len, dest, capacity, + (UErrorCode *) & err); int result = _i18n_error_mapping(err); return result; diff --git a/src/utils_i18n_unumber.c b/src/utils_i18n_unumber.c index e568e44..9815e3e 100755 --- a/src/utils_i18n_unumber.c +++ b/src/utils_i18n_unumber.c @@ -19,17 +19,20 @@ #include #include -int i18n_unumber_create (i18n_unumber_format_style_e style, const i18n_uchar *pattern, int32_t pattern_len, const char *locale, i18n_uparse_error_s *parse_err, i18n_unumber_format_h *num_format) +int i18n_unumber_create(i18n_unumber_format_style_e style, const i18n_uchar *pattern, + int32_t pattern_len, const char *locale, i18n_uparse_error_s *parse_err, + i18n_unumber_format_h *num_format) { - retv_if (num_format == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(num_format == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode icu_error = U_ZERO_ERROR; - *num_format = unum_open(style, pattern, pattern_len, locale, (UParseError*)parse_err, &icu_error); + *num_format = + unum_open(style, pattern, pattern_len, locale, (UParseError *) parse_err, &icu_error); return _i18n_error_mapping(icu_error); } -int i18n_unumber_destroy (i18n_unumber_format_h fmt) +int i18n_unumber_destroy(i18n_unumber_format_h fmt) { retv_if(fmt == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -38,7 +41,8 @@ int i18n_unumber_destroy (i18n_unumber_format_h fmt) return I18N_ERROR_NONE; } -int i18n_unumber_get_symbol (const i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, i18n_uchar *buffer, int32_t size, int32_t *len_symbol) +int i18n_unumber_get_symbol(const i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, + i18n_uchar *buffer, int32_t size, int32_t *len_symbol) { retv_if(fmt == NULL || len_symbol == NULL, I18N_ERROR_INVALID_PARAMETER); @@ -52,12 +56,11 @@ int i18n_unumber_get_symbol (const i18n_unumber_format_h fmt, i18n_unumber_forma int i18n_unumber_clone(const i18n_unumber_format_h fmt, i18n_unumber_format_h *fmt_clone) { - if(fmt == NULL || NULL == fmt_clone) { + if (fmt == NULL || NULL == fmt_clone) return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - *fmt_clone = (i18n_unumber_format_h)unum_clone(fmt, &icu_error); + *fmt_clone = (i18n_unumber_format_h) unum_clone(fmt, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -65,33 +68,42 @@ int i18n_unumber_clone(const i18n_unumber_format_h fmt, i18n_unumber_format_h *f return i18n_error; } -int32_t i18n_unumber_format (const i18n_unumber_format_h fmt, int32_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_s *pos, i18n_error_code_e *status) +int32_t i18n_unumber_format(const i18n_unumber_format_h fmt, int32_t number, i18n_uchar *result, + int32_t result_length, i18n_ufield_position_s *pos, + i18n_error_code_e *status) { - if(NULL == fmt) { - if(NULL != status) { + if (NULL == fmt) { + if (NULL != status) *status = I18N_ERROR_INVALID_PARAMETER; - } + return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_format = unum_format (fmt, number, (UChar*)result, result_length, (UFieldPosition*)pos, &icu_error); - if(NULL != status) { + int32_t result_unum_format = + unum_format(fmt, number, (UChar *) result, result_length, (UFieldPosition *) pos, + &icu_error); + + if (NULL != status) { ERR_MAPPING(icu_error, *status); I18N_ERR(*status); } + return result_unum_format; } -int32_t i18n_unumber_format_int64 (const i18n_unumber_format_h fmt, int64_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos) +int32_t i18n_unumber_format_int64(const i18n_unumber_format_h fmt, int64_t number, + i18n_uchar *result, int32_t result_length, + i18n_ufield_position_h pos) { - if(fmt == NULL) { + if (fmt == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_formatInt64 = unum_formatInt64 (fmt, number, result, result_length, (UFieldPosition*)pos, &icu_error); + int32_t result_unum_formatInt64 = + unum_formatInt64(fmt, number, result, result_length, (UFieldPosition *) pos, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -100,15 +112,18 @@ int32_t i18n_unumber_format_int64 (const i18n_unumber_format_h fmt, int64_t numb return result_unum_formatInt64; } -int32_t i18n_unumber_format_double (const i18n_unumber_format_h fmt, double number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos) +int32_t i18n_unumber_format_double(const i18n_unumber_format_h fmt, double number, + i18n_uchar *result, int32_t result_length, + i18n_ufield_position_h pos) { - if(fmt == NULL) { + if (fmt == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_formatDouble = unum_formatDouble(fmt, number, result, result_length, (UFieldPosition*)pos, &icu_error); + int32_t result_unum_formatDouble = + unum_formatDouble(fmt, number, result, result_length, (UFieldPosition *) pos, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -117,15 +132,19 @@ int32_t i18n_unumber_format_double (const i18n_unumber_format_h fmt, double numb return result_unum_formatDouble; } -int32_t i18n_unumber_format_decimal (const i18n_unumber_format_h fmt, const char *number, int32_t length, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos) +int32_t i18n_unumber_format_decimal(const i18n_unumber_format_h fmt, const char *number, + int32_t length, i18n_uchar *result, int32_t result_length, + i18n_ufield_position_h pos) { - if(fmt == NULL || number == NULL) { + if (fmt == NULL || number == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_formatDecimal = unum_formatDecimal (fmt, number, length, result, result_length, (UFieldPosition*)pos, &icu_error); + int32_t result_unum_formatDecimal = + unum_formatDecimal(fmt, number, length, result, result_length, (UFieldPosition *) pos, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -134,15 +153,19 @@ int32_t i18n_unumber_format_decimal (const i18n_unumber_format_h fmt, const char return result_unum_formatDecimal; } -int32_t i18n_unumber_format_double_currency (const i18n_unumber_format_h fmt, double number, i18n_uchar *currency, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos) +int32_t i18n_unumber_format_double_currency(const i18n_unumber_format_h fmt, double number, + i18n_uchar *currency, i18n_uchar *result, + int32_t result_length, i18n_ufield_position_h pos) { - if(fmt == NULL) { + if (fmt == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_formatDoubleCurrency = unum_formatDoubleCurrency (fmt, number, currency, result, result_length, (UFieldPosition*)pos, &icu_error); + int32_t result_unum_formatDoubleCurrency = + unum_formatDoubleCurrency(fmt, number, currency, result, result_length, + (UFieldPosition *) pos, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -151,15 +174,16 @@ int32_t i18n_unumber_format_double_currency (const i18n_unumber_format_h fmt, do return result_unum_formatDoubleCurrency; } -int32_t i18n_unumber_parse (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos) +int32_t i18n_unumber_parse(const i18n_unumber_format_h fmt, const i18n_uchar *text, + int32_t text_length, int32_t *parse_pos) { - if(fmt == NULL || text == NULL || text_length < -1) { + if (fmt == NULL || text == NULL || text_length < -1) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_parse = unum_parse (fmt, text, text_length, parse_pos, &icu_error); + int32_t result_unum_parse = unum_parse(fmt, text, text_length, parse_pos, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -168,15 +192,16 @@ int32_t i18n_unumber_parse (const i18n_unumber_format_h fmt, const i18n_uchar *t return result_unum_parse; } -int64_t i18n_unumber_parse_int64 (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos) +int64_t i18n_unumber_parse_int64(const i18n_unumber_format_h fmt, const i18n_uchar *text, + int32_t text_length, int32_t *parse_pos) { - if(fmt == NULL || text == NULL || text_length < -1) { + if (fmt == NULL || text == NULL || text_length < -1) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int64_t result_unum_parseInt64 = unum_parseInt64 (fmt, text, text_length, parse_pos, &icu_error); + int64_t result_unum_parseInt64 = unum_parseInt64(fmt, text, text_length, parse_pos, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -185,15 +210,17 @@ int64_t i18n_unumber_parse_int64 (const i18n_unumber_format_h fmt, const i18n_uc return result_unum_parseInt64; } -double i18n_unumber_parse_double (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos) +double i18n_unumber_parse_double(const i18n_unumber_format_h fmt, const i18n_uchar *text, + int32_t text_length, int32_t *parse_pos) { - if(fmt == NULL || text == NULL || text_length < -1) { + if (fmt == NULL || text == NULL || text_length < -1) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - double result_unum_parseDouble = unum_parseDouble (fmt, text, text_length, parse_pos, &icu_error); + double result_unum_parseDouble = + unum_parseDouble(fmt, text, text_length, parse_pos, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -202,15 +229,18 @@ double i18n_unumber_parse_double (const i18n_unumber_format_h fmt, const i18n_uc return result_unum_parseDouble; } -int32_t i18n_unumber_parse_decimal (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, char *out_buf, int32_t out_buf_length) +int32_t i18n_unumber_parse_decimal(const i18n_unumber_format_h fmt, const i18n_uchar *text, + int32_t text_length, int32_t *parse_pos, char *out_buf, + int32_t out_buf_length) { - if(fmt == NULL || text == NULL || text_length < -1 || out_buf == NULL) { + if (fmt == NULL || text == NULL || text_length < -1 || out_buf == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_parseDecimal = unum_parseDecimal (fmt, text, text_length, parse_pos, out_buf, out_buf_length, &icu_error); + int32_t result_unum_parseDecimal = + unum_parseDecimal(fmt, text, text_length, parse_pos, out_buf, out_buf_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -219,15 +249,18 @@ int32_t i18n_unumber_parse_decimal (const i18n_unumber_format_h fmt, const i18n_ return result_unum_parseDecimal; } -double i18n_unumber_parse_double_currency (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_uchar *currency) +double i18n_unumber_parse_double_currency(const i18n_unumber_format_h fmt, const i18n_uchar *text, + int32_t text_length, int32_t *parse_pos, + i18n_uchar *currency) { - if(fmt == NULL || text == NULL || text_length < -1 || currency == NULL) { + if (fmt == NULL || text == NULL || text_length < -1 || currency == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_parseDoubleCurrency = unum_parseDoubleCurrency (fmt, text, text_length, parse_pos, currency, &icu_error); + int32_t result_unum_parseDoubleCurrency = + unum_parseDoubleCurrency(fmt, text, text_length, parse_pos, currency, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -236,14 +269,16 @@ double i18n_unumber_parse_double_currency (const i18n_unumber_format_h fmt, cons return result_unum_parseDoubleCurrency; } -int i18n_unumber_apply_pattern (i18n_unumber_format_h format, i18n_ubool localized, const i18n_uchar *pattern, int32_t pattern_length, i18n_uparse_error_s* parse_error) +int i18n_unumber_apply_pattern(i18n_unumber_format_h format, i18n_ubool localized, + const i18n_uchar *pattern, int32_t pattern_length, + i18n_uparse_error_s *parse_error) { - if(format == NULL || pattern == NULL || pattern_length < -1) { + if (format == NULL || pattern == NULL || pattern_length < -1) return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - unum_applyPattern (format, localized, pattern, pattern_length, (UParseError*)parse_error, &icu_error); + unum_applyPattern(format, localized, pattern, pattern_length, (UParseError *) parse_error, + &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -252,9 +287,9 @@ int i18n_unumber_apply_pattern (i18n_unumber_format_h format, i18n_ubool localiz return i18n_error; } -const char *i18n_unumber_get_available (int32_t locale_index) +const char *i18n_unumber_get_available(int32_t locale_index) { - if(locale_index < 0) { + if (locale_index < 0) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -263,15 +298,16 @@ const char *i18n_unumber_get_available (int32_t locale_index) return unum_getAvailable(locale_index); } -int32_t i18n_unumber_count_available (void) +int32_t i18n_unumber_count_available(void) { set_last_result(I18N_ERROR_NONE); return unum_countAvailable(); } -int32_t i18n_unumber_get_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr) +int32_t i18n_unumber_get_attribute(const i18n_unumber_format_h fmt, + i18n_unumber_format_attribute_e attr) { - if(fmt == NULL) { + if (fmt == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -280,46 +316,50 @@ int32_t i18n_unumber_get_attribute (const i18n_unumber_format_h fmt, i18n_unumbe return unum_getAttribute(fmt, attr); } -int i18n_unumber_set_attribute (i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, int32_t new_value) +int i18n_unumber_set_attribute(i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, + int32_t new_value) { - if(fmt == NULL || attr == I18N_UNUMBER_ROUNDING_INCREMENT) { + if (fmt == NULL || attr == I18N_UNUMBER_ROUNDING_INCREMENT) return I18N_ERROR_INVALID_PARAMETER; - } unum_setAttribute(fmt, attr, new_value); return I18N_ERROR_NONE; } -double i18n_unumber_get_double_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr) +double i18n_unumber_get_double_attribute(const i18n_unumber_format_h fmt, + i18n_unumber_format_attribute_e attr) { - if(fmt == NULL || I18N_UNUMBER_ROUNDING_INCREMENT != attr) { + if (fmt == NULL || I18N_UNUMBER_ROUNDING_INCREMENT != attr) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } set_last_result(I18N_ERROR_NONE); - return unum_getDoubleAttribute (fmt, attr); + return unum_getDoubleAttribute(fmt, attr); } -int i18n_unumber_set_double_attribute (i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, double new_value) +int i18n_unumber_set_double_attribute(i18n_unumber_format_h fmt, + i18n_unumber_format_attribute_e attr, double new_value) { - if(fmt == NULL || attr != I18N_UNUMBER_ROUNDING_INCREMENT) { + if (fmt == NULL || attr != I18N_UNUMBER_ROUNDING_INCREMENT) return I18N_ERROR_INVALID_PARAMETER; - } unum_setDoubleAttribute(fmt, attr, new_value); return I18N_ERROR_NONE; } -int32_t i18n_unumber_get_text_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, i18n_uchar *result, int32_t result_length) +int32_t i18n_unumber_get_text_attribute(const i18n_unumber_format_h fmt, + i18n_unumber_format_text_attribute_e tag, + i18n_uchar *result, int32_t result_length) { - if(fmt == NULL) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + if (fmt == NULL) { + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_getTextAttribute = unum_getTextAttribute (fmt, tag, result, result_length, &icu_error); + int32_t result_unum_getTextAttribute = + unum_getTextAttribute(fmt, tag, result, result_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -328,14 +368,15 @@ int32_t i18n_unumber_get_text_attribute (const i18n_unumber_format_h fmt, i18n_u return result_unum_getTextAttribute; } -int i18n_unumber_set_text_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, const i18n_uchar *new_value, int32_t new_value_length) +int i18n_unumber_set_text_attribute(const i18n_unumber_format_h fmt, + i18n_unumber_format_text_attribute_e tag, + const i18n_uchar *new_value, int32_t new_value_length) { - if(fmt == NULL || new_value == NULL || new_value_length < -1) { + if (fmt == NULL || new_value == NULL || new_value_length < -1) return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; - unum_setTextAttribute((UNumberFormat*)fmt, tag, new_value, new_value_length, &icu_error); + unum_setTextAttribute((UNumberFormat *) fmt, tag, new_value, new_value_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -343,15 +384,17 @@ int i18n_unumber_set_text_attribute (const i18n_unumber_format_h fmt, i18n_unumb return i18n_error; } -int32_t i18n_unumber_to_pattern (const i18n_unumber_format_h fmt, i18n_ubool is_pattern_localized, i18n_uchar *result, int32_t result_length) +int32_t i18n_unumber_to_pattern(const i18n_unumber_format_h fmt, i18n_ubool is_pattern_localized, + i18n_uchar *result, int32_t result_length) { - if(fmt == NULL) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + if (fmt == NULL) { + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_unum_toPattern = unum_toPattern(fmt, is_pattern_localized, result, result_length, &icu_error); + int32_t result_unum_toPattern = + unum_toPattern(fmt, is_pattern_localized, result, result_length, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); @@ -360,11 +403,11 @@ int32_t i18n_unumber_to_pattern (const i18n_unumber_format_h fmt, i18n_ubool is_ return result_unum_toPattern; } -int i18n_unumber_set_symbol (i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, const i18n_uchar *value, int32_t length) +int i18n_unumber_set_symbol(i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, + const i18n_uchar *value, int32_t length) { - if(fmt == NULL) { + if (fmt == NULL) return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; unum_setSymbol(fmt, symbol, value, length, &icu_error); @@ -375,15 +418,16 @@ int i18n_unumber_set_symbol (i18n_unumber_format_h fmt, i18n_unumber_format_symb return i18n_error; } -const char *i18n_unumber_get_locale_by_type (const i18n_unumber_format_h fmt, i18n_ulocale_data_locale_type_e type) +const char *i18n_unumber_get_locale_by_type(const i18n_unumber_format_h fmt, + i18n_ulocale_data_locale_type_e type) { - if(fmt == NULL) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + if (fmt == NULL) { + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } UErrorCode icu_error = U_ZERO_ERROR; - const char *result_unum_getLocaleByType = unum_getLocaleByType (fmt, type, &icu_error); + const char *result_unum_getLocaleByType = unum_getLocaleByType(fmt, type, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); diff --git a/src/utils_i18n_usearch.c b/src/utils_i18n_usearch.c index 74aa151..566832c 100755 --- a/src/utils_i18n_usearch.c +++ b/src/utils_i18n_usearch.c @@ -18,61 +18,68 @@ #include #include -int i18n_usearch_destroy ( i18n_usearch_h searchiter ) +int i18n_usearch_destroy(i18n_usearch_h searchiter) { - retv_if ( searchiter == NULL, I18N_ERROR_INVALID_PARAMETER ); + retv_if(searchiter == NULL, I18N_ERROR_INVALID_PARAMETER); - usearch_close ( searchiter ); + usearch_close(searchiter); return I18N_ERROR_NONE; } -int i18n_usearch_first ( i18n_usearch_h strsrch, int32_t *index_first ) +int i18n_usearch_first(i18n_usearch_h strsrch, int32_t *index_first) { - retv_if ( strsrch == NULL || index_first == NULL, I18N_ERROR_INVALID_PARAMETER ); + retv_if(strsrch == NULL || index_first == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode err = U_ZERO_ERROR; - *index_first = usearch_first ( strsrch, &err ); - int result = _i18n_error_mapping ( err ); + *index_first = usearch_first(strsrch, &err); + int result = _i18n_error_mapping(err); I18N_ERR(result); return result; } -int i18n_usearch_get_collator ( const i18n_usearch_h strsrch, i18n_ucollator_h *collator ) +int i18n_usearch_get_collator(const i18n_usearch_h strsrch, i18n_ucollator_h *collator) { - retv_if ( strsrch == NULL || collator == NULL, I18N_ERROR_INVALID_PARAMETER ); - *collator = usearch_getCollator ( strsrch ); + retv_if(strsrch == NULL || collator == NULL, I18N_ERROR_INVALID_PARAMETER); + *collator = usearch_getCollator(strsrch); return I18N_ERROR_NONE; } -int i18n_usearch_get_matched_text ( const i18n_usearch_h strsrch, i18n_uchar *result_w, int32_t result_capacity, int32_t *len_matched_text ) +int i18n_usearch_get_matched_text(const i18n_usearch_h strsrch, i18n_uchar *result_w, + int32_t result_capacity, int32_t *len_matched_text) { UErrorCode err = U_ZERO_ERROR; - *len_matched_text = usearch_getMatchedText ( strsrch, result_w, result_capacity, &err ); - int result = _i18n_error_mapping ( err ); + *len_matched_text = usearch_getMatchedText(strsrch, result_w, result_capacity, &err); + int result = _i18n_error_mapping(err); I18N_ERR(result); return result; } -int i18n_usearch_create ( const i18n_uchar *pattern, int32_t pattern_len, const i18n_uchar *text, - int32_t text_len, const char *locale, i18n_ubreak_iterator_s *break_iter, i18n_usearch_h *search_iter ) +int i18n_usearch_create(const i18n_uchar *pattern, int32_t pattern_len, const i18n_uchar *text, + int32_t text_len, const char *locale, i18n_ubreak_iterator_s *break_iter, + i18n_usearch_h *search_iter) { - retv_if ( search_iter == NULL, I18N_ERROR_INVALID_PARAMETER ); + retv_if(search_iter == NULL, I18N_ERROR_INVALID_PARAMETER); i18n_error_code_e err = I18N_ERROR_NONE; - *search_iter = usearch_open ( pattern, pattern_len, text, text_len, locale, (UBreakIterator*)break_iter, (UErrorCode*)&err ); - int result = _i18n_error_mapping ( err ); + *search_iter = + usearch_open(pattern, pattern_len, text, text_len, locale, (UBreakIterator *) break_iter, + (UErrorCode *) & err); + int result = _i18n_error_mapping(err); return result; } -int i18n_usearch_create_new ( const i18n_uchar *pattern, int32_t pattern_len, const i18n_uchar *text, - int32_t text_len, const char *locale, i18n_ubreak_iterator_h break_iter, i18n_usearch_h *search_iter ) +int i18n_usearch_create_new(const i18n_uchar *pattern, int32_t pattern_len, + const i18n_uchar *text, int32_t text_len, const char *locale, + i18n_ubreak_iterator_h break_iter, i18n_usearch_h *search_iter) { - retv_if ( search_iter == NULL, I18N_ERROR_INVALID_PARAMETER ); + retv_if(search_iter == NULL, I18N_ERROR_INVALID_PARAMETER); UErrorCode icu_error = U_ZERO_ERROR; - *search_iter = (i18n_usearch_h)usearch_open(pattern, pattern_len, text, text_len, locale, (UBreakIterator*)break_iter, &icu_error); + *search_iter = + (i18n_usearch_h) usearch_open(pattern, pattern_len, text, text_len, locale, + (UBreakIterator *) break_iter, &icu_error); i18n_error_code_e i18n_error; ERR_MAPPING(icu_error, i18n_error); diff --git a/src/utils_i18n_uset.c b/src/utils_i18n_uset.c index 75ebe4b..6093d10 100644 --- a/src/utils_i18n_uset.c +++ b/src/utils_i18n_uset.c @@ -19,129 +19,129 @@ #include #include -int i18n_uset_create_empty ( i18n_uset_h* set ) +int i18n_uset_create_empty(i18n_uset_h *set) { - if(set == NULL) - { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - *set = (i18n_uset_h)uset_openEmpty(); + + *set = (i18n_uset_h) uset_openEmpty(); return I18N_ERROR_NONE; } -int i18n_uset_create ( i18n_uchar32 start, i18n_uchar32 end, i18n_uset_h *set) +int i18n_uset_create(i18n_uchar32 start, i18n_uchar32 end, i18n_uset_h *set) { - if(set == NULL) - { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - *set = (i18n_uset_h)uset_open(start, end); + + *set = (i18n_uset_h) uset_open(start, end); return I18N_ERROR_NONE; } -int i18n_uset_create_pattern ( const i18n_uchar *pattern, int32_t pattern_length, i18n_uset_h *set ) +int i18n_uset_create_pattern(const i18n_uchar *pattern, int32_t pattern_length, i18n_uset_h *set) { UErrorCode icu_error = U_ZERO_ERROR; i18n_error_code_e i18n_error; - if (pattern == NULL || pattern_length < -1 || set == NULL) { + if (pattern == NULL || pattern_length < -1 || set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - *set = (i18n_uset_h)uset_openPattern(pattern, pattern_length, &icu_error); + *set = (i18n_uset_h) uset_openPattern(pattern, pattern_length, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); return i18n_error; } -int i18n_uset_create_pattern_options ( const i18n_uchar *pattern, int32_t pattern_length, uint32_t options, i18n_uset_h *set ) +int i18n_uset_create_pattern_options(const i18n_uchar *pattern, int32_t pattern_length, + uint32_t options, i18n_uset_h *set) { UErrorCode icu_error = U_ZERO_ERROR; i18n_error_code_e i18n_error; - if (pattern == NULL || pattern_length < -1 || set == NULL) { + if (pattern == NULL || pattern_length < -1 || set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - if ((options != I18N_USET_IGNORE_SPACE) && (options != I18N_USET_CASE_INSENSITIVE)) { + + if ((options != I18N_USET_IGNORE_SPACE) && (options != I18N_USET_CASE_INSENSITIVE)) return I18N_ERROR_INVALID_PARAMETER; - } - *set = (i18n_uset_h)uset_openPatternOptions(pattern, pattern_length, options, &icu_error); + *set = (i18n_uset_h) uset_openPatternOptions(pattern, pattern_length, options, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); return i18n_error; } -int i18n_uset_destroy ( i18n_uset_h set ) +int i18n_uset_destroy(i18n_uset_h set) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_close((USet*)set); + + uset_close((USet *) set); return I18N_ERROR_NONE; } -int i18n_uset_clone ( const i18n_uset_h set, i18n_uset_h *set_clone ) +int i18n_uset_clone(const i18n_uset_h set, i18n_uset_h *set_clone) { - if (set == NULL || set_clone == NULL) { + if (set == NULL || set_clone == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - *set_clone = (i18n_uset_h)uset_clone((const USet*)set); + *set_clone = (i18n_uset_h) uset_clone((const USet *)set); return I18N_ERROR_NONE; } -i18n_ubool i18n_uset_is_frozen ( const i18n_uset_h set ) +i18n_ubool i18n_uset_is_frozen(const i18n_uset_h set) { set_last_result(I18N_ERROR_NONE); + if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } - return uset_isFrozen((const USet*)set); + + return uset_isFrozen((const USet *)set); } -int i18n_uset_freeze ( i18n_uset_h set ) +int i18n_uset_freeze(i18n_uset_h set) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_freeze((USet*)set); + + uset_freeze((USet *) set); return I18N_ERROR_NONE; } -int i18n_uset_clone_as_thawed ( const i18n_uset_h set, i18n_uset_h *set_copy ) +int i18n_uset_clone_as_thawed(const i18n_uset_h set, i18n_uset_h *set_copy) { - if (set == NULL || set_copy == NULL) { + if (set == NULL || set_copy == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - *set_copy = (i18n_uset_h)uset_cloneAsThawed((const USet*)set); + *set_copy = (i18n_uset_h) uset_cloneAsThawed((const USet *)set); return I18N_ERROR_NONE; } -int i18n_uset_set ( i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end ) +int i18n_uset_set(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_set((USet*)set, start, end); + + uset_set((USet *) set, start, end); return I18N_ERROR_NONE; } -int32_t i18n_uset_apply_pattern ( i18n_uset_h set, const i18n_uchar *pattern, int32_t pattern_length, uint32_t options ) +int32_t i18n_uset_apply_pattern(i18n_uset_h set, const i18n_uchar *pattern, int32_t pattern_length, + uint32_t options) { - if (set == NULL ) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + if (set == NULL) { + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + if (pattern == NULL || pattern_length < -1) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + if (options != I18N_USET_IGNORE_SPACE && options != I18N_USET_CASE_INSENSITIVE) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; @@ -150,7 +150,8 @@ int32_t i18n_uset_apply_pattern ( i18n_uset_h set, const i18n_uchar *pattern, in UErrorCode icu_error = U_ZERO_ERROR; i18n_error_code_e i18n_error; - int32_t result_uset_applyPattern = uset_applyPattern ((USet*)set, pattern, pattern_length, options, &icu_error); + int32_t result_uset_applyPattern = + uset_applyPattern((USet *) set, pattern, pattern_length, options, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); @@ -158,47 +159,45 @@ int32_t i18n_uset_apply_pattern ( i18n_uset_h set, const i18n_uchar *pattern, in return result_uset_applyPattern; } -int i18n_uset_apply_int_property_value ( i18n_uset_h set, i18n_uchar_uproperty_e prop, int32_t value ) +int i18n_uset_apply_int_property_value(i18n_uset_h set, i18n_uchar_uproperty_e prop, int32_t value) { - if (set == NULL) { - return I18N_ERROR_INVALID_PARAMETER; - } - if ((prop < I18N_UCHAR_INT_START || prop > I18N_UCHAR_INT_LIMIT-1) && - (prop < I18N_UCHAR_MASK_START || prop > I18N_UCHAR_MASK_LIMIT-1)) { - return I18N_ERROR_INVALID_PARAMETER; - } + if (set == NULL) + return I18N_ERROR_INVALID_PARAMETER; + + if ((prop < I18N_UCHAR_INT_START || prop > I18N_UCHAR_INT_LIMIT - 1) && + (prop < I18N_UCHAR_MASK_START || prop > I18N_UCHAR_MASK_LIMIT - 1)) + return I18N_ERROR_INVALID_PARAMETER; + if (prop != I18N_UCHAR_GENERAL_CATEGORY_MASK && - (value <= I18N_UCHAR_INVALID_CODE || - value >= I18N_UCHAR_OTHER_PROPERTY_LIMIT)) { - return I18N_ERROR_INVALID_PARAMETER; - } + (value <= I18N_UCHAR_INVALID_CODE || value >= I18N_UCHAR_OTHER_PROPERTY_LIMIT)) + return I18N_ERROR_INVALID_PARAMETER; UErrorCode icu_error = U_ZERO_ERROR; i18n_error_code_e i18n_error; - uset_applyIntPropertyValue((USet *)set, prop, value, &icu_error); + uset_applyIntPropertyValue((USet *) set, prop, value, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); return i18n_error; } -int i18n_uset_apply_property_alias ( i18n_uset_h set, const i18n_uchar *prop, int32_t prop_length, const i18n_uchar *value, int32_t value_length ) +int i18n_uset_apply_property_alias(i18n_uset_h set, const i18n_uchar *prop, int32_t prop_length, + const i18n_uchar *value, int32_t value_length) { - if (set == NULL) { - return I18N_ERROR_INVALID_PARAMETER; - } - if (prop == NULL || prop_length < -1) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - if (value == NULL || value_length < -1) { + + if (prop == NULL || prop_length < -1) + return I18N_ERROR_INVALID_PARAMETER; + + if (value == NULL || value_length < -1) return I18N_ERROR_INVALID_PARAMETER; - } UErrorCode icu_error = U_ZERO_ERROR; i18n_error_code_e i18n_error; - uset_applyPropertyAlias ((USet*)set, prop, prop_length, value, value_length, &icu_error); + uset_applyPropertyAlias((USet *) set, prop, prop_length, value, value_length, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); @@ -206,27 +205,31 @@ int i18n_uset_apply_property_alias ( i18n_uset_h set, const i18n_uchar *prop, in } -i18n_ubool i18n_uset_resembles_pattern ( const i18n_uchar *pattern, int32_t pattern_length, int32_t pos ) +i18n_ubool i18n_uset_resembles_pattern(const i18n_uchar *pattern, int32_t pattern_length, + int32_t pos) { if (pattern == NULL || pattern_length < -1 || pos < 0) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return false; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return false; } + set_last_result(I18N_ERROR_NONE); return uset_resemblesPattern(pattern, pattern_length, pos); } -int32_t i18n_uset_to_pattern ( const i18n_uset_h set, i18n_uchar *result, int32_t result_capacity, i18n_ubool escape_unprintable ) +int32_t i18n_uset_to_pattern(const i18n_uset_h set, i18n_uchar *result, int32_t result_capacity, + i18n_ubool escape_unprintable) { if (set == NULL || result == NULL || result_capacity < 0) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } UErrorCode icu_error = U_ZERO_ERROR; i18n_error_code_e i18n_error; - int32_t result_uset_toPattern = uset_toPattern((const USet*)set, result, result_capacity, escape_unprintable, &icu_error); + int32_t result_uset_toPattern = + uset_toPattern((const USet *)set, result, result_capacity, escape_unprintable, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); @@ -234,268 +237,280 @@ int32_t i18n_uset_to_pattern ( const i18n_uset_h set, i18n_uchar *result, int32_ return result_uset_toPattern; } -int i18n_uset_add ( i18n_uset_h set, i18n_uchar32 character ) +int i18n_uset_add(i18n_uset_h set, i18n_uchar32 character) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_add ((USet*)set, character); + + uset_add((USet *) set, character); return I18N_ERROR_NONE; } -int i18n_uset_add_all ( i18n_uset_h set, const i18n_uset_h additional_set ) +int i18n_uset_add_all(i18n_uset_h set, const i18n_uset_h additional_set) { - if (set == NULL || additional_set == NULL) { + if (set == NULL || additional_set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_addAll((USet *)set, (const USet*)additional_set); + + uset_addAll((USet *) set, (const USet *)additional_set); return I18N_ERROR_NONE; } -int i18n_uset_add_range ( i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end ) +int i18n_uset_add_range(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_addRange((USet*)set, start, end); + + uset_addRange((USet *) set, start, end); return I18N_ERROR_NONE; } -int i18n_uset_add_string ( i18n_uset_h set, const i18n_uchar *str, int32_t str_len ) +int i18n_uset_add_string(i18n_uset_h set, const i18n_uchar *str, int32_t str_len) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - if (str == NULL || str_len < -1) { - return I18N_ERROR_INVALID_PARAMETER; - } - uset_addString((USet*)set, str, str_len); + + if (str == NULL || str_len < -1) + return I18N_ERROR_INVALID_PARAMETER; + + uset_addString((USet *) set, str, str_len); return I18N_ERROR_NONE; } -int i18n_uset_add_all_code_points ( i18n_uset_h set, const i18n_uchar *str, int32_t str_len ) +int i18n_uset_add_all_code_points(i18n_uset_h set, const i18n_uchar *str, int32_t str_len) { - if(set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - if (str == NULL || str_len < -1) { - return I18N_ERROR_INVALID_PARAMETER; - } - uset_addAllCodePoints((USet*)set, str, str_len); + + if (str == NULL || str_len < -1) + return I18N_ERROR_INVALID_PARAMETER; + + uset_addAllCodePoints((USet *) set, str, str_len); return I18N_ERROR_NONE; } -int i18n_uset_remove ( i18n_uset_h set, i18n_uchar32 character ) +int i18n_uset_remove(i18n_uset_h set, i18n_uchar32 character) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_remove ((USet*)set, character); + + uset_remove((USet *) set, character); return I18N_ERROR_NONE; } -int i18n_uset_remove_range ( i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end ) +int i18n_uset_remove_range(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_removeRange ((USet*)set, start, end); + + uset_removeRange((USet *) set, start, end); return I18N_ERROR_NONE; } -int i18n_uset_remove_string ( i18n_uset_h set, const i18n_uchar *str, int32_t str_len ) +int i18n_uset_remove_string(i18n_uset_h set, const i18n_uchar *str, int32_t str_len) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - if (str == NULL || str_len < -1) { - return I18N_ERROR_INVALID_PARAMETER; - } - uset_removeString((USet*)set, str, str_len); + + if (str == NULL || str_len < -1) + return I18N_ERROR_INVALID_PARAMETER; + + uset_removeString((USet *) set, str, str_len); return I18N_ERROR_NONE; } -int i18n_uset_remove_all ( i18n_uset_h set, const i18n_uset_h remove_set ) +int i18n_uset_remove_all(i18n_uset_h set, const i18n_uset_h remove_set) { - if (set == NULL || remove_set == NULL) { + if (set == NULL || remove_set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_removeAll((USet*)set, (const USet*)remove_set); + + uset_removeAll((USet *) set, (const USet *)remove_set); return I18N_ERROR_NONE; } -int i18n_uset_retain ( i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end ) +int i18n_uset_retain(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_retain((USet*)set, start, end); - return I18N_ERROR_NONE; + + uset_retain((USet *) set, start, end); + return I18N_ERROR_NONE; } -int i18n_uset_retain_all ( i18n_uset_h set, const i18n_uset_h retain ) +int i18n_uset_retain_all(i18n_uset_h set, const i18n_uset_h retain) { - if (set == NULL || retain == NULL) { + if (set == NULL || retain == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_retainAll ((USet*)set, (const USet*)retain); + + uset_retainAll((USet *) set, (const USet *)retain); return I18N_ERROR_NONE; } -int i18n_uset_compact ( i18n_uset_h set ) +int i18n_uset_compact(i18n_uset_h set) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_compact((USet*)set); + + uset_compact((USet *) set); return I18N_ERROR_NONE; } -int i18n_uset_complement ( i18n_uset_h set ) +int i18n_uset_complement(i18n_uset_h set) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_complement((USet*)set); + + uset_complement((USet *) set); return I18N_ERROR_NONE; } -int i18n_uset_complement_all ( i18n_uset_h set, const i18n_uset_h complement ) +int i18n_uset_complement_all(i18n_uset_h set, const i18n_uset_h complement) { - if (set == NULL || set == complement || complement == NULL) { + if (set == NULL || set == complement || complement == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_complementAll((USet*)set, (const USet*)complement); + + uset_complementAll((USet *) set, (const USet *)complement); return I18N_ERROR_NONE; } -int i18n_uset_clear ( i18n_uset_h set ) +int i18n_uset_clear(i18n_uset_h set) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_clear((USet*)set); + + uset_clear((USet *) set); return I18N_ERROR_NONE; } -int i18n_uset_destroy_over ( i18n_uset_h set, int32_t attributes ) +int i18n_uset_destroy_over(i18n_uset_h set, int32_t attributes) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_closeOver((USet*)set, attributes); + + uset_closeOver((USet *) set, attributes); return I18N_ERROR_NONE; } -int i18n_uset_remove_all_strings ( i18n_uset_h set ) +int i18n_uset_remove_all_strings(i18n_uset_h set) { - if (set == NULL) { + if (set == NULL) return I18N_ERROR_INVALID_PARAMETER; - } - uset_removeAllStrings((USet*)set); + + uset_removeAllStrings((USet *) set); return I18N_ERROR_NONE; } -i18n_ubool i18n_uset_is_empty ( const i18n_uset_h set ) +i18n_ubool i18n_uset_is_empty(const i18n_uset_h set) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } + set_last_result(I18N_ERROR_NONE); - return uset_isEmpty((const USet*)set); + return uset_isEmpty((const USet *)set); } -i18n_ubool i18n_uset_contains ( const i18n_uset_h set, i18n_uchar32 character ) +i18n_ubool i18n_uset_contains(const i18n_uset_h set, i18n_uchar32 character) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } + set_last_result(I18N_ERROR_NONE); - return uset_contains((const USet*)set, character); + return uset_contains((const USet *)set, character); } -i18n_ubool i18n_uset_contains_range ( const i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end ) +i18n_ubool i18n_uset_contains_range(const i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } + set_last_result(I18N_ERROR_NONE); - return uset_containsRange((const USet*)set, start, end); + return uset_containsRange((const USet *)set, start, end); } -i18n_ubool i18n_uset_contains_string ( const i18n_uset_h set, const i18n_uchar *str, int32_t str_len ) +i18n_ubool i18n_uset_contains_string(const i18n_uset_h set, const i18n_uchar *str, int32_t str_len) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } + if (str == NULL || str_len < -1) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return false; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return false; } + set_last_result(I18N_ERROR_NONE); - return uset_containsString((const USet*)set, str, str_len); + return uset_containsString((const USet *)set, str, str_len); } -int32_t i18n_uset_index_of ( const i18n_uset_h set, i18n_uchar32 character ) +int32_t i18n_uset_index_of(const i18n_uset_h set, i18n_uchar32 character) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_indexOf((const USet*)set, character); + return uset_indexOf((const USet *)set, character); } -i18n_uchar32 i18n_uset_char_at ( const i18n_uset_h set, int32_t char_index ) +i18n_uchar32 i18n_uset_char_at(const i18n_uset_h set, int32_t char_index) { - if (set == NULL || (char_index < 0 || char_index > uset_size((const USet*)set)-1)) { + if (set == NULL || (char_index < 0 || char_index > uset_size((const USet *)set) - 1)) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0x0; } + set_last_result(I18N_ERROR_NONE); - return uset_charAt((const USet*)set, char_index); + return uset_charAt((const USet *)set, char_index); } -int32_t i18n_uset_size ( const i18n_uset_h set ) +int32_t i18n_uset_size(const i18n_uset_h set) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_size((const USet*)set); + return uset_size((const USet *)set); } -int32_t i18n_uset_get_item_count ( const i18n_uset_h set ) +int32_t i18n_uset_get_item_count(const i18n_uset_h set) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_getItemCount((const USet*)set); + return uset_getItemCount((const USet *)set); } -int32_t i18n_uset_get_item ( const i18n_uset_h set, int32_t item_index, i18n_uchar32 *start, i18n_uchar32 *end, - i18n_uchar *str, int32_t str_capacity ) +int32_t i18n_uset_get_item(const i18n_uset_h set, int32_t item_index, i18n_uchar32 *start, + i18n_uchar32 *end, i18n_uchar *str, int32_t str_capacity) { - if (set == NULL || (item_index < 0 || item_index > uset_getItemCount((const USet*)set)-1) || start == NULL || end == NULL) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + if (set == NULL || (item_index < 0 || item_index > uset_getItemCount((const USet *)set) - 1) + || start == NULL || end == NULL) { + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + if ((str == NULL && str_capacity != 0) || (str != NULL && str_capacity < 0)) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } UErrorCode icu_error = U_ZERO_ERROR; i18n_error_code_e i18n_error; - int32_t result_uset_getItem = uset_getItem((const USet*)set, item_index, start, end, str, str_capacity, &icu_error); + int32_t result_uset_getItem = + uset_getItem((const USet *)set, item_index, start, end, str, str_capacity, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); @@ -503,146 +518,170 @@ int32_t i18n_uset_get_item ( const i18n_uset_h set, int32_t item_index, i18n_uch return result_uset_getItem; } -i18n_ubool i18n_uset_contains_all ( const i18n_uset_h set1, const i18n_uset_h set2 ) +i18n_ubool i18n_uset_contains_all(const i18n_uset_h set1, const i18n_uset_h set2) { if (set1 == NULL || set2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } + set_last_result(I18N_ERROR_NONE); - return uset_containsAll((const USet*)set1, (const USet*)set2); + return uset_containsAll((const USet *)set1, (const USet *)set2); } -i18n_ubool i18n_uset_contains_all_code_points ( const i18n_uset_h set, const i18n_uchar *str, int32_t str_len ) +i18n_ubool i18n_uset_contains_all_code_points(const i18n_uset_h set, const i18n_uchar *str, + int32_t str_len) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } + if (str == NULL || str_len < -1) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return false; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return false; } + set_last_result(I18N_ERROR_NONE); - return uset_containsAllCodePoints((const USet*)set, str, str_len); + return uset_containsAllCodePoints((const USet *)set, str, str_len); } -i18n_ubool i18n_uset_contains_none ( const i18n_uset_h set1, const i18n_uset_h set2 ) +i18n_ubool i18n_uset_contains_none(const i18n_uset_h set1, const i18n_uset_h set2) { if (set1 == NULL || set2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } + set_last_result(I18N_ERROR_NONE); - return uset_containsNone((const USet*)set1, (const USet*)set2); + return uset_containsNone((const USet *)set1, (const USet *)set2); } -i18n_ubool i18n_uset_contains_some ( const i18n_uset_h set1, const i18n_uset_h set2 ) +i18n_ubool i18n_uset_contains_some(const i18n_uset_h set1, const i18n_uset_h set2) { if (set1 == NULL || set2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } + set_last_result(I18N_ERROR_NONE); - return uset_containsSome((const USet*)set1, (const USet*)set2); + return uset_containsSome((const USet *)set1, (const USet *)set2); } -int32_t i18n_uset_span ( const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition ) +int32_t i18n_uset_span(const i18n_uset_h set, const i18n_uchar *str, int32_t length, + i18n_uset_span_condition_e span_condition) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + if (str == NULL || length < -1) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_span((const USet*)set, str, length, (USetSpanCondition) span_condition); + return uset_span((const USet *)set, str, length, (USetSpanCondition) span_condition); } -int32_t i18n_uset_span_back ( const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition ) +int32_t i18n_uset_span_back(const i18n_uset_h set, const i18n_uchar *str, int32_t length, + i18n_uset_span_condition_e span_condition) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + if (str == NULL || length < -1) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + if (span_condition < I18N_USET_SPAN_NOT_CONTAINED || span_condition > I18N_USET_SPAN_CONDITION_COUNT) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_spanBack((const USet*)set, str, length, (USetSpanCondition) span_condition); + return uset_spanBack((const USet *)set, str, length, (USetSpanCondition) span_condition); } -int32_t i18n_uset_span_utf8 ( const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition ) +int32_t i18n_uset_span_utf8(const i18n_uset_h set, const char *str, int32_t length, + i18n_uset_span_condition_e span_condition) { if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + if (str == NULL || length < -1) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + if (span_condition < I18N_USET_SPAN_NOT_CONTAINED || span_condition > I18N_USET_SPAN_CONDITION_COUNT) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_spanUTF8((const USet*)set, str, length, (USetSpanCondition) span_condition); + return uset_spanUTF8((const USet *)set, str, length, (USetSpanCondition) span_condition); } -int32_t i18n_uset_span_back_utf8 ( const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition ) +int32_t i18n_uset_span_back_utf8(const i18n_uset_h set, const char *str, int32_t length, + i18n_uset_span_condition_e span_condition) { - if(set == NULL) { + if (set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + if (str == NULL || length < -1) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + if (span_condition < I18N_USET_SPAN_NOT_CONTAINED || span_condition > I18N_USET_SPAN_CONDITION_COUNT) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_spanBackUTF8((const USet*)set, str, length, (USetSpanCondition) span_condition); + return uset_spanBackUTF8((const USet *)set, str, length, (USetSpanCondition) span_condition); } -i18n_ubool i18n_uset_equals ( const i18n_uset_h set1, const i18n_uset_h set2 ) +i18n_ubool i18n_uset_equals(const i18n_uset_h set1, const i18n_uset_h set2) { if (set1 == NULL || set2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } + set_last_result(I18N_ERROR_NONE); - return uset_equals((const USet*)set1, (const USet*)set2); + return uset_equals((const USet *)set1, (const USet *)set2); } -int32_t i18n_uset_serialize ( const i18n_uset_h set, uint16_t *dest, int32_t dest_capacity ) +int32_t i18n_uset_serialize(const i18n_uset_h set, uint16_t *dest, int32_t dest_capacity) { i18n_error_code_e i18n_error; if (set == NULL) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + if (dest == NULL || dest_capacity < 0) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result_uset_serialize = uset_serialize((const USet*)set, dest, dest_capacity, &icu_error); + int32_t result_uset_serialize = + uset_serialize((const USet *)set, dest, dest_capacity, &icu_error); ERR_MAPPING(icu_error, i18n_error); I18N_ERR(i18n_error); @@ -650,55 +689,63 @@ int32_t i18n_uset_serialize ( const i18n_uset_h set, uint16_t *dest, int32_t des return result_uset_serialize; } -i18n_ubool i18n_uset_get_serialized_set ( const uint16_t *src, int32_t src_length, i18n_userialized_set_s *fill_set ) +i18n_ubool i18n_uset_get_serialized_set(const uint16_t *src, int32_t src_length, + i18n_userialized_set_s *fill_set) { if (src == NULL || src_length < 0 || fill_set == NULL) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_getSerializedSet((USerializedSet*)fill_set, src, src_length); + return uset_getSerializedSet((USerializedSet *) fill_set, src, src_length); } -int i18n_uset_set_serialized_to_one ( i18n_uchar32 character, i18n_userialized_set_s *fill_set ) +int i18n_uset_set_serialized_to_one(i18n_uchar32 character, i18n_userialized_set_s *fill_set) { - if (fill_set == NULL) { - return I18N_ERROR_INVALID_PARAMETER; - } - uset_setSerializedToOne((USerializedSet*)fill_set, character); + if (fill_set == NULL) + return I18N_ERROR_INVALID_PARAMETER; + + uset_setSerializedToOne((USerializedSet *) fill_set, character); return I18N_ERROR_NONE; } -i18n_ubool i18n_uset_serialized_contains ( const i18n_userialized_set_s *set, i18n_uchar32 character ) +i18n_ubool i18n_uset_serialized_contains(const i18n_userialized_set_s *set, i18n_uchar32 character) { if (set == NULL) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_serializedContains((const USerializedSet*)set, character); + return uset_serializedContains((const USerializedSet *)set, character); } -int32_t i18n_uset_get_serialized_range_count ( const i18n_userialized_set_s *set ) +int32_t i18n_uset_get_serialized_range_count(const i18n_userialized_set_s *set) { if (set == NULL) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return 0; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return 0; } + set_last_result(I18N_ERROR_NONE); - return uset_getSerializedRangeCount((const USerializedSet*)set); + return uset_getSerializedRangeCount((const USerializedSet *)set); } -i18n_ubool i18n_uset_get_serialized_range ( const i18n_userialized_set_s *set, int32_t range_index, i18n_uchar32 *p_start, i18n_uchar32 *p_end ) +i18n_ubool i18n_uset_get_serialized_range(const i18n_userialized_set_s *set, int32_t range_index, + i18n_uchar32 *p_start, i18n_uchar32 *p_end) { if (set == NULL) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return false; + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return false; } - if (range_index < 0 || range_index > uset_getSerializedRangeCount((const USerializedSet*)set)-1) { - set_last_result(I18N_ERROR_INVALID_PARAMETER); - return false; + + if (range_index < 0 + || range_index > uset_getSerializedRangeCount((const USerializedSet *)set) - 1) { + set_last_result(I18N_ERROR_INVALID_PARAMETER); + return false; } + set_last_result(I18N_ERROR_NONE); - return uset_getSerializedRange((const USerializedSet*)set, range_index, p_start, p_end); + return uset_getSerializedRange((const USerializedSet *)set, range_index, p_start, p_end); } diff --git a/src/utils_i18n_ustring.c b/src/utils_i18n_ustring.c index 730b4a6..82e101f 100644 --- a/src/utils_i18n_ustring.c +++ b/src/utils_i18n_ustring.c @@ -18,20 +18,20 @@ #include #include -int32_t i18n_ustring_get_length ( const i18n_uchar *s ) +int32_t i18n_ustring_get_length(const i18n_uchar *s) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } set_last_result(I18N_ERROR_NONE); - return u_strlen (s); + return u_strlen(s); } -int32_t i18n_ustring_count_char32 ( const i18n_uchar *s, int32_t length ) +int32_t i18n_ustring_count_char32(const i18n_uchar *s, int32_t length) { - if(s == NULL || length < -1) { + if (s == NULL || length < -1) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -40,9 +40,9 @@ int32_t i18n_ustring_count_char32 ( const i18n_uchar *s, int32_t length ) return u_countChar32(s, length); } -i18n_ubool i18n_ustring_has_more_char32_than ( const i18n_uchar *s, int32_t length, int32_t number ) +i18n_ubool i18n_ustring_has_more_char32_than(const i18n_uchar *s, int32_t length, int32_t number) { - if(s == NULL || length < -1) { + if (s == NULL || length < -1) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return false; } @@ -51,9 +51,9 @@ i18n_ubool i18n_ustring_has_more_char32_than ( const i18n_uchar *s, int32_t leng return u_strHasMoreChar32Than(s, length, number); } -i18n_uchar* i18n_ustring_cat ( i18n_uchar *dest, const i18n_uchar *src ) +i18n_uchar *i18n_ustring_cat(i18n_uchar *dest, const i18n_uchar *src) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -62,9 +62,9 @@ i18n_uchar* i18n_ustring_cat ( i18n_uchar *dest, const i18n_uchar *src ) return u_strcat(dest, src); } -i18n_uchar * i18n_ustring_cat_n ( i18n_uchar *dest, const i18n_uchar *src, int32_t n ) +i18n_uchar *i18n_ustring_cat_n(i18n_uchar *dest, const i18n_uchar *src, int32_t n) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -73,20 +73,21 @@ i18n_uchar * i18n_ustring_cat_n ( i18n_uchar *dest, const i18n_uchar *src, int32 return u_strncat(dest, src, n); } -i18n_uchar* i18n_ustring_string ( const i18n_uchar *s, const i18n_uchar *sub_string ) +i18n_uchar *i18n_ustring_string(const i18n_uchar *s, const i18n_uchar *sub_string) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_strstr(s, sub_string); + return (i18n_uchar *) u_strstr(s, sub_string); } -i18n_uchar* i18n_ustring_find_first ( const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length ) +i18n_uchar *i18n_ustring_find_first(const i18n_uchar *s, int32_t length, + const i18n_uchar *sub_string, int32_t sub_length) { - if(s == NULL || length < -1) { + if (s == NULL || length < -1) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -95,86 +96,87 @@ i18n_uchar* i18n_ustring_find_first ( const i18n_uchar *s, int32_t length, const return u_strFindFirst(s, length, sub_string, sub_length); } -i18n_uchar* i18n_ustring_char ( const i18n_uchar *s, i18n_uchar c ) +i18n_uchar *i18n_ustring_char(const i18n_uchar *s, i18n_uchar c) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_strchr(s, c); + return (i18n_uchar *) u_strchr(s, c); } -i18n_uchar* i18n_ustring_char32 ( const i18n_uchar *s, i18n_uchar32 c ) +i18n_uchar *i18n_ustring_char32(const i18n_uchar *s, i18n_uchar32 c) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_strchr32(s, c); + return (i18n_uchar *) u_strchr32(s, c); } -i18n_uchar* i18n_ustring_r_string ( const i18n_uchar *s, const i18n_uchar *sub_string ) +i18n_uchar *i18n_ustring_r_string(const i18n_uchar *s, const i18n_uchar *sub_string) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_strrstr(s, sub_string); + return (i18n_uchar *) u_strrstr(s, sub_string); } -i18n_uchar* i18n_ustring_find_last( const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length ) +i18n_uchar *i18n_ustring_find_last(const i18n_uchar *s, int32_t length, + const i18n_uchar *sub_string, int32_t sub_length) { - if(s == NULL || length < -1) { + if (s == NULL || length < -1) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_strFindLast(s, length, sub_string, sub_length); + return (i18n_uchar *) u_strFindLast(s, length, sub_string, sub_length); } -i18n_uchar* i18n_ustring_r_char ( const i18n_uchar *s, i18n_uchar c ) +i18n_uchar *i18n_ustring_r_char(const i18n_uchar *s, i18n_uchar c) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_strrchr(s, c); + return (i18n_uchar *) u_strrchr(s, c); } -i18n_uchar* i18n_ustring_r_char32 ( const i18n_uchar *s, i18n_uchar32 c ) +i18n_uchar *i18n_ustring_r_char32(const i18n_uchar *s, i18n_uchar32 c) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_strrchr32(s, c); + return (i18n_uchar *) u_strrchr32(s, c); } -i18n_uchar* i18n_ustring_pbrk ( const i18n_uchar *string, const i18n_uchar *match_set ) +i18n_uchar *i18n_ustring_pbrk(const i18n_uchar *string, const i18n_uchar *match_set) { - if(string == NULL || match_set == NULL) { + if (string == NULL || match_set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_strpbrk(string, match_set); + return (i18n_uchar *) u_strpbrk(string, match_set); } -int32_t i18n_ustring_cspn ( const i18n_uchar *string, const i18n_uchar *match_set ) +int32_t i18n_ustring_cspn(const i18n_uchar *string, const i18n_uchar *match_set) { - if(string == NULL || match_set == NULL) { + if (string == NULL || match_set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -183,9 +185,9 @@ int32_t i18n_ustring_cspn ( const i18n_uchar *string, const i18n_uchar *match_se return u_strcspn(string, match_set); } -int32_t i18n_ustring_spn ( const i18n_uchar *string, const i18n_uchar *match_set ) +int32_t i18n_ustring_spn(const i18n_uchar *string, const i18n_uchar *match_set) { - if(string == NULL || match_set == NULL) { + if (string == NULL || match_set == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -194,9 +196,10 @@ int32_t i18n_ustring_spn ( const i18n_uchar *string, const i18n_uchar *match_set return u_strspn(string, match_set); } -i18n_uchar* i18n_ustring_tokenizer_r ( i18n_uchar *src, const i18n_uchar *delim, i18n_uchar **save_state ) +i18n_uchar *i18n_ustring_tokenizer_r(i18n_uchar *src, const i18n_uchar *delim, + i18n_uchar ** save_state) { - if((src == NULL && save_state == NULL) || delim == NULL) { + if ((src == NULL && save_state == NULL) || delim == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -205,20 +208,20 @@ i18n_uchar* i18n_ustring_tokenizer_r ( i18n_uchar *src, const i18n_uchar *delim, return u_strtok_r(src, delim, save_state); } -int32_t i18n_ustring_compare ( const i18n_uchar *s1, const i18n_uchar *s2 ) +int32_t i18n_ustring_compare(const i18n_uchar *s1, const i18n_uchar *s2) { - if(s1 == NULL || s2 == NULL) { + if (s1 == NULL || s2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } set_last_result(I18N_ERROR_NONE); - return u_strcmp (s1, s2); + return u_strcmp(s1, s2); } -int32_t i18n_ustring_compare_code_point_order( const i18n_uchar *s1, const i18n_uchar *s2 ) +int32_t i18n_ustring_compare_code_point_order(const i18n_uchar *s1, const i18n_uchar *s2) { - if(s1 == NULL || s2 == NULL) { + if (s1 == NULL || s2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -227,18 +230,22 @@ int32_t i18n_ustring_compare_code_point_order( const i18n_uchar *s1, const i18n_ return u_strcmpCodePointOrder(s1, s2); } -int32_t i18n_ustring_compare_binary_order( const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, i18n_ubool code_point_order ) +int32_t i18n_ustring_compare_binary_order(const i18n_uchar *s1, int32_t length1, + const i18n_uchar *s2, int32_t length2, + i18n_ubool code_point_order) { - if(s1 == NULL || s2 == NULL) { + if (s1 == NULL || s2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } set_last_result(I18N_ERROR_NONE); - return u_strCompare(s1, length1, s2, length2, code_point_order); + return u_strCompare(s1, length1, s2, length2, code_point_order); } -int32_t i18n_ustring_case_compare_with_length( const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, uint32_t options, i18n_error_code_e *i18n_error ) +int32_t i18n_ustring_case_compare_with_length(const i18n_uchar *s1, int32_t length1, + const i18n_uchar *s2, int32_t length2, + uint32_t options, i18n_error_code_e *i18n_error) { UErrorCode icu_error = U_ZERO_ERROR; int32_t result = u_strCaseCompare(s1, length1, s2, length2, options, &icu_error); @@ -247,9 +254,9 @@ int32_t i18n_ustring_case_compare_with_length( const i18n_uchar *s1, int32_t len return result; } -int32_t i18n_ustring_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, int32_t n ) +int32_t i18n_ustring_compare_n(const i18n_uchar *s1, const i18n_uchar *s2, int32_t n) { - if(s1 == NULL || s2 == NULL) { + if (s1 == NULL || s2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -258,9 +265,10 @@ int32_t i18n_ustring_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, int3 return u_strncmp(s1, s2, n); } -int32_t i18n_ustring_compare_n_code_point_order( const i18n_uchar *s1, const i18n_uchar *s2, int32_t n ) +int32_t i18n_ustring_compare_n_code_point_order(const i18n_uchar *s1, const i18n_uchar *s2, + int32_t n) { - if(s1 == NULL || s2 == NULL) { + if (s1 == NULL || s2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -269,9 +277,9 @@ int32_t i18n_ustring_compare_n_code_point_order( const i18n_uchar *s1, const i18 return u_strncmpCodePointOrder(s1, s2, n); } -int32_t i18n_ustring_case_compare( const i18n_uchar *s1, const i18n_uchar *s2, uint32_t options ) +int32_t i18n_ustring_case_compare(const i18n_uchar *s1, const i18n_uchar *s2, uint32_t options) { - if(s1 == NULL || s2 == NULL) { + if (s1 == NULL || s2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -280,9 +288,10 @@ int32_t i18n_ustring_case_compare( const i18n_uchar *s1, const i18n_uchar *s2, u return u_strcasecmp(s1, s2, options); } -int32_t i18n_ustring_case_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, int32_t n, uint32_t options ) +int32_t i18n_ustring_case_compare_n(const i18n_uchar *s1, const i18n_uchar *s2, int32_t n, + uint32_t options) { - if(s1 == NULL || s2 == NULL) { + if (s1 == NULL || s2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -291,9 +300,10 @@ int32_t i18n_ustring_case_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, return u_strncasecmp(s1, s2, n, options); } -int32_t i18n_ustring_mem_case_compare( const i18n_uchar *s1, const i18n_uchar *s2, int32_t length, uint32_t options ) +int32_t i18n_ustring_mem_case_compare(const i18n_uchar *s1, const i18n_uchar *s2, int32_t length, + uint32_t options) { - if(s1 == NULL || s2 == NULL) { + if (s1 == NULL || s2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -302,9 +312,9 @@ int32_t i18n_ustring_mem_case_compare( const i18n_uchar *s1, const i18n_uchar *s return u_memcasecmp(s1, s2, length, options); } -i18n_uchar* i18n_ustring_copy ( i18n_uchar *dest, const i18n_uchar *src ) +i18n_uchar *i18n_ustring_copy(i18n_uchar *dest, const i18n_uchar *src) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -313,9 +323,9 @@ i18n_uchar* i18n_ustring_copy ( i18n_uchar *dest, const i18n_uchar *src ) return u_strcpy(dest, src); } -i18n_uchar* i18n_ustring_copy_n ( i18n_uchar *dest, const i18n_uchar *src, int32_t n ) +i18n_uchar *i18n_ustring_copy_n(i18n_uchar *dest, const i18n_uchar *src, int32_t n) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -324,9 +334,9 @@ i18n_uchar* i18n_ustring_copy_n ( i18n_uchar *dest, const i18n_uchar *src, int32 return u_strncpy(dest, src, n); } -i18n_uchar* i18n_ustring_copy_ua ( i18n_uchar *dest, const char *src ) +i18n_uchar *i18n_ustring_copy_ua(i18n_uchar *dest, const char *src) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -335,9 +345,9 @@ i18n_uchar* i18n_ustring_copy_ua ( i18n_uchar *dest, const char *src ) return u_uastrcpy(dest, src); } -i18n_uchar* i18n_ustring_copy_ua_n ( i18n_uchar *dest, const char *src, int32_t n ) +i18n_uchar *i18n_ustring_copy_ua_n(i18n_uchar *dest, const char *src, int32_t n) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -346,9 +356,9 @@ i18n_uchar* i18n_ustring_copy_ua_n ( i18n_uchar *dest, const char *src, int32_t return u_uastrncpy(dest, src, n); } -char* i18n_ustring_copy_au ( char *dest, const i18n_uchar *src ) +char *i18n_ustring_copy_au(char *dest, const i18n_uchar *src) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -357,9 +367,9 @@ char* i18n_ustring_copy_au ( char *dest, const i18n_uchar *src ) return u_austrcpy(dest, src); } -char* i18n_ustring_copy_au_n ( char *dest, const i18n_uchar *src, int32_t n ) +char *i18n_ustring_copy_au_n(char *dest, const i18n_uchar *src, int32_t n) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -368,9 +378,9 @@ char* i18n_ustring_copy_au_n ( char *dest, const i18n_uchar *src, int32_t n ) return u_austrncpy(dest, src, n); } -i18n_uchar* i18n_ustring_mem_copy ( i18n_uchar *dest, const i18n_uchar *src, int32_t count ) +i18n_uchar *i18n_ustring_mem_copy(i18n_uchar *dest, const i18n_uchar *src, int32_t count) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -379,9 +389,9 @@ i18n_uchar* i18n_ustring_mem_copy ( i18n_uchar *dest, const i18n_uchar *src, int return u_memcpy(dest, src, count); } -i18n_uchar* i18n_ustring_mem_move ( i18n_uchar *dest, const i18n_uchar *src, int32_t count ) +i18n_uchar *i18n_ustring_mem_move(i18n_uchar *dest, const i18n_uchar *src, int32_t count) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -390,9 +400,9 @@ i18n_uchar* i18n_ustring_mem_move ( i18n_uchar *dest, const i18n_uchar *src, int return u_memmove(dest, src, count); } -i18n_uchar* i18n_ustring_mem_set ( i18n_uchar *dest, const i18n_uchar c, int32_t count ) +i18n_uchar *i18n_ustring_mem_set(i18n_uchar *dest, const i18n_uchar c, int32_t count) { - if(dest == NULL) { + if (dest == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } @@ -401,9 +411,9 @@ i18n_uchar* i18n_ustring_mem_set ( i18n_uchar *dest, const i18n_uchar c, int32_t return u_memset(dest, c, count); } -int32_t i18n_ustring_mem_compare ( const i18n_uchar *buf1, const i18n_uchar *buf2, int32_t count ) +int32_t i18n_ustring_mem_compare(const i18n_uchar *buf1, const i18n_uchar *buf2, int32_t count) { - if(buf1 == NULL || buf2 == NULL) { + if (buf1 == NULL || buf2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -412,9 +422,10 @@ int32_t i18n_ustring_mem_compare ( const i18n_uchar *buf1, const i18n_uchar *buf return u_memcmp(buf1, buf2, count); } -int32_t i18n_ustring_mem_compare_code_point_order ( const i18n_uchar *s1, const i18n_uchar *s2, int32_t count ) +int32_t i18n_ustring_mem_compare_code_point_order(const i18n_uchar *s1, const i18n_uchar *s2, + int32_t count) { - if(s1 == NULL || s2 == NULL) { + if (s1 == NULL || s2 == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -423,53 +434,53 @@ int32_t i18n_ustring_mem_compare_code_point_order ( const i18n_uchar *s1, const return u_memcmpCodePointOrder(s1, s2, count); } -i18n_uchar* i18n_ustring_mem_char ( const i18n_uchar *s, i18n_uchar c, int32_t count ) +i18n_uchar *i18n_ustring_mem_char(const i18n_uchar *s, i18n_uchar c, int32_t count) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_memchr(s, c, count); + return (i18n_uchar *) u_memchr(s, c, count); } -i18n_uchar* i18n_ustring_mem_char32 ( const i18n_uchar *s, i18n_uchar32 c, int32_t count ) +i18n_uchar *i18n_ustring_mem_char32(const i18n_uchar *s, i18n_uchar32 c, int32_t count) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_memchr32(s, c, count); + return (i18n_uchar *) u_memchr32(s, c, count); } -i18n_uchar* i18n_ustring_mem_r_char ( const i18n_uchar *s, i18n_uchar c, int32_t count ) +i18n_uchar *i18n_ustring_mem_r_char(const i18n_uchar *s, i18n_uchar c, int32_t count) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_memrchr(s, c, count); + return (i18n_uchar *) u_memrchr(s, c, count); } -i18n_uchar* i18n_ustring_mem_r_char32 ( const i18n_uchar *s, i18n_uchar32 c, int32_t count ) +i18n_uchar *i18n_ustring_mem_r_char32(const i18n_uchar *s, i18n_uchar32 c, int32_t count) { - if(s == NULL) { + if (s == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return NULL; } set_last_result(I18N_ERROR_NONE); - return (i18n_uchar*)u_memrchr32(s, c, count); + return (i18n_uchar *) u_memrchr32(s, c, count); } -int32_t i18n_ustring_unescape ( const char *src, i18n_uchar *dest, int32_t dest_capacity ) +int32_t i18n_ustring_unescape(const char *src, i18n_uchar *dest, int32_t dest_capacity) { - if(dest == NULL || src == NULL) { + if (dest == NULL || src == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -478,9 +489,10 @@ int32_t i18n_ustring_unescape ( const char *src, i18n_uchar *dest, int32_t dest_ return u_unescape(src, dest, dest_capacity); } -i18n_uchar32 i18n_ustring_unescape_at ( i18n_ustring_unescape_char_at_cb char_at, int32_t *offset, int32_t length, void *context ) +i18n_uchar32 i18n_ustring_unescape_at(i18n_ustring_unescape_char_at_cb char_at, int32_t *offset, + int32_t length, void *context) { - if(char_at == NULL || offset == NULL) { + if (char_at == NULL || offset == NULL) { set_last_result(I18N_ERROR_INVALID_PARAMETER); return 0; } @@ -489,217 +501,257 @@ i18n_uchar32 i18n_ustring_unescape_at ( i18n_ustring_unescape_char_at_cb char_at return u_unescapeAt(char_at, offset, length, context); } -int32_t i18n_ustring_to_upper ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *i18n_error ) +int32_t i18n_ustring_to_upper(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, + int32_t src_len, const char *locale, i18n_error_code_e *i18n_error) { - UErrorCode icu_error = U_ZERO_ERROR; - int32_t result = u_strToUpper (dest, dest_capacity, src, src_len, locale, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + int32_t result = u_strToUpper(dest, dest_capacity, src, src_len, locale, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -int32_t i18n_ustring_to_lower ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *i18n_error ) +int32_t i18n_ustring_to_lower(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, + int32_t src_len, const char *locale, i18n_error_code_e *i18n_error) { - UErrorCode icu_error = U_ZERO_ERROR; - int32_t result = u_strToLower (dest, dest_capacity, src, src_len, locale, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + int32_t result = u_strToLower(dest, dest_capacity, src, src_len, locale, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -int32_t i18n_ustring_to_title ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, i18n_ubreak_iterator_s *title_iter, - const char *locale, i18n_error_code_e *i18n_error ) +int32_t i18n_ustring_to_title(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, + int32_t src_len, i18n_ubreak_iterator_s *title_iter, + const char *locale, i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return 0; } UErrorCode icu_error = U_ZERO_ERROR; - int32_t result = u_strToTitle (dest, dest_capacity, src, src_len, (UBreakIterator*)title_iter, locale, &icu_error); + int32_t result = + u_strToTitle(dest, dest_capacity, src, src_len, (UBreakIterator *) title_iter, locale, + &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -int32_t i18n_ustring_to_title_new ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, - int32_t src_len, i18n_ubreak_iterator_h title_iter, const char *locale) +int32_t i18n_ustring_to_title_new(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, + int32_t src_len, i18n_ubreak_iterator_h title_iter, + const char *locale) { UErrorCode err = U_ZERO_ERROR; - int32_t result = u_strToTitle (dest, dest_capacity, src, src_len, (UBreakIterator*)title_iter, locale, &err); + int32_t result = + u_strToTitle(dest, dest_capacity, src, src_len, (UBreakIterator *) title_iter, locale, + &err); set_last_result(_i18n_error_mapping(err)); return result; } -int32_t i18n_ustring_fold_case ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, uint32_t options, i18n_error_code_e *i18n_error ) +int32_t i18n_ustring_fold_case(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, + int32_t src_len, uint32_t options, i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return 0; } - UErrorCode icu_error = U_ZERO_ERROR; - int32_t result =u_strFoldCase (dest, dest_capacity, src, src_len, options, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + int32_t result = u_strFoldCase(dest, dest_capacity, src, src_len, options, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); I18N_ERR(*i18n_error); return result; } -wchar_t* i18n_ustring_to_WCS ( wchar_t *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *i18n_error ) +wchar_t *i18n_ustring_to_WCS(wchar_t *dest, int32_t dest_capacity, int32_t *dest_len, + const i18n_uchar *src, int32_t src_len, + i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } - UErrorCode icu_error = U_ZERO_ERROR; - wchar_t* result = u_strToWCS (dest, dest_capacity, dest_len, src, src_len, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + wchar_t *result = u_strToWCS(dest, dest_capacity, dest_len, src, src_len, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -i18n_uchar* i18n_ustring_from_WCS ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const wchar_t *src, int32_t src_len, i18n_error_code_e *i18n_error ) +i18n_uchar *i18n_ustring_from_WCS(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, + const wchar_t *src, int32_t src_len, + i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } - UErrorCode icu_error = U_ZERO_ERROR; - i18n_uchar* result = u_strFromWCS (dest, dest_capacity, dest_len, src, src_len, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + i18n_uchar *result = u_strFromWCS(dest, dest_capacity, dest_len, src, src_len, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -char* i18n_ustring_to_UTF8 ( char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *i18n_error ) +char *i18n_ustring_to_UTF8(char *dest, int32_t dest_capacity, int32_t *dest_len, + const i18n_uchar *src, int32_t src_len, i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } - UErrorCode icu_error = U_ZERO_ERROR; - char* result = u_strToUTF8 (dest, dest_capacity, dest_len, src, src_len, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + char *result = u_strToUTF8(dest, dest_capacity, dest_len, src, src_len, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -i18n_uchar* i18n_ustring_from_UTF8 ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *i18n_error ) +i18n_uchar *i18n_ustring_from_UTF8(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, + const char *src, int32_t src_len, i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } - UErrorCode icu_error = U_ZERO_ERROR; - i18n_uchar* result = u_strFromUTF8 (dest, dest_capacity, dest_len, src, src_len, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + i18n_uchar *result = u_strFromUTF8(dest, dest_capacity, dest_len, src, src_len, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -char* i18n_ustring_to_UTF8_with_sub ( char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *i18n_error ) +char *i18n_ustring_to_UTF8_with_sub(char *dest, int32_t dest_capacity, int32_t *dest_len, + const i18n_uchar *src, int32_t src_len, i18n_uchar32 sub_char, + int32_t *num_substitutions, i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } UErrorCode icu_error = U_ZERO_ERROR; - char* result = u_strToUTF8WithSub (dest, dest_capacity, dest_len, src, src_len, sub_char, num_substitutions, &icu_error); + char *result = + u_strToUTF8WithSub(dest, dest_capacity, dest_len, src, src_len, sub_char, num_substitutions, + &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -i18n_uchar* i18n_ustring_from_UTF8_with_sub ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_uchar32 sub_char, - int32_t *num_substitutions, i18n_error_code_e *i18n_error ) +i18n_uchar *i18n_ustring_from_UTF8_with_sub(i18n_uchar *dest, int32_t dest_capacity, + int32_t *dest_len, const char *src, int32_t src_len, + i18n_uchar32 sub_char, int32_t *num_substitutions, + i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } - UErrorCode icu_error = U_ZERO_ERROR; - i18n_uchar* result = u_strFromUTF8WithSub (dest, dest_capacity, dest_len, src, src_len, sub_char, num_substitutions, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + i18n_uchar *result = + u_strFromUTF8WithSub(dest, dest_capacity, dest_len, src, src_len, sub_char, + num_substitutions, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -i18n_uchar* i18n_ustring_from_UTF8_lenient ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *i18n_error ) +i18n_uchar *i18n_ustring_from_UTF8_lenient(i18n_uchar *dest, int32_t dest_capacity, + int32_t *dest_len, const char *src, int32_t src_len, + i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } - UErrorCode icu_error = U_ZERO_ERROR; - i18n_uchar* result = u_strFromUTF8Lenient (dest, dest_capacity, dest_len, src, src_len, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + i18n_uchar *result = + u_strFromUTF8Lenient(dest, dest_capacity, dest_len, src, src_len, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -i18n_uchar32* i18n_ustring_to_UTF32 ( i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *i18n_error ) +i18n_uchar32 *i18n_ustring_to_UTF32(i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, + const i18n_uchar *src, int32_t src_len, + i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } - UErrorCode icu_error = U_ZERO_ERROR; - i18n_uchar32* result = u_strToUTF32 (dest, dest_capacity, dest_len, src, src_len, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + i18n_uchar32 *result = u_strToUTF32(dest, dest_capacity, dest_len, src, src_len, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -i18n_uchar* i18n_ustring_from_UTF32 ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_error_code_e *i18n_error ) +i18n_uchar *i18n_ustring_from_UTF32(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, + const i18n_uchar32 *src, int32_t src_len, + i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } - UErrorCode icu_error = U_ZERO_ERROR; - i18n_uchar* result = u_strFromUTF32 (dest, dest_capacity, dest_len, src, src_len, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + i18n_uchar *result = u_strFromUTF32(dest, dest_capacity, dest_len, src, src_len, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -i18n_uchar32* i18n_ustring_to_UTF32_with_sub ( i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, - i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *i18n_error ) +i18n_uchar32 *i18n_ustring_to_UTF32_with_sub(i18n_uchar32 *dest, int32_t dest_capacity, + int32_t *dest_len, const i18n_uchar *src, + int32_t src_len, i18n_uchar32 sub_char, + int32_t *num_substitutions, + i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } - UErrorCode icu_error = U_ZERO_ERROR; - i18n_uchar32* result = u_strToUTF32WithSub (dest, dest_capacity, dest_len, src, src_len, sub_char, num_substitutions, &icu_error); + UErrorCode icu_error = U_ZERO_ERROR; + i18n_uchar32 *result = + u_strToUTF32WithSub(dest, dest_capacity, dest_len, src, src_len, sub_char, + num_substitutions, &icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } -i18n_uchar* i18n_ustring_from_UTF32_with_sub ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *i18n_error ) +i18n_uchar *i18n_ustring_from_UTF32_with_sub(i18n_uchar *dest, int32_t dest_capacity, + int32_t *dest_len, const i18n_uchar32 *src, + int32_t src_len, i18n_uchar32 sub_char, + int32_t *num_substitutions, + i18n_error_code_e *i18n_error) { - if(src == NULL) { + if (src == NULL) { *i18n_error = I18N_ERROR_INVALID_PARAMETER; return NULL; } UErrorCode icu_error = U_ZERO_ERROR; - i18n_uchar* result = u_strFromUTF32WithSub (dest, dest_capacity, dest_len, src, src_len, sub_char, num_substitutions, (UErrorCode*)&icu_error); + i18n_uchar *result = + u_strFromUTF32WithSub(dest, dest_capacity, dest_len, src, src_len, sub_char, + num_substitutions, (UErrorCode *) & icu_error); *i18n_error = _i18n_error_mapping(icu_error); return result; } - -- 2.7.4 From bc39b97e4eb5f121b81cdb58ea04a195ed24800f Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Fri, 18 Dec 2015 12:04:09 +0900 Subject: [PATCH 04/16] Update version - 1.1.0 Change-Id: Ibcc97f9f565fdfefaccd20ade33b48229cfe0e79 --- packaging/capi-base-utils.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-base-utils.spec b/packaging/capi-base-utils.spec index ae1b44c..2d1ffa4 100755 --- a/packaging/capi-base-utils.spec +++ b/packaging/capi-base-utils.spec @@ -1,6 +1,6 @@ Name: capi-base-utils Summary: Base Utils -Version: 1.0.8 +Version: 1.1.0 Release: 1 Group: Base License: Apache-2.0 and ICU -- 2.7.4 From bb9cff5cf94fd40076436b5a6ccbedce5ba94fc4 Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Fri, 18 Dec 2015 14:34:44 +0900 Subject: [PATCH 05/16] Deprecated parameters stack_buffer and p_buffer_size of i18n_ubrk_safe_clone() Change-Id: I04a44c06a3c8cc8c215de0c206eee1568fccb116 --- src/include/mobile/utils_i18n_ubrk.h | 4 ++-- src/include/wearable/utils_i18n_ubrk.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/mobile/utils_i18n_ubrk.h b/src/include/mobile/utils_i18n_ubrk.h index e755473..23cf7aa 100755 --- a/src/include/mobile/utils_i18n_ubrk.h +++ b/src/include/mobile/utils_i18n_ubrk.h @@ -95,10 +95,10 @@ int i18n_ubrk_create_rules (const i18n_uchar *rules, int32_t rules_length, const * @remarks Error codes are described in #i18n_error_code_e description. * @since_tizen 2.3.1 * @param[in] break_iter iterator to be cloned. Must not be @c NULL. - * @param[in] stack_buffer User allocated space for the new clone. If @c NULL new memory will be allocated. + * @param[in] stack_buffer (Deprecated Since 3.0. Use NULL instead.) User allocated space for the new clone. If @c NULL new memory will be allocated. * If buffer is not large enough, new memory will be allocated. * Clients can use the #I18N_U_BRK_SAFECLONE_BUFFERSIZE. This will probably be enough to avoid memory allocations. - * @param[in] p_buffer_size A pointer to size of allocated space. + * @param[in] p_buffer_size (Deprecated Since 3.0. Use NULL instead.) A pointer to size of allocated space. * If *p_buffer_size == 0, a sufficient size for use in cloning will * be returned ('pre-flighting') * If *p_buffer_size is not enough for a stack-based safe clone, diff --git a/src/include/wearable/utils_i18n_ubrk.h b/src/include/wearable/utils_i18n_ubrk.h index e755473..23cf7aa 100755 --- a/src/include/wearable/utils_i18n_ubrk.h +++ b/src/include/wearable/utils_i18n_ubrk.h @@ -95,10 +95,10 @@ int i18n_ubrk_create_rules (const i18n_uchar *rules, int32_t rules_length, const * @remarks Error codes are described in #i18n_error_code_e description. * @since_tizen 2.3.1 * @param[in] break_iter iterator to be cloned. Must not be @c NULL. - * @param[in] stack_buffer User allocated space for the new clone. If @c NULL new memory will be allocated. + * @param[in] stack_buffer (Deprecated Since 3.0. Use NULL instead.) User allocated space for the new clone. If @c NULL new memory will be allocated. * If buffer is not large enough, new memory will be allocated. * Clients can use the #I18N_U_BRK_SAFECLONE_BUFFERSIZE. This will probably be enough to avoid memory allocations. - * @param[in] p_buffer_size A pointer to size of allocated space. + * @param[in] p_buffer_size (Deprecated Since 3.0. Use NULL instead.) A pointer to size of allocated space. * If *p_buffer_size == 0, a sufficient size for use in cloning will * be returned ('pre-flighting') * If *p_buffer_size is not enough for a stack-based safe clone, -- 2.7.4 From cec4de23edd838c307fd41db42fb7f2e20b7f8c8 Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Mon, 28 Dec 2015 18:41:59 +0900 Subject: [PATCH 06/16] Update version - 1.1.1 Change-Id: Ic18767c84edb2867feedd29d0d23fe530d567586 --- packaging/capi-base-utils.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-base-utils.spec b/packaging/capi-base-utils.spec index 2d1ffa4..388694a 100755 --- a/packaging/capi-base-utils.spec +++ b/packaging/capi-base-utils.spec @@ -1,6 +1,6 @@ Name: capi-base-utils Summary: Base Utils -Version: 1.1.0 +Version: 1.1.1 Release: 1 Group: Base License: Apache-2.0 and ICU -- 2.7.4 From c53db5fbd898bbc3a89a6262b0e8d17150e642b3 Mon Sep 17 00:00:00 2001 From: Radoslaw Czerski Date: Mon, 28 Dec 2015 10:45:17 +0100 Subject: [PATCH 07/16] Coding style fixed. utils_i18n_private.c Change-Id: If1860a6444b75d7a565df9bad6fd301d0118ae49 Signed-off-by: Radoslaw Czerski --- src/utils_i18n_private.c | 282 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 211 insertions(+), 71 deletions(-) diff --git a/src/utils_i18n_private.c b/src/utils_i18n_private.c index 13e93d4..1df4b56 100755 --- a/src/utils_i18n_private.c +++ b/src/utils_i18n_private.c @@ -26,82 +26,222 @@ int _i18n_error_mapping(int err) return I18N_ERROR_NONE; switch (err) { - case U_ILLEGAL_ARGUMENT_ERROR : return I18N_ERROR_INVALID_PARAMETER; - case U_MISSING_RESOURCE_ERROR : return I18N_ERROR_MISSING_RESOURCE; - case U_INVALID_FORMAT_ERROR : return I18N_ERROR_INVALID_FORMAT; - case U_FILE_ACCESS_ERROR : return I18N_ERROR_FILE_ACCESS; - case U_INTERNAL_PROGRAM_ERROR : return I18N_ERROR_INTERNAL_PROGRAM; - case U_MESSAGE_PARSE_ERROR : return I18N_ERROR_MESSAGE_PARSE; - case U_MEMORY_ALLOCATION_ERROR : return I18N_ERROR_OUT_OF_MEMORY; - case U_INDEX_OUTOFBOUNDS_ERROR : return I18N_ERROR_INDEX_OUTOFBOUNDS; - case U_PARSE_ERROR : return I18N_ERROR_PARSE; - case U_INVALID_CHAR_FOUND : return I18N_ERROR_INVALID_CHAR_FOUND; - case U_TRUNCATED_CHAR_FOUND : return I18N_ERROR_TRUNCATED_CHAR_FOUND; - case U_ILLEGAL_CHAR_FOUND : return I18N_ERROR_ILLEGAL_CHAR_FOUND; - case U_INVALID_TABLE_FORMAT : return I18N_ERROR_INVALID_TABLE_FORMAT; - case U_INVALID_TABLE_FILE : return I18N_ERROR_INVALID_TABLE_FILE; - case U_BUFFER_OVERFLOW_ERROR : return I18N_ERROR_BUFFER_OVERFLOW; - case U_UNSUPPORTED_ERROR : return I18N_ERROR_NOT_SUPPORTED; - case U_RESOURCE_TYPE_MISMATCH : return I18N_ERROR_RESOURCE_TYPE_MISMATCH; - case U_ILLEGAL_ESCAPE_SEQUENCE : return I18N_ERROR_ILLECAL_ESCAPE_SEQUENCE; - case U_UNSUPPORTED_ESCAPE_SEQUENCE : return I18N_ERROR_UNSUPPORTED_ESCAPE_SEQUENCE; - case U_NO_SPACE_AVAILABLE : return I18N_ERROR_NO_SPACE_AVAILABLE; - case U_CE_NOT_FOUND_ERROR : return I18N_ERROR_CE_NOT_FOUND; - case U_PRIMARY_TOO_LONG_ERROR : return I18N_ERROR_PRIMARY_TOO_LONG; - case U_STATE_TOO_OLD_ERROR : return I18N_ERROR_STATE_TOO_OLD; - case U_TOO_MANY_ALIASES_ERROR : return I18N_ERROR_TOO_MANY_ALIASES; - case U_ENUM_OUT_OF_SYNC_ERROR : return I18N_ERROR_ENUM_OUT_OF_SYNC; - case U_INVARIANT_CONVERSION_ERROR : return I18N_ERROR_INVARIANT_CONVERSION; - case U_INVALID_STATE_ERROR : return I18N_ERROR_INVALID_STATE; - case U_COLLATOR_VERSION_MISMATCH : return I18N_ERROR_COLLATOR_VERSION_MISMATCH; - case U_USELESS_COLLATOR_ERROR : return I18N_ERROR_USELESS_COLLATOR; - case U_NO_WRITE_PERMISSION : return I18N_ERROR_NO_WRITE_PERMISSION; - case U_MALFORMED_SET : return I18N_ERROR_MALFORMED_SET; - case U_IDNA_STD3_ASCII_RULES_ERROR : return I18N_ERROR_STD3_ASCII_RULES; - case U_IDNA_UNASSIGNED_ERROR : return I18N_ERROR_UNASSIGNED; - default : return I18N_ERROR_UNKNOWN; + case U_ILLEGAL_ARGUMENT_ERROR: + return I18N_ERROR_INVALID_PARAMETER; + + case U_MISSING_RESOURCE_ERROR: + return I18N_ERROR_MISSING_RESOURCE; + + case U_INVALID_FORMAT_ERROR: + return I18N_ERROR_INVALID_FORMAT; + + case U_FILE_ACCESS_ERROR: + return I18N_ERROR_FILE_ACCESS; + + case U_INTERNAL_PROGRAM_ERROR: + return I18N_ERROR_INTERNAL_PROGRAM; + + case U_MESSAGE_PARSE_ERROR: + return I18N_ERROR_MESSAGE_PARSE; + + case U_MEMORY_ALLOCATION_ERROR: + return I18N_ERROR_OUT_OF_MEMORY; + + case U_INDEX_OUTOFBOUNDS_ERROR: + return I18N_ERROR_INDEX_OUTOFBOUNDS; + + case U_PARSE_ERROR: + return I18N_ERROR_PARSE; + + case U_INVALID_CHAR_FOUND: + return I18N_ERROR_INVALID_CHAR_FOUND; + + case U_TRUNCATED_CHAR_FOUND: + return I18N_ERROR_TRUNCATED_CHAR_FOUND; + + case U_ILLEGAL_CHAR_FOUND: + return I18N_ERROR_ILLEGAL_CHAR_FOUND; + + case U_INVALID_TABLE_FORMAT: + return I18N_ERROR_INVALID_TABLE_FORMAT; + + case U_INVALID_TABLE_FILE: + return I18N_ERROR_INVALID_TABLE_FILE; + + case U_BUFFER_OVERFLOW_ERROR: + return I18N_ERROR_BUFFER_OVERFLOW; + + case U_UNSUPPORTED_ERROR: + return I18N_ERROR_NOT_SUPPORTED; + + case U_RESOURCE_TYPE_MISMATCH: + return I18N_ERROR_RESOURCE_TYPE_MISMATCH; + + case U_ILLEGAL_ESCAPE_SEQUENCE: + return I18N_ERROR_ILLECAL_ESCAPE_SEQUENCE; + + case U_UNSUPPORTED_ESCAPE_SEQUENCE: + return I18N_ERROR_UNSUPPORTED_ESCAPE_SEQUENCE; + + case U_NO_SPACE_AVAILABLE: + return I18N_ERROR_NO_SPACE_AVAILABLE; + + case U_CE_NOT_FOUND_ERROR: + return I18N_ERROR_CE_NOT_FOUND; + + case U_PRIMARY_TOO_LONG_ERROR: + return I18N_ERROR_PRIMARY_TOO_LONG; + + case U_STATE_TOO_OLD_ERROR: + return I18N_ERROR_STATE_TOO_OLD; + + case U_TOO_MANY_ALIASES_ERROR: + return I18N_ERROR_TOO_MANY_ALIASES; + + case U_ENUM_OUT_OF_SYNC_ERROR: + return I18N_ERROR_ENUM_OUT_OF_SYNC; + + case U_INVARIANT_CONVERSION_ERROR: + return I18N_ERROR_INVARIANT_CONVERSION; + + case U_INVALID_STATE_ERROR: + return I18N_ERROR_INVALID_STATE; + + case U_COLLATOR_VERSION_MISMATCH: + return I18N_ERROR_COLLATOR_VERSION_MISMATCH; + + case U_USELESS_COLLATOR_ERROR: + return I18N_ERROR_USELESS_COLLATOR; + + case U_NO_WRITE_PERMISSION: + return I18N_ERROR_NO_WRITE_PERMISSION; + + case U_MALFORMED_SET: + return I18N_ERROR_MALFORMED_SET; + + case U_IDNA_STD3_ASCII_RULES_ERROR: + return I18N_ERROR_STD3_ASCII_RULES; + + case U_IDNA_UNASSIGNED_ERROR: + return I18N_ERROR_UNASSIGNED; + + default: + return I18N_ERROR_UNKNOWN; } } int _i18n_error_mapping_reverse(int err) { switch (err) { - case I18N_ERROR_NONE : return U_ZERO_ERROR; - case I18N_ERROR_INVALID_PARAMETER : return U_ILLEGAL_ARGUMENT_ERROR; - case I18N_ERROR_MISSING_RESOURCE : return U_MISSING_RESOURCE_ERROR; - case I18N_ERROR_INVALID_FORMAT : return U_INVALID_FORMAT_ERROR; - case I18N_ERROR_FILE_ACCESS : return U_FILE_ACCESS_ERROR; - case I18N_ERROR_INTERNAL_PROGRAM : return U_INTERNAL_PROGRAM_ERROR; - case I18N_ERROR_MESSAGE_PARSE : return U_MESSAGE_PARSE_ERROR; - case I18N_ERROR_OUT_OF_MEMORY : return U_MEMORY_ALLOCATION_ERROR; - case I18N_ERROR_INDEX_OUTOFBOUNDS : return U_INDEX_OUTOFBOUNDS_ERROR; - case I18N_ERROR_PARSE : return U_PARSE_ERROR; - case I18N_ERROR_INVALID_CHAR_FOUND : return U_INVALID_CHAR_FOUND; - case I18N_ERROR_TRUNCATED_CHAR_FOUND : return U_TRUNCATED_CHAR_FOUND; - case I18N_ERROR_ILLEGAL_CHAR_FOUND : return U_ILLEGAL_CHAR_FOUND; - case I18N_ERROR_INVALID_TABLE_FORMAT : return U_INVALID_TABLE_FORMAT; - case I18N_ERROR_INVALID_TABLE_FILE : return U_INVALID_TABLE_FILE; - case I18N_ERROR_BUFFER_OVERFLOW : return U_BUFFER_OVERFLOW_ERROR; - case I18N_ERROR_NOT_SUPPORTED : return U_UNSUPPORTED_ERROR; - case I18N_ERROR_RESOURCE_TYPE_MISMATCH : return U_RESOURCE_TYPE_MISMATCH; - case I18N_ERROR_ILLECAL_ESCAPE_SEQUENCE : return U_ILLEGAL_ESCAPE_SEQUENCE; - case I18N_ERROR_UNSUPPORTED_ESCAPE_SEQUENCE : return U_UNSUPPORTED_ESCAPE_SEQUENCE; - case I18N_ERROR_NO_SPACE_AVAILABLE : return U_NO_SPACE_AVAILABLE; - case I18N_ERROR_CE_NOT_FOUND : return U_CE_NOT_FOUND_ERROR; - case I18N_ERROR_PRIMARY_TOO_LONG : return U_PRIMARY_TOO_LONG_ERROR; - case I18N_ERROR_STATE_TOO_OLD : return U_STATE_TOO_OLD_ERROR; - case I18N_ERROR_TOO_MANY_ALIASES : return U_TOO_MANY_ALIASES_ERROR; - case I18N_ERROR_ENUM_OUT_OF_SYNC : return U_ENUM_OUT_OF_SYNC_ERROR; - case I18N_ERROR_INVARIANT_CONVERSION : return U_INVARIANT_CONVERSION_ERROR; - case I18N_ERROR_INVALID_STATE : return U_INVALID_STATE_ERROR; - case I18N_ERROR_COLLATOR_VERSION_MISMATCH : return U_COLLATOR_VERSION_MISMATCH; - case I18N_ERROR_USELESS_COLLATOR : return U_USELESS_COLLATOR_ERROR; - case I18N_ERROR_NO_WRITE_PERMISSION : return U_NO_WRITE_PERMISSION; - case I18N_ERROR_MALFORMED_SET : return U_MALFORMED_SET; - case I18N_ERROR_STD3_ASCII_RULES : return U_IDNA_STD3_ASCII_RULES_ERROR; - case I18N_WARNING_STRING_NOT_TERMINATED : return U_STRING_NOT_TERMINATED_WARNING; - case I18N_ERROR_UNASSIGNED : return U_IDNA_UNASSIGNED_ERROR; - case I18N_WARNING_SORT_KEY_TOO_SHORT : return U_SORT_KEY_TOO_SHORT_WARNING; - default : return U_STANDARD_ERROR_LIMIT; + case I18N_ERROR_NONE: + return U_ZERO_ERROR; + + case I18N_ERROR_INVALID_PARAMETER: + return U_ILLEGAL_ARGUMENT_ERROR; + + case I18N_ERROR_MISSING_RESOURCE: + return U_MISSING_RESOURCE_ERROR; + + case I18N_ERROR_INVALID_FORMAT: + return U_INVALID_FORMAT_ERROR; + + case I18N_ERROR_FILE_ACCESS: + return U_FILE_ACCESS_ERROR; + + case I18N_ERROR_INTERNAL_PROGRAM: + return U_INTERNAL_PROGRAM_ERROR; + + case I18N_ERROR_MESSAGE_PARSE: + return U_MESSAGE_PARSE_ERROR; + + case I18N_ERROR_OUT_OF_MEMORY: + return U_MEMORY_ALLOCATION_ERROR; + + case I18N_ERROR_INDEX_OUTOFBOUNDS: + return U_INDEX_OUTOFBOUNDS_ERROR; + + case I18N_ERROR_PARSE: + return U_PARSE_ERROR; + + case I18N_ERROR_INVALID_CHAR_FOUND: + return U_INVALID_CHAR_FOUND; + + case I18N_ERROR_TRUNCATED_CHAR_FOUND: + return U_TRUNCATED_CHAR_FOUND; + + case I18N_ERROR_ILLEGAL_CHAR_FOUND: + return U_ILLEGAL_CHAR_FOUND; + + case I18N_ERROR_INVALID_TABLE_FORMAT: + return U_INVALID_TABLE_FORMAT; + + case I18N_ERROR_INVALID_TABLE_FILE: + return U_INVALID_TABLE_FILE; + + case I18N_ERROR_BUFFER_OVERFLOW: + return U_BUFFER_OVERFLOW_ERROR; + + case I18N_ERROR_NOT_SUPPORTED: + return U_UNSUPPORTED_ERROR; + + case I18N_ERROR_RESOURCE_TYPE_MISMATCH: + return U_RESOURCE_TYPE_MISMATCH; + + case I18N_ERROR_ILLECAL_ESCAPE_SEQUENCE: + return U_ILLEGAL_ESCAPE_SEQUENCE; + + case I18N_ERROR_UNSUPPORTED_ESCAPE_SEQUENCE: + return U_UNSUPPORTED_ESCAPE_SEQUENCE; + + case I18N_ERROR_NO_SPACE_AVAILABLE: + return U_NO_SPACE_AVAILABLE; + + case I18N_ERROR_CE_NOT_FOUND: + return U_CE_NOT_FOUND_ERROR; + + case I18N_ERROR_PRIMARY_TOO_LONG: + return U_PRIMARY_TOO_LONG_ERROR; + + case I18N_ERROR_STATE_TOO_OLD: + return U_STATE_TOO_OLD_ERROR; + + case I18N_ERROR_TOO_MANY_ALIASES: + return U_TOO_MANY_ALIASES_ERROR; + + case I18N_ERROR_ENUM_OUT_OF_SYNC: + return U_ENUM_OUT_OF_SYNC_ERROR; + + case I18N_ERROR_INVARIANT_CONVERSION: + return U_INVARIANT_CONVERSION_ERROR; + + case I18N_ERROR_INVALID_STATE: + return U_INVALID_STATE_ERROR; + + case I18N_ERROR_COLLATOR_VERSION_MISMATCH: + return U_COLLATOR_VERSION_MISMATCH; + + case I18N_ERROR_USELESS_COLLATOR: + return U_USELESS_COLLATOR_ERROR; + + case I18N_ERROR_NO_WRITE_PERMISSION: + return U_NO_WRITE_PERMISSION; + + case I18N_ERROR_MALFORMED_SET: + return U_MALFORMED_SET; + + case I18N_ERROR_STD3_ASCII_RULES: + return U_IDNA_STD3_ASCII_RULES_ERROR; + + case I18N_WARNING_STRING_NOT_TERMINATED: + return U_STRING_NOT_TERMINATED_WARNING; + + case I18N_ERROR_UNASSIGNED: + return U_IDNA_UNASSIGNED_ERROR; + + case I18N_WARNING_SORT_KEY_TOO_SHORT: + return U_SORT_KEY_TOO_SHORT_WARNING; + + default: + return U_STANDARD_ERROR_LIMIT; } } -- 2.7.4 From b46eca9c1a2517e912665849e766e2575c45c6a3 Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Wed, 30 Dec 2015 16:17:19 +0900 Subject: [PATCH 08/16] Modify information in pc file Change-Id: I02ede8cc0b0a8da481d83dea6ade688b045eef31 --- src/capi-base-utils-i18n.pc.in | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/capi-base-utils-i18n.pc.in b/src/capi-base-utils-i18n.pc.in index 70dadc8..ceccb35 100644 --- a/src/capi-base-utils-i18n.pc.in +++ b/src/capi-base-utils-i18n.pc.in @@ -1,13 +1,11 @@ # Package Information for pkg-config -prefix=/usr -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include/base +libdir=@LIB_INSTALL_DIR@ +includedir=@INCLUDE_INSTALL_DIR@ Name: base-utils -Description: base-utils +Description: The base utils library for internationalization and localization Version: @VERSION@ Requires: @PC_REQUIRED@ Libs: -L${libdir} -lbase-utils-i18n -Cflags: -I${includedir} +Cflags: -I${includedir}/base -- 2.7.4 From c8b156313b2f05ab32a7640bb57ac3a9accefc75 Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Fri, 8 Jan 2016 11:06:58 +0900 Subject: [PATCH 09/16] sync test Change-Id: I13e3179230ae89f481a71b963c0df67682e28612 --- src/utils_i18n_ubrk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils_i18n_ubrk.c b/src/utils_i18n_ubrk.c index cefa08b..ee514b7 100644 --- a/src/utils_i18n_ubrk.c +++ b/src/utils_i18n_ubrk.c @@ -18,6 +18,7 @@ #include #include + int i18n_ubrk_create(i18n_ubreak_iterator_type_e type, const char *locale, const i18n_uchar *text, int32_t text_length, i18n_ubreak_iterator_h *break_iter) { -- 2.7.4 From 5ee050f3270e5fcf9bc6c1e308636ebfda7b7d43 Mon Sep 17 00:00:00 2001 From: Radoslaw Czerski Date: Wed, 27 Jan 2016 11:20:46 +0100 Subject: [PATCH 10/16] [i18n] Update regarding ICU version change 51.1 -> 54.1 Change-Id: I224273cf60ff07575928fd4f914c32ff0c625511 Signed-off-by: Radoslaw Czerski --- src/include/mobile/utils_i18n_types.h | 509 ++++++++++++++++++++++++++++-- src/include/mobile/utils_i18n_ubrk.h | 7 +- src/include/mobile/utils_i18n_ucollator.h | 9 +- src/include/mobile/utils_i18n_udatepg.h | 3 +- src/include/mobile/utils_i18n_ulocale.h | 58 +++- src/include/mobile/utils_i18n_unumber.h | 6 +- src/include/mobile/utils_i18n_ustring.h | 36 +-- src/utils_i18n_unumber.c | 4 + 8 files changed, 570 insertions(+), 62 deletions(-) diff --git a/src/include/mobile/utils_i18n_types.h b/src/include/mobile/utils_i18n_types.h index cf2dde8..a96cbed 100644 --- a/src/include/mobile/utils_i18n_types.h +++ b/src/include/mobile/utils_i18n_types.h @@ -240,9 +240,9 @@ typedef enum { 0-9 A-F a-f */ I18N_UCHAR_BIDI_CONTROL, - /**< Binary property Bidi_Control. \n - Format controls which have specific functions in the Bidi Algorithm. - */ + /**< Binary property Bidi_Control. \n + Format controls which have specific functions in the Bidi Algorithm. + */ I18N_UCHAR_BIDI_MIRRORED, /**< Binary property Bidi_Mirrored. \n Characters that may change display in RTL text. See Bidi Algorithm, UTR 9. @@ -524,7 +524,9 @@ typedef enum { Returns #i18n_uchar_u_word_break_values_e values. */ I18N_UCHAR_BIDI_PAIRED_BRACKET_TYPE, - /**< Unsupported yet. Please do not use. */ + /**< Enumerated property Bidi_Paired_Bracket_Type. \n + Returns #i18n_uchar_u_bidi_paired_bracket_type_e values . + */ I18N_UCHAR_INT_LIMIT, /**< One more than the last constant for enumerated/integer Unicode properties. */ I18N_UCHAR_GENERAL_CATEGORY_MASK = 0x2000, @@ -565,8 +567,8 @@ typedef enum { /**< String property Titlecase_Mapping. */ I18N_UCHAR_UPPERCASE_MAPPING = 0x400C, /**< String property Uppercase_Mapping. */ - I18N_UCHAR_BIDI_PAIRED_BRACKET, - /**< Unsupported yet. Please do not use. */ + I18N_UCHAR_BIDI_PAIRED_BRACKET = 0x400D, + /**< String property Bidi_Paired_Bracket. */ I18N_UCHAR_STRING_LIMIT, /**< One more than the last constant for string Unicode properties. */ I18N_UCHAR_SCRIPT_EXTENSIONS = 0x7000, @@ -580,6 +582,22 @@ typedef enum { } i18n_uchar_uproperty_e; /** + * @brief Bidi Paired Bracket Type constants. + * @since_tizen 3.0 + * @see I18N_UCHAR_BIDI_PAIRED_BRACKET_TYPE + * + */ +typedef enum { + I18N_UCHAR_U_BPT_NONE, /**< Not a paired bracket. */ + + I18N_UCHAR_U_BPT_OPEN, /**< Open paired bracket. */ + + I18N_UCHAR_U_BPT_CLOSE, /**< Close paired bracket. */ + + I18N_UCHAR_U_BPT_COUNT /**< Count */ +} i18n_uchar_u_bidi_paired_bracket_type_e; + +/** * @brief Constants for Unicode blocks, see the Unicode Data file Blocks.txt. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -798,6 +816,38 @@ typedef enum { I18N_UCHAR_UBLOCK_TRANSPORT_AND_MAP_SYMBOLS, /**< Transport And Map Symbols */ I18N_UCHAR_UBLOCK_ALCHEMICAL_SYMBOLS, /**< Alchemical Symbols */ I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D, /**< CJK Unified Ideographs Extension D */ + I18N_UCHAR_UBLOCK_BASSA_VAH = 221, /**< Bassa Vah (Since 3.0) */ + I18N_UCHAR_UBLOCK_CAUCASIAN_ALBANIAN = 222, /**< Caucasian Albanian (Since 3.0) */ + I18N_UCHAR_UBLOCK_COPTIC_EPACT_NUMBERS = 223, /**< Coptic Epact Numbers (Since 3.0) */ + I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS_EXTENDED = 224, /**< Combining Diacritical Marks Extended (Since 3.0) */ + I18N_UCHAR_UBLOCK_DUPLOYAN = 225, /**< Duployan (Since 3.0) */ + I18N_UCHAR_UBLOCK_ELBASAN = 226, /**< Elbasan (Since 3.0) */ + I18N_UCHAR_UBLOCK_GEOMETRIC_SHAPES_EXTENDED = 227, /**< Geometric Shapes Extended (Since 3.0) */ + I18N_UCHAR_UBLOCK_GRANTHA = 228, /**< Grantha (Since 3.0) */ + I18N_UCHAR_UBLOCK_KHOJKI = 229, /**< Khojki (Since 3.0) */ + I18N_UCHAR_UBLOCK_KHUDAWADI = 230, /**< Khudawadi (Since 3.0) */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_E = 231, /**< Latin Extended E (Since 3.0) */ + I18N_UCHAR_UBLOCK_LINEAR_A = 232, /**< Linear A (Since 3.0) */ + I18N_UCHAR_UBLOCK_MAHAJANI = 233, /**< Mahajani (Since 3.0) */ + I18N_UCHAR_UBLOCK_MANICHAEAN = 234, /**< Manichaean (Since 3.0) */ + I18N_UCHAR_UBLOCK_MENDE_KIKAKUI = 235, /**< Mende Kikakui (Since 3.0) */ + I18N_UCHAR_UBLOCK_MODI = 236, /**< Modi (Since 3.0) */ + I18N_UCHAR_UBLOCK_MRO = 237, /**< Mro (Since 3.0) */ + I18N_UCHAR_UBLOCK_MYANMAR_EXTENDED_B = 238, /**< Myanmar Extended B (Since 3.0) */ + I18N_UCHAR_UBLOCK_NABATAEAN = 239, /**< Nabataean (Since 3.0) */ + I18N_UCHAR_UBLOCK_OLD_NORTH_ARABIAN = 240, /**< Old North Arabian (Since 3.0) */ + I18N_UCHAR_UBLOCK_OLD_PERMIC = 241, /**< Old Permic (Since 3.0) */ + I18N_UCHAR_UBLOCK_ORNAMENTAL_DINGBATS = 242, /**< Ornamental Dingbats (Since 3.0) */ + I18N_UCHAR_UBLOCK_PAHAWH_HMONG = 243, /**< Pahawh Hmong (Since 3.0) */ + I18N_UCHAR_UBLOCK_PALMYRENE = 244, /**< Palmyrene (Since 3.0) */ + I18N_UCHAR_UBLOCK_PAU_CIN_HAU = 245, /**< Pau Cin Hau (Since 3.0) */ + I18N_UCHAR_UBLOCK_PSALTER_PAHLAVI = 246, /**< Psalter Pahlavi (Since 3.0) */ + I18N_UCHAR_UBLOCK_SHORTHAND_FORMAT_CONTROLS = 247, /**< Shorthand Format Controls (Since 3.0) */ + I18N_UCHAR_UBLOCK_SIDDHAM = 248, /**< Siddham (Since 3.0) */ + I18N_UCHAR_UBLOCK_SINHALA_ARCHAIC_NUMBERS = 249, /**< Sinhala Archaic Numbers (Since 3.0) */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_C = 250, /**< Supplemental Arrows C (Since 3.0) */ + I18N_UCHAR_UBLOCK_TIRHUTA = 251, /**< Tirhuta (Since 3.0) */ + I18N_UCHAR_UBLOCK_WARANG_CITI = 252, /**< Warang Citi (Since 3.0) */ I18N_UCHAR_UBLOCK_COUNT, /**< Count */ I18N_UCHAR_UBLOCK_INVALID_CODE = -1 /**< Invalid Code */ } i18n_uchar_ublock_code_e; @@ -826,6 +876,10 @@ typedef enum { I18N_UCHAR_U_POP_DIRECTIONAL_FORMAT, /**< PDF */ I18N_UCHAR_U_DIR_NON_SPACING_MARK, /**< NSM */ I18N_UCHAR_U_BOUNDARY_NEUTRAL, /**< BN */ + I18N_UCHAR_U_FIRST_STRONG_ISOLATE, /**< FSI (Since 3.0) */ + I18N_UCHAR_U_LEFT_TO_RIGHT_ISOLATE, /**< FSI (Since 3.0) */ + I18N_UCHAR_U_RIGHT_TO_LEFT_ISOLATE, /**< RLI (Since 3.0) */ + I18N_UCHAR_U_POP_DIRECTIONAL_ISOLATE, /**< PDI (Since 3.0) */ I18N_UCHAR_U_CHAR_DIRECTION_COUNT /**< Count */ } i18n_uchar_direction_e; @@ -972,6 +1026,34 @@ typedef enum { I18N_UCHAR_U_JG_FARSI_YEH, /**< Farsi Yeh */ I18N_UCHAR_U_JG_NYA, /**< Nya */ I18N_UCHAR_U_JG_ROHINGYA_YEH, /**< Rohingya Yeh */ + I18N_UCHAR_U_JG_MANICHAEAN_ALEPH, /**< Manichaean Aleph (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_AYIN, /**< Manichaean Ayin (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_BETH, /**< Manichaean Beth (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_DALETH, /**< Manichaean Daleth (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_DHAMEDH, /**< Manichaean Dhamedh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_FIVE, /**< Manichaean Five (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_GIMEL, /**< Manichaean Gimel (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_HETH, /**< Manichaean Heth (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_HUNDRED, /**< Manichaean Hundred (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_KAPH, /**< Manichaean Kaph (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_LAMEDH, /**< Manichaean Lamedh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_MEM, /**< Manichaean Mem (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_NUN, /**< Manichaean Nun (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_ONE, /**< Manichaean One (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_PE, /**< Manichaean Pe (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_QOPH, /**< Manichaean Qoph (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_RESH, /**< Manichaean Resh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_SADHE, /**< Manichaean Sadhe (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_SAMEKH, /**< Manichaean Samekh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_TAW, /**< Manichaean Taw (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_TEN, /**< Manichaean Ten (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_TETH, /**< Manichaean Teth (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_THAMEDH, /**< Manichaean Thamedh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_TWENTY, /**< Manichaean Twenty (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_WAW, /**< Manichaean Waw (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_YODH, /**< Manichaean Yodh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_ZAYIN, /**< Manichaean Zayin (Since 3.0) */ + I18N_UCHAR_U_JG_STRAIGHT_WAW, /**< Manichaean Waw (Since 3.0) */ I18N_UCHAR_U_JG_COUNT /**< Count */ } i18n_uchar_u_joining_group_e; @@ -1102,6 +1184,10 @@ typedef enum { I18N_UCHAR_U_WB_LF, /**< [LF] */ I18N_UCHAR_U_WB_MIDNUMLET, /**< [MB] */ I18N_UCHAR_U_WB_NEWLINE, /**< [NL] */ + I18N_UCHAR_U_WB_REGIONAL_INDICATOR, /**< [RI] (Since 3.0) */ + I18N_UCHAR_U_WB_HEBREW_LETTER, /**< [HL] (Since 3.0) */ + I18N_UCHAR_U_WB_SINGLE_QUOTE, /**< [SQ] (Since 3.0) */ + I18N_UCHAR_U_WB_DOUBLE_QUOTE, /**< [DQ] (Since 3.0) */ I18N_UCHAR_U_WB_COUNT /**< */ } i18n_uchar_u_word_break_values_e; @@ -1253,9 +1339,9 @@ typedef enum { * @since_tizen 2.4 */ typedef enum { - I18N_UNORMALIZATION_NO, /**< The input string is not in the normalization form. */ - I18N_UNORMALIZATION_YES, /**< The input string is in the normalization form. */ - I18N_UNORMALIZATION_MAYBE /**< The input string may or may not be in the normalization form. */ + I18N_UNORMALIZATION_NO, /**< The input string is not in the normalization form. */ + I18N_UNORMALIZATION_YES, /**< The input string is in the normalization form. */ + I18N_UNORMALIZATION_MAYBE /**< The input string may or may not be in the normalization form. */ } i18n_unormalization_check_result_e; /** @@ -1626,6 +1712,281 @@ typedef enum { I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_STANDALONE = (I18N_UDISPCTX_TYPE_CAPITALIZATION<<8) + 4, /**< Capitalization: For standalone */ } i18n_udisplay_context_e; +/* Skeletons for dates. */ + +/** + * @brief Constant for date skeleton with year. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_YEAR "y" + +/** + * @brief Constant for date skeleton with quarter. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_QUARTER "QQQQ" + +/** + * @brief Constant for date skeleton with abbreviated quarter. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_ABBR_QUARTER "QQQ" + +/** + * @brief Constant for date skeleton with year and quarter. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_YEAR_QUARTER "yQQQQ" + +/** + * @brief Constant for date skeleton with year and abbreviated quarter. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_YEAR_ABBR_QUARTER "yQQQ" + +/** + * @brief Constant for date skeleton with month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_MONTH "MMMM" + +/** + * @brief Constant for date skeleton with abbreviated month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_ABBR_MONTH "MMM" + +/** + * @brief Constant for date skeleton with numeric month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_NUM_MONTH "M" + +/** + * @brief Constant for date skeleton with year and month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_MONTH "yMMMM" + +/** + * @brief Constant for date skeleton with year and abbreviated month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_ABBR_MONTH "yMMM" + +/** + * @brief Constant for date skeleton with year and numeric month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_NUM_MONTH "yM" + +/** + * @brief Constant for date skeleton with day. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_DAY "d" + +/** + * @brief Constant for date skeleton with year, month, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_MONTH_DAY "yMMMMd" + +/** + * @brief Constant for date skeleton with year, abbreviated month, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_ABBR_MONTH_DAY "yMMMd" + +/** + * @brief Constant for date skeleton with year, numeric month, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_NUM_MONTH_DAY "yMd" + +/** + * @brief Constant for date skeleton with weekday. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_WEEKDAY "EEEE" + +/** + * @brief Constant for date skeleton with abbreviated weekday. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_ABBR_WEEKDAY "E" + +/** + * @brief Constant for date skeleton with year, month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd" + +/** + * @brief Constant for date skeleton with year, abbreviated month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd" + +/** + * @brief Constant for date skeleton with year, numeric month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd" + +/** + * @brief Constant for date skeleton with long month and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_MONTH_DAY "MMMMd" + +/** + * @brief Constant for date skeleton with abbreviated month and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_ABBR_MONTH_DAY "MMMd" + +/** + * @brief Constant for date skeleton with numeric month and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_NUM_MONTH_DAY "Md" + +/** + * @brief Constant for date skeleton with month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_MONTH_WEEKDAY_DAY "MMMMEEEEd" + +/** + * @brief Constant for date skeleton with abbreviated month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_ABBR_MONTH_WEEKDAY_DAY "MMMEd" + +/** + * @brief Constant for date skeleton with numeric month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_NUM_MONTH_WEEKDAY_DAY "MEd" + +/* Skeletons for times. */ + +/** + * @brief Constant for date skeleton with hour, with the locale's preferred hour format (12 or 24). + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR "j" + +/** + * @brief Constant for date skeleton with hour in 24-hour presentation. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR24 "H" + +/** + * @brief Constant for date skeleton with minute. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_MINUTE "m" + +/** + * @brief Constant for date skeleton with hour and minute, with the locale's preferred hour format (12 or 24). + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR_MINUTE "jm" + +/** + * @brief Constant for date skeleton with hour and minute in 24-hour presentation. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR24_MINUTE "Hm" + +/** + * @brief Constant for date skeleton with second. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_SECOND "s" + +/** + * @brief Constant for date skeleton with hour, minute, and second, + * with the locale's preferred hour format (12 or 24). + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR_MINUTE_SECOND "jms" + +/** + * @brief Constant for date skeleton with hour, minute, and second in + * 24-hour presentation. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR24_MINUTE_SECOND "Hms" + +/** + * @brief Constant for date skeleton with minute and second. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_MINUTE_SECOND "ms" + /** * @} * @} @@ -1741,7 +2102,7 @@ typedef enum { I18N_UNUMBER_CURRENCY_ISO, /**< Currency format with an ISO currency code, e.g., "USD1.00" */ I18N_UNUMBER_CURRENCY_PLURAL, /**< Currency format with a pluralized currency name, e.g., "1.00 US dollar" and "3.00 US dollars" */ - I18N_UNUMBER_FORMAT_STYLE_COUNT = I18N_UNUMBER_CURRENCY_PLURAL + 2, /**< One more than the highest number format style constant */ + I18N_UNUMBER_FORMAT_STYLE_COUNT, /**< One more than the highest number format style constant */ I18N_UNUMBER_DEFAULT = I18N_UNUMBER_DECIMAL, /**< Default format */ I18N_UNUMBER_IGNORE = I18N_UNUMBER_PATTERN_DECIMAL /**< Alias for #I18N_UNUMBER_PATTERN_DECIMAL */ } i18n_unumber_format_style_e; @@ -1778,7 +2139,7 @@ typedef enum { I18N_UNUMBER_SEVEN_DIGIT_SYMBOL = 24, /**< Seven */ I18N_UNUMBER_EIGHT_DIGIT_SYMBOL = 25, /**< Eight */ I18N_UNUMBER_NINE_DIGIT_SYMBOL = 26, /**< Nine */ - I18N_UNUMBER_FORMAT_SYMBOL_COUNT = 27 /**< Number of enumerators */ + I18N_UNUMBER_FORMAT_SYMBOL_COUNT /**< Number of enumerators */ } i18n_unumber_format_symbol_e; /** @@ -1823,17 +2184,21 @@ typedef enum { * @since_tizen 2.3.1 */ typedef enum { - I18N_UNUMBER_POSITIVE_PREFIX, /**< Positive prefix */ - I18N_UNUMBER_POSITIVE_SUFFIX, /**< Positive suffix */ - I18N_UNUMBER_NEGATIVE_PREFIX, /**< Negative prefix */ - I18N_UNUMBER_NEGATIVE_SUFFIX, /**< Negative suffix */ - I18N_UNUMBER_PADDING_CHARACTER, /**< The character used to pad to the format width */ - I18N_UNUMBER_CURRENCY_CODE, /**< The ISO currency code */ - I18N_UNUMBER_DEFAULT_RULESET, /**< The default rule set, such as "%spellout-numbering-year:", "%spellout-cardinal:", "%spellout-ordinal-masculine-plural:", "%spellout-ordinal-feminine:", or "%spellout-ordinal-neuter:". - The available public rulesets can be listed using i18n_unumber_get_text_attribute() with #I18N_UNUMBER_PUBLIC_RULESETS. This is only available with rule-based formatters */ - I18N_UNUMBER_PUBLIC_RULESETS, /**< The public rule sets. This is only available with rule-based formatters. This is a read-only attribute. - The public rulesets are returned as a single string, with each ruleset name delimited by ';' (semicolon). - See the CLDR LDML spec for more information about RBNF rulesets: http://www.unicode.org/reports/tr35/tr35-numbers.html#Rule-Based_Number_Formatting */ + I18N_UNUMBER_POSITIVE_PREFIX, /**< Positive prefix */ + I18N_UNUMBER_POSITIVE_SUFFIX, /**< Positive suffix */ + I18N_UNUMBER_NEGATIVE_PREFIX, /**< Negative prefix */ + I18N_UNUMBER_NEGATIVE_SUFFIX, /**< Negative suffix */ + I18N_UNUMBER_PADDING_CHARACTER, /**< The character used to pad to the format width */ + I18N_UNUMBER_CURRENCY_CODE, /**< The ISO currency code */ + I18N_UNUMBER_DEFAULT_RULESET, /**< The default rule set, such as "%spellout-numbering-year:", "%spellout-cardinal:", + "%spellout-ordinal-masculine-plural:", "%spellout-ordinal-feminine:" + or "%spellout-ordinal-neuter:". + The available public rulesets can be listed using i18n_unumber_get_text_attribute() + with #I18N_UNUMBER_PUBLIC_RULESETS. This is only available with rule-based formatters */ + I18N_UNUMBER_PUBLIC_RULESETS, /**< The public rule sets. This is only available with rule-based formatters. This is a read-only attribute. + The public rulesets are returned as a single string, with each ruleset name delimited by ';' (semicolon). + See the CLDR LDML spec for more information about RBNF rulesets: + http://www.unicode.org/reports/tr35/tr35-numbers.html#Rule-Based_Number_Formatting */ } i18n_unumber_format_text_attribute_e; /** @@ -1869,6 +2234,99 @@ typedef enum { #define I18N_ULOCALE_US "en_US" /**< Useful constant for en_US. @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif*/ /** + * @brief Useful constant for the maximum size of the language part of a locale ID. + * (including the terminating NULL). + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + * @see i18n_ulocale_get_language() + */ +#define I18N_ULOCALE_LANG_CAPACITY 12 + +/** + * @brief Useful constant for the maximum size of the country part of a locale ID + * (including the terminating NULL). + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + * @see i18n_ulocale_get_country() + */ +#define I18N_ULOCALE_COUNTRY_CAPACITY 4 +/** + * @brief Useful constant for the maximum size of the whole locale ID + * (including the terminating NULL and all keywords). + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_FULLNAME_CAPACITY 157 + +/** + * @brief Useful constant for the maximum size of the script part of a locale ID + * (including the terminating NULL). + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + * @see i18n_ulocale_get_script() + */ +#define I18N_ULOCALE_SCRIPT_CAPACITY 6 + +/** + * @brief Useful constant for the maximum size of keywords in a locale + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORDS_CAPACITY 96 + +/** + * @brief Useful constant for the maximum total size of keywords and their values in a locale + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_AND_VALUES_CAPACITY 100 + +/** + * @brief Invariant character separating keywords from the locale string + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_SEPARATOR '@' + +/** + * @brief Unicode code point for '@' separating keywords from the locale string. + * @since_tizen 3.0 + * @see #I18N_ULOCALE_KEYWORD_SEPARATOR + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_SEPARATOR_UNICODE 0x40 + +/** + * @brief Invariant character for assigning value to a keyword + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_ASSIGN '=' + +/** + * @brief Unicode code point for '=' for assigning value to a keyword. + * @since_tizen 3.0 + * @see #I18N_ULOCALE_KEYWORD_ASSIGN + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_ASSIGN_UNICODE 0x3D + +/** + * @brief Invariant character separating keywords + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_ITEM_SEPARATOR ';' + +/** + * @brief Unicode code point for ';' separating keywords + * @since_tizen 3.0 + * @see #I18N_ULOCALE_KEYWORD_ITEM_SEPARATOR + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_ITEM_SEPARATOR_UNICODE 0x3B + +/** * @brief Enumeration for the 'out_result' parameter return value * @since_tizen 2.3.1 * @@ -1924,7 +2382,7 @@ typedef enum { * * @retval character the character represented by the escape sequence at offset * - * @see #i18n_ustring_unescape_at() + * @see i18n_ustring_unescape_at() */ typedef i18n_uchar(* i18n_ustring_unescape_char_at_cb)(int32_t offset, void *context); @@ -2018,6 +2476,7 @@ typedef void* i18n_ubreak_iterator_s; typedef void* i18n_ubreak_iterator_h; /** + * @deprecated Deprecated since Tizen 3.0 * @brief A recommended size (in bytes) for the memory buffer to be passed to i18n_ubrk_safe_clone(). * @since_tizen 2.3.1 */ @@ -2349,11 +2808,11 @@ typedef enum { I18N_USCRIPT_ANATOLIAN_HIEROGLYPHS = 156,/**< Hluw */ I18N_USCRIPT_KHOJKI = 157,/**< Khoj */ I18N_USCRIPT_TIRHUTA = 158,/**< Tirh */ -I18N_USCRIPT_CODE_LIMIT = 159 /**< Count of i18n_uscript_code_e enumerators*/ + I18N_USCRIPT_CODE_LIMIT = 159 /**< Count of i18n_uscript_code_e enumerators*/ } i18n_uscript_code_e; #ifdef __cplusplus } #endif -#endif /* __UTILS_I18N_TYPES_H__*/ +#endif /* __UTILS_I18N_TYPES_H__*/ diff --git a/src/include/mobile/utils_i18n_ubrk.h b/src/include/mobile/utils_i18n_ubrk.h index e755473..4ecdfdf 100755 --- a/src/include/mobile/utils_i18n_ubrk.h +++ b/src/include/mobile/utils_i18n_ubrk.h @@ -177,13 +177,12 @@ int32_t i18n_ubrk_next (i18n_ubreak_iterator_h break_iter); int32_t i18n_ubrk_previous (i18n_ubreak_iterator_h break_iter); /** - * @brief Sets the iterator position to the index of the first character in the text being scanned. - * @details This is not always the same as index @c 0 of the text. - * @remarks The specific error code can be obtained using the get_last_result() method. + * @brief Sets the iterator position to zero, the start of the text being scanned. + * * @remarks The specific error code can be obtained using the get_last_result() method. * Error codes are described in Exceptions section. * @since_tizen 2.3.1 * @param[in] break_iter The break iterator to use. Must not be @c NULL. - * @return The character index of the first character in the text being scanned. + * @return The new iterator position (zero). * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_last() diff --git a/src/include/mobile/utils_i18n_ucollator.h b/src/include/mobile/utils_i18n_ucollator.h index cd129da..4a40674 100755 --- a/src/include/mobile/utils_i18n_ucollator.h +++ b/src/include/mobile/utils_i18n_ucollator.h @@ -125,7 +125,14 @@ extern "C" { /** * @brief Creates a i18n_ucollator_h for comparing strings. - * @details The i18n_ucollator_h is used in all the calls to the Collation service.\n + * @details For some languages, multiple collation types are available; + * for example, "de@collation=phonebook". + * Collation attributes can be specified via locale keywords as well, + * in the old locale extension syntax ("el@colCaseFirst=upper") + * or in language tag syntax ("el-u-kf-upper"). + * See User Guide: Collation API. + * + * The i18n_ucollator_h is used in all the calls to the Collation service.\n * After finished, collator must be disposed off by calling {@link #i18n_ucollator_destroy()}. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks Must release @a collator using i18n_ucollator_destroy(). diff --git a/src/include/mobile/utils_i18n_udatepg.h b/src/include/mobile/utils_i18n_udatepg.h index 174690b..d46317d 100755 --- a/src/include/mobile/utils_i18n_udatepg.h +++ b/src/include/mobile/utils_i18n_udatepg.h @@ -37,7 +37,8 @@ * @details The Udatepg module provides flexible generation of date format patterns, * like "yy-MM-dd". The user can build up the generator by adding successive patterns. * Once that is done, a query can be made using a "skeleton", which is a pattern that - * just includes the desired fields and lengths. The generator will return the + * just includes the desired fields and lengths(Since Tizen 3.0 constants for skeletons are available - + * see #I18N_UDATE_YEAR and many, many others). The generator will return the * "best fit" pattern corresponding to that skeleton.\n * The main method people will use is i18n_udatepg_get_best_pattern(), since normally * #i18n_udatepg_h is pre-built with data from a particular locale. diff --git a/src/include/mobile/utils_i18n_ulocale.h b/src/include/mobile/utils_i18n_ulocale.h index 51d6e89..a180152 100644 --- a/src/include/mobile/utils_i18n_ulocale.h +++ b/src/include/mobile/utils_i18n_ulocale.h @@ -442,7 +442,8 @@ int32_t i18n_ulocale_get_display_variant ( const char *locale, const char *displ * int32_t keyword_count = 0; * i18n_uchar display_keyword[256]; * int32_t display_keyword_len = 0; - * i18n_uenumeration_h keyword_enum = i18n_ulocale_keywords_create("de_DE@collation=PHONEBOOK;calendar=TRADITIONAL"); + * i18n_uenumeration_h keyword_enum; + * i18n_ulocale_keywords_create("en_US@collation=PHONEBOOK;calendar=TRADITIONAL", &keyword_enum); * * for(keyword_count = i18n_uenumeration_count(keyword_enum); keyword_count > 0; keyword_count--){ * status = get_last_result(); @@ -484,7 +485,8 @@ int32_t i18n_ulocale_get_display_keyword ( const char *keyword, const char *disp /** * @brief Gets the value of the keyword suitable for display for the specified locale. - * @details E.g : for the locale string de_DE\@collation=PHONEBOOK, this API gets the display string for PHONEBOOK, in the display locale, when "collation" is specified as the keyword. + * @details E.g : for the locale string de_DE\@collation=PHONEBOOK, this API gets the display string for PHONEBOOK, + * in the display locale, when "collation" is specified as the keyword. * @remarks The specific error code can be obtained using the get_last_result() method. * Error codes are described in Exceptions section and #i18n_error_code_e description. * @since_tizen 2.3.1 @@ -567,7 +569,7 @@ const char * const *i18n_ulocale_get_iso_countries ( void ); int32_t i18n_ulocale_get_parent ( const char *locale_id, char *parent, int32_t parent_capacity ); /** - * @brief Gets the full name for the specified locale. + * @brief Gets the full name for the specified locale, like i18n_ulocale_get_name(), but without keywords. * @details Note : This has the effect of 'canonicalizing' the string to a certain extent. * Upper and lower case are set as needed, * and if the components were in 'POSIX' format they are changed to I18N format. @@ -628,13 +630,61 @@ int32_t i18n_ulocale_get_keyword_value ( const char *locale_id, const char *keyw /** * @brief Sets or removes the value of the specified keyword. - * @details For removing all keywords, use i18n_ulocale_get_base_name(). + * @details For removing all keywords(retrieving only locale base name associated with the keywords), + * use i18n_ulocale_get_base_name(). * * NOTE : Unlike almost every other I18N function which takes a * buffer, this function will NOT truncate the output text. If a * #I18N_ERROR_BUFFER_OVERFLOW is received, it means that the original * buffer is untouched. This is done to prevent incorrect or possibly * even malformed locales from being generated and used. + * + * Below code prints following logs in SDK: + * + * Locale and keywords: en_US@abc=12;def=34 + * keyword1: abc + * keyword2: def + * Locale: en_US + * Keyword1 value: 12 + * + * @code + * int32_t buff_size = 50; + * int32_t sub_buff_size = 45; + * char *buff = malloc(sizeof(char)*buff_size); + * char *sub_buff = malloc(sizeof(char)*sub_buff_size); + * char *locale = "en_US"; + * + * snprintf(buff, buff_size, "%s%s",locale, sub_buff); + * + * i18n_ulocale_set_keyword_value("abc", "cba", buff, buff_size); + * i18n_ulocale_set_keyword_value("def", "34", buff, buff_size); + * + * i18n_uenumeration_h keyword_enum; + * i18n_ulocale_keywords_create(buff, &keyword_enum); + * + * int32_t res_len = 0; + * const char *keyw = i18n_uenumeration_next(keyword_enum, &res_len); + * const char *keyw2 = i18n_uenumeration_next(keyword_enum, &res_len); + * + * char *only_locale = malloc(sizeof(char)*10); + * i18n_ulocale_get_base_name(buff, only_locale, 10); + * + * int32_t buff_size_get = 50; + * char *buff_out = malloc(sizeof(char)*buff_size_get); + * i18n_ulocale_get_keyword_value(buff, "abc", buff_out, buff_size_get); + * + * dlog_print(DLOG_DEBUG, "test", "Locale and keywords: %s", buff); + * dlog_print(DLOG_DEBUG, "test", "keyword1: %s", keyw); + * dlog_print(DLOG_DEBUG, "test", "keyword2: %s", keyw2); + * dlog_print(DLOG_DEBUG, "test", "Locale: %s", only_locale); + * dlog_print(DLOG_DEBUG, "test", "Keyword1 value: %s", buff_out); + * + * i18n_uenumeration_destroy(keyword_enum) + * free(buff); + * free(sub_buff); + * free(only_locale); + * free(buff_out); + * @endcode * @remarks The specific error code can be obtained using the get_last_result() method. * Error codes are described in Exceptions section and #i18n_error_code_e description. * @since_tizen 2.3.1 diff --git a/src/include/mobile/utils_i18n_unumber.h b/src/include/mobile/utils_i18n_unumber.h index c25d665..f1e7cf3 100644 --- a/src/include/mobile/utils_i18n_unumber.h +++ b/src/include/mobile/utils_i18n_unumber.h @@ -74,8 +74,8 @@ extern "C" { /** * @brief Creates and returns a new unumber_format_h for formatting and parsing numbers. - * @details A unumber_format_style_e may be used to format numbers by calling {@link i18n_unumber_create()}. - * The caller must call {@link #i18n_unumber_destroy() } when done to release resources used by this object. + * @details A unumber_format_style_e may be used to format numbers by calling i18n_unumber_create(). + * The caller must call i18n_unumber_destroy() when done to release resources used by this object. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks Must release @a num_format using i18n_unumber_destroy(). * @@ -84,6 +84,8 @@ extern "C" { * #I18N_UNUMBER_CURRENCY, * #I18N_UNUMBER_PERCENT, * #I18N_UNUMBER_SCIENTIFIC, + * #I18N_UNUMBER_CURRENCY_ISO, + * #I18N_UNUMBER_CURRENCY_PLURAL, * #I18N_UNUMBER_SPELLOUT, * #I18N_UNUMBER_ORDINAL, * #I18N_UNUMBER_DURATION, diff --git a/src/include/mobile/utils_i18n_ustring.h b/src/include/mobile/utils_i18n_ustring.h index d4bbc94..dba29a0 100644 --- a/src/include/mobile/utils_i18n_ustring.h +++ b/src/include/mobile/utils_i18n_ustring.h @@ -1142,7 +1142,6 @@ i18n_uchar* i18n_ustring_from_UTF8 ( i18n_uchar *dest, int32_t dest_capacity, in /** * @brief Convert a UTF-16 string to UTF-8. - * @details If the input string is not well-formed, then the #I18N_ERROR_INVALID_CHAR_FOUND error code is set. * Same as #i18n_ustring_to_UTF8() except for the additional sub_char which is output for illegal input sequences, instead of stopping with the #I18N_ERROR_INVALID_CHAR_FOUND error code. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -1162,10 +1161,8 @@ i18n_uchar* i18n_ustring_from_UTF8 ( i18n_uchar *dest, int32_t dest_capacity, in * A substitution character can be any valid Unicode code point (up to U+10FFFF) except for surrogate code points (U+D800..U+DFFF). * The recommended value is U+FFFD "REPLACEMENT CHARACTER". * @param[out] num_substitutions Output parameter receiving the number of substitutions if sub_char>=0. Set to 0 if no substitutions occur or sub_char<0. num_substitutions can be NULL. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) + * @param[out] error_codeMust be a valid pointer to an error code value, + * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter @@ -1176,7 +1173,6 @@ char* i18n_ustring_to_UTF8_with_sub ( char *dest, int32_t dest_capacity, int32_t /** * @brief Convert a UTF-8 string to UTF-16. - * @details Same as #i18n_ustring_from_UTF8() except for the additional sub_char which is output for illegal input sequences, instead of stopping with the #I18N_ERROR_INVALID_CHAR_FOUND error code. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @param[out] dest A buffer for the result string.\n @@ -1195,10 +1191,8 @@ char* i18n_ustring_to_UTF8_with_sub ( char *dest, int32_t dest_capacity, int32_t * A substitution character can be any valid Unicode code point (up to U+10FFFF) except for surrogate code points (U+D800..U+DFFF). * The recommended value is U+FFFD "REPLACEMENT CHARACTER". * @param[out] num_substitutions Output parameter receiving the number of substitutions if sub_char>=0. Set to 0 if no substitutions occur or sub_char<0. num_substitutions can be NULL. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) + * @param[out] error_code Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter @@ -1236,10 +1230,8 @@ i18n_uchar* i18n_ustring_from_UTF8_with_sub ( i18n_uchar *dest, int32_t dest_cap * @param[in] src The original source string * @param[in] src_len The length of the original string.\n * If @c -1, then @a src must be zero-terminated. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) + * @param[out] error_code Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter @@ -1291,7 +1283,6 @@ i18n_uchar32* i18n_ustring_to_UTF32 ( i18n_uchar32 *dest, int32_t dest_capacity, * @param[in] src The original source string * @param[in] src_len The length of the original string.\n * If @c -1, then @a src must be zero-terminated. - * * @param[out] error_code Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The pointer to destination buffer. @@ -1322,10 +1313,8 @@ i18n_uchar* i18n_ustring_from_UTF32 ( i18n_uchar *dest, int32_t dest_capacity, i * A substitution character can be any valid Unicode code point (up to U+10FFFF) except for surrogate code points (U+D800..U+DFFF). * The recommended value is U+FFFD "REPLACEMENT CHARACTER". * @param[out] num_substitutions Output parameter receiving the number of substitutions if sub_char>=0. Set to 0 if no substitutions occur or sub_char<0. num_substitutions can be NULL. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) + * @param[out] error_code Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter @@ -1337,7 +1326,6 @@ i18n_uchar32* i18n_ustring_to_UTF32_with_sub ( i18n_uchar32 *dest, int32_t dest_ /** * @brief Convert a UTF-32 string to UTF-16. - * @details If the input string is not well-formed, then the #I18N_ERROR_INVALID_CHAR_FOUND error code is set. * Same as #i18n_ustring_from_UTF32() except for the additional sub_char which is output for illegal input sequences, instead of stopping with the #I18N_ERROR_INVALID_CHAR_FOUND error code. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -1356,11 +1344,9 @@ i18n_uchar32* i18n_ustring_to_UTF32_with_sub ( i18n_uchar32 *dest, int32_t dest_ * A substitution character can be any valid Unicode code point (up to U+10FFFF) except for surrogate code points (U+D800..U+DFFF). * The recommended value is U+FFFD "REPLACEMENT CHARACTER". * @param[out] num_substitutions Output parameter receiving the number of substitutions if sub_char>=0. Set to 0 if no substitutions occur or sub_char<0. num_substitutions can be NULL. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) - * @return[out] The pointer to destination buffer. + * @param[out] error_code Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * @return The pointer to destination buffer. * * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter diff --git a/src/utils_i18n_unumber.c b/src/utils_i18n_unumber.c index 9815e3e..7908a4d 100755 --- a/src/utils_i18n_unumber.c +++ b/src/utils_i18n_unumber.c @@ -24,6 +24,7 @@ int i18n_unumber_create(i18n_unumber_format_style_e style, const i18n_uchar *pat i18n_unumber_format_h *num_format) { retv_if(num_format == NULL, I18N_ERROR_INVALID_PARAMETER); + retv_if(style > I18N_UNUMBER_CURRENCY_PLURAL, I18N_ERROR_INVALID_PARAMETER); UErrorCode icu_error = U_ZERO_ERROR; *num_format = @@ -409,6 +410,9 @@ int i18n_unumber_set_symbol(i18n_unumber_format_h fmt, i18n_unumber_format_symbo if (fmt == NULL) return I18N_ERROR_INVALID_PARAMETER; + if (symbol >= I18N_UNUMBER_FORMAT_SYMBOL_COUNT) + return I18N_ERROR_INVALID_PARAMETER; + UErrorCode icu_error = U_ZERO_ERROR; unum_setSymbol(fmt, symbol, value, length, &icu_error); -- 2.7.4 From ae6e5448fec7dc00a147df47b0c2f0d04d36ff2d Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Wed, 3 Feb 2016 10:21:53 +0900 Subject: [PATCH 11/16] Update version - 1.2.1 Change-Id: I04e5bb18c8c9e9cfc8ac584dba4aa7defae39b4a --- packaging/capi-base-utils.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-base-utils.spec b/packaging/capi-base-utils.spec index 388694a..d98fc4b 100755 --- a/packaging/capi-base-utils.spec +++ b/packaging/capi-base-utils.spec @@ -1,6 +1,6 @@ Name: capi-base-utils Summary: Base Utils -Version: 1.1.1 +Version: 1.2.1 Release: 1 Group: Base License: Apache-2.0 and ICU -- 2.7.4 From 3875168caab90819aefd95317cced46474e5d6d8 Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Thu, 11 Feb 2016 11:03:11 +0900 Subject: [PATCH 12/16] Apply changes of mobile to wearable Change-Id: I47a53b690d70b9f28fe9626ab6f46d0efe77ed7e --- src/include/wearable/utils_i18n_types.h | 509 ++++++++++++++++++++++++++-- src/include/wearable/utils_i18n_ubrk.h | 7 +- src/include/wearable/utils_i18n_ucollator.h | 9 +- src/include/wearable/utils_i18n_udatepg.h | 3 +- src/include/wearable/utils_i18n_ulocale.h | 58 +++- src/include/wearable/utils_i18n_unumber.h | 6 +- src/include/wearable/utils_i18n_usearch.h | 2 +- src/include/wearable/utils_i18n_ustring.h | 37 +- 8 files changed, 568 insertions(+), 63 deletions(-) diff --git a/src/include/wearable/utils_i18n_types.h b/src/include/wearable/utils_i18n_types.h index cf2dde8..a96cbed 100644 --- a/src/include/wearable/utils_i18n_types.h +++ b/src/include/wearable/utils_i18n_types.h @@ -240,9 +240,9 @@ typedef enum { 0-9 A-F a-f */ I18N_UCHAR_BIDI_CONTROL, - /**< Binary property Bidi_Control. \n - Format controls which have specific functions in the Bidi Algorithm. - */ + /**< Binary property Bidi_Control. \n + Format controls which have specific functions in the Bidi Algorithm. + */ I18N_UCHAR_BIDI_MIRRORED, /**< Binary property Bidi_Mirrored. \n Characters that may change display in RTL text. See Bidi Algorithm, UTR 9. @@ -524,7 +524,9 @@ typedef enum { Returns #i18n_uchar_u_word_break_values_e values. */ I18N_UCHAR_BIDI_PAIRED_BRACKET_TYPE, - /**< Unsupported yet. Please do not use. */ + /**< Enumerated property Bidi_Paired_Bracket_Type. \n + Returns #i18n_uchar_u_bidi_paired_bracket_type_e values . + */ I18N_UCHAR_INT_LIMIT, /**< One more than the last constant for enumerated/integer Unicode properties. */ I18N_UCHAR_GENERAL_CATEGORY_MASK = 0x2000, @@ -565,8 +567,8 @@ typedef enum { /**< String property Titlecase_Mapping. */ I18N_UCHAR_UPPERCASE_MAPPING = 0x400C, /**< String property Uppercase_Mapping. */ - I18N_UCHAR_BIDI_PAIRED_BRACKET, - /**< Unsupported yet. Please do not use. */ + I18N_UCHAR_BIDI_PAIRED_BRACKET = 0x400D, + /**< String property Bidi_Paired_Bracket. */ I18N_UCHAR_STRING_LIMIT, /**< One more than the last constant for string Unicode properties. */ I18N_UCHAR_SCRIPT_EXTENSIONS = 0x7000, @@ -580,6 +582,22 @@ typedef enum { } i18n_uchar_uproperty_e; /** + * @brief Bidi Paired Bracket Type constants. + * @since_tizen 3.0 + * @see I18N_UCHAR_BIDI_PAIRED_BRACKET_TYPE + * + */ +typedef enum { + I18N_UCHAR_U_BPT_NONE, /**< Not a paired bracket. */ + + I18N_UCHAR_U_BPT_OPEN, /**< Open paired bracket. */ + + I18N_UCHAR_U_BPT_CLOSE, /**< Close paired bracket. */ + + I18N_UCHAR_U_BPT_COUNT /**< Count */ +} i18n_uchar_u_bidi_paired_bracket_type_e; + +/** * @brief Constants for Unicode blocks, see the Unicode Data file Blocks.txt. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -798,6 +816,38 @@ typedef enum { I18N_UCHAR_UBLOCK_TRANSPORT_AND_MAP_SYMBOLS, /**< Transport And Map Symbols */ I18N_UCHAR_UBLOCK_ALCHEMICAL_SYMBOLS, /**< Alchemical Symbols */ I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D, /**< CJK Unified Ideographs Extension D */ + I18N_UCHAR_UBLOCK_BASSA_VAH = 221, /**< Bassa Vah (Since 3.0) */ + I18N_UCHAR_UBLOCK_CAUCASIAN_ALBANIAN = 222, /**< Caucasian Albanian (Since 3.0) */ + I18N_UCHAR_UBLOCK_COPTIC_EPACT_NUMBERS = 223, /**< Coptic Epact Numbers (Since 3.0) */ + I18N_UCHAR_UBLOCK_COMBINING_DIACRITICAL_MARKS_EXTENDED = 224, /**< Combining Diacritical Marks Extended (Since 3.0) */ + I18N_UCHAR_UBLOCK_DUPLOYAN = 225, /**< Duployan (Since 3.0) */ + I18N_UCHAR_UBLOCK_ELBASAN = 226, /**< Elbasan (Since 3.0) */ + I18N_UCHAR_UBLOCK_GEOMETRIC_SHAPES_EXTENDED = 227, /**< Geometric Shapes Extended (Since 3.0) */ + I18N_UCHAR_UBLOCK_GRANTHA = 228, /**< Grantha (Since 3.0) */ + I18N_UCHAR_UBLOCK_KHOJKI = 229, /**< Khojki (Since 3.0) */ + I18N_UCHAR_UBLOCK_KHUDAWADI = 230, /**< Khudawadi (Since 3.0) */ + I18N_UCHAR_UBLOCK_LATIN_EXTENDED_E = 231, /**< Latin Extended E (Since 3.0) */ + I18N_UCHAR_UBLOCK_LINEAR_A = 232, /**< Linear A (Since 3.0) */ + I18N_UCHAR_UBLOCK_MAHAJANI = 233, /**< Mahajani (Since 3.0) */ + I18N_UCHAR_UBLOCK_MANICHAEAN = 234, /**< Manichaean (Since 3.0) */ + I18N_UCHAR_UBLOCK_MENDE_KIKAKUI = 235, /**< Mende Kikakui (Since 3.0) */ + I18N_UCHAR_UBLOCK_MODI = 236, /**< Modi (Since 3.0) */ + I18N_UCHAR_UBLOCK_MRO = 237, /**< Mro (Since 3.0) */ + I18N_UCHAR_UBLOCK_MYANMAR_EXTENDED_B = 238, /**< Myanmar Extended B (Since 3.0) */ + I18N_UCHAR_UBLOCK_NABATAEAN = 239, /**< Nabataean (Since 3.0) */ + I18N_UCHAR_UBLOCK_OLD_NORTH_ARABIAN = 240, /**< Old North Arabian (Since 3.0) */ + I18N_UCHAR_UBLOCK_OLD_PERMIC = 241, /**< Old Permic (Since 3.0) */ + I18N_UCHAR_UBLOCK_ORNAMENTAL_DINGBATS = 242, /**< Ornamental Dingbats (Since 3.0) */ + I18N_UCHAR_UBLOCK_PAHAWH_HMONG = 243, /**< Pahawh Hmong (Since 3.0) */ + I18N_UCHAR_UBLOCK_PALMYRENE = 244, /**< Palmyrene (Since 3.0) */ + I18N_UCHAR_UBLOCK_PAU_CIN_HAU = 245, /**< Pau Cin Hau (Since 3.0) */ + I18N_UCHAR_UBLOCK_PSALTER_PAHLAVI = 246, /**< Psalter Pahlavi (Since 3.0) */ + I18N_UCHAR_UBLOCK_SHORTHAND_FORMAT_CONTROLS = 247, /**< Shorthand Format Controls (Since 3.0) */ + I18N_UCHAR_UBLOCK_SIDDHAM = 248, /**< Siddham (Since 3.0) */ + I18N_UCHAR_UBLOCK_SINHALA_ARCHAIC_NUMBERS = 249, /**< Sinhala Archaic Numbers (Since 3.0) */ + I18N_UCHAR_UBLOCK_SUPPLEMENTAL_ARROWS_C = 250, /**< Supplemental Arrows C (Since 3.0) */ + I18N_UCHAR_UBLOCK_TIRHUTA = 251, /**< Tirhuta (Since 3.0) */ + I18N_UCHAR_UBLOCK_WARANG_CITI = 252, /**< Warang Citi (Since 3.0) */ I18N_UCHAR_UBLOCK_COUNT, /**< Count */ I18N_UCHAR_UBLOCK_INVALID_CODE = -1 /**< Invalid Code */ } i18n_uchar_ublock_code_e; @@ -826,6 +876,10 @@ typedef enum { I18N_UCHAR_U_POP_DIRECTIONAL_FORMAT, /**< PDF */ I18N_UCHAR_U_DIR_NON_SPACING_MARK, /**< NSM */ I18N_UCHAR_U_BOUNDARY_NEUTRAL, /**< BN */ + I18N_UCHAR_U_FIRST_STRONG_ISOLATE, /**< FSI (Since 3.0) */ + I18N_UCHAR_U_LEFT_TO_RIGHT_ISOLATE, /**< FSI (Since 3.0) */ + I18N_UCHAR_U_RIGHT_TO_LEFT_ISOLATE, /**< RLI (Since 3.0) */ + I18N_UCHAR_U_POP_DIRECTIONAL_ISOLATE, /**< PDI (Since 3.0) */ I18N_UCHAR_U_CHAR_DIRECTION_COUNT /**< Count */ } i18n_uchar_direction_e; @@ -972,6 +1026,34 @@ typedef enum { I18N_UCHAR_U_JG_FARSI_YEH, /**< Farsi Yeh */ I18N_UCHAR_U_JG_NYA, /**< Nya */ I18N_UCHAR_U_JG_ROHINGYA_YEH, /**< Rohingya Yeh */ + I18N_UCHAR_U_JG_MANICHAEAN_ALEPH, /**< Manichaean Aleph (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_AYIN, /**< Manichaean Ayin (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_BETH, /**< Manichaean Beth (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_DALETH, /**< Manichaean Daleth (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_DHAMEDH, /**< Manichaean Dhamedh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_FIVE, /**< Manichaean Five (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_GIMEL, /**< Manichaean Gimel (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_HETH, /**< Manichaean Heth (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_HUNDRED, /**< Manichaean Hundred (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_KAPH, /**< Manichaean Kaph (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_LAMEDH, /**< Manichaean Lamedh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_MEM, /**< Manichaean Mem (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_NUN, /**< Manichaean Nun (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_ONE, /**< Manichaean One (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_PE, /**< Manichaean Pe (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_QOPH, /**< Manichaean Qoph (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_RESH, /**< Manichaean Resh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_SADHE, /**< Manichaean Sadhe (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_SAMEKH, /**< Manichaean Samekh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_TAW, /**< Manichaean Taw (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_TEN, /**< Manichaean Ten (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_TETH, /**< Manichaean Teth (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_THAMEDH, /**< Manichaean Thamedh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_TWENTY, /**< Manichaean Twenty (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_WAW, /**< Manichaean Waw (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_YODH, /**< Manichaean Yodh (Since 3.0) */ + I18N_UCHAR_U_JG_MANICHAEAN_ZAYIN, /**< Manichaean Zayin (Since 3.0) */ + I18N_UCHAR_U_JG_STRAIGHT_WAW, /**< Manichaean Waw (Since 3.0) */ I18N_UCHAR_U_JG_COUNT /**< Count */ } i18n_uchar_u_joining_group_e; @@ -1102,6 +1184,10 @@ typedef enum { I18N_UCHAR_U_WB_LF, /**< [LF] */ I18N_UCHAR_U_WB_MIDNUMLET, /**< [MB] */ I18N_UCHAR_U_WB_NEWLINE, /**< [NL] */ + I18N_UCHAR_U_WB_REGIONAL_INDICATOR, /**< [RI] (Since 3.0) */ + I18N_UCHAR_U_WB_HEBREW_LETTER, /**< [HL] (Since 3.0) */ + I18N_UCHAR_U_WB_SINGLE_QUOTE, /**< [SQ] (Since 3.0) */ + I18N_UCHAR_U_WB_DOUBLE_QUOTE, /**< [DQ] (Since 3.0) */ I18N_UCHAR_U_WB_COUNT /**< */ } i18n_uchar_u_word_break_values_e; @@ -1253,9 +1339,9 @@ typedef enum { * @since_tizen 2.4 */ typedef enum { - I18N_UNORMALIZATION_NO, /**< The input string is not in the normalization form. */ - I18N_UNORMALIZATION_YES, /**< The input string is in the normalization form. */ - I18N_UNORMALIZATION_MAYBE /**< The input string may or may not be in the normalization form. */ + I18N_UNORMALIZATION_NO, /**< The input string is not in the normalization form. */ + I18N_UNORMALIZATION_YES, /**< The input string is in the normalization form. */ + I18N_UNORMALIZATION_MAYBE /**< The input string may or may not be in the normalization form. */ } i18n_unormalization_check_result_e; /** @@ -1626,6 +1712,281 @@ typedef enum { I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_STANDALONE = (I18N_UDISPCTX_TYPE_CAPITALIZATION<<8) + 4, /**< Capitalization: For standalone */ } i18n_udisplay_context_e; +/* Skeletons for dates. */ + +/** + * @brief Constant for date skeleton with year. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_YEAR "y" + +/** + * @brief Constant for date skeleton with quarter. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_QUARTER "QQQQ" + +/** + * @brief Constant for date skeleton with abbreviated quarter. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_ABBR_QUARTER "QQQ" + +/** + * @brief Constant for date skeleton with year and quarter. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_YEAR_QUARTER "yQQQQ" + +/** + * @brief Constant for date skeleton with year and abbreviated quarter. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_YEAR_ABBR_QUARTER "yQQQ" + +/** + * @brief Constant for date skeleton with month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_MONTH "MMMM" + +/** + * @brief Constant for date skeleton with abbreviated month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ + +#define I18N_UDATE_ABBR_MONTH "MMM" + +/** + * @brief Constant for date skeleton with numeric month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_NUM_MONTH "M" + +/** + * @brief Constant for date skeleton with year and month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_MONTH "yMMMM" + +/** + * @brief Constant for date skeleton with year and abbreviated month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_ABBR_MONTH "yMMM" + +/** + * @brief Constant for date skeleton with year and numeric month. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_NUM_MONTH "yM" + +/** + * @brief Constant for date skeleton with day. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_DAY "d" + +/** + * @brief Constant for date skeleton with year, month, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_MONTH_DAY "yMMMMd" + +/** + * @brief Constant for date skeleton with year, abbreviated month, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_ABBR_MONTH_DAY "yMMMd" + +/** + * @brief Constant for date skeleton with year, numeric month, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_NUM_MONTH_DAY "yMd" + +/** + * @brief Constant for date skeleton with weekday. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_WEEKDAY "EEEE" + +/** + * @brief Constant for date skeleton with abbreviated weekday. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_ABBR_WEEKDAY "E" + +/** + * @brief Constant for date skeleton with year, month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd" + +/** + * @brief Constant for date skeleton with year, abbreviated month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd" + +/** + * @brief Constant for date skeleton with year, numeric month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd" + +/** + * @brief Constant for date skeleton with long month and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_MONTH_DAY "MMMMd" + +/** + * @brief Constant for date skeleton with abbreviated month and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_ABBR_MONTH_DAY "MMMd" + +/** + * @brief Constant for date skeleton with numeric month and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_NUM_MONTH_DAY "Md" + +/** + * @brief Constant for date skeleton with month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_MONTH_WEEKDAY_DAY "MMMMEEEEd" + +/** + * @brief Constant for date skeleton with abbreviated month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_ABBR_MONTH_WEEKDAY_DAY "MMMEd" + +/** + * @brief Constant for date skeleton with numeric month, weekday, and day. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_NUM_MONTH_WEEKDAY_DAY "MEd" + +/* Skeletons for times. */ + +/** + * @brief Constant for date skeleton with hour, with the locale's preferred hour format (12 or 24). + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR "j" + +/** + * @brief Constant for date skeleton with hour in 24-hour presentation. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR24 "H" + +/** + * @brief Constant for date skeleton with minute. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_MINUTE "m" + +/** + * @brief Constant for date skeleton with hour and minute, with the locale's preferred hour format (12 or 24). + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR_MINUTE "jm" + +/** + * @brief Constant for date skeleton with hour and minute in 24-hour presentation. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR24_MINUTE "Hm" + +/** + * @brief Constant for date skeleton with second. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_SECOND "s" + +/** + * @brief Constant for date skeleton with hour, minute, and second, + * with the locale's preferred hour format (12 or 24). + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR_MINUTE_SECOND "jms" + +/** + * @brief Constant for date skeleton with hour, minute, and second in + * 24-hour presentation. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_HOUR24_MINUTE_SECOND "Hms" + +/** + * @brief Constant for date skeleton with minute and second. + * @details Used in combinations date + time, date + time + zone, or time + zone. + * @since_tizen 3.0 + * @see i18n_udatepg_get_best_pattern() + */ +#define I18N_UDATE_MINUTE_SECOND "ms" + /** * @} * @} @@ -1741,7 +2102,7 @@ typedef enum { I18N_UNUMBER_CURRENCY_ISO, /**< Currency format with an ISO currency code, e.g., "USD1.00" */ I18N_UNUMBER_CURRENCY_PLURAL, /**< Currency format with a pluralized currency name, e.g., "1.00 US dollar" and "3.00 US dollars" */ - I18N_UNUMBER_FORMAT_STYLE_COUNT = I18N_UNUMBER_CURRENCY_PLURAL + 2, /**< One more than the highest number format style constant */ + I18N_UNUMBER_FORMAT_STYLE_COUNT, /**< One more than the highest number format style constant */ I18N_UNUMBER_DEFAULT = I18N_UNUMBER_DECIMAL, /**< Default format */ I18N_UNUMBER_IGNORE = I18N_UNUMBER_PATTERN_DECIMAL /**< Alias for #I18N_UNUMBER_PATTERN_DECIMAL */ } i18n_unumber_format_style_e; @@ -1778,7 +2139,7 @@ typedef enum { I18N_UNUMBER_SEVEN_DIGIT_SYMBOL = 24, /**< Seven */ I18N_UNUMBER_EIGHT_DIGIT_SYMBOL = 25, /**< Eight */ I18N_UNUMBER_NINE_DIGIT_SYMBOL = 26, /**< Nine */ - I18N_UNUMBER_FORMAT_SYMBOL_COUNT = 27 /**< Number of enumerators */ + I18N_UNUMBER_FORMAT_SYMBOL_COUNT /**< Number of enumerators */ } i18n_unumber_format_symbol_e; /** @@ -1823,17 +2184,21 @@ typedef enum { * @since_tizen 2.3.1 */ typedef enum { - I18N_UNUMBER_POSITIVE_PREFIX, /**< Positive prefix */ - I18N_UNUMBER_POSITIVE_SUFFIX, /**< Positive suffix */ - I18N_UNUMBER_NEGATIVE_PREFIX, /**< Negative prefix */ - I18N_UNUMBER_NEGATIVE_SUFFIX, /**< Negative suffix */ - I18N_UNUMBER_PADDING_CHARACTER, /**< The character used to pad to the format width */ - I18N_UNUMBER_CURRENCY_CODE, /**< The ISO currency code */ - I18N_UNUMBER_DEFAULT_RULESET, /**< The default rule set, such as "%spellout-numbering-year:", "%spellout-cardinal:", "%spellout-ordinal-masculine-plural:", "%spellout-ordinal-feminine:", or "%spellout-ordinal-neuter:". - The available public rulesets can be listed using i18n_unumber_get_text_attribute() with #I18N_UNUMBER_PUBLIC_RULESETS. This is only available with rule-based formatters */ - I18N_UNUMBER_PUBLIC_RULESETS, /**< The public rule sets. This is only available with rule-based formatters. This is a read-only attribute. - The public rulesets are returned as a single string, with each ruleset name delimited by ';' (semicolon). - See the CLDR LDML spec for more information about RBNF rulesets: http://www.unicode.org/reports/tr35/tr35-numbers.html#Rule-Based_Number_Formatting */ + I18N_UNUMBER_POSITIVE_PREFIX, /**< Positive prefix */ + I18N_UNUMBER_POSITIVE_SUFFIX, /**< Positive suffix */ + I18N_UNUMBER_NEGATIVE_PREFIX, /**< Negative prefix */ + I18N_UNUMBER_NEGATIVE_SUFFIX, /**< Negative suffix */ + I18N_UNUMBER_PADDING_CHARACTER, /**< The character used to pad to the format width */ + I18N_UNUMBER_CURRENCY_CODE, /**< The ISO currency code */ + I18N_UNUMBER_DEFAULT_RULESET, /**< The default rule set, such as "%spellout-numbering-year:", "%spellout-cardinal:", + "%spellout-ordinal-masculine-plural:", "%spellout-ordinal-feminine:" + or "%spellout-ordinal-neuter:". + The available public rulesets can be listed using i18n_unumber_get_text_attribute() + with #I18N_UNUMBER_PUBLIC_RULESETS. This is only available with rule-based formatters */ + I18N_UNUMBER_PUBLIC_RULESETS, /**< The public rule sets. This is only available with rule-based formatters. This is a read-only attribute. + The public rulesets are returned as a single string, with each ruleset name delimited by ';' (semicolon). + See the CLDR LDML spec for more information about RBNF rulesets: + http://www.unicode.org/reports/tr35/tr35-numbers.html#Rule-Based_Number_Formatting */ } i18n_unumber_format_text_attribute_e; /** @@ -1869,6 +2234,99 @@ typedef enum { #define I18N_ULOCALE_US "en_US" /**< Useful constant for en_US. @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif*/ /** + * @brief Useful constant for the maximum size of the language part of a locale ID. + * (including the terminating NULL). + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + * @see i18n_ulocale_get_language() + */ +#define I18N_ULOCALE_LANG_CAPACITY 12 + +/** + * @brief Useful constant for the maximum size of the country part of a locale ID + * (including the terminating NULL). + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + * @see i18n_ulocale_get_country() + */ +#define I18N_ULOCALE_COUNTRY_CAPACITY 4 +/** + * @brief Useful constant for the maximum size of the whole locale ID + * (including the terminating NULL and all keywords). + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_FULLNAME_CAPACITY 157 + +/** + * @brief Useful constant for the maximum size of the script part of a locale ID + * (including the terminating NULL). + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + * @see i18n_ulocale_get_script() + */ +#define I18N_ULOCALE_SCRIPT_CAPACITY 6 + +/** + * @brief Useful constant for the maximum size of keywords in a locale + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORDS_CAPACITY 96 + +/** + * @brief Useful constant for the maximum total size of keywords and their values in a locale + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_AND_VALUES_CAPACITY 100 + +/** + * @brief Invariant character separating keywords from the locale string + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_SEPARATOR '@' + +/** + * @brief Unicode code point for '@' separating keywords from the locale string. + * @since_tizen 3.0 + * @see #I18N_ULOCALE_KEYWORD_SEPARATOR + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_SEPARATOR_UNICODE 0x40 + +/** + * @brief Invariant character for assigning value to a keyword + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_ASSIGN '=' + +/** + * @brief Unicode code point for '=' for assigning value to a keyword. + * @since_tizen 3.0 + * @see #I18N_ULOCALE_KEYWORD_ASSIGN + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_ASSIGN_UNICODE 0x3D + +/** + * @brief Invariant character separating keywords + * @since_tizen 3.0 + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_ITEM_SEPARATOR ';' + +/** + * @brief Unicode code point for ';' separating keywords + * @since_tizen 3.0 + * @see #I18N_ULOCALE_KEYWORD_ITEM_SEPARATOR + * @see i18n_ulocale_get_keyword_value() + */ +#define I18N_ULOCALE_KEYWORD_ITEM_SEPARATOR_UNICODE 0x3B + +/** * @brief Enumeration for the 'out_result' parameter return value * @since_tizen 2.3.1 * @@ -1924,7 +2382,7 @@ typedef enum { * * @retval character the character represented by the escape sequence at offset * - * @see #i18n_ustring_unescape_at() + * @see i18n_ustring_unescape_at() */ typedef i18n_uchar(* i18n_ustring_unescape_char_at_cb)(int32_t offset, void *context); @@ -2018,6 +2476,7 @@ typedef void* i18n_ubreak_iterator_s; typedef void* i18n_ubreak_iterator_h; /** + * @deprecated Deprecated since Tizen 3.0 * @brief A recommended size (in bytes) for the memory buffer to be passed to i18n_ubrk_safe_clone(). * @since_tizen 2.3.1 */ @@ -2349,11 +2808,11 @@ typedef enum { I18N_USCRIPT_ANATOLIAN_HIEROGLYPHS = 156,/**< Hluw */ I18N_USCRIPT_KHOJKI = 157,/**< Khoj */ I18N_USCRIPT_TIRHUTA = 158,/**< Tirh */ -I18N_USCRIPT_CODE_LIMIT = 159 /**< Count of i18n_uscript_code_e enumerators*/ + I18N_USCRIPT_CODE_LIMIT = 159 /**< Count of i18n_uscript_code_e enumerators*/ } i18n_uscript_code_e; #ifdef __cplusplus } #endif -#endif /* __UTILS_I18N_TYPES_H__*/ +#endif /* __UTILS_I18N_TYPES_H__*/ diff --git a/src/include/wearable/utils_i18n_ubrk.h b/src/include/wearable/utils_i18n_ubrk.h index 23cf7aa..c8a6fa0 100755 --- a/src/include/wearable/utils_i18n_ubrk.h +++ b/src/include/wearable/utils_i18n_ubrk.h @@ -177,13 +177,12 @@ int32_t i18n_ubrk_next (i18n_ubreak_iterator_h break_iter); int32_t i18n_ubrk_previous (i18n_ubreak_iterator_h break_iter); /** - * @brief Sets the iterator position to the index of the first character in the text being scanned. - * @details This is not always the same as index @c 0 of the text. - * @remarks The specific error code can be obtained using the get_last_result() method. + * @brief Sets the iterator position to zero, the start of the text being scanned. + * * @remarks The specific error code can be obtained using the get_last_result() method. * Error codes are described in Exceptions section. * @since_tizen 2.3.1 * @param[in] break_iter The break iterator to use. Must not be @c NULL. - * @return The character index of the first character in the text being scanned. + * @return The new iterator position (zero). * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_last() diff --git a/src/include/wearable/utils_i18n_ucollator.h b/src/include/wearable/utils_i18n_ucollator.h index cd129da..4a40674 100755 --- a/src/include/wearable/utils_i18n_ucollator.h +++ b/src/include/wearable/utils_i18n_ucollator.h @@ -125,7 +125,14 @@ extern "C" { /** * @brief Creates a i18n_ucollator_h for comparing strings. - * @details The i18n_ucollator_h is used in all the calls to the Collation service.\n + * @details For some languages, multiple collation types are available; + * for example, "de@collation=phonebook". + * Collation attributes can be specified via locale keywords as well, + * in the old locale extension syntax ("el@colCaseFirst=upper") + * or in language tag syntax ("el-u-kf-upper"). + * See User Guide: Collation API. + * + * The i18n_ucollator_h is used in all the calls to the Collation service.\n * After finished, collator must be disposed off by calling {@link #i18n_ucollator_destroy()}. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks Must release @a collator using i18n_ucollator_destroy(). diff --git a/src/include/wearable/utils_i18n_udatepg.h b/src/include/wearable/utils_i18n_udatepg.h index 174690b..d46317d 100755 --- a/src/include/wearable/utils_i18n_udatepg.h +++ b/src/include/wearable/utils_i18n_udatepg.h @@ -37,7 +37,8 @@ * @details The Udatepg module provides flexible generation of date format patterns, * like "yy-MM-dd". The user can build up the generator by adding successive patterns. * Once that is done, a query can be made using a "skeleton", which is a pattern that - * just includes the desired fields and lengths. The generator will return the + * just includes the desired fields and lengths(Since Tizen 3.0 constants for skeletons are available - + * see #I18N_UDATE_YEAR and many, many others). The generator will return the * "best fit" pattern corresponding to that skeleton.\n * The main method people will use is i18n_udatepg_get_best_pattern(), since normally * #i18n_udatepg_h is pre-built with data from a particular locale. diff --git a/src/include/wearable/utils_i18n_ulocale.h b/src/include/wearable/utils_i18n_ulocale.h index 51d6e89..a180152 100644 --- a/src/include/wearable/utils_i18n_ulocale.h +++ b/src/include/wearable/utils_i18n_ulocale.h @@ -442,7 +442,8 @@ int32_t i18n_ulocale_get_display_variant ( const char *locale, const char *displ * int32_t keyword_count = 0; * i18n_uchar display_keyword[256]; * int32_t display_keyword_len = 0; - * i18n_uenumeration_h keyword_enum = i18n_ulocale_keywords_create("de_DE@collation=PHONEBOOK;calendar=TRADITIONAL"); + * i18n_uenumeration_h keyword_enum; + * i18n_ulocale_keywords_create("en_US@collation=PHONEBOOK;calendar=TRADITIONAL", &keyword_enum); * * for(keyword_count = i18n_uenumeration_count(keyword_enum); keyword_count > 0; keyword_count--){ * status = get_last_result(); @@ -484,7 +485,8 @@ int32_t i18n_ulocale_get_display_keyword ( const char *keyword, const char *disp /** * @brief Gets the value of the keyword suitable for display for the specified locale. - * @details E.g : for the locale string de_DE\@collation=PHONEBOOK, this API gets the display string for PHONEBOOK, in the display locale, when "collation" is specified as the keyword. + * @details E.g : for the locale string de_DE\@collation=PHONEBOOK, this API gets the display string for PHONEBOOK, + * in the display locale, when "collation" is specified as the keyword. * @remarks The specific error code can be obtained using the get_last_result() method. * Error codes are described in Exceptions section and #i18n_error_code_e description. * @since_tizen 2.3.1 @@ -567,7 +569,7 @@ const char * const *i18n_ulocale_get_iso_countries ( void ); int32_t i18n_ulocale_get_parent ( const char *locale_id, char *parent, int32_t parent_capacity ); /** - * @brief Gets the full name for the specified locale. + * @brief Gets the full name for the specified locale, like i18n_ulocale_get_name(), but without keywords. * @details Note : This has the effect of 'canonicalizing' the string to a certain extent. * Upper and lower case are set as needed, * and if the components were in 'POSIX' format they are changed to I18N format. @@ -628,13 +630,61 @@ int32_t i18n_ulocale_get_keyword_value ( const char *locale_id, const char *keyw /** * @brief Sets or removes the value of the specified keyword. - * @details For removing all keywords, use i18n_ulocale_get_base_name(). + * @details For removing all keywords(retrieving only locale base name associated with the keywords), + * use i18n_ulocale_get_base_name(). * * NOTE : Unlike almost every other I18N function which takes a * buffer, this function will NOT truncate the output text. If a * #I18N_ERROR_BUFFER_OVERFLOW is received, it means that the original * buffer is untouched. This is done to prevent incorrect or possibly * even malformed locales from being generated and used. + * + * Below code prints following logs in SDK: + * + * Locale and keywords: en_US@abc=12;def=34 + * keyword1: abc + * keyword2: def + * Locale: en_US + * Keyword1 value: 12 + * + * @code + * int32_t buff_size = 50; + * int32_t sub_buff_size = 45; + * char *buff = malloc(sizeof(char)*buff_size); + * char *sub_buff = malloc(sizeof(char)*sub_buff_size); + * char *locale = "en_US"; + * + * snprintf(buff, buff_size, "%s%s",locale, sub_buff); + * + * i18n_ulocale_set_keyword_value("abc", "cba", buff, buff_size); + * i18n_ulocale_set_keyword_value("def", "34", buff, buff_size); + * + * i18n_uenumeration_h keyword_enum; + * i18n_ulocale_keywords_create(buff, &keyword_enum); + * + * int32_t res_len = 0; + * const char *keyw = i18n_uenumeration_next(keyword_enum, &res_len); + * const char *keyw2 = i18n_uenumeration_next(keyword_enum, &res_len); + * + * char *only_locale = malloc(sizeof(char)*10); + * i18n_ulocale_get_base_name(buff, only_locale, 10); + * + * int32_t buff_size_get = 50; + * char *buff_out = malloc(sizeof(char)*buff_size_get); + * i18n_ulocale_get_keyword_value(buff, "abc", buff_out, buff_size_get); + * + * dlog_print(DLOG_DEBUG, "test", "Locale and keywords: %s", buff); + * dlog_print(DLOG_DEBUG, "test", "keyword1: %s", keyw); + * dlog_print(DLOG_DEBUG, "test", "keyword2: %s", keyw2); + * dlog_print(DLOG_DEBUG, "test", "Locale: %s", only_locale); + * dlog_print(DLOG_DEBUG, "test", "Keyword1 value: %s", buff_out); + * + * i18n_uenumeration_destroy(keyword_enum) + * free(buff); + * free(sub_buff); + * free(only_locale); + * free(buff_out); + * @endcode * @remarks The specific error code can be obtained using the get_last_result() method. * Error codes are described in Exceptions section and #i18n_error_code_e description. * @since_tizen 2.3.1 diff --git a/src/include/wearable/utils_i18n_unumber.h b/src/include/wearable/utils_i18n_unumber.h index c25d665..f1e7cf3 100644 --- a/src/include/wearable/utils_i18n_unumber.h +++ b/src/include/wearable/utils_i18n_unumber.h @@ -74,8 +74,8 @@ extern "C" { /** * @brief Creates and returns a new unumber_format_h for formatting and parsing numbers. - * @details A unumber_format_style_e may be used to format numbers by calling {@link i18n_unumber_create()}. - * The caller must call {@link #i18n_unumber_destroy() } when done to release resources used by this object. + * @details A unumber_format_style_e may be used to format numbers by calling i18n_unumber_create(). + * The caller must call i18n_unumber_destroy() when done to release resources used by this object. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks Must release @a num_format using i18n_unumber_destroy(). * @@ -84,6 +84,8 @@ extern "C" { * #I18N_UNUMBER_CURRENCY, * #I18N_UNUMBER_PERCENT, * #I18N_UNUMBER_SCIENTIFIC, + * #I18N_UNUMBER_CURRENCY_ISO, + * #I18N_UNUMBER_CURRENCY_PLURAL, * #I18N_UNUMBER_SPELLOUT, * #I18N_UNUMBER_ORDINAL, * #I18N_UNUMBER_DURATION, diff --git a/src/include/wearable/utils_i18n_usearch.h b/src/include/wearable/utils_i18n_usearch.h index eb76f89..8b1e1b9 100755 --- a/src/include/wearable/utils_i18n_usearch.h +++ b/src/include/wearable/utils_i18n_usearch.h @@ -106,7 +106,7 @@ int i18n_usearch_create_new ( const i18n_uchar *pattern, int32_t pattern_len, co /** * @brief Destroys and cleans up the i18n_usearch_h. - * @details If a collator is created in i18n_usearch_create_new(), it will be destroyed here. + * @details If a collator is created in i18n_usearch_create(), it will be destroyed here. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @param[in] search_iter The i18n_usearch_h to clean up diff --git a/src/include/wearable/utils_i18n_ustring.h b/src/include/wearable/utils_i18n_ustring.h index 247969d..4e67aa0 100755 --- a/src/include/wearable/utils_i18n_ustring.h +++ b/src/include/wearable/utils_i18n_ustring.h @@ -976,6 +976,7 @@ int32_t i18n_ustring_to_lower ( i18n_uchar *dest, int32_t dest_capacity, const i * only some of the result were written to the destination buffer. * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter + * @see i18n_ustring_to_title() */ int32_t i18n_ustring_to_title_new ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, i18n_ubreak_iterator_h title_iter, const char *locale); @@ -1101,7 +1102,6 @@ i18n_uchar* i18n_ustring_from_UTF8 ( i18n_uchar *dest, int32_t dest_capacity, in /** * @brief Convert a UTF-16 string to UTF-8. - * @details If the input string is not well-formed, then the #I18N_ERROR_INVALID_CHAR_FOUND error code is set. * Same as #i18n_ustring_to_UTF8() except for the additional sub_char which is output for illegal input sequences, instead of stopping with the #I18N_ERROR_INVALID_CHAR_FOUND error code. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -1121,10 +1121,8 @@ i18n_uchar* i18n_ustring_from_UTF8 ( i18n_uchar *dest, int32_t dest_capacity, in * A substitution character can be any valid Unicode code point (up to U+10FFFF) except for surrogate code points (U+D800..U+DFFF). * The recommended value is U+FFFD "REPLACEMENT CHARACTER". * @param[out] num_substitutions Output parameter receiving the number of substitutions if sub_char>=0. Set to 0 if no substitutions occur or sub_char<0. num_substitutions can be NULL. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) + * @param[out] error_codeMust be a valid pointer to an error code value, + * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter @@ -1135,7 +1133,6 @@ char* i18n_ustring_to_UTF8_with_sub ( char *dest, int32_t dest_capacity, int32_t /** * @brief Convert a UTF-8 string to UTF-16. - * @details Same as #i18n_ustring_from_UTF8() except for the additional sub_char which is output for illegal input sequences, instead of stopping with the #I18N_ERROR_INVALID_CHAR_FOUND error code. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @param[out] dest A buffer for the result string.\n @@ -1154,10 +1151,8 @@ char* i18n_ustring_to_UTF8_with_sub ( char *dest, int32_t dest_capacity, int32_t * A substitution character can be any valid Unicode code point (up to U+10FFFF) except for surrogate code points (U+D800..U+DFFF). * The recommended value is U+FFFD "REPLACEMENT CHARACTER". * @param[out] num_substitutions Output parameter receiving the number of substitutions if sub_char>=0. Set to 0 if no substitutions occur or sub_char<0. num_substitutions can be NULL. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) + * @param[out] error_code Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter @@ -1195,10 +1190,8 @@ i18n_uchar* i18n_ustring_from_UTF8_with_sub ( i18n_uchar *dest, int32_t dest_cap * @param[in] src The original source string * @param[in] src_len The length of the original string.\n * If @c -1, then @a src must be zero-terminated. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) + * @param[out] error_code Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter @@ -1250,7 +1243,6 @@ i18n_uchar32* i18n_ustring_to_UTF32 ( i18n_uchar32 *dest, int32_t dest_capacity, * @param[in] src The original source string * @param[in] src_len The length of the original string.\n * If @c -1, then @a src must be zero-terminated. - * * @param[out] error_code Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The pointer to destination buffer. @@ -1281,10 +1273,8 @@ i18n_uchar* i18n_ustring_from_UTF32 ( i18n_uchar *dest, int32_t dest_capacity, i * A substitution character can be any valid Unicode code point (up to U+10FFFF) except for surrogate code points (U+D800..U+DFFF). * The recommended value is U+FFFD "REPLACEMENT CHARACTER". * @param[out] num_substitutions Output parameter receiving the number of substitutions if sub_char>=0. Set to 0 if no substitutions occur or sub_char<0. num_substitutions can be NULL. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) + * @param[out] error_code Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter @@ -1296,7 +1286,6 @@ i18n_uchar32* i18n_ustring_to_UTF32_with_sub ( i18n_uchar32 *dest, int32_t dest_ /** * @brief Convert a UTF-32 string to UTF-16. - * @details If the input string is not well-formed, then the #I18N_ERROR_INVALID_CHAR_FOUND error code is set. * Same as #i18n_ustring_from_UTF32() except for the additional sub_char which is output for illegal input sequences, instead of stopping with the #I18N_ERROR_INVALID_CHAR_FOUND error code. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -1315,11 +1304,9 @@ i18n_uchar32* i18n_ustring_to_UTF32_with_sub ( i18n_uchar32 *dest, int32_t dest_ * A substitution character can be any valid Unicode code point (up to U+10FFFF) except for surrogate code points (U+D800..U+DFFF). * The recommended value is U+FFFD "REPLACEMENT CHARACTER". * @param[out] num_substitutions Output parameter receiving the number of substitutions if sub_char>=0. Set to 0 if no substitutions occur or sub_char<0. num_substitutions can be NULL. - * @param[out] error_code Pointer to a standard ICU error code. Its input value must - * pass the U_SUCCESS() test, or else the function returns - * immediately. Check for U_FAILURE() on output or use with - * function chaining. (See User Guide for details.) - * @return[out] The pointer to destination buffer. + * @param[out] error_code Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * @return The pointer to destination buffer. * * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter -- 2.7.4 From 1c015acfd73f1d1e8fb7cbf917ee71a61e4d78eb Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Mon, 28 Mar 2016 14:56:52 +0900 Subject: [PATCH 13/16] Fix bug - don't delete timezone object Change-Id: I3ff6e00affd052eaf11e72b7c995a204c99e0456 --- packaging/capi-base-utils.spec | 2 +- src/utils_i18n_timezone.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packaging/capi-base-utils.spec b/packaging/capi-base-utils.spec index d98fc4b..8fbf2de 100755 --- a/packaging/capi-base-utils.spec +++ b/packaging/capi-base-utils.spec @@ -1,6 +1,6 @@ Name: capi-base-utils Summary: Base Utils -Version: 1.2.1 +Version: 1.2.2 Release: 1 Group: Base License: Apache-2.0 and ICU diff --git a/src/utils_i18n_timezone.cpp b/src/utils_i18n_timezone.cpp index fdd706f..bbe4c71 100755 --- a/src/utils_i18n_timezone.cpp +++ b/src/utils_i18n_timezone.cpp @@ -49,9 +49,6 @@ int i18n_timezone_create_gmt(i18n_timezone_h *timezone) *timezone = gmt->clone(); - if (gmt != NULL) - delete gmt; - retv_if(timezone == NULL, I18N_ERROR_OUT_OF_MEMORY); return I18N_ERROR_NONE; -- 2.7.4 From 41a98845406b3797f5d4f30f5ab2c97ec52f4490 Mon Sep 17 00:00:00 2001 From: Jakub Siewierski Date: Mon, 11 Apr 2016 12:57:49 +0200 Subject: [PATCH 14/16] Apply coding rules Change-Id: Ia8993428d637a5f017b4a14a6f4461ef731ba696 Signed-off-by: Jakub Siewierski --- src/include/mobile/utils_i18n_private.h | 6 +- src/include/mobile/utils_i18n_timezone.h | 10 +- src/include/mobile/utils_i18n_types.h | 20 ++-- src/include/mobile/utils_i18n_ubrk.h | 36 +++---- src/include/mobile/utils_i18n_ucalendar.h | 84 +++++++-------- src/include/mobile/utils_i18n_uchar.h | 4 +- src/include/mobile/utils_i18n_ucollator.h | 38 +++---- src/include/mobile/utils_i18n_udate.h | 64 ++++++------ src/include/mobile/utils_i18n_udatepg.h | 60 +++++------ src/include/mobile/utils_i18n_uenumeration.h | 14 +-- src/include/mobile/utils_i18n_ulocale.h | 74 +++++++------- src/include/mobile/utils_i18n_unormalization.h | 4 +- src/include/mobile/utils_i18n_unumber.h | 54 +++++----- src/include/mobile/utils_i18n_usearch.h | 12 +-- src/include/mobile/utils_i18n_uset.h | 112 ++++++++++---------- src/include/mobile/utils_i18n_ustring.h | 124 +++++++++++------------ src/include/wearable/utils_i18n_private.h | 6 +- src/include/wearable/utils_i18n_timezone.h | 10 +- src/include/wearable/utils_i18n_types.h | 20 ++-- src/include/wearable/utils_i18n_ubrk.h | 36 +++---- src/include/wearable/utils_i18n_ucalendar.h | 84 +++++++-------- src/include/wearable/utils_i18n_uchar.h | 4 +- src/include/wearable/utils_i18n_ucollator.h | 40 ++++---- src/include/wearable/utils_i18n_udate.h | 64 ++++++------ src/include/wearable/utils_i18n_udatepg.h | 60 +++++------ src/include/wearable/utils_i18n_uenumeration.h | 14 +-- src/include/wearable/utils_i18n_ulocale.h | 74 +++++++------- src/include/wearable/utils_i18n_unormalization.h | 4 +- src/include/wearable/utils_i18n_unumber.h | 54 +++++----- src/include/wearable/utils_i18n_usearch.h | 10 +- src/include/wearable/utils_i18n_uset.h | 112 ++++++++++---------- src/include/wearable/utils_i18n_ustring.h | 120 +++++++++++----------- 32 files changed, 714 insertions(+), 714 deletions(-) diff --git a/src/include/mobile/utils_i18n_private.h b/src/include/mobile/utils_i18n_private.h index b981e4f..70783e9 100755 --- a/src/include/mobile/utils_i18n_private.h +++ b/src/include/mobile/utils_i18n_private.h @@ -73,7 +73,7 @@ extern "C" { } while (0) #define retex_if(expr, val, fmt, arg...) do { \ - if(expr) { \ + if (expr) { \ ERR(fmt, ##arg); \ val; \ goto CATCH; \ @@ -86,8 +86,8 @@ extern "C" { #define ERR_MAPPING(ICU_ERROR, BASE_UTILS_ERROR) BASE_UTILS_ERROR = \ (i18n_error_code_e)_i18n_error_mapping((int)ICU_ERROR) -int _i18n_error_mapping ( int err ); -int _i18n_error_mapping_reverse ( int err ); +int _i18n_error_mapping(int err); +int _i18n_error_mapping_reverse(int err); #ifdef __cplusplus } diff --git a/src/include/mobile/utils_i18n_timezone.h b/src/include/mobile/utils_i18n_timezone.h index b34e617..fb768ae 100755 --- a/src/include/mobile/utils_i18n_timezone.h +++ b/src/include/mobile/utils_i18n_timezone.h @@ -72,7 +72,7 @@ extern "C" { * @see i18n_timezone_create() * @see i18n_timezone_create_gmt() */ -int i18n_timezone_create_unknown ( i18n_timezone_h *timezone ); +int i18n_timezone_create_unknown(i18n_timezone_h *timezone); /** * @brief The GMT (=UTC) time zone has a raw offset of zero and does not use daylight savings time. @@ -85,7 +85,7 @@ int i18n_timezone_create_unknown ( i18n_timezone_h *timezone ); * @retval #I18N_ERROR_NONE Successful * @see i18n_timezone_create_unknown() */ -int i18n_timezone_create_gmt ( i18n_timezone_h *timezone ); +int i18n_timezone_create_gmt(i18n_timezone_h *timezone); /** * @brief Creates an i18n_timezone_h for the given timezone_id. @@ -96,7 +96,7 @@ int i18n_timezone_create_gmt ( i18n_timezone_h *timezone ); * * @retval #I18N_ERROR_NONE Successful */ -int i18n_timezone_create ( i18n_timezone_h *timezone, const char *timezone_id ); +int i18n_timezone_create(i18n_timezone_h *timezone, const char *timezone_id); /** * @brief Destroys an i18n_timezone_h. @@ -214,7 +214,7 @@ int i18n_timezone_get_equivalent_id(const char *timezone_id, int32_t index, char * * @retval #I18N_ERROR_NONE Successful */ -int i18n_timezone_create_default ( i18n_timezone_h *timezone ); +int i18n_timezone_create_default(i18n_timezone_h *timezone); /** * @brief Sets the default time zone (i.e., what's returned by #i18n_timezone_create_default()) to be the specified time zone. @@ -230,7 +230,7 @@ int i18n_timezone_create_default ( i18n_timezone_h *timezone ); * * @retval #I18N_ERROR_NONE Successful */ -int i18n_timezone_set_default( i18n_timezone_h timezone ); +int i18n_timezone_set_default(i18n_timezone_h timezone); /** * @brief Returns the timezone data version currently used by I18N. diff --git a/src/include/mobile/utils_i18n_types.h b/src/include/mobile/utils_i18n_types.h index a96cbed..15af948 100644 --- a/src/include/mobile/utils_i18n_types.h +++ b/src/include/mobile/utils_i18n_types.h @@ -169,20 +169,20 @@ typedef enum { #if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32) # ifdef __STDC_ISO_10646__ -# if (U_SIZEOF_WCHAR_T==2) +# if (U_SIZEOF_WCHAR_T == 2) # define U_WCHAR_IS_UTF16 -# elif (U_SIZEOF_WCHAR_T==4) +# elif (U_SIZEOF_WCHAR_T == 4) # define U_WCHAR_IS_UTF32 # endif # elif defined __UCS2__ -# if (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400) && (U_SIZEOF_WCHAR_T==2) +# if (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400) && (U_SIZEOF_WCHAR_T == 2) # define U_WCHAR_IS_UTF16 # endif # elif defined(__UCS4__) || (U_PLATFORM == U_PF_OS400 && defined(__UTF32__)) -# if (U_SIZEOF_WCHAR_T==4) +# if (U_SIZEOF_WCHAR_T == 4) # define U_WCHAR_IS_UTF32 # endif -# elif U_PLATFORM_IS_DARWIN_BASED || (U_SIZEOF_WCHAR_T==4 && U_PLATFORM_IS_LINUX_BASED) +# elif U_PLATFORM_IS_DARWIN_BASED || (U_SIZEOF_WCHAR_T == 4 && U_PLATFORM_IS_LINUX_BASED) # define U_WCHAR_IS_UTF32 # elif U_PLATFORM_HAS_WIN32_API # define U_WCHAR_IS_UTF16 @@ -198,7 +198,7 @@ typedef enum { typedef UCHAR_TYPE i18n_uchar; /* Not #elif U_HAVE_CHAR16_T -- because that is type-incompatible with pre-C++11 callers typedef char16_t i18n_uchar; */ -#elif U_SIZEOF_WCHAR_T==2 +#elif U_SIZEOF_WCHAR_T == 2 typedef wchar_t i18n_uchar; #elif defined(__CHAR16_TYPE__) typedef __CHAR16_TYPE__ i18n_uchar; @@ -1592,7 +1592,7 @@ typedef struct { * @brief Handle to struct representing a range of text containing a specific field. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ -typedef i18n_ufield_position_s* i18n_ufield_position_h; +typedef i18n_ufield_position_s *18n_ufield_position_h; /** * @brief Enumeration for the possible date/time format styles. @@ -1690,7 +1690,7 @@ typedef enum { * @since_tizen 2.3.1 */ -typedef enum{ +typedef enum { I18N_UDISPCTX_TYPE_DIALECT_HANDLING, /**beyond the last character in the text being scanned. @@ -202,7 +202,7 @@ int32_t i18n_ubrk_first (i18n_ubreak_iterator_h break_iter); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_first() */ -int32_t i18n_ubrk_last (i18n_ubreak_iterator_h break_iter); +int32_t i18n_ubrk_last(i18n_ubreak_iterator_h break_iter); /** * @brief Sets the iterator position to the first boundary preceding the specified @c offset. @@ -217,7 +217,7 @@ int32_t i18n_ubrk_last (i18n_ubreak_iterator_h break_iter); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_following() */ -int32_t i18n_ubrk_preceding (i18n_ubreak_iterator_h break_iter, int32_t offset); +int32_t i18n_ubrk_preceding(i18n_ubreak_iterator_h break_iter, int32_t offset); /** * @brief Advances the iterator to the first boundary following the specified @c offset. @@ -232,7 +232,7 @@ int32_t i18n_ubrk_preceding (i18n_ubreak_iterator_h break_iter, int32_t offset); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_preceding() */ -int32_t i18n_ubrk_following (i18n_ubreak_iterator_h break_iter, int32_t offset); +int32_t i18n_ubrk_following(i18n_ubreak_iterator_h break_iter, int32_t offset); /** * @brief Gets a locale for which text breaking information is available. @@ -247,7 +247,7 @@ int32_t i18n_ubrk_following (i18n_ubreak_iterator_h break_iter, int32_t offset); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_count_available() */ -const char *i18n_ubrk_get_available (int32_t index); +const char *i18n_ubrk_get_available(int32_t index); /** * @brief Determines how many locales have text breaking information available. @@ -260,7 +260,7 @@ const char *i18n_ubrk_get_available (int32_t index); * @exception #I18N_ERROR_NONE Successful * @see i18n_ubrk_get_available() */ -int32_t i18n_ubrk_count_available (void); +int32_t i18n_ubrk_count_available(void); /** * @brief Returns true if the specfied position is a boundary position. @@ -275,7 +275,7 @@ int32_t i18n_ubrk_count_available (void); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_ubrk_is_boundary (i18n_ubreak_iterator_h break_iter, int32_t offset); +i18n_ubool i18n_ubrk_is_boundary(i18n_ubreak_iterator_h break_iter, int32_t offset); /** * @brief Returns the status from the break rule that determined the most recently @@ -293,7 +293,7 @@ i18n_ubool i18n_ubrk_is_boundary (i18n_ubreak_iterator_h break_iter, int32_t off * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ubrk_get_rule_status (i18n_ubreak_iterator_h break_iter); +int32_t i18n_ubrk_get_rule_status(i18n_ubreak_iterator_h break_iter); /** * @brief Gets the statuses from the break rules that determined the most recently @@ -316,7 +316,7 @@ int32_t i18n_ubrk_get_rule_status (i18n_ubreak_iterator_h break_iter); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ubrk_get_rule_status_vec (i18n_ubreak_iterator_h break_iter, int32_t *fill_in_vec, int32_t capacity); +int32_t i18n_ubrk_get_rule_status_vec(i18n_ubreak_iterator_h break_iter, int32_t *fill_in_vec, int32_t capacity); /** * @brief Returns the locale of the break iterator. You can choose between the valid and @@ -331,7 +331,7 @@ int32_t i18n_ubrk_get_rule_status_vec (i18n_ubreak_iterator_h break_iter, int32_ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char *i18n_ubrk_get_locale_by_type (const i18n_ubreak_iterator_h break_iter, i18n_ulocale_data_locale_type_e type); +const char *i18n_ubrk_get_locale_by_type(const i18n_ubreak_iterator_h break_iter, i18n_ulocale_data_locale_type_e type); #ifdef __cplusplus } diff --git a/src/include/mobile/utils_i18n_ucalendar.h b/src/include/mobile/utils_i18n_ucalendar.h index 7de77be..a725a56 100644 --- a/src/include/mobile/utils_i18n_ucalendar.h +++ b/src/include/mobile/utils_i18n_ucalendar.h @@ -129,7 +129,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_set_default_timezone ( const i18n_uchar *zone_id ); +int i18n_ucalendar_set_default_timezone(const i18n_uchar *zone_id); /** * @brief Gets the current date and time. @@ -141,7 +141,7 @@ int i18n_ucalendar_set_default_timezone ( const i18n_uchar *zone_id ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_now ( i18n_udate *date ); +int i18n_ucalendar_get_now(i18n_udate *date); /** * @brief Creates an #i18n_ucalendar_h. @@ -171,7 +171,7 @@ int i18n_ucalendar_get_now ( i18n_udate *date ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory */ -int i18n_ucalendar_create ( const i18n_uchar *zone_id, int32_t len, const char *locale, i18n_ucalendar_type_e type, i18n_ucalendar_h *calendar ); +int i18n_ucalendar_create(const i18n_uchar *zone_id, int32_t len, const char *locale, i18n_ucalendar_type_e type, i18n_ucalendar_h *calendar); /** * @brief Destroys an #i18n_ucalendar_h. @@ -182,7 +182,7 @@ int i18n_ucalendar_create ( const i18n_uchar *zone_id, int32_t len, const char * * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_destroy ( i18n_ucalendar_h calendar ); +int i18n_ucalendar_destroy(i18n_ucalendar_h calendar); /** * @brief Creates a copy of a #i18n_ucalendar_h. @@ -194,7 +194,7 @@ int i18n_ucalendar_destroy ( i18n_ucalendar_h calendar ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_clone ( const i18n_ucalendar_h cal, i18n_ucalendar_h *identical_to_cal ); +int i18n_ucalendar_clone(const i18n_ucalendar_h cal, i18n_ucalendar_h *identical_to_cal); /** * @brief Gets the display name for a calendar's TimeZone. @@ -213,7 +213,7 @@ int i18n_ucalendar_clone ( const i18n_ucalendar_h cal, i18n_ucalendar_h *identic * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_timezone_displayname ( const i18n_ucalendar_h calendar, i18n_ucalendar_displayname_type_e type, const char *locale, i18n_uchar *result, int32_t result_len, int32_t *buf_size_needed ); +int i18n_ucalendar_get_timezone_displayname(const i18n_ucalendar_h calendar, i18n_ucalendar_displayname_type_e type, const char *locale, i18n_uchar *result, int32_t result_len, int32_t *buf_size_needed); /** * @brief Determines if an #i18n_ucalendar_h is currently in daylight savings time. @@ -227,7 +227,7 @@ int i18n_ucalendar_get_timezone_displayname ( const i18n_ucalendar_h calendar, i * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_is_in_daylight_time ( const i18n_ucalendar_h calendar, i18n_ubool *is_in ); +int i18n_ucalendar_is_in_daylight_time(const i18n_ucalendar_h calendar, i18n_ubool *is_in); /** * @brief Sets the value of a field in a #i18n_ucalendar_h. @@ -246,7 +246,7 @@ int i18n_ucalendar_is_in_daylight_time ( const i18n_ucalendar_h calendar, i18n_u * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_set ( i18n_ucalendar_h cal, i18n_ucalendar_date_fields_e field, int32_t val ); +int i18n_ucalendar_set(i18n_ucalendar_h cal, i18n_ucalendar_date_fields_e field, int32_t val); /** * @brief Sets a numeric attribute associated with an #i18n_ucalendar_h. @@ -263,7 +263,7 @@ int i18n_ucalendar_set ( i18n_ucalendar_h cal, i18n_ucalendar_date_fields_e fiel * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_set_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t val ); +int i18n_ucalendar_set_attribute(i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t val); /** * @brief Gets a numeric attribute associated with an i18n_ucalendar. @@ -281,7 +281,7 @@ int i18n_ucalendar_set_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_att * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t *val); +int i18n_ucalendar_get_attribute(i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t *val); /** * @brief Gets a calendar's current time in milliseconds. @@ -296,7 +296,7 @@ int i18n_ucalendar_get_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_att * @see i18n_ucalendar_set_milliseconds() * @see i18n_ucalendar_set_date_time() */ -int i18n_ucalendar_get_milliseconds( const i18n_ucalendar_h calendar, i18n_udate *date ); +int i18n_ucalendar_get_milliseconds(const i18n_ucalendar_h calendar, i18n_udate *date); /** * @brief Sets a calendar's current time in milliseconds. @@ -311,7 +311,7 @@ int i18n_ucalendar_get_milliseconds( const i18n_ucalendar_h calendar, i18n_udate * @see i18n_ucalendar_get_milliseconds() * @see i18n_ucalendar_set_date_time() */ -int i18n_ucalendar_set_milliseconds ( i18n_ucalendar_h calendar, i18n_udate milliseconds ); +int i18n_ucalendar_set_milliseconds(i18n_ucalendar_h calendar, i18n_udate milliseconds); /** * @brief Sets a calendar's current date. @@ -333,7 +333,7 @@ int i18n_ucalendar_set_milliseconds ( i18n_ucalendar_h calendar, i18n_udate mill * @see i18n_ucalendar_get_milliseconds() * @see i18n_ucalendar_set_milliseconds() */ -int i18n_ucalendar_set_date_time ( i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date, int32_t hour, int32_t min, int32_t sec ); +int i18n_ucalendar_set_date_time(i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date, int32_t hour, int32_t min, int32_t sec); /** * @brief Returns @c true if two #i18n_ucalendar_h calendars are equivalent. @@ -348,7 +348,7 @@ int i18n_ucalendar_set_date_time ( i18n_ucalendar_h calendar, int32_t year, int3 * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_is_equivalent_to ( const i18n_ucalendar_h calendar1, const i18n_ucalendar_h calendar2, i18n_ubool *equiv ); +int i18n_ucalendar_is_equivalent_to(const i18n_ucalendar_h calendar1, const i18n_ucalendar_h calendar2, i18n_ubool *equiv); /** * @brief Adds a specified signed amount to a particular field in a #i18n_ucalendar_h. @@ -368,7 +368,7 @@ int i18n_ucalendar_is_equivalent_to ( const i18n_ucalendar_h calendar1, const i1 * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_add ( i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount ); +int i18n_ucalendar_add(i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount); /** * @brief Gets the current value of a field from an #i18n_ucalendar_h. @@ -385,7 +385,7 @@ int i18n_ucalendar_add ( i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get ( const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t *val ); +int i18n_ucalendar_get(const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t *val); // Newly Added APIs @@ -418,7 +418,7 @@ int i18n_ucalendar_get ( const i18n_ucalendar_h calendar, i18n_ucalendar_date_fi * * @return The date difference for the specified field. */ -int32_t i18n_ucalendar_get_field_difference ( i18n_ucalendar_h calendar, i18n_udate target, i18n_ucalendar_date_fields_e field, i18n_error_code_e *status ); +int32_t i18n_ucalendar_get_field_difference(i18n_ucalendar_h calendar, i18n_udate target, i18n_ucalendar_date_fields_e field, i18n_error_code_e *status); /** * @brief Creates an enumeration over system time zone IDs with the given filter conditions. @@ -437,7 +437,7 @@ int32_t i18n_ucalendar_get_field_difference ( i18n_ucalendar_h calendar, i18n_ud * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_timezone_id_enumeration_create ( i18n_system_timezone_type_e zone_type, const char *region, const int32_t *raw_offset, i18n_uenumeration_h *enumeration); +int i18n_ucalendar_timezone_id_enumeration_create(i18n_system_timezone_type_e zone_type, const char *region, const int32_t *raw_offset, i18n_uenumeration_h *enumeration); /** * @brief Creates an enumeration over all time zones. @@ -450,7 +450,7 @@ int i18n_ucalendar_timezone_id_enumeration_create ( i18n_system_timezone_type_e * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_timezones_create (i18n_uenumeration_h * enumeration); +int i18n_ucalendar_timezones_create(i18n_uenumeration_h * enumeration); /** * @brief Creates an enumeration over all time zones associated with the given country. @@ -466,7 +466,7 @@ int i18n_ucalendar_timezones_create (i18n_uenumeration_h * enumeration); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_country_timezones_create (const char *country, i18n_uenumeration_h * enumeration); +int i18n_ucalendar_country_timezones_create(const char *country, i18n_uenumeration_h * enumeration); /** * @brief Returns the default time zone. @@ -484,7 +484,7 @@ int i18n_ucalendar_country_timezones_create (const char *country, i18n_uenumerat * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid parameter */ -int32_t i18n_ucalendar_get_default_timezone (i18n_uchar *result, int32_t result_capacity); +int32_t i18n_ucalendar_get_default_timezone(i18n_uchar *result, int32_t result_capacity); /** * @brief Sets the TimeZone used by a #i18n_ucalendar_h. @@ -499,7 +499,7 @@ int32_t i18n_ucalendar_get_default_timezone (i18n_uchar *result, int32_t result_ * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_set_timezone ( i18n_ucalendar_h calendar, const i18n_uchar *zone_id, int32_t length ); +int i18n_ucalendar_set_timezone(i18n_ucalendar_h calendar, const i18n_uchar *zone_id, int32_t length); /** * @brief Gets the ID of the calendar's time zone. @@ -516,7 +516,7 @@ int i18n_ucalendar_set_timezone ( i18n_ucalendar_h calendar, const i18n_uchar *z * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ucalendar_get_timezone_id (const i18n_ucalendar_h calendar, i18n_uchar *result, int32_t result_length); +int32_t i18n_ucalendar_get_timezone_id(const i18n_ucalendar_h calendar, i18n_uchar *result, int32_t result_length); /** * @brief Sets the Gregorian Calendar change date. @@ -537,7 +537,7 @@ int32_t i18n_ucalendar_get_timezone_id (const i18n_ucalendar_h calendar, i18n_uc * * @see i18n_ucalendar_get_gregorian_change() */ -int i18n_ucalendar_set_gregorian_change ( i18n_ucalendar_h calendar, i18n_udate date); +int i18n_ucalendar_set_gregorian_change(i18n_ucalendar_h calendar, i18n_udate date); /** * @brief Gets the Gregorian Calendar change date. @@ -558,7 +558,7 @@ int i18n_ucalendar_set_gregorian_change ( i18n_ucalendar_h calendar, i18n_udate * * @see i18n_ucalendar_set_gregorian_change() */ -int i18n_ucalendar_get_gregorian_change (const i18n_ucalendar_h calendar, i18n_udate *date); +int i18n_ucalendar_get_gregorian_change(const i18n_ucalendar_h calendar, i18n_udate *date); /** * @brief Gets a locale for which calendars are available. @@ -575,7 +575,7 @@ int i18n_ucalendar_get_gregorian_change (const i18n_ucalendar_h calendar, i18n_u * @exception #I18N_ERROR_INVALID_PARAMETER Invalid parameter * @see i18n_ucalendar_count_available() */ -const char * i18n_ucalendar_get_available (int32_t locale_index); +const char * i18n_ucalendar_get_available(int32_t locale_index); /** * @brief Determines how many locales have calendars available. @@ -588,7 +588,7 @@ const char * i18n_ucalendar_get_available (int32_t locale_index); * @exception #I18N_ERROR_NONE Successful * @see i18n_ucalendar_get_available() */ -int32_t i18n_ucalendar_count_available (void); +int32_t i18n_ucalendar_count_available(void); /** * @brief Sets a calendar's current date. @@ -611,7 +611,7 @@ int32_t i18n_ucalendar_count_available (void); * @see i18n_ucalendar_set_milliseconds() * @see i18n_ucalendar_set_date_time() */ -int i18n_ucalendar_set_date (i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date); +int i18n_ucalendar_set_date(i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date); /** * @brief Adds a specified signed amount to a particular field in a #i18n_ucalendar_h. @@ -646,7 +646,7 @@ int i18n_ucalendar_set_date (i18n_ucalendar_h calendar, int32_t year, int32_t mo * @remarks #I18N_UCALENDAR_ZONE_OFFSET and #I18N_UCALENDAR_DST_OFFSET are not supported by this function. * @see i18n_ucalendar_add() */ -int i18n_ucalendar_roll (i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount); +int i18n_ucalendar_roll(i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount); /** * @brief Determines if a field in a #i18n_ucalendar_h is set. @@ -667,7 +667,7 @@ int i18n_ucalendar_roll (i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e * @see i18n_ucalendar_clear() * */ -i18n_ubool i18n_ucalendar_is_set (const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field); +i18n_ubool i18n_ucalendar_is_set(const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field); /** * @brief Clears a field in a #i18n_ucalendar_h. @@ -687,7 +687,7 @@ i18n_ubool i18n_ucalendar_is_set (const i18n_ucalendar_h calendar, i18n_ucalenda * @see i18n_ucalendar_clear() * */ -int i18n_ucalendar_clear_field (i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field); +int i18n_ucalendar_clear_field(i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field); /** * @brief Clears all fields in a #i18n_ucalendar_h. @@ -704,7 +704,7 @@ int i18n_ucalendar_clear_field (i18n_ucalendar_h calendar, i18n_ucalendar_date_f * @see i18n_ucalendar_clear_field() * */ -int i18n_ucalendar_clear (i18n_ucalendar_h calendar); +int i18n_ucalendar_clear(i18n_ucalendar_h calendar); /** * @brief Determines a limit for a field in an #i18n_ucalendar_h. @@ -731,7 +731,7 @@ int i18n_ucalendar_clear (i18n_ucalendar_h calendar); * * @return The requested value. */ -int32_t i18n_ucalendar_get_limit (const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, i18n_ucalendar_limit_type_e type); +int32_t i18n_ucalendar_get_limit(const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, i18n_ucalendar_limit_type_e type); /** * @brief Gets the locale for this @c calendar object. @@ -748,7 +748,7 @@ int32_t i18n_ucalendar_get_limit (const i18n_ucalendar_h calendar, i18n_ucalenda * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char *i18n_ucalendar_get_locale_by_type (const i18n_ucalendar_h calendar, i18n_ulocale_data_locale_type_e type); +const char *i18n_ucalendar_get_locale_by_type(const i18n_ucalendar_h calendar, i18n_ulocale_data_locale_type_e type); /** * @brief Returns the timezone data version currently used by ICU. @@ -759,7 +759,7 @@ const char *i18n_ucalendar_get_locale_by_type (const i18n_ucalendar_h calendar, * @return The version string, such as "2007f". * @exception #I18N_ERROR_NONE Successful */ -const char *i18n_ucalendar_get_tz_data_version (void); +const char *i18n_ucalendar_get_tz_data_version(void); /** * @brief Returns the canonical system timezone ID or the normalized custom time zone ID for the given time zone ID. @@ -778,7 +778,7 @@ const char *i18n_ucalendar_get_tz_data_version (void); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ucalendar_get_canonical_timezone_id (const i18n_uchar *id, int32_t length, i18n_uchar *result, int32_t result_capacity, i18n_ubool *is_system_id); +int32_t i18n_ucalendar_get_canonical_timezone_id(const i18n_uchar *id, int32_t length, i18n_uchar *result, int32_t result_capacity, i18n_ubool *is_system_id); /** * @brief Gets the resource keyword value string designating the calendar type for the #i18n_ucalendar_h. @@ -793,7 +793,7 @@ int32_t i18n_ucalendar_get_canonical_timezone_id (const i18n_uchar *id, int32_t * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char *i18n_ucalendar_get_type (const i18n_ucalendar_h calendar); +const char *i18n_ucalendar_get_type(const i18n_ucalendar_h calendar); /** * @brief Given a key and a locale, returns an array of string values in a preferred order that would make a difference. @@ -814,7 +814,7 @@ const char *i18n_ucalendar_get_type (const i18n_ucalendar_h calendar); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_keyword_values_for_locale (const char *key, const char *locale, i18n_ubool commonly_used, i18n_uenumeration_h *enumeration); +int i18n_ucalendar_get_keyword_values_for_locale(const char *key, const char *locale, i18n_ubool commonly_used, i18n_uenumeration_h *enumeration); /** * @brief Returns whether the given day of the week is a weekday, a weekend day, @@ -837,7 +837,7 @@ int i18n_ucalendar_get_keyword_values_for_locale (const char *key, const char *l * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_day_of_week_type (const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week, i18n_ucalendar_weekday_type_e *weekday); +int i18n_ucalendar_get_day_of_week_type(const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week, i18n_ucalendar_weekday_type_e *weekday); /** * @brief Returns the time during the day at which the weekend begins or ends in this calendar system. @@ -859,7 +859,7 @@ int i18n_ucalendar_get_day_of_week_type (const i18n_ucalendar_h calendar, i18n_u * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ucalendar_get_weekend_transition (const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week); +int32_t i18n_ucalendar_get_weekend_transition(const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week); /** * @brief Returns @c true if the given #i18n_udate is in the weekend in this calendar system. @@ -875,7 +875,7 @@ int32_t i18n_ucalendar_get_weekend_transition (const i18n_ucalendar_h calendar, * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_ucalendar_is_weekend (i18n_ucalendar_h calendar, i18n_udate date); +i18n_ubool i18n_ucalendar_is_weekend(i18n_ucalendar_h calendar, i18n_udate date); /** * @brief Get the #i18n_udate for the next/previous time zone transition relative @@ -896,7 +896,7 @@ i18n_ubool i18n_ucalendar_is_weekend (i18n_ucalendar_h calendar, i18n_udate date * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_ucalendar_get_timezone_transition_date (const i18n_ucalendar_h calendar, i18n_utimezone_transition_type_e type, i18n_udate *transition); +i18n_ubool i18n_ucalendar_get_timezone_transition_date(const i18n_ucalendar_h calendar, i18n_utimezone_transition_type_e type, i18n_udate *transition); /** * @} diff --git a/src/include/mobile/utils_i18n_uchar.h b/src/include/mobile/utils_i18n_uchar.h index 4194c05..4dc6e1e 100644 --- a/src/include/mobile/utils_i18n_uchar.h +++ b/src/include/mobile/utils_i18n_uchar.h @@ -149,7 +149,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uchar_get_int_property_value ( i18n_uchar32 c, i18n_uchar_uproperty_e which, int32_t *property_val ); +int i18n_uchar_get_int_property_value(i18n_uchar32 c, i18n_uchar_uproperty_e which, int32_t *property_val); /** * @brief Gets the Unicode allocation block that contains the character. @@ -161,7 +161,7 @@ int i18n_uchar_get_int_property_value ( i18n_uchar32 c, i18n_uchar_uproperty_e w * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uchar_get_ublock_code ( i18n_uchar32 c, i18n_uchar_ublock_code_e *block_val ); +int i18n_uchar_get_ublock_code(i18n_uchar32 c, i18n_uchar_ublock_code_e *block_val); #ifdef __cplusplus } diff --git a/src/include/mobile/utils_i18n_ucollator.h b/src/include/mobile/utils_i18n_ucollator.h index 4a40674..5959403 100755 --- a/src/include/mobile/utils_i18n_ucollator.h +++ b/src/include/mobile/utils_i18n_ucollator.h @@ -83,25 +83,25 @@ extern "C" { int ret = I18N_ERROR_NONE; int buf_01_len = 0, buf_02_len = 0; - for ( i = 0; i < sizeof( src ) / sizeof( src[0] ); i++ ) { - dlog_print(DLOG_INFO, LOG_TAG, "%s\n", src[i] ); + for (i = 0; i < sizeof(src) / sizeof(src[0]); i++) { + dlog_print(DLOG_INFO, LOG_TAG, "%s\n", src[i]); } // cat banana airplane // creates a collator - ret = i18n_ucollator_create( "en_US", &coll ); + ret = i18n_ucollator_create("en_US", &coll); // compares and sorts in ascending order - if ( ret == I18N_ERROR_NONE ) { + if (ret == I18N_ERROR_NONE) { i18n_ucollator_set_strength( coll, I18N_UCOLLATOR_TERTIARY ); - for ( i = 0; i < 2; i++ ) { - for ( j = 0; j < 2 - i; j++ ) { - i18n_ustring_copy_ua( buf_01, src[j] ); - i18n_ustring_copy_ua( buf_02, src[j+1] ); - i18n_ustring_get_length( buf_01, &buf_01_len ); - i18n_ustring_get_length( buf_02, &buf_02_len ); + for (i = 0; i < 2; i++) { + for (j = 0; j < 2 - i; j++) { + i18n_ustring_copy_ua(buf_01, src[j]); + i18n_ustring_copy_ua(buf_02, src[j+1]); + i18n_ustring_get_length(buf_01, &buf_01_len); + i18n_ustring_get_length(buf_02, &buf_02_len); // compares buf_01 with buf_02 - i18n_ucollator_str_collator( coll, buf_01, buf_01_len, buf_02, buf_02_len, &result ); - if ( result == I18N_UCOLLATOR_GREATER ) { + i18n_ucollator_str_collator(coll, buf_01, buf_01_len, buf_02, buf_02_len, &result); + if (result == I18N_UCOLLATOR_GREATER) { tmp = src[j]; src[j] = src[j+1]; src[j+1] = tmp; @@ -112,7 +112,7 @@ extern "C" { // destroys the collator i18n_ucollator_destroy( coll ); // deallocate memory for collator - for ( i = 0; i < sizeof( src ) / sizeof( src[0] ); i++ ) { + for (i = 0; i < sizeof(src) / sizeof(src[0]); i++) { dlog_print(DLOG_INFO, LOG_TAG, "%s\n", src[i] ); } // ariplane banana cat * @endcode @@ -146,7 +146,7 @@ extern "C" { * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ucollator_destroy() */ -int i18n_ucollator_create ( const char *locale, i18n_ucollator_h *collator ); +int i18n_ucollator_create(const char *locale, i18n_ucollator_h *collator); /** * @brief Closes a i18n_ucollator_h. @@ -159,7 +159,7 @@ int i18n_ucollator_create ( const char *locale, i18n_ucollator_h *collator ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ucollator_create() */ -int i18n_ucollator_destroy ( i18n_ucollator_h collator ); +int i18n_ucollator_destroy(i18n_ucollator_h collator); /** * @brief Compares two strings. @@ -178,7 +178,7 @@ int i18n_ucollator_destroy ( i18n_ucollator_h collator ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ucollator_equal() */ -int i18n_ucollator_str_collator ( const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ucollator_result_e *result ); +int i18n_ucollator_str_collator(const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ucollator_result_e *result); /** * @brief Compares two strings for equality. @@ -196,7 +196,7 @@ int i18n_ucollator_str_collator ( const i18n_ucollator_h collator, const i18n_uc * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ucollator_str_collator() */ -int i18n_ucollator_equal ( const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ubool *equal ); +int i18n_ucollator_equal(const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ubool *equal); /** * @brief Sets the collation strength used in a collator. @@ -210,7 +210,7 @@ int i18n_ucollator_equal ( const i18n_ucollator_h collator, const i18n_uchar *sr * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucollator_set_strength ( i18n_ucollator_h collator, i18n_ucollator_strength_e strength ); +int i18n_ucollator_set_strength(i18n_ucollator_h collator, i18n_ucollator_strength_e strength); /** * @brief Sets a universal attribute setter. @@ -223,7 +223,7 @@ int i18n_ucollator_set_strength ( i18n_ucollator_h collator, i18n_ucollator_stre * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucollator_set_attribute ( i18n_ucollator_h collator, i18n_ucollator_attribute_e attr, i18n_ucollator_attribute_value_e val ); +int i18n_ucollator_set_attribute(i18n_ucollator_h collator, i18n_ucollator_attribute_e attr, i18n_ucollator_attribute_value_e val); #ifdef __cplusplus } diff --git a/src/include/mobile/utils_i18n_udate.h b/src/include/mobile/utils_i18n_udate.h index d6504bb..440dfe6 100644 --- a/src/include/mobile/utils_i18n_udate.h +++ b/src/include/mobile/utils_i18n_udate.h @@ -107,21 +107,21 @@ // creates new i18n_udate_format_h to format dates and times ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_KR, -1, bestPattern, -1, &formatter_KR); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_KR) { dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n"); } ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_LA, -1, bestPattern, -1, &formatter_LA); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_LA) { dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n"); } ret = i18n_udate_create(I18N_UDATE_PATTERN , I18N_UDATE_PATTERN , locale, utf16_timezone_SaoPaulo, -1, bestPattern, -1, &formatter_SaoPaulo); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_LA) { @@ -195,7 +195,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_create ( i18n_udate_format_style_e time_style, i18n_udate_format_style_e date_style, const char *locale, const i18n_uchar *tz_id, int32_t tz_id_len, const i18n_uchar *pattern, int pattern_len, i18n_udate_format_h *format ); +int i18n_udate_create(i18n_udate_format_style_e time_style, i18n_udate_format_style_e date_style, const char *locale, const i18n_uchar *tz_id, int32_t tz_id_len, const i18n_uchar *pattern, int pattern_len, i18n_udate_format_h *format); /** * @brief Destroys an #i18n_udate_format_h. @@ -207,7 +207,7 @@ int i18n_udate_create ( i18n_udate_format_style_e time_style, i18n_udate_format_ * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_destroy ( i18n_udate_format_h format ); +int i18n_udate_destroy(i18n_udate_format_h format); /** * @brief Formats a date using an #i18n_udate_format_h. @@ -231,7 +231,7 @@ int i18n_udate_destroy ( i18n_udate_format_h format ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_format_date ( const i18n_udate_format_h format, i18n_udate date_to_format, i18n_uchar *result, int32_t result_len, i18n_ufield_position_h pos, int32_t *buf_size_needed ); +int i18n_udate_format_date(const i18n_udate_format_h format, i18n_udate date_to_format, i18n_uchar *result, int32_t result_len, i18n_ufield_position_h pos, int32_t *buf_size_needed); // Newly Added APIs @@ -250,7 +250,7 @@ int i18n_udate_format_date ( const i18n_udate_format_h format, i18n_udate date_t * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_to_calendar_date_field ( i18n_udate_format_field_e field, i18n_ucalendar_date_fields_e *date_field_type ); +int i18n_udate_to_calendar_date_field(i18n_udate_format_field_e field, i18n_ucalendar_date_fields_e *date_field_type); /** * @brief Creates a copy of an #i18n_udate_format_h. @@ -264,7 +264,7 @@ int i18n_udate_to_calendar_date_field ( i18n_udate_format_field_e field, i18n_uc * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_clone ( const i18n_udate_format_h format, i18n_udate_format_h *format_clone ); +int i18n_udate_clone(const i18n_udate_format_h format, i18n_udate_format_h *format_clone); /** * @brief Parses a string into an date/time using an #i18n_udate_format_h. @@ -290,7 +290,7 @@ int i18n_udate_clone ( const i18n_udate_format_h format, i18n_udate_format_h *fo * * @see i18n_udate_format_date() */ -int i18n_udate_parse ( const i18n_udate_format_h format, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_udate *parsed_date ); +int i18n_udate_parse(const i18n_udate_format_h format, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_udate *parsed_date); /** * @brief Parses a string into an date/time using an #i18n_udate_format_h. @@ -314,8 +314,8 @@ int i18n_udate_parse ( const i18n_udate_format_h format, const i18n_uchar *text, * * @see i18n_udate_format_date() */ -int i18n_udate_parse_calendar (const i18n_udate_format_h format, i18n_ucalendar_h *calendar, const i18n_uchar *text, - int32_t text_length, int32_t *parse_pos ); +int i18n_udate_parse_calendar(const i18n_udate_format_h format, i18n_ucalendar_h *calendar, const i18n_uchar *text, + int32_t text_length, int32_t *parse_pos); /** * @brief Determines if an #i18n_udate_format_h will perform lenient parsing. @@ -333,7 +333,7 @@ int i18n_udate_parse_calendar (const i18n_udate_format_h format, i18n_ucalendar_ * * @see i18n_udate_set_lenient() */ -i18n_ubool i18n_udate_is_lenient ( const i18n_udate_format_h format ); +i18n_ubool i18n_udate_is_lenient(const i18n_udate_format_h format); /** * @brief Specifies whether an #i18n_udate_format_h will perform lenient parsing. @@ -350,7 +350,7 @@ i18n_ubool i18n_udate_is_lenient ( const i18n_udate_format_h format ); * * @see i18n_udate_is_lenient() */ -int i18n_udate_set_lenient ( i18n_udate_format_h format, i18n_ubool is_lenient ); +int i18n_udate_set_lenient(i18n_udate_format_h format, i18n_ubool is_lenient); /** * @brief Gets the #i18n_ucalendar_h associated with an #i18n_udate_format_h. @@ -366,7 +366,7 @@ int i18n_udate_set_lenient ( i18n_udate_format_h format, i18n_ubool is_lenient ) * * @see i18n_udate_set_calendar() */ -int i18n_udate_get_calendar ( const i18n_udate_format_h format, i18n_ucalendar_h *calendar); +int i18n_udate_get_calendar(const i18n_udate_format_h format, i18n_ucalendar_h *calendar); /** * @brief Sets the #i18n_ucalendar_h associated with an #i18n_udate_format_h. @@ -382,7 +382,7 @@ int i18n_udate_get_calendar ( const i18n_udate_format_h format, i18n_ucalendar_h * * @see i18n_udate_get_calendar() */ -int i18n_udate_set_calendar ( i18n_udate_format_h format, const i18n_ucalendar_h calendar_to_set ); +int i18n_udate_set_calendar(i18n_udate_format_h format, const i18n_ucalendar_h calendar_to_set); /** * @brief Gets the #i18n_unumber_format_h associated with an #i18n_udate_format_h. @@ -398,7 +398,7 @@ int i18n_udate_set_calendar ( i18n_udate_format_h format, const i18n_ucalendar_h * * @see i18n_udate_set_number_format() */ -int i18n_udate_get_number_format ( const i18n_udate_format_h format, i18n_unumber_format_h *number_format ); +int i18n_udate_get_number_format(const i18n_udate_format_h format, i18n_unumber_format_h *number_format); /** * @brief Sets the #i18n_unumber_format_h associated with an #i18n_udate_format_h. @@ -414,7 +414,7 @@ int i18n_udate_get_number_format ( const i18n_udate_format_h format, i18n_unumbe * * @see i18n_udate_get_number_format() */ -int i18n_udate_set_number_format ( i18n_udate_format_h format, const i18n_unumber_format_h number_format_to_set ); +int i18n_udate_set_number_format(i18n_udate_format_h format, const i18n_unumber_format_h number_format_to_set); /** * @brief Gets a locale for which date/time formatting patterns are available. @@ -430,7 +430,7 @@ int i18n_udate_set_number_format ( i18n_udate_format_h format, const i18n_unumbe * @see i18n_udate_count_available() */ -const char *i18n_udate_get_available ( int32_t locale_index ); +const char *i18n_udate_get_available(int32_t locale_index); /** * @brief Determines how many locales have date/time formatting patterns available. @@ -444,7 +444,7 @@ const char *i18n_udate_get_available ( int32_t locale_index ); * * @see i18n_udate_get_available() */ -int32_t i18n_udate_count_available ( void ); +int32_t i18n_udate_count_available(void); /** * @brief Gets the year relative to which all 2-digit years are interpreted. @@ -461,7 +461,7 @@ int32_t i18n_udate_count_available ( void ); * * @see i18n_udate_set_2digit_year_start() */ -int i18n_udate_get_2digit_year_start ( const i18n_udate_format_h format, i18n_udate *year ); +int i18n_udate_get_2digit_year_start(const i18n_udate_format_h format, i18n_udate *year); /** * @brief Sets the year relative to which all 2-digit years will be interpreted. @@ -478,7 +478,7 @@ int i18n_udate_get_2digit_year_start ( const i18n_udate_format_h format, i18n_ud * * @see i18n_udate_get_2digit_year_start() */ -int i18n_udate_set_2digit_year_start ( i18n_udate_format_h format, i18n_udate date ); +int i18n_udate_set_2digit_year_start(i18n_udate_format_h format, i18n_udate date); /** * @brief Extracts the pattern from an #i18n_udate_format_h. @@ -499,8 +499,8 @@ int i18n_udate_set_2digit_year_start ( i18n_udate_format_h format, i18n_udate da * * @see i18n_udate_apply_pattern() */ -int32_t i18n_udate_to_pattern ( const i18n_udate_format_h format, i18n_ubool localized, i18n_uchar *result, - int32_t result_length ); +int32_t i18n_udate_to_pattern(const i18n_udate_format_h format, i18n_ubool localized, i18n_uchar *result, + int32_t result_length); /** * @brief Sets the pattern used by an #i18n_udate_format_h. @@ -518,8 +518,8 @@ int32_t i18n_udate_to_pattern ( const i18n_udate_format_h format, i18n_ubool loc * * @see i18n_udate_to_pattern() */ -int i18n_udate_apply_pattern ( i18n_udate_format_h format, i18n_ubool localized, const i18n_uchar *pattern, - int32_t pattern_length ); +int i18n_udate_apply_pattern(i18n_udate_format_h format, i18n_ubool localized, const i18n_uchar *pattern, + int32_t pattern_length); /** * @brief Gets the symbols associated with an #i18n_udate_format_h. @@ -543,8 +543,8 @@ int i18n_udate_apply_pattern ( i18n_udate_format_h format, i18n_ubool localized, * @see i18n_udate_count_symbols() * @see #i18n_udate_set_symbols() */ -int32_t i18n_udate_get_symbols ( const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, - i18n_uchar *result, int32_t result_length ); +int32_t i18n_udate_get_symbols(const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, + i18n_uchar *result, int32_t result_length); /** * @brief Counts the number of particular symbols for an #i18n_udate_format_h. @@ -564,7 +564,7 @@ int32_t i18n_udate_get_symbols ( const i18n_udate_format_h format, i18n_udate_fo * @see i18n_udate_get_symbols() * @see #i18n_udate_set_symbols() */ -int32_t i18n_udate_count_symbols ( const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type ); +int32_t i18n_udate_count_symbols(const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type); /** * @brief Sets the symbols associated with an #i18n_udate_format_h. @@ -587,8 +587,8 @@ int32_t i18n_udate_count_symbols ( const i18n_udate_format_h format, i18n_udate_ * @see i18n_udate_count_symbols() * @see #i18n_udate_get_symbols() */ -int i18n_udate_set_symbols ( i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, - i18n_uchar *value, int32_t value_length ); +int i18n_udate_set_symbols(i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, + i18n_uchar *value, int32_t value_length); /** * @brief Gets the locale for this date format object. @@ -605,7 +605,7 @@ int i18n_udate_set_symbols ( i18n_udate_format_h format, i18n_udate_format_symbo * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char * i18n_udate_get_locale_by_type ( const i18n_udate_format_h format, i18n_ulocale_data_locale_type_e type ); +const char * i18n_udate_get_locale_by_type(const i18n_udate_format_h format, i18n_ulocale_data_locale_type_e type); /** * @brief Sets a particular #i18n_udisplay_context_e value in the formatter, such as #I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_STANDALONE. @@ -620,7 +620,7 @@ const char * i18n_udate_get_locale_by_type ( const i18n_udate_format_h format, i * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_set_context ( i18n_udate_format_h format, i18n_udisplay_context_e value ); +int i18n_udate_set_context(i18n_udate_format_h format, i18n_udisplay_context_e value); /** diff --git a/src/include/mobile/utils_i18n_udatepg.h b/src/include/mobile/utils_i18n_udatepg.h index d46317d..8308288 100755 --- a/src/include/mobile/utils_i18n_udatepg.h +++ b/src/include/mobile/utils_i18n_udatepg.h @@ -106,21 +106,21 @@ // creates new i18n_udate_format to format dates and times ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_KR, -1, bestPattern, -1, &formatter_KR); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_KR) { dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n"); } ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_LA, -1, bestPattern, -1, &formatter_LA); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_LA) { dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n"); } ret = i18n_udate_create(I18N_UDATE_PATTERN , I18N_UDATE_PATTERN , locale, utf16_timezone_SaoPaulo, -1, bestPattern, -1, &formatter_SaoPaulo); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_LA) { @@ -178,7 +178,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_create ( const char *locale, i18n_udatepg_h *dtpg ); +int i18n_udatepg_create(const char *locale, i18n_udatepg_h *dtpg); /** * @brief Destroys a generator. @@ -189,7 +189,7 @@ int i18n_udatepg_create ( const char *locale, i18n_udatepg_h *dtpg ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_destroy ( i18n_udatepg_h dtpg ); +int i18n_udatepg_destroy(i18n_udatepg_h dtpg); /** * @brief Gets the best pattern matching the input skeleton. @@ -213,7 +213,7 @@ int i18n_udatepg_destroy ( i18n_udatepg_h dtpg ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @retval #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int i18n_udatepg_get_best_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t len, i18n_uchar *best_pattern, int32_t capacity, int32_t *best_pattern_len ); +int i18n_udatepg_get_best_pattern(i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t len, i18n_uchar *best_pattern, int32_t capacity, int32_t *best_pattern_len); // Newly Added APIs @@ -229,7 +229,7 @@ int i18n_udatepg_get_best_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *skele * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_create_empty (i18n_udatepg_h *dtpg); +int i18n_udatepg_create_empty(i18n_udatepg_h *dtpg); /** * @brief Creates a copy of a generator. @@ -242,7 +242,7 @@ int i18n_udatepg_create_empty (i18n_udatepg_h *dtpg); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_clone ( const i18n_udatepg_h dtpg, i18n_udatepg_h * dtpg_clone); +int i18n_udatepg_clone(const i18n_udatepg_h dtpg, i18n_udatepg_h * dtpg_clone); /** * @brief Gets the best pattern matching the input @a skeleton. @@ -273,8 +273,8 @@ int i18n_udatepg_clone ( const i18n_udatepg_h dtpg, i18n_udatepg_h * dtpg_clone) * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_get_best_pattern_with_options ( i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t length, - i18n_udatepg_date_time_pattern_match_options_e options, i18n_uchar *best_pattern, int32_t capacity ); +int32_t i18n_udatepg_get_best_pattern_with_options(i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t length, + i18n_udatepg_date_time_pattern_match_options_e options, i18n_uchar *best_pattern, int32_t capacity); /** * @brief Gets a unique skeleton from a given pattern. For example, both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd". @@ -298,7 +298,7 @@ int32_t i18n_udatepg_get_best_pattern_with_options ( i18n_udatepg_h dtpg, const * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_get_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, i18n_uchar *skeleton, int32_t capacity ); +int32_t i18n_udatepg_get_skeleton(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, i18n_uchar *skeleton, int32_t capacity); /** * @brief Gets a unique base skeleton from a given pattern. @@ -325,7 +325,7 @@ int32_t i18n_udatepg_get_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar *patte * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_get_base_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, i18n_uchar *base_skeleton, int32_t capacity ); +int32_t i18n_udatepg_get_base_skeleton(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, i18n_uchar *base_skeleton, int32_t capacity); /** * @brief Adds a pattern to the generator. @@ -353,7 +353,7 @@ int32_t i18n_udatepg_get_base_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar * * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_add_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, i18n_ubool override, i18n_uchar *conflicting_pattern, int32_t capacity, i18n_udatepg_date_time_pattern_conflict_e * conflict_status ); +int32_t i18n_udatepg_add_pattern(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, i18n_ubool override, i18n_uchar *conflicting_pattern, int32_t capacity, i18n_udatepg_date_time_pattern_conflict_e * conflict_status); /** * @brief An append_item_format is a pattern used to append a field if there is no good match. @@ -379,7 +379,7 @@ int32_t i18n_udatepg_add_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *patte * * @see i18n_udatepg_get_append_item_format() */ -int i18n_udatepg_set_append_item_format ( i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, const i18n_uchar *value, int32_t length ); +int i18n_udatepg_set_append_item_format(i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, const i18n_uchar *value, int32_t length); /** * @brief Getter corresponding to i18n_udatepg_set_append_item_format(). @@ -399,7 +399,7 @@ int i18n_udatepg_set_append_item_format ( i18n_udatepg_h dtpg, i18n_udatepg_date * * @see i18n_udatepg_set_append_item_format() */ -const i18n_uchar *i18n_udatepg_get_append_item_format ( const i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_append_item_format(const i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, int32_t *pattern_length); /** * @brief Sets the name of field, e.g. "era" in English for ERA. @@ -418,8 +418,8 @@ const i18n_uchar *i18n_udatepg_get_append_item_format ( const i18n_udatepg_h dtp * * @see i18n_udatepg_get_append_item_name() */ -int i18n_udatepg_set_append_item_name ( i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, const i18n_uchar *value, - int32_t length ); +int i18n_udatepg_set_append_item_name(i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, const i18n_uchar *value, + int32_t length); /** * @brief Getter corresponding to i18n_udatepg_set_append_item_name(). @@ -439,8 +439,8 @@ int i18n_udatepg_set_append_item_name ( i18n_udatepg_h dtpg, i18n_udatepg_date_t * * @see i18n_udatepg_set_append_item_name() */ -const i18n_uchar *i18n_udatepg_get_append_item_name ( const i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, - int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_append_item_name(const i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, + int32_t *pattern_length); /** * @brief The date time format is a message format pattern used to compose date and time patterns. @@ -464,7 +464,7 @@ const i18n_uchar *i18n_udatepg_get_append_item_name ( const i18n_udatepg_h dtpg, * * @see i18n_udatepg_get_date_time_format() */ -int i18n_udatepg_set_date_time_format ( const i18n_udatepg_h dtpg, const i18n_uchar *date_time_format, int32_t length ); +int i18n_udatepg_set_date_time_format(const i18n_udatepg_h dtpg, const i18n_uchar *date_time_format, int32_t length); /** * @brief Getter corresponding to i18n_udatepg_set_date_time_format(). @@ -482,7 +482,7 @@ int i18n_udatepg_set_date_time_format ( const i18n_udatepg_h dtpg, const i18n_uc * * @see i18n_udatepg_set_date_time_format() */ -const i18n_uchar *i18n_udatepg_get_date_time_format ( const i18n_udatepg_h dtpg, int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_date_time_format(const i18n_udatepg_h dtpg, int32_t *pattern_length); /** * @brief The decimal value is used in formatting fractions of seconds. @@ -502,7 +502,7 @@ const i18n_uchar *i18n_udatepg_get_date_time_format ( const i18n_udatepg_h dtpg, * * @see i18n_udatepg_get_decimal() */ -int i18n_udatepg_set_decimal ( i18n_udatepg_h dtpg, const i18n_uchar *decimal, int32_t length ); +int i18n_udatepg_set_decimal(i18n_udatepg_h dtpg, const i18n_uchar *decimal, int32_t length); /** * @brief Getter corresponding to i18n_udatepg_set_decimal(). @@ -520,7 +520,7 @@ int i18n_udatepg_set_decimal ( i18n_udatepg_h dtpg, const i18n_uchar *decimal, i * * @see i18n_udatepg_set_decimal() */ -const i18n_uchar *i18n_udatepg_get_decimal ( const i18n_udatepg_h dtpg, int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_decimal(const i18n_udatepg_h dtpg, int32_t *pattern_length); /** * @brief Adjusts the field types (width and subtype) of a @a pattern to match what is in a @a skeleton. @@ -548,8 +548,8 @@ const i18n_uchar *i18n_udatepg_get_decimal ( const i18n_udatepg_h dtpg, int32_t * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_replace_field_types ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, - const i18n_uchar *skeleton, int32_t skeleton_length, i18n_uchar *dest, int32_t dest_capacity ); +int32_t i18n_udatepg_replace_field_types(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, + const i18n_uchar *skeleton, int32_t skeleton_length, i18n_uchar *dest, int32_t dest_capacity); /** * @brief Adjusts the field types (width and subtype) of a pattern to match what is in a @a skeleton. @@ -581,9 +581,9 @@ int32_t i18n_udatepg_replace_field_types ( i18n_udatepg_h dtpg, const i18n_uchar * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_replace_field_types_with_options ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, +int32_t i18n_udatepg_replace_field_types_with_options(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, const i18n_uchar *skeleton, int32_t skeleton_length, i18n_udatepg_date_time_pattern_match_options_e options, - i18n_uchar *dest, int32_t dest_capacity ); + i18n_uchar *dest, int32_t dest_capacity); /** * @brief Creates an #i18n_uenumeration_h for list of all the skeletons in canonical form. @@ -597,7 +597,7 @@ int32_t i18n_udatepg_replace_field_types_with_options ( i18n_udatepg_h dtpg, con * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration ); +int i18n_udatepg_skeletons_create(const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration); /** * @brief Creates an #i18n_uenumeration_h for list of all the base skeletons in canonical form. @@ -610,7 +610,7 @@ int i18n_udatepg_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumeration * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_base_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration ); +int i18n_udatepg_base_skeletons_create(const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration); /** * @brief Gets the pattern corresponding to a given skeleton. @@ -628,7 +628,7 @@ int i18n_udatepg_base_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumer * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const i18n_uchar *i18n_udatepg_get_pattern_for_skeleton ( const i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t skeleton_length, int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_pattern_for_skeleton(const i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t skeleton_length, int32_t *pattern_length); #ifdef __cplusplus diff --git a/src/include/mobile/utils_i18n_uenumeration.h b/src/include/mobile/utils_i18n_uenumeration.h index bbfe620..543945d 100755 --- a/src/include/mobile/utils_i18n_uenumeration.h +++ b/src/include/mobile/utils_i18n_uenumeration.h @@ -61,7 +61,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uenumeration_destroy ( i18n_uenumeration_h enumeration ); +int i18n_uenumeration_destroy(i18n_uenumeration_h enumeration); /** * @brief Returns the number of elements that the iterator traverses. @@ -79,7 +79,7 @@ int i18n_uenumeration_destroy ( i18n_uenumeration_h enumeration ); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @exception #I18N_ERROR_ENUM_OUT_OF_SYNC The iterator is out of sync */ -int32_t i18n_uenumeration_count ( i18n_uenumeration_h enumeration ); +int32_t i18n_uenumeration_count(i18n_uenumeration_h enumeration); /** * @brief Returns the next element in the iterator's list. @@ -102,7 +102,7 @@ int32_t i18n_uenumeration_count ( i18n_uenumeration_h enumeration ); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @exception #I18N_ERROR_ENUM_OUT_OF_SYNC The iterator is out of sync */ -const i18n_uchar *i18n_uenumeration_unext ( i18n_uenumeration_h enumeration, int32_t *result_length ); +const i18n_uchar *i18n_uenumeration_unext(i18n_uenumeration_h enumeration, int32_t *result_length); /** * @brief Returns the next element in the iterator's list. @@ -128,7 +128,7 @@ const i18n_uchar *i18n_uenumeration_unext ( i18n_uenumeration_h enumeration, int * @exception #I18N_ERROR_INVARIANT_CONVERSION The underlying native string is i18n_uchar* and conversion to char* with the invariant converter fails. * This error pertains only to current string, so iteration might be able to continue successfully. */ -const char *i18n_uenumeration_next ( i18n_uenumeration_h enumeration, int32_t *result_length ); +const char *i18n_uenumeration_next(i18n_uenumeration_h enumeration, int32_t *result_length); /** * @brief Resets the iterator to the current list of service IDs. @@ -142,7 +142,7 @@ const char *i18n_uenumeration_next ( i18n_uenumeration_h enumeration, int32_t *r * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uenumeration_reset ( i18n_uenumeration_h enumeration ); +int i18n_uenumeration_reset(i18n_uenumeration_h enumeration); /** * @brief Given an array of const i18n_uchar* strings, return an #i18n_uenumeration_h. @@ -161,7 +161,7 @@ int i18n_uenumeration_reset ( i18n_uenumeration_h enumeration ); * * @see i18n_uenumeration_destroy() */ -int i18n_uenumeration_uchar_strings_enumeration_create(const i18n_uchar *const strings[], int32_t count, i18n_uenumeration_h *enumeration ); +int i18n_uenumeration_uchar_strings_enumeration_create(const i18n_uchar *const strings[], int32_t count, i18n_uenumeration_h *enumeration); /** * @brief Given an array of const char* strings (invariant chars only), return an #i18n_uenumeration_h. @@ -180,7 +180,7 @@ int i18n_uenumeration_uchar_strings_enumeration_create(const i18n_uchar *const s * * @see i18n_uenumeration_destroy() */ -int i18n_uenumeration_char_strings_enumeration_create(const char* const strings[], int32_t count, i18n_uenumeration_h *enumeration ); +int i18n_uenumeration_char_strings_enumeration_create(const char* const strings[], int32_t count, i18n_uenumeration_h *enumeration); /** * @} diff --git a/src/include/mobile/utils_i18n_ulocale.h b/src/include/mobile/utils_i18n_ulocale.h index a180152..18af395 100644 --- a/src/include/mobile/utils_i18n_ulocale.h +++ b/src/include/mobile/utils_i18n_ulocale.h @@ -61,21 +61,21 @@ // Gets default locale ret = i18n_ulocale_get_default(&locale); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_ERROR, LOG_TAG, "i18n_ulocale_get_default() failed!!! \n"); } dlog_print(DLOG_INFO, LOG_TAG, "default locale : %s\n", locale); // default locale : en_GB.UTF-8 // Gets the language code for the specified locale ret = i18n_ulocale_get_language(locale, language, language_capacity, &buf_size_language); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_ERROR, LOG_TAG, "i18n_ulocale_get_language() failed!!! \n"); } dlog_print(DLOG_INFO, LOG_TAG, "language code for the locale : %s\n", language); // language code for the locale : en // Gets the full name suitable for display for the specified locale ret = i18n_ulocale_get_display_name(locale, in_locale_id, result_w, 64, &buf_size_display_name); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_ERROR, LOG_TAG, "i18n_ulocale_get_display_name() failed!!! \n"); } i18n_ustring_copy_au(result, result_w); @@ -120,7 +120,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_default ( const char **locale ); +int i18n_ulocale_get_default(const char **locale); /** * @brief Sets I18N's default locale. @@ -138,7 +138,7 @@ int i18n_ulocale_get_default ( const char **locale ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_set_default ( const char *locale_id ); +int i18n_ulocale_set_default(const char *locale_id); /** * @brief Gets the language code for the specified locale. @@ -154,7 +154,7 @@ int i18n_ulocale_set_default ( const char *locale_id ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_language ( const char *locale_id, char *language, int32_t language_capacity, int32_t *buf_size_language ); +int i18n_ulocale_get_language(const char *locale_id, char *language, int32_t language_capacity, int32_t *buf_size_language); /** * @brief Gets the country code for the specified locale. @@ -168,7 +168,7 @@ int i18n_ulocale_get_language ( const char *locale_id, char *language, int32_t l * @return The actual buffer size needed for the country code.\n * If it's greater than @a country_capacity, the returned country code will be truncated. */ -int32_t i18n_ulocale_get_country ( const char *locale_id, char *country, int32_t country_capacity, int *error ); +int32_t i18n_ulocale_get_country(const char *locale_id, char *country, int32_t country_capacity, int *error); /** * @brief Gets the full name suitable for display for the specified locale. @@ -186,7 +186,7 @@ int32_t i18n_ulocale_get_country ( const char *locale_id, char *country, int32_t * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_display_name ( const char *locale_id, const char *in_locale_id, i18n_uchar *result, int32_t max_result_size, int32_t *buf_size_display_name ); +int i18n_ulocale_get_display_name(const char *locale_id, const char *in_locale_id, i18n_uchar *result, int32_t max_result_size, int32_t *buf_size_display_name); /** * @brief Gets the specified locale from a list of all available locales. @@ -204,7 +204,7 @@ int i18n_ulocale_get_display_name ( const char *locale_id, const char *in_locale * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char* i18n_ulocale_get_available ( int32_t n ); +const char* i18n_ulocale_get_available(int32_t n); /** * @brief Gets the size of the all available locale list. @@ -215,7 +215,7 @@ const char* i18n_ulocale_get_available ( int32_t n ); * @return The size of the locale list * @exception #I18N_ERROR_NONE Success */ -int32_t i18n_ulocale_count_available ( void ); +int32_t i18n_ulocale_count_available(void); // Newly Added APIs @@ -237,7 +237,7 @@ int32_t i18n_ulocale_count_available ( void ); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_script ( const char *locale_id, char *script, int32_t script_capacity ); +int32_t i18n_ulocale_get_script(const char *locale_id, char *script, int32_t script_capacity); /** * @brief Gets the variant code for the specified locale. @@ -257,7 +257,7 @@ int32_t i18n_ulocale_get_script ( const char *locale_id, char *script, int32_t s * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_variant ( const char *locale_id, char *variant, int32_t variant_capacity ); +int32_t i18n_ulocale_get_variant(const char *locale_id, char *variant, int32_t variant_capacity); /** * @brief Gets the full name for the specified locale. @@ -279,7 +279,7 @@ int32_t i18n_ulocale_get_variant ( const char *locale_id, char *variant, int32_t * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int32_t i18n_ulocale_get_name ( const char *locale_id, char *name, int32_t name_capacity ); +int32_t i18n_ulocale_get_name(const char *locale_id, char *name, int32_t name_capacity); /** * @brief Gets the full name for the specified locale. @@ -301,7 +301,7 @@ int32_t i18n_ulocale_get_name ( const char *locale_id, char *name, int32_t name_ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int32_t i18n_ulocale_canonicalize ( const char *locale_id, char *name, int32_t name_capacity ); +int32_t i18n_ulocale_canonicalize(const char *locale_id, char *name, int32_t name_capacity); /** * @brief Gets the ISO language code for the specified locale. @@ -315,7 +315,7 @@ int32_t i18n_ulocale_canonicalize ( const char *locale_id, char *name, int32_t n * * @exception #I18N_ERROR_NONE Successful */ -const char * i18n_ulocale_get_iso3_language ( const char *locale_id ); +const char * i18n_ulocale_get_iso3_language(const char *locale_id); /** * @brief Gets the ISO country code for the specified locale. @@ -329,7 +329,7 @@ const char * i18n_ulocale_get_iso3_language ( const char *locale_id ); * * @exception #I18N_ERROR_NONE Successful */ -const char * i18n_ulocale_get_iso3_country ( const char *locale_id ); +const char * i18n_ulocale_get_iso3_country(const char *locale_id); /** * @brief Gets the Win32 LCID value for the specified locale. @@ -344,7 +344,7 @@ const char * i18n_ulocale_get_iso3_country ( const char *locale_id ); * * @exception #I18N_ERROR_NONE Successful */ -uint32_t i18n_ulocale_get_lcid ( const char *locale_id ); +uint32_t i18n_ulocale_get_lcid(const char *locale_id); /** * @brief Gets the language name suitable for display for the specified locale. @@ -366,7 +366,7 @@ uint32_t i18n_ulocale_get_lcid ( const char *locale_id ); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_language ( const char *locale, const char *display_locale, i18n_uchar *language, int32_t language_capacity ); +int32_t i18n_ulocale_get_display_language(const char *locale, const char *display_locale, i18n_uchar *language, int32_t language_capacity); /** * @brief Gets the script name suitable for display for the specified locale. @@ -387,7 +387,7 @@ int32_t i18n_ulocale_get_display_language ( const char *locale, const char *disp * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_script ( const char *locale, const char *display_locale, i18n_uchar *script, int32_t script_capacity ); +int32_t i18n_ulocale_get_display_script(const char *locale, const char *display_locale, i18n_uchar *script, int32_t script_capacity); /** * @brief Gets the country name suitable for display for the specified locale. @@ -408,7 +408,7 @@ int32_t i18n_ulocale_get_display_script ( const char *locale, const char *displa * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_country ( const char *locale, const char *display_locale, i18n_uchar *country, int32_t country_capacity ); +int32_t i18n_ulocale_get_display_country(const char *locale, const char *display_locale, i18n_uchar *country, int32_t country_capacity); /** * @brief Gets the variant name suitable for display for the specified locale. @@ -429,7 +429,7 @@ int32_t i18n_ulocale_get_display_country ( const char *locale, const char *displ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_variant ( const char *locale, const char *display_locale, i18n_uchar *variant, int32_t variant_capacity ); +int32_t i18n_ulocale_get_display_variant(const char *locale, const char *display_locale, i18n_uchar *variant, int32_t variant_capacity); /** * @brief Gets the keyword name suitable for display for the specified locale. @@ -481,7 +481,7 @@ int32_t i18n_ulocale_get_display_variant ( const char *locale, const char *displ * @see i18n_uenumeration_next() * @see i18n_uenumeration_destroy() */ -int32_t i18n_ulocale_get_display_keyword ( const char *keyword, const char *display_locale, i18n_uchar *dest, int32_t dest_capacity ); +int32_t i18n_ulocale_get_display_keyword(const char *keyword, const char *display_locale, i18n_uchar *dest, int32_t dest_capacity); /** * @brief Gets the value of the keyword suitable for display for the specified locale. @@ -506,7 +506,7 @@ int32_t i18n_ulocale_get_display_keyword ( const char *keyword, const char *disp * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_keyword_value ( const char *locale, const char *keyword, const char *display_locale, i18n_uchar *dest, int32_t dest_capacity ); +int32_t i18n_ulocale_get_display_keyword_value(const char *locale, const char *keyword, const char *display_locale, i18n_uchar *dest, int32_t dest_capacity); /** * @brief Gets a list of all available 2-letter language codes defined in ISO 639, @@ -523,7 +523,7 @@ int32_t i18n_ulocale_get_display_keyword_value ( const char *locale, const char * * @exception #I18N_ERROR_NONE Successful */ -const char * const *i18n_ulocale_get_iso_languages ( void ); +const char * const *i18n_ulocale_get_iso_languages(void); /** * @@ -539,7 +539,7 @@ const char * const *i18n_ulocale_get_iso_languages ( void ); * * @exception #I18N_ERROR_NONE Successful */ -const char * const *i18n_ulocale_get_iso_countries ( void ); +const char * const *i18n_ulocale_get_iso_countries(void); /** * @brief Truncates the locale ID string to get the parent locale ID. @@ -566,7 +566,7 @@ const char * const *i18n_ulocale_get_iso_countries ( void ); * in the @a locale_id from index 0 to the index of the last occurrence of * the underscore ("_") symbol. */ -int32_t i18n_ulocale_get_parent ( const char *locale_id, char *parent, int32_t parent_capacity ); +int32_t i18n_ulocale_get_parent(const char *locale_id, char *parent, int32_t parent_capacity); /** * @brief Gets the full name for the specified locale, like i18n_ulocale_get_name(), but without keywords. @@ -591,7 +591,7 @@ int32_t i18n_ulocale_get_parent ( const char *locale_id, char *parent, int32_t p * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int32_t i18n_ulocale_get_base_name ( const char *locale_id, char *name, int32_t name_capacity ); +int32_t i18n_ulocale_get_base_name(const char *locale_id, char *name, int32_t name_capacity); /** * @brief Gets an enumeration of keywords for the specified locale. @@ -606,7 +606,7 @@ int32_t i18n_ulocale_get_base_name ( const char *locale_id, char *name, int32_t * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_keywords_create ( const char *locale_id, i18n_uenumeration_h *enumeration ); +int i18n_ulocale_keywords_create(const char *locale_id, i18n_uenumeration_h *enumeration); /** * @brief Gets the value for a keyword. @@ -626,7 +626,7 @@ int i18n_ulocale_keywords_create ( const char *locale_id, i18n_uenumeration_h *e * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_keyword_value ( const char *locale_id, const char *keyword_name, char *buffer, int32_t buffer_capacity ); +int32_t i18n_ulocale_get_keyword_value(const char *locale_id, const char *keyword_name, char *buffer, int32_t buffer_capacity); /** * @brief Sets or removes the value of the specified keyword. @@ -704,7 +704,7 @@ int32_t i18n_ulocale_get_keyword_value ( const char *locale_id, const char *keyw * * @see i18n_ulocale_get_keyword_value() */ -int32_t i18n_ulocale_set_keyword_value ( const char *keyword_name, const char *keyword_value, char *buffer, int32_t buffer_capacity ); +int32_t i18n_ulocale_set_keyword_value(const char *keyword_name, const char *keyword_value, char *buffer, int32_t buffer_capacity); /** * @brief Gets the layout character orientation for the specified locale. @@ -718,7 +718,7 @@ int32_t i18n_ulocale_set_keyword_value ( const char *keyword_name, const char *k * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_character_orientation ( const char *locale_id, i18n_ulocale_layout_type_e *layout_type ); +int i18n_ulocale_get_character_orientation(const char *locale_id, i18n_ulocale_layout_type_e *layout_type); /** * @brief Gets the layout line orientation for the specified locale. @@ -732,7 +732,7 @@ int i18n_ulocale_get_character_orientation ( const char *locale_id, i18n_ulocale * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_line_orientation ( const char *locale_id, i18n_ulocale_layout_type_e *layout_type ); +int i18n_ulocale_get_line_orientation(const char *locale_id, i18n_ulocale_layout_type_e *layout_type); /** * @brief Gets the I18N locale ID for the specified Win32 LCID value. @@ -751,7 +751,7 @@ int i18n_ulocale_get_line_orientation ( const char *locale_id, i18n_ulocale_layo * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_locale_for_lcid ( uint32_t host_id, char *locale, int32_t locale_capacity ); +int32_t i18n_ulocale_get_locale_for_lcid(uint32_t host_id, char *locale, int32_t locale_capacity); /** * @brief Adds the likely subtags for a provided locale ID, per the algorithm described @@ -785,7 +785,7 @@ int32_t i18n_ulocale_get_locale_for_lcid ( uint32_t host_id, char *locale, int32 * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_add_likely_subtags ( const char *locale_id, char *maximized_locale_id, int32_t maximized_locale_id_capacity ); +int32_t i18n_ulocale_add_likely_subtags(const char *locale_id, char *maximized_locale_id, int32_t maximized_locale_id_capacity); /** * @brief Minimizes the subtags for a provided locale ID, per the algorithm described @@ -818,7 +818,7 @@ int32_t i18n_ulocale_add_likely_subtags ( const char *locale_id, char *maximized * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_minimize_subtags ( const char *locale_id, char *minimized_locale_id, int32_t minimized_locale_id_capacity ); +int32_t i18n_ulocale_minimize_subtags(const char *locale_id, char *minimized_locale_id, int32_t minimized_locale_id_capacity); /** * @brief Returns a locale ID for the specified BCP47 language tag string. @@ -849,7 +849,7 @@ int32_t i18n_ulocale_minimize_subtags ( const char *locale_id, char *minimized_l * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_for_language_tag ( const char *langtag, char *locale_id, int32_t locale_id_capacity, int32_t *parsed_length ); +int32_t i18n_ulocale_for_language_tag(const char *langtag, char *locale_id, int32_t locale_id_capacity, int32_t *parsed_length); /** * @brief Returns a well-formed language tag for this locale ID. @@ -877,7 +877,7 @@ int32_t i18n_ulocale_for_language_tag ( const char *langtag, char *locale_id, in * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_to_language_tag ( const char *locale_id, char *langtag, int32_t langtag_capacity, i18n_ubool strict ); +int32_t i18n_ulocale_to_language_tag(const char *locale_id, char *langtag, int32_t langtag_capacity, i18n_ubool strict); #ifdef __cplusplus } diff --git a/src/include/mobile/utils_i18n_unormalization.h b/src/include/mobile/utils_i18n_unormalization.h index 76ecbc0..15bad5d 100755 --- a/src/include/mobile/utils_i18n_unormalization.h +++ b/src/include/mobile/utils_i18n_unormalization.h @@ -81,7 +81,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unormalization_get_instance (const char *package_name, const char *name, i18n_unormalization_mode_e mode, +int i18n_unormalization_get_instance(const char *package_name, const char *name, i18n_unormalization_mode_e mode, i18n_unormalizer_h *normalizer); /** @@ -100,7 +100,7 @@ int i18n_unormalization_get_instance (const char *package_name, const char *name * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unormalization_normalize (i18n_unormalizer_h normalizer, const i18n_uchar *src, int32_t len, i18n_uchar *dest, int32_t capacity, int32_t *len_deststr); +int i18n_unormalization_normalize(i18n_unormalizer_h normalizer, const i18n_uchar *src, int32_t len, i18n_uchar *dest, int32_t capacity, int32_t *len_deststr); #ifdef __cplusplus } diff --git a/src/include/mobile/utils_i18n_unumber.h b/src/include/mobile/utils_i18n_unumber.h index f1e7cf3..4a4e2ac 100644 --- a/src/include/mobile/utils_i18n_unumber.h +++ b/src/include/mobile/utils_i18n_unumber.h @@ -106,8 +106,8 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_create ( i18n_unumber_format_style_e style, const i18n_uchar *pattern, int32_t pattern_len, const char *locale, - i18n_uparse_error_s *parse_err, i18n_unumber_format_h *num_format ); +int i18n_unumber_create(i18n_unumber_format_style_e style, const i18n_uchar *pattern, int32_t pattern_len, const char *locale, + i18n_uparse_error_s *parse_err, i18n_unumber_format_h *num_format); /** * @brief Destroys an #i18n_unumber_format_h. @@ -119,7 +119,7 @@ int i18n_unumber_create ( i18n_unumber_format_style_e style, const i18n_uchar *p * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_destroy ( i18n_unumber_format_h fmt ); +int i18n_unumber_destroy(i18n_unumber_format_h fmt); /** * @brief Gets a symbol associated with an #i18n_unumber_format_h. @@ -138,7 +138,7 @@ int i18n_unumber_destroy ( i18n_unumber_format_h fmt ); * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_get_symbol ( const i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, i18n_uchar *buffer, int32_t size, int32_t *len_symbol ); +int i18n_unumber_get_symbol(const i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, i18n_uchar *buffer, int32_t size, int32_t *len_symbol); // Newly Added APIs @@ -156,7 +156,7 @@ int i18n_unumber_get_symbol ( const i18n_unumber_format_h fmt, i18n_unumber_form * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_clone (const i18n_unumber_format_h fmt, i18n_unumber_format_h *fmt_clone); +int i18n_unumber_clone(const i18n_unumber_format_h fmt, i18n_unumber_format_h *fmt_clone); /** * @brief Formats an integer using a i18n_unumber_format_h. @@ -177,7 +177,7 @@ int i18n_unumber_clone (const i18n_unumber_format_h fmt, i18n_unumber_format_h * * * @return The total buffer size needed; if greater than result_length, the output was truncated. */ -int32_t i18n_unumber_format (const i18n_unumber_format_h fmt, int32_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_s *pos, i18n_error_code_e *status); +int32_t i18n_unumber_format(const i18n_unumber_format_h fmt, int32_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_s *pos, i18n_error_code_e *status); /** * @brief Formats an int64 using an #i18n_unumber_format_h. @@ -204,7 +204,7 @@ int32_t i18n_unumber_format (const i18n_unumber_format_h fmt, int32_t number, i1 * @exception #I18N_WARNING_STRING_NOT_TERMINATED If the formatted number fits into @a result but cannot be NULL-terminated (length == result_length) * @exception #I18N_ERROR_BUFFER_OVERFLOW If the formatted number doesn't fit into the @a result buffer */ -int32_t i18n_unumber_format_int64 (const i18n_unumber_format_h fmt, int64_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); +int32_t i18n_unumber_format_int64(const i18n_unumber_format_h fmt, int64_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); /** * @brief Formats a double using an #i18n_unumber_format_h. @@ -232,7 +232,7 @@ int32_t i18n_unumber_format_int64 (const i18n_unumber_format_h fmt, int64_t numb * @exception #I18N_WARNING_STRING_NOT_TERMINATED If the formatted number fits into @a result but cannot be NULL-terminated (length == result_length) * @exception #I18N_ERROR_BUFFER_OVERFLOW If the formatted number doesn't fit into the @a result buffer */ -int32_t i18n_unumber_format_double (const i18n_unumber_format_h fmt, double number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); +int32_t i18n_unumber_format_double(const i18n_unumber_format_h fmt, double number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); /** * @brief Formats a decimal number using an #i18n_unumber_format_h. @@ -263,7 +263,7 @@ int32_t i18n_unumber_format_double (const i18n_unumber_format_h fmt, double numb * @exception #I18N_WARNING_STRING_NOT_TERMINATED If the formatted number fits into @a result but cannot be NULL-terminated (length == result_length) * @exception #I18N_ERROR_BUFFER_OVERFLOW If the formatted number doesn't fit into the @a result buffer */ -int32_t i18n_unumber_format_decimal (const i18n_unumber_format_h fmt, const char *number, int32_t length, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); +int32_t i18n_unumber_format_decimal(const i18n_unumber_format_h fmt, const char *number, int32_t length, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); /** * @brief Formats a double currency amount using an #i18n_unumber_format_h. @@ -293,7 +293,7 @@ int32_t i18n_unumber_format_decimal (const i18n_unumber_format_h fmt, const char * @exception #I18N_WARNING_STRING_NOT_TERMINATED If the formatted number fits into @a result but cannot be NULL-terminated (length == result_length) * @exception #I18N_ERROR_BUFFER_OVERFLOW If the formatted number doesn't fit into the @a result buffer */ -int32_t i18n_unumber_format_double_currency (const i18n_unumber_format_h fmt, double number, i18n_uchar *currency, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); +int32_t i18n_unumber_format_double_currency(const i18n_unumber_format_h fmt, double number, i18n_uchar *currency, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); /** * @brief Parses a string into an integer using an #i18n_unumber_format_h. @@ -313,7 +313,7 @@ int32_t i18n_unumber_format_double_currency (const i18n_unumber_format_h fmt, do * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_parse (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); +int32_t i18n_unumber_parse(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); /** * @brief Parses a string into an int64 using an #i18n_unumber_format_h. @@ -333,7 +333,7 @@ int32_t i18n_unumber_parse (const i18n_unumber_format_h fmt, const i18n_uchar *t * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int64_t i18n_unumber_parse_int64 (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); +int64_t i18n_unumber_parse_int64(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); /** * @brief Parses a string into a double using an #i18n_unumber_format_h. @@ -353,7 +353,7 @@ int64_t i18n_unumber_parse_int64 (const i18n_unumber_format_h fmt, const i18n_uc * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -double i18n_unumber_parse_double (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); +double i18n_unumber_parse_double(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); /** * @brief Parses a number from a string into an unformatted numeric string using an #i18n_unumber_format_h. @@ -379,7 +379,7 @@ double i18n_unumber_parse_double (const i18n_unumber_format_h fmt, const i18n_uc * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_parse_decimal (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, char *out_buf, int32_t out_buf_length); +int32_t i18n_unumber_parse_decimal(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, char *out_buf, int32_t out_buf_length); /** * @brief Parses a string into a double and a currency using an #i18n_unumber_format_h. @@ -403,7 +403,7 @@ int32_t i18n_unumber_parse_decimal (const i18n_unumber_format_h fmt, const i18n_ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -double i18n_unumber_parse_double_currency (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_uchar *currency); +double i18n_unumber_parse_double_currency(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_uchar *currency); /** * @brief Sets the pattern used by an #i18n_unumber_format_h. @@ -422,7 +422,7 @@ double i18n_unumber_parse_double_currency (const i18n_unumber_format_h fmt, cons * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_apply_pattern (i18n_unumber_format_h format, i18n_ubool localized, const i18n_uchar *pattern, int32_t pattern_length, i18n_uparse_error_s* parse_error); +int i18n_unumber_apply_pattern(i18n_unumber_format_h format, i18n_ubool localized, const i18n_uchar *pattern, int32_t pattern_length, i18n_uparse_error_s* parse_error); /** * @brief Gets a locale for which decimal formatting patterns are available. @@ -438,7 +438,7 @@ int i18n_unumber_apply_pattern (i18n_unumber_format_h format, i18n_ubool localiz * * @exception #I18N_ERROR_NONE Successful */ -const char *i18n_unumber_get_available (int32_t locale_index); +const char *i18n_unumber_get_available(int32_t locale_index); /** * @brief Determines how many locales have decimal formatting patterns available. @@ -452,7 +452,7 @@ const char *i18n_unumber_get_available (int32_t locale_index); * * @exception #I18N_ERROR_NONE Successful */ -int32_t i18n_unumber_count_available (void); +int32_t i18n_unumber_count_available(void); /** * @brief Gets a numeric attribute associated with an #i18n_unumber_format_h. @@ -474,7 +474,7 @@ int32_t i18n_unumber_count_available (void); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_get_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr); +int32_t i18n_unumber_get_attribute(const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr); /** * @brief Sets a numeric attribute associated with an #i18n_unumber_format_h. @@ -499,7 +499,7 @@ int32_t i18n_unumber_get_attribute (const i18n_unumber_format_h fmt, i18n_unumbe * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_set_attribute (i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, int32_t new_value); +int i18n_unumber_set_attribute(i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, int32_t new_value); /** * @brief Gets a numeric attribute associated with an #i18n_unumber_format_h. @@ -517,7 +517,7 @@ int i18n_unumber_set_attribute (i18n_unumber_format_h fmt, i18n_unumber_format_a * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -double i18n_unumber_get_double_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr); +double i18n_unumber_get_double_attribute(const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr); /** * @brief Sets a numeric attribute associated with an #i18n_unumber_format_h. @@ -534,7 +534,7 @@ double i18n_unumber_get_double_attribute (const i18n_unumber_format_h fmt, i18n_ * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_set_double_attribute (i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, double new_value); +int i18n_unumber_set_double_attribute(i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, double new_value); /** * @brief Gets a text attribute associated with an #i18n_unumber_format_h. @@ -557,7 +557,7 @@ int i18n_unumber_set_double_attribute (i18n_unumber_format_h fmt, i18n_unumber_f * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_get_text_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, i18n_uchar *result, int32_t result_length); +int32_t i18n_unumber_get_text_attribute(const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, i18n_uchar *result, int32_t result_length); /** * @brief Sets a text attribute associated with an #i18n_unumber_format_h. @@ -577,7 +577,7 @@ int32_t i18n_unumber_get_text_attribute (const i18n_unumber_format_h fmt, i18n_u * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_set_text_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, const i18n_uchar *new_value, int32_t new_value_length); +int i18n_unumber_set_text_attribute(const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, const i18n_uchar *new_value, int32_t new_value_length); /** * @brief Extracts the pattern from an #i18n_unumber_format_h. @@ -597,7 +597,7 @@ int i18n_unumber_set_text_attribute (const i18n_unumber_format_h fmt, i18n_unumb * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_to_pattern (const i18n_unumber_format_h fmt, i18n_ubool is_pattern_localized, i18n_uchar *result, int32_t result_length); +int32_t i18n_unumber_to_pattern(const i18n_unumber_format_h fmt, i18n_ubool is_pattern_localized, i18n_uchar *result, int32_t result_length); /** * @brief Sets a symbol associated with an #i18n_unumber_format_h. @@ -615,7 +615,7 @@ int32_t i18n_unumber_to_pattern (const i18n_unumber_format_h fmt, i18n_ubool is_ * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_set_symbol (i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, const i18n_uchar *value, int32_t length); +int i18n_unumber_set_symbol(i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, const i18n_uchar *value, int32_t length); /** * @brief Gets the locale for this number format object. @@ -632,7 +632,7 @@ int i18n_unumber_set_symbol (i18n_unumber_format_h fmt, i18n_unumber_format_symb * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char *i18n_unumber_get_locale_by_type (const i18n_unumber_format_h fmt, i18n_ulocale_data_locale_type_e type); +const char *i18n_unumber_get_locale_by_type(const i18n_unumber_format_h fmt, i18n_ulocale_data_locale_type_e type); #ifdef __cplusplus diff --git a/src/include/mobile/utils_i18n_usearch.h b/src/include/mobile/utils_i18n_usearch.h index a770cf6..9478569 100755 --- a/src/include/mobile/utils_i18n_usearch.h +++ b/src/include/mobile/utils_i18n_usearch.h @@ -103,7 +103,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_usearch_create ( const i18n_uchar *pattern, int32_t pattern_len, const i18n_uchar *text, int32_t text_len, const char *locale, i18n_ubreak_iterator_s *break_iter, i18n_usearch_h *search_iter ); +int i18n_usearch_create(const i18n_uchar *pattern, int32_t pattern_len, const i18n_uchar *text, int32_t text_len, const char *locale, i18n_ubreak_iterator_s *break_iter, i18n_usearch_h *search_iter); /** * @brief Creates an #i18n_usearch_h using the argument locale language rule set. @@ -126,7 +126,7 @@ int i18n_usearch_create ( const i18n_uchar *pattern, int32_t pattern_len, const * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_usearch_create_new ( const i18n_uchar *pattern, int32_t pattern_len, const i18n_uchar *text, +int i18n_usearch_create_new(const i18n_uchar *pattern, int32_t pattern_len, const i18n_uchar *text, int32_t text_len, const char *locale, i18n_ubreak_iterator_h break_iter, i18n_usearch_h *search_iter); /** @@ -139,7 +139,7 @@ int i18n_usearch_create_new ( const i18n_uchar *pattern, int32_t pattern_len, co * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_usearch_destroy ( i18n_usearch_h search_iter ); +int i18n_usearch_destroy(i18n_usearch_h search_iter); /** * @brief Returns the text that matches by the most recent call to i18n_usearch_first(), or so on. @@ -161,7 +161,7 @@ int i18n_usearch_destroy ( i18n_usearch_h search_iter ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @retval #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int i18n_usearch_get_matched_text ( const i18n_usearch_h search_iter, i18n_uchar *result, int32_t result_capacity, int32_t *len_matched_text ); +int i18n_usearch_get_matched_text(const i18n_usearch_h search_iter, i18n_uchar *result, int32_t result_capacity, int32_t *len_matched_text); /** * @brief Gets the collator used for the language rules. @@ -176,7 +176,7 @@ int i18n_usearch_get_matched_text ( const i18n_usearch_h search_iter, i18n_uchar * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_usearch_get_collator ( const i18n_usearch_h search_iter, i18n_ucollator_h *collator ); +int i18n_usearch_get_collator(const i18n_usearch_h search_iter, i18n_ucollator_h *collator); /** * @brief Returns the first index at which the string text matches the search pattern. @@ -193,7 +193,7 @@ int i18n_usearch_get_collator ( const i18n_usearch_h search_iter, i18n_ucollator * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_usearch_first ( i18n_usearch_h search_iter, int32_t *index_first ); +int i18n_usearch_first(i18n_usearch_h search_iter, int32_t *index_first); #ifdef __cplusplus } diff --git a/src/include/mobile/utils_i18n_uset.h b/src/include/mobile/utils_i18n_uset.h index 6cf528e..8e40c1f 100755 --- a/src/include/mobile/utils_i18n_uset.h +++ b/src/include/mobile/utils_i18n_uset.h @@ -63,7 +63,7 @@ extern "C" { * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_destroy() */ -int i18n_uset_create_empty (i18n_uset_h *set); +int i18n_uset_create_empty(i18n_uset_h *set); /** * @brief Creates an #i18n_uset_h object that contains the range of characters @@ -81,7 +81,7 @@ int i18n_uset_create_empty (i18n_uset_h *set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_destroy() */ -int i18n_uset_create (i18n_uchar32 start, i18n_uchar32 end, i18n_uset_h *set); +int i18n_uset_create(i18n_uchar32 start, i18n_uchar32 end, i18n_uset_h *set); /** * @brief Creates a set based on a given pattern. @@ -98,7 +98,7 @@ int i18n_uset_create (i18n_uchar32 start, i18n_uchar32 end, i18n_uset_h *set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_destroy() */ -int i18n_uset_create_pattern (const i18n_uchar *pattern, int32_t pattern_length, i18n_uset_h *set); +int i18n_uset_create_pattern(const i18n_uchar *pattern, int32_t pattern_length, i18n_uset_h *set); /** * @brief Creates a set based on a given pattern. @@ -117,7 +117,7 @@ int i18n_uset_create_pattern (const i18n_uchar *pattern, int32_t pattern_length, * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_destroy() */ -int i18n_uset_create_pattern_options (const i18n_uchar *pattern, int32_t pattern_length, uint32_t options, i18n_uset_h *set); +int i18n_uset_create_pattern_options(const i18n_uchar *pattern, int32_t pattern_length, uint32_t options, i18n_uset_h *set); /** * @brief Disposes of the storage used by a #i18n_uset_h object. @@ -130,7 +130,7 @@ int i18n_uset_create_pattern_options (const i18n_uchar *pattern, int32_t pattern * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_destroy (i18n_uset_h set); +int i18n_uset_destroy(i18n_uset_h set); /** * @brief Returns a copy of this object. @@ -146,7 +146,7 @@ int i18n_uset_destroy (i18n_uset_h set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_clone_as_thawed() */ -int i18n_uset_clone (const i18n_uset_h set, i18n_uset_h *set_clone); +int i18n_uset_clone(const i18n_uset_h set, i18n_uset_h *set_clone); /** * @brief Determines whether the set has been frozen (made immutable) or not. @@ -164,7 +164,7 @@ int i18n_uset_clone (const i18n_uset_h set, i18n_uset_h *set_clone); * @see i18n_uset_freeze() * @see i18n_uset_clone_as_thawed() */ -i18n_ubool i18n_uset_is_frozen (const i18n_uset_h set); +i18n_ubool i18n_uset_is_frozen(const i18n_uset_h set); /** * @brief Freezes the set (make it immutable). @@ -185,7 +185,7 @@ i18n_ubool i18n_uset_is_frozen (const i18n_uset_h set); * @see i18n_uset_is_frozen() * @see i18n_uset_clone_as_thawed() */ -int i18n_uset_freeze (i18n_uset_h set); +int i18n_uset_freeze(i18n_uset_h set); /** * @brief Clones the set and make the clone mutable. @@ -202,7 +202,7 @@ int i18n_uset_freeze (i18n_uset_h set); * @see i18n_uset_is_frozen() * @see i18n_uset_clone() */ -int i18n_uset_clone_as_thawed (const i18n_uset_h set, i18n_uset_h *set_copy); +int i18n_uset_clone_as_thawed(const i18n_uset_h set, i18n_uset_h *set_copy); /** * @brief Causes the #i18n_uset_h object to represent the range start - end. @@ -218,7 +218,7 @@ int i18n_uset_clone_as_thawed (const i18n_uset_h set, i18n_uset_h *set_copy); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_set (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +int i18n_uset_set(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Modifies the set to represent the set specified by the given @@ -248,7 +248,7 @@ int i18n_uset_set (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_apply_pattern (i18n_uset_h set, const i18n_uchar *pattern, int32_t pattern_length, uint32_t options); +int32_t i18n_uset_apply_pattern(i18n_uset_h set, const i18n_uchar *pattern, int32_t pattern_length, uint32_t options); /** * @brief Modifies the set to contain those code points which have the given value @@ -271,7 +271,7 @@ int32_t i18n_uset_apply_pattern (i18n_uset_h set, const i18n_uchar *pattern, int * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_apply_int_property_value (i18n_uset_h set, i18n_uchar_uproperty_e prop, int32_t value); +int i18n_uset_apply_int_property_value(i18n_uset_h set, i18n_uchar_uproperty_e prop, int32_t value); /** * @brief Modifies the set to contain those code points which have the @@ -305,7 +305,7 @@ int i18n_uset_apply_int_property_value (i18n_uset_h set, i18n_uchar_uproperty_e * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_apply_property_alias (i18n_uset_h set, const i18n_uchar *prop, int32_t prop_length, const i18n_uchar *value, int32_t value_length); +int i18n_uset_apply_property_alias(i18n_uset_h set, const i18n_uchar *prop, int32_t prop_length, const i18n_uchar *value, int32_t value_length); /** * @brief Return true if the given position, in the given pattern, appears @@ -324,7 +324,7 @@ int i18n_uset_apply_property_alias (i18n_uset_h set, const i18n_uchar *prop, int * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_resembles_pattern (const i18n_uchar *pattern, int32_t pattern_length, int32_t pos); +i18n_ubool i18n_uset_resembles_pattern(const i18n_uchar *pattern, int32_t pattern_length, int32_t pos); /** * @brief Returns a string representation of the given @a set. @@ -347,7 +347,7 @@ i18n_ubool i18n_uset_resembles_pattern (const i18n_uchar *pattern, int32_t patte * * @see i18n_uset_pattern_create() */ -int32_t i18n_uset_to_pattern (const i18n_uset_h set, i18n_uchar *result, int32_t result_capacity, i18n_ubool escape_unprintable); +int32_t i18n_uset_to_pattern(const i18n_uset_h set, i18n_uchar *result, int32_t result_capacity, i18n_ubool escape_unprintable); /** * @brief Adds the given character to the given #i18n_uset_h. @@ -364,7 +364,7 @@ int32_t i18n_uset_to_pattern (const i18n_uset_h set, i18n_uchar *result, int32_t * * @see i18n_uset_contains() */ -int i18n_uset_add (i18n_uset_h set, i18n_uchar32 character); +int i18n_uset_add(i18n_uset_h set, i18n_uchar32 character); /** @@ -383,7 +383,7 @@ int i18n_uset_add (i18n_uset_h set, i18n_uchar32 character); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_add_all (i18n_uset_h set, const i18n_uset_h additional_set); +int i18n_uset_add_all(i18n_uset_h set, const i18n_uset_h additional_set); /** * @brief Adds the given range of characters to the given #i18n_uset_h. After this call, @@ -400,7 +400,7 @@ int i18n_uset_add_all (i18n_uset_h set, const i18n_uset_h additional_set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_contains() */ -int i18n_uset_add_range (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +int i18n_uset_add_range(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Adds the given string to the given #i18n_uset_h. @@ -417,7 +417,7 @@ int i18n_uset_add_range (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_contains_string() */ -int i18n_uset_add_string (i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +int i18n_uset_add_string(i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Adds each of the characters in this string to the set. Thus "ch" => {"c", "h"} @@ -433,7 +433,7 @@ int i18n_uset_add_string (i18n_uset_h set, const i18n_uchar *str, int32_t str_le * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_add_all_code_points (i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +int i18n_uset_add_all_code_points(i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Removes the given @a character from the given #i18n_uset_h. @@ -450,7 +450,7 @@ int i18n_uset_add_all_code_points (i18n_uset_h set, const i18n_uchar *str, int32 * * @see i18n_uset_contains() */ -int i18n_uset_remove (i18n_uset_h set, i18n_uchar32 character); +int i18n_uset_remove(i18n_uset_h set, i18n_uchar32 character); /** * @brief Removes the given range of characters from the given #i18n_uset_h. @@ -467,7 +467,7 @@ int i18n_uset_remove (i18n_uset_h set, i18n_uchar32 character); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_contains() */ -int i18n_uset_remove_range (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +int i18n_uset_remove_range(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Removes the given string to the given #i18n_uset_h. @@ -484,7 +484,7 @@ int i18n_uset_remove_range (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 en * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_contains_string() */ -int i18n_uset_remove_string (i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +int i18n_uset_remove_string(i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Removes from this set all of its elements that are contained in the specified set. @@ -501,7 +501,7 @@ int i18n_uset_remove_string (i18n_uset_h set, const i18n_uchar *str, int32_t str * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_remove_all (i18n_uset_h set, const i18n_uset_h remove_set); +int i18n_uset_remove_all(i18n_uset_h set, const i18n_uset_h remove_set); /** * @brief Retains only the elements in this set that are contained in the specified range. @@ -520,7 +520,7 @@ int i18n_uset_remove_all (i18n_uset_h set, const i18n_uset_h remove_set); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_retain (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +int i18n_uset_retain(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Retains only the elements in this set that are contained in the @@ -539,7 +539,7 @@ int i18n_uset_retain (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_retain_all (i18n_uset_h set, const i18n_uset_h retain); +int i18n_uset_retain_all(i18n_uset_h set, const i18n_uset_h retain); /** * @brief Reallocates this objects internal structures to take up the least @@ -553,7 +553,7 @@ int i18n_uset_retain_all (i18n_uset_h set, const i18n_uset_h retain); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_compact (i18n_uset_h set); +int i18n_uset_compact(i18n_uset_h set); /** * @brief Inverts this set. This operation modifies this set so that @@ -569,7 +569,7 @@ int i18n_uset_compact (i18n_uset_h set); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_complement (i18n_uset_h set); +int i18n_uset_complement(i18n_uset_h set); /** * @brief Complements in this set all elements contained in the specified set. @@ -586,7 +586,7 @@ int i18n_uset_complement (i18n_uset_h set); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_complement_all (i18n_uset_h set, const i18n_uset_h complement); +int i18n_uset_complement_all(i18n_uset_h set, const i18n_uset_h complement); /** * @brief Removes all of the elements from this set. @@ -600,7 +600,7 @@ int i18n_uset_complement_all (i18n_uset_h set, const i18n_uset_h complement); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_clear (i18n_uset_h set); +int i18n_uset_clear(i18n_uset_h set); /** * @brief Closes this set over the given attribute. @@ -633,7 +633,7 @@ int i18n_uset_clear (i18n_uset_h set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_fold_case() */ -int i18n_uset_destroy_over (i18n_uset_h set, int32_t attributes); +int i18n_uset_destroy_over(i18n_uset_h set, int32_t attributes); /** * @brief Removes all strings from this set. @@ -645,7 +645,7 @@ int i18n_uset_destroy_over (i18n_uset_h set, int32_t attributes); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_remove_all_strings (i18n_uset_h set); +int i18n_uset_remove_all_strings(i18n_uset_h set); /** * @brief Returns true if the given #i18n_uset_h contains no characters and no @@ -661,7 +661,7 @@ int i18n_uset_remove_all_strings (i18n_uset_h set); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_is_empty (const i18n_uset_h set); +i18n_ubool i18n_uset_is_empty(const i18n_uset_h set); /** * @brief Returns @c true if the given #i18n_uset_h contains the given @a character. @@ -678,7 +678,7 @@ i18n_ubool i18n_uset_is_empty (const i18n_uset_h set); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains (const i18n_uset_h set, i18n_uchar32 character); +i18n_ubool i18n_uset_contains(const i18n_uset_h set, i18n_uchar32 character); /** * @brief Returns true if the given #i18n_uset_h contains all characters c @@ -696,7 +696,7 @@ i18n_ubool i18n_uset_contains (const i18n_uset_h set, i18n_uchar32 character); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_range (const i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +i18n_ubool i18n_uset_contains_range(const i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Returns true if the given #i18n_uset_h contains the given string. @@ -713,7 +713,7 @@ i18n_ubool i18n_uset_contains_range (const i18n_uset_h set, i18n_uchar32 start, * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_string (const i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +i18n_ubool i18n_uset_contains_string(const i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Returns the index of the given @a character within this @a set, where @@ -732,7 +732,7 @@ i18n_ubool i18n_uset_contains_string (const i18n_uset_h set, const i18n_uchar *s * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_index_of (const i18n_uset_h set, i18n_uchar32 character); +int32_t i18n_uset_index_of(const i18n_uset_h set, i18n_uchar32 character); /** * @brief Returns the character at the given index within this set, where @@ -751,7 +751,7 @@ int32_t i18n_uset_index_of (const i18n_uset_h set, i18n_uchar32 character); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar32 i18n_uset_char_at (const i18n_uset_h set, int32_t char_index); +i18n_uchar32 i18n_uset_char_at(const i18n_uset_h set, int32_t char_index); /** * @brief Returns the number of characters and strings contained in the given #i18n_uset_h. @@ -767,7 +767,7 @@ i18n_uchar32 i18n_uset_char_at (const i18n_uset_h set, int32_t char_index); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_size (const i18n_uset_h set); +int32_t i18n_uset_size(const i18n_uset_h set); /** * @brief Returns the number of items in this set. @@ -784,7 +784,7 @@ int32_t i18n_uset_size (const i18n_uset_h set); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_get_item_count (const i18n_uset_h set); +int32_t i18n_uset_get_item_count(const i18n_uset_h set); /** * @brief Returns an item of this set. @@ -809,7 +809,7 @@ int32_t i18n_uset_get_item_count (const i18n_uset_h set); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_get_item (const i18n_uset_h set, int32_t item_index, i18n_uchar32 *start, i18n_uchar32 *end, i18n_uchar *str, int32_t str_capacity); +int32_t i18n_uset_get_item(const i18n_uset_h set, int32_t item_index, i18n_uchar32 *start, i18n_uchar32 *end, i18n_uchar *str, int32_t str_capacity); /** * @brief Returns true if set1 contains all the characters and strings of set2. It answers the question, 'Is set1 a superset of set2?' @@ -825,7 +825,7 @@ int32_t i18n_uset_get_item (const i18n_uset_h set, int32_t item_index, i18n_ucha * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_all (const i18n_uset_h set1, const i18n_uset_h set2); +i18n_ubool i18n_uset_contains_all(const i18n_uset_h set1, const i18n_uset_h set2); /** * @brief Returns true if this set contains all the characters of the given string. @@ -844,7 +844,7 @@ i18n_ubool i18n_uset_contains_all (const i18n_uset_h set1, const i18n_uset_h set * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_all_code_points (const i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +i18n_ubool i18n_uset_contains_all_code_points(const i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Returns true if set1 contains none of the characters and strings of set2. @@ -861,7 +861,7 @@ i18n_ubool i18n_uset_contains_all_code_points (const i18n_uset_h set, const i18n * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_none (const i18n_uset_h set1, const i18n_uset_h set2); +i18n_ubool i18n_uset_contains_none(const i18n_uset_h set1, const i18n_uset_h set2); /** * @brief Returns true if set1 contains some of the characters and strings of set2. @@ -878,7 +878,7 @@ i18n_ubool i18n_uset_contains_none (const i18n_uset_h set1, const i18n_uset_h se * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_some (const i18n_uset_h set1, const i18n_uset_h set2); +i18n_ubool i18n_uset_contains_some(const i18n_uset_h set1, const i18n_uset_h set2); /** * @brief Returns the length of the initial substring of the input string which @@ -907,7 +907,7 @@ i18n_ubool i18n_uset_contains_some (const i18n_uset_h set1, const i18n_uset_h se * * @see #i18n_uset_span_condition_e */ -int32_t i18n_uset_span (const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition); +int32_t i18n_uset_span(const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition); /** * @brief Returns the start of the trailing substring of the input string which @@ -935,7 +935,7 @@ int32_t i18n_uset_span (const i18n_uset_h set, const i18n_uchar *str, int32_t le * * @see #i18n_uset_span_condition_e */ -int32_t i18n_uset_span_back (const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition); +int32_t i18n_uset_span_back(const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition); /** * @brief Returns the length of the initial substring of the input string which @@ -964,7 +964,7 @@ int32_t i18n_uset_span_back (const i18n_uset_h set, const i18n_uchar *str, int32 * * @see #i18n_uset_span_condition_e */ -int32_t i18n_uset_span_utf8 (const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition); +int32_t i18n_uset_span_utf8(const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition); /** * @brief Returns the start of the trailing substring of the input string which @@ -992,7 +992,7 @@ int32_t i18n_uset_span_utf8 (const i18n_uset_h set, const char *str, int32_t len * * @see #i18n_uset_span_condition_e */ -int32_t i18n_uset_span_back_utf8 (const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition); +int32_t i18n_uset_span_back_utf8(const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition); /** * @brief Returns true if set1 contains all of the characters and strings @@ -1009,7 +1009,7 @@ int32_t i18n_uset_span_back_utf8 (const i18n_uset_h set, const char *str, int32_ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_equals (const i18n_uset_h set1, const i18n_uset_h set2); +i18n_ubool i18n_uset_equals(const i18n_uset_h set1, const i18n_uset_h set2); /********************************************************************* * Serialized set API @@ -1070,7 +1070,7 @@ i18n_ubool i18n_uset_equals (const i18n_uset_h set1, const i18n_uset_h set2); * @exception #I18N_ERROR_INDEX_OUTOFBOUNDS If n+2*m > 0x7FFF * @exception #I18N_ERROR_BUFFER_OVERFLOW If n+2*m+(m != 0 ? 2 : 1) > dest_capacity. */ -int32_t i18n_uset_serialize (const i18n_uset_h set, uint16_t *dest, int32_t dest_capacity); +int32_t i18n_uset_serialize(const i18n_uset_h set, uint16_t *dest, int32_t dest_capacity); /** * @brief Given a serialized array, fill in the given serialized set object. @@ -1089,7 +1089,7 @@ int32_t i18n_uset_serialize (const i18n_uset_h set, uint16_t *dest, int32_t dest * * @see #i18n_userialized_set_s */ -i18n_ubool i18n_uset_get_serialized_set (const uint16_t *src, int32_t src_length, i18n_userialized_set_s* fill_set); +i18n_ubool i18n_uset_get_serialized_set(const uint16_t *src, int32_t src_length, i18n_userialized_set_s* fill_set); /** * @brief Sets the #i18n_userialized_set_s to contain the given @a character (and nothing else). @@ -1104,7 +1104,7 @@ i18n_ubool i18n_uset_get_serialized_set (const uint16_t *src, int32_t src_length * * @see #i18n_userialized_set_s */ -int i18n_uset_set_serialized_to_one (i18n_uchar32 character, i18n_userialized_set_s* fill_set); +int i18n_uset_set_serialized_to_one(i18n_uchar32 character, i18n_userialized_set_s* fill_set); /** * @brief Returns @c true if the given #i18n_userialized_set_s contains the given @a character. @@ -1121,7 +1121,7 @@ int i18n_uset_set_serialized_to_one (i18n_uchar32 character, i18n_userialized_se * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see #i18n_userialized_set_s */ -i18n_ubool i18n_uset_serialized_contains (const i18n_userialized_set_s* set, i18n_uchar32 character); +i18n_ubool i18n_uset_serialized_contains(const i18n_userialized_set_s* set, i18n_uchar32 character); /** * @brief Returns the number of disjoint ranges of characters contained in @@ -1139,7 +1139,7 @@ i18n_ubool i18n_uset_serialized_contains (const i18n_userialized_set_s* set, i18 * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see #i18n_userialized_set_s */ -int32_t i18n_uset_get_serialized_range_count (const i18n_userialized_set_s* set); +int32_t i18n_uset_get_serialized_range_count(const i18n_userialized_set_s* set); /** * @brief Returns a range of characters contained in the given serialized set. @@ -1161,7 +1161,7 @@ int32_t i18n_uset_get_serialized_range_count (const i18n_userialized_set_s* set) * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see #i18n_userialized_set_s */ -i18n_ubool i18n_uset_get_serialized_range (const i18n_userialized_set_s* set, int32_t range_index, i18n_uchar32 *p_start, i18n_uchar32 *p_end); +i18n_ubool i18n_uset_get_serialized_range(const i18n_userialized_set_s* set, int32_t range_index, i18n_uchar32 *p_start, i18n_uchar32 *p_end); /** * @} diff --git a/src/include/mobile/utils_i18n_ustring.h b/src/include/mobile/utils_i18n_ustring.h index dba29a0..71cbf4e 100644 --- a/src/include/mobile/utils_i18n_ustring.h +++ b/src/include/mobile/utils_i18n_ustring.h @@ -83,7 +83,7 @@ extern "C" { * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_get_length ( const i18n_uchar *s ); +int32_t i18n_ustring_get_length(const i18n_uchar *s); /** * @brief Counts Unicode code points in the length #i18n_uchar code units of the string. @@ -101,7 +101,7 @@ int32_t i18n_ustring_get_length ( const i18n_uchar *s ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_count_char32 ( const i18n_uchar *s, int32_t length ); +int32_t i18n_ustring_count_char32(const i18n_uchar *s, int32_t length); /** * @brief Checks if the string contains more Unicode code points than a certain number. @@ -122,7 +122,7 @@ int32_t i18n_ustring_count_char32 ( const i18n_uchar *s, int32_t length ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_ustring_has_more_char32_than ( const i18n_uchar *s, int32_t length, int32_t number ); +i18n_ubool i18n_ustring_has_more_char32_than(const i18n_uchar *s, int32_t length, int32_t number); /** * @brief Concatenates two ustrings. @@ -139,7 +139,7 @@ i18n_ubool i18n_ustring_has_more_char32_than ( const i18n_uchar *s, int32_t leng * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_cat ( i18n_uchar *dest, const i18n_uchar *src ); +i18n_uchar* i18n_ustring_cat(i18n_uchar *dest, const i18n_uchar *src); /** * @brief Concatenate two ustrings. @@ -157,7 +157,7 @@ i18n_uchar* i18n_ustring_cat ( i18n_uchar *dest, const i18n_uchar *src ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_cat_n ( i18n_uchar *dest, const i18n_uchar *src, int32_t n ); +i18n_uchar* i18n_ustring_cat_n(i18n_uchar *dest, const i18n_uchar *src, int32_t n); /** * @brief Finds the first occurrence of a substring in a string. @@ -182,7 +182,7 @@ i18n_uchar* i18n_ustring_cat_n ( i18n_uchar *dest, const i18n_uchar *src, int32_ * @see i18n_ustring_find_first() * @see i18n_ustring_find_last() */ -i18n_uchar* i18n_ustring_string ( const i18n_uchar *s, const i18n_uchar *sub_string ); +i18n_uchar* i18n_ustring_string(const i18n_uchar *s, const i18n_uchar *sub_string); /** * @brief Finds the first occurrence of a substring in a string. @@ -208,7 +208,7 @@ i18n_uchar* i18n_ustring_string ( const i18n_uchar *s, const i18n_uchar *sub_str * @see i18n_ustring_string() * @see i18n_ustring_find_last() */ -i18n_uchar* i18n_ustring_find_first ( const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length ); +i18n_uchar* i18n_ustring_find_first(const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length); /** * @brief Finds the first occurrence of a BMP code point in a string. @@ -229,7 +229,7 @@ i18n_uchar* i18n_ustring_find_first ( const i18n_uchar *s, int32_t length, const * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_char ( const i18n_uchar *s, i18n_uchar c ); +i18n_uchar* i18n_ustring_char(const i18n_uchar *s, i18n_uchar c); /** * @brief Finds the first occurrence of a code point in a string. @@ -250,7 +250,7 @@ i18n_uchar* i18n_ustring_char ( const i18n_uchar *s, i18n_uchar c ); * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_char32 ( const i18n_uchar *s, i18n_uchar32 c ); +i18n_uchar* i18n_ustring_char32(const i18n_uchar *s, i18n_uchar32 c); /** * @brief Finds the last occurrence of a substring in a string. @@ -273,7 +273,7 @@ i18n_uchar* i18n_ustring_char32 ( const i18n_uchar *s, i18n_uchar32 c ); * @see i18n_ustring_find_first() * @see i18n_ustring_find_last() */ -i18n_uchar* i18n_ustring_r_string ( const i18n_uchar *s, const i18n_uchar *sub_string ); +i18n_uchar* i18n_ustring_r_string(const i18n_uchar *s, const i18n_uchar *sub_string); /** * @brief Finds the last occurrence of a substring in a string. @@ -297,7 +297,7 @@ i18n_uchar* i18n_ustring_r_string ( const i18n_uchar *s, const i18n_uchar *sub_s * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_find_last( const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length ); +i18n_uchar* i18n_ustring_find_last(const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length); /** * @brief Finds the last occurrence of a BMP code point in a string. @@ -318,7 +318,7 @@ i18n_uchar* i18n_ustring_find_last( const i18n_uchar *s, int32_t length, const i * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_r_char ( const i18n_uchar *s, i18n_uchar c ); +i18n_uchar* i18n_ustring_r_char(const i18n_uchar *s, i18n_uchar c); /** * @brief Finds the last occurrence of a code point in a string. @@ -339,7 +339,7 @@ i18n_uchar* i18n_ustring_r_char ( const i18n_uchar *s, i18n_uchar c ); * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_r_char32 ( const i18n_uchar *s, i18n_uchar32 c ); +i18n_uchar* i18n_ustring_r_char32(const i18n_uchar *s, i18n_uchar32 c); /** * @brief Locates the first occurrence in the string of any of the characters in the string matchSet. @@ -356,7 +356,7 @@ i18n_uchar* i18n_ustring_r_char32 ( const i18n_uchar *s, i18n_uchar32 c ); * @return A pointer to the character in @a string that matches one of the * characters in @a match_set, or NULL if no such character is found. */ -i18n_uchar* i18n_ustring_pbrk ( const i18n_uchar *string, const i18n_uchar *match_set ); +i18n_uchar* i18n_ustring_pbrk(const i18n_uchar *string, const i18n_uchar *match_set); /** * @brief Returns the number of consecutive characters in string, beginning with the first, that do not occur somewhere in match_set. @@ -373,7 +373,7 @@ i18n_uchar* i18n_ustring_pbrk ( const i18n_uchar *string, const i18n_uchar *matc * @return The number of initial characters in @a string that do not * occur in @a match_set. */ -int32_t i18n_ustring_cspn ( const i18n_uchar *string, const i18n_uchar *match_set ); +int32_t i18n_ustring_cspn(const i18n_uchar *string, const i18n_uchar *match_set); /** * @brief Returns the number of consecutive characters in string, beginning with the first, that occur somewhere in match_set. @@ -390,7 +390,7 @@ int32_t i18n_ustring_cspn ( const i18n_uchar *string, const i18n_uchar *match_se * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_spn() */ -int32_t i18n_ustring_spn ( const i18n_uchar *string, const i18n_uchar *match_set ); +int32_t i18n_ustring_spn(const i18n_uchar *string, const i18n_uchar *match_set); /** * @brief The string tokenizer API allows an application to break a string into tokens. @@ -408,7 +408,7 @@ int32_t i18n_ustring_spn ( const i18n_uchar *string, const i18n_uchar *match_set * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_tokenizer_r ( i18n_uchar *src, const i18n_uchar *delim, i18n_uchar **save_state ); +i18n_uchar* i18n_ustring_tokenizer_r(i18n_uchar *src, const i18n_uchar *delim, i18n_uchar **save_state); /** * @brief Compares two Unicode strings for bitwise equality (code unit order). @@ -424,7 +424,7 @@ i18n_uchar* i18n_ustring_tokenizer_r ( i18n_uchar *src, const i18n_uchar *delim, * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare ( const i18n_uchar *s1, const i18n_uchar *s2 ); +int32_t i18n_ustring_compare(const i18n_uchar *s1, const i18n_uchar *s2); /** * @brief Compare two Unicode strings in code point order. @@ -441,7 +441,7 @@ int32_t i18n_ustring_compare ( const i18n_uchar *s1, const i18n_uchar *s2 ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare_code_point_order( const i18n_uchar *s1, const i18n_uchar *s2 ); +int32_t i18n_ustring_compare_code_point_order(const i18n_uchar *s1, const i18n_uchar *s2); /** * @brief Compare two Unicode strings (binary order). @@ -463,7 +463,7 @@ int32_t i18n_ustring_compare_code_point_order( const i18n_uchar *s1, const i18n_ * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare_binary_order( const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, i18n_ubool code_point_order ); +int32_t i18n_ustring_compare_binary_order(const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, i18n_ubool code_point_order); /** * @brief Compare two strings case-insensitively using full case folding. @@ -488,7 +488,7 @@ int32_t i18n_ustring_compare_binary_order( const i18n_uchar *s1, int32_t length1 * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_case_compare_with_length( const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, uint32_t options, i18n_error_code_e *error_code ); +int32_t i18n_ustring_case_compare_with_length(const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, uint32_t options, i18n_error_code_e *error_code); /** * @brief Compare two ustrings for bitwise equality. @@ -506,7 +506,7 @@ int32_t i18n_ustring_case_compare_with_length( const i18n_uchar *s1, int32_t len * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, int32_t n ); +int32_t i18n_ustring_compare_n(const i18n_uchar *s1, const i18n_uchar *s2, int32_t n); /** * @brief Compare two Unicode strings in code point order. @@ -524,7 +524,7 @@ int32_t i18n_ustring_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, int3 * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare_n_code_point_order( const i18n_uchar *s1, const i18n_uchar *s2, int32_t n ); +int32_t i18n_ustring_compare_n_code_point_order(const i18n_uchar *s1, const i18n_uchar *s2, int32_t n); /** * @brief Compare two strings case-insensitively using full case folding. @@ -542,7 +542,7 @@ int32_t i18n_ustring_compare_n_code_point_order( const i18n_uchar *s1, const i18 * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_case_compare( const i18n_uchar *s1, const i18n_uchar *s2, uint32_t options ); +int32_t i18n_ustring_case_compare(const i18n_uchar *s1, const i18n_uchar *s2, uint32_t options); /** * @brief Compare two strings case-insensitively using full case folding. @@ -561,7 +561,7 @@ int32_t i18n_ustring_case_compare( const i18n_uchar *s1, const i18n_uchar *s2, u * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_case_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, int32_t n, uint32_t options ); +int32_t i18n_ustring_case_compare_n(const i18n_uchar *s1, const i18n_uchar *s2, int32_t n, uint32_t options); /** * @brief Compare two strings case-insensitively using full case folding. @@ -580,7 +580,7 @@ int32_t i18n_ustring_case_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_mem_case_compare( const i18n_uchar *s1, const i18n_uchar *s2, int32_t length, uint32_t options ); +int32_t i18n_ustring_mem_case_compare(const i18n_uchar *s1, const i18n_uchar *s2, int32_t length, uint32_t options); /** * @brief Copies a ustring. Adds a NULL terminator. @@ -595,7 +595,7 @@ int32_t i18n_ustring_mem_case_compare( const i18n_uchar *s1, const i18n_uchar *s * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_copy ( i18n_uchar *dest, const i18n_uchar *src ); +i18n_uchar* i18n_ustring_copy(i18n_uchar *dest, const i18n_uchar *src); /** * @brief Copies a ustring. @@ -613,7 +613,7 @@ i18n_uchar* i18n_ustring_copy ( i18n_uchar *dest, const i18n_uchar *src ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_copy_n ( i18n_uchar *dest, const i18n_uchar *src, int32_t n ); +i18n_uchar* i18n_ustring_copy_n(i18n_uchar *dest, const i18n_uchar *src, int32_t n); /** * @brief Copies a byte string encoded in the default codepage to a ustring. @@ -629,7 +629,7 @@ i18n_uchar* i18n_ustring_copy_n ( i18n_uchar *dest, const i18n_uchar *src, int32 * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_copy_ua ( i18n_uchar *dest, const char *src ); +i18n_uchar* i18n_ustring_copy_ua(i18n_uchar *dest, const char *src); /** * @brief Copies a byte string encoded in the default codepage to a ustring. @@ -648,7 +648,7 @@ i18n_uchar* i18n_ustring_copy_ua ( i18n_uchar *dest, const char *src ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_copy_ua_n ( i18n_uchar *dest, const char *src, int32_t n ); +i18n_uchar* i18n_ustring_copy_ua_n(i18n_uchar *dest, const char *src, int32_t n); /** * @brief Copies a ustring to a byte string encoded in the default codepage. @@ -664,7 +664,7 @@ i18n_uchar* i18n_ustring_copy_ua_n ( i18n_uchar *dest, const char *src, int32_t * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -char* i18n_ustring_copy_au ( char *dest, const i18n_uchar *src ); +char* i18n_ustring_copy_au(char *dest, const i18n_uchar *src); /** * @brief Copies a ustring to a byte string encoded in the default codepage. @@ -683,7 +683,7 @@ char* i18n_ustring_copy_au ( char *dest, const i18n_uchar *src ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -char* i18n_ustring_copy_au_n ( char *dest, const i18n_uchar *src, int32_t n ); +char* i18n_ustring_copy_au_n(char *dest, const i18n_uchar *src, int32_t n); /** * @brief Synonym for memcpy(), but with #i18n_uchar characters only. @@ -699,7 +699,7 @@ char* i18n_ustring_copy_au_n ( char *dest, const i18n_uchar *src, int32_t n ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_mem_copy ( i18n_uchar *dest, const i18n_uchar *src, int32_t count ); +i18n_uchar* i18n_ustring_mem_copy(i18n_uchar *dest, const i18n_uchar *src, int32_t count); /** * @brief Synonym for memmove(), but with #i18n_uchar characters only. @@ -715,7 +715,7 @@ i18n_uchar* i18n_ustring_mem_copy ( i18n_uchar *dest, const i18n_uchar *src, int * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_mem_move ( i18n_uchar *dest, const i18n_uchar *src, int32_t count ); +i18n_uchar* i18n_ustring_mem_move(i18n_uchar *dest, const i18n_uchar *src, int32_t count); /** * @brief Initialize count characters of dest to c. @@ -731,7 +731,7 @@ i18n_uchar* i18n_ustring_mem_move ( i18n_uchar *dest, const i18n_uchar *src, int * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_mem_set ( i18n_uchar *dest, const i18n_uchar c, int32_t count ); +i18n_uchar* i18n_ustring_mem_set(i18n_uchar *dest, const i18n_uchar c, int32_t count); /** * @brief Compare the first count #i18n_uchar characters of each buffer. @@ -748,7 +748,7 @@ i18n_uchar* i18n_ustring_mem_set ( i18n_uchar *dest, const i18n_uchar c, int32_t * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_mem_compare ( const i18n_uchar *buf1, const i18n_uchar *buf2, int32_t count ); +int32_t i18n_ustring_mem_compare(const i18n_uchar *buf1, const i18n_uchar *buf2, int32_t count); /** * @brief Compare two Unicode strings in code point order. @@ -766,7 +766,7 @@ int32_t i18n_ustring_mem_compare ( const i18n_uchar *buf1, const i18n_uchar *buf * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_mem_compare_code_point_order ( const i18n_uchar *s1, const i18n_uchar *s2, int32_t count ); +int32_t i18n_ustring_mem_compare_code_point_order(const i18n_uchar *s1, const i18n_uchar *s2, int32_t count); /** * @brief Finds the first occurrence of a BMP code point in a string. @@ -786,7 +786,7 @@ int32_t i18n_ustring_mem_compare_code_point_order ( const i18n_uchar *s1, const * @see i18n_ustring_mem_char32() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_mem_char ( const i18n_uchar *s, i18n_uchar c, int32_t count ); +i18n_uchar* i18n_ustring_mem_char(const i18n_uchar *s, i18n_uchar c, int32_t count); /** * @brief Finds the first occurrence of a code point in a string. @@ -803,7 +803,7 @@ i18n_uchar* i18n_ustring_mem_char ( const i18n_uchar *s, i18n_uchar c, int32_t c * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_mem_char32 ( const i18n_uchar *s, i18n_uchar32 c, int32_t count ); +i18n_uchar* i18n_ustring_mem_char32(const i18n_uchar *s, i18n_uchar32 c, int32_t count); /** * @brief Finds the last occurrence of a BMP code point in a string. @@ -823,7 +823,7 @@ i18n_uchar* i18n_ustring_mem_char32 ( const i18n_uchar *s, i18n_uchar32 c, int32 * @see #i18n_ustring_mem_r_char32 * @see #i18n_ustring_find_last */ -i18n_uchar* i18n_ustring_mem_r_char ( const i18n_uchar *s, i18n_uchar c, int32_t count ); +i18n_uchar* i18n_ustring_mem_r_char(const i18n_uchar *s, i18n_uchar c, int32_t count); /** * @brief Finds the last occurrence of a code point in a string. @@ -843,7 +843,7 @@ i18n_uchar* i18n_ustring_mem_r_char ( const i18n_uchar *s, i18n_uchar c, int32_t * @see #i18n_ustring_mem_r_char * @see #i18n_ustring_find_last */ -i18n_uchar* i18n_ustring_mem_r_char32 ( const i18n_uchar *s, i18n_uchar32 c, int32_t count ); +i18n_uchar* i18n_ustring_mem_r_char32(const i18n_uchar *s, i18n_uchar32 c, int32_t count); /** * @brief Unescape a string of characters and write the resulting Unicode characters to the destination buffer. @@ -866,7 +866,7 @@ i18n_uchar* i18n_ustring_mem_r_char32 ( const i18n_uchar *s, i18n_uchar32 c, int * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_unescape_at() */ -int32_t i18n_ustring_unescape ( const char *src, i18n_uchar *dest, int32_t dest_capacity ); +int32_t i18n_ustring_unescape(const char *src, i18n_uchar *dest, int32_t dest_capacity); /** * @brief Unescape a single sequence. @@ -890,7 +890,7 @@ int32_t i18n_ustring_unescape ( const char *src, i18n_uchar *dest, int32_t dest_ * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_unescape() */ -i18n_uchar32 i18n_ustring_unescape_at ( i18n_ustring_unescape_char_at_cb char_at, int32_t *offset, int32_t length, void *context ); +i18n_uchar32 i18n_ustring_unescape_at(i18n_ustring_unescape_char_at_cb char_at, int32_t *offset, int32_t length, void *context); /** * @brief Uppercases the characters in a string. @@ -915,7 +915,7 @@ i18n_uchar32 i18n_ustring_unescape_at ( i18n_ustring_unescape_char_at_cb char_at * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_to_upper ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *error_code ); +int32_t i18n_ustring_to_upper(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *error_code); /** * @brief Lowercase the characters in a string. @@ -938,7 +938,7 @@ int32_t i18n_ustring_to_upper ( i18n_uchar *dest, int32_t dest_capacity, const i * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_to_lower ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *error_code ); +int32_t i18n_ustring_to_lower(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *error_code); /** * @brief Titlecases a string. @@ -977,8 +977,8 @@ int32_t i18n_ustring_to_lower ( i18n_uchar *dest, int32_t dest_capacity, const i * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_to_title ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, i18n_ubreak_iterator_s *title_iter, - const char *locale, i18n_error_code_e *error_code ); +int32_t i18n_ustring_to_title(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, i18n_ubreak_iterator_s *title_iter, + const char *locale, i18n_error_code_e *error_code); /** * @brief Titlecases a string. @@ -1018,7 +1018,7 @@ int32_t i18n_ustring_to_title ( i18n_uchar *dest, int32_t dest_capacity, const i * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_to_title() */ -int32_t i18n_ustring_to_title_new ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, i18n_ubreak_iterator_h title_iter, const char *locale); +int32_t i18n_ustring_to_title_new(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, i18n_ubreak_iterator_h title_iter, const char *locale); /** * @brief Case-folds the characters in a string. @@ -1043,7 +1043,7 @@ int32_t i18n_ustring_to_title_new ( i18n_uchar *dest, int32_t dest_capacity, con * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_fold_case ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, uint32_t options, i18n_error_code_e *error_code ); +int32_t i18n_ustring_fold_case(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, uint32_t options, i18n_error_code_e *error_code); /** * @brief Convert a UTF-16 string to a wchar_t string. @@ -1065,7 +1065,7 @@ int32_t i18n_ustring_fold_case ( i18n_uchar *dest, int32_t dest_capacity, const * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -wchar_t* i18n_ustring_to_WCS ( wchar_t *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code ); +wchar_t* i18n_ustring_to_WCS(wchar_t *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a wchar_t string to UTF-16. @@ -1087,7 +1087,7 @@ wchar_t* i18n_ustring_to_WCS ( wchar_t *dest, int32_t dest_capacity, int32_t *de * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_from_WCS ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const wchar_t *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_WCS(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const wchar_t *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Converts a UTF-16 string to UTF-8. @@ -1113,7 +1113,7 @@ i18n_uchar* i18n_ustring_from_WCS ( i18n_uchar *dest, int32_t dest_capacity, int * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_from_UTF8() */ -char* i18n_ustring_to_UTF8 ( char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code ); +char* i18n_ustring_to_UTF8(char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Converts a UTF-8 string to UTF-16. @@ -1138,7 +1138,7 @@ char* i18n_ustring_to_UTF8 ( char *dest, int32_t dest_capacity, int32_t *dest_le * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_from_UTF8 ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF8(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a UTF-16 string to UTF-8. @@ -1169,7 +1169,7 @@ i18n_uchar* i18n_ustring_from_UTF8 ( i18n_uchar *dest, int32_t dest_capacity, in * @see i18n_ustring_to_UTF8() * @see i18n_ustring_from_UTF8_with_sub() */ -char* i18n_ustring_to_UTF8_with_sub ( char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code ); +char* i18n_ustring_to_UTF8_with_sub(char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code); /** * @brief Convert a UTF-8 string to UTF-16. @@ -1200,8 +1200,8 @@ char* i18n_ustring_to_UTF8_with_sub ( char *dest, int32_t dest_capacity, int32_t * @see i18n_ustring_from_UTF8_lenient() * @see i18n_ustring_to_UTF8_with_sub() */ -i18n_uchar* i18n_ustring_from_UTF8_with_sub ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_uchar32 sub_char, - int32_t *num_substitutions, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF8_with_sub(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_uchar32 sub_char, + int32_t *num_substitutions, i18n_error_code_e *error_code); /** * @brief Convert a UTF-8 string to UTF-16. @@ -1239,7 +1239,7 @@ i18n_uchar* i18n_ustring_from_UTF8_with_sub ( i18n_uchar *dest, int32_t dest_cap * @see i18n_ustring_to_UTF8_with_sub() * @see i18n_ustring_from_UTF8_with_sub() */ -i18n_uchar* i18n_ustring_from_UTF8_lenient ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF8_lenient(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a UTF-16 string to UTF-32. @@ -1265,7 +1265,7 @@ i18n_uchar* i18n_ustring_from_UTF8_lenient ( i18n_uchar *dest, int32_t dest_capa * @see i18n_ustring_to_UTF32_with_sub() * @see i18n_ustring_from_UTF32() */ -i18n_uchar32* i18n_ustring_to_UTF32 ( i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar32* i18n_ustring_to_UTF32(i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a UTF-32 string to UTF-16. @@ -1291,7 +1291,7 @@ i18n_uchar32* i18n_ustring_to_UTF32 ( i18n_uchar32 *dest, int32_t dest_capacity, * @see i18n_ustring_from_UTF32_with_sub() * @see i18n_ustring_to_UTF32() */ -i18n_uchar* i18n_ustring_from_UTF32 ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF32(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a UTF-16 string to UTF-32. @@ -1321,8 +1321,8 @@ i18n_uchar* i18n_ustring_from_UTF32 ( i18n_uchar *dest, int32_t dest_capacity, i * @see i18n_ustring_to_UTF32() * @see i18n_ustring_from_UTF32_with_sub() */ -i18n_uchar32* i18n_ustring_to_UTF32_with_sub ( i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, - i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code ); +i18n_uchar32* i18n_ustring_to_UTF32_with_sub(i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, + i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code); /** * @brief Convert a UTF-32 string to UTF-16. @@ -1353,7 +1353,7 @@ i18n_uchar32* i18n_ustring_to_UTF32_with_sub ( i18n_uchar32 *dest, int32_t dest_ * @see i18n_ustring_from_UTF32() * @see i18n_ustring_to_UTF32_with_sub() */ -i18n_uchar* i18n_ustring_from_UTF32_with_sub ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF32_with_sub(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code); #ifdef __cplusplus } diff --git a/src/include/wearable/utils_i18n_private.h b/src/include/wearable/utils_i18n_private.h index b981e4f..70783e9 100755 --- a/src/include/wearable/utils_i18n_private.h +++ b/src/include/wearable/utils_i18n_private.h @@ -73,7 +73,7 @@ extern "C" { } while (0) #define retex_if(expr, val, fmt, arg...) do { \ - if(expr) { \ + if (expr) { \ ERR(fmt, ##arg); \ val; \ goto CATCH; \ @@ -86,8 +86,8 @@ extern "C" { #define ERR_MAPPING(ICU_ERROR, BASE_UTILS_ERROR) BASE_UTILS_ERROR = \ (i18n_error_code_e)_i18n_error_mapping((int)ICU_ERROR) -int _i18n_error_mapping ( int err ); -int _i18n_error_mapping_reverse ( int err ); +int _i18n_error_mapping(int err); +int _i18n_error_mapping_reverse(int err); #ifdef __cplusplus } diff --git a/src/include/wearable/utils_i18n_timezone.h b/src/include/wearable/utils_i18n_timezone.h index b10955a..a537e37 100755 --- a/src/include/wearable/utils_i18n_timezone.h +++ b/src/include/wearable/utils_i18n_timezone.h @@ -72,7 +72,7 @@ extern "C" { * @see i18n_timezone_create() * @see i18n_timezone_create_gmt() */ -int i18n_timezone_create_unknown ( i18n_timezone_h *timezone ); +int i18n_timezone_create_unknown(i18n_timezone_h *timezone); /** * @brief The GMT (=UTC) time zone has a raw offset of zero and does not use daylight savings time. @@ -85,7 +85,7 @@ int i18n_timezone_create_unknown ( i18n_timezone_h *timezone ); * @retval #I18N_ERROR_NONE Successful * @see i18n_timezone_create_unknown() */ -int i18n_timezone_create_gmt ( i18n_timezone_h *timezone ); +int i18n_timezone_create_gmt(i18n_timezone_h *timezone); /** * @brief Creates an i18n_timezone_h for the given timezone_id. @@ -96,7 +96,7 @@ int i18n_timezone_create_gmt ( i18n_timezone_h *timezone ); * * @retval #I18N_ERROR_NONE Successful */ -int i18n_timezone_create ( i18n_timezone_h *timezone, const char *timezone_id ); +int i18n_timezone_create(i18n_timezone_h *timezone, const char *timezone_id); /** * @brief Destroys an i18n_timezone_h. @@ -214,7 +214,7 @@ int i18n_timezone_get_equivalent_id(const char *timezone_id, int32_t index, char * * @retval #I18N_ERROR_NONE Successful */ -int i18n_timezone_create_default ( i18n_timezone_h *timezone ); +int i18n_timezone_create_default(i18n_timezone_h *timezone); /** * @brief Sets the default time zone (i.e., what's returned by #i18n_timezone_create_default()) to be the specified time zone. @@ -230,7 +230,7 @@ int i18n_timezone_create_default ( i18n_timezone_h *timezone ); * * @retval #I18N_ERROR_NONE Successful */ -int i18n_timezone_set_default( i18n_timezone_h timezone ); +int i18n_timezone_set_default(i18n_timezone_h timezone); /** * @brief Returns the timezone data version currently used by I18N. diff --git a/src/include/wearable/utils_i18n_types.h b/src/include/wearable/utils_i18n_types.h index a96cbed..7fa2b7a 100644 --- a/src/include/wearable/utils_i18n_types.h +++ b/src/include/wearable/utils_i18n_types.h @@ -169,20 +169,20 @@ typedef enum { #if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32) # ifdef __STDC_ISO_10646__ -# if (U_SIZEOF_WCHAR_T==2) +# if (U_SIZEOF_WCHAR_T == 2) # define U_WCHAR_IS_UTF16 -# elif (U_SIZEOF_WCHAR_T==4) +# elif (U_SIZEOF_WCHAR_T == 4) # define U_WCHAR_IS_UTF32 # endif # elif defined __UCS2__ -# if (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400) && (U_SIZEOF_WCHAR_T==2) +# if (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400) && (U_SIZEOF_WCHAR_T == 2) # define U_WCHAR_IS_UTF16 # endif # elif defined(__UCS4__) || (U_PLATFORM == U_PF_OS400 && defined(__UTF32__)) -# if (U_SIZEOF_WCHAR_T==4) +# if (U_SIZEOF_WCHAR_T == 4) # define U_WCHAR_IS_UTF32 # endif -# elif U_PLATFORM_IS_DARWIN_BASED || (U_SIZEOF_WCHAR_T==4 && U_PLATFORM_IS_LINUX_BASED) +# elif U_PLATFORM_IS_DARWIN_BASED || (U_SIZEOF_WCHAR_T == 4 && U_PLATFORM_IS_LINUX_BASED) # define U_WCHAR_IS_UTF32 # elif U_PLATFORM_HAS_WIN32_API # define U_WCHAR_IS_UTF16 @@ -198,7 +198,7 @@ typedef enum { typedef UCHAR_TYPE i18n_uchar; /* Not #elif U_HAVE_CHAR16_T -- because that is type-incompatible with pre-C++11 callers typedef char16_t i18n_uchar; */ -#elif U_SIZEOF_WCHAR_T==2 +#elif U_SIZEOF_WCHAR_T == 2 typedef wchar_t i18n_uchar; #elif defined(__CHAR16_TYPE__) typedef __CHAR16_TYPE__ i18n_uchar; @@ -1592,7 +1592,7 @@ typedef struct { * @brief Handle to struct representing a range of text containing a specific field. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ -typedef i18n_ufield_position_s* i18n_ufield_position_h; +typedef i18n_ufield_position_s *i18n_ufield_position_h; /** * @brief Enumeration for the possible date/time format styles. @@ -1690,7 +1690,7 @@ typedef enum { * @since_tizen 2.3.1 */ -typedef enum{ +typedef enum { I18N_UDISPCTX_TYPE_DIALECT_HANDLING, /**beyond the last character in the text being scanned. @@ -202,7 +202,7 @@ int32_t i18n_ubrk_first (i18n_ubreak_iterator_h break_iter); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_first() */ -int32_t i18n_ubrk_last (i18n_ubreak_iterator_h break_iter); +int32_t i18n_ubrk_last(i18n_ubreak_iterator_h break_iter); /** * @brief Sets the iterator position to the first boundary preceding the specified @c offset. @@ -217,7 +217,7 @@ int32_t i18n_ubrk_last (i18n_ubreak_iterator_h break_iter); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_following() */ -int32_t i18n_ubrk_preceding (i18n_ubreak_iterator_h break_iter, int32_t offset); +int32_t i18n_ubrk_preceding(i18n_ubreak_iterator_h break_iter, int32_t offset); /** * @brief Advances the iterator to the first boundary following the specified @c offset. @@ -232,7 +232,7 @@ int32_t i18n_ubrk_preceding (i18n_ubreak_iterator_h break_iter, int32_t offset); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_preceding() */ -int32_t i18n_ubrk_following (i18n_ubreak_iterator_h break_iter, int32_t offset); +int32_t i18n_ubrk_following(i18n_ubreak_iterator_h break_iter, int32_t offset); /** * @brief Gets a locale for which text breaking information is available. @@ -247,7 +247,7 @@ int32_t i18n_ubrk_following (i18n_ubreak_iterator_h break_iter, int32_t offset); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ubrk_count_available() */ -const char *i18n_ubrk_get_available (int32_t index); +const char *i18n_ubrk_get_available(int32_t index); /** * @brief Determines how many locales have text breaking information available. @@ -260,7 +260,7 @@ const char *i18n_ubrk_get_available (int32_t index); * @exception #I18N_ERROR_NONE Successful * @see i18n_ubrk_get_available() */ -int32_t i18n_ubrk_count_available (void); +int32_t i18n_ubrk_count_available(void); /** * @brief Returns true if the specfied position is a boundary position. @@ -275,7 +275,7 @@ int32_t i18n_ubrk_count_available (void); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_ubrk_is_boundary (i18n_ubreak_iterator_h break_iter, int32_t offset); +i18n_ubool i18n_ubrk_is_boundary(i18n_ubreak_iterator_h break_iter, int32_t offset); /** * @brief Returns the status from the break rule that determined the most recently @@ -293,7 +293,7 @@ i18n_ubool i18n_ubrk_is_boundary (i18n_ubreak_iterator_h break_iter, int32_t off * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ubrk_get_rule_status (i18n_ubreak_iterator_h break_iter); +int32_t i18n_ubrk_get_rule_status(i18n_ubreak_iterator_h break_iter); /** * @brief Gets the statuses from the break rules that determined the most recently @@ -316,7 +316,7 @@ int32_t i18n_ubrk_get_rule_status (i18n_ubreak_iterator_h break_iter); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ubrk_get_rule_status_vec (i18n_ubreak_iterator_h break_iter, int32_t *fill_in_vec, int32_t capacity); +int32_t i18n_ubrk_get_rule_status_vec(i18n_ubreak_iterator_h break_iter, int32_t *fill_in_vec, int32_t capacity); /** * @brief Returns the locale of the break iterator. You can choose between the valid and @@ -331,7 +331,7 @@ int32_t i18n_ubrk_get_rule_status_vec (i18n_ubreak_iterator_h break_iter, int32_ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char *i18n_ubrk_get_locale_by_type (const i18n_ubreak_iterator_h break_iter, i18n_ulocale_data_locale_type_e type); +const char *i18n_ubrk_get_locale_by_type(const i18n_ubreak_iterator_h break_iter, i18n_ulocale_data_locale_type_e type); #ifdef __cplusplus } diff --git a/src/include/wearable/utils_i18n_ucalendar.h b/src/include/wearable/utils_i18n_ucalendar.h index 7de77be..a725a56 100644 --- a/src/include/wearable/utils_i18n_ucalendar.h +++ b/src/include/wearable/utils_i18n_ucalendar.h @@ -129,7 +129,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_set_default_timezone ( const i18n_uchar *zone_id ); +int i18n_ucalendar_set_default_timezone(const i18n_uchar *zone_id); /** * @brief Gets the current date and time. @@ -141,7 +141,7 @@ int i18n_ucalendar_set_default_timezone ( const i18n_uchar *zone_id ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_now ( i18n_udate *date ); +int i18n_ucalendar_get_now(i18n_udate *date); /** * @brief Creates an #i18n_ucalendar_h. @@ -171,7 +171,7 @@ int i18n_ucalendar_get_now ( i18n_udate *date ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory */ -int i18n_ucalendar_create ( const i18n_uchar *zone_id, int32_t len, const char *locale, i18n_ucalendar_type_e type, i18n_ucalendar_h *calendar ); +int i18n_ucalendar_create(const i18n_uchar *zone_id, int32_t len, const char *locale, i18n_ucalendar_type_e type, i18n_ucalendar_h *calendar); /** * @brief Destroys an #i18n_ucalendar_h. @@ -182,7 +182,7 @@ int i18n_ucalendar_create ( const i18n_uchar *zone_id, int32_t len, const char * * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_destroy ( i18n_ucalendar_h calendar ); +int i18n_ucalendar_destroy(i18n_ucalendar_h calendar); /** * @brief Creates a copy of a #i18n_ucalendar_h. @@ -194,7 +194,7 @@ int i18n_ucalendar_destroy ( i18n_ucalendar_h calendar ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_clone ( const i18n_ucalendar_h cal, i18n_ucalendar_h *identical_to_cal ); +int i18n_ucalendar_clone(const i18n_ucalendar_h cal, i18n_ucalendar_h *identical_to_cal); /** * @brief Gets the display name for a calendar's TimeZone. @@ -213,7 +213,7 @@ int i18n_ucalendar_clone ( const i18n_ucalendar_h cal, i18n_ucalendar_h *identic * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_timezone_displayname ( const i18n_ucalendar_h calendar, i18n_ucalendar_displayname_type_e type, const char *locale, i18n_uchar *result, int32_t result_len, int32_t *buf_size_needed ); +int i18n_ucalendar_get_timezone_displayname(const i18n_ucalendar_h calendar, i18n_ucalendar_displayname_type_e type, const char *locale, i18n_uchar *result, int32_t result_len, int32_t *buf_size_needed); /** * @brief Determines if an #i18n_ucalendar_h is currently in daylight savings time. @@ -227,7 +227,7 @@ int i18n_ucalendar_get_timezone_displayname ( const i18n_ucalendar_h calendar, i * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_is_in_daylight_time ( const i18n_ucalendar_h calendar, i18n_ubool *is_in ); +int i18n_ucalendar_is_in_daylight_time(const i18n_ucalendar_h calendar, i18n_ubool *is_in); /** * @brief Sets the value of a field in a #i18n_ucalendar_h. @@ -246,7 +246,7 @@ int i18n_ucalendar_is_in_daylight_time ( const i18n_ucalendar_h calendar, i18n_u * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_set ( i18n_ucalendar_h cal, i18n_ucalendar_date_fields_e field, int32_t val ); +int i18n_ucalendar_set(i18n_ucalendar_h cal, i18n_ucalendar_date_fields_e field, int32_t val); /** * @brief Sets a numeric attribute associated with an #i18n_ucalendar_h. @@ -263,7 +263,7 @@ int i18n_ucalendar_set ( i18n_ucalendar_h cal, i18n_ucalendar_date_fields_e fiel * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_set_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t val ); +int i18n_ucalendar_set_attribute(i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t val); /** * @brief Gets a numeric attribute associated with an i18n_ucalendar. @@ -281,7 +281,7 @@ int i18n_ucalendar_set_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_att * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t *val); +int i18n_ucalendar_get_attribute(i18n_ucalendar_h calendar, i18n_ucalendar_attribute_e attr, int32_t *val); /** * @brief Gets a calendar's current time in milliseconds. @@ -296,7 +296,7 @@ int i18n_ucalendar_get_attribute ( i18n_ucalendar_h calendar, i18n_ucalendar_att * @see i18n_ucalendar_set_milliseconds() * @see i18n_ucalendar_set_date_time() */ -int i18n_ucalendar_get_milliseconds( const i18n_ucalendar_h calendar, i18n_udate *date ); +int i18n_ucalendar_get_milliseconds(const i18n_ucalendar_h calendar, i18n_udate *date); /** * @brief Sets a calendar's current time in milliseconds. @@ -311,7 +311,7 @@ int i18n_ucalendar_get_milliseconds( const i18n_ucalendar_h calendar, i18n_udate * @see i18n_ucalendar_get_milliseconds() * @see i18n_ucalendar_set_date_time() */ -int i18n_ucalendar_set_milliseconds ( i18n_ucalendar_h calendar, i18n_udate milliseconds ); +int i18n_ucalendar_set_milliseconds(i18n_ucalendar_h calendar, i18n_udate milliseconds); /** * @brief Sets a calendar's current date. @@ -333,7 +333,7 @@ int i18n_ucalendar_set_milliseconds ( i18n_ucalendar_h calendar, i18n_udate mill * @see i18n_ucalendar_get_milliseconds() * @see i18n_ucalendar_set_milliseconds() */ -int i18n_ucalendar_set_date_time ( i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date, int32_t hour, int32_t min, int32_t sec ); +int i18n_ucalendar_set_date_time(i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date, int32_t hour, int32_t min, int32_t sec); /** * @brief Returns @c true if two #i18n_ucalendar_h calendars are equivalent. @@ -348,7 +348,7 @@ int i18n_ucalendar_set_date_time ( i18n_ucalendar_h calendar, int32_t year, int3 * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_is_equivalent_to ( const i18n_ucalendar_h calendar1, const i18n_ucalendar_h calendar2, i18n_ubool *equiv ); +int i18n_ucalendar_is_equivalent_to(const i18n_ucalendar_h calendar1, const i18n_ucalendar_h calendar2, i18n_ubool *equiv); /** * @brief Adds a specified signed amount to a particular field in a #i18n_ucalendar_h. @@ -368,7 +368,7 @@ int i18n_ucalendar_is_equivalent_to ( const i18n_ucalendar_h calendar1, const i1 * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_add ( i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount ); +int i18n_ucalendar_add(i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount); /** * @brief Gets the current value of a field from an #i18n_ucalendar_h. @@ -385,7 +385,7 @@ int i18n_ucalendar_add ( i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get ( const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t *val ); +int i18n_ucalendar_get(const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t *val); // Newly Added APIs @@ -418,7 +418,7 @@ int i18n_ucalendar_get ( const i18n_ucalendar_h calendar, i18n_ucalendar_date_fi * * @return The date difference for the specified field. */ -int32_t i18n_ucalendar_get_field_difference ( i18n_ucalendar_h calendar, i18n_udate target, i18n_ucalendar_date_fields_e field, i18n_error_code_e *status ); +int32_t i18n_ucalendar_get_field_difference(i18n_ucalendar_h calendar, i18n_udate target, i18n_ucalendar_date_fields_e field, i18n_error_code_e *status); /** * @brief Creates an enumeration over system time zone IDs with the given filter conditions. @@ -437,7 +437,7 @@ int32_t i18n_ucalendar_get_field_difference ( i18n_ucalendar_h calendar, i18n_ud * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_timezone_id_enumeration_create ( i18n_system_timezone_type_e zone_type, const char *region, const int32_t *raw_offset, i18n_uenumeration_h *enumeration); +int i18n_ucalendar_timezone_id_enumeration_create(i18n_system_timezone_type_e zone_type, const char *region, const int32_t *raw_offset, i18n_uenumeration_h *enumeration); /** * @brief Creates an enumeration over all time zones. @@ -450,7 +450,7 @@ int i18n_ucalendar_timezone_id_enumeration_create ( i18n_system_timezone_type_e * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_timezones_create (i18n_uenumeration_h * enumeration); +int i18n_ucalendar_timezones_create(i18n_uenumeration_h * enumeration); /** * @brief Creates an enumeration over all time zones associated with the given country. @@ -466,7 +466,7 @@ int i18n_ucalendar_timezones_create (i18n_uenumeration_h * enumeration); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_country_timezones_create (const char *country, i18n_uenumeration_h * enumeration); +int i18n_ucalendar_country_timezones_create(const char *country, i18n_uenumeration_h * enumeration); /** * @brief Returns the default time zone. @@ -484,7 +484,7 @@ int i18n_ucalendar_country_timezones_create (const char *country, i18n_uenumerat * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid parameter */ -int32_t i18n_ucalendar_get_default_timezone (i18n_uchar *result, int32_t result_capacity); +int32_t i18n_ucalendar_get_default_timezone(i18n_uchar *result, int32_t result_capacity); /** * @brief Sets the TimeZone used by a #i18n_ucalendar_h. @@ -499,7 +499,7 @@ int32_t i18n_ucalendar_get_default_timezone (i18n_uchar *result, int32_t result_ * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_set_timezone ( i18n_ucalendar_h calendar, const i18n_uchar *zone_id, int32_t length ); +int i18n_ucalendar_set_timezone(i18n_ucalendar_h calendar, const i18n_uchar *zone_id, int32_t length); /** * @brief Gets the ID of the calendar's time zone. @@ -516,7 +516,7 @@ int i18n_ucalendar_set_timezone ( i18n_ucalendar_h calendar, const i18n_uchar *z * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ucalendar_get_timezone_id (const i18n_ucalendar_h calendar, i18n_uchar *result, int32_t result_length); +int32_t i18n_ucalendar_get_timezone_id(const i18n_ucalendar_h calendar, i18n_uchar *result, int32_t result_length); /** * @brief Sets the Gregorian Calendar change date. @@ -537,7 +537,7 @@ int32_t i18n_ucalendar_get_timezone_id (const i18n_ucalendar_h calendar, i18n_uc * * @see i18n_ucalendar_get_gregorian_change() */ -int i18n_ucalendar_set_gregorian_change ( i18n_ucalendar_h calendar, i18n_udate date); +int i18n_ucalendar_set_gregorian_change(i18n_ucalendar_h calendar, i18n_udate date); /** * @brief Gets the Gregorian Calendar change date. @@ -558,7 +558,7 @@ int i18n_ucalendar_set_gregorian_change ( i18n_ucalendar_h calendar, i18n_udate * * @see i18n_ucalendar_set_gregorian_change() */ -int i18n_ucalendar_get_gregorian_change (const i18n_ucalendar_h calendar, i18n_udate *date); +int i18n_ucalendar_get_gregorian_change(const i18n_ucalendar_h calendar, i18n_udate *date); /** * @brief Gets a locale for which calendars are available. @@ -575,7 +575,7 @@ int i18n_ucalendar_get_gregorian_change (const i18n_ucalendar_h calendar, i18n_u * @exception #I18N_ERROR_INVALID_PARAMETER Invalid parameter * @see i18n_ucalendar_count_available() */ -const char * i18n_ucalendar_get_available (int32_t locale_index); +const char * i18n_ucalendar_get_available(int32_t locale_index); /** * @brief Determines how many locales have calendars available. @@ -588,7 +588,7 @@ const char * i18n_ucalendar_get_available (int32_t locale_index); * @exception #I18N_ERROR_NONE Successful * @see i18n_ucalendar_get_available() */ -int32_t i18n_ucalendar_count_available (void); +int32_t i18n_ucalendar_count_available(void); /** * @brief Sets a calendar's current date. @@ -611,7 +611,7 @@ int32_t i18n_ucalendar_count_available (void); * @see i18n_ucalendar_set_milliseconds() * @see i18n_ucalendar_set_date_time() */ -int i18n_ucalendar_set_date (i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date); +int i18n_ucalendar_set_date(i18n_ucalendar_h calendar, int32_t year, int32_t month, int32_t date); /** * @brief Adds a specified signed amount to a particular field in a #i18n_ucalendar_h. @@ -646,7 +646,7 @@ int i18n_ucalendar_set_date (i18n_ucalendar_h calendar, int32_t year, int32_t mo * @remarks #I18N_UCALENDAR_ZONE_OFFSET and #I18N_UCALENDAR_DST_OFFSET are not supported by this function. * @see i18n_ucalendar_add() */ -int i18n_ucalendar_roll (i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount); +int i18n_ucalendar_roll(i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, int32_t amount); /** * @brief Determines if a field in a #i18n_ucalendar_h is set. @@ -667,7 +667,7 @@ int i18n_ucalendar_roll (i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e * @see i18n_ucalendar_clear() * */ -i18n_ubool i18n_ucalendar_is_set (const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field); +i18n_ubool i18n_ucalendar_is_set(const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field); /** * @brief Clears a field in a #i18n_ucalendar_h. @@ -687,7 +687,7 @@ i18n_ubool i18n_ucalendar_is_set (const i18n_ucalendar_h calendar, i18n_ucalenda * @see i18n_ucalendar_clear() * */ -int i18n_ucalendar_clear_field (i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field); +int i18n_ucalendar_clear_field(i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field); /** * @brief Clears all fields in a #i18n_ucalendar_h. @@ -704,7 +704,7 @@ int i18n_ucalendar_clear_field (i18n_ucalendar_h calendar, i18n_ucalendar_date_f * @see i18n_ucalendar_clear_field() * */ -int i18n_ucalendar_clear (i18n_ucalendar_h calendar); +int i18n_ucalendar_clear(i18n_ucalendar_h calendar); /** * @brief Determines a limit for a field in an #i18n_ucalendar_h. @@ -731,7 +731,7 @@ int i18n_ucalendar_clear (i18n_ucalendar_h calendar); * * @return The requested value. */ -int32_t i18n_ucalendar_get_limit (const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, i18n_ucalendar_limit_type_e type); +int32_t i18n_ucalendar_get_limit(const i18n_ucalendar_h calendar, i18n_ucalendar_date_fields_e field, i18n_ucalendar_limit_type_e type); /** * @brief Gets the locale for this @c calendar object. @@ -748,7 +748,7 @@ int32_t i18n_ucalendar_get_limit (const i18n_ucalendar_h calendar, i18n_ucalenda * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char *i18n_ucalendar_get_locale_by_type (const i18n_ucalendar_h calendar, i18n_ulocale_data_locale_type_e type); +const char *i18n_ucalendar_get_locale_by_type(const i18n_ucalendar_h calendar, i18n_ulocale_data_locale_type_e type); /** * @brief Returns the timezone data version currently used by ICU. @@ -759,7 +759,7 @@ const char *i18n_ucalendar_get_locale_by_type (const i18n_ucalendar_h calendar, * @return The version string, such as "2007f". * @exception #I18N_ERROR_NONE Successful */ -const char *i18n_ucalendar_get_tz_data_version (void); +const char *i18n_ucalendar_get_tz_data_version(void); /** * @brief Returns the canonical system timezone ID or the normalized custom time zone ID for the given time zone ID. @@ -778,7 +778,7 @@ const char *i18n_ucalendar_get_tz_data_version (void); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ucalendar_get_canonical_timezone_id (const i18n_uchar *id, int32_t length, i18n_uchar *result, int32_t result_capacity, i18n_ubool *is_system_id); +int32_t i18n_ucalendar_get_canonical_timezone_id(const i18n_uchar *id, int32_t length, i18n_uchar *result, int32_t result_capacity, i18n_ubool *is_system_id); /** * @brief Gets the resource keyword value string designating the calendar type for the #i18n_ucalendar_h. @@ -793,7 +793,7 @@ int32_t i18n_ucalendar_get_canonical_timezone_id (const i18n_uchar *id, int32_t * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char *i18n_ucalendar_get_type (const i18n_ucalendar_h calendar); +const char *i18n_ucalendar_get_type(const i18n_ucalendar_h calendar); /** * @brief Given a key and a locale, returns an array of string values in a preferred order that would make a difference. @@ -814,7 +814,7 @@ const char *i18n_ucalendar_get_type (const i18n_ucalendar_h calendar); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_keyword_values_for_locale (const char *key, const char *locale, i18n_ubool commonly_used, i18n_uenumeration_h *enumeration); +int i18n_ucalendar_get_keyword_values_for_locale(const char *key, const char *locale, i18n_ubool commonly_used, i18n_uenumeration_h *enumeration); /** * @brief Returns whether the given day of the week is a weekday, a weekend day, @@ -837,7 +837,7 @@ int i18n_ucalendar_get_keyword_values_for_locale (const char *key, const char *l * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucalendar_get_day_of_week_type (const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week, i18n_ucalendar_weekday_type_e *weekday); +int i18n_ucalendar_get_day_of_week_type(const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week, i18n_ucalendar_weekday_type_e *weekday); /** * @brief Returns the time during the day at which the weekend begins or ends in this calendar system. @@ -859,7 +859,7 @@ int i18n_ucalendar_get_day_of_week_type (const i18n_ucalendar_h calendar, i18n_u * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ucalendar_get_weekend_transition (const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week); +int32_t i18n_ucalendar_get_weekend_transition(const i18n_ucalendar_h calendar, i18n_ucalendar_days_of_week_e day_of_week); /** * @brief Returns @c true if the given #i18n_udate is in the weekend in this calendar system. @@ -875,7 +875,7 @@ int32_t i18n_ucalendar_get_weekend_transition (const i18n_ucalendar_h calendar, * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_ucalendar_is_weekend (i18n_ucalendar_h calendar, i18n_udate date); +i18n_ubool i18n_ucalendar_is_weekend(i18n_ucalendar_h calendar, i18n_udate date); /** * @brief Get the #i18n_udate for the next/previous time zone transition relative @@ -896,7 +896,7 @@ i18n_ubool i18n_ucalendar_is_weekend (i18n_ucalendar_h calendar, i18n_udate date * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_ucalendar_get_timezone_transition_date (const i18n_ucalendar_h calendar, i18n_utimezone_transition_type_e type, i18n_udate *transition); +i18n_ubool i18n_ucalendar_get_timezone_transition_date(const i18n_ucalendar_h calendar, i18n_utimezone_transition_type_e type, i18n_udate *transition); /** * @} diff --git a/src/include/wearable/utils_i18n_uchar.h b/src/include/wearable/utils_i18n_uchar.h index 4194c05..4dc6e1e 100644 --- a/src/include/wearable/utils_i18n_uchar.h +++ b/src/include/wearable/utils_i18n_uchar.h @@ -149,7 +149,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uchar_get_int_property_value ( i18n_uchar32 c, i18n_uchar_uproperty_e which, int32_t *property_val ); +int i18n_uchar_get_int_property_value(i18n_uchar32 c, i18n_uchar_uproperty_e which, int32_t *property_val); /** * @brief Gets the Unicode allocation block that contains the character. @@ -161,7 +161,7 @@ int i18n_uchar_get_int_property_value ( i18n_uchar32 c, i18n_uchar_uproperty_e w * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uchar_get_ublock_code ( i18n_uchar32 c, i18n_uchar_ublock_code_e *block_val ); +int i18n_uchar_get_ublock_code(i18n_uchar32 c, i18n_uchar_ublock_code_e *block_val); #ifdef __cplusplus } diff --git a/src/include/wearable/utils_i18n_ucollator.h b/src/include/wearable/utils_i18n_ucollator.h index 4a40674..d492ffd 100755 --- a/src/include/wearable/utils_i18n_ucollator.h +++ b/src/include/wearable/utils_i18n_ucollator.h @@ -83,25 +83,25 @@ extern "C" { int ret = I18N_ERROR_NONE; int buf_01_len = 0, buf_02_len = 0; - for ( i = 0; i < sizeof( src ) / sizeof( src[0] ); i++ ) { - dlog_print(DLOG_INFO, LOG_TAG, "%s\n", src[i] ); + for (i = 0; i < sizeof(src) / sizeof(src[0]); i++) { + dlog_print(DLOG_INFO, LOG_TAG, "%s\n", src[i]); } // cat banana airplane // creates a collator ret = i18n_ucollator_create( "en_US", &coll ); // compares and sorts in ascending order - if ( ret == I18N_ERROR_NONE ) { - i18n_ucollator_set_strength( coll, I18N_UCOLLATOR_TERTIARY ); - for ( i = 0; i < 2; i++ ) { - for ( j = 0; j < 2 - i; j++ ) { - i18n_ustring_copy_ua( buf_01, src[j] ); - i18n_ustring_copy_ua( buf_02, src[j+1] ); - i18n_ustring_get_length( buf_01, &buf_01_len ); - i18n_ustring_get_length( buf_02, &buf_02_len ); + if (ret == I18N_ERROR_NONE) { + i18n_ucollator_set_strength(coll, I18N_UCOLLATOR_TERTIARY); + for (i = 0; i < 2; i++) { + for (j = 0; j < 2 - i; j++) { + i18n_ustring_copy_ua(buf_01, src[j]); + i18n_ustring_copy_ua(buf_02, src[j+1]); + i18n_ustring_get_length(buf_01, &buf_01_len); + i18n_ustring_get_length(buf_02, &buf_02_len); // compares buf_01 with buf_02 - i18n_ucollator_str_collator( coll, buf_01, buf_01_len, buf_02, buf_02_len, &result ); - if ( result == I18N_UCOLLATOR_GREATER ) { + i18n_ucollator_str_collator(coll, buf_01, buf_01_len, buf_02, buf_02_len, &result); + if (result == I18N_UCOLLATOR_GREATER) { tmp = src[j]; src[j] = src[j+1]; src[j+1] = tmp; @@ -112,8 +112,8 @@ extern "C" { // destroys the collator i18n_ucollator_destroy( coll ); // deallocate memory for collator - for ( i = 0; i < sizeof( src ) / sizeof( src[0] ); i++ ) { - dlog_print(DLOG_INFO, LOG_TAG, "%s\n", src[i] ); + for (i = 0; i < sizeof(src) / sizeof(src[0]); i++) { + dlog_print(DLOG_INFO, LOG_TAG, "%s\n", src[i]); } // ariplane banana cat * @endcode */ @@ -146,7 +146,7 @@ extern "C" { * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ucollator_destroy() */ -int i18n_ucollator_create ( const char *locale, i18n_ucollator_h *collator ); +int i18n_ucollator_create(const char *locale, i18n_ucollator_h *collator); /** * @brief Closes a i18n_ucollator_h. @@ -159,7 +159,7 @@ int i18n_ucollator_create ( const char *locale, i18n_ucollator_h *collator ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ucollator_create() */ -int i18n_ucollator_destroy ( i18n_ucollator_h collator ); +int i18n_ucollator_destroy(i18n_ucollator_h collator); /** * @brief Compares two strings. @@ -178,7 +178,7 @@ int i18n_ucollator_destroy ( i18n_ucollator_h collator ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ucollator_equal() */ -int i18n_ucollator_str_collator ( const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ucollator_result_e *result ); +int i18n_ucollator_str_collator(const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ucollator_result_e *result); /** * @brief Compares two strings for equality. @@ -196,7 +196,7 @@ int i18n_ucollator_str_collator ( const i18n_ucollator_h collator, const i18n_uc * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ucollator_str_collator() */ -int i18n_ucollator_equal ( const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ubool *equal ); +int i18n_ucollator_equal(const i18n_ucollator_h collator, const i18n_uchar *src, int32_t src_len, const i18n_uchar *target, int32_t target_len, i18n_ubool *equal); /** * @brief Sets the collation strength used in a collator. @@ -210,7 +210,7 @@ int i18n_ucollator_equal ( const i18n_ucollator_h collator, const i18n_uchar *sr * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucollator_set_strength ( i18n_ucollator_h collator, i18n_ucollator_strength_e strength ); +int i18n_ucollator_set_strength(i18n_ucollator_h collator, i18n_ucollator_strength_e strength); /** * @brief Sets a universal attribute setter. @@ -223,7 +223,7 @@ int i18n_ucollator_set_strength ( i18n_ucollator_h collator, i18n_ucollator_stre * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ucollator_set_attribute ( i18n_ucollator_h collator, i18n_ucollator_attribute_e attr, i18n_ucollator_attribute_value_e val ); +int i18n_ucollator_set_attribute(i18n_ucollator_h collator, i18n_ucollator_attribute_e attr, i18n_ucollator_attribute_value_e val); #ifdef __cplusplus } diff --git a/src/include/wearable/utils_i18n_udate.h b/src/include/wearable/utils_i18n_udate.h index d6504bb..440dfe6 100644 --- a/src/include/wearable/utils_i18n_udate.h +++ b/src/include/wearable/utils_i18n_udate.h @@ -107,21 +107,21 @@ // creates new i18n_udate_format_h to format dates and times ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_KR, -1, bestPattern, -1, &formatter_KR); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_KR) { dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n"); } ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_LA, -1, bestPattern, -1, &formatter_LA); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_LA) { dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n"); } ret = i18n_udate_create(I18N_UDATE_PATTERN , I18N_UDATE_PATTERN , locale, utf16_timezone_SaoPaulo, -1, bestPattern, -1, &formatter_SaoPaulo); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_LA) { @@ -195,7 +195,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_create ( i18n_udate_format_style_e time_style, i18n_udate_format_style_e date_style, const char *locale, const i18n_uchar *tz_id, int32_t tz_id_len, const i18n_uchar *pattern, int pattern_len, i18n_udate_format_h *format ); +int i18n_udate_create(i18n_udate_format_style_e time_style, i18n_udate_format_style_e date_style, const char *locale, const i18n_uchar *tz_id, int32_t tz_id_len, const i18n_uchar *pattern, int pattern_len, i18n_udate_format_h *format); /** * @brief Destroys an #i18n_udate_format_h. @@ -207,7 +207,7 @@ int i18n_udate_create ( i18n_udate_format_style_e time_style, i18n_udate_format_ * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_destroy ( i18n_udate_format_h format ); +int i18n_udate_destroy(i18n_udate_format_h format); /** * @brief Formats a date using an #i18n_udate_format_h. @@ -231,7 +231,7 @@ int i18n_udate_destroy ( i18n_udate_format_h format ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_format_date ( const i18n_udate_format_h format, i18n_udate date_to_format, i18n_uchar *result, int32_t result_len, i18n_ufield_position_h pos, int32_t *buf_size_needed ); +int i18n_udate_format_date(const i18n_udate_format_h format, i18n_udate date_to_format, i18n_uchar *result, int32_t result_len, i18n_ufield_position_h pos, int32_t *buf_size_needed); // Newly Added APIs @@ -250,7 +250,7 @@ int i18n_udate_format_date ( const i18n_udate_format_h format, i18n_udate date_t * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_to_calendar_date_field ( i18n_udate_format_field_e field, i18n_ucalendar_date_fields_e *date_field_type ); +int i18n_udate_to_calendar_date_field(i18n_udate_format_field_e field, i18n_ucalendar_date_fields_e *date_field_type); /** * @brief Creates a copy of an #i18n_udate_format_h. @@ -264,7 +264,7 @@ int i18n_udate_to_calendar_date_field ( i18n_udate_format_field_e field, i18n_uc * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_clone ( const i18n_udate_format_h format, i18n_udate_format_h *format_clone ); +int i18n_udate_clone(const i18n_udate_format_h format, i18n_udate_format_h *format_clone); /** * @brief Parses a string into an date/time using an #i18n_udate_format_h. @@ -290,7 +290,7 @@ int i18n_udate_clone ( const i18n_udate_format_h format, i18n_udate_format_h *fo * * @see i18n_udate_format_date() */ -int i18n_udate_parse ( const i18n_udate_format_h format, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_udate *parsed_date ); +int i18n_udate_parse(const i18n_udate_format_h format, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_udate *parsed_date); /** * @brief Parses a string into an date/time using an #i18n_udate_format_h. @@ -314,8 +314,8 @@ int i18n_udate_parse ( const i18n_udate_format_h format, const i18n_uchar *text, * * @see i18n_udate_format_date() */ -int i18n_udate_parse_calendar (const i18n_udate_format_h format, i18n_ucalendar_h *calendar, const i18n_uchar *text, - int32_t text_length, int32_t *parse_pos ); +int i18n_udate_parse_calendar(const i18n_udate_format_h format, i18n_ucalendar_h *calendar, const i18n_uchar *text, + int32_t text_length, int32_t *parse_pos); /** * @brief Determines if an #i18n_udate_format_h will perform lenient parsing. @@ -333,7 +333,7 @@ int i18n_udate_parse_calendar (const i18n_udate_format_h format, i18n_ucalendar_ * * @see i18n_udate_set_lenient() */ -i18n_ubool i18n_udate_is_lenient ( const i18n_udate_format_h format ); +i18n_ubool i18n_udate_is_lenient(const i18n_udate_format_h format); /** * @brief Specifies whether an #i18n_udate_format_h will perform lenient parsing. @@ -350,7 +350,7 @@ i18n_ubool i18n_udate_is_lenient ( const i18n_udate_format_h format ); * * @see i18n_udate_is_lenient() */ -int i18n_udate_set_lenient ( i18n_udate_format_h format, i18n_ubool is_lenient ); +int i18n_udate_set_lenient(i18n_udate_format_h format, i18n_ubool is_lenient); /** * @brief Gets the #i18n_ucalendar_h associated with an #i18n_udate_format_h. @@ -366,7 +366,7 @@ int i18n_udate_set_lenient ( i18n_udate_format_h format, i18n_ubool is_lenient ) * * @see i18n_udate_set_calendar() */ -int i18n_udate_get_calendar ( const i18n_udate_format_h format, i18n_ucalendar_h *calendar); +int i18n_udate_get_calendar(const i18n_udate_format_h format, i18n_ucalendar_h *calendar); /** * @brief Sets the #i18n_ucalendar_h associated with an #i18n_udate_format_h. @@ -382,7 +382,7 @@ int i18n_udate_get_calendar ( const i18n_udate_format_h format, i18n_ucalendar_h * * @see i18n_udate_get_calendar() */ -int i18n_udate_set_calendar ( i18n_udate_format_h format, const i18n_ucalendar_h calendar_to_set ); +int i18n_udate_set_calendar(i18n_udate_format_h format, const i18n_ucalendar_h calendar_to_set); /** * @brief Gets the #i18n_unumber_format_h associated with an #i18n_udate_format_h. @@ -398,7 +398,7 @@ int i18n_udate_set_calendar ( i18n_udate_format_h format, const i18n_ucalendar_h * * @see i18n_udate_set_number_format() */ -int i18n_udate_get_number_format ( const i18n_udate_format_h format, i18n_unumber_format_h *number_format ); +int i18n_udate_get_number_format(const i18n_udate_format_h format, i18n_unumber_format_h *number_format); /** * @brief Sets the #i18n_unumber_format_h associated with an #i18n_udate_format_h. @@ -414,7 +414,7 @@ int i18n_udate_get_number_format ( const i18n_udate_format_h format, i18n_unumbe * * @see i18n_udate_get_number_format() */ -int i18n_udate_set_number_format ( i18n_udate_format_h format, const i18n_unumber_format_h number_format_to_set ); +int i18n_udate_set_number_format(i18n_udate_format_h format, const i18n_unumber_format_h number_format_to_set); /** * @brief Gets a locale for which date/time formatting patterns are available. @@ -430,7 +430,7 @@ int i18n_udate_set_number_format ( i18n_udate_format_h format, const i18n_unumbe * @see i18n_udate_count_available() */ -const char *i18n_udate_get_available ( int32_t locale_index ); +const char *i18n_udate_get_available(int32_t locale_index); /** * @brief Determines how many locales have date/time formatting patterns available. @@ -444,7 +444,7 @@ const char *i18n_udate_get_available ( int32_t locale_index ); * * @see i18n_udate_get_available() */ -int32_t i18n_udate_count_available ( void ); +int32_t i18n_udate_count_available(void); /** * @brief Gets the year relative to which all 2-digit years are interpreted. @@ -461,7 +461,7 @@ int32_t i18n_udate_count_available ( void ); * * @see i18n_udate_set_2digit_year_start() */ -int i18n_udate_get_2digit_year_start ( const i18n_udate_format_h format, i18n_udate *year ); +int i18n_udate_get_2digit_year_start(const i18n_udate_format_h format, i18n_udate *year); /** * @brief Sets the year relative to which all 2-digit years will be interpreted. @@ -478,7 +478,7 @@ int i18n_udate_get_2digit_year_start ( const i18n_udate_format_h format, i18n_ud * * @see i18n_udate_get_2digit_year_start() */ -int i18n_udate_set_2digit_year_start ( i18n_udate_format_h format, i18n_udate date ); +int i18n_udate_set_2digit_year_start(i18n_udate_format_h format, i18n_udate date); /** * @brief Extracts the pattern from an #i18n_udate_format_h. @@ -499,8 +499,8 @@ int i18n_udate_set_2digit_year_start ( i18n_udate_format_h format, i18n_udate da * * @see i18n_udate_apply_pattern() */ -int32_t i18n_udate_to_pattern ( const i18n_udate_format_h format, i18n_ubool localized, i18n_uchar *result, - int32_t result_length ); +int32_t i18n_udate_to_pattern(const i18n_udate_format_h format, i18n_ubool localized, i18n_uchar *result, + int32_t result_length); /** * @brief Sets the pattern used by an #i18n_udate_format_h. @@ -518,8 +518,8 @@ int32_t i18n_udate_to_pattern ( const i18n_udate_format_h format, i18n_ubool loc * * @see i18n_udate_to_pattern() */ -int i18n_udate_apply_pattern ( i18n_udate_format_h format, i18n_ubool localized, const i18n_uchar *pattern, - int32_t pattern_length ); +int i18n_udate_apply_pattern(i18n_udate_format_h format, i18n_ubool localized, const i18n_uchar *pattern, + int32_t pattern_length); /** * @brief Gets the symbols associated with an #i18n_udate_format_h. @@ -543,8 +543,8 @@ int i18n_udate_apply_pattern ( i18n_udate_format_h format, i18n_ubool localized, * @see i18n_udate_count_symbols() * @see #i18n_udate_set_symbols() */ -int32_t i18n_udate_get_symbols ( const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, - i18n_uchar *result, int32_t result_length ); +int32_t i18n_udate_get_symbols(const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, + i18n_uchar *result, int32_t result_length); /** * @brief Counts the number of particular symbols for an #i18n_udate_format_h. @@ -564,7 +564,7 @@ int32_t i18n_udate_get_symbols ( const i18n_udate_format_h format, i18n_udate_fo * @see i18n_udate_get_symbols() * @see #i18n_udate_set_symbols() */ -int32_t i18n_udate_count_symbols ( const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type ); +int32_t i18n_udate_count_symbols(const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type); /** * @brief Sets the symbols associated with an #i18n_udate_format_h. @@ -587,8 +587,8 @@ int32_t i18n_udate_count_symbols ( const i18n_udate_format_h format, i18n_udate_ * @see i18n_udate_count_symbols() * @see #i18n_udate_get_symbols() */ -int i18n_udate_set_symbols ( i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, - i18n_uchar *value, int32_t value_length ); +int i18n_udate_set_symbols(i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, + i18n_uchar *value, int32_t value_length); /** * @brief Gets the locale for this date format object. @@ -605,7 +605,7 @@ int i18n_udate_set_symbols ( i18n_udate_format_h format, i18n_udate_format_symbo * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char * i18n_udate_get_locale_by_type ( const i18n_udate_format_h format, i18n_ulocale_data_locale_type_e type ); +const char * i18n_udate_get_locale_by_type(const i18n_udate_format_h format, i18n_ulocale_data_locale_type_e type); /** * @brief Sets a particular #i18n_udisplay_context_e value in the formatter, such as #I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_STANDALONE. @@ -620,7 +620,7 @@ const char * i18n_udate_get_locale_by_type ( const i18n_udate_format_h format, i * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udate_set_context ( i18n_udate_format_h format, i18n_udisplay_context_e value ); +int i18n_udate_set_context(i18n_udate_format_h format, i18n_udisplay_context_e value); /** diff --git a/src/include/wearable/utils_i18n_udatepg.h b/src/include/wearable/utils_i18n_udatepg.h index d46317d..8308288 100755 --- a/src/include/wearable/utils_i18n_udatepg.h +++ b/src/include/wearable/utils_i18n_udatepg.h @@ -106,21 +106,21 @@ // creates new i18n_udate_format to format dates and times ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_KR, -1, bestPattern, -1, &formatter_KR); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_KR) { dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n"); } ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_LA, -1, bestPattern, -1, &formatter_LA); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_LA) { dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n"); } ret = i18n_udate_create(I18N_UDATE_PATTERN , I18N_UDATE_PATTERN , locale, utf16_timezone_SaoPaulo, -1, bestPattern, -1, &formatter_SaoPaulo); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n"); } if (!formatter_LA) { @@ -178,7 +178,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_create ( const char *locale, i18n_udatepg_h *dtpg ); +int i18n_udatepg_create(const char *locale, i18n_udatepg_h *dtpg); /** * @brief Destroys a generator. @@ -189,7 +189,7 @@ int i18n_udatepg_create ( const char *locale, i18n_udatepg_h *dtpg ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_destroy ( i18n_udatepg_h dtpg ); +int i18n_udatepg_destroy(i18n_udatepg_h dtpg); /** * @brief Gets the best pattern matching the input skeleton. @@ -213,7 +213,7 @@ int i18n_udatepg_destroy ( i18n_udatepg_h dtpg ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @retval #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int i18n_udatepg_get_best_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t len, i18n_uchar *best_pattern, int32_t capacity, int32_t *best_pattern_len ); +int i18n_udatepg_get_best_pattern(i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t len, i18n_uchar *best_pattern, int32_t capacity, int32_t *best_pattern_len); // Newly Added APIs @@ -229,7 +229,7 @@ int i18n_udatepg_get_best_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *skele * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_create_empty (i18n_udatepg_h *dtpg); +int i18n_udatepg_create_empty(i18n_udatepg_h *dtpg); /** * @brief Creates a copy of a generator. @@ -242,7 +242,7 @@ int i18n_udatepg_create_empty (i18n_udatepg_h *dtpg); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_clone ( const i18n_udatepg_h dtpg, i18n_udatepg_h * dtpg_clone); +int i18n_udatepg_clone(const i18n_udatepg_h dtpg, i18n_udatepg_h * dtpg_clone); /** * @brief Gets the best pattern matching the input @a skeleton. @@ -273,8 +273,8 @@ int i18n_udatepg_clone ( const i18n_udatepg_h dtpg, i18n_udatepg_h * dtpg_clone) * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_get_best_pattern_with_options ( i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t length, - i18n_udatepg_date_time_pattern_match_options_e options, i18n_uchar *best_pattern, int32_t capacity ); +int32_t i18n_udatepg_get_best_pattern_with_options(i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t length, + i18n_udatepg_date_time_pattern_match_options_e options, i18n_uchar *best_pattern, int32_t capacity); /** * @brief Gets a unique skeleton from a given pattern. For example, both "MMM-dd" and "dd/MMM" produce the skeleton "MMMdd". @@ -298,7 +298,7 @@ int32_t i18n_udatepg_get_best_pattern_with_options ( i18n_udatepg_h dtpg, const * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_get_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, i18n_uchar *skeleton, int32_t capacity ); +int32_t i18n_udatepg_get_skeleton(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, i18n_uchar *skeleton, int32_t capacity); /** * @brief Gets a unique base skeleton from a given pattern. @@ -325,7 +325,7 @@ int32_t i18n_udatepg_get_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar *patte * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_get_base_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, i18n_uchar *base_skeleton, int32_t capacity ); +int32_t i18n_udatepg_get_base_skeleton(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t length, i18n_uchar *base_skeleton, int32_t capacity); /** * @brief Adds a pattern to the generator. @@ -353,7 +353,7 @@ int32_t i18n_udatepg_get_base_skeleton ( i18n_udatepg_h dtpg, const i18n_uchar * * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_add_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, i18n_ubool override, i18n_uchar *conflicting_pattern, int32_t capacity, i18n_udatepg_date_time_pattern_conflict_e * conflict_status ); +int32_t i18n_udatepg_add_pattern(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, i18n_ubool override, i18n_uchar *conflicting_pattern, int32_t capacity, i18n_udatepg_date_time_pattern_conflict_e * conflict_status); /** * @brief An append_item_format is a pattern used to append a field if there is no good match. @@ -379,7 +379,7 @@ int32_t i18n_udatepg_add_pattern ( i18n_udatepg_h dtpg, const i18n_uchar *patte * * @see i18n_udatepg_get_append_item_format() */ -int i18n_udatepg_set_append_item_format ( i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, const i18n_uchar *value, int32_t length ); +int i18n_udatepg_set_append_item_format(i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, const i18n_uchar *value, int32_t length); /** * @brief Getter corresponding to i18n_udatepg_set_append_item_format(). @@ -399,7 +399,7 @@ int i18n_udatepg_set_append_item_format ( i18n_udatepg_h dtpg, i18n_udatepg_date * * @see i18n_udatepg_set_append_item_format() */ -const i18n_uchar *i18n_udatepg_get_append_item_format ( const i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_append_item_format(const i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, int32_t *pattern_length); /** * @brief Sets the name of field, e.g. "era" in English for ERA. @@ -418,8 +418,8 @@ const i18n_uchar *i18n_udatepg_get_append_item_format ( const i18n_udatepg_h dtp * * @see i18n_udatepg_get_append_item_name() */ -int i18n_udatepg_set_append_item_name ( i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, const i18n_uchar *value, - int32_t length ); +int i18n_udatepg_set_append_item_name(i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, const i18n_uchar *value, + int32_t length); /** * @brief Getter corresponding to i18n_udatepg_set_append_item_name(). @@ -439,8 +439,8 @@ int i18n_udatepg_set_append_item_name ( i18n_udatepg_h dtpg, i18n_udatepg_date_t * * @see i18n_udatepg_set_append_item_name() */ -const i18n_uchar *i18n_udatepg_get_append_item_name ( const i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, - int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_append_item_name(const i18n_udatepg_h dtpg, i18n_udatepg_date_time_pattern_field_e field, + int32_t *pattern_length); /** * @brief The date time format is a message format pattern used to compose date and time patterns. @@ -464,7 +464,7 @@ const i18n_uchar *i18n_udatepg_get_append_item_name ( const i18n_udatepg_h dtpg, * * @see i18n_udatepg_get_date_time_format() */ -int i18n_udatepg_set_date_time_format ( const i18n_udatepg_h dtpg, const i18n_uchar *date_time_format, int32_t length ); +int i18n_udatepg_set_date_time_format(const i18n_udatepg_h dtpg, const i18n_uchar *date_time_format, int32_t length); /** * @brief Getter corresponding to i18n_udatepg_set_date_time_format(). @@ -482,7 +482,7 @@ int i18n_udatepg_set_date_time_format ( const i18n_udatepg_h dtpg, const i18n_uc * * @see i18n_udatepg_set_date_time_format() */ -const i18n_uchar *i18n_udatepg_get_date_time_format ( const i18n_udatepg_h dtpg, int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_date_time_format(const i18n_udatepg_h dtpg, int32_t *pattern_length); /** * @brief The decimal value is used in formatting fractions of seconds. @@ -502,7 +502,7 @@ const i18n_uchar *i18n_udatepg_get_date_time_format ( const i18n_udatepg_h dtpg, * * @see i18n_udatepg_get_decimal() */ -int i18n_udatepg_set_decimal ( i18n_udatepg_h dtpg, const i18n_uchar *decimal, int32_t length ); +int i18n_udatepg_set_decimal(i18n_udatepg_h dtpg, const i18n_uchar *decimal, int32_t length); /** * @brief Getter corresponding to i18n_udatepg_set_decimal(). @@ -520,7 +520,7 @@ int i18n_udatepg_set_decimal ( i18n_udatepg_h dtpg, const i18n_uchar *decimal, i * * @see i18n_udatepg_set_decimal() */ -const i18n_uchar *i18n_udatepg_get_decimal ( const i18n_udatepg_h dtpg, int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_decimal(const i18n_udatepg_h dtpg, int32_t *pattern_length); /** * @brief Adjusts the field types (width and subtype) of a @a pattern to match what is in a @a skeleton. @@ -548,8 +548,8 @@ const i18n_uchar *i18n_udatepg_get_decimal ( const i18n_udatepg_h dtpg, int32_t * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_replace_field_types ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, - const i18n_uchar *skeleton, int32_t skeleton_length, i18n_uchar *dest, int32_t dest_capacity ); +int32_t i18n_udatepg_replace_field_types(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, + const i18n_uchar *skeleton, int32_t skeleton_length, i18n_uchar *dest, int32_t dest_capacity); /** * @brief Adjusts the field types (width and subtype) of a pattern to match what is in a @a skeleton. @@ -581,9 +581,9 @@ int32_t i18n_udatepg_replace_field_types ( i18n_udatepg_h dtpg, const i18n_uchar * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_udatepg_replace_field_types_with_options ( i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, +int32_t i18n_udatepg_replace_field_types_with_options(i18n_udatepg_h dtpg, const i18n_uchar *pattern, int32_t pattern_length, const i18n_uchar *skeleton, int32_t skeleton_length, i18n_udatepg_date_time_pattern_match_options_e options, - i18n_uchar *dest, int32_t dest_capacity ); + i18n_uchar *dest, int32_t dest_capacity); /** * @brief Creates an #i18n_uenumeration_h for list of all the skeletons in canonical form. @@ -597,7 +597,7 @@ int32_t i18n_udatepg_replace_field_types_with_options ( i18n_udatepg_h dtpg, con * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration ); +int i18n_udatepg_skeletons_create(const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration); /** * @brief Creates an #i18n_uenumeration_h for list of all the base skeletons in canonical form. @@ -610,7 +610,7 @@ int i18n_udatepg_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumeration * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_udatepg_base_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration ); +int i18n_udatepg_base_skeletons_create(const i18n_udatepg_h dtpg, i18n_uenumeration_h *enumeration); /** * @brief Gets the pattern corresponding to a given skeleton. @@ -628,7 +628,7 @@ int i18n_udatepg_base_skeletons_create ( const i18n_udatepg_h dtpg, i18n_uenumer * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const i18n_uchar *i18n_udatepg_get_pattern_for_skeleton ( const i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t skeleton_length, int32_t *pattern_length ); +const i18n_uchar *i18n_udatepg_get_pattern_for_skeleton(const i18n_udatepg_h dtpg, const i18n_uchar *skeleton, int32_t skeleton_length, int32_t *pattern_length); #ifdef __cplusplus diff --git a/src/include/wearable/utils_i18n_uenumeration.h b/src/include/wearable/utils_i18n_uenumeration.h index bbfe620..543945d 100755 --- a/src/include/wearable/utils_i18n_uenumeration.h +++ b/src/include/wearable/utils_i18n_uenumeration.h @@ -61,7 +61,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uenumeration_destroy ( i18n_uenumeration_h enumeration ); +int i18n_uenumeration_destroy(i18n_uenumeration_h enumeration); /** * @brief Returns the number of elements that the iterator traverses. @@ -79,7 +79,7 @@ int i18n_uenumeration_destroy ( i18n_uenumeration_h enumeration ); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @exception #I18N_ERROR_ENUM_OUT_OF_SYNC The iterator is out of sync */ -int32_t i18n_uenumeration_count ( i18n_uenumeration_h enumeration ); +int32_t i18n_uenumeration_count(i18n_uenumeration_h enumeration); /** * @brief Returns the next element in the iterator's list. @@ -102,7 +102,7 @@ int32_t i18n_uenumeration_count ( i18n_uenumeration_h enumeration ); * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @exception #I18N_ERROR_ENUM_OUT_OF_SYNC The iterator is out of sync */ -const i18n_uchar *i18n_uenumeration_unext ( i18n_uenumeration_h enumeration, int32_t *result_length ); +const i18n_uchar *i18n_uenumeration_unext(i18n_uenumeration_h enumeration, int32_t *result_length); /** * @brief Returns the next element in the iterator's list. @@ -128,7 +128,7 @@ const i18n_uchar *i18n_uenumeration_unext ( i18n_uenumeration_h enumeration, int * @exception #I18N_ERROR_INVARIANT_CONVERSION The underlying native string is i18n_uchar* and conversion to char* with the invariant converter fails. * This error pertains only to current string, so iteration might be able to continue successfully. */ -const char *i18n_uenumeration_next ( i18n_uenumeration_h enumeration, int32_t *result_length ); +const char *i18n_uenumeration_next(i18n_uenumeration_h enumeration, int32_t *result_length); /** * @brief Resets the iterator to the current list of service IDs. @@ -142,7 +142,7 @@ const char *i18n_uenumeration_next ( i18n_uenumeration_h enumeration, int32_t *r * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uenumeration_reset ( i18n_uenumeration_h enumeration ); +int i18n_uenumeration_reset(i18n_uenumeration_h enumeration); /** * @brief Given an array of const i18n_uchar* strings, return an #i18n_uenumeration_h. @@ -161,7 +161,7 @@ int i18n_uenumeration_reset ( i18n_uenumeration_h enumeration ); * * @see i18n_uenumeration_destroy() */ -int i18n_uenumeration_uchar_strings_enumeration_create(const i18n_uchar *const strings[], int32_t count, i18n_uenumeration_h *enumeration ); +int i18n_uenumeration_uchar_strings_enumeration_create(const i18n_uchar *const strings[], int32_t count, i18n_uenumeration_h *enumeration); /** * @brief Given an array of const char* strings (invariant chars only), return an #i18n_uenumeration_h. @@ -180,7 +180,7 @@ int i18n_uenumeration_uchar_strings_enumeration_create(const i18n_uchar *const s * * @see i18n_uenumeration_destroy() */ -int i18n_uenumeration_char_strings_enumeration_create(const char* const strings[], int32_t count, i18n_uenumeration_h *enumeration ); +int i18n_uenumeration_char_strings_enumeration_create(const char* const strings[], int32_t count, i18n_uenumeration_h *enumeration); /** * @} diff --git a/src/include/wearable/utils_i18n_ulocale.h b/src/include/wearable/utils_i18n_ulocale.h index a180152..18af395 100644 --- a/src/include/wearable/utils_i18n_ulocale.h +++ b/src/include/wearable/utils_i18n_ulocale.h @@ -61,21 +61,21 @@ // Gets default locale ret = i18n_ulocale_get_default(&locale); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_ERROR, LOG_TAG, "i18n_ulocale_get_default() failed!!! \n"); } dlog_print(DLOG_INFO, LOG_TAG, "default locale : %s\n", locale); // default locale : en_GB.UTF-8 // Gets the language code for the specified locale ret = i18n_ulocale_get_language(locale, language, language_capacity, &buf_size_language); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_ERROR, LOG_TAG, "i18n_ulocale_get_language() failed!!! \n"); } dlog_print(DLOG_INFO, LOG_TAG, "language code for the locale : %s\n", language); // language code for the locale : en // Gets the full name suitable for display for the specified locale ret = i18n_ulocale_get_display_name(locale, in_locale_id, result_w, 64, &buf_size_display_name); - if ( ret != I18N_ERROR_NONE ) { + if (ret != I18N_ERROR_NONE) { dlog_print(DLOG_ERROR, LOG_TAG, "i18n_ulocale_get_display_name() failed!!! \n"); } i18n_ustring_copy_au(result, result_w); @@ -120,7 +120,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_default ( const char **locale ); +int i18n_ulocale_get_default(const char **locale); /** * @brief Sets I18N's default locale. @@ -138,7 +138,7 @@ int i18n_ulocale_get_default ( const char **locale ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_set_default ( const char *locale_id ); +int i18n_ulocale_set_default(const char *locale_id); /** * @brief Gets the language code for the specified locale. @@ -154,7 +154,7 @@ int i18n_ulocale_set_default ( const char *locale_id ); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_language ( const char *locale_id, char *language, int32_t language_capacity, int32_t *buf_size_language ); +int i18n_ulocale_get_language(const char *locale_id, char *language, int32_t language_capacity, int32_t *buf_size_language); /** * @brief Gets the country code for the specified locale. @@ -168,7 +168,7 @@ int i18n_ulocale_get_language ( const char *locale_id, char *language, int32_t l * @return The actual buffer size needed for the country code.\n * If it's greater than @a country_capacity, the returned country code will be truncated. */ -int32_t i18n_ulocale_get_country ( const char *locale_id, char *country, int32_t country_capacity, int *error ); +int32_t i18n_ulocale_get_country(const char *locale_id, char *country, int32_t country_capacity, int *error); /** * @brief Gets the full name suitable for display for the specified locale. @@ -186,7 +186,7 @@ int32_t i18n_ulocale_get_country ( const char *locale_id, char *country, int32_t * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_display_name ( const char *locale_id, const char *in_locale_id, i18n_uchar *result, int32_t max_result_size, int32_t *buf_size_display_name ); +int i18n_ulocale_get_display_name(const char *locale_id, const char *in_locale_id, i18n_uchar *result, int32_t max_result_size, int32_t *buf_size_display_name); /** * @brief Gets the specified locale from a list of all available locales. @@ -204,7 +204,7 @@ int i18n_ulocale_get_display_name ( const char *locale_id, const char *in_locale * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char* i18n_ulocale_get_available ( int32_t n ); +const char* i18n_ulocale_get_available(int32_t n); /** * @brief Gets the size of the all available locale list. @@ -215,7 +215,7 @@ const char* i18n_ulocale_get_available ( int32_t n ); * @return The size of the locale list * @exception #I18N_ERROR_NONE Success */ -int32_t i18n_ulocale_count_available ( void ); +int32_t i18n_ulocale_count_available(void); // Newly Added APIs @@ -237,7 +237,7 @@ int32_t i18n_ulocale_count_available ( void ); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_script ( const char *locale_id, char *script, int32_t script_capacity ); +int32_t i18n_ulocale_get_script(const char *locale_id, char *script, int32_t script_capacity); /** * @brief Gets the variant code for the specified locale. @@ -257,7 +257,7 @@ int32_t i18n_ulocale_get_script ( const char *locale_id, char *script, int32_t s * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_variant ( const char *locale_id, char *variant, int32_t variant_capacity ); +int32_t i18n_ulocale_get_variant(const char *locale_id, char *variant, int32_t variant_capacity); /** * @brief Gets the full name for the specified locale. @@ -279,7 +279,7 @@ int32_t i18n_ulocale_get_variant ( const char *locale_id, char *variant, int32_t * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int32_t i18n_ulocale_get_name ( const char *locale_id, char *name, int32_t name_capacity ); +int32_t i18n_ulocale_get_name(const char *locale_id, char *name, int32_t name_capacity); /** * @brief Gets the full name for the specified locale. @@ -301,7 +301,7 @@ int32_t i18n_ulocale_get_name ( const char *locale_id, char *name, int32_t name_ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int32_t i18n_ulocale_canonicalize ( const char *locale_id, char *name, int32_t name_capacity ); +int32_t i18n_ulocale_canonicalize(const char *locale_id, char *name, int32_t name_capacity); /** * @brief Gets the ISO language code for the specified locale. @@ -315,7 +315,7 @@ int32_t i18n_ulocale_canonicalize ( const char *locale_id, char *name, int32_t n * * @exception #I18N_ERROR_NONE Successful */ -const char * i18n_ulocale_get_iso3_language ( const char *locale_id ); +const char * i18n_ulocale_get_iso3_language(const char *locale_id); /** * @brief Gets the ISO country code for the specified locale. @@ -329,7 +329,7 @@ const char * i18n_ulocale_get_iso3_language ( const char *locale_id ); * * @exception #I18N_ERROR_NONE Successful */ -const char * i18n_ulocale_get_iso3_country ( const char *locale_id ); +const char * i18n_ulocale_get_iso3_country(const char *locale_id); /** * @brief Gets the Win32 LCID value for the specified locale. @@ -344,7 +344,7 @@ const char * i18n_ulocale_get_iso3_country ( const char *locale_id ); * * @exception #I18N_ERROR_NONE Successful */ -uint32_t i18n_ulocale_get_lcid ( const char *locale_id ); +uint32_t i18n_ulocale_get_lcid(const char *locale_id); /** * @brief Gets the language name suitable for display for the specified locale. @@ -366,7 +366,7 @@ uint32_t i18n_ulocale_get_lcid ( const char *locale_id ); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_language ( const char *locale, const char *display_locale, i18n_uchar *language, int32_t language_capacity ); +int32_t i18n_ulocale_get_display_language(const char *locale, const char *display_locale, i18n_uchar *language, int32_t language_capacity); /** * @brief Gets the script name suitable for display for the specified locale. @@ -387,7 +387,7 @@ int32_t i18n_ulocale_get_display_language ( const char *locale, const char *disp * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_script ( const char *locale, const char *display_locale, i18n_uchar *script, int32_t script_capacity ); +int32_t i18n_ulocale_get_display_script(const char *locale, const char *display_locale, i18n_uchar *script, int32_t script_capacity); /** * @brief Gets the country name suitable for display for the specified locale. @@ -408,7 +408,7 @@ int32_t i18n_ulocale_get_display_script ( const char *locale, const char *displa * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_country ( const char *locale, const char *display_locale, i18n_uchar *country, int32_t country_capacity ); +int32_t i18n_ulocale_get_display_country(const char *locale, const char *display_locale, i18n_uchar *country, int32_t country_capacity); /** * @brief Gets the variant name suitable for display for the specified locale. @@ -429,7 +429,7 @@ int32_t i18n_ulocale_get_display_country ( const char *locale, const char *displ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_variant ( const char *locale, const char *display_locale, i18n_uchar *variant, int32_t variant_capacity ); +int32_t i18n_ulocale_get_display_variant(const char *locale, const char *display_locale, i18n_uchar *variant, int32_t variant_capacity); /** * @brief Gets the keyword name suitable for display for the specified locale. @@ -481,7 +481,7 @@ int32_t i18n_ulocale_get_display_variant ( const char *locale, const char *displ * @see i18n_uenumeration_next() * @see i18n_uenumeration_destroy() */ -int32_t i18n_ulocale_get_display_keyword ( const char *keyword, const char *display_locale, i18n_uchar *dest, int32_t dest_capacity ); +int32_t i18n_ulocale_get_display_keyword(const char *keyword, const char *display_locale, i18n_uchar *dest, int32_t dest_capacity); /** * @brief Gets the value of the keyword suitable for display for the specified locale. @@ -506,7 +506,7 @@ int32_t i18n_ulocale_get_display_keyword ( const char *keyword, const char *disp * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_display_keyword_value ( const char *locale, const char *keyword, const char *display_locale, i18n_uchar *dest, int32_t dest_capacity ); +int32_t i18n_ulocale_get_display_keyword_value(const char *locale, const char *keyword, const char *display_locale, i18n_uchar *dest, int32_t dest_capacity); /** * @brief Gets a list of all available 2-letter language codes defined in ISO 639, @@ -523,7 +523,7 @@ int32_t i18n_ulocale_get_display_keyword_value ( const char *locale, const char * * @exception #I18N_ERROR_NONE Successful */ -const char * const *i18n_ulocale_get_iso_languages ( void ); +const char * const *i18n_ulocale_get_iso_languages(void); /** * @@ -539,7 +539,7 @@ const char * const *i18n_ulocale_get_iso_languages ( void ); * * @exception #I18N_ERROR_NONE Successful */ -const char * const *i18n_ulocale_get_iso_countries ( void ); +const char * const *i18n_ulocale_get_iso_countries(void); /** * @brief Truncates the locale ID string to get the parent locale ID. @@ -566,7 +566,7 @@ const char * const *i18n_ulocale_get_iso_countries ( void ); * in the @a locale_id from index 0 to the index of the last occurrence of * the underscore ("_") symbol. */ -int32_t i18n_ulocale_get_parent ( const char *locale_id, char *parent, int32_t parent_capacity ); +int32_t i18n_ulocale_get_parent(const char *locale_id, char *parent, int32_t parent_capacity); /** * @brief Gets the full name for the specified locale, like i18n_ulocale_get_name(), but without keywords. @@ -591,7 +591,7 @@ int32_t i18n_ulocale_get_parent ( const char *locale_id, char *parent, int32_t p * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int32_t i18n_ulocale_get_base_name ( const char *locale_id, char *name, int32_t name_capacity ); +int32_t i18n_ulocale_get_base_name(const char *locale_id, char *name, int32_t name_capacity); /** * @brief Gets an enumeration of keywords for the specified locale. @@ -606,7 +606,7 @@ int32_t i18n_ulocale_get_base_name ( const char *locale_id, char *name, int32_t * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_keywords_create ( const char *locale_id, i18n_uenumeration_h *enumeration ); +int i18n_ulocale_keywords_create(const char *locale_id, i18n_uenumeration_h *enumeration); /** * @brief Gets the value for a keyword. @@ -626,7 +626,7 @@ int i18n_ulocale_keywords_create ( const char *locale_id, i18n_uenumeration_h *e * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_keyword_value ( const char *locale_id, const char *keyword_name, char *buffer, int32_t buffer_capacity ); +int32_t i18n_ulocale_get_keyword_value(const char *locale_id, const char *keyword_name, char *buffer, int32_t buffer_capacity); /** * @brief Sets or removes the value of the specified keyword. @@ -704,7 +704,7 @@ int32_t i18n_ulocale_get_keyword_value ( const char *locale_id, const char *keyw * * @see i18n_ulocale_get_keyword_value() */ -int32_t i18n_ulocale_set_keyword_value ( const char *keyword_name, const char *keyword_value, char *buffer, int32_t buffer_capacity ); +int32_t i18n_ulocale_set_keyword_value(const char *keyword_name, const char *keyword_value, char *buffer, int32_t buffer_capacity); /** * @brief Gets the layout character orientation for the specified locale. @@ -718,7 +718,7 @@ int32_t i18n_ulocale_set_keyword_value ( const char *keyword_name, const char *k * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_character_orientation ( const char *locale_id, i18n_ulocale_layout_type_e *layout_type ); +int i18n_ulocale_get_character_orientation(const char *locale_id, i18n_ulocale_layout_type_e *layout_type); /** * @brief Gets the layout line orientation for the specified locale. @@ -732,7 +732,7 @@ int i18n_ulocale_get_character_orientation ( const char *locale_id, i18n_ulocale * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_ulocale_get_line_orientation ( const char *locale_id, i18n_ulocale_layout_type_e *layout_type ); +int i18n_ulocale_get_line_orientation(const char *locale_id, i18n_ulocale_layout_type_e *layout_type); /** * @brief Gets the I18N locale ID for the specified Win32 LCID value. @@ -751,7 +751,7 @@ int i18n_ulocale_get_line_orientation ( const char *locale_id, i18n_ulocale_layo * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_get_locale_for_lcid ( uint32_t host_id, char *locale, int32_t locale_capacity ); +int32_t i18n_ulocale_get_locale_for_lcid(uint32_t host_id, char *locale, int32_t locale_capacity); /** * @brief Adds the likely subtags for a provided locale ID, per the algorithm described @@ -785,7 +785,7 @@ int32_t i18n_ulocale_get_locale_for_lcid ( uint32_t host_id, char *locale, int32 * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_add_likely_subtags ( const char *locale_id, char *maximized_locale_id, int32_t maximized_locale_id_capacity ); +int32_t i18n_ulocale_add_likely_subtags(const char *locale_id, char *maximized_locale_id, int32_t maximized_locale_id_capacity); /** * @brief Minimizes the subtags for a provided locale ID, per the algorithm described @@ -818,7 +818,7 @@ int32_t i18n_ulocale_add_likely_subtags ( const char *locale_id, char *maximized * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_minimize_subtags ( const char *locale_id, char *minimized_locale_id, int32_t minimized_locale_id_capacity ); +int32_t i18n_ulocale_minimize_subtags(const char *locale_id, char *minimized_locale_id, int32_t minimized_locale_id_capacity); /** * @brief Returns a locale ID for the specified BCP47 language tag string. @@ -849,7 +849,7 @@ int32_t i18n_ulocale_minimize_subtags ( const char *locale_id, char *minimized_l * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_for_language_tag ( const char *langtag, char *locale_id, int32_t locale_id_capacity, int32_t *parsed_length ); +int32_t i18n_ulocale_for_language_tag(const char *langtag, char *locale_id, int32_t locale_id_capacity, int32_t *parsed_length); /** * @brief Returns a well-formed language tag for this locale ID. @@ -877,7 +877,7 @@ int32_t i18n_ulocale_for_language_tag ( const char *langtag, char *locale_id, in * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ulocale_to_language_tag ( const char *locale_id, char *langtag, int32_t langtag_capacity, i18n_ubool strict ); +int32_t i18n_ulocale_to_language_tag(const char *locale_id, char *langtag, int32_t langtag_capacity, i18n_ubool strict); #ifdef __cplusplus } diff --git a/src/include/wearable/utils_i18n_unormalization.h b/src/include/wearable/utils_i18n_unormalization.h index 76ecbc0..15bad5d 100755 --- a/src/include/wearable/utils_i18n_unormalization.h +++ b/src/include/wearable/utils_i18n_unormalization.h @@ -81,7 +81,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unormalization_get_instance (const char *package_name, const char *name, i18n_unormalization_mode_e mode, +int i18n_unormalization_get_instance(const char *package_name, const char *name, i18n_unormalization_mode_e mode, i18n_unormalizer_h *normalizer); /** @@ -100,7 +100,7 @@ int i18n_unormalization_get_instance (const char *package_name, const char *name * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unormalization_normalize (i18n_unormalizer_h normalizer, const i18n_uchar *src, int32_t len, i18n_uchar *dest, int32_t capacity, int32_t *len_deststr); +int i18n_unormalization_normalize(i18n_unormalizer_h normalizer, const i18n_uchar *src, int32_t len, i18n_uchar *dest, int32_t capacity, int32_t *len_deststr); #ifdef __cplusplus } diff --git a/src/include/wearable/utils_i18n_unumber.h b/src/include/wearable/utils_i18n_unumber.h index f1e7cf3..4a4e2ac 100644 --- a/src/include/wearable/utils_i18n_unumber.h +++ b/src/include/wearable/utils_i18n_unumber.h @@ -106,8 +106,8 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_create ( i18n_unumber_format_style_e style, const i18n_uchar *pattern, int32_t pattern_len, const char *locale, - i18n_uparse_error_s *parse_err, i18n_unumber_format_h *num_format ); +int i18n_unumber_create(i18n_unumber_format_style_e style, const i18n_uchar *pattern, int32_t pattern_len, const char *locale, + i18n_uparse_error_s *parse_err, i18n_unumber_format_h *num_format); /** * @brief Destroys an #i18n_unumber_format_h. @@ -119,7 +119,7 @@ int i18n_unumber_create ( i18n_unumber_format_style_e style, const i18n_uchar *p * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_destroy ( i18n_unumber_format_h fmt ); +int i18n_unumber_destroy(i18n_unumber_format_h fmt); /** * @brief Gets a symbol associated with an #i18n_unumber_format_h. @@ -138,7 +138,7 @@ int i18n_unumber_destroy ( i18n_unumber_format_h fmt ); * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_get_symbol ( const i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, i18n_uchar *buffer, int32_t size, int32_t *len_symbol ); +int i18n_unumber_get_symbol(const i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, i18n_uchar *buffer, int32_t size, int32_t *len_symbol); // Newly Added APIs @@ -156,7 +156,7 @@ int i18n_unumber_get_symbol ( const i18n_unumber_format_h fmt, i18n_unumber_form * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_clone (const i18n_unumber_format_h fmt, i18n_unumber_format_h *fmt_clone); +int i18n_unumber_clone(const i18n_unumber_format_h fmt, i18n_unumber_format_h *fmt_clone); /** * @brief Formats an integer using a i18n_unumber_format_h. @@ -177,7 +177,7 @@ int i18n_unumber_clone (const i18n_unumber_format_h fmt, i18n_unumber_format_h * * * @return The total buffer size needed; if greater than result_length, the output was truncated. */ -int32_t i18n_unumber_format (const i18n_unumber_format_h fmt, int32_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_s *pos, i18n_error_code_e *status); +int32_t i18n_unumber_format(const i18n_unumber_format_h fmt, int32_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_s *pos, i18n_error_code_e *status); /** * @brief Formats an int64 using an #i18n_unumber_format_h. @@ -204,7 +204,7 @@ int32_t i18n_unumber_format (const i18n_unumber_format_h fmt, int32_t number, i1 * @exception #I18N_WARNING_STRING_NOT_TERMINATED If the formatted number fits into @a result but cannot be NULL-terminated (length == result_length) * @exception #I18N_ERROR_BUFFER_OVERFLOW If the formatted number doesn't fit into the @a result buffer */ -int32_t i18n_unumber_format_int64 (const i18n_unumber_format_h fmt, int64_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); +int32_t i18n_unumber_format_int64(const i18n_unumber_format_h fmt, int64_t number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); /** * @brief Formats a double using an #i18n_unumber_format_h. @@ -232,7 +232,7 @@ int32_t i18n_unumber_format_int64 (const i18n_unumber_format_h fmt, int64_t numb * @exception #I18N_WARNING_STRING_NOT_TERMINATED If the formatted number fits into @a result but cannot be NULL-terminated (length == result_length) * @exception #I18N_ERROR_BUFFER_OVERFLOW If the formatted number doesn't fit into the @a result buffer */ -int32_t i18n_unumber_format_double (const i18n_unumber_format_h fmt, double number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); +int32_t i18n_unumber_format_double(const i18n_unumber_format_h fmt, double number, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); /** * @brief Formats a decimal number using an #i18n_unumber_format_h. @@ -263,7 +263,7 @@ int32_t i18n_unumber_format_double (const i18n_unumber_format_h fmt, double numb * @exception #I18N_WARNING_STRING_NOT_TERMINATED If the formatted number fits into @a result but cannot be NULL-terminated (length == result_length) * @exception #I18N_ERROR_BUFFER_OVERFLOW If the formatted number doesn't fit into the @a result buffer */ -int32_t i18n_unumber_format_decimal (const i18n_unumber_format_h fmt, const char *number, int32_t length, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); +int32_t i18n_unumber_format_decimal(const i18n_unumber_format_h fmt, const char *number, int32_t length, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); /** * @brief Formats a double currency amount using an #i18n_unumber_format_h. @@ -293,7 +293,7 @@ int32_t i18n_unumber_format_decimal (const i18n_unumber_format_h fmt, const char * @exception #I18N_WARNING_STRING_NOT_TERMINATED If the formatted number fits into @a result but cannot be NULL-terminated (length == result_length) * @exception #I18N_ERROR_BUFFER_OVERFLOW If the formatted number doesn't fit into the @a result buffer */ -int32_t i18n_unumber_format_double_currency (const i18n_unumber_format_h fmt, double number, i18n_uchar *currency, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); +int32_t i18n_unumber_format_double_currency(const i18n_unumber_format_h fmt, double number, i18n_uchar *currency, i18n_uchar *result, int32_t result_length, i18n_ufield_position_h pos); /** * @brief Parses a string into an integer using an #i18n_unumber_format_h. @@ -313,7 +313,7 @@ int32_t i18n_unumber_format_double_currency (const i18n_unumber_format_h fmt, do * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_parse (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); +int32_t i18n_unumber_parse(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); /** * @brief Parses a string into an int64 using an #i18n_unumber_format_h. @@ -333,7 +333,7 @@ int32_t i18n_unumber_parse (const i18n_unumber_format_h fmt, const i18n_uchar *t * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int64_t i18n_unumber_parse_int64 (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); +int64_t i18n_unumber_parse_int64(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); /** * @brief Parses a string into a double using an #i18n_unumber_format_h. @@ -353,7 +353,7 @@ int64_t i18n_unumber_parse_int64 (const i18n_unumber_format_h fmt, const i18n_uc * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -double i18n_unumber_parse_double (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); +double i18n_unumber_parse_double(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos); /** * @brief Parses a number from a string into an unformatted numeric string using an #i18n_unumber_format_h. @@ -379,7 +379,7 @@ double i18n_unumber_parse_double (const i18n_unumber_format_h fmt, const i18n_uc * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_parse_decimal (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, char *out_buf, int32_t out_buf_length); +int32_t i18n_unumber_parse_decimal(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, char *out_buf, int32_t out_buf_length); /** * @brief Parses a string into a double and a currency using an #i18n_unumber_format_h. @@ -403,7 +403,7 @@ int32_t i18n_unumber_parse_decimal (const i18n_unumber_format_h fmt, const i18n_ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -double i18n_unumber_parse_double_currency (const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_uchar *currency); +double i18n_unumber_parse_double_currency(const i18n_unumber_format_h fmt, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_uchar *currency); /** * @brief Sets the pattern used by an #i18n_unumber_format_h. @@ -422,7 +422,7 @@ double i18n_unumber_parse_double_currency (const i18n_unumber_format_h fmt, cons * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_apply_pattern (i18n_unumber_format_h format, i18n_ubool localized, const i18n_uchar *pattern, int32_t pattern_length, i18n_uparse_error_s* parse_error); +int i18n_unumber_apply_pattern(i18n_unumber_format_h format, i18n_ubool localized, const i18n_uchar *pattern, int32_t pattern_length, i18n_uparse_error_s* parse_error); /** * @brief Gets a locale for which decimal formatting patterns are available. @@ -438,7 +438,7 @@ int i18n_unumber_apply_pattern (i18n_unumber_format_h format, i18n_ubool localiz * * @exception #I18N_ERROR_NONE Successful */ -const char *i18n_unumber_get_available (int32_t locale_index); +const char *i18n_unumber_get_available(int32_t locale_index); /** * @brief Determines how many locales have decimal formatting patterns available. @@ -452,7 +452,7 @@ const char *i18n_unumber_get_available (int32_t locale_index); * * @exception #I18N_ERROR_NONE Successful */ -int32_t i18n_unumber_count_available (void); +int32_t i18n_unumber_count_available(void); /** * @brief Gets a numeric attribute associated with an #i18n_unumber_format_h. @@ -474,7 +474,7 @@ int32_t i18n_unumber_count_available (void); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_get_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr); +int32_t i18n_unumber_get_attribute(const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr); /** * @brief Sets a numeric attribute associated with an #i18n_unumber_format_h. @@ -499,7 +499,7 @@ int32_t i18n_unumber_get_attribute (const i18n_unumber_format_h fmt, i18n_unumbe * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_set_attribute (i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, int32_t new_value); +int i18n_unumber_set_attribute(i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, int32_t new_value); /** * @brief Gets a numeric attribute associated with an #i18n_unumber_format_h. @@ -517,7 +517,7 @@ int i18n_unumber_set_attribute (i18n_unumber_format_h fmt, i18n_unumber_format_a * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -double i18n_unumber_get_double_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr); +double i18n_unumber_get_double_attribute(const i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr); /** * @brief Sets a numeric attribute associated with an #i18n_unumber_format_h. @@ -534,7 +534,7 @@ double i18n_unumber_get_double_attribute (const i18n_unumber_format_h fmt, i18n_ * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_set_double_attribute (i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, double new_value); +int i18n_unumber_set_double_attribute(i18n_unumber_format_h fmt, i18n_unumber_format_attribute_e attr, double new_value); /** * @brief Gets a text attribute associated with an #i18n_unumber_format_h. @@ -557,7 +557,7 @@ int i18n_unumber_set_double_attribute (i18n_unumber_format_h fmt, i18n_unumber_f * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_get_text_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, i18n_uchar *result, int32_t result_length); +int32_t i18n_unumber_get_text_attribute(const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, i18n_uchar *result, int32_t result_length); /** * @brief Sets a text attribute associated with an #i18n_unumber_format_h. @@ -577,7 +577,7 @@ int32_t i18n_unumber_get_text_attribute (const i18n_unumber_format_h fmt, i18n_u * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_set_text_attribute (const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, const i18n_uchar *new_value, int32_t new_value_length); +int i18n_unumber_set_text_attribute(const i18n_unumber_format_h fmt, i18n_unumber_format_text_attribute_e tag, const i18n_uchar *new_value, int32_t new_value_length); /** * @brief Extracts the pattern from an #i18n_unumber_format_h. @@ -597,7 +597,7 @@ int i18n_unumber_set_text_attribute (const i18n_unumber_format_h fmt, i18n_unumb * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_unumber_to_pattern (const i18n_unumber_format_h fmt, i18n_ubool is_pattern_localized, i18n_uchar *result, int32_t result_length); +int32_t i18n_unumber_to_pattern(const i18n_unumber_format_h fmt, i18n_ubool is_pattern_localized, i18n_uchar *result, int32_t result_length); /** * @brief Sets a symbol associated with an #i18n_unumber_format_h. @@ -615,7 +615,7 @@ int32_t i18n_unumber_to_pattern (const i18n_unumber_format_h fmt, i18n_ubool is_ * @retval #I18N_ERROR_NONE Successful. * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_unumber_set_symbol (i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, const i18n_uchar *value, int32_t length); +int i18n_unumber_set_symbol(i18n_unumber_format_h fmt, i18n_unumber_format_symbol_e symbol, const i18n_uchar *value, int32_t length); /** * @brief Gets the locale for this number format object. @@ -632,7 +632,7 @@ int i18n_unumber_set_symbol (i18n_unumber_format_h fmt, i18n_unumber_format_symb * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -const char *i18n_unumber_get_locale_by_type (const i18n_unumber_format_h fmt, i18n_ulocale_data_locale_type_e type); +const char *i18n_unumber_get_locale_by_type(const i18n_unumber_format_h fmt, i18n_ulocale_data_locale_type_e type); #ifdef __cplusplus diff --git a/src/include/wearable/utils_i18n_usearch.h b/src/include/wearable/utils_i18n_usearch.h index 8b1e1b9..95ac13a 100755 --- a/src/include/wearable/utils_i18n_usearch.h +++ b/src/include/wearable/utils_i18n_usearch.h @@ -101,7 +101,7 @@ extern "C" { * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_usearch_create_new ( const i18n_uchar *pattern, int32_t pattern_len, const i18n_uchar *text, +int i18n_usearch_create_new(const i18n_uchar *pattern, int32_t pattern_len, const i18n_uchar *text, int32_t text_len, const char *locale, i18n_ubreak_iterator_h break_iter, i18n_usearch_h *search_iter); /** @@ -114,7 +114,7 @@ int i18n_usearch_create_new ( const i18n_uchar *pattern, int32_t pattern_len, co * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_usearch_destroy ( i18n_usearch_h search_iter ); +int i18n_usearch_destroy(i18n_usearch_h search_iter); /** * @brief Returns the text that matches by the most recent call to i18n_usearch_first(), or so on. @@ -136,7 +136,7 @@ int i18n_usearch_destroy ( i18n_usearch_h search_iter ); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @retval #I18N_ERROR_BUFFER_OVERFLOW A result would not fit in the supplied buffer */ -int i18n_usearch_get_matched_text ( const i18n_usearch_h search_iter, i18n_uchar *result, int32_t result_capacity, int32_t *len_matched_text ); +int i18n_usearch_get_matched_text(const i18n_usearch_h search_iter, i18n_uchar *result, int32_t result_capacity, int32_t *len_matched_text); /** * @brief Gets the collator used for the language rules. @@ -151,7 +151,7 @@ int i18n_usearch_get_matched_text ( const i18n_usearch_h search_iter, i18n_uchar * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_usearch_get_collator ( const i18n_usearch_h search_iter, i18n_ucollator_h *collator ); +int i18n_usearch_get_collator(const i18n_usearch_h search_iter, i18n_ucollator_h *collator); /** * @brief Returns the first index at which the string text matches the search pattern. @@ -168,7 +168,7 @@ int i18n_usearch_get_collator ( const i18n_usearch_h search_iter, i18n_ucollator * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_usearch_first ( i18n_usearch_h search_iter, int32_t *index_first ); +int i18n_usearch_first(i18n_usearch_h search_iter, int32_t *index_first); #ifdef __cplusplus } diff --git a/src/include/wearable/utils_i18n_uset.h b/src/include/wearable/utils_i18n_uset.h index 6cf528e..8e40c1f 100755 --- a/src/include/wearable/utils_i18n_uset.h +++ b/src/include/wearable/utils_i18n_uset.h @@ -63,7 +63,7 @@ extern "C" { * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_destroy() */ -int i18n_uset_create_empty (i18n_uset_h *set); +int i18n_uset_create_empty(i18n_uset_h *set); /** * @brief Creates an #i18n_uset_h object that contains the range of characters @@ -81,7 +81,7 @@ int i18n_uset_create_empty (i18n_uset_h *set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_destroy() */ -int i18n_uset_create (i18n_uchar32 start, i18n_uchar32 end, i18n_uset_h *set); +int i18n_uset_create(i18n_uchar32 start, i18n_uchar32 end, i18n_uset_h *set); /** * @brief Creates a set based on a given pattern. @@ -98,7 +98,7 @@ int i18n_uset_create (i18n_uchar32 start, i18n_uchar32 end, i18n_uset_h *set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_destroy() */ -int i18n_uset_create_pattern (const i18n_uchar *pattern, int32_t pattern_length, i18n_uset_h *set); +int i18n_uset_create_pattern(const i18n_uchar *pattern, int32_t pattern_length, i18n_uset_h *set); /** * @brief Creates a set based on a given pattern. @@ -117,7 +117,7 @@ int i18n_uset_create_pattern (const i18n_uchar *pattern, int32_t pattern_length, * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_destroy() */ -int i18n_uset_create_pattern_options (const i18n_uchar *pattern, int32_t pattern_length, uint32_t options, i18n_uset_h *set); +int i18n_uset_create_pattern_options(const i18n_uchar *pattern, int32_t pattern_length, uint32_t options, i18n_uset_h *set); /** * @brief Disposes of the storage used by a #i18n_uset_h object. @@ -130,7 +130,7 @@ int i18n_uset_create_pattern_options (const i18n_uchar *pattern, int32_t pattern * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_destroy (i18n_uset_h set); +int i18n_uset_destroy(i18n_uset_h set); /** * @brief Returns a copy of this object. @@ -146,7 +146,7 @@ int i18n_uset_destroy (i18n_uset_h set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_clone_as_thawed() */ -int i18n_uset_clone (const i18n_uset_h set, i18n_uset_h *set_clone); +int i18n_uset_clone(const i18n_uset_h set, i18n_uset_h *set_clone); /** * @brief Determines whether the set has been frozen (made immutable) or not. @@ -164,7 +164,7 @@ int i18n_uset_clone (const i18n_uset_h set, i18n_uset_h *set_clone); * @see i18n_uset_freeze() * @see i18n_uset_clone_as_thawed() */ -i18n_ubool i18n_uset_is_frozen (const i18n_uset_h set); +i18n_ubool i18n_uset_is_frozen(const i18n_uset_h set); /** * @brief Freezes the set (make it immutable). @@ -185,7 +185,7 @@ i18n_ubool i18n_uset_is_frozen (const i18n_uset_h set); * @see i18n_uset_is_frozen() * @see i18n_uset_clone_as_thawed() */ -int i18n_uset_freeze (i18n_uset_h set); +int i18n_uset_freeze(i18n_uset_h set); /** * @brief Clones the set and make the clone mutable. @@ -202,7 +202,7 @@ int i18n_uset_freeze (i18n_uset_h set); * @see i18n_uset_is_frozen() * @see i18n_uset_clone() */ -int i18n_uset_clone_as_thawed (const i18n_uset_h set, i18n_uset_h *set_copy); +int i18n_uset_clone_as_thawed(const i18n_uset_h set, i18n_uset_h *set_copy); /** * @brief Causes the #i18n_uset_h object to represent the range start - end. @@ -218,7 +218,7 @@ int i18n_uset_clone_as_thawed (const i18n_uset_h set, i18n_uset_h *set_copy); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_set (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +int i18n_uset_set(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Modifies the set to represent the set specified by the given @@ -248,7 +248,7 @@ int i18n_uset_set (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_apply_pattern (i18n_uset_h set, const i18n_uchar *pattern, int32_t pattern_length, uint32_t options); +int32_t i18n_uset_apply_pattern(i18n_uset_h set, const i18n_uchar *pattern, int32_t pattern_length, uint32_t options); /** * @brief Modifies the set to contain those code points which have the given value @@ -271,7 +271,7 @@ int32_t i18n_uset_apply_pattern (i18n_uset_h set, const i18n_uchar *pattern, int * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_apply_int_property_value (i18n_uset_h set, i18n_uchar_uproperty_e prop, int32_t value); +int i18n_uset_apply_int_property_value(i18n_uset_h set, i18n_uchar_uproperty_e prop, int32_t value); /** * @brief Modifies the set to contain those code points which have the @@ -305,7 +305,7 @@ int i18n_uset_apply_int_property_value (i18n_uset_h set, i18n_uchar_uproperty_e * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_apply_property_alias (i18n_uset_h set, const i18n_uchar *prop, int32_t prop_length, const i18n_uchar *value, int32_t value_length); +int i18n_uset_apply_property_alias(i18n_uset_h set, const i18n_uchar *prop, int32_t prop_length, const i18n_uchar *value, int32_t value_length); /** * @brief Return true if the given position, in the given pattern, appears @@ -324,7 +324,7 @@ int i18n_uset_apply_property_alias (i18n_uset_h set, const i18n_uchar *prop, int * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_resembles_pattern (const i18n_uchar *pattern, int32_t pattern_length, int32_t pos); +i18n_ubool i18n_uset_resembles_pattern(const i18n_uchar *pattern, int32_t pattern_length, int32_t pos); /** * @brief Returns a string representation of the given @a set. @@ -347,7 +347,7 @@ i18n_ubool i18n_uset_resembles_pattern (const i18n_uchar *pattern, int32_t patte * * @see i18n_uset_pattern_create() */ -int32_t i18n_uset_to_pattern (const i18n_uset_h set, i18n_uchar *result, int32_t result_capacity, i18n_ubool escape_unprintable); +int32_t i18n_uset_to_pattern(const i18n_uset_h set, i18n_uchar *result, int32_t result_capacity, i18n_ubool escape_unprintable); /** * @brief Adds the given character to the given #i18n_uset_h. @@ -364,7 +364,7 @@ int32_t i18n_uset_to_pattern (const i18n_uset_h set, i18n_uchar *result, int32_t * * @see i18n_uset_contains() */ -int i18n_uset_add (i18n_uset_h set, i18n_uchar32 character); +int i18n_uset_add(i18n_uset_h set, i18n_uchar32 character); /** @@ -383,7 +383,7 @@ int i18n_uset_add (i18n_uset_h set, i18n_uchar32 character); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_add_all (i18n_uset_h set, const i18n_uset_h additional_set); +int i18n_uset_add_all(i18n_uset_h set, const i18n_uset_h additional_set); /** * @brief Adds the given range of characters to the given #i18n_uset_h. After this call, @@ -400,7 +400,7 @@ int i18n_uset_add_all (i18n_uset_h set, const i18n_uset_h additional_set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_contains() */ -int i18n_uset_add_range (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +int i18n_uset_add_range(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Adds the given string to the given #i18n_uset_h. @@ -417,7 +417,7 @@ int i18n_uset_add_range (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_contains_string() */ -int i18n_uset_add_string (i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +int i18n_uset_add_string(i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Adds each of the characters in this string to the set. Thus "ch" => {"c", "h"} @@ -433,7 +433,7 @@ int i18n_uset_add_string (i18n_uset_h set, const i18n_uchar *str, int32_t str_le * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_add_all_code_points (i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +int i18n_uset_add_all_code_points(i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Removes the given @a character from the given #i18n_uset_h. @@ -450,7 +450,7 @@ int i18n_uset_add_all_code_points (i18n_uset_h set, const i18n_uchar *str, int32 * * @see i18n_uset_contains() */ -int i18n_uset_remove (i18n_uset_h set, i18n_uchar32 character); +int i18n_uset_remove(i18n_uset_h set, i18n_uchar32 character); /** * @brief Removes the given range of characters from the given #i18n_uset_h. @@ -467,7 +467,7 @@ int i18n_uset_remove (i18n_uset_h set, i18n_uchar32 character); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_contains() */ -int i18n_uset_remove_range (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +int i18n_uset_remove_range(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Removes the given string to the given #i18n_uset_h. @@ -484,7 +484,7 @@ int i18n_uset_remove_range (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 en * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_uset_contains_string() */ -int i18n_uset_remove_string (i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +int i18n_uset_remove_string(i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Removes from this set all of its elements that are contained in the specified set. @@ -501,7 +501,7 @@ int i18n_uset_remove_string (i18n_uset_h set, const i18n_uchar *str, int32_t str * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_remove_all (i18n_uset_h set, const i18n_uset_h remove_set); +int i18n_uset_remove_all(i18n_uset_h set, const i18n_uset_h remove_set); /** * @brief Retains only the elements in this set that are contained in the specified range. @@ -520,7 +520,7 @@ int i18n_uset_remove_all (i18n_uset_h set, const i18n_uset_h remove_set); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_retain (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +int i18n_uset_retain(i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Retains only the elements in this set that are contained in the @@ -539,7 +539,7 @@ int i18n_uset_retain (i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_retain_all (i18n_uset_h set, const i18n_uset_h retain); +int i18n_uset_retain_all(i18n_uset_h set, const i18n_uset_h retain); /** * @brief Reallocates this objects internal structures to take up the least @@ -553,7 +553,7 @@ int i18n_uset_retain_all (i18n_uset_h set, const i18n_uset_h retain); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_compact (i18n_uset_h set); +int i18n_uset_compact(i18n_uset_h set); /** * @brief Inverts this set. This operation modifies this set so that @@ -569,7 +569,7 @@ int i18n_uset_compact (i18n_uset_h set); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_complement (i18n_uset_h set); +int i18n_uset_complement(i18n_uset_h set); /** * @brief Complements in this set all elements contained in the specified set. @@ -586,7 +586,7 @@ int i18n_uset_complement (i18n_uset_h set); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_complement_all (i18n_uset_h set, const i18n_uset_h complement); +int i18n_uset_complement_all(i18n_uset_h set, const i18n_uset_h complement); /** * @brief Removes all of the elements from this set. @@ -600,7 +600,7 @@ int i18n_uset_complement_all (i18n_uset_h set, const i18n_uset_h complement); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_clear (i18n_uset_h set); +int i18n_uset_clear(i18n_uset_h set); /** * @brief Closes this set over the given attribute. @@ -633,7 +633,7 @@ int i18n_uset_clear (i18n_uset_h set); * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_fold_case() */ -int i18n_uset_destroy_over (i18n_uset_h set, int32_t attributes); +int i18n_uset_destroy_over(i18n_uset_h set, int32_t attributes); /** * @brief Removes all strings from this set. @@ -645,7 +645,7 @@ int i18n_uset_destroy_over (i18n_uset_h set, int32_t attributes); * @retval #I18N_ERROR_NONE Successful * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int i18n_uset_remove_all_strings (i18n_uset_h set); +int i18n_uset_remove_all_strings(i18n_uset_h set); /** * @brief Returns true if the given #i18n_uset_h contains no characters and no @@ -661,7 +661,7 @@ int i18n_uset_remove_all_strings (i18n_uset_h set); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_is_empty (const i18n_uset_h set); +i18n_ubool i18n_uset_is_empty(const i18n_uset_h set); /** * @brief Returns @c true if the given #i18n_uset_h contains the given @a character. @@ -678,7 +678,7 @@ i18n_ubool i18n_uset_is_empty (const i18n_uset_h set); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains (const i18n_uset_h set, i18n_uchar32 character); +i18n_ubool i18n_uset_contains(const i18n_uset_h set, i18n_uchar32 character); /** * @brief Returns true if the given #i18n_uset_h contains all characters c @@ -696,7 +696,7 @@ i18n_ubool i18n_uset_contains (const i18n_uset_h set, i18n_uchar32 character); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_range (const i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); +i18n_ubool i18n_uset_contains_range(const i18n_uset_h set, i18n_uchar32 start, i18n_uchar32 end); /** * @brief Returns true if the given #i18n_uset_h contains the given string. @@ -713,7 +713,7 @@ i18n_ubool i18n_uset_contains_range (const i18n_uset_h set, i18n_uchar32 start, * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_string (const i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +i18n_ubool i18n_uset_contains_string(const i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Returns the index of the given @a character within this @a set, where @@ -732,7 +732,7 @@ i18n_ubool i18n_uset_contains_string (const i18n_uset_h set, const i18n_uchar *s * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_index_of (const i18n_uset_h set, i18n_uchar32 character); +int32_t i18n_uset_index_of(const i18n_uset_h set, i18n_uchar32 character); /** * @brief Returns the character at the given index within this set, where @@ -751,7 +751,7 @@ int32_t i18n_uset_index_of (const i18n_uset_h set, i18n_uchar32 character); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar32 i18n_uset_char_at (const i18n_uset_h set, int32_t char_index); +i18n_uchar32 i18n_uset_char_at(const i18n_uset_h set, int32_t char_index); /** * @brief Returns the number of characters and strings contained in the given #i18n_uset_h. @@ -767,7 +767,7 @@ i18n_uchar32 i18n_uset_char_at (const i18n_uset_h set, int32_t char_index); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_size (const i18n_uset_h set); +int32_t i18n_uset_size(const i18n_uset_h set); /** * @brief Returns the number of items in this set. @@ -784,7 +784,7 @@ int32_t i18n_uset_size (const i18n_uset_h set); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_get_item_count (const i18n_uset_h set); +int32_t i18n_uset_get_item_count(const i18n_uset_h set); /** * @brief Returns an item of this set. @@ -809,7 +809,7 @@ int32_t i18n_uset_get_item_count (const i18n_uset_h set); * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_uset_get_item (const i18n_uset_h set, int32_t item_index, i18n_uchar32 *start, i18n_uchar32 *end, i18n_uchar *str, int32_t str_capacity); +int32_t i18n_uset_get_item(const i18n_uset_h set, int32_t item_index, i18n_uchar32 *start, i18n_uchar32 *end, i18n_uchar *str, int32_t str_capacity); /** * @brief Returns true if set1 contains all the characters and strings of set2. It answers the question, 'Is set1 a superset of set2?' @@ -825,7 +825,7 @@ int32_t i18n_uset_get_item (const i18n_uset_h set, int32_t item_index, i18n_ucha * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_all (const i18n_uset_h set1, const i18n_uset_h set2); +i18n_ubool i18n_uset_contains_all(const i18n_uset_h set1, const i18n_uset_h set2); /** * @brief Returns true if this set contains all the characters of the given string. @@ -844,7 +844,7 @@ i18n_ubool i18n_uset_contains_all (const i18n_uset_h set1, const i18n_uset_h set * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_all_code_points (const i18n_uset_h set, const i18n_uchar *str, int32_t str_len); +i18n_ubool i18n_uset_contains_all_code_points(const i18n_uset_h set, const i18n_uchar *str, int32_t str_len); /** * @brief Returns true if set1 contains none of the characters and strings of set2. @@ -861,7 +861,7 @@ i18n_ubool i18n_uset_contains_all_code_points (const i18n_uset_h set, const i18n * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_none (const i18n_uset_h set1, const i18n_uset_h set2); +i18n_ubool i18n_uset_contains_none(const i18n_uset_h set1, const i18n_uset_h set2); /** * @brief Returns true if set1 contains some of the characters and strings of set2. @@ -878,7 +878,7 @@ i18n_ubool i18n_uset_contains_none (const i18n_uset_h set1, const i18n_uset_h se * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_contains_some (const i18n_uset_h set1, const i18n_uset_h set2); +i18n_ubool i18n_uset_contains_some(const i18n_uset_h set1, const i18n_uset_h set2); /** * @brief Returns the length of the initial substring of the input string which @@ -907,7 +907,7 @@ i18n_ubool i18n_uset_contains_some (const i18n_uset_h set1, const i18n_uset_h se * * @see #i18n_uset_span_condition_e */ -int32_t i18n_uset_span (const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition); +int32_t i18n_uset_span(const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition); /** * @brief Returns the start of the trailing substring of the input string which @@ -935,7 +935,7 @@ int32_t i18n_uset_span (const i18n_uset_h set, const i18n_uchar *str, int32_t le * * @see #i18n_uset_span_condition_e */ -int32_t i18n_uset_span_back (const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition); +int32_t i18n_uset_span_back(const i18n_uset_h set, const i18n_uchar *str, int32_t length, i18n_uset_span_condition_e span_condition); /** * @brief Returns the length of the initial substring of the input string which @@ -964,7 +964,7 @@ int32_t i18n_uset_span_back (const i18n_uset_h set, const i18n_uchar *str, int32 * * @see #i18n_uset_span_condition_e */ -int32_t i18n_uset_span_utf8 (const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition); +int32_t i18n_uset_span_utf8(const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition); /** * @brief Returns the start of the trailing substring of the input string which @@ -992,7 +992,7 @@ int32_t i18n_uset_span_utf8 (const i18n_uset_h set, const char *str, int32_t len * * @see #i18n_uset_span_condition_e */ -int32_t i18n_uset_span_back_utf8 (const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition); +int32_t i18n_uset_span_back_utf8(const i18n_uset_h set, const char *str, int32_t length, i18n_uset_span_condition_e span_condition); /** * @brief Returns true if set1 contains all of the characters and strings @@ -1009,7 +1009,7 @@ int32_t i18n_uset_span_back_utf8 (const i18n_uset_h set, const char *str, int32_ * @exception #I18N_ERROR_NONE Successful * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_uset_equals (const i18n_uset_h set1, const i18n_uset_h set2); +i18n_ubool i18n_uset_equals(const i18n_uset_h set1, const i18n_uset_h set2); /********************************************************************* * Serialized set API @@ -1070,7 +1070,7 @@ i18n_ubool i18n_uset_equals (const i18n_uset_h set1, const i18n_uset_h set2); * @exception #I18N_ERROR_INDEX_OUTOFBOUNDS If n+2*m > 0x7FFF * @exception #I18N_ERROR_BUFFER_OVERFLOW If n+2*m+(m != 0 ? 2 : 1) > dest_capacity. */ -int32_t i18n_uset_serialize (const i18n_uset_h set, uint16_t *dest, int32_t dest_capacity); +int32_t i18n_uset_serialize(const i18n_uset_h set, uint16_t *dest, int32_t dest_capacity); /** * @brief Given a serialized array, fill in the given serialized set object. @@ -1089,7 +1089,7 @@ int32_t i18n_uset_serialize (const i18n_uset_h set, uint16_t *dest, int32_t dest * * @see #i18n_userialized_set_s */ -i18n_ubool i18n_uset_get_serialized_set (const uint16_t *src, int32_t src_length, i18n_userialized_set_s* fill_set); +i18n_ubool i18n_uset_get_serialized_set(const uint16_t *src, int32_t src_length, i18n_userialized_set_s* fill_set); /** * @brief Sets the #i18n_userialized_set_s to contain the given @a character (and nothing else). @@ -1104,7 +1104,7 @@ i18n_ubool i18n_uset_get_serialized_set (const uint16_t *src, int32_t src_length * * @see #i18n_userialized_set_s */ -int i18n_uset_set_serialized_to_one (i18n_uchar32 character, i18n_userialized_set_s* fill_set); +int i18n_uset_set_serialized_to_one(i18n_uchar32 character, i18n_userialized_set_s* fill_set); /** * @brief Returns @c true if the given #i18n_userialized_set_s contains the given @a character. @@ -1121,7 +1121,7 @@ int i18n_uset_set_serialized_to_one (i18n_uchar32 character, i18n_userialized_se * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see #i18n_userialized_set_s */ -i18n_ubool i18n_uset_serialized_contains (const i18n_userialized_set_s* set, i18n_uchar32 character); +i18n_ubool i18n_uset_serialized_contains(const i18n_userialized_set_s* set, i18n_uchar32 character); /** * @brief Returns the number of disjoint ranges of characters contained in @@ -1139,7 +1139,7 @@ i18n_ubool i18n_uset_serialized_contains (const i18n_userialized_set_s* set, i18 * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see #i18n_userialized_set_s */ -int32_t i18n_uset_get_serialized_range_count (const i18n_userialized_set_s* set); +int32_t i18n_uset_get_serialized_range_count(const i18n_userialized_set_s* set); /** * @brief Returns a range of characters contained in the given serialized set. @@ -1161,7 +1161,7 @@ int32_t i18n_uset_get_serialized_range_count (const i18n_userialized_set_s* set) * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see #i18n_userialized_set_s */ -i18n_ubool i18n_uset_get_serialized_range (const i18n_userialized_set_s* set, int32_t range_index, i18n_uchar32 *p_start, i18n_uchar32 *p_end); +i18n_ubool i18n_uset_get_serialized_range(const i18n_userialized_set_s* set, int32_t range_index, i18n_uchar32 *p_start, i18n_uchar32 *p_end); /** * @} diff --git a/src/include/wearable/utils_i18n_ustring.h b/src/include/wearable/utils_i18n_ustring.h index 4e67aa0..92d5ae0 100755 --- a/src/include/wearable/utils_i18n_ustring.h +++ b/src/include/wearable/utils_i18n_ustring.h @@ -83,7 +83,7 @@ extern "C" { * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_get_length ( const i18n_uchar *s ); +int32_t i18n_ustring_get_length(const i18n_uchar *s); /** * @brief Counts Unicode code points in the length #i18n_uchar code units of the string. @@ -101,7 +101,7 @@ int32_t i18n_ustring_get_length ( const i18n_uchar *s ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_count_char32 ( const i18n_uchar *s, int32_t length ); +int32_t i18n_ustring_count_char32(const i18n_uchar *s, int32_t length); /** * @brief Checks if the string contains more Unicode code points than a certain number. @@ -122,7 +122,7 @@ int32_t i18n_ustring_count_char32 ( const i18n_uchar *s, int32_t length ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_ubool i18n_ustring_has_more_char32_than ( const i18n_uchar *s, int32_t length, int32_t number ); +i18n_ubool i18n_ustring_has_more_char32_than(const i18n_uchar *s, int32_t length, int32_t number); /** * @brief Concatenates two ustrings. @@ -139,7 +139,7 @@ i18n_ubool i18n_ustring_has_more_char32_than ( const i18n_uchar *s, int32_t leng * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_cat ( i18n_uchar *dest, const i18n_uchar *src ); +i18n_uchar* i18n_ustring_cat(i18n_uchar *dest, const i18n_uchar *src); /** * @brief Concatenate two ustrings. @@ -157,7 +157,7 @@ i18n_uchar* i18n_ustring_cat ( i18n_uchar *dest, const i18n_uchar *src ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_cat_n ( i18n_uchar *dest, const i18n_uchar *src, int32_t n ); +i18n_uchar* i18n_ustring_cat_n(i18n_uchar *dest, const i18n_uchar *src, int32_t n); /** * @brief Finds the first occurrence of a substring in a string. @@ -182,7 +182,7 @@ i18n_uchar* i18n_ustring_cat_n ( i18n_uchar *dest, const i18n_uchar *src, int32_ * @see i18n_ustring_find_first() * @see i18n_ustring_find_last() */ -i18n_uchar* i18n_ustring_string ( const i18n_uchar *s, const i18n_uchar *sub_string ); +i18n_uchar* i18n_ustring_string(const i18n_uchar *s, const i18n_uchar *sub_string); /** * @brief Finds the first occurrence of a substring in a string. @@ -208,7 +208,7 @@ i18n_uchar* i18n_ustring_string ( const i18n_uchar *s, const i18n_uchar *sub_str * @see i18n_ustring_string() * @see i18n_ustring_find_last() */ -i18n_uchar* i18n_ustring_find_first ( const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length ); +i18n_uchar* i18n_ustring_find_first(const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length); /** * @brief Finds the first occurrence of a BMP code point in a string. @@ -229,7 +229,7 @@ i18n_uchar* i18n_ustring_find_first ( const i18n_uchar *s, int32_t length, const * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_char ( const i18n_uchar *s, i18n_uchar c ); +i18n_uchar* i18n_ustring_char(const i18n_uchar *s, i18n_uchar c); /** * @brief Finds the first occurrence of a code point in a string. @@ -250,7 +250,7 @@ i18n_uchar* i18n_ustring_char ( const i18n_uchar *s, i18n_uchar c ); * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_char32 ( const i18n_uchar *s, i18n_uchar32 c ); +i18n_uchar* i18n_ustring_char32(const i18n_uchar *s, i18n_uchar32 c); /** * @brief Finds the last occurrence of a substring in a string. @@ -273,7 +273,7 @@ i18n_uchar* i18n_ustring_char32 ( const i18n_uchar *s, i18n_uchar32 c ); * @see i18n_ustring_find_first() * @see i18n_ustring_find_last() */ -i18n_uchar* i18n_ustring_r_string ( const i18n_uchar *s, const i18n_uchar *sub_string ); +i18n_uchar* i18n_ustring_r_string(const i18n_uchar *s, const i18n_uchar *sub_string); /** * @brief Finds the last occurrence of a substring in a string. @@ -297,7 +297,7 @@ i18n_uchar* i18n_ustring_r_string ( const i18n_uchar *s, const i18n_uchar *sub_s * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_find_last( const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length ); +i18n_uchar* i18n_ustring_find_last(const i18n_uchar *s, int32_t length, const i18n_uchar *sub_string, int32_t sub_length); /** * @brief Finds the last occurrence of a BMP code point in a string. @@ -318,7 +318,7 @@ i18n_uchar* i18n_ustring_find_last( const i18n_uchar *s, int32_t length, const i * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_r_char ( const i18n_uchar *s, i18n_uchar c ); +i18n_uchar* i18n_ustring_r_char(const i18n_uchar *s, i18n_uchar c); /** * @brief Finds the last occurrence of a code point in a string. @@ -339,7 +339,7 @@ i18n_uchar* i18n_ustring_r_char ( const i18n_uchar *s, i18n_uchar c ); * @see i18n_ustring_string() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_r_char32 ( const i18n_uchar *s, i18n_uchar32 c ); +i18n_uchar* i18n_ustring_r_char32(const i18n_uchar *s, i18n_uchar32 c); /** * @brief Locates the first occurrence in the string of any of the characters in the string matchSet. @@ -356,7 +356,7 @@ i18n_uchar* i18n_ustring_r_char32 ( const i18n_uchar *s, i18n_uchar32 c ); * @return A pointer to the character in @a string that matches one of the * characters in @a match_set, or NULL if no such character is found. */ -i18n_uchar* i18n_ustring_pbrk ( const i18n_uchar *string, const i18n_uchar *match_set ); +i18n_uchar* i18n_ustring_pbrk(const i18n_uchar *string, const i18n_uchar *match_set); /** * @brief Returns the number of consecutive characters in string, beginning with the first, that do not occur somewhere in match_set. @@ -373,7 +373,7 @@ i18n_uchar* i18n_ustring_pbrk ( const i18n_uchar *string, const i18n_uchar *matc * @return The number of initial characters in @a string that do not * occur in @a match_set. */ -int32_t i18n_ustring_cspn ( const i18n_uchar *string, const i18n_uchar *match_set ); +int32_t i18n_ustring_cspn(const i18n_uchar *string, const i18n_uchar *match_set); /** * @brief Returns the number of consecutive characters in string, beginning with the first, that occur somewhere in match_set. @@ -390,7 +390,7 @@ int32_t i18n_ustring_cspn ( const i18n_uchar *string, const i18n_uchar *match_se * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_spn() */ -int32_t i18n_ustring_spn ( const i18n_uchar *string, const i18n_uchar *match_set ); +int32_t i18n_ustring_spn(const i18n_uchar *string, const i18n_uchar *match_set); /** * @brief The string tokenizer API allows an application to break a string into tokens. @@ -408,7 +408,7 @@ int32_t i18n_ustring_spn ( const i18n_uchar *string, const i18n_uchar *match_set * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_tokenizer_r ( i18n_uchar *src, const i18n_uchar *delim, i18n_uchar **save_state ); +i18n_uchar* i18n_ustring_tokenizer_r(i18n_uchar *src, const i18n_uchar *delim, i18n_uchar **save_state); /** * @brief Compares two Unicode strings for bitwise equality (code unit order). @@ -424,7 +424,7 @@ i18n_uchar* i18n_ustring_tokenizer_r ( i18n_uchar *src, const i18n_uchar *delim, * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare ( const i18n_uchar *s1, const i18n_uchar *s2 ); +int32_t i18n_ustring_compare(const i18n_uchar *s1, const i18n_uchar *s2); /** * @brief Compare two Unicode strings in code point order. @@ -441,7 +441,7 @@ int32_t i18n_ustring_compare ( const i18n_uchar *s1, const i18n_uchar *s2 ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare_code_point_order( const i18n_uchar *s1, const i18n_uchar *s2 ); +int32_t i18n_ustring_compare_code_point_order(const i18n_uchar *s1, const i18n_uchar *s2); /** * @brief Compare two Unicode strings (binary order). @@ -463,7 +463,7 @@ int32_t i18n_ustring_compare_code_point_order( const i18n_uchar *s1, const i18n_ * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare_binary_order( const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, i18n_ubool code_point_order ); +int32_t i18n_ustring_compare_binary_order(const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, i18n_ubool code_point_order); /** * @brief Compare two strings case-insensitively using full case folding. @@ -488,7 +488,7 @@ int32_t i18n_ustring_compare_binary_order( const i18n_uchar *s1, int32_t length1 * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_case_compare_with_length( const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, uint32_t options, i18n_error_code_e *error_code ); +int32_t i18n_ustring_case_compare_with_length(const i18n_uchar *s1, int32_t length1, const i18n_uchar *s2, int32_t length2, uint32_t options, i18n_error_code_e *error_code); /** * @brief Compare two ustrings for bitwise equality. @@ -506,7 +506,7 @@ int32_t i18n_ustring_case_compare_with_length( const i18n_uchar *s1, int32_t len * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, int32_t n ); +int32_t i18n_ustring_compare_n(const i18n_uchar *s1, const i18n_uchar *s2, int32_t n); /** * @brief Compare two Unicode strings in code point order. @@ -524,7 +524,7 @@ int32_t i18n_ustring_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, int3 * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_compare_n_code_point_order( const i18n_uchar *s1, const i18n_uchar *s2, int32_t n ); +int32_t i18n_ustring_compare_n_code_point_order(const i18n_uchar *s1, const i18n_uchar *s2, int32_t n); /** * @brief Compare two strings case-insensitively using full case folding. @@ -542,7 +542,7 @@ int32_t i18n_ustring_compare_n_code_point_order( const i18n_uchar *s1, const i18 * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_case_compare( const i18n_uchar *s1, const i18n_uchar *s2, uint32_t options ); +int32_t i18n_ustring_case_compare(const i18n_uchar *s1, const i18n_uchar *s2, uint32_t options); /** * @brief Compare two strings case-insensitively using full case folding. @@ -561,7 +561,7 @@ int32_t i18n_ustring_case_compare( const i18n_uchar *s1, const i18n_uchar *s2, u * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_case_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, int32_t n, uint32_t options ); +int32_t i18n_ustring_case_compare_n(const i18n_uchar *s1, const i18n_uchar *s2, int32_t n, uint32_t options); /** * @brief Compare two strings case-insensitively using full case folding. @@ -580,7 +580,7 @@ int32_t i18n_ustring_case_compare_n( const i18n_uchar *s1, const i18n_uchar *s2, * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_mem_case_compare( const i18n_uchar *s1, const i18n_uchar *s2, int32_t length, uint32_t options ); +int32_t i18n_ustring_mem_case_compare(const i18n_uchar *s1, const i18n_uchar *s2, int32_t length, uint32_t options); /** * @brief Copies a ustring. Adds a NULL terminator. @@ -595,7 +595,7 @@ int32_t i18n_ustring_mem_case_compare( const i18n_uchar *s1, const i18n_uchar *s * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_copy ( i18n_uchar *dest, const i18n_uchar *src ); +i18n_uchar* i18n_ustring_copy(i18n_uchar *dest, const i18n_uchar *src); /** * @brief Copies a ustring. @@ -613,7 +613,7 @@ i18n_uchar* i18n_ustring_copy ( i18n_uchar *dest, const i18n_uchar *src ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_copy_n ( i18n_uchar *dest, const i18n_uchar *src, int32_t n ); +i18n_uchar* i18n_ustring_copy_n(i18n_uchar *dest, const i18n_uchar *src, int32_t n); /** * @brief Copies a byte string encoded in the default codepage to a ustring. @@ -629,7 +629,7 @@ i18n_uchar* i18n_ustring_copy_n ( i18n_uchar *dest, const i18n_uchar *src, int32 * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_copy_ua ( i18n_uchar *dest, const char *src ); +i18n_uchar* i18n_ustring_copy_ua(i18n_uchar *dest, const char *src); /** * @brief Copies a byte string encoded in the default codepage to a ustring. @@ -648,7 +648,7 @@ i18n_uchar* i18n_ustring_copy_ua ( i18n_uchar *dest, const char *src ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_copy_ua_n ( i18n_uchar *dest, const char *src, int32_t n ); +i18n_uchar* i18n_ustring_copy_ua_n(i18n_uchar *dest, const char *src, int32_t n); /** * @brief Copies a ustring to a byte string encoded in the default codepage. @@ -664,7 +664,7 @@ i18n_uchar* i18n_ustring_copy_ua_n ( i18n_uchar *dest, const char *src, int32_t * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -char* i18n_ustring_copy_au ( char *dest, const i18n_uchar *src ); +char* i18n_ustring_copy_au(char *dest, const i18n_uchar *src); /** * @brief Copies a ustring to a byte string encoded in the default codepage. @@ -683,7 +683,7 @@ char* i18n_ustring_copy_au ( char *dest, const i18n_uchar *src ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -char* i18n_ustring_copy_au_n ( char *dest, const i18n_uchar *src, int32_t n ); +char* i18n_ustring_copy_au_n(char *dest, const i18n_uchar *src, int32_t n); /** * @brief Synonym for memcpy(), but with #i18n_uchar characters only. @@ -699,7 +699,7 @@ char* i18n_ustring_copy_au_n ( char *dest, const i18n_uchar *src, int32_t n ); * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_mem_copy ( i18n_uchar *dest, const i18n_uchar *src, int32_t count ); +i18n_uchar* i18n_ustring_mem_copy(i18n_uchar *dest, const i18n_uchar *src, int32_t count); /** * @brief Synonym for memmove(), but with #i18n_uchar characters only. @@ -715,7 +715,7 @@ i18n_uchar* i18n_ustring_mem_copy ( i18n_uchar *dest, const i18n_uchar *src, int * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_mem_move ( i18n_uchar *dest, const i18n_uchar *src, int32_t count ); +i18n_uchar* i18n_ustring_mem_move(i18n_uchar *dest, const i18n_uchar *src, int32_t count); /** * @brief Initialize count characters of dest to c. @@ -731,7 +731,7 @@ i18n_uchar* i18n_ustring_mem_move ( i18n_uchar *dest, const i18n_uchar *src, int * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_mem_set ( i18n_uchar *dest, const i18n_uchar c, int32_t count ); +i18n_uchar* i18n_ustring_mem_set(i18n_uchar *dest, const i18n_uchar c, int32_t count); /** * @brief Compare the first count #i18n_uchar characters of each buffer. @@ -748,7 +748,7 @@ i18n_uchar* i18n_ustring_mem_set ( i18n_uchar *dest, const i18n_uchar c, int32_t * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_mem_compare ( const i18n_uchar *buf1, const i18n_uchar *buf2, int32_t count ); +int32_t i18n_ustring_mem_compare(const i18n_uchar *buf1, const i18n_uchar *buf2, int32_t count); /** * @brief Compare two Unicode strings in code point order. @@ -766,7 +766,7 @@ int32_t i18n_ustring_mem_compare ( const i18n_uchar *buf1, const i18n_uchar *buf * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_mem_compare_code_point_order ( const i18n_uchar *s1, const i18n_uchar *s2, int32_t count ); +int32_t i18n_ustring_mem_compare_code_point_order(const i18n_uchar *s1, const i18n_uchar *s2, int32_t count); /** * @brief Finds the first occurrence of a BMP code point in a string. @@ -786,7 +786,7 @@ int32_t i18n_ustring_mem_compare_code_point_order ( const i18n_uchar *s1, const * @see i18n_ustring_mem_char32() * @see i18n_ustring_find_first() */ -i18n_uchar* i18n_ustring_mem_char ( const i18n_uchar *s, i18n_uchar c, int32_t count ); +i18n_uchar* i18n_ustring_mem_char(const i18n_uchar *s, i18n_uchar c, int32_t count); /** * @brief Finds the first occurrence of a code point in a string. @@ -803,7 +803,7 @@ i18n_uchar* i18n_ustring_mem_char ( const i18n_uchar *s, i18n_uchar c, int32_t c * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_mem_char32 ( const i18n_uchar *s, i18n_uchar32 c, int32_t count ); +i18n_uchar* i18n_ustring_mem_char32(const i18n_uchar *s, i18n_uchar32 c, int32_t count); /** * @brief Finds the last occurrence of a BMP code point in a string. @@ -823,7 +823,7 @@ i18n_uchar* i18n_ustring_mem_char32 ( const i18n_uchar *s, i18n_uchar32 c, int32 * @see #i18n_ustring_mem_r_char32 * @see #i18n_ustring_find_last */ -i18n_uchar* i18n_ustring_mem_r_char ( const i18n_uchar *s, i18n_uchar c, int32_t count ); +i18n_uchar* i18n_ustring_mem_r_char(const i18n_uchar *s, i18n_uchar c, int32_t count); /** * @brief Finds the last occurrence of a code point in a string. @@ -843,7 +843,7 @@ i18n_uchar* i18n_ustring_mem_r_char ( const i18n_uchar *s, i18n_uchar c, int32_t * @see #i18n_ustring_mem_r_char * @see #i18n_ustring_find_last */ -i18n_uchar* i18n_ustring_mem_r_char32 ( const i18n_uchar *s, i18n_uchar32 c, int32_t count ); +i18n_uchar* i18n_ustring_mem_r_char32(const i18n_uchar *s, i18n_uchar32 c, int32_t count); /** * @brief Unescape a string of characters and write the resulting Unicode characters to the destination buffer. @@ -866,7 +866,7 @@ i18n_uchar* i18n_ustring_mem_r_char32 ( const i18n_uchar *s, i18n_uchar32 c, int * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_unescape_at() */ -int32_t i18n_ustring_unescape ( const char *src, i18n_uchar *dest, int32_t dest_capacity ); +int32_t i18n_ustring_unescape(const char *src, i18n_uchar *dest, int32_t dest_capacity); /** * @brief Unescape a single sequence. @@ -890,7 +890,7 @@ int32_t i18n_ustring_unescape ( const char *src, i18n_uchar *dest, int32_t dest_ * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_unescape() */ -i18n_uchar32 i18n_ustring_unescape_at ( i18n_ustring_unescape_char_at_cb char_at, int32_t *offset, int32_t length, void *context ); +i18n_uchar32 i18n_ustring_unescape_at(i18n_ustring_unescape_char_at_cb char_at, int32_t *offset, int32_t length, void *context); /** * @brief Uppercases the characters in a string. @@ -915,7 +915,7 @@ i18n_uchar32 i18n_ustring_unescape_at ( i18n_ustring_unescape_char_at_cb char_at * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_to_upper ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *error_code ); +int32_t i18n_ustring_to_upper(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *error_code); /** * @brief Lowercase the characters in a string. @@ -938,7 +938,7 @@ int32_t i18n_ustring_to_upper ( i18n_uchar *dest, int32_t dest_capacity, const i * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_to_lower ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *error_code ); +int32_t i18n_ustring_to_lower(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, const char *locale, i18n_error_code_e *error_code); /** * @brief Titlecases a string. @@ -978,7 +978,7 @@ int32_t i18n_ustring_to_lower ( i18n_uchar *dest, int32_t dest_capacity, const i * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_to_title() */ -int32_t i18n_ustring_to_title_new ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, i18n_ubreak_iterator_h title_iter, const char *locale); +int32_t i18n_ustring_to_title_new(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, i18n_ubreak_iterator_h title_iter, const char *locale); /** * @brief Case-folds the characters in a string. @@ -1003,7 +1003,7 @@ int32_t i18n_ustring_to_title_new ( i18n_uchar *dest, int32_t dest_capacity, con * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -int32_t i18n_ustring_fold_case ( i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, uint32_t options, i18n_error_code_e *error_code ); +int32_t i18n_ustring_fold_case(i18n_uchar *dest, int32_t dest_capacity, const i18n_uchar *src, int32_t src_len, uint32_t options, i18n_error_code_e *error_code); /** * @brief Convert a UTF-16 string to a wchar_t string. @@ -1025,7 +1025,7 @@ int32_t i18n_ustring_fold_case ( i18n_uchar *dest, int32_t dest_capacity, const * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -wchar_t* i18n_ustring_to_WCS ( wchar_t *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code ); +wchar_t* i18n_ustring_to_WCS(wchar_t *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a wchar_t string to UTF-16. @@ -1047,7 +1047,7 @@ wchar_t* i18n_ustring_to_WCS ( wchar_t *dest, int32_t dest_capacity, int32_t *de * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_from_WCS ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const wchar_t *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_WCS(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const wchar_t *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Converts a UTF-16 string to UTF-8. @@ -1073,7 +1073,7 @@ i18n_uchar* i18n_ustring_from_WCS ( i18n_uchar *dest, int32_t dest_capacity, int * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter * @see i18n_ustring_from_UTF8() */ -char* i18n_ustring_to_UTF8 ( char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code ); +char* i18n_ustring_to_UTF8(char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Converts a UTF-8 string to UTF-16. @@ -1098,7 +1098,7 @@ char* i18n_ustring_to_UTF8 ( char *dest, int32_t dest_capacity, int32_t *dest_le * @exception #I18N_ERROR_NONE Success * @exception #I18N_ERROR_INVALID_PARAMETER Invalid function parameter */ -i18n_uchar* i18n_ustring_from_UTF8 ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF8(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a UTF-16 string to UTF-8. @@ -1129,7 +1129,7 @@ i18n_uchar* i18n_ustring_from_UTF8 ( i18n_uchar *dest, int32_t dest_capacity, in * @see i18n_ustring_to_UTF8() * @see i18n_ustring_from_UTF8_with_sub() */ -char* i18n_ustring_to_UTF8_with_sub ( char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code ); +char* i18n_ustring_to_UTF8_with_sub(char *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code); /** * @brief Convert a UTF-8 string to UTF-16. @@ -1160,8 +1160,8 @@ char* i18n_ustring_to_UTF8_with_sub ( char *dest, int32_t dest_capacity, int32_t * @see i18n_ustring_from_UTF8_lenient() * @see i18n_ustring_to_UTF8_with_sub() */ -i18n_uchar* i18n_ustring_from_UTF8_with_sub ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_uchar32 sub_char, - int32_t *num_substitutions, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF8_with_sub(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_uchar32 sub_char, + int32_t *num_substitutions, i18n_error_code_e *error_code); /** * @brief Convert a UTF-8 string to UTF-16. @@ -1199,7 +1199,7 @@ i18n_uchar* i18n_ustring_from_UTF8_with_sub ( i18n_uchar *dest, int32_t dest_cap * @see i18n_ustring_to_UTF8_with_sub() * @see i18n_ustring_from_UTF8_with_sub() */ -i18n_uchar* i18n_ustring_from_UTF8_lenient ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF8_lenient(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const char *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a UTF-16 string to UTF-32. @@ -1225,7 +1225,7 @@ i18n_uchar* i18n_ustring_from_UTF8_lenient ( i18n_uchar *dest, int32_t dest_capa * @see i18n_ustring_to_UTF32_with_sub() * @see i18n_ustring_from_UTF32() */ -i18n_uchar32* i18n_ustring_to_UTF32 ( i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar32* i18n_ustring_to_UTF32(i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a UTF-32 string to UTF-16. @@ -1251,7 +1251,7 @@ i18n_uchar32* i18n_ustring_to_UTF32 ( i18n_uchar32 *dest, int32_t dest_capacity, * @see i18n_ustring_from_UTF32_with_sub() * @see i18n_ustring_to_UTF32() */ -i18n_uchar* i18n_ustring_from_UTF32 ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF32(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_error_code_e *error_code); /** * @brief Convert a UTF-16 string to UTF-32. @@ -1281,8 +1281,8 @@ i18n_uchar* i18n_ustring_from_UTF32 ( i18n_uchar *dest, int32_t dest_capacity, i * @see i18n_ustring_to_UTF32() * @see i18n_ustring_from_UTF32_with_sub() */ -i18n_uchar32* i18n_ustring_to_UTF32_with_sub ( i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, - i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code ); +i18n_uchar32* i18n_ustring_to_UTF32_with_sub(i18n_uchar32 *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar *src, int32_t src_len, + i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code); /** * @brief Convert a UTF-32 string to UTF-16. @@ -1313,7 +1313,7 @@ i18n_uchar32* i18n_ustring_to_UTF32_with_sub ( i18n_uchar32 *dest, int32_t dest_ * @see i18n_ustring_from_UTF32() * @see i18n_ustring_to_UTF32_with_sub() */ -i18n_uchar* i18n_ustring_from_UTF32_with_sub ( i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code ); +i18n_uchar* i18n_ustring_from_UTF32_with_sub(i18n_uchar *dest, int32_t dest_capacity, int32_t *dest_len, const i18n_uchar32 *src, int32_t src_len, i18n_uchar32 sub_char, int32_t *num_substitutions, i18n_error_code_e *error_code); #ifdef __cplusplus } -- 2.7.4 From 586a2eb10daf08b32a17a05e522d7ca81a0ac833 Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Tue, 12 Apr 2016 09:35:09 +0900 Subject: [PATCH 15/16] Fix build break Change-Id: Ibcc53fd40ff5138c12918f85604c15ea0603cb6f --- src/include/mobile/utils_i18n_types.h | 2 +- src/include/mobile/utils_i18n_ucollator.h | 4 ++-- src/include/wearable/utils_i18n_ucollator.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/mobile/utils_i18n_types.h b/src/include/mobile/utils_i18n_types.h index 15af948..7fa2b7a 100644 --- a/src/include/mobile/utils_i18n_types.h +++ b/src/include/mobile/utils_i18n_types.h @@ -1592,7 +1592,7 @@ typedef struct { * @brief Handle to struct representing a range of text containing a specific field. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ -typedef i18n_ufield_position_s *18n_ufield_position_h; +typedef i18n_ufield_position_s *i18n_ufield_position_h; /** * @brief Enumeration for the possible date/time format styles. diff --git a/src/include/mobile/utils_i18n_ucollator.h b/src/include/mobile/utils_i18n_ucollator.h index 5959403..a0be21a 100755 --- a/src/include/mobile/utils_i18n_ucollator.h +++ b/src/include/mobile/utils_i18n_ucollator.h @@ -92,7 +92,7 @@ extern "C" { // compares and sorts in ascending order if (ret == I18N_ERROR_NONE) { - i18n_ucollator_set_strength( coll, I18N_UCOLLATOR_TERTIARY ); + i18n_ucollator_set_strength(coll, I18N_UCOLLATOR_TERTIARY); for (i = 0; i < 2; i++) { for (j = 0; j < 2 - i; j++) { i18n_ustring_copy_ua(buf_01, src[j]); @@ -113,7 +113,7 @@ extern "C" { i18n_ucollator_destroy( coll ); // deallocate memory for collator for (i = 0; i < sizeof(src) / sizeof(src[0]); i++) { - dlog_print(DLOG_INFO, LOG_TAG, "%s\n", src[i] ); + dlog_print(DLOG_INFO, LOG_TAG, "%s\n", src[i]); } // ariplane banana cat * @endcode */ diff --git a/src/include/wearable/utils_i18n_ucollator.h b/src/include/wearable/utils_i18n_ucollator.h index d492ffd..a0be21a 100755 --- a/src/include/wearable/utils_i18n_ucollator.h +++ b/src/include/wearable/utils_i18n_ucollator.h @@ -88,7 +88,7 @@ extern "C" { } // cat banana airplane // creates a collator - ret = i18n_ucollator_create( "en_US", &coll ); + ret = i18n_ucollator_create("en_US", &coll); // compares and sorts in ascending order if (ret == I18N_ERROR_NONE) { -- 2.7.4 From 2513dab93693ff925998f858e86606ca17ce3b09 Mon Sep 17 00:00:00 2001 From: ByungWoo Lee Date: Tue, 12 Apr 2016 09:35:43 +0900 Subject: [PATCH 16/16] Update version - 1.2.3 Change-Id: I9d9f23c5f0b379b54e927c3fc519b3f35ec5c40f --- packaging/capi-base-utils.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-base-utils.spec b/packaging/capi-base-utils.spec index 8fbf2de..b3c278c 100755 --- a/packaging/capi-base-utils.spec +++ b/packaging/capi-base-utils.spec @@ -1,6 +1,6 @@ Name: capi-base-utils Summary: Base Utils -Version: 1.2.2 +Version: 1.2.3 Release: 1 Group: Base License: Apache-2.0 and ICU -- 2.7.4