Lines Matching refs:cnv

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