Home | History | Annotate | Download | only in i18n

Lines Matching defs:tbl

29 static void uprv_growTable(ContractionTable *tbl, UErrorCode *status) {
30 if(tbl->position == tbl->size) {
31 uint32_t *newData = (uint32_t *)uprv_realloc(tbl->CEs, 2*tbl->size*sizeof(uint32_t));
36 UChar *newCPs = (UChar *)uprv_realloc(tbl->codePoints, 2*tbl->size*sizeof(UChar));
42 tbl->CEs = newData;
43 tbl->codePoints = newCPs;
44 tbl->size *= 2;
54 CntTable *tbl = (CntTable *)uprv_malloc(sizeof(CntTable));
55 if(tbl == NULL) {
59 tbl->mapping = mapping;
60 tbl->elements = (ContractionTable **)uprv_malloc(INIT_EXP_TABLE_SIZE*sizeof(ContractionTable *));
61 if(tbl->elements == NULL) {
63 uprv_free(tbl);
66 tbl->capacity = INIT_EXP_TABLE_SIZE;
67 uprv_memset(tbl->elements, 0, INIT_EXP_TABLE_SIZE*sizeof(ContractionTable *));
68 tbl->size = 0;
69 tbl->position = 0;
70 tbl->CEs = NULL;
71 tbl->codePoints = NULL;
72 tbl->offsets = NULL;
73 tbl->currentTag = NOT_FOUND_TAG;
74 return tbl;
354 ContractionTable *tbl = NULL;
359 if((element == 0xFFFFFF) || (tbl = table->elements[element]) == NULL) {
363 tbl->CEs[tbl->position-1] = value;
373 ContractionTable *tbl = NULL;
380 if((element == 0xFFFFFF) || (tbl = table->elements[element]) == NULL) {
381 tbl = addATableElement(table, &element, status);
387 uprv_growTable(tbl, status);
392 while(tbl->codePoints[offset] < codePoint && offset<tbl->position) {
396 uint32_t i = tbl->position;
397 for(i = tbl->position; i > offset; i--) {
398 tbl->CEs[i] = tbl->CEs[i-1];
399 tbl->codePoints[i] = tbl->codePoints[i-1];
402 tbl->CEs[offset] = value;
403 tbl->codePoints[offset] = codePoint;
405 tbl->position++;
417 ContractionTable *tbl = NULL;
423 if((element == 0xFFFFFF) || (tbl = table->elements[element]) == NULL) {
424 tbl = addATableElement(table, &element, status);
430 uprv_growTable(tbl, status);
432 tbl->CEs[tbl->position] = value;
433 tbl->codePoints[tbl->position] = codePoint;
435 tbl->position++;
445 ContractionTable *tbl = NULL;
451 if((element == 0xFFFFFF) || (tbl = table->elements[element]) == NULL) {
452 tbl = addATableElement(table, &element, status);
459 if(offset >= tbl->size) {
463 tbl->CEs[offset] = value;
464 tbl->codePoints[offset] = codePoint;
472 ContractionTable *tbl = NULL;
475 tbl = table->elements[element]; /* This could also return NULL */
477 return tbl;
480 static int32_t _cnttab_findCP(ContractionTable *tbl, UChar codePoint) {
482 if(tbl == NULL) {
486 while(codePoint > tbl->codePoints[position]) {
488 if(position > tbl->position) {
492 if (codePoint == tbl->codePoints[position]) {
499 static uint32_t _cnttab_getCE(ContractionTable *tbl, int32_t position) {
500 if(tbl == NULL) {
503 if((uint32_t)position > tbl->position || position == -1) {
506 return tbl->CEs[position];
534 ContractionTable *tbl = _cnttab_getContractionTable(table, element);
535 return _cnttab_getCE(tbl, _cnttab_findCP(tbl, codePoint));
561 ContractionTable *tbl = NULL;
567 if((element == 0xFFFFFF) || (tbl = table->elements[element]) == NULL) {
573 while(codePoint > tbl->codePoints[position]) {
575 if(position > tbl->position) {
579 if (codePoint == tbl->codePoints[position]) {
580 tbl->CEs[position] = newCE;