• Home
  • Raw
  • Download

Lines Matching refs:cnv

152 ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)  in ucnv_safeClone()  argument
186 if (!pBufferSize || !cnv){ in ucnv_safeClone()
193 ucnv_getName(cnv, status), cnv, stackBuffer); in ucnv_safeClone()
195 if (cnv->sharedData->impl->safeClone != NULL) { in ucnv_safeClone()
198 cnv->sharedData->impl->safeClone(cnv, NULL, &bufferSizeNeeded, status); in ucnv_safeClone()
256 uprv_memcpy(localConverter, cnv, sizeof(UConverter)); in ucnv_safeClone()
260 if (cnv->subChars == (uint8_t *)cnv->subUChars) { in ucnv_safeClone()
269 … uprv_memcpy(localConverter->subChars, cnv->subChars, UCNV_ERROR_BUFFER_LENGTH * U_SIZEOF_UCHAR); in ucnv_safeClone()
273 if (cnv->sharedData->impl->safeClone != NULL) { in ucnv_safeClone()
275 localConverter = cnv->sharedData->impl->safeClone(cnv, localConverter, pBufferSize, status); in ucnv_safeClone()
293 if (cnv->sharedData->referenceCounter != ~0) { in ucnv_safeClone()
294 ucnv_incrementRefCount(cnv->sharedData); in ucnv_safeClone()
305 cnv->fromCharErrorBehaviour(cnv->toUContext, &toUArgs, NULL, 0, UCNV_CLONE, &cbErr); in ucnv_safeClone()
307 cnv->fromUCharErrorBehaviour(cnv->fromUContext, &fromUArgs, NULL, 0, 0, UCNV_CLONE, &cbErr); in ucnv_safeClone()
472 ucnv_setSubstString(UConverter *cnv, in ucnv_setSubstString() argument
485 clone = ucnv_safeClone(cnv, cloneBuffer, &cloneSize, err); in ucnv_setSubstString()
493 if (cnv->sharedData->impl->writeSub == NULL in ucnv_setSubstString()
495 || (cnv->sharedData->staticData->conversionType == UCNV_MBCS && in ucnv_setSubstString()
496 ucnv_MBCSGetType(cnv) != UCNV_EBCDIC_STATEFUL) in ucnv_setSubstString()
530 if (cnv->subChars == (uint8_t *)cnv->subUChars) { in ucnv_setSubstString()
532 cnv->subChars = (uint8_t *)uprv_malloc(UCNV_ERROR_BUFFER_LENGTH * U_SIZEOF_UCHAR); in ucnv_setSubstString()
533 if (cnv->subChars == NULL) { in ucnv_setSubstString()
534 cnv->subChars = (uint8_t *)cnv->subUChars; in ucnv_setSubstString()
538 uprv_memset(cnv->subChars, 0, UCNV_ERROR_BUFFER_LENGTH * U_SIZEOF_UCHAR); in ucnv_setSubstString()
544 cnv->subCharLen = 0; in ucnv_setSubstString()
546 uprv_memcpy(cnv->subChars, subChars, length8); in ucnv_setSubstString()
548 cnv->subCharLen = (int8_t)length8; in ucnv_setSubstString()
550 cnv->subCharLen = (int8_t)-length; in ucnv_setSubstString()
555 cnv->subChar1 = 0; in ucnv_setSubstString()
826 UConverter *cnv; in _fromUnicodeWithCallback() local
840 cnv=pArgs->converter; in _fromUnicodeWithCallback()
848 fromUnicode=cnv->sharedData->impl->fromUnicode; in _fromUnicodeWithCallback()
850 fromUnicode=cnv->sharedData->impl->fromUnicodeWithOffsets; in _fromUnicodeWithCallback()
853 fromUnicode=cnv->sharedData->impl->fromUnicode; in _fromUnicodeWithCallback()
859 if(cnv->preFromULength>=0) { in _fromUnicodeWithCallback()
878 uprv_memcpy(replay, cnv->preFromU, -cnv->preFromULength*U_SIZEOF_UCHAR); in _fromUnicodeWithCallback()
880 pArgs->sourceLimit=replay-cnv->preFromULength; in _fromUnicodeWithCallback()
884 cnv->preFromULength=0; in _fromUnicodeWithCallback()
914 cnv->fromUChar32==0); in _fromUnicodeWithCallback()
956 if(cnv->preFromULength<0) { in _fromUnicodeWithCallback()
967 uprv_memcpy(replay, cnv->preFromU, -cnv->preFromULength*U_SIZEOF_UCHAR); in _fromUnicodeWithCallback()
969 pArgs->sourceLimit=replay-cnv->preFromULength; in _fromUnicodeWithCallback()
971 if((sourceIndex+=cnv->preFromULength)<0) { in _fromUnicodeWithCallback()
975 cnv->preFromULength=0; in _fromUnicodeWithCallback()
1003 } else if(pArgs->flush && cnv->fromUChar32!=0) { in _fromUnicodeWithCallback()
1027 _reset(cnv, UCNV_RESET_FROM_UNICODE, FALSE); in _fromUnicodeWithCallback()
1060 U_ASSERT(cnv->preFromULength==0); in _fromUnicodeWithCallback()
1064 uprv_memcpy(cnv->preFromU, pArgs->source, length*U_SIZEOF_UCHAR); in _fromUnicodeWithCallback()
1065 cnv->preFromULength=(int8_t)-length; in _fromUnicodeWithCallback()
1082 codePoint=cnv->fromUChar32; in _fromUnicodeWithCallback()
1084 U16_APPEND_UNSAFE(cnv->invalidUCharBuffer, errorInputLength, codePoint); in _fromUnicodeWithCallback()
1085 cnv->invalidUCharLength=(int8_t)errorInputLength; in _fromUnicodeWithCallback()
1088 cnv->fromUChar32=0; in _fromUnicodeWithCallback()
1091 cnv->fromUCharErrorBehaviour(cnv->fromUContext, pArgs, in _fromUnicodeWithCallback()
1092 cnv->invalidUCharBuffer, errorInputLength, codePoint, in _fromUnicodeWithCallback()
1115 ucnv_outputOverflowFromUnicode(UConverter *cnv, in ucnv_outputOverflowFromUnicode() argument
1130 overflow=(char *)cnv->charErrorBuffer; in ucnv_outputOverflowFromUnicode()
1131 length=cnv->charErrorBufferLength; in ucnv_outputOverflowFromUnicode()
1142 cnv->charErrorBufferLength=(int8_t)j; in ucnv_outputOverflowFromUnicode()
1159 cnv->charErrorBufferLength=0; in ucnv_outputOverflowFromUnicode()
1168 ucnv_fromUnicode(UConverter *cnv, in ucnv_fromUnicode() argument
1183 if(cnv==NULL || target==NULL || source==NULL) { in ucnv_fromUnicode()
1229 if( cnv->charErrorBufferLength>0 && in ucnv_fromUnicode()
1230 ucnv_outputOverflowFromUnicode(cnv, target, targetLimit, &offsets, err) in ucnv_fromUnicode()
1237 if(!flush && s==sourceLimit && cnv->preFromULength>=0) { in ucnv_fromUnicode()
1251 args.converter=cnv; in ucnv_fromUnicode()
1271 UConverter *cnv; in _toUnicodeWithCallback() local
1285 cnv=pArgs->converter; in _toUnicodeWithCallback()
1293 toUnicode=cnv->sharedData->impl->toUnicode; in _toUnicodeWithCallback()
1295 toUnicode=cnv->sharedData->impl->toUnicodeWithOffsets; in _toUnicodeWithCallback()
1298 toUnicode=cnv->sharedData->impl->toUnicode; in _toUnicodeWithCallback()
1304 if(cnv->preToULength>=0) { in _toUnicodeWithCallback()
1323 uprv_memcpy(replay, cnv->preToU, -cnv->preToULength); in _toUnicodeWithCallback()
1325 pArgs->sourceLimit=replay-cnv->preToULength; in _toUnicodeWithCallback()
1329 cnv->preToULength=0; in _toUnicodeWithCallback()
1359 cnv->toULength==0); in _toUnicodeWithCallback()
1401 if(cnv->preToULength<0) { in _toUnicodeWithCallback()
1412 uprv_memcpy(replay, cnv->preToU, -cnv->preToULength); in _toUnicodeWithCallback()
1414 pArgs->sourceLimit=replay-cnv->preToULength; in _toUnicodeWithCallback()
1416 if((sourceIndex+=cnv->preToULength)<0) { in _toUnicodeWithCallback()
1420 cnv->preToULength=0; in _toUnicodeWithCallback()
1448 } else if(pArgs->flush && cnv->toULength>0) { in _toUnicodeWithCallback()
1472 _reset(cnv, UCNV_RESET_TO_UNICODE, FALSE); in _toUnicodeWithCallback()
1507 U_ASSERT(cnv->preToULength==0); in _toUnicodeWithCallback()
1511 uprv_memcpy(cnv->preToU, pArgs->source, length); in _toUnicodeWithCallback()
1512 cnv->preToULength=(int8_t)-length; in _toUnicodeWithCallback()
1525 errorInputLength=cnv->invalidCharLength=cnv->toULength; in _toUnicodeWithCallback()
1527 uprv_memcpy(cnv->invalidCharBuffer, cnv->toUBytes, errorInputLength); in _toUnicodeWithCallback()
1531 cnv->toULength=0; in _toUnicodeWithCallback()
1534 if(cnv->toUCallbackReason==UCNV_ILLEGAL && *err==U_INVALID_CHAR_FOUND) { in _toUnicodeWithCallback()
1535 cnv->toUCallbackReason = UCNV_UNASSIGNED; in _toUnicodeWithCallback()
1537 cnv->fromCharErrorBehaviour(cnv->toUContext, pArgs, in _toUnicodeWithCallback()
1538 cnv->invalidCharBuffer, errorInputLength, in _toUnicodeWithCallback()
1539 cnv->toUCallbackReason, in _toUnicodeWithCallback()
1541 cnv->toUCallbackReason = UCNV_ILLEGAL; /* reset to default value */ in _toUnicodeWithCallback()
1561 ucnv_outputOverflowToUnicode(UConverter *cnv, in ucnv_outputOverflowToUnicode() argument
1576 overflow=cnv->UCharErrorBuffer; in ucnv_outputOverflowToUnicode()
1577 length=cnv->UCharErrorBufferLength; in ucnv_outputOverflowToUnicode()
1588 cnv->UCharErrorBufferLength=(int8_t)j; in ucnv_outputOverflowToUnicode()
1605 cnv->UCharErrorBufferLength=0; in ucnv_outputOverflowToUnicode()
1614 ucnv_toUnicode(UConverter *cnv, in ucnv_toUnicode() argument
1629 if(cnv==NULL || target==NULL || source==NULL) { in ucnv_toUnicode()
1675 if( cnv->UCharErrorBufferLength>0 && in ucnv_toUnicode()
1676 ucnv_outputOverflowToUnicode(cnv, target, targetLimit, &offsets, err) in ucnv_toUnicode()
1683 if(!flush && s==sourceLimit && cnv->preToULength>=0) { in ucnv_toUnicode()
1697 args.converter=cnv; in ucnv_toUnicode()
1715 ucnv_fromUChars(UConverter *cnv, in ucnv_fromUChars() argument
1728 if( cnv==NULL || in ucnv_fromUChars()
1737 ucnv_resetFromUnicode(cnv); in ucnv_fromUChars()
1752 ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode); in ucnv_fromUChars()
1763 ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode); in ucnv_fromUChars()
1775 ucnv_toUChars(UConverter *cnv, in ucnv_toUChars() argument
1788 if( cnv==NULL || in ucnv_toUChars()
1797 ucnv_resetToUnicode(cnv); in ucnv_toUChars()
1812 ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode); in ucnv_toUChars()
1824 ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode); in ucnv_toUChars()
1839 ucnv_getNextUChar(UConverter *cnv, in ucnv_getNextUChar() argument
1853 if(cnv==NULL || source==NULL) { in ucnv_getNextUChar()
1884 if(cnv->UCharErrorBufferLength>0) { in ucnv_getNextUChar()
1887 overflow=cnv->UCharErrorBuffer; in ucnv_getNextUChar()
1889 length=cnv->UCharErrorBufferLength; in ucnv_getNextUChar()
1893 if((cnv->UCharErrorBufferLength=(int8_t)(length-i))>0) { in ucnv_getNextUChar()
1894 uprv_memmove(cnv->UCharErrorBuffer, cnv->UCharErrorBuffer+i, in ucnv_getNextUChar()
1895 cnv->UCharErrorBufferLength*U_SIZEOF_UCHAR); in ucnv_getNextUChar()
1916 args.converter=cnv; in ucnv_getNextUChar()
1934 if(cnv->toULength==0 && cnv->sharedData->impl->getNextUChar!=NULL) { in ucnv_getNextUChar()
1935 c=cnv->sharedData->impl->getNextUChar(&args, err); in ucnv_getNextUChar()
1939 _reset(cnv, UCNV_RESET_TO_UNICODE, FALSE); in ucnv_getNextUChar()
1986 if(cnv->UCharErrorBufferLength>0) { in ucnv_getNextUChar()
1988 if(U16_IS_TRAIL(c2=cnv->UCharErrorBuffer[0])) { in ucnv_getNextUChar()
1993 if((--cnv->UCharErrorBufferLength)>0) { in ucnv_getNextUChar()
1994 uprv_memmove(cnv->UCharErrorBuffer, cnv->UCharErrorBuffer+1, in ucnv_getNextUChar()
1995 cnv->UCharErrorBufferLength*U_SIZEOF_UCHAR); in ucnv_getNextUChar()
2025 if((length=cnv->UCharErrorBufferLength)>0) { in ucnv_getNextUChar()
2026 uprv_memmove(cnv->UCharErrorBuffer+delta, cnv->UCharErrorBuffer, in ucnv_getNextUChar()
2029 cnv->UCharErrorBufferLength=(int8_t)(length+delta); in ucnv_getNextUChar()
2031 cnv->UCharErrorBuffer[0]=buffer[i++]; in ucnv_getNextUChar()
2033 cnv->UCharErrorBuffer[1]=buffer[i]; in ucnv_getNextUChar()
2527 UConverter *cnv, in ucnv_convertAlgorithmic() argument
2539 if( cnv==NULL || source==NULL || sourceLength<-1 || in ucnv_convertAlgorithmic()
2561 ucnv_resetToUnicode(cnv); in ucnv_convertAlgorithmic()
2563 from=cnv; in ucnv_convertAlgorithmic()
2566 ucnv_resetFromUnicode(cnv); in ucnv_convertAlgorithmic()
2568 to=cnv; in ucnv_convertAlgorithmic()
2583 UConverter *cnv, in ucnv_toAlgorithmic() argument
2587 return ucnv_convertAlgorithmic(TRUE, algorithmicType, cnv, in ucnv_toAlgorithmic()
2594 ucnv_fromAlgorithmic(UConverter *cnv, in ucnv_fromAlgorithmic() argument
2599 return ucnv_convertAlgorithmic(FALSE, algorithmicType, cnv, in ucnv_fromAlgorithmic()
2633 static const UAmbiguousConverter *ucnv_getAmbiguous(const UConverter *cnv) in ucnv_getAmbiguous() argument
2639 if(cnv==NULL) { in ucnv_getAmbiguous()
2644 name=ucnv_getName(cnv, &errorCode); in ucnv_getAmbiguous()
2661 ucnv_fixFileSeparator(const UConverter *cnv, in ucnv_fixFileSeparator() argument
2668 if(cnv==NULL || source==NULL || sourceLength<=0 || (a=ucnv_getAmbiguous(cnv))==NULL) in ucnv_fixFileSeparator()
2682 ucnv_isAmbiguous(const UConverter *cnv) { in ucnv_isAmbiguous() argument
2683 return (UBool)(ucnv_getAmbiguous(cnv)!=NULL); in ucnv_isAmbiguous()
2687 ucnv_setFallback(UConverter *cnv, UBool usesFallback) in ucnv_setFallback() argument
2689 cnv->useFallback = usesFallback; in ucnv_setFallback()
2693 ucnv_usesFallback(const UConverter *cnv) in ucnv_usesFallback() argument
2695 return cnv->useFallback; in ucnv_usesFallback()
2842 ucnv_fromUCountPending(const UConverter* cnv, UErrorCode* status) in ucnv_fromUCountPending() argument
2847 if(cnv == NULL){ in ucnv_fromUCountPending()
2852 if(cnv->preFromULength > 0){ in ucnv_fromUCountPending()
2853 return U16_LENGTH(cnv->preFromUFirstCP)+cnv->preFromULength ; in ucnv_fromUCountPending()
2854 }else if(cnv->preFromULength < 0){ in ucnv_fromUCountPending()
2855 return -cnv->preFromULength ; in ucnv_fromUCountPending()
2856 }else if(cnv->fromUChar32 > 0){ in ucnv_fromUCountPending()
2858 }else if(cnv->preFromUFirstCP >0){ in ucnv_fromUCountPending()
2859 return U16_LENGTH(cnv->preFromUFirstCP); in ucnv_fromUCountPending()
2866 ucnv_toUCountPending(const UConverter* cnv, UErrorCode* status){ in ucnv_toUCountPending() argument
2871 if(cnv == NULL){ in ucnv_toUCountPending()
2876 if(cnv->preToULength > 0){ in ucnv_toUCountPending()
2877 return cnv->preToULength ; in ucnv_toUCountPending()
2878 }else if(cnv->preToULength < 0){ in ucnv_toUCountPending()
2879 return -cnv->preToULength; in ucnv_toUCountPending()
2880 }else if(cnv->toULength > 0){ in ucnv_toUCountPending()
2881 return cnv->toULength; in ucnv_toUCountPending()
2887 ucnv_isFixedWidth(UConverter *cnv, UErrorCode *status){ in ucnv_isFixedWidth() argument
2892 if (cnv == NULL) { in ucnv_isFixedWidth()
2897 switch (ucnv_getType(cnv)) { in ucnv_isFixedWidth()