Lines Matching refs:coll
122 (s)->coll = (collator); in IInit_collIterate()
477 ucol_cloneBinary(const UCollator *coll, in ucol_cloneBinary() argument
489 if(coll->hasRealData == TRUE) { in ucol_cloneBinary()
490 length = coll->image->size; in ucol_cloneBinary()
492 uprv_memcpy(buffer, coll->image, length); in ucol_cloneBinary()
521 uprv_memcpy(myData->version, coll->image->version, sizeof(UVersionInfo)); in ucol_cloneBinary()
523 uprv_memcpy(myData->UCAVersion, coll->image->UCAVersion, sizeof(UVersionInfo)); in ucol_cloneBinary()
524 uprv_memcpy(myData->UCDVersion, coll->image->UCDVersion, sizeof(UVersionInfo)); in ucol_cloneBinary()
525 uprv_memcpy(myData->formatVersion, coll->image->formatVersion, sizeof(UVersionInfo)); in ucol_cloneBinary()
526 myData->jamoSpecial = coll->image->jamoSpecial; in ucol_cloneBinary()
529 … uprv_memcpy(buffer+paddedsize(sizeof(UCATableHeader)), coll->options, sizeof(UColOptionSet)); in ucol_cloneBinary()
538 ucol_safeClone(const UCollator *coll, void *stackBuffer, int32_t * pBufferSize, UErrorCode *status) in ucol_safeClone() argument
559 if ((stackBuffer && !pBufferSize) || !coll){ in ucol_safeClone()
564 if (coll->rules && coll->freeRulesOnClose) { in ucol_safeClone()
565 rulesSize = (int32_t)(coll->rulesLength + 1)*sizeof(UChar); in ucol_safeClone()
570 if (coll->defaultReorderCodes) { in ucol_safeClone()
571 defaultReorderCodesSize = coll->defaultReorderCodesLength * sizeof(int32_t); in ucol_safeClone()
574 if (coll->reorderCodes) { in ucol_safeClone()
575 reorderCodesSize = coll->reorderCodesLength * sizeof(int32_t); in ucol_safeClone()
578 if (coll->leadBytePermutationTable) { in ucol_safeClone()
624 imageSize = ucol_cloneBinary(coll, NULL, 0, &tempStatus); in ucol_safeClone()
626 if (coll->freeImageOnClose) { in ucol_safeClone()
633 ucol_cloneBinary(coll, image, imageSize, status); in ucol_safeClone()
637 image = (uint8_t *)coll->image; in ucol_safeClone()
639 localCollator = ucol_initFromBinary(image, imageSize, coll->UCA, localCollator, status); in ucol_safeClone()
644 if (coll->rules) { in ucol_safeClone()
645 if (coll->freeRulesOnClose) { in ucol_safeClone()
646 localCollator->rules = u_strcpy(rules, coll->rules); in ucol_safeClone()
650 localCollator->rules = coll->rules; in ucol_safeClone()
653 localCollator->rulesLength = coll->rulesLength; in ucol_safeClone()
657 if (coll->defaultReorderCodes) { in ucol_safeClone()
659 …(int32_t*) uprv_memcpy(defaultReorderCodes, coll->defaultReorderCodes, coll->defaultReorderCodesLe… in ucol_safeClone()
660 localCollator->defaultReorderCodesLength = coll->defaultReorderCodesLength; in ucol_safeClone()
663 if (coll->reorderCodes) { in ucol_safeClone()
665 …(int32_t*)uprv_memcpy(reorderCodes, coll->reorderCodes, coll->reorderCodesLength * sizeof(int32_t)… in ucol_safeClone()
666 localCollator->reorderCodesLength = coll->reorderCodesLength; in ucol_safeClone()
669 if (coll->leadBytePermutationTable) { in ucol_safeClone()
671 (uint8_t*) uprv_memcpy(leadBytePermutationTable, coll->leadBytePermutationTable, 256); in ucol_safeClone()
677 …ucol_setAttribute(localCollator, (UColAttribute)i, ucol_getAttribute(coll, (UColAttribute)i, statu… in ucol_safeClone()
683 localCollator->ucaRules = coll->ucaRules; // There should only be one copy here. in ucol_safeClone()
690 ucol_close(UCollator *coll) in ucol_close() argument
693 UTRACE_DATA1(UTRACE_INFO, "coll = %p", coll); in ucol_close()
694 if(coll != NULL) { in ucol_close()
697 if(coll->validLocale != NULL) { in ucol_close()
698 uprv_free(coll->validLocale); in ucol_close()
700 if(coll->actualLocale != NULL) { in ucol_close()
701 uprv_free(coll->actualLocale); in ucol_close()
703 if(coll->requestedLocale != NULL) { in ucol_close()
704 uprv_free(coll->requestedLocale); in ucol_close()
706 if(coll->latinOneCEs != NULL) { in ucol_close()
707 uprv_free(coll->latinOneCEs); in ucol_close()
709 if(coll->options != NULL && coll->freeOptionsOnClose) { in ucol_close()
710 uprv_free(coll->options); in ucol_close()
712 if(coll->rules != NULL && coll->freeRulesOnClose) { in ucol_close()
713 uprv_free((UChar *)coll->rules); in ucol_close()
715 if(coll->image != NULL && coll->freeImageOnClose) { in ucol_close()
716 uprv_free((UCATableHeader *)coll->image); in ucol_close()
719 … if(coll->leadBytePermutationTable != NULL && coll->freeLeadBytePermutationTableOnClose == TRUE) { in ucol_close()
720 uprv_free(coll->leadBytePermutationTable); in ucol_close()
722 if(coll->defaultReorderCodes != NULL && coll->freeDefaultReorderCodesOnClose == TRUE) { in ucol_close()
723 uprv_free(coll->defaultReorderCodes); in ucol_close()
725 if(coll->reorderCodes != NULL && coll->freeReorderCodesOnClose == TRUE) { in ucol_close()
726 uprv_free(coll->reorderCodes); in ucol_close()
732 UTRACE_DATA1(UTRACE_INFO, "coll->freeOnClose: %d", coll->freeOnClose); in ucol_close()
733 if(coll->freeOnClose){ in ucol_close()
736 uprv_free(coll); in ucol_close()
745 ucol_cloneRuleData(const UCollator *coll, int32_t *length, UErrorCode *status) in ucol_cloneRuleData() argument
751 if(coll->hasRealData == TRUE) { in ucol_cloneRuleData()
752 *length = coll->image->size; in ucol_cloneRuleData()
759 uprv_memcpy(result, coll->image, *length); in ucol_cloneRuleData()
791 uprv_memcpy(myData->version, coll->image->version, sizeof(UVersionInfo)); in ucol_cloneRuleData()
793 uprv_memcpy(myData->UCAVersion, coll->image->UCAVersion, sizeof(UVersionInfo)); in ucol_cloneRuleData()
794 uprv_memcpy(myData->UCDVersion, coll->image->UCDVersion, sizeof(UVersionInfo)); in ucol_cloneRuleData()
795 uprv_memcpy(myData->formatVersion, coll->image->formatVersion, sizeof(UVersionInfo)); in ucol_cloneRuleData()
796 myData->jamoSpecial = coll->image->jamoSpecial; in ucol_cloneRuleData()
799 … uprv_memcpy(result+paddedsize(sizeof(UCATableHeader)), coll->options, sizeof(UColOptionSet)); in ucol_cloneRuleData()
844 inline UBool ucol_contractionEndCP(UChar c, const UCollator *coll) { in ucol_contractionEndCP() argument
845 if (c < coll->minContrEndCP) { in ucol_contractionEndCP()
857 htbyte = coll->contrEndCP[hash>>3]; in ucol_contractionEndCP()
870 inline uint8_t i_getCombiningClass(UChar32 c, const UCollator *coll) { in i_getCombiningClass() argument
872 if ((c >= 0x300 && ucol_unsafeCP(c, coll)) || c > 0xFFFF) { in i_getCombiningClass()
1485 inline uint32_t ucol_IGetNextCE(const UCollator *coll, collIterate *collationSource, UErrorCode *st… in ucol_IGetNextCE() argument
1626 order = coll->latinOneMapping[ch]; in ucol_IGetNextCE()
1628 order = ucol_prv_getSpecialCE(coll, ch, order, collationSource, status); in ucol_IGetNextCE()
1644 order = UTRIE_GET32_FROM_LEAD(&coll->mapping, ch); in ucol_IGetNextCE()
1650 order = UTRIE_GET32_FROM_LEAD(&coll->mapping, ch); in ucol_IGetNextCE()
1654 …order = ucol_prv_getSpecialCE(coll, ch, order, collationSource, status); /* and try to get the … in ucol_IGetNextCE()
1657 … if(order == UCOL_NOT_FOUND && coll->UCA) { /* We couldn't find a good CE in the tailoring */ in ucol_IGetNextCE()
1659 order = UTRIE_GET32_FROM_LEAD(&coll->UCA->mapping, ch); in ucol_IGetNextCE()
1662 order = ucol_prv_getSpecialCE(coll->UCA, ch, order, collationSource, status); in ucol_IGetNextCE()
1676 ucol_getNextCE(const UCollator *coll, collIterate *collationSource, UErrorCode *status) { in ucol_getNextCE() argument
1677 return ucol_IGetNextCE(coll, collationSource, status); in ucol_getNextCE()
1749 uint32_t baseOrder = UTRIE_GET32_FROM_LEAD(&data->coll->mapping, baseChar); in collPrevIterNormalize()
1751 if (baseOrder == UCOL_NOT_FOUND && data->coll->UCA) { in collPrevIterNormalize()
1752 baseOrder = UTRIE_GET32_FROM_LEAD(&data->coll->UCA->mapping, baseChar); in collPrevIterNormalize()
1985 inline uint32_t ucol_IGetPrevCE(const UCollator *coll, collIterate *data, in ucol_IGetPrevCE() argument
2125 if (ucol_contractionEndCP(ch, coll) && !isAtStartPrevIterate(data)) { in ucol_IGetPrevCE()
2126 result = ucol_prv_getSpecialPrevCE(coll, ch, UCOL_CONTRACTION, data, status); in ucol_IGetPrevCE()
2129 result = coll->latinOneMapping[ch]; in ucol_IGetPrevCE()
2142 result = UTRIE_GET32_FROM_LEAD(&coll->mapping, ch); in ucol_IGetPrevCE()
2147 result = UTRIE_GET32_FROM_LEAD(&coll->mapping, ch); in ucol_IGetPrevCE()
2151 result = ucol_prv_getSpecialPrevCE(coll, ch, result, data, status); in ucol_IGetPrevCE()
2155 ucol_contractionEndCP(ch, data->coll)) in ucol_IGetPrevCE()
2159 if(coll->UCA) { in ucol_IGetPrevCE()
2160 result = UTRIE_GET32_FROM_LEAD(&coll->UCA->mapping, ch); in ucol_IGetPrevCE()
2165 if(coll->UCA) { in ucol_IGetPrevCE()
2166 result = ucol_prv_getSpecialPrevCE(coll->UCA, ch, result, data, status); in ucol_IGetPrevCE()
2184 ucol_getPrevCE(const UCollator *coll, collIterate *data, in ucol_getPrevCE() argument
2186 return ucol_IGetPrevCE(coll, data, status); in ucol_getPrevCE()
2192 ucol_getFirstCE(const UCollator *coll, UChar u, UErrorCode *status) { in ucol_getFirstCE() argument
2194 IInit_collIterate(coll, &u, 1, &colIt, status); in ucol_getFirstCE()
2198 return ucol_IGetNextCE(coll, &colIt, status); in ucol_getFirstCE()
2458 uint32_t getDiscontiguous(const UCollator *coll, collIterate *source, in getDiscontiguous() argument
2496 return *(coll->contractionCEs + in getDiscontiguous()
2497 (tempconstart - coll->contractionIndex)); in getDiscontiguous()
2522 result = *(coll->contractionCEs + in getDiscontiguous()
2523 (UCharOffset - coll->contractionIndex)); in getDiscontiguous()
2530 tempconstart = (UChar *)coll->image + getContractOffset(result); in getDiscontiguous()
2531 if (*(coll->contractionCEs + (constart - coll->contractionIndex)) in getDiscontiguous()
2554 return *(coll->contractionCEs + (constart - coll->contractionIndex)); in getDiscontiguous()
2730 uint32_t ucol_prv_getSpecialCE(const UCollator *coll, UChar ch, uint32_t CE, collIterate *source, U… in ucol_prv_getSpecialCE() argument
2767 … const UChar *ContractionStart = UCharOffset = (UChar *)coll->image+getContractOffset(CE); in ucol_prv_getSpecialCE()
2769 CE = *(coll->contractionCEs + (UCharOffset - coll->contractionIndex)); in ucol_prv_getSpecialCE()
2782 CE = *(coll->contractionCEs + in ucol_prv_getSpecialCE()
2783 (UCharOffset - coll->contractionIndex)); in ucol_prv_getSpecialCE()
2789 CE = *(coll->contractionCEs + in ucol_prv_getSpecialCE()
2790 (ContractionStart - coll->contractionIndex)); in ucol_prv_getSpecialCE()
2817 …uint32_t firstCE = *(coll->contractionCEs + ((UChar *)coll->image+getContractOffset(CE) - coll->co… in ucol_prv_getSpecialCE()
2826 … const UChar *ContractionStart = UCharOffset = (UChar *)coll->image+getContractOffset(CE); in ucol_prv_getSpecialCE()
2830 CE = *(coll->contractionCEs + (UCharOffset - coll->contractionIndex)); in ucol_prv_getSpecialCE()
2854 CE = *(coll->contractionCEs + in ucol_prv_getSpecialCE()
2855 (UCharOffset - coll->contractionIndex)); in ucol_prv_getSpecialCE()
2888 (sCC = i_getCombiningClass(miss, coll)) == 0 || in ucol_prv_getSpecialCE()
2900 CE = *(coll->contractionCEs + in ucol_prv_getSpecialCE()
2901 (ContractionStart - coll->contractionIndex)); in ucol_prv_getSpecialCE()
2913 if (i_getCombiningClass(tempchar, coll) == 0) { in ucol_prv_getSpecialCE()
2919 CE = *(coll->contractionCEs + in ucol_prv_getSpecialCE()
2920 (ContractionStart - coll->contractionIndex)); in ucol_prv_getSpecialCE()
2922 CE = getDiscontiguous(coll, source, ContractionStart); in ucol_prv_getSpecialCE()
2949 … uint32_t tempCE = *(coll->contractionCEs + (ContractionStart - coll->contractionIndex)); in ucol_prv_getSpecialCE()
2992 …CEOffset = (uint32_t *)coll->image+getExpansionOffset(CE); /* find the offset to expansion table */ in ucol_prv_getSpecialCE()
3020 if (source->coll->numericCollation == UCOL_ON){ in ucol_prv_getSpecialCE()
3201 …CEOffset = (uint32_t *)coll->image+getExpansionOffset(CE); /* find the offset to expansion table */ in ucol_prv_getSpecialCE()
3239 if (!source->coll->image->jamoSpecial) { // FAST PATH in ucol_prv_getSpecialCE()
3241 *(source->CEpos++) = UTRIE_GET32_FROM_LEAD(&coll->mapping, V); in ucol_prv_getSpecialCE()
3243 *(source->CEpos++) = UTRIE_GET32_FROM_LEAD(&coll->mapping, T); in ucol_prv_getSpecialCE()
3246 return UTRIE_GET32_FROM_LEAD(&coll->mapping, L); in ucol_prv_getSpecialCE()
3302 CE = UTRIE_GET32_FROM_OFFSET_TRAIL(&coll->mapping, CE&0xFFFFFF, trail); in ucol_prv_getSpecialCE()
3378 uint32_t ucol_prv_getSpecialPrevCE(const UCollator *coll, UChar ch, uint32_t CE, in ucol_prv_getSpecialPrevCE() argument
3418 … const UChar *ContractionStart = UCharOffset = (UChar *)coll->image+getContractOffset(CE); in ucol_prv_getSpecialPrevCE()
3421 CE = *(coll->contractionCEs + (UCharOffset - coll->contractionIndex)); in ucol_prv_getSpecialPrevCE()
3434 CE = *(coll->contractionCEs + in ucol_prv_getSpecialPrevCE()
3435 (UCharOffset - coll->contractionIndex)); in ucol_prv_getSpecialPrevCE()
3443 uint32_t isZeroCE = UTRIE_GET32_FROM_LEAD(&coll->mapping, schar); in ucol_prv_getSpecialPrevCE()
3457 isZeroCE = UTRIE_GET32_FROM_LEAD(&coll->mapping, lead); in ucol_prv_getSpecialPrevCE()
3459 … uint32_t finalCE = UTRIE_GET32_FROM_OFFSET_TRAIL(&coll->mapping, isZeroCE&0xFFFFFF, schar); in ucol_prv_getSpecialPrevCE()
3477 CE = *(coll->contractionCEs + in ucol_prv_getSpecialPrevCE()
3478 (ContractionStart - coll->contractionIndex)); in ucol_prv_getSpecialPrevCE()
3501 constart = (UChar *)coll->image + getContractOffset(CE); in ucol_prv_getSpecialPrevCE()
3506 CE = *(coll->contractionCEs + in ucol_prv_getSpecialPrevCE()
3507 (constart - coll->contractionIndex)); in ucol_prv_getSpecialPrevCE()
3515 while (ucol_unsafeCP(schar, coll)) { in ucol_prv_getSpecialPrevCE()
3573 IInit_collIterate(coll, UCharOffset, noChars, &temp, status); in ucol_prv_getSpecialPrevCE()
3581 CE = ucol_IGetNextCE(coll, &temp, status); in ucol_prv_getSpecialPrevCE()
3618 CE = ucol_IGetNextCE(coll, &temp, status); in ucol_prv_getSpecialPrevCE()
3695 CEOffset = (uint32_t *)coll->image + getExpansionOffset(CE); in ucol_prv_getSpecialPrevCE()
3749 if (source->coll->numericCollation == UCOL_ON){ in ucol_prv_getSpecialPrevCE()
3968 CEOffset = (uint32_t *)coll->image + getExpansionOffset(CE); in ucol_prv_getSpecialPrevCE()
4006 if (!source->coll->image->jamoSpecial) { in ucol_prv_getSpecialPrevCE()
4007 *(source->CEpos++) = UTRIE_GET32_FROM_LEAD(&coll->mapping, L); in ucol_prv_getSpecialPrevCE()
4008 *(source->CEpos++) = UTRIE_GET32_FROM_LEAD(&coll->mapping, V); in ucol_prv_getSpecialPrevCE()
4012 *(source->CEpos++) = UTRIE_GET32_FROM_LEAD(&coll->mapping, T); in ucol_prv_getSpecialPrevCE()
4472 ucol_getSortKey(const UCollator *coll, in ucol_getSortKey() argument
4480 UTRACE_DATA3(UTRACE_VERBOSE, "coll=%p, source string = %vh ", coll, source, in ucol_getSortKey()
4499 coll->sortKeyGen(coll, source, sourceLength, sink, &status); in ucol_getSortKey()
4509 ucol_getSortKeyWithAllocation(const UCollator *coll, in ucol_getSortKeyWithAllocation() argument
4514 coll->sortKeyGen(coll, source, sourceLength, sink, pErrorCode); in ucol_getSortKeyWithAllocation()
4588 ucol_calcSortKey(const UCollator *coll, in ucol_calcSortKey() argument
4612 UColAttributeValue strength = coll->strength; in ucol_calcSortKey()
4618 UBool doCase = (coll->caseLevel == UCOL_ON); in ucol_calcSortKey()
4619 UBool isFrenchSec = (coll->frenchCollation == UCOL_ON) && (compareSec == 0); in ucol_calcSortKey()
4620 UBool shifted = (coll->alternateHandling == UCOL_SHIFTED); in ucol_calcSortKey()
4622 UBool doHiragana = (coll->hiraganaQ == UCOL_ON) && (compareQuad == 0); in ucol_calcSortKey()
4624 uint32_t variableTopValue = coll->variableTopValue; in ucol_calcSortKey()
4627 uint8_t UCOL_COMMON_BOT4 = (uint8_t)((coll->variableTopValue>>8)+1); in ucol_calcSortKey()
4643 } else if(coll->normalizationMode != UCOL_OFF) { in ucol_calcSortKey()
4660 IInit_collIterate(coll, source, len, &s, status); in ucol_calcSortKey()
4672 uint8_t caseSwitch = coll->caseSwitch; in ucol_calcSortKey()
4673 uint8_t tertiaryMask = coll->tertiaryMask; in ucol_calcSortKey()
4674 int8_t tertiaryAddition = coll->tertiaryAddition; in ucol_calcSortKey()
4675 uint8_t tertiaryTop = coll->tertiaryTop; in ucol_calcSortKey()
4676 uint8_t tertiaryBottom = coll->tertiaryBottom; in ucol_calcSortKey()
4677 uint8_t tertiaryCommon = coll->tertiaryCommon; in ucol_calcSortKey()
4687 order = ucol_IGetNextCE(coll, &s, status); in ucol_calcSortKey()
4709 if(notIsContinuation && coll->leadBytePermutationTable != NULL) { in ucol_calcSortKey()
4710 primary1 = coll->leadBytePermutationTable[primary1]; in ucol_calcSortKey()
4758 } else if(isCompressible(coll, originalPrimary1)) { in ucol_calcSortKey()
4829 if(coll->caseFirst == UCOL_UPPER_FIRST) { in ucol_calcSortKey()
4870 while (count3 > coll->tertiaryTopCount) { in ucol_calcSortKey()
4871 tertiaries.Append((uint8_t)(tertiaryTop - coll->tertiaryTopCount)); in ucol_calcSortKey()
4872 count3 -= (uint32_t)coll->tertiaryTopCount; in ucol_calcSortKey()
4876 while (count3 > coll->tertiaryBottomCount) { in ucol_calcSortKey()
4877 … tertiaries.Append((uint8_t)(tertiaryBottom + coll->tertiaryBottomCount)); in ucol_calcSortKey()
4878 count3 -= (uint32_t)coll->tertiaryBottomCount; in ucol_calcSortKey()
4944 if (coll->tertiaryCommon != UCOL_COMMON_BOT3) { in ucol_calcSortKey()
4945 while (count3 >= coll->tertiaryTopCount) { in ucol_calcSortKey()
4946 tertiaries.Append((uint8_t)(tertiaryTop - coll->tertiaryTopCount)); in ucol_calcSortKey()
4947 count3 -= (uint32_t)coll->tertiaryTopCount; in ucol_calcSortKey()
4951 while (count3 > coll->tertiaryBottomCount) { in ucol_calcSortKey()
4952 tertiaries.Append((uint8_t)(tertiaryBottom + coll->tertiaryBottomCount)); in ucol_calcSortKey()
4953 count3 -= (uint32_t)coll->tertiaryBottomCount; in ucol_calcSortKey()
4987 ucol_calcSortKeySimpleTertiary(const UCollator *coll, in ucol_calcSortKeySimpleTertiary() argument
5011 if(coll->normalizationMode != UCOL_OFF) { in ucol_calcSortKeySimpleTertiary()
5024 IInit_collIterate(coll, (UChar *)source, len, &s, status); in ucol_calcSortKeySimpleTertiary()
5036 uint8_t caseSwitch = coll->caseSwitch; in ucol_calcSortKeySimpleTertiary()
5037 uint8_t tertiaryMask = coll->tertiaryMask; in ucol_calcSortKeySimpleTertiary()
5038 int8_t tertiaryAddition = coll->tertiaryAddition; in ucol_calcSortKeySimpleTertiary()
5039 uint8_t tertiaryTop = coll->tertiaryTop; in ucol_calcSortKeySimpleTertiary()
5040 uint8_t tertiaryBottom = coll->tertiaryBottom; in ucol_calcSortKeySimpleTertiary()
5041 uint8_t tertiaryCommon = coll->tertiaryCommon; in ucol_calcSortKeySimpleTertiary()
5049 order = ucol_IGetNextCE(coll, &s, status); in ucol_calcSortKeySimpleTertiary()
5072 if (coll->leadBytePermutationTable != NULL && notIsContinuation) { in ucol_calcSortKeySimpleTertiary()
5073 primary1 = coll->leadBytePermutationTable[primary1]; in ucol_calcSortKeySimpleTertiary()
5092 } else if(isCompressible(coll, originalPrimary1)) { in ucol_calcSortKeySimpleTertiary()
5151 while (count3 > coll->tertiaryTopCount) { in ucol_calcSortKeySimpleTertiary()
5152 tertiaries.Append((uint8_t)(tertiaryTop - coll->tertiaryTopCount)); in ucol_calcSortKeySimpleTertiary()
5153 count3 -= (uint32_t)coll->tertiaryTopCount; in ucol_calcSortKeySimpleTertiary()
5157 while (count3 > coll->tertiaryBottomCount) { in ucol_calcSortKeySimpleTertiary()
5158 … tertiaries.Append((uint8_t)(tertiaryBottom + coll->tertiaryBottomCount)); in ucol_calcSortKeySimpleTertiary()
5159 count3 -= (uint32_t)coll->tertiaryBottomCount; in ucol_calcSortKeySimpleTertiary()
5183 if (coll->tertiaryCommon != UCOL_COMMON3_NORMAL) { in ucol_calcSortKeySimpleTertiary()
5184 while (count3 >= coll->tertiaryTopCount) { in ucol_calcSortKeySimpleTertiary()
5185 tertiaries.Append((uint8_t)(tertiaryTop - coll->tertiaryTopCount)); in ucol_calcSortKeySimpleTertiary()
5186 count3 -= (uint32_t)coll->tertiaryTopCount; in ucol_calcSortKeySimpleTertiary()
5190 while (count3 > coll->tertiaryBottomCount) { in ucol_calcSortKeySimpleTertiary()
5191 tertiaries.Append((uint8_t)(tertiaryBottom + coll->tertiaryBottomCount)); in ucol_calcSortKeySimpleTertiary()
5192 count3 -= (uint32_t)coll->tertiaryBottomCount; in ucol_calcSortKeySimpleTertiary()
5326 ucol_nextSortKeyPart(const UCollator *coll, in ucol_nextSortKeyPart() argument
5337 if( coll==NULL || iter==NULL || in ucol_nextSortKeyPart()
5347 coll, iter, state[0], state[1], dest, count); in ucol_nextSortKeyPart()
5376 int32_t strength = ucol_getAttribute(coll, UCOL_STRENGTH, status); in ucol_nextSortKeyPart()
5380 if(ucol_getAttribute(coll, UCOL_CASE_LEVEL, status) == UCOL_ON) { in ucol_nextSortKeyPart()
5396 (ucol_getAttribute(coll, UCOL_HIRAGANA_QUATERNARY_MODE, status) == UCOL_ON)?0xFE:0xFF; in ucol_nextSortKeyPart()
5398 uint32_t LVT = (coll->alternateHandling == UCOL_SHIFTED)?(coll->variableTopValue<<16):0; in ucol_nextSortKeyPart()
5400 UBool doingFrench = (ucol_getAttribute(coll, UCOL_FRENCH_COLLATION, status) == UCOL_ON); in ucol_nextSortKeyPart()
5407 IInit_collIterate(coll, NULL, -1, &s, status); in ucol_nextSortKeyPart()
5426 …if(ucol_getAttribute(coll, UCOL_NORMALIZATION_MODE, status) == UCOL_ON && level < UCOL_PSK_IDENTIC… in ucol_nextSortKeyPart()
5489 CE = ucol_IGetPrevCE(coll, &s, status); in ucol_nextSortKeyPart()
5491 CE = ucol_IGetNextCE(coll, &s, status); in ucol_nextSortKeyPart()
5543 CE = ucol_IGetNextCE(coll, &s, status); in ucol_nextSortKeyPart()
5557 if(coll->leadBytePermutationTable != NULL){ in ucol_nextSortKeyPart()
5558 CE = (coll->leadBytePermutationTable[CE>>24] << 24) | (CE & 0x00FFFFFF); in ucol_nextSortKeyPart()
5605 CE = ucol_IGetNextCE(coll, &s, status); in ucol_nextSortKeyPart()
5651 CE = ucol_IGetPrevCE(coll, &s, status); in ucol_nextSortKeyPart()
5694 if(ucol_getAttribute(coll, UCOL_CASE_LEVEL, status) == UCOL_ON) { in ucol_nextSortKeyPart()
5714 CE = ucol_IGetNextCE(coll, &s, status); in ucol_nextSortKeyPart()
5754 if(coll->caseFirst == UCOL_UPPER_FIRST) { in ucol_nextSortKeyPart()
5812 CE = ucol_IGetNextCE(coll, &s, status); in ucol_nextSortKeyPart()
5830 CE ^= coll->caseSwitch; in ucol_nextSortKeyPart()
5831 CE &= coll->tertiaryMask; in ucol_nextSortKeyPart()
5868 CE = ucol_IGetNextCE(coll, &s, status); in ucol_nextSortKeyPart()
6163 ucol_addLatinOneEntry(UCollator *coll, UChar ch, uint32_t CE, in ucol_addLatinOneEntry() argument
6170 tertiary = (uint8_t)((CE & coll->tertiaryMask)); in ucol_addLatinOneEntry()
6171 tertiary ^= coll->caseSwitch; in ucol_addLatinOneEntry()
6184 if (coll->leadBytePermutationTable != NULL && !continuation) { in ucol_addLatinOneEntry()
6185 primary1 = coll->leadBytePermutationTable[primary1]; in ucol_addLatinOneEntry()
6188 coll->latinOneCEs[ch] |= (primary1 << *primShift); in ucol_addLatinOneEntry()
6193 coll->latinOneCEs[ch] = UCOL_BAIL_OUT_CE; in ucol_addLatinOneEntry()
6194 coll->latinOneCEs[coll->latinOneTableLen+ch] = UCOL_BAIL_OUT_CE; in ucol_addLatinOneEntry()
6195 coll->latinOneCEs[2*coll->latinOneTableLen+ch] = UCOL_BAIL_OUT_CE; in ucol_addLatinOneEntry()
6198 coll->latinOneCEs[ch] |= (primary2 << *primShift); in ucol_addLatinOneEntry()
6202 if(reverseSecondary && coll->frenchCollation == UCOL_ON) { // reverse secondary in ucol_addLatinOneEntry()
6203 coll->latinOneCEs[coll->latinOneTableLen+ch] >>= 8; // make space for secondary in ucol_addLatinOneEntry()
6204 coll->latinOneCEs[coll->latinOneTableLen+ch] |= (secondary << 24); in ucol_addLatinOneEntry()
6206 coll->latinOneCEs[coll->latinOneTableLen+ch] |= (secondary << *secShift); in ucol_addLatinOneEntry()
6211 coll->latinOneCEs[2*coll->latinOneTableLen+ch] |= (tertiary << *terShift); in ucol_addLatinOneEntry()
6217 ucol_resizeLatinOneTable(UCollator *coll, int32_t size, UErrorCode *status) { in ucol_resizeLatinOneTable() argument
6221 coll->latinOneFailed = TRUE; in ucol_resizeLatinOneTable()
6224 … int32_t sizeToCopy = ((size<coll->latinOneTableLen)?size:coll->latinOneTableLen)*sizeof(uint32_t); in ucol_resizeLatinOneTable()
6226 uprv_memcpy(newTable, coll->latinOneCEs, sizeToCopy); in ucol_resizeLatinOneTable()
6227 uprv_memcpy(newTable+size, coll->latinOneCEs+coll->latinOneTableLen, sizeToCopy); in ucol_resizeLatinOneTable()
6228 uprv_memcpy(newTable+2*size, coll->latinOneCEs+2*coll->latinOneTableLen, sizeToCopy); in ucol_resizeLatinOneTable()
6229 coll->latinOneTableLen = size; in ucol_resizeLatinOneTable()
6230 uprv_free(coll->latinOneCEs); in ucol_resizeLatinOneTable()
6231 coll->latinOneCEs = newTable; in ucol_resizeLatinOneTable()
6236 ucol_setUpLatinOne(UCollator *coll, UErrorCode *status) { in ucol_setUpLatinOne() argument
6238 if(coll->latinOneCEs == NULL) { in ucol_setUpLatinOne()
6239 coll->latinOneCEs = (uint32_t *)uprv_malloc(sizeof(uint32_t)*UCOL_LATINONETABLELEN*3); in ucol_setUpLatinOne()
6240 if(coll->latinOneCEs == NULL) { in ucol_setUpLatinOne()
6244 coll->latinOneTableLen = UCOL_LATINONETABLELEN; in ucol_setUpLatinOne()
6247 UCollationElements *it = ucol_openElements(coll, &ch, 1, status); in ucol_setUpLatinOne()
6252 uprv_memset(coll->latinOneCEs, 0, sizeof(uint32_t)*coll->latinOneTableLen*3); in ucol_setUpLatinOne()
6262 CE = coll->latinOneMapping[ch]; in ucol_setUpLatinOne()
6264 CE = UTRIE_GET32_FROM_LEAD(&coll->mapping, ch); in ucol_setUpLatinOne()
6265 if(CE == UCOL_NOT_FOUND && coll->UCA) { in ucol_setUpLatinOne()
6266 CE = UTRIE_GET32_FROM_LEAD(&coll->UCA->mapping, ch); in ucol_setUpLatinOne()
6270 ucol_addLatinOneEntry(coll, ch, CE, &primShift, &secShift, &terShift); in ucol_setUpLatinOne()
6278 coll->latinOneCEs[ch] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6279 coll->latinOneCEs[coll->latinOneTableLen+ch] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6280 coll->latinOneCEs[2*coll->latinOneTableLen+ch] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6283 ucol_addLatinOneEntry(coll, ch, CE, &primShift, &secShift, &terShift); in ucol_setUpLatinOne()
6298 const UChar *UCharOffset = (UChar *)coll->image+getContractOffset(CE); in ucol_setUpLatinOne()
6302 coll->latinOneCEs[ch] = CE; in ucol_setUpLatinOne()
6303 coll->latinOneCEs[coll->latinOneTableLen+ch] = CE; in ucol_setUpLatinOne()
6304 coll->latinOneCEs[2*coll->latinOneTableLen+ch] = CE; in ucol_setUpLatinOne()
6309 CE = *(coll->contractionCEs + in ucol_setUpLatinOne()
6310 (UCharOffset - coll->contractionIndex)); in ucol_setUpLatinOne()
6314 …uint32_t *CEOffset = (uint32_t *)coll->image+getExpansionOffset(CE); /* find the offset to expansi… in ucol_setUpLatinOne()
6320 … coll->latinOneCEs[(UChar)contractionOffset] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6321 … coll->latinOneCEs[coll->latinOneTableLen+(UChar)contractionOffset] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6322 … coll->latinOneCEs[2*coll->latinOneTableLen+(UChar)contractionOffset] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6325 …ucol_addLatinOneEntry(coll, (UChar)contractionOffset, *CEOffset++, &primShift, &secShift, &terShif… in ucol_setUpLatinOne()
6330 … coll->latinOneCEs[(UChar)contractionOffset] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6331 … coll->latinOneCEs[coll->latinOneTableLen+(UChar)contractionOffset] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6332 … coll->latinOneCEs[2*coll->latinOneTableLen+(UChar)contractionOffset] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6335 …ucol_addLatinOneEntry(coll, (UChar)contractionOffset, *CEOffset++, &primShift, &secShift, &terShif… in ucol_setUpLatinOne()
6340 … ucol_addLatinOneEntry(coll, (UChar)contractionOffset++, CE, &primShift, &secShift, &terShift); in ucol_setUpLatinOne()
6342 coll->latinOneCEs[(UChar)contractionOffset] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6343 … coll->latinOneCEs[coll->latinOneTableLen+(UChar)contractionOffset] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6344 … coll->latinOneCEs[2*coll->latinOneTableLen+(UChar)contractionOffset] = UCOL_BAIL_OUT_CE; in ucol_setUpLatinOne()
6349 if(contractionOffset == coll->latinOneTableLen) { // we need to reallocate in ucol_setUpLatinOne()
6350 if(!ucol_resizeLatinOneTable(coll, 2*coll->latinOneTableLen, status)) { in ucol_setUpLatinOne()
6363 ucol_addLatinOneEntry(coll, ch, CE, &primShift, &secShift, &terShift); in ucol_setUpLatinOne()
6376 if(contractionOffset < coll->latinOneTableLen) { in ucol_setUpLatinOne()
6377 if(!ucol_resizeLatinOneTable(coll, contractionOffset, status)) { in ucol_setUpLatinOne()
6386 coll->latinOneFailed = TRUE; in ucol_setUpLatinOne()
6391 void ucol_updateInternalState(UCollator *coll, UErrorCode *status) { in ucol_updateInternalState() argument
6393 if(coll->caseFirst == UCOL_UPPER_FIRST) { in ucol_updateInternalState()
6394 coll->caseSwitch = UCOL_CASE_SWITCH; in ucol_updateInternalState()
6396 coll->caseSwitch = UCOL_NO_CASE_SWITCH; in ucol_updateInternalState()
6399 if(coll->caseLevel == UCOL_ON || coll->caseFirst == UCOL_OFF) { in ucol_updateInternalState()
6400 coll->tertiaryMask = UCOL_REMOVE_CASE; in ucol_updateInternalState()
6401 coll->tertiaryCommon = UCOL_COMMON3_NORMAL; in ucol_updateInternalState()
6402 coll->tertiaryAddition = (int8_t)UCOL_FLAG_BIT_MASK_CASE_SW_OFF; /* Should be 0x80 */ in ucol_updateInternalState()
6403 coll->tertiaryTop = UCOL_COMMON_TOP3_CASE_SW_OFF; in ucol_updateInternalState()
6404 coll->tertiaryBottom = UCOL_COMMON_BOT3; in ucol_updateInternalState()
6406 coll->tertiaryMask = UCOL_KEEP_CASE; in ucol_updateInternalState()
6407 coll->tertiaryAddition = UCOL_FLAG_BIT_MASK_CASE_SW_ON; in ucol_updateInternalState()
6408 if(coll->caseFirst == UCOL_UPPER_FIRST) { in ucol_updateInternalState()
6409 coll->tertiaryCommon = UCOL_COMMON3_UPPERFIRST; in ucol_updateInternalState()
6410 coll->tertiaryTop = UCOL_COMMON_TOP3_CASE_SW_UPPER; in ucol_updateInternalState()
6411 coll->tertiaryBottom = UCOL_COMMON_BOTTOM3_CASE_SW_UPPER; in ucol_updateInternalState()
6413 coll->tertiaryCommon = UCOL_COMMON3_NORMAL; in ucol_updateInternalState()
6414 coll->tertiaryTop = UCOL_COMMON_TOP3_CASE_SW_LOWER; in ucol_updateInternalState()
6415 coll->tertiaryBottom = UCOL_COMMON_BOTTOM3_CASE_SW_LOWER; in ucol_updateInternalState()
6420 uint8_t tertiaryTotal = (uint8_t)(coll->tertiaryTop - coll->tertiaryBottom - 1); in ucol_updateInternalState()
6421 …coll->tertiaryTopCount = (uint8_t)(UCOL_PROPORTION3*tertiaryTotal); /* we multilply double with in… in ucol_updateInternalState()
6422 coll->tertiaryBottomCount = (uint8_t)(tertiaryTotal - coll->tertiaryTopCount); in ucol_updateInternalState()
6424 if(coll->caseLevel == UCOL_OFF && coll->strength == UCOL_TERTIARY in ucol_updateInternalState()
6425 && coll->frenchCollation == UCOL_OFF && coll->alternateHandling == UCOL_NON_IGNORABLE) in ucol_updateInternalState()
6427 coll->sortKeyGen = ucol_calcSortKeySimpleTertiary; in ucol_updateInternalState()
6429 coll->sortKeyGen = ucol_calcSortKey; in ucol_updateInternalState()
6431 …if(coll->caseLevel == UCOL_OFF && coll->strength <= UCOL_TERTIARY && coll->numericCollation == UCO… in ucol_updateInternalState()
6432 && coll->alternateHandling == UCOL_NON_IGNORABLE && !coll->latinOneFailed) in ucol_updateInternalState()
6434 if(coll->latinOneCEs == NULL || coll->latinOneRegenTable) { in ucol_updateInternalState()
6435 … if(ucol_setUpLatinOne(coll, status)) { // if we succeed in building latin1 table, we'll use it in ucol_updateInternalState()
6437 coll->latinOneUse = TRUE; in ucol_updateInternalState()
6439 coll->latinOneUse = FALSE; in ucol_updateInternalState()
6445 coll->latinOneUse = TRUE; in ucol_updateInternalState()
6448 coll->latinOneUse = FALSE; in ucol_updateInternalState()
6454 ucol_setVariableTop(UCollator *coll, const UChar *varTop, int32_t len, UErrorCode *status) { in ucol_setVariableTop() argument
6455 if(U_FAILURE(*status) || coll == NULL) { in ucol_setVariableTop()
6467 IInit_collIterate(coll, varTop, len, &s, status); in ucol_setVariableTop()
6472 uint32_t CE = ucol_IGetNextCE(coll, &s, status); in ucol_setVariableTop()
6482 uint32_t nextCE = ucol_IGetNextCE(coll, &s, status); in ucol_setVariableTop()
6488 if(coll->variableTopValue != (CE & UCOL_PRIMARYMASK)>>16) { in ucol_setVariableTop()
6489 coll->variableTopValueisDefault = FALSE; in ucol_setVariableTop()
6490 coll->variableTopValue = (CE & UCOL_PRIMARYMASK)>>16; in ucol_setVariableTop()
6499 U_CAPI uint32_t U_EXPORT2 ucol_getVariableTop(const UCollator *coll, UErrorCode *status) { in ucol_getVariableTop() argument
6500 if(U_FAILURE(*status) || coll == NULL) { in ucol_getVariableTop()
6503 return coll->variableTopValue<<16; in ucol_getVariableTop()
6507 ucol_restoreVariableTop(UCollator *coll, const uint32_t varTop, UErrorCode *status) { in ucol_restoreVariableTop() argument
6508 if(U_FAILURE(*status) || coll == NULL) { in ucol_restoreVariableTop()
6512 if(coll->variableTopValue != (varTop & UCOL_PRIMARYMASK)>>16) { in ucol_restoreVariableTop()
6513 coll->variableTopValueisDefault = FALSE; in ucol_restoreVariableTop()
6514 coll->variableTopValue = (varTop & UCOL_PRIMARYMASK)>>16; in ucol_restoreVariableTop()
6519 ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value, UErrorCode *status… in ucol_setAttribute() argument
6520 if(U_FAILURE(*status) || coll == NULL) { in ucol_setAttribute()
6524 UColAttributeValue oldFrench = coll->frenchCollation; in ucol_setAttribute()
6525 UColAttributeValue oldCaseFirst = coll->caseFirst; in ucol_setAttribute()
6529 coll->numericCollation = UCOL_ON; in ucol_setAttribute()
6530 coll->numericCollationisDefault = FALSE; in ucol_setAttribute()
6532 coll->numericCollation = UCOL_OFF; in ucol_setAttribute()
6533 coll->numericCollationisDefault = FALSE; in ucol_setAttribute()
6535 coll->numericCollationisDefault = TRUE; in ucol_setAttribute()
6536 coll->numericCollation = (UColAttributeValue)coll->options->numericCollation; in ucol_setAttribute()
6543 coll->hiraganaQ = UCOL_ON; in ucol_setAttribute()
6544 coll->hiraganaQisDefault = FALSE; in ucol_setAttribute()
6546 coll->hiraganaQ = UCOL_OFF; in ucol_setAttribute()
6547 coll->hiraganaQisDefault = FALSE; in ucol_setAttribute()
6549 coll->hiraganaQisDefault = TRUE; in ucol_setAttribute()
6550 coll->hiraganaQ = (UColAttributeValue)coll->options->hiraganaQ; in ucol_setAttribute()
6557 coll->frenchCollation = UCOL_ON; in ucol_setAttribute()
6558 coll->frenchCollationisDefault = FALSE; in ucol_setAttribute()
6560 coll->frenchCollation = UCOL_OFF; in ucol_setAttribute()
6561 coll->frenchCollationisDefault = FALSE; in ucol_setAttribute()
6563 coll->frenchCollationisDefault = TRUE; in ucol_setAttribute()
6564 coll->frenchCollation = (UColAttributeValue)coll->options->frenchCollation; in ucol_setAttribute()
6571 coll->alternateHandling = UCOL_SHIFTED; in ucol_setAttribute()
6572 coll->alternateHandlingisDefault = FALSE; in ucol_setAttribute()
6574 coll->alternateHandling = UCOL_NON_IGNORABLE; in ucol_setAttribute()
6575 coll->alternateHandlingisDefault = FALSE; in ucol_setAttribute()
6577 coll->alternateHandlingisDefault = TRUE; in ucol_setAttribute()
6578 coll->alternateHandling = (UColAttributeValue)coll->options->alternateHandling ; in ucol_setAttribute()
6585 coll->caseFirst = UCOL_LOWER_FIRST; in ucol_setAttribute()
6586 coll->caseFirstisDefault = FALSE; in ucol_setAttribute()
6588 coll->caseFirst = UCOL_UPPER_FIRST; in ucol_setAttribute()
6589 coll->caseFirstisDefault = FALSE; in ucol_setAttribute()
6591 coll->caseFirst = UCOL_OFF; in ucol_setAttribute()
6592 coll->caseFirstisDefault = FALSE; in ucol_setAttribute()
6594 coll->caseFirst = (UColAttributeValue)coll->options->caseFirst; in ucol_setAttribute()
6595 coll->caseFirstisDefault = TRUE; in ucol_setAttribute()
6602 coll->caseLevel = UCOL_ON; in ucol_setAttribute()
6603 coll->caseLevelisDefault = FALSE; in ucol_setAttribute()
6605 coll->caseLevel = UCOL_OFF; in ucol_setAttribute()
6606 coll->caseLevelisDefault = FALSE; in ucol_setAttribute()
6608 coll->caseLevel = (UColAttributeValue)coll->options->caseLevel; in ucol_setAttribute()
6609 coll->caseLevelisDefault = TRUE; in ucol_setAttribute()
6616 coll->normalizationMode = UCOL_ON; in ucol_setAttribute()
6617 coll->normalizationModeisDefault = FALSE; in ucol_setAttribute()
6620 coll->normalizationMode = UCOL_OFF; in ucol_setAttribute()
6621 coll->normalizationModeisDefault = FALSE; in ucol_setAttribute()
6623 coll->normalizationModeisDefault = TRUE; in ucol_setAttribute()
6624 coll->normalizationMode = (UColAttributeValue)coll->options->normalizationMode; in ucol_setAttribute()
6625 if(coll->normalizationMode == UCOL_ON) { in ucol_setAttribute()
6634 coll->strengthisDefault = TRUE; in ucol_setAttribute()
6635 coll->strength = (UColAttributeValue)coll->options->strength; in ucol_setAttribute()
6637 coll->strengthisDefault = FALSE; in ucol_setAttribute()
6638 coll->strength = value; in ucol_setAttribute()
6648 if(oldFrench != coll->frenchCollation || oldCaseFirst != coll->caseFirst) { in ucol_setAttribute()
6649 coll->latinOneRegenTable = TRUE; in ucol_setAttribute()
6651 coll->latinOneRegenTable = FALSE; in ucol_setAttribute()
6653 ucol_updateInternalState(coll, status); in ucol_setAttribute()
6657 ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status) { in ucol_getAttribute() argument
6658 if(U_FAILURE(*status) || coll == NULL) { in ucol_getAttribute()
6663 return coll->numericCollation; in ucol_getAttribute()
6665 return coll->hiraganaQ; in ucol_getAttribute()
6667 return coll->frenchCollation; in ucol_getAttribute()
6669 return coll->alternateHandling; in ucol_getAttribute()
6671 return coll->caseFirst; in ucol_getAttribute()
6673 return coll->caseLevel; in ucol_getAttribute()
6675 return coll->normalizationMode; in ucol_getAttribute()
6677 return coll->strength; in ucol_getAttribute()
6687 ucol_setStrength( UCollator *coll, in ucol_setStrength() argument
6691 ucol_setAttribute(coll, UCOL_STRENGTH, strength, &status); in ucol_setStrength()
6695 ucol_getStrength(const UCollator *coll) in ucol_getStrength() argument
6698 return ucol_getAttribute(coll, UCOL_STRENGTH, &status); in ucol_getStrength()
6702 ucol_getReorderCodes(const UCollator *coll, in ucol_getReorderCodes() argument
6716 printf("coll->reorderCodesLength = %d\n", coll->reorderCodesLength); in ucol_getReorderCodes()
6717 printf("coll->defaultReorderCodesLength = %d\n", coll->defaultReorderCodesLength); in ucol_getReorderCodes()
6720 if (coll->reorderCodesLength > destCapacity) { in ucol_getReorderCodes()
6722 return coll->reorderCodesLength; in ucol_getReorderCodes()
6724 for (int32_t i = 0; i < coll->reorderCodesLength; i++) { in ucol_getReorderCodes()
6725 dest[i] = coll->reorderCodes[i]; in ucol_getReorderCodes()
6727 return coll->reorderCodesLength; in ucol_getReorderCodes()
6731 ucol_setReorderCodes(UCollator* coll, in ucol_setReorderCodes() argument
6744 if (coll->reorderCodes != NULL && coll->freeReorderCodesOnClose == TRUE) { in ucol_setReorderCodes()
6745 uprv_free(coll->reorderCodes); in ucol_setReorderCodes()
6747 coll->reorderCodes = NULL; in ucol_setReorderCodes()
6748 coll->reorderCodesLength = 0; in ucol_setReorderCodes()
6750 … if (coll->leadBytePermutationTable != NULL && coll->freeLeadBytePermutationTableOnClose == TRUE) { in ucol_setReorderCodes()
6751 uprv_free(coll->leadBytePermutationTable); in ucol_setReorderCodes()
6753 coll->leadBytePermutationTable = NULL; in ucol_setReorderCodes()
6756 coll->reorderCodes = (int32_t*) uprv_malloc(reorderCodesLength * sizeof(int32_t)); in ucol_setReorderCodes()
6757 if (coll->reorderCodes == NULL) { in ucol_setReorderCodes()
6761 coll->freeReorderCodesOnClose = TRUE; in ucol_setReorderCodes()
6763 coll->reorderCodes[i] = reorderCodes[i]; in ucol_setReorderCodes()
6765 coll->reorderCodesLength = reorderCodesLength; in ucol_setReorderCodes()
6766 ucol_buildPermutationTable(coll, status); in ucol_setReorderCodes()
6838 ucol_getVersion(const UCollator* coll, in ucol_getVersion() argument
6844 uint8_t bdVersion = coll->image->version[0]; in ucol_getVersion()
6858 versionInfo[2] = coll->image->version[1]; in ucol_getVersion()
6859 if(coll->UCA) { in ucol_getVersion()
6861 …versionInfo[3] = (coll->UCA->image->UCAVersion[0] & 0x1f) << 3 | (coll->UCA->image->UCAVersion[1] … in ucol_getVersion()
6870 ucol_isTailored(const UCollator *coll, const UChar u, UErrorCode *status) { in ucol_isTailored() argument
6871 if(U_FAILURE(*status) || coll == NULL || coll == coll->UCA) { in ucol_isTailored()
6878 CE = coll->latinOneMapping[u]; in ucol_isTailored()
6879 if(coll->UCA && CE == coll->UCA->latinOneMapping[u]) { in ucol_isTailored()
6883 CE = UTRIE_GET32_FROM_LEAD(&coll->mapping, u); in ucol_isTailored()
6887 ContractionStart = (UChar *)coll->image+getContractOffset(CE); in ucol_isTailored()
6888 CE = *(coll->contractionCEs + (ContractionStart- coll->contractionIndex)); in ucol_isTailored()
7030 const UCollator *coll = sColl->coll; in ucol_compareUsingSortKeys() local
7061 sourceKeyLen = ucol_getSortKey(coll, source, sourceLength, sourceKeyP, sourceKeyLen); in ucol_compareUsingSortKeys()
7068 sourceKeyLen = ucol_getSortKey(coll, source, sourceLength, sourceKeyP, sourceKeyLen); in ucol_compareUsingSortKeys()
7071 targetKeyLen = ucol_getSortKey(coll, target, targetLength, targetKeyP, targetKeyLen); in ucol_compareUsingSortKeys()
7078 targetKeyLen = ucol_getSortKey(coll, target, targetLength, targetKeyP, targetKeyLen); in ucol_compareUsingSortKeys()
7107 const UCollator *coll = sColl->coll; in ucol_strcollRegular() local
7111 UColAttributeValue strength = coll->strength; in ucol_strcollRegular()
7118 UBool checkCase = (coll->caseLevel == UCOL_ON); in ucol_strcollRegular()
7119 UBool isFrenchSec = (coll->frenchCollation == UCOL_ON) && checkSecTer; in ucol_strcollRegular()
7120 UBool shifted = (coll->alternateHandling == UCOL_SHIFTED); in ucol_strcollRegular()
7122 UBool doHiragana = (coll->hiraganaQ == UCOL_ON) && checkQuad; in ucol_strcollRegular()
7127 uint8_t caseSwitch = coll->caseSwitch; in ucol_strcollRegular()
7128 uint8_t tertiaryMask = coll->tertiaryMask; in ucol_strcollRegular()
7131 uint32_t LVT = (shifted)?(coll->variableTopValue<<16):0; in ucol_strcollRegular()
7152 sOrder = ucol_IGetNextCE(coll, sColl, status); in ucol_strcollRegular()
7161 tOrder = ucol_IGetNextCE(coll, tColl, status); in ucol_strcollRegular()
7181 if (coll->leadBytePermutationTable != NULL && !isContinuation(sOrder)) { in ucol_strcollRegular()
7182 … sOrder = (coll->leadBytePermutationTable[sOrder>>24] << 24) | (sOrder & 0x00FFFFFF); in ucol_strcollRegular()
7183 … tOrder = (coll->leadBytePermutationTable[tOrder>>24] << 24) | (tOrder & 0x00FFFFFF); in ucol_strcollRegular()
7197 sOrder = ucol_IGetNextCE(coll, sColl, status); in ucol_strcollRegular()
7223 if(coll->leadBytePermutationTable != NULL){ in ucol_strcollRegular()
7224 … sOrder = (coll->leadBytePermutationTable[sOrder>>24] << 24) | (sOrder & 0x00FFFFFF); in ucol_strcollRegular()
7247 tOrder = ucol_IGetNextCE(coll, tColl, status); in ucol_strcollRegular()
7273 if(coll->leadBytePermutationTable != NULL){ in ucol_strcollRegular()
7274 … tOrder = (coll->leadBytePermutationTable[tOrder>>24] << 24) | (tOrder & 0x00FFFFFF); in ucol_strcollRegular()
7592 ucol_strcollRegular(const UCollator *coll, in ucol_strcollRegular() argument
7598 IInit_collIterate(coll, source, sourceLength, &sColl, status); in ucol_strcollRegular()
7599 IInit_collIterate(coll, target, targetLength, &tColl, status); in ucol_strcollRegular()
7607 ucol_getLatinOneContraction(const UCollator *coll, int32_t strength, in ucol_getLatinOneContraction() argument
7610 const UChar *UCharOffset = (UChar *)coll->image+getContractOffset(CE&0xFFF); in ucol_getLatinOneContraction()
7618 return(coll->latinOneCEs[strength*coll->latinOneTableLen+latinOneOffset]); in ucol_getLatinOneContraction()
7624 return(coll->latinOneCEs[strength*coll->latinOneTableLen+latinOneOffset]); in ucol_getLatinOneContraction()
7636 return(coll->latinOneCEs[strength*coll->latinOneTableLen+latinOneOffset+offset]); in ucol_getLatinOneContraction()
7644 uint32_t isZeroCE = UTRIE_GET32_FROM_LEAD(&coll->mapping, schar); in ucol_getLatinOneContraction()
7650 return(coll->latinOneCEs[strength*coll->latinOneTableLen+latinOneOffset]); in ucol_getLatinOneContraction()
7666 ucol_strcollUseLatin1( const UCollator *coll, in ucol_strcollUseLatin1() argument
7674 int32_t strength = coll->strength; in ucol_strcollUseLatin1()
7682 uint32_t *elements = coll->latinOneCEs; in ucol_strcollUseLatin1()
7706 return ucol_strcollRegular(coll, source, sLen, target, tLen, status); in ucol_strcollUseLatin1()
7713 … sOrder = ucol_getLatinOneContraction(coll, UCOL_PRIMARY, sOrder, source, &sIndex, sLen); in ucol_strcollUseLatin1()
7720 return ucol_strcollRegular(coll, source, sLen, target, tLen, status); in ucol_strcollUseLatin1()
7752 return ucol_strcollRegular(coll, source, sLen, target, tLen, status); in ucol_strcollUseLatin1()
7758 … tOrder = ucol_getLatinOneContraction(coll, UCOL_PRIMARY, tOrder, target, &tIndex, tLen); in ucol_strcollUseLatin1()
7763 return ucol_strcollRegular(coll, source, sLen, target, tLen, status); in ucol_strcollUseLatin1()
7799 elements += coll->latinOneTableLen; in ucol_strcollUseLatin1()
7802 if(coll->frenchCollation == UCOL_OFF) { // non French in ucol_strcollUseLatin1()
7817 … sOrder = ucol_getLatinOneContraction(coll, UCOL_SECONDARY, sOrder, source, &sIndex, sLen); in ucol_strcollUseLatin1()
7832 … tOrder = ucol_getLatinOneContraction(coll, UCOL_SECONDARY, tOrder, target, &tIndex, tLen); in ucol_strcollUseLatin1()
7858 return ucol_strcollRegular(coll, source, sLen, target, tLen, status); in ucol_strcollUseLatin1()
7911 elements += coll->latinOneTableLen; in ucol_strcollUseLatin1()
7923 … sOrder = ucol_getLatinOneContraction(coll, UCOL_TERTIARY, sOrder, source, &sIndex, sLen); in ucol_strcollUseLatin1()
7937 … tOrder = ucol_getLatinOneContraction(coll, UCOL_TERTIARY, tOrder, target, &tIndex, tLen); in ucol_strcollUseLatin1()
7964 ucol_strcollIter( const UCollator *coll, in ucol_strcollIter() argument
7974 UTRACE_DATA3(UTRACE_VERBOSE, "coll=%p, sIter=%p, tIter=%p", coll, sIter, tIter); in ucol_strcollIter()
7980 if(sIter == NULL || tIter == NULL || coll == NULL) { in ucol_strcollIter()
7990 IInit_collIterate(coll, NULL, -1, &sColl, status); in ucol_strcollIter()
7991 IInit_collIterate(coll, NULL, -1, &tColl, status); in ucol_strcollIter()
8008 if(ucol_getAttribute(coll, UCOL_NORMALIZATION_MODE, status) == UCOL_ON) { in ucol_strcollIter()
8039 if (ucol_unsafeCP((UChar)sChar, coll) || ucol_unsafeCP((UChar)tChar, coll)) in ucol_strcollIter()
8049 while (sChar != U_SENTINEL && ucol_unsafeCP((UChar)sChar, coll)); in ucol_strcollIter()
8072 ucol_strcoll( const UCollator *coll, in ucol_strcoll() argument
8082 UTRACE_DATA3(UTRACE_VERBOSE, "coll=%p, source=%p, target=%p", coll, source, target); in ucol_strcoll()
8159 if ((pSrc != source+sourceLength && ucol_unsafeCP(*pSrc, coll)) || in ucol_strcoll()
8160 (pTarg != target+targetLength && ucol_unsafeCP(*pTarg, coll))) in ucol_strcoll()
8170 while (equalLength>0 && ucol_unsafeCP(*pSrc, coll)); in ucol_strcoll()
8185 …if(!coll->latinOneUse || (sourceLength > 0 && *source&0xff00) || (targetLength > 0 && *target&0xff… in ucol_strcoll()
8186 returnVal = ucol_strcollRegular(coll, source, sourceLength, target, targetLength, &status); in ucol_strcoll()
8188 … returnVal = ucol_strcollUseLatin1(coll, source, sourceLength, target, targetLength, &status); in ucol_strcoll()
8196 ucol_greater( const UCollator *coll, in ucol_greater() argument
8202 return (ucol_strcoll(coll, source, sourceLength, target, targetLength) in ucol_greater()
8208 ucol_greaterOrEqual( const UCollator *coll, in ucol_greaterOrEqual() argument
8214 return (ucol_strcoll(coll, source, sourceLength, target, targetLength) in ucol_greaterOrEqual()
8220 ucol_equal( const UCollator *coll, in ucol_equal() argument
8226 return (ucol_strcoll(coll, source, sourceLength, target, targetLength) in ucol_equal()
8231 ucol_getUCAVersion(const UCollator* coll, UVersionInfo info) { in ucol_getUCAVersion() argument
8232 if(coll && coll->UCA) { in ucol_getUCAVersion()
8233 uprv_memcpy(info, coll->UCA->image->UCAVersion, sizeof(UVersionInfo)); in ucol_getUCAVersion()