Home | History | Annotate | Download | only in common

Lines Matching refs:cnv

154 ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
188 if (!pBufferSize || !cnv){
195 ucnv_getName(cnv, status), cnv, stackBuffer);
197 if (cnv->sharedData->impl->safeClone != NULL) {
200 cnv->sharedData->impl->safeClone(cnv, NULL, &bufferSizeNeeded, status);
258 uprv_memcpy(localConverter, cnv, sizeof(UConverter));
262 if (cnv->subChars == (uint8_t *)cnv->subUChars) {
271 uprv_memcpy(localConverter->subChars, cnv->subChars, UCNV_ERROR_BUFFER_LENGTH * U_SIZEOF_UCHAR);
275 if (cnv->sharedData->impl->safeClone != NULL) {
277 localConverter = cnv->sharedData->impl->safeClone(cnv, localConverter, pBufferSize, status);
295 if (cnv->sharedData->referenceCounter != ~0) {
296 ucnv_incrementRefCount(cnv->sharedData);
307 cnv->fromCharErrorBehaviour(cnv->toUContext, &toUArgs, NULL, 0, UCNV_CLONE, &cbErr);
309 cnv->fromUCharErrorBehaviour(cnv->fromUContext, &fromUArgs, NULL, 0, 0, UCNV_CLONE, &cbErr);
474 ucnv_setSubstString(UConverter *cnv,
487 clone = ucnv_safeClone(cnv, cloneBuffer, &cloneSize, err);
495 if (cnv->sharedData->impl->writeSub == NULL
497 || (cnv->sharedData->staticData->conversionType == UCNV_MBCS &&
498 ucnv_MBCSGetType(cnv) != UCNV_EBCDIC_STATEFUL)
532 if (cnv->subChars == (uint8_t *)cnv->subUChars) {
534 cnv->subChars = (uint8_t *)uprv_malloc(UCNV_ERROR_BUFFER_LENGTH * U_SIZEOF_UCHAR);
535 if (cnv->subChars == NULL) {
536 cnv->subChars = (uint8_t *)cnv->subUChars;
540 uprv_memset(cnv->subChars, 0, UCNV_ERROR_BUFFER_LENGTH * U_SIZEOF_UCHAR);
546 cnv->subCharLen = 0;
548 uprv_memcpy(cnv->subChars, subChars, length8);
550 cnv->subCharLen = (int8_t)length8;
552 cnv->subCharLen = (int8_t)-length;
557 cnv->subChar1 = 0;
828 UConverter *cnv;
842 cnv=pArgs->converter;
850 fromUnicode=cnv->sharedData->impl->fromUnicode;
852 fromUnicode=cnv->sharedData->impl->fromUnicodeWithOffsets;
855 fromUnicode=cnv->sharedData->impl->fromUnicode;
861 if(cnv->preFromULength>=0) {
880 uprv_memcpy(replay, cnv->preFromU, -cnv->preFromULength*U_SIZEOF_UCHAR);
882 pArgs->sourceLimit=replay-cnv->preFromULength;
886 cnv->preFromULength=0;
910 * need not check cnv->preFromULength==0 because a replay (<0) will cause
916 cnv->fromUChar32==0);
958 if(cnv->preFromULength<0) {
969 uprv_memcpy(replay, cnv->preFromU, -cnv->preFromULength*U_SIZEOF_UCHAR);
971 pArgs->sourceLimit=replay-cnv->preFromULength;
973 if((sourceIndex+=cnv->preFromULength)<0) {
977 cnv->preFromULength=0;
1005 } else if(pArgs->flush && cnv->fromUChar32!=0) {
1029 _reset(cnv, UCNV_RESET_FROM_UNICODE, FALSE);
1062 U_ASSERT(cnv->preFromULength==0);
1066 uprv_memcpy(cnv->preFromU, pArgs->source, length*U_SIZEOF_UCHAR);
1067 cnv->preFromULength=(int8_t)-length;
1084 codePoint=cnv->fromUChar32;
1086 U16_APPEND_UNSAFE(cnv->invalidUCharBuffer, errorInputLength, codePoint);
1087 cnv->invalidUCharLength=(int8_t)errorInputLength;
1090 cnv->fromUChar32=0;
1093 cnv->fromUCharErrorBehaviour(cnv->fromUContext, pArgs,
1094 cnv->invalidUCharBuffer, errorInputLength, codePoint,
1113 * Call this function if(cnv->charErrorBufferLength>0).
1117 ucnv_outputOverflowFromUnicode(UConverter *cnv,
1132 overflow=(char *)cnv->charErrorBuffer;
1133 length=cnv->charErrorBufferLength;
1144 cnv->charErrorBufferLength=(int8_t)j;
1161 cnv->charErrorBufferLength=0;
1170 ucnv_fromUnicode(UConverter *cnv,
1185 if(cnv==NULL || target==NULL || source==NULL) {
1231 if( cnv->charErrorBufferLength>0 &&
1232 ucnv_outputOverflowFromUnicode(cnv, target, targetLimit, &offsets, err)
1239 if(!flush && s==sourceLimit && cnv->preFromULength>=0) {
1253 args.converter=cnv;
1273 UConverter *cnv;
1287 cnv=pArgs->converter;
1295 toUnicode=cnv->sharedData->impl->toUnicode;
1297 toUnicode=cnv->sharedData->impl->toUnicodeWithOffsets;
1300 toUnicode=cnv->sharedData->impl->toUnicode;
1306 if(cnv->preToULength>=0) {
1325 uprv_memcpy(replay, cnv->preToU, -cnv->preToULength);
1327 pArgs->sourceLimit=replay-cnv->preToULength;
1331 cnv->preToULength=0;
1355 * need not check cnv->preToULength==0 because a replay (<0) will cause
1361 cnv->toULength==0);
1403 if(cnv->preToULength<0) {
1414 uprv_memcpy(replay, cnv->preToU, -cnv->preToULength);
1416 pArgs->sourceLimit=replay-cnv->preToULength;
1418 if((sourceIndex+=cnv->preToULength)<0) {
1422 cnv->preToULength=0;
1450 } else if(pArgs->flush && cnv->toULength>0) {
1474 _reset(cnv, UCNV_RESET_TO_UNICODE, FALSE);
1509 U_ASSERT(cnv->preToULength==0);
1513 uprv_memcpy(cnv->preToU, pArgs->source, length);
1514 cnv->preToULength=(int8_t)-length;
1527 errorInputLength=cnv->invalidCharLength=cnv->toULength;
1529 uprv_memcpy(cnv->invalidCharBuffer, cnv->toUBytes, errorInputLength);
1533 cnv->toULength=0;
1536 if(cnv->toUCallbackReason==UCNV_ILLEGAL && *err==U_INVALID_CHAR_FOUND) {
1537 cnv->toUCallbackReason = UCNV_UNASSIGNED;
1539 cnv->fromCharErrorBehaviour(cnv->toUContext, pArgs,
1540 cnv->invalidCharBuffer, errorInputLength,
1541 cnv->toUCallbackReason,
1543 cnv->toUCallbackReason = UCNV_ILLEGAL; /* reset to default value */
1559 * Call this function if(cnv->UCharErrorBufferLength>0).
1563 ucnv_outputOverflowToUnicode(UConverter *cnv,
1578 overflow=cnv->UCharErrorBuffer;
1579 length=cnv->UCharErrorBufferLength;
1590 cnv->UCharErrorBufferLength=(int8_t)j;
1607 cnv->UCharErrorBufferLength=0;
1616 ucnv_toUnicode(UConverter *cnv,
1631 if(cnv==NULL || target==NULL || source==NULL) {
1677 if( cnv->UCharErrorBufferLength>0 &&
1678 ucnv_outputOverflowToUnicode(cnv, target, targetLimit, &offsets, err)
1685 if(!flush && s==sourceLimit && cnv->preToULength>=0) {
1699 args.converter=cnv;
1717 ucnv_fromUChars(UConverter *cnv,
1730 if( cnv==NULL ||
1739 ucnv_resetFromUnicode(cnv);
1754 ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
1765 ucnv_fromUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
1777 ucnv_toUChars(UConverter *cnv,
1790 if( cnv==NULL ||
1799 ucnv_resetToUnicode(cnv);
1814 ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
1826 ucnv_toUnicode(cnv, &dest, destLimit, &src, srcLimit, 0, TRUE, pErrorCode);
1841 ucnv_getNextUChar(UConverter *cnv,
1855 if(cnv==NULL || source==NULL) {
1886 if(cnv->UCharErrorBufferLength>0) {
1889 overflow=cnv->UCharErrorBuffer;
1891 length=cnv->UCharErrorBufferLength;
1895 if((cnv->UCharErrorBufferLength=(int8_t)(length-i))>0) {
1896 uprv_memmove(cnv->UCharErrorBuffer, cnv->UCharErrorBuffer+i,
1897 cnv->UCharErrorBufferLength*U_SIZEOF_UCHAR);
1918 args.converter=cnv;
1936 if(cnv->toULength==0 && cnv->sharedData->impl->getNextUChar!=NULL) {
1937 c=cnv->sharedData->impl->getNextUChar(&args, err);
1941 _reset(cnv, UCNV_RESET_TO_UNICODE, FALSE);
1988 if(cnv->UCharErrorBufferLength>0) {
1990 if(U16_IS_TRAIL(c2=cnv->UCharErrorBuffer[0])) {
1995 if((--cnv->UCharErrorBufferLength)>0) {
1996 cnv->UCharErrorBuffer, cnv->UCharErrorBuffer+1,
1997 cnv->UCharErrorBufferLength*U_SIZEOF_UCHAR);
2027 if((length=cnv->UCharErrorBufferLength)>0) {
2028 uprv_memmove(cnv->UCharErrorBuffer+delta, cnv->UCharErrorBuffer,
2031 cnv->UCharErrorBufferLength=(int8_t)(length+delta);
2033 cnv->UCharErrorBuffer[0]=buffer[i++];
2035 cnv->UCharErrorBuffer[1]=buffer[i];
2529 UConverter *cnv,
2541 if( cnv==NULL || source==NULL || sourceLength<-1 ||
2562 /* cnv->Unicode->algo */
2563 ucnv_resetToUnicode(cnv);
2565 from=cnv;
2567 /* algo->Unicode->cnv */
2568 ucnv_resetFromUnicode(cnv);
2570 to=cnv;
2585 UConverter *cnv,
2589 return ucnv_convertAlgorithmic(TRUE, algorithmicType, cnv,
2596 ucnv_fromAlgorithmic(UConverter *cnv,
2601 return ucnv_convertAlgorithmic(FALSE, algorithmicType, cnv,
2635 static const UAmbiguousConverter *ucnv_getAmbiguous(const UConverter *cnv)
2641 if(cnv==NULL) {
2646 name=ucnv_getName(cnv, &errorCode);
2663 ucnv_fixFileSeparator(const UConverter *cnv,
2670 if(cnv==NULL || source==NULL || sourceLength<=0 || (a=ucnv_getAmbiguous(cnv))==NULL)
2684 ucnv_isAmbiguous(const UConverter *cnv) {
2685 return (UBool)(ucnv_getAmbiguous(cnv)!=NULL);
2689 ucnv_setFallback(UConverter *cnv, UBool usesFallback)
2691 cnv->useFallback = usesFallback;
2695 ucnv_usesFallback(const UConverter *cnv)
2697 return cnv->useFallback;
2844 ucnv_fromUCountPending(const UConverter* cnv, UErrorCode* status)
2849 if(cnv == NULL){
2854 if(cnv->preFromUFirstCP >= 0){
2855 return U16_LENGTH(cnv->preFromUFirstCP)+cnv->preFromULength ;
2856 }else if(cnv->preFromULength < 0){
2857 return -cnv->preFromULength ;
2858 }else if(cnv->fromUChar32 > 0){
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)) {