Lines Matching refs:block
83 /* preallocate and reset the first data block (block index 0) */
87 /* preallocate and reset the first block (number 0) and Latin-1 (U+0000..U+00ff) after that */
93 /* do this at least for trie->index[0] even if that block is only partly used for Latin-1 */
190 * @return -1 if no new data block available (out of memory in data array)
203 /* allocate a new data block */
211 /* copy-on-write for a block from a setRange() */
221 int32_t block;
228 block=utrie_getDataBlock(trie, c);
229 if(block<0) {
233 trie->data[block+(c&UTRIE_MASK)]=value;
239 int32_t block;
249 block=trie->index[c>>UTRIE_SHIFT];
251 *pInBlockZero= (UBool)(block==0);
254 return trie->data[ABS(block)+(c&UTRIE_MASK)];
261 utrie_fillBlock(uint32_t *block, UChar32 start, UChar32 limit,
265 pLimit=block+limit;
266 block+=start;
268 while(block<pLimit) {
269 *block++=value;
272 while(block<pLimit) {
273 if(*block==initialValue) {
274 *block=value;
276 ++block;
289 int32_t block, rest, repeatBlock;
305 /* set partial block at [start..following block boundary[ */
306 block=utrie_getDataBlock(trie, start);
307 if(block<0) {
313 utrie_fillBlock(trie->data+block, start&UTRIE_MASK, UTRIE_DATA_BLOCK_LENGTH,
317 utrie_fillBlock(trie->data+block, start&UTRIE_MASK, limit&UTRIE_MASK,
323 /* number of positions in the last, partial block */
326 /* round down limit to a block boundary */
337 block=trie->index[start>>UTRIE_SHIFT];
338 if(block>0) {
340 utrie_fillBlock(trie->data+block, 0, UTRIE_DATA_BLOCK_LENGTH, value, initialValue, overwrite);
341 } else if(trie->data[-block]!=value && (block==0 || overwrite)) {
342 /* set the repeatBlock instead of the current block 0 or range block */
352 /* set the negative block number to indicate that it is a repeat block */
362 /* set partial block at [last block boundary..limit[ */
363 block=utrie_getDataBlock(trie, start);
364 if(block<0) {
368 utrie_fillBlock(trie->data+block, 0, rest, value, initialValue, overwrite);
377 int32_t block, i;
379 for(block=UTRIE_BMP_INDEX_LENGTH; block<indexLength; block+=UTRIE_SURROGATE_BLOCK_COUNT) {
381 if(idx[block+i]!=idx[otherBlock+i]) {
386 return block;
408 int32_t indexLength, block;
429 block=0; /* leadUnitValue==initialValue, use all-initial-value block */
432 block=utrie_allocDataBlock(trie);
433 if(block<0) {
438 utrie_fillBlock(trie->data+block, 0, UTRIE_DATA_BLOCK_LENGTH, trie->leadUnitValue, trie->data[0], TRUE);
439 block=-block; /* negative block number to indicate that it is a repeat block */
442 trie->index[c]=block;
448 * its index block must be used first (in which case the folding is a no-op).
457 /* there is data, treat the full block for a lead surrogate */
465 /* is there an identical index block? */
466 block=_findSameIndexBlock(idx, indexLength, c>>UTRIE_SHIFT);
473 value=getFoldedValue(trie, c, block+UTRIE_SURROGATE_BLOCK_COUNT);
481 /* if we did not find an identical index block... */
482 if(block==indexLength) {
508 * the additional block of duplicated values for lead surrogates.
516 * make space for the lead surrogate index block and
536 * Set a value in the trie index map to indicate which data block
550 /* mark each block that _is_ used with 0 */
555 /* never move the all-initial-value block 0 */
562 int32_t block;
567 for(block=0; block<=dataLength; block+=step) {
568 if(equal_uint32(data+block, data+otherBlock, UTRIE_DATA_BLOCK_LENGTH)) {
569 return block;
606 /* initialize the index map with "block is used/unused" flags */
619 * start: index of first entry of current block
620 * newStart: index where the current block is to be moved
626 /* advance start to the next block */
629 /* leave newStart with the previous block! */
633 /* search for an identical block */
639 /* found an identical block, set the other block's index value for the current block */
642 /* advance start to the next block */
645 /* leave newStart with the previous block! */
649 /* see if the beginning of this block can be overlapped with the end of the previous block */
651 /* look for maximum overlap (modulo granularity) with the previous, adjacent block */
937 uint16_t block;
945 /* max(Latin-1, block 0) */
975 /* indexes to block 0 */
976 block=(uint16_t)(trie->indexLength>>UTRIE_INDEX_SHIFT);
979 p16[i]=block;
983 /* indexes for lead surrogate code units to the block after Latin-1 */
984 block+=(uint16_t)(latin1Length>>UTRIE_INDEX_SHIFT);
988 p16[i]=block;
1010 /* indexes to block 0 */
1014 /* indexes for lead surrogate code units to the block after Latin-1 */
1015 block=(uint16_t)(latin1Length>>UTRIE_INDEX_SHIFT);
1019 p16[i]=block;
1064 block, prevBlock, nullBlock, offset;
1101 block=idx[i]<<UTRIE_INDEX_SHIFT;
1102 if(block==prevBlock) {
1103 /* the block is the same as the previous one, and filled with value */
1105 } else if(block==nullBlock) {
1106 /* this is the all-initial-value block */
1119 prevBlock=block;
1121 value=enumValue(context, data32!=NULL ? data32[block+j] : idx[block+j]);
1129 /* the block is not filled with all the same value */
1145 /* no entries for a whole block of lead surrogates */
1187 block=idx[i]<<UTRIE_INDEX_SHIFT;
1188 if(block==prevBlock) {
1189 /* the block is the same as the previous one, and filled with value */
1191 } else if(block==nullBlock) {
1192 /* this is the all-initial-value block */
1205 prevBlock=block;
1207 value=enumValue(context, data32!=NULL ? data32[block+j] : idx[block+j]);
1215 /* the block is not filled with all the same value */