Lines Matching refs:extData

75     CnvExtData *extData;  in CnvExtOpen()  local
77 extData=(CnvExtData *)uprv_malloc(sizeof(CnvExtData)); in CnvExtOpen()
78 if(extData==NULL) { in CnvExtOpen()
82 uprv_memset(extData, 0, sizeof(CnvExtData)); in CnvExtOpen()
84 extData->ucm=ucm; /* aliased, not owned */ in CnvExtOpen()
86 extData->newConverter.close=CnvExtClose; in CnvExtOpen()
87 extData->newConverter.isValid=CnvExtIsValid; in CnvExtOpen()
88 extData->newConverter.addTable=CnvExtAddTable; in CnvExtOpen()
89 extData->newConverter.write=CnvExtWrite; in CnvExtOpen()
90 return &extData->newConverter; in CnvExtOpen()
95 CnvExtData *extData=(CnvExtData *)cnvData; in CnvExtClose() local
96 if(extData!=NULL) { in CnvExtClose()
97 utm_close(extData->toUTable); in CnvExtClose()
98 utm_close(extData->toUUChars); in CnvExtClose()
99 utm_close(extData->fromUTableUChars); in CnvExtClose()
100 utm_close(extData->fromUTableValues); in CnvExtClose()
101 utm_close(extData->fromUBytes); in CnvExtClose()
102 uprv_free(extData); in CnvExtClose()
116 CnvExtData *extData=(CnvExtData *)cnvData; in CnvExtWrite() local
127 length=(int32_t)uprv_strlen(extData->ucm->baseName)+1; in CnvExtWrite()
130 extData->ucm->baseName[length++]=0; in CnvExtWrite()
142 udata_writeBlock(pData, extData->ucm->baseName, length); in CnvExtWrite()
152 indexes[UCNV_EXT_TO_U_LENGTH]=length=utm_countItems(extData->toUTable); in CnvExtWrite()
156 indexes[UCNV_EXT_TO_U_UCHARS_LENGTH]=length=utm_countItems(extData->toUUChars); in CnvExtWrite()
160 length=utm_countItems(extData->fromUTableUChars); in CnvExtWrite()
165 *((UChar *)utm_alloc(extData->fromUTableUChars))=0; in CnvExtWrite()
166 *((uint32_t *)utm_alloc(extData->fromUTableValues))=0; in CnvExtWrite()
176 length=utm_countItems(extData->fromUBytes); in CnvExtWrite()
181 *((uint8_t *)utm_alloc(extData->fromUBytes))=0; in CnvExtWrite()
188 indexes[UCNV_EXT_FROM_U_STAGE_1_LENGTH]=length=extData->stage1Top; in CnvExtWrite()
189 indexes[UCNV_EXT_FROM_U_STAGE_12_LENGTH]=length+=extData->stage2Top; in CnvExtWrite()
193 length=extData->stage3Top; in CnvExtWrite()
198 extData->stage3[extData->stage3Top++]=0; in CnvExtWrite()
205 indexes[UCNV_EXT_FROM_U_STAGE_3B_LENGTH]=length=extData->stage3bTop; in CnvExtWrite()
212 (extData->maxInBytes<<16)| in CnvExtWrite()
213 (extData->maxOutBytes<<8)| in CnvExtWrite()
214 extData->maxBytesPerUChar; in CnvExtWrite()
216 (extData->maxInUChars<<16)| in CnvExtWrite()
217 (extData->maxOutUChars<<8)| in CnvExtWrite()
218 extData->maxUCharsPerByte; in CnvExtWrite()
220 indexes[UCNV_EXT_FLAGS]=extData->ucm->ext->unicodeMask; in CnvExtWrite()
224 udata_writeBlock(pData, utm_getStart(extData->toUTable), indexes[UCNV_EXT_TO_U_LENGTH]*4); in CnvExtWrite()
225 … udata_writeBlock(pData, utm_getStart(extData->toUUChars), indexes[UCNV_EXT_TO_U_UCHARS_LENGTH]*2); in CnvExtWrite()
227 …udata_writeBlock(pData, utm_getStart(extData->fromUTableUChars), indexes[UCNV_EXT_FROM_U_LENGTH]*2… in CnvExtWrite()
228 …udata_writeBlock(pData, utm_getStart(extData->fromUTableValues), indexes[UCNV_EXT_FROM_U_LENGTH]*4… in CnvExtWrite()
229 … udata_writeBlock(pData, utm_getStart(extData->fromUBytes), indexes[UCNV_EXT_FROM_U_BYTES_LENGTH]); in CnvExtWrite()
231 udata_writeBlock(pData, extData->stage1, extData->stage1Top*2); in CnvExtWrite()
232 udata_writeBlock(pData, extData->stage2, extData->stage2Top*2); in CnvExtWrite()
233 udata_writeBlock(pData, extData->stage3, extData->stage3Top*2); in CnvExtWrite()
234 udata_writeBlock(pData, extData->stage3b, extData->stage3bTop*4); in CnvExtWrite()
240 length=extData->stage1Top; in CnvExtWrite()
244 if(extData->stage1[i]!=length) { in CnvExtWrite()
245 printf("stage1[%04x]=%04x\n", i, extData->stage1[i]); in CnvExtWrite()
250 length=extData->stage2Top; in CnvExtWrite()
254 if(extData->stage2[i]!=0) { in CnvExtWrite()
255 printf("stage12[%04x]=%04x\n", j, extData->stage2[i]); in CnvExtWrite()
259 length=extData->stage3Top; in CnvExtWrite()
263 if(extData->stage3[i]!=0) { in CnvExtWrite()
264 printf("stage3[%04x]=%04x\n", i, extData->stage3[i]); in CnvExtWrite()
268 length=extData->stage3bTop; in CnvExtWrite()
272 if(extData->stage3b[i]!=0) { in CnvExtWrite()
273 printf("stage3b[%04x]=%08x\n", i, extData->stage3b[i]); in CnvExtWrite()
328 getToUnicodeValue(CnvExtData *extData, UCMTable *table, UCMapping *m) { in getToUnicodeValue() argument
353 ((uint32_t)utm_countItems(extData->toUUChars)); in getToUnicodeValue()
354 u=utm_allocN(extData->toUUChars, u16Length); in getToUnicodeValue()
368 if(m->bLen>extData->maxInBytes) { in getToUnicodeValue()
369 extData->maxInBytes=m->bLen; in getToUnicodeValue()
371 if(u16Length>extData->maxOutUChars) { in getToUnicodeValue()
372 extData->maxOutUChars=u16Length; in getToUnicodeValue()
376 if(ratio>extData->maxUCharsPerByte) { in getToUnicodeValue()
377 extData->maxUCharsPerByte=ratio; in getToUnicodeValue()
411 generateToUTable(CnvExtData *extData, UCMTable *table, in generateToUTable() argument
465 section=(uint32_t *)utm_allocN(extData->toUTable, 1+count); in generateToUTable()
524 defaultValue=getToUnicodeValue(extData, table, m); in generateToUTable()
532 section[j]|=(uint32_t)utm_countItems(extData->toUTable); in generateToUTable()
535 if(!generateToUTable(extData, table, subStart, subLimit, unitIndex+1, defaultValue)) { in generateToUTable()
549 makeToUTable(CnvExtData *extData, UCMTable *table) { in makeToUTable() argument
554 extData->toUTable=utm_open("cnv extension toUTable", 0x10000, UCNV_EXT_TO_U_MIN_CODE_POINT, 4); in makeToUTable()
555 extData->toUUChars=utm_open("cnv extension toUUChars", 0x10000, UCNV_EXT_TO_U_INDEX_MASK+1, 2); in makeToUTable()
557 return generateToUTable(extData, table, 0, toUCount, 0, 0); in makeToUTable()
635 getFromUBytesValue(CnvExtData *extData, UCMTable *table, UCMapping *m) { in getFromUBytesValue() argument
666 value=(uint32_t)utm_countItems(extData->fromUBytes); in getFromUBytesValue()
667 resultBytes=utm_allocN(extData->fromUBytes, m->bLen); in getFromUBytesValue()
686 if(u16Length>extData->maxInUChars) { in getFromUBytesValue()
687 extData->maxInUChars=u16Length; in getFromUBytesValue()
689 if(m->bLen>extData->maxOutBytes) { in getFromUBytesValue()
690 extData->maxOutBytes=m->bLen; in getFromUBytesValue()
694 if(ratio>extData->maxBytesPerUChar) { in getFromUBytesValue()
695 extData->maxBytesPerUChar=ratio; in getFromUBytesValue()
710 generateFromUTable(CnvExtData *extData, UCMTable *table, in generateFromUTable() argument
749 sectionUChars=(UChar *)utm_allocN(extData->fromUTableUChars, 1+count); in generateFromUTable()
750 sectionValues=(uint32_t *)utm_allocN(extData->fromUTableValues, 1+count); in generateFromUTable()
797 defaultValue=getFromUBytesValue(extData, table, m); in generateFromUTable()
805 sectionValues[j]=(uint32_t)utm_countItems(extData->fromUTableValues); in generateFromUTable()
808 if(!generateFromUTable(extData, table, subStart, subLimit, unitIndex+1, defaultValue)) { in generateFromUTable()
822 addFromUTrieEntry(CnvExtData *extData, UChar32 c, uint32_t value) { in addFromUTrieEntry() argument
835 if(i1>=extData->stage1Top) { in addFromUTrieEntry()
836 extData->stage1Top=i1+1; in addFromUTrieEntry()
841 if(extData->stage1[i1]==0) { in addFromUTrieEntry()
843 newBlock=extData->stage2Top; in addFromUTrieEntry()
845 while(min<newBlock && extData->stage2[newBlock-1]==0) { in addFromUTrieEntry()
849 extData->stage1[i1]=(uint16_t)newBlock; in addFromUTrieEntry()
850 extData->stage2Top=newBlock+MBCS_STAGE_2_BLOCK_SIZE; in addFromUTrieEntry()
851 if(extData->stage2Top>UPRV_LENGTHOF(extData->stage2)) { in addFromUTrieEntry()
857 i2=extData->stage1[i1]+nextOffset; in addFromUTrieEntry()
860 if(extData->stage2[i2]==0) { in addFromUTrieEntry()
862 newBlock=extData->stage3Top; in addFromUTrieEntry()
864 while(min<newBlock && extData->stage3[newBlock-1]==0) { in addFromUTrieEntry()
870 extData->stage2[i2]=(uint16_t)(newBlock>>UCNV_EXT_STAGE_2_LEFT_SHIFT); in addFromUTrieEntry()
872 extData->stage3Top=newBlock+MBCS_STAGE_3_BLOCK_SIZE; in addFromUTrieEntry()
873 if(extData->stage3Top>UPRV_LENGTHOF(extData->stage3)) { in addFromUTrieEntry()
879 i3=((int32_t)extData->stage2[i2]<<UCNV_EXT_STAGE_2_LEFT_SHIFT)+nextOffset; in addFromUTrieEntry()
887 extData->stage3[i3]=1; in addFromUTrieEntry()
900 min<i3 && extData->stage3[min]==1; in addFromUTrieEntry()
905 if(extData->stage3Sub1Block!=0) { in addFromUTrieEntry()
907 extData->stage2[i2]=extData->stage3Sub1Block; in addFromUTrieEntry()
908 extData->stage3Top-=MBCS_STAGE_3_BLOCK_SIZE; in addFromUTrieEntry()
909 uprv_memset(extData->stage3+extData->stage3Top, 0, MBCS_STAGE_3_BLOCK_SIZE*2); in addFromUTrieEntry()
912 extData->stage3Sub1Block=extData->stage2[i2]; in addFromUTrieEntry()
917 if((i3b=extData->stage3bTop++)>=UPRV_LENGTHOF(extData->stage3b)) { in addFromUTrieEntry()
923 extData->stage3[i3]=(uint16_t)i3b; in addFromUTrieEntry()
924 extData->stage3b[i3b]=value; in addFromUTrieEntry()
929 generateFromUTrie(CnvExtData *extData, UCMTable *table, int32_t mapLength) { in generateFromUTrie() argument
985 value=getFromUBytesValue(extData, table, m); in generateFromUTrie()
990 addFromUTrieEntry(extData, c, value); in generateFromUTrie()
993 addFromUTrieEntry(extData, c, (uint32_t)utm_countItems(extData->fromUTableValues)); in generateFromUTrie()
996 if(!generateFromUTable(extData, table, subStart, subLimit, 2, value)) { in generateFromUTrie()
1010 makeFromUTable(CnvExtData *extData, UCMTable *table) { in makeFromUTable() argument
1016extData->fromUTableUChars=utm_open("cnv extension fromUTableUChars", 0x10000, UCNV_EXT_FROM_U_DATA… in makeFromUTable()
1017extData->fromUTableValues=utm_open("cnv extension fromUTableValues", 0x10000, UCNV_EXT_FROM_U_DATA… in makeFromUTable()
1018extData->fromUBytes=utm_open("cnv extension fromUBytes", 0x10000, UCNV_EXT_FROM_U_DATA_MASK+1, 1); in makeFromUTable()
1021 extData->stage2Top=MBCS_STAGE_2_FIRST_ASSIGNED; in makeFromUTable()
1022 extData->stage3Top=MBCS_STAGE_3_FIRST_ASSIGNED; in makeFromUTable()
1029 extData->stage3b[1]=UCNV_EXT_FROM_U_SUBCHAR1; in makeFromUTable()
1030 extData->stage3bTop=2; in makeFromUTable()
1033 utm_alloc(extData->fromUTableUChars); in makeFromUTable()
1034 utm_alloc(extData->fromUTableValues); in makeFromUTable()
1036 if(!generateFromUTrie(extData, table, fromUCount)) { in makeFromUTable()
1044 stage1=extData->stage1; in makeFromUTable()
1045 stage1Top=extData->stage1Top; in makeFromUTable()
1057 CnvExtData *extData; in CnvExtAddTable() local
1066 extData=(CnvExtData *)cnvData; in CnvExtAddTable()
1076 makeToUTable(extData, table) && in CnvExtAddTable()
1077 makeFromUTable(extData, table); in CnvExtAddTable()