/**
* @brief This value is intended for sentinel values for APIs that take or return single code points (#i18n_uchar32).
* @details It is outside of the Unicode code point range 0..0x10ffff. For example, a "done" or "error" value in a new
- * API could be indicated with #I18N_SENTINEL.
+ * API could be indicated with #I18N_SENTINEL.
* @since_tizen 4.0
*/
#define I18N_SENTINEL (-1)
* @{
*/
-#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_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) /**< U_GC_XX_MASK constants are bit flags corresponding to Unicode general category values. @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif*/
#define I18N_U_GC_LU_MASK I18N_U_MASK(I18N_UCHAR_U_UPPERCASE_LETTER) /**< Mask constant for a #i18n_uchar_category_e. @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif*/
I18N_UCHAR_UBLOCK_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS, /**< Arabic Mathematical Alphabetic Symbols (Since 4.0) */
I18N_UCHAR_UBLOCK_CHAKMA, /**< Chakma (Since 4.0) */
I18N_UCHAR_UBLOCK_MEETEI_MAYEK_EXTENSIONS, /**< Meetei Mayek Extensions (Since 4.0) */
- I18N_UCHAR_UBLOCK_MEROITIC_CURSIVE, /**< Meroitic Cursive (Since 4.0) */
+ I18N_UCHAR_UBLOCK_MEROITIC_CURSIVE, /**< Meroitic Cursive (Since 4.0) */
I18N_UCHAR_UBLOCK_MEROITIC_HIEROGLYPHS, /**< Meroitic Hieroglyphs (Since 4.0) */
I18N_UCHAR_UBLOCK_MIAO, /**< Miao (Since 4.0) */
I18N_UCHAR_UBLOCK_SHARADA, /**< Sharada (Since 4.0) */
* @param[in] code The Unicode code point for the character with this name
* @param[in] name_choice Selector for which kind of names is enumerated
* @param[in] name The character's name, zero-terminated. Can be used only in the callback.
- * To use outside, make a copy.
+ * To use outside, make a copy.
* @param[in] length The length of the name
*
* @return @c true if the enumeration should continue, @c false to stop it
* @since_tizen 2.3.1
*/
typedef enum {
- I18N_UDISPLAY_CONTEXT_STANDARD_NAMES = (I18N_UDISPCTX_TYPE_DIALECT_HANDLING<<8) + 0, /**< Standard names */
- I18N_UDISPLAY_CONTEXT_DIALECT_NAMES = (I18N_UDISPCTX_TYPE_DIALECT_HANDLING<<8) + 1, /**< Dialect names */
- I18N_UDISPLAY_CONTEXT_CAPITALIZATION_NONE = (I18N_UDISPCTX_TYPE_CAPITALIZATION<<8) + 0, /**< Capitalization: None */
- I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = (I18N_UDISPCTX_TYPE_CAPITALIZATION<<8) + 1, /**< Capitalization: For middle of sentence */
- I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = (I18N_UDISPCTX_TYPE_CAPITALIZATION<<8) + 2, /**< Capitalization: For beginning of sentence */
- I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_UI_LIST_OR_MENU = (I18N_UDISPCTX_TYPE_CAPITALIZATION<<8) + 3, /**< Capitalization: For UI list or menu */
- I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_STANDALONE = (I18N_UDISPCTX_TYPE_CAPITALIZATION<<8) + 4, /**< Capitalization: For standalone */
+ I18N_UDISPLAY_CONTEXT_STANDARD_NAMES = (I18N_UDISPCTX_TYPE_DIALECT_HANDLING << 8) + 0, /**< Standard names */
+ I18N_UDISPLAY_CONTEXT_DIALECT_NAMES = (I18N_UDISPCTX_TYPE_DIALECT_HANDLING << 8) + 1, /**< Dialect names */
+ I18N_UDISPLAY_CONTEXT_CAPITALIZATION_NONE = (I18N_UDISPCTX_TYPE_CAPITALIZATION << 8) + 0, /**< Capitalization: None */
+ I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = (I18N_UDISPCTX_TYPE_CAPITALIZATION << 8) + 1, /**< Capitalization: For middle of sentence */
+ I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = (I18N_UDISPCTX_TYPE_CAPITALIZATION << 8) + 2, /**< Capitalization: For beginning of sentence */
+ I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_UI_LIST_OR_MENU = (I18N_UDISPCTX_TYPE_CAPITALIZATION << 8) + 3, /**< Capitalization: For UI list or menu */
+ I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_STANDALONE = (I18N_UDISPCTX_TYPE_CAPITALIZATION << 8) + 4, /**< Capitalization: For standalone */
} i18n_udisplay_context_e;
/* Skeletons for dates. */
typedef enum {
I18N_USET_SPAN_NOT_CONTAINED = 0, /**< Continue a span() while there is no set element at the current position.
Stops before the first set element (character or string).
- (For code points only, this is like while contains(current)==false).
+ (For code points only, this is like while contains(current) == false).
When span() returns, the substring between where it started and the position
it returned consists only of characters that are not in the set,
and none of its strings overlap with the span. */
I18N_USET_SPAN_CONTAINED = 1, /**< Continue a span() while there is a set element at the current position.
- (For characters only, this is like while contains(current)==true).
+ (For characters only, this is like while contains(current) == true).
When span() returns, the substring between where it started and the position
it returned consists only of set elements (characters or strings) that are in the set.
(There must be a single, non-overlapping concatenation of characters or strings.)
This is equivalent to a POSIX regular expression for (OR of each set element). */
I18N_USET_SPAN_SIMPLE = 2, /**< Continue a span() while there is a set element at the current position.
- (For characters only, this is like while contains(current)==true).
+ (For characters only, this is like while contains(current) == true).
When span() returns, the substring between where it started and the position
it returned consists only of set elements (characters or strings) that are in the set.
* @since_tizen 4.0
*/
typedef enum {
- I18N_UCHAR_ITER_START, /**< The 'start' origin */
- I18N_UCHAR_ITER_CURRENT, /**< The 'current' origin */
- I18N_UCHAR_ITER_LIMIT, /**< The 'limit' origin */
- I18N_UCHAR_ITER_ZERO, /**< The 'zero' origin */
- I18N_UCHAR_ITER_LENGTH, /**< The 'length' origin */
+ I18N_UCHAR_ITER_START, /**< The 'start' origin */
+ I18N_UCHAR_ITER_CURRENT, /**< The 'current' origin */
+ I18N_UCHAR_ITER_LIMIT, /**< The 'limit' origin */
+ I18N_UCHAR_ITER_ZERO, /**< The 'zero' origin */
+ I18N_UCHAR_ITER_LENGTH, /**< The 'length' origin */
} i18n_uchar_iter_origin_e;
/**
* @since_tizen 4.0
*/
typedef enum {
- I18N_UPLURAL_TYPE_CARDINAL, /**< Plural rules for cardinal numbers: 1 file vs. 2 files */
- I18N_UPLURAL_TYPE_ORDINAL, /**< Plural rules for ordinal numbers:
- 1st file, 2nd file, 3rd file, 4th file, etc. */
+ I18N_UPLURAL_TYPE_CARDINAL, /**< Plural rules for cardinal numbers: 1 file vs. 2 files */
+ I18N_UPLURAL_TYPE_ORDINAL, /**< Plural rules for ordinal numbers:
+ 1st file, 2nd file, 3rd file, 4th file, etc. */
} i18n_uplural_type_e;
/**
* @param[out] iter The #i18n_uchar_iter_h handle
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
* @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_uchar_iter_create(i18n_uchar_iter_h *iter);
* @brief Deletes an #i18n_uchar_iter_h object.
* @since_tizen 4.0
*
- * @param[in] iter The #i18n_uchar_iter_h object
+ * @param[in] iter The #i18n_uchar_iter_h object
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
*/
int i18n_uchar_iter_destroy(i18n_uchar_iter_h iter);
* @since_tizen 4.0
* @remarks The string @a s will not be copied or reallocated.
*
- * @param[in] iter The #i18n_uchar_iter_h structure to be set for iteration
- * @param[in] s String to iterate over
- * @param[in] length Length of @a s, or @c -1 if @c NULL-terminated
+ * @param[in] iter The #i18n_uchar_iter_h structure to be set for iteration
+ * @param[in] s String to iterate over
+ * @param[in] length Length of @a s, or @c -1 if @c NULL-terminated
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
*/
int i18n_uchar_iter_set_string(i18n_uchar_iter_h iter, const i18n_uchar *s, int32_t length);
* of bytes.
* @since_tizen 4.0
*
- * @param[in] iter #i18n_uchar_iter_h structure to be set for iteration
- * @param[in] s UTF-16BE string to iterate over
- * @param[in] length Length of @a s as an even number of bytes, or @c -1 if
- * @c NULL-terminated (@c NULL means pair of 0 bytes at even
- * index from @a s)
+ * @param[in] iter #i18n_uchar_iter_h structure to be set for iteration
+ * @param[in] s UTF-16BE string to iterate over
+ * @param[in] length Length of @a s as an even number of bytes, or @c -1 if
+ * @c NULL-terminated (@c NULL means pair of 0 bytes at even
+ * index from @a s)
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
*/
int i18n_uchar_iter_set_utf16be(i18n_uchar_iter_h iter, const char *s, int32_t length);
* middle of a surrogate pair (from a 4-byte UTF-8 sequence for the corresponding supplementary code point).
* i18n_uchar_iter_get_state() cannot also encode the UTF-16 index in the state value.
*
- * @param[in] iter #i18n_uchar_iter_h structure to be set for iteration
- * @param[in] s UTF-8 string to iterate over
- * @param[in] length Length of @a s, or @c -1 if @c NULL-terminated
+ * @param[in] iter #i18n_uchar_iter_h structure to be set for iteration
+ * @param[in] s UTF-8 string to iterate over
+ * @param[in] length Length of @a s, or @c -1 if @c NULL-terminated
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_set_utf8(i18n_uchar_iter_h iter, const char *s, int32_t length);
* UChars if the underlying storage is not UTF-16.
* @since_tizen 4.0
*
- * @param[in] iter The #i18n_uchar_iter_h object
- * @param[in] origin Origin defining action to perform
- * @param[out] index The requested index, or #I18N_SENTINEL in an error condition
+ * @param[in] iter The #i18n_uchar_iter_h object
+ * @param[in] origin Origin defining action to perform
+ * @param[out] index The requested index, or #I18N_SENTINEL in an error condition
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_get_index(i18n_uchar_iter_h iter, i18n_uchar_iter_origin_e origin, int32_t *index);
* i18n_uchar_iter_get_index(#I18N_UCHAR_ITER_CURRENT) which will count the UChars if necessary.
* @since_tizen 4.0
*
- * @param[in] iter The #i18n_uchar_iter_h object
- * @param[in] delta Movement
- * @param[in] origin Origin defining action to perform
- * @param[out] new_index The new index or #I18N_UCHAR_ITER_UNKNOWN_INDEX when the index is not known,
- * or #I18N_SENTINEL on an error condition
+ * @param[in] iter The #i18n_uchar_iter_h object
+ * @param[in] delta Movement
+ * @param[in] origin Origin defining action to perform
+ * @param[out] new_index The new index or #I18N_UCHAR_ITER_UNKNOWN_INDEX when the index is not known,
+ * or #I18N_SENTINEL on an error condition
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_move(i18n_uchar_iter_h iter, int32_t delta, i18n_uchar_iter_origin_e origin, int32_t *new_index);
* @brief Checks if i18n_uchar_iter_current() and i18n_uchar_iter_next() can still return another code unit.
* @since_tizen 4.0
*
- * @param[in] iter The #i18n_uchar_iter_h object
- * @param[out] has_next @c true if another code unit can be returned, @c false otherwise
+ * @param[in] iter The #i18n_uchar_iter_h object
+ * @param[out] has_next @c true if another code unit can be returned, @c false otherwise
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_has_next(i18n_uchar_iter_h iter, bool *has_next);
* @brief Checks if i18n_uchar_iter_previous() can still return another code unit.
* @since_tizen 4.0
*
- * @param[in] iter The #i18n_uchar_iter_h object
- * @param[out] has_previous @c true if another code unit can be returned, @c false otherwise
+ * @param[in] iter The #i18n_uchar_iter_h object
+ * @param[out] has_previous @c true if another code unit can be returned, @c false otherwise
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_has_previous(i18n_uchar_iter_h iter, bool *has_previous);
/**
* @brief Returns the code unit at the current position, or #I18N_SENTINEL if there is none
- * (index is at the limit).
+ * (index is at the limit).
* @since_tizen 4.0
*
- * @param[in] iter The #i18n_uchar_iter_h object
- * @param[out] current The current code unit
+ * @param[in] iter The #i18n_uchar_iter_h object
+ * @param[out] current The current code unit
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_current(i18n_uchar_iter_h iter, i18n_uchar32 *current);
/**
* @brief Returns the code unit at the current index and increments the index (post-increment, like s[i++]),
- * or returns #I18N_SENTINEL if there is none (index is at the limit).
+ * or returns #I18N_SENTINEL if there is none (index is at the limit).
* @since_tizen 4.0
*
- * @param[in] iter The #i18n_uchar_iter_h object
- * @param[out] current The current code unit
+ * @param[in] iter The #i18n_uchar_iter_h object
+ * @param[out] current The current code unit
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_next(i18n_uchar_iter_h iter, i18n_uchar32 *current);
/**
* @brief Decrements the index and returns the code unit from there (pre-decrement, like s[--i]),
- * or returns #I18N_SENTINEL if there is none (index is at the start).
+ * or returns #I18N_SENTINEL if there is none (index is at the start).
* @since_tizen 4.0
*
- * @param[in] iter The #i18n_uchar_iter_h object
- * @param[out] previous The previous code unit
+ * @param[in] iter The #i18n_uchar_iter_h object
+ * @param[out] previous The previous code unit
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_previous(i18n_uchar_iter_h iter, i18n_uchar32 *previous);
* @since_tizen 4.0
*
* @param[in] iter The #i18n_uchar_iter_h object
- * @param[out] state The state word
+ * @param[out] state The state word
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_get_state(const i18n_uchar_iter_h iter, uint32_t *state);
* the correct text contents and move relative to the current position without performance degradation.
* @since_tizen 4.0
*
- * @param[in] iter The #i18n_uchar_iter_h object
- * @param[in] state The state word from an i18n_uchar_iter_get_state() call on a same-type,
- * same-string iterator
+ * @param[in] iter The #i18n_uchar_iter_h object
+ * @param[in] state The state word from an i18n_uchar_iter_get_state() call on a same-type,
+ * same-string iterator
*
* @return @c 0 on success, otherwise a negative error value
- * @retval #I18N_ERROR_NONE Successful
- * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
- * i18n_uchar_iter_set_UTF8().
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ * @pre The string must be set with one of: i18n_uchar_iter_set_string(), i18n_uchar_iter_set_UTF16BE(),
+ * i18n_uchar_iter_set_UTF8().
*/
int i18n_uchar_iter_set_state(i18n_uchar_iter_h iter, uint32_t state);