Lines Matching refs:cnv
150 ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
184 if (!pBufferSize || !cnv){
191 ucnv_getName(cnv, status), cnv, stackBuffer);
193 if (cnv->sharedData->impl->safeClone != NULL) {
196 cnv->sharedData->impl->safeClone(cnv, NULL, &bufferSizeNeeded, status);
254 uprv_memcpy(localConverter, cnv, sizeof(UConverter));
258 if (cnv->subChars == (uint8_t *)cnv->subUChars) {
267 uprv_memcpy(localConverter->subChars, cnv->subChars, UCNV_ERROR_BUFFER_LENGTH * U_SIZEOF_UCHAR);
271 if (cnv->sharedData->impl->safeClone != NULL) {
273 localConverter = cnv->sharedData->impl->safeClone(cnv, localConverter, pBufferSize, status);
291 if (cnv->sharedData->referenceCounter != ~0) {
292 ucnv_incrementRefCount(cnv->sharedData);
303 cnv->fromCharErrorBehaviour(cnv->toUContext, &toUArgs, NULL, 0, UCNV_CLONE, &cbErr);
305 cnv->fromUCharErrorBehaviour(cnv->fromUContext, &fromUArgs, NULL, 0, 0, UCNV_CLONE, &cbErr);
470 ucnv_setSubstString(UConverter *cnv,
483 clone = ucnv_safeClone(cnv, cloneBuffer, &cloneSize, err);
491 if (cnv->sharedData->impl->writeSub == NULL
493 || (cnv->sharedData->staticData->conversionType == UCNV_MBCS &&
494 ucnv_MBCSGetType(cnv) != UCNV_EBCDIC_STATEFUL)
528 if (cnv->subChars == (uint8_t *)cnv
530 cnv->subChars = (uint8_t *)uprv_malloc(UCNV_ERROR_BUFFER_LENGTH * U_SIZEOF_UCHAR);
531 if (cnv->subChars == NULL) {
532 cnv->subChars = (uint8_t *)cnv->subUChars;
536 uprv_memset(cnv->subChars, 0, UCNV_ERROR_BUFFER_LENGTH * U_SIZEOF_UCHAR);
542 cnv->subCharLen = 0;
544 uprv_memcpy(cnv->subChars, subChars, length8);
546 cnv->subCharLen = (int8_t)length8;
548 cnv->subCharLen = (int8_t)-length;
553 cnv->subChar1 = 0;
824 UConverter *cnv;
838 cnv=pArgs->converter;
846 fromUnicode=cnv->sharedData->impl->fromUnicode;
848 fromUnicode=cnv->sharedData->impl->fromUnicodeWithOffsets;
851 fromUnicode=cnv->sharedData->impl->fromUnicode;
857 if(cnv->preFromULength>=0) {
876 uprv_memcpy(replay, cnv->preFromU, -cnv->preFromULength*U_SIZEOF_UCHAR);
878 pArgs->sourceLimit=replay-cnv->preFromULength;
882 cnv->preFromULength=0;
906 * need not check cnv->preFromULength==0 because a replay (<0) will cause
912 cnv->fromUChar32==0);
954 if(cnv->preFromULength<0) {
965 uprv_memcpy(replay, cnv->preFromU, -cnv->preFromULength*U_SIZEOF_UCHAR);
967 pArgs->sourceLimit=replay-cnv->preFromULength;
969 if((sourceIndex+=cnv->preFromULength)<0) {
973 cnv->preFromULength=0;
1001 } else if(pArgs->flush && cnv->fromUChar32!=0) {
1025 _reset(cnv, UCNV_RESET_FROM_UNICODE, FALSE);
1058 U_ASSERT(cnv->preFromULength==0);
1062 uprv_memcpy(cnv->preFromU, pArgs->source, length*U_SIZEOF_UCHAR);
1063 cnv->preFromULength=(int8_t)-length;
1080 codePoint=cnv->fromUChar32;
1082 U16_APPEND_UNSAFE(cnv->invalidUCharBuffer, errorInputLength, codePoint);
1083 cnv->invalidUCharLength=(int8_t)errorInputLength;
1086 cnv->fromUChar32=0;
1089 cnv->fromUCharErrorBehaviour(cnv->fromUContext, pArgs,
1090 cnv->invalidUCharBuffer, errorInputLength, codePoint,
1109 * Call this function if(cnv->charErrorBufferLength>0).
1113 ucnv_outputOverflowFromUnicode(UConverter *cnv,
1128 overflow=(char *)cnv->charErrorBuffer;
1129 length=cnv->charErrorBufferLength;
1140 cnv->charErrorBufferLength=(int8_t)j;
1157 cnv->charErrorBufferLength=0;
1166 ucnv_fromUnicode(UConverter *cnv,
1181 if(cnv==NULL || target==NULL || source==NULL) {
1227 if( cnv->charErrorBufferLength>0 &&
1228 ucnv_outputOverflowFromUnicode(cnv, target, targetLimit, &offsets, err)
1235 if(!flush && s==sourceLimit && cnv->preFromULength>=0) {
1249 args.converter=cnv;
1269 UConverter *cnv;
1283 cnv=pArgs->converter;
1291 toUnicode=cnv->sharedData->impl->toUnicode;
1293 toUnicode=cnv->sharedData->impl->toUnicodeWithOffsets;
1296 toUnicode=cnv->sharedData->impl->toUnicode;
1302 if(cnv->preToULength>=0) {
1321 uprv_memcpy(replay, cnv->preToU, -cnv->preToULength);
1323 pArgs->sourceLimit=replay-cnv->preToULength;
1327 cnv->preToULength=0;
1351 * need not check cnv->preToULength==0 because a replay (<0) will cause
1357 cnv->toULength==0);
1399 if(cnv->preToULength<0) {
1410 uprv_memcpy(replay, cnv->preToU, -cnv->preToULength);
1412 pArgs->sourceLimit=replay-cnv->preToULength;
1414 if((sourceIndex+=cnv->preToULength)<0) {
1418 cnv->preToULength=0;
1446 } else if(pArgs->flush && cnv->toULength>0) {
1470 _reset(cnv, UCNV_RESET_TO_UNICODE, FALSE);
1505 U_ASSERT(cnv->preToULength==0);
1509 uprv_memcpy(cnv->preToU, pArgs->source, length);
1510 cnv->preToULength=(int8_t)-length;
1523 errorInputLength=cnv->invalidCharLength=cnv->toULength;
1525 uprv_memcpy(cnv->invalidCharBuffer, cnv->toUBytes, errorInputLength);
1529 cnv->toULength=0;
1532 if(cnv->toUCallbackReason==UCNV_ILLEGAL && *err==U_INVALID_CHAR_FOUND) {
1533 cnv->toUCallbackReason = UCNV_UNASSIGNED;
1535 cnv->fromCharErrorBehaviour(cnv->toUContext, pArgs,
1536 cnv->invalidCharBuffer, errorInputLength,
1537 cnv->toUCallbackReason,
1539 cnv->toUCallbackReason = UCNV_ILLEGAL; /* reset to default value */
1555 * Call this function if(cnv->UCharErrorBufferLength>0).
1559 ucnv_outputOverflowToUnicode(UConverter *cnv,
1574 overflow=cnv->UCharErrorBuffer;
1575 length=cnv->UCharErrorBufferLength;
1586 cnv->UCharErrorBufferLength=(int8_t)j;
1603 cnv->UCharErrorBufferLength=0;
1612 ucnv_toUnicode(UConverter *cnv,
1627 if(cnv==NULL || target==NULL || source==NULL) {
1673 if( cnv->UCharErrorBufferLength>0 &&
1674 ucnv_outputOverflowToUnicode(cnv, target, targetLimit, &offsets, err)
1681 if(!flush && s==sourceLimit && cnv->preToULength>=0) {
1695 args.converter=cnv;
1713 ucnv_fromUChars(UConverter *cnv,
1726 if( cnv==NULL ||
1735 ucnv_resetFromUnicode(cnv);
1750 ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
1761 ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
1773 ucnv_toUChars(UConverter *cnv,
1786 if( cnv==NULL ||
1795 ucnv_resetToUnicode(cnv);
1810 ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
1822 ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
1837 ucnv_getNextUChar(UConverter *cnv,
1851 if(cnv==NULL || source==NULL) {
1882 if(cnv->UCharErrorBufferLength>0) {
1885 overflow=cnv->UCharErrorBuffer;
1887 length=cnv->UCharErrorBufferLength;
1891 if((cnv->UCharErrorBufferLength=(int8_t)(length-i))>0) {
1892 uprv_memmove(cnv->UCharErrorBuffer, cnv->UCharErrorBuffer+i,
1893 cnv->UCharErrorBufferLength*U_SIZEOF_UCHAR);
1914 args.converter=cnv;
1932 if(cnv->toULength==0 && cnv->sharedData->impl->getNextUChar!=NULL) {
1933 c=cnv->sharedData->impl->getNextUChar(&args, err);
1937 _reset(cnv, UCNV_RESET_TO_UNICODE, FALSE);
1984 if(cnv->UCharErrorBufferLength>0) {
1986 if(U16_IS_TRAIL(c2=cnv->UCharErrorBuffer[0])) {
1991 if((--cnv->UCharErrorBufferLength)>0) {
1992 uprv_memmove(cnv->UCharErrorBuffer, cnv->UCharErrorBuffer+1,
1993 cnv
2023 if((length=cnv->UCharErrorBufferLength)>0) {
2024 uprv_memmove(cnv->UCharErrorBuffer+delta, cnv->UCharErrorBuffer,
2027 cnv->UCharErrorBufferLength=(int8_t)(length+delta);
2029 cnv->UCharErrorBuffer[0]=buffer[i++];
2031 cnv->UCharErrorBuffer[1]=buffer[i];
2525 UConverter *cnv,
2537 if( cnv==NULL || source==NULL || sourceLength<-1 ||
2558 /* cnv->Unicode->algo */
2559 ucnv_resetToUnicode(cnv);
2561 from=cnv;
2563 /* algo->Unicode->cnv */
2564 ucnv_resetFromUnicode(cnv);
2566 to=cnv;
2581 UConverter *cnv,
2585 return ucnv_convertAlgorithmic(TRUE, algorithmicType, cnv,
2592 ucnv_fromAlgorithmic(UConverter *cnv,
2597 return ucnv_convertAlgorithmic(FALSE, algorithmicType, cnv,
2631 static const UAmbiguousConverter *ucnv_getAmbiguous(const UConverter *cnv)
2637 if(cnv==NULL) {
2642 name=ucnv_getName(cnv, &errorCode);
2659 ucnv_fixFileSeparator(const UConverter *cnv,
2666 if(cnv==NULL || source==NULL || sourceLength<=0 || (a=ucnv_getAmbiguous(cnv))==NULL)
2680 ucnv_isAmbiguous(const UConverter *cnv) {
2681 return (UBool)(ucnv_getAmbiguous(cnv)!=NULL);
2685 ucnv_setFallback(UConverter *cnv, UBool usesFallback)
2687 cnv->useFallback = usesFallback;
2691 ucnv_usesFallback(const UConverter *cnv)
2693 return cnv->useFallback;
2840 ucnv_fromUCountPending(const UConverter* cnv, UErrorCode* status)
2845 if(cnv == NULL){
2850 if(cnv->preFromULength > 0){
2851 return U16_LENGTH(cnv->preFromUFirstCP)+cnv->preFromULength ;
2852 }else if(cnv->preFromULength < 0){
2853 return -cnv->preFromULength ;
2854 }else if(cnv->fromUChar32 > 0){
2856 }else if(cnv->preFromUFirstCP >0){
2857 return U16_LENGTH(cnv->preFromUFirstCP);
2864 ucnv_toUCountPending(const UConverter* cnv, UErrorCode* status){
2869 if(cnv == NULL){
2874 if(cnv->preToULength > 0){
2875 return cnv->preToULength ;
2876 }else if(cnv->preToULength < 0){
2877 return -cnv->preToULength;
2878 }else if(cnv->toULength > 0){
2879 return cnv->toULength;