diff options
author | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-09 20:07:20 +0300 |
---|---|---|
committer | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-09 20:59:13 +0300 |
commit | fd82fb12fb45e71a02c628e45b12c50c0dd0d308 (patch) | |
tree | f582b79f9002ab1d083e9acda600dfb3551c47b6 /contrib/libs/icu/include/unicode/ucoleitr.h | |
parent | bf862ddf5c6178e1bb5e4fb3f7c61015deebe284 (diff) | |
download | ydb-fd82fb12fb45e71a02c628e45b12c50c0dd0d308.tar.gz |
Update ICU to 70.1
Diffstat (limited to 'contrib/libs/icu/include/unicode/ucoleitr.h')
-rw-r--r-- | contrib/libs/icu/include/unicode/ucoleitr.h | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/contrib/libs/icu/include/unicode/ucoleitr.h b/contrib/libs/icu/include/unicode/ucoleitr.h index 85ec8383d7..25efcf2a08 100644 --- a/contrib/libs/icu/include/unicode/ucoleitr.h +++ b/contrib/libs/icu/include/unicode/ucoleitr.h @@ -23,7 +23,7 @@ #if !UCONFIG_NO_COLLATION /** - * This indicates an error has occured during processing or if no more CEs is + * This indicates an error has occurred during processing or if no more CEs is * to be returned. * @stable ICU 2.0 */ @@ -66,14 +66,14 @@ typedef struct UCollationElements UCollationElements; * . UCollationElements *c; * . UCollatorOld *coll; * . UErrorCode success = U_ZERO_ERROR; - * . s=(UChar*)malloc(sizeof(UChar) * (strlen("This is a test")+1) ); - * . u_uastrcpy(s, "This is a test"); + * . str=(UChar*)malloc(sizeof(UChar) * (strlen("This is a test")+1) ); + * . u_uastrcpy(str, "This is a test"); * . coll = ucol_open(NULL, &success); * . c = ucol_openElements(coll, str, u_strlen(str), &status); * . order = ucol_next(c, &success); * . ucol_reset(c); * . order = ucol_prev(c, &success); - * . free(s); + * . free(str); * . ucol_close(coll); * . ucol_closeElements(c); * . } @@ -102,6 +102,10 @@ typedef struct UCollationElements UCollationElements; /** * Open the collation elements for a string. * + * The UCollationElements retains a pointer to the supplied text. + * The caller must not modify or delete the text while the UCollationElements + * object is used to iterate over this text. + * * @param coll The collator containing the desired collation rules. * @param text The text to iterate over. * @param textLength The number of characters in text, or -1 if null-terminated @@ -109,13 +113,12 @@ typedef struct UCollationElements UCollationElements; * @return a struct containing collation element information * @stable ICU 2.0 */ -U_STABLE UCollationElements* U_EXPORT2 +U_CAPI UCollationElements* U_EXPORT2 ucol_openElements(const UCollator *coll, const UChar *text, int32_t textLength, UErrorCode *status); - /** * get a hash code for a key... Not very useful! * @param key the given key. @@ -123,7 +126,7 @@ ucol_openElements(const UCollator *coll, * @return the hash code. * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ucol_keyHashCode(const uint8_t* key, int32_t length); /** @@ -132,7 +135,7 @@ ucol_keyHashCode(const uint8_t* key, int32_t length); * @param elems The UCollationElements to close. * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 ucol_closeElements(UCollationElements *elems); /** @@ -144,7 +147,7 @@ ucol_closeElements(UCollationElements *elems); * @see ucol_previous * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 ucol_reset(UCollationElements *elems); /** @@ -153,10 +156,10 @@ ucol_reset(UCollationElements *elems); * @param elems The UCollationElements containing the text. * @param status A pointer to a UErrorCode to receive any errors. * @return The next collation elements ordering, otherwise returns UCOL_NULLORDER - * if an error has occured or if the end of string has been reached + * if an error has occurred or if the end of string has been reached * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ucol_next(UCollationElements *elems, UErrorCode *status); /** @@ -164,15 +167,15 @@ ucol_next(UCollationElements *elems, UErrorCode *status); * A single character may contain more than one collation element. * Note that internally a stack is used to store buffered collation elements. * @param elems The UCollationElements containing the text. - * @param status A pointer to a UErrorCode to receive any errors. Noteably + * @param status A pointer to a UErrorCode to receive any errors. Notably * a U_BUFFER_OVERFLOW_ERROR is returned if the internal stack * buffer has been exhausted. * @return The previous collation elements ordering, otherwise returns - * UCOL_NULLORDER if an error has occured or if the start of string has + * UCOL_NULLORDER if an error has occurred or if the start of string has * been reached. * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ucol_previous(UCollationElements *elems, UErrorCode *status); /** @@ -186,7 +189,7 @@ ucol_previous(UCollationElements *elems, UErrorCode *status); * expansion sequence * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ucol_getMaxExpansion(const UCollationElements *elems, int32_t order); /** @@ -194,6 +197,11 @@ ucol_getMaxExpansion(const UCollationElements *elems, int32_t order); * Property settings for collation will remain the same. * In order to reset the iterator to the current collation property settings, * the API reset() has to be called. + * + * The UCollationElements retains a pointer to the supplied text. + * The caller must not modify or delete the text while the UCollationElements + * object is used to iterate over this text. + * * @param elems The UCollationElements to set. * @param text The source text containing the collation elements. * @param textLength The length of text, or -1 if null-terminated. @@ -201,8 +209,8 @@ ucol_getMaxExpansion(const UCollationElements *elems, int32_t order); * @see ucol_getText * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 -ucol_setText( UCollationElements *elems, +U_CAPI void U_EXPORT2 +ucol_setText( UCollationElements *elems, const UChar *text, int32_t textLength, UErrorCode *status); @@ -216,7 +224,7 @@ ucol_setText( UCollationElements *elems, * @see ucol_setOffset * @stable ICU 2.0 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ucol_getOffset(const UCollationElements *elems); /** @@ -231,9 +239,9 @@ ucol_getOffset(const UCollationElements *elems); * @see ucol_getOffset * @stable ICU 2.0 */ -U_STABLE void U_EXPORT2 +U_CAPI void U_EXPORT2 ucol_setOffset(UCollationElements *elems, - int32_t offset, + int32_t offset, UErrorCode *status); /** @@ -242,7 +250,7 @@ ucol_setOffset(UCollationElements *elems, * @return the primary order of a collation order. * @stable ICU 2.6 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ucol_primaryOrder (int32_t order); /** @@ -251,7 +259,7 @@ ucol_primaryOrder (int32_t order); * @return the secondary order of a collation order. * @stable ICU 2.6 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ucol_secondaryOrder (int32_t order); /** @@ -260,7 +268,7 @@ ucol_secondaryOrder (int32_t order); * @return the tertiary order of a collation order. * @stable ICU 2.6 */ -U_STABLE int32_t U_EXPORT2 +U_CAPI int32_t U_EXPORT2 ucol_tertiaryOrder (int32_t order); #endif /* #if !UCONFIG_NO_COLLATION */ |