Home | History | Annotate | Download | only in common

Lines Matching defs:trie

17 // need not depend on other trie code.
30 UTrieHeader trie;
49 trie.signature=ds->readUInt32(inTrie->signature);
50 trie.options=ds->readUInt32(inTrie->options);
51 trie.indexLength=udata_readInt32(ds, inTrie->indexLength);
52 trie.dataLength=udata_readInt32(ds, inTrie->dataLength);
54 if( trie.signature!=0x54726965 ||
55 (trie.options&UTRIE_OPTIONS_SHIFT_MASK)!=UTRIE_SHIFT ||
56 ((trie.options>>UTRIE_OPTIONS_INDEX_SHIFT)&UTRIE_OPTIONS_SHIFT_MASK)!=UTRIE_INDEX_SHIFT ||
57 trie.indexLength<UTRIE_BMP_INDEX_LENGTH ||
58 (trie.indexLength&(UTRIE_SURROGATE_BLOCK_COUNT-1))!=0 ||
59 trie.dataLength<UTRIE_DATA_BLOCK_LENGTH ||
60 (trie.dataLength&(UTRIE_DATA_GRANULARITY-1))!=0 ||
61 ((trie.options&UTRIE_OPTIONS_LATIN1_IS_LINEAR)!=0 && trie.dataLength<(UTRIE_DATA_BLOCK_LENGTH+0x100))
67 dataIs32=(UBool)((trie.options&UTRIE_OPTIONS_DATA_IS_32_BIT)!=0);
68 size=sizeof(UTrieHeader)+trie.indexLength*2+trie.dataLength*(dataIs32?4:2);
85 ds->swapArray16(ds, inTrie+1, trie.indexLength*2, outTrie+1, pErrorCode);
86 ds->swapArray32(ds, (const uint16_t *)(inTrie+1)+trie.indexLength, trie.dataLength*4,
87 (uint16_t *)(outTrie+1)+trie.indexLength, pErrorCode);
89 ds->swapArray16(ds, inTrie+1, (trie.indexLength+trie.dataLength)*2, outTrie+1, pErrorCode);
101 UTrie2Header trie;
120 trie.signature=ds->readUInt32(inTrie->signature);
121 trie.options=ds->readUInt16(inTrie->options);
122 trie.indexLength=ds->readUInt16(inTrie->indexLength);
123 trie.shiftedDataLength=ds->readUInt16(inTrie->shiftedDataLength);
125 valueBits=(UTrie2ValueBits)(trie.options&UTRIE2_OPTIONS_VALUE_BITS_MASK);
126 dataLength=(int32_t)trie.shiftedDataLength<<UTRIE2_INDEX_SHIFT;
128 if( trie.signature!=UTRIE2_SIG ||
130 trie.indexLength<UTRIE2_INDEX_1_OFFSET ||
137 size=sizeof(UTrie2Header)+trie.indexLength*2;
167 ds->swapArray16(ds, inTrie+1, (trie.indexLength+dataLength)*2, outTrie+1, pErrorCode);
170 ds->swapArray16(ds, inTrie+1, trie.indexLength*2, outTrie+1, pErrorCode);
171 ds->swapArray32(ds, (const uint16_t *)(inTrie+1)+trie.indexLength, dataLength*4,
172 (uint16_t *)(outTrie+1)+trie.indexLength, pErrorCode);
188 UCPTrieHeader trie;
207 trie.signature=ds->readUInt32(inTrie->signature);
208 trie.options=ds->readUInt16(inTrie->options);
209 trie.indexLength=ds->readUInt16(inTrie->indexLength);
210 trie.dataLength = ds->readUInt16(inTrie->dataLength);
212 UCPTrieType type = (UCPTrieType)((trie.options >> 6) & 3);
213 valueWidth = (UCPTrieValueWidth)(trie.options & UCPTRIE_OPTIONS_VALUE_BITS_MASK);
214 dataLength = ((int32_t)(trie.options & UCPTRIE_OPTIONS_DATA_LENGTH_MASK) << 4) | trie.dataLength;
218 if( trie.signature!=UCPTRIE_SIG ||
220 (trie.options & UCPTRIE_OPTIONS_RESERVED_MASK) != 0 ||
222 trie.indexLength < minIndexLength ||
229 size=sizeof(UCPTrieHeader)+trie.indexLength*2;
262 ds->swapArray16(ds, inTrie+1, (trie.indexLength+dataLength)*2, outTrie+1, pErrorCode);
265 ds->swapArray16(ds, inTrie+1, trie.indexLength*2, outTrie+1, pErrorCode);
266 ds->swapArray32(ds, (const uint16_t *)(inTrie+1)+trie.indexLength, dataLength*4,
267 (uint16_t *)(outTrie+1)+trie.indexLength, pErrorCode);
270 ds->swapArray16(ds, inTrie+1, trie.indexLength*2, outTrie+1, pErrorCode);
272 uprv_memmove((outTrie+1)+trie.indexLength, (inTrie+1)+trie.indexLength, dataLength);
287 * Gets the trie version from 32-bit-aligned memory containing the serialized form
290 * @param data a pointer to 32-bit-aligned memory containing the serialized form of a trie
295 * @return the trie version of the serialized form, or 0 if it is not
296 * recognized as a serialized trie