• Home
  • Raw
  • Download

Lines Matching refs:sel

230 ucnvsel_close(UConverterSelector *sel) {  in ucnvsel_close()  argument
231 if (!sel) { in ucnvsel_close()
234 if (sel->ownEncodingStrings) { in ucnvsel_close()
235 uprv_free(sel->encodings[0]); in ucnvsel_close()
237 uprv_free(sel->encodings); in ucnvsel_close()
238 if (sel->ownPv) { in ucnvsel_close()
239 uprv_free(sel->pv); in ucnvsel_close()
241 utrie2_close(sel->trie); in ucnvsel_close()
242 uprv_free(sel->swapped); in ucnvsel_close()
243 uprv_free(sel); in ucnvsel_close()
283 ucnvsel_serialize(const UConverterSelector* sel, in ucnvsel_serialize() argument
298 int32_t serializedTrieSize = utrie2_serialize(sel->trie, NULL, 0, status); in ucnvsel_serialize()
313 sel->pvCount, in ucnvsel_serialize()
314 sel->encodingsCount, in ucnvsel_serialize()
315 sel->encodingStrLength in ucnvsel_serialize()
322 sel->pvCount * 4 + in ucnvsel_serialize()
323 sel->encodingStrLength; in ucnvsel_serialize()
339 utrie2_serialize(sel->trie, p, serializedTrieSize, status); in ucnvsel_serialize()
342 length = sel->pvCount * 4; in ucnvsel_serialize()
343 uprv_memcpy(p, sel->pv, length); in ucnvsel_serialize()
346 uprv_memcpy(p, sel->encodings[0], sel->encodingStrLength); in ucnvsel_serialize()
347 p += sel->encodingStrLength; in ucnvsel_serialize()
551 UConverterSelector* sel = (UConverterSelector*)uprv_malloc(sizeof(UConverterSelector)); in ucnvsel_openFromSerialized() local
555 if (sel == NULL || encodings == NULL) { in ucnvsel_openFromSerialized()
557 uprv_free(sel); in ucnvsel_openFromSerialized()
562 uprv_memset(sel, 0, sizeof(UConverterSelector)); in ucnvsel_openFromSerialized()
563 sel->pvCount = indexes[UCNVSEL_INDEX_PV_COUNT]; in ucnvsel_openFromSerialized()
564 sel->encodings = encodings; in ucnvsel_openFromSerialized()
565 sel->encodingsCount = indexes[UCNVSEL_INDEX_NAMES_COUNT]; in ucnvsel_openFromSerialized()
566 sel->encodingStrLength = indexes[UCNVSEL_INDEX_NAMES_LENGTH]; in ucnvsel_openFromSerialized()
567 sel->swapped = swapped; in ucnvsel_openFromSerialized()
569 sel->trie = utrie2_openFromSerialized(UTRIE2_16_VALUE_BITS, in ucnvsel_openFromSerialized()
574 ucnvsel_close(sel); in ucnvsel_openFromSerialized()
578 sel->pv = (uint32_t *)p; in ucnvsel_openFromSerialized()
579 p += sel->pvCount * 4; in ucnvsel_openFromSerialized()
582 for (int32_t i = 0; i < sel->encodingsCount; ++i) { in ucnvsel_openFromSerialized()
583 sel->encodings[i] = s; in ucnvsel_openFromSerialized()
586 p += sel->encodingStrLength; in ucnvsel_openFromSerialized()
588 return sel; in ucnvsel_openFromSerialized()
597 const UConverterSelector* sel; member
629 const UConverterSelector* sel; in ucnvsel_next_encoding() local
634 sel = ((Enumerator*)(enumerator->context))->sel; in ucnvsel_next_encoding()
635 result = sel->encodings[((Enumerator*)(enumerator->context))->index[cur] ]; in ucnvsel_next_encoding()
693 static UEnumeration *selectForMask(const UConverterSelector* sel, in selectForMask() argument
705 result->sel = sel; in selectForMask()
718 int32_t columns = (sel->encodingsCount+31)/32; in selectForMask()
728 for (i = 0 ; i < 32 && k < sel->encodingsCount; i++, k++) { in selectForMask()
743 ucnvsel_selectForString(const UConverterSelector* sel, in ucnvsel_selectForString() argument
750 if (sel == NULL || (s == NULL && length != 0)) { in ucnvsel_selectForString()
755 int32_t columns = (sel->encodingsCount+31)/32; in ucnvsel_selectForString()
774 UTRIE2_U16_NEXT16(sel->trie, s, limit, c, pvIndex); in ucnvsel_selectForString()
775 if (intersectMasks(mask, sel->pv+pvIndex, columns)) { in ucnvsel_selectForString()
780 return selectForMask(sel, mask, status); in ucnvsel_selectForString()
785 ucnvsel_selectForUTF8(const UConverterSelector* sel, in ucnvsel_selectForUTF8() argument
792 if (sel == NULL || (s == NULL && length != 0)) { in ucnvsel_selectForUTF8()
797 int32_t columns = (sel->encodingsCount+31)/32; in ucnvsel_selectForUTF8()
814 UTRIE2_U8_NEXT16(sel->trie, s, limit, pvIndex); in ucnvsel_selectForUTF8()
815 if (intersectMasks(mask, sel->pv+pvIndex, columns)) { in ucnvsel_selectForUTF8()
820 return selectForMask(sel, mask, status); in ucnvsel_selectForUTF8()