Lines Matching refs:cnv
50 UConverter *cnv; in _UTF16BEFromUnicodeWithOffsets() local
66 cnv=pArgs->converter; in _UTF16BEFromUnicodeWithOffsets()
69 if(cnv->fromUnicodeStatus==UCNV_NEED_TO_WRITE_BOM) { in _UTF16BEFromUnicodeWithOffsets()
71 ucnv_fromUWriteBytes(cnv, in _UTF16BEFromUnicodeWithOffsets()
76 cnv->fromUnicodeStatus=0; in _UTF16BEFromUnicodeWithOffsets()
91 if((c=(UChar)cnv->fromUChar32)!=0 && U16_IS_TRAIL(trail=*source) && targetCapacity>=4) { in _UTF16BEFromUnicodeWithOffsets()
108 cnv->fromUChar32=c=0; in _UTF16BEFromUnicodeWithOffsets()
228 cnv->fromUChar32=c; in _UTF16BEFromUnicodeWithOffsets()
233 ucnv_fromUWriteBytes(cnv, in _UTF16BEFromUnicodeWithOffsets()
254 UConverter *cnv; in _UTF16BEToUnicodeWithOffsets() local
267 cnv=pArgs->converter; in _UTF16BEToUnicodeWithOffsets()
270 if(length<=0 && cnv->toUnicodeStatus==0) { in _UTF16BEToUnicodeWithOffsets()
287 if(cnv->toUnicodeStatus!=0) { in _UTF16BEToUnicodeWithOffsets()
294 cnv->toUBytes[0]=(uint8_t)cnv->toUnicodeStatus; in _UTF16BEToUnicodeWithOffsets()
295 cnv->toULength=1; in _UTF16BEToUnicodeWithOffsets()
296 cnv->toUnicodeStatus=0; in _UTF16BEToUnicodeWithOffsets()
298 if((count=cnv->toULength)!=0) { in _UTF16BEToUnicodeWithOffsets()
299 uint8_t *p=cnv->toUBytes; in _UTF16BEToUnicodeWithOffsets()
338 cnv->UCharErrorBuffer[0]=trail; in _UTF16BEToUnicodeWithOffsets()
339 cnv->UCharErrorBufferLength=1; in _UTF16BEToUnicodeWithOffsets()
358 cnv->toUnicodeStatus=0x100|p[2]; in _UTF16BEToUnicodeWithOffsets()
361 cnv->toULength=2; in _UTF16BEToUnicodeWithOffsets()
371 cnv->toULength=(int8_t)count; in _UTF16BEToUnicodeWithOffsets()
440 cnv->toUBytes[0]=(uint8_t)(c>>8); in _UTF16BEToUnicodeWithOffsets()
441 cnv->toUBytes[1]=(uint8_t)c; in _UTF16BEToUnicodeWithOffsets()
442 cnv->toULength=2; in _UTF16BEToUnicodeWithOffsets()
454 cnv->UCharErrorBuffer[0]=trail; in _UTF16BEToUnicodeWithOffsets()
455 cnv->UCharErrorBufferLength=1; in _UTF16BEToUnicodeWithOffsets()
456 cnv->toULength=0; in _UTF16BEToUnicodeWithOffsets()
478 cnv->toUBytes[cnv->toULength++]=*source++; in _UTF16BEToUnicodeWithOffsets()
569 _UTF16BEReset(UConverter *cnv, UConverterResetChoice choice) { in _UTF16BEReset() argument
572 if(UCNV_GET_VERSION(cnv)==0) { in _UTF16BEReset()
573 cnv->mode=8; /* no BOM handling */ in _UTF16BEReset()
575 cnv->mode=0; /* Java-specific "UnicodeBig" requires BE BOM or no BOM */ in _UTF16BEReset()
578 if(choice!=UCNV_RESET_TO_UNICODE && UCNV_GET_VERSION(cnv)==1) { in _UTF16BEReset()
580 cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM; in _UTF16BEReset()
585 _UTF16BEOpen(UConverter *cnv, in _UTF16BEOpen() argument
588 if(UCNV_GET_VERSION(cnv)<=1) { in _UTF16BEOpen()
589 _UTF16BEReset(cnv, UCNV_RESET_BOTH); in _UTF16BEOpen()
596 _UTF16BEGetName(const UConverter *cnv) { in _UTF16BEGetName() argument
597 if(UCNV_GET_VERSION(cnv)==0) { in _UTF16BEGetName()
649 UConverter *cnv; in _UTF16LEFromUnicodeWithOffsets() local
665 cnv=pArgs->converter; in _UTF16LEFromUnicodeWithOffsets()
668 if(cnv->fromUnicodeStatus==UCNV_NEED_TO_WRITE_BOM) { in _UTF16LEFromUnicodeWithOffsets()
670 ucnv_fromUWriteBytes(cnv, in _UTF16LEFromUnicodeWithOffsets()
675 cnv->fromUnicodeStatus=0; in _UTF16LEFromUnicodeWithOffsets()
690 if((c=(UChar)cnv->fromUChar32)!=0 && U16_IS_TRAIL(trail=*source) && targetCapacity>=4) { in _UTF16LEFromUnicodeWithOffsets()
707 cnv->fromUChar32=c=0; in _UTF16LEFromUnicodeWithOffsets()
827 cnv->fromUChar32=c; in _UTF16LEFromUnicodeWithOffsets()
832 ucnv_fromUWriteBytes(cnv, in _UTF16LEFromUnicodeWithOffsets()
853 UConverter *cnv; in _UTF16LEToUnicodeWithOffsets() local
866 cnv=pArgs->converter; in _UTF16LEToUnicodeWithOffsets()
869 if(length<=0 && cnv->toUnicodeStatus==0) { in _UTF16LEToUnicodeWithOffsets()
886 if(cnv->toUnicodeStatus!=0) { in _UTF16LEToUnicodeWithOffsets()
893 cnv->toUBytes[0]=(uint8_t)cnv->toUnicodeStatus; in _UTF16LEToUnicodeWithOffsets()
894 cnv->toULength=1; in _UTF16LEToUnicodeWithOffsets()
895 cnv->toUnicodeStatus=0; in _UTF16LEToUnicodeWithOffsets()
897 if((count=cnv->toULength)!=0) { in _UTF16LEToUnicodeWithOffsets()
898 uint8_t *p=cnv->toUBytes; in _UTF16LEToUnicodeWithOffsets()
937 cnv->UCharErrorBuffer[0]=trail; in _UTF16LEToUnicodeWithOffsets()
938 cnv->UCharErrorBufferLength=1; in _UTF16LEToUnicodeWithOffsets()
957 cnv->toUnicodeStatus=0x100|p[2]; in _UTF16LEToUnicodeWithOffsets()
960 cnv->toULength=2; in _UTF16LEToUnicodeWithOffsets()
970 cnv->toULength=(int8_t)count; in _UTF16LEToUnicodeWithOffsets()
1039 cnv->toUBytes[0]=(uint8_t)c; in _UTF16LEToUnicodeWithOffsets()
1040 cnv->toUBytes[1]=(uint8_t)(c>>8); in _UTF16LEToUnicodeWithOffsets()
1041 cnv->toULength=2; in _UTF16LEToUnicodeWithOffsets()
1053 cnv->UCharErrorBuffer[0]=trail; in _UTF16LEToUnicodeWithOffsets()
1054 cnv->UCharErrorBufferLength=1; in _UTF16LEToUnicodeWithOffsets()
1055 cnv->toULength=0; in _UTF16LEToUnicodeWithOffsets()
1077 cnv->toUBytes[cnv->toULength++]=*source++; in _UTF16LEToUnicodeWithOffsets()
1168 _UTF16LEReset(UConverter *cnv, UConverterResetChoice choice) { in _UTF16LEReset() argument
1171 if(UCNV_GET_VERSION(cnv)==0) { in _UTF16LEReset()
1172 cnv->mode=8; /* no BOM handling */ in _UTF16LEReset()
1174 cnv->mode=0; /* Java-specific "UnicodeLittle" requires LE BOM or no BOM */ in _UTF16LEReset()
1177 if(choice!=UCNV_RESET_TO_UNICODE && UCNV_GET_VERSION(cnv)==1) { in _UTF16LEReset()
1179 cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM; in _UTF16LEReset()
1184 _UTF16LEOpen(UConverter *cnv, in _UTF16LEOpen() argument
1187 if(UCNV_GET_VERSION(cnv)<=1) { in _UTF16LEOpen()
1188 _UTF16LEReset(cnv, UCNV_RESET_BOTH); in _UTF16LEOpen()
1195 _UTF16LEGetName(const UConverter *cnv) { in _UTF16LEGetName() argument
1196 if(UCNV_GET_VERSION(cnv)==0) { in _UTF16LEGetName()
1271 _UTF16Reset(UConverter *cnv, UConverterResetChoice choice) { in _UTF16Reset() argument
1274 cnv->mode=0; in _UTF16Reset()
1278 cnv->fromUnicodeStatus=UCNV_NEED_TO_WRITE_BOM; in _UTF16Reset()
1285 _UTF16Open(UConverter *cnv, in _UTF16Open() argument
1288 if(UCNV_GET_VERSION(cnv)<=2) { in _UTF16Open()
1289 if(UCNV_GET_VERSION(cnv)==2 && !pArgs->onlyTestIsLoadable) { in _UTF16Open()
1296 cnv->sharedData=(UConverterSharedData*)&_UTF16v2Data; in _UTF16Open()
1297 uprv_memcpy(cnv->subChars, _UTF16v2Data.staticData->subChar, UCNV_MAX_SUBCHAR_LEN); in _UTF16Open()
1299 _UTF16Reset(cnv, UCNV_RESET_BOTH); in _UTF16Open()
1306 _UTF16GetName(const UConverter *cnv) { in _UTF16GetName() argument
1307 if(UCNV_GET_VERSION(cnv)==0) { in _UTF16GetName()
1309 } else if(UCNV_GET_VERSION(cnv)==1) { in _UTF16GetName()
1318 #define IS_UTF16BE(cnv) ((cnv)->sharedData==&_UTF16BEData) argument
1319 #define IS_UTF16LE(cnv) ((cnv)->sharedData==&_UTF16LEData) argument
1320 #define IS_UTF16(cnv) ((cnv)->sharedData==&_UTF16Data || (cnv)->sharedData==&_UTF16v2Data) argument
1325 UConverter *cnv=pArgs->converter; in _UTF16ToUnicodeWithOffsets() local
1333 state=cnv->mode; in _UTF16ToUnicodeWithOffsets()
1345 cnv->toUBytes[0]=(uint8_t)*source++; in _UTF16ToUnicodeWithOffsets()
1346 cnv->toULength=1; in _UTF16ToUnicodeWithOffsets()
1357 if(cnv->toUBytes[0]==0xfe && b==0xff) { in _UTF16ToUnicodeWithOffsets()
1358 if(IS_UTF16LE(cnv)) { in _UTF16ToUnicodeWithOffsets()
1363 } else if(cnv->toUBytes[0]==0xff && b==0xfe) { in _UTF16ToUnicodeWithOffsets()
1364 if(IS_UTF16BE(cnv)) { in _UTF16ToUnicodeWithOffsets()
1369 } else if((IS_UTF16(cnv) && UCNV_GET_VERSION(cnv)==1)) { in _UTF16ToUnicodeWithOffsets()
1375 cnv->toULength=0; in _UTF16ToUnicodeWithOffsets()
1382 cnv->toULength=0; in _UTF16ToUnicodeWithOffsets()
1384 if(IS_UTF16LE(cnv)) { in _UTF16ToUnicodeWithOffsets()
1399 cnv->toUBytes[1]=b; in _UTF16ToUnicodeWithOffsets()
1400 cnv->toULength=2; in _UTF16ToUnicodeWithOffsets()
1408 cnv->mode=state+2; in _UTF16ToUnicodeWithOffsets()
1413 cnv->mode=state; in _UTF16ToUnicodeWithOffsets()
1459 cnv->mode=state; in _UTF16ToUnicodeWithOffsets()