Lines Matching refs:sel
227 ucnvsel_close(UConverterSelector *sel) { in ucnvsel_close() argument
228 if (!sel) { in ucnvsel_close()
231 if (sel->ownEncodingStrings) { in ucnvsel_close()
232 uprv_free(sel->encodings[0]); in ucnvsel_close()
234 uprv_free(sel->encodings); in ucnvsel_close()
235 if (sel->ownPv) { in ucnvsel_close()
236 uprv_free(sel->pv); in ucnvsel_close()
238 utrie2_close(sel->trie); in ucnvsel_close()
239 uprv_free(sel->swapped); in ucnvsel_close()
240 uprv_free(sel); in ucnvsel_close()
280 ucnvsel_serialize(const UConverterSelector* sel, in ucnvsel_serialize() argument
295 int32_t serializedTrieSize = utrie2_serialize(sel->trie, NULL, 0, status); in ucnvsel_serialize()
310 sel->pvCount, in ucnvsel_serialize()
311 sel->encodingsCount, in ucnvsel_serialize()
312 sel->encodingStrLength in ucnvsel_serialize()
319 sel->pvCount * 4 + in ucnvsel_serialize()
320 sel->encodingStrLength; in ucnvsel_serialize()
336 utrie2_serialize(sel->trie, p, serializedTrieSize, status); in ucnvsel_serialize()
339 length = sel->pvCount * 4; in ucnvsel_serialize()
340 uprv_memcpy(p, sel->pv, length); in ucnvsel_serialize()
343 uprv_memcpy(p, sel->encodings[0], sel->encodingStrLength); in ucnvsel_serialize()
344 p += sel->encodingStrLength; in ucnvsel_serialize()
548 UConverterSelector* sel = (UConverterSelector*)uprv_malloc(sizeof(UConverterSelector)); in ucnvsel_openFromSerialized() local
552 if (sel == NULL || encodings == NULL) { in ucnvsel_openFromSerialized()
554 uprv_free(sel); in ucnvsel_openFromSerialized()
559 uprv_memset(sel, 0, sizeof(UConverterSelector)); in ucnvsel_openFromSerialized()
560 sel->pvCount = indexes[UCNVSEL_INDEX_PV_COUNT]; in ucnvsel_openFromSerialized()
561 sel->encodings = encodings; in ucnvsel_openFromSerialized()
562 sel->encodingsCount = indexes[UCNVSEL_INDEX_NAMES_COUNT]; in ucnvsel_openFromSerialized()
563 sel->encodingStrLength = indexes[UCNVSEL_INDEX_NAMES_LENGTH]; in ucnvsel_openFromSerialized()
564 sel->swapped = swapped; in ucnvsel_openFromSerialized()
566 sel->trie = utrie2_openFromSerialized(UTRIE2_16_VALUE_BITS, in ucnvsel_openFromSerialized()
571 ucnvsel_close(sel); in ucnvsel_openFromSerialized()
575 sel->pv = (uint32_t *)p; in ucnvsel_openFromSerialized()
576 p += sel->pvCount * 4; in ucnvsel_openFromSerialized()
579 for (int32_t i = 0; i < sel->encodingsCount; ++i) { in ucnvsel_openFromSerialized()
580 sel->encodings[i] = s; in ucnvsel_openFromSerialized()
583 p += sel->encodingStrLength; in ucnvsel_openFromSerialized()
585 return sel; in ucnvsel_openFromSerialized()
594 const UConverterSelector* sel; member
626 const UConverterSelector* sel; in ucnvsel_next_encoding() local
631 sel = ((Enumerator*)(enumerator->context))->sel; in ucnvsel_next_encoding()
632 result = sel->encodings[((Enumerator*)(enumerator->context))->index[cur] ]; in ucnvsel_next_encoding()
690 static UEnumeration *selectForMask(const UConverterSelector* sel, in selectForMask() argument
702 result->sel = sel; in selectForMask()
715 int32_t columns = (sel->encodingsCount+31)/32; in selectForMask()
725 for (i = 0 ; i < 32 && k < sel->encodingsCount; i++, k++) { in selectForMask()
740 ucnvsel_selectForString(const UConverterSelector* sel, in ucnvsel_selectForString() argument
747 if (sel == NULL || (s == NULL && length != 0)) { in ucnvsel_selectForString()
752 int32_t columns = (sel->encodingsCount+31)/32; in ucnvsel_selectForString()
771 UTRIE2_U16_NEXT16(sel->trie, s, limit, c, pvIndex); in ucnvsel_selectForString()
772 if (intersectMasks(mask, sel->pv+pvIndex, columns)) { in ucnvsel_selectForString()
777 return selectForMask(sel, mask, status); in ucnvsel_selectForString()
782 ucnvsel_selectForUTF8(const UConverterSelector* sel, in ucnvsel_selectForUTF8() argument
789 if (sel == NULL || (s == NULL && length != 0)) { in ucnvsel_selectForUTF8()
794 int32_t columns = (sel->encodingsCount+31)/32; in ucnvsel_selectForUTF8()
811 UTRIE2_U8_NEXT16(sel->trie, s, limit, pvIndex); in ucnvsel_selectForUTF8()
812 if (intersectMasks(mask, sel->pv+pvIndex, columns)) { in ucnvsel_selectForUTF8()
817 return selectForMask(sel, mask, status); in ucnvsel_selectForUTF8()