Lines Matching refs:table
66 ucm_printMapping(UCMTable *table, UCMapping *m, FILE *f) {
67 printMapping(m, UCM_GET_CODE_POINTS(table, m), UCM_GET_BYTES(table, m), f);
71 ucm_printTable(UCMTable *table, FILE *f, UBool byUnicode) {
75 m=table->mappings;
76 length=table->mappingsLength;
79 ucm_printMapping(table, m, f);
82 const int32_t *map=table->reverseMap;
84 ucm_printMapping(table, m+map[i], f);
214 UCMTable *table=(UCMTable *)context;
217 table, table->mappings+l,
218 table, table->mappings+r, FALSE);
271 * remove mappings with their move flag set from the base table
272 * and move some of them (with UCM_MOVE_TO_EXT) to the extension table
289 /* add the mapping to the extension table */
372 /* mark this mapping to be moved to the extension table */
377 "ucm error: the base table contains a mapping whose input sequence\n"
402 "ucm error: the base table contains a mapping whose input sequence\n"
489 /* mark this mapping to be moved to the extension table */
494 "ucm error: the base table contains a mapping whose input sequence\n"
519 "ucm error: the base table contains a mapping whose input sequence\n"
535 ucm_checkValidity(UCMTable *table, UCMStates *baseStates) {
540 m=table->mappings;
541 mLimit=m+table->mappingsLength;
545 count=ucm_countChars(baseStates, UCM_GET_BYTES(table, m), m->bLen);
547 ucm_printMapping(table, m, stderr);
562 /* if we have an extension table, we must always use precision flags */
564 fprintf(stderr, "ucm error: the base table contains mappings without precision flags\n");
568 fprintf(stderr, "ucm error: extension table contains mappings without precision flags\n");
646 * (reverse) fallback codepage->Unicode, copy it to the fromU table
654 /* the table may have been reallocated */
695 /* separate extension mappings out of base table for rptp2ucm --------------- */
699 UCMTable *table;
704 table=ucm->base;
705 m=table->mappings;
706 mLimit=m+table->mappingsLength;
713 fprintf(stderr, "warning: removing illegal mapping from an SI/SO-stateful table\n");
714 ucm_printMapping(table, m, stderr);
722 UCM_GET_CODE_POINTS(table, m), UCM_GET_BYTES(table, m));
725 printMapping(m, UCM_GET_CODE_POINTS(table, m), UCM_GET_BYTES(table, m), stderr);
884 UCMTable *table=(UCMTable *)uprv_malloc(sizeof(UCMTable));
885 if(table==NULL) {
890 memset(table, 0, sizeof(UCMTable));
891 return table;
895 ucm_closeTable(UCMTable *table) {
896 if(table!=NULL) {
897 uprv_free(table->mappings);
898 uprv_free(table->codePoints);
899 uprv_free(table->bytes);
900 uprv_free(table->reverseMap);
901 uprv_free(table);
906 ucm_resetTable(UCMTable *table) {
907 if(table!=NULL) {
908 table->mappingsLength=0;
909 table->flagsType=0;
910 table->unicodeMask=0;
911 table->bytesLength=table->codePointsLength=0;
912 table->isSorted=FALSE;
917 ucm_addMapping(UCMTable *table,
925 if(table->mappingsLength>=table->mappingsCapacity) {
927 if(table->mappingsCapacity==0) {
928 table->mappingsCapacity=1000;
930 table->mappingsCapacity*=10;
932 table->mappings=(UCMapping *)uprv_realloc(table->mappings,
933 table->mappingsCapacity*sizeof(UCMapping));
934 if(table->mappings==NULL) {
936 (int)table->mappingsCapacity);
940 if(table->reverseMap!=NULL) {
942 uprv_free(table->reverseMap);
943 table->reverseMap=NULL;
947 if(m->uLen>1 && table->codePointsCapacity==0) {
948 table->codePointsCapacity=10000;
949 table->codePoints=(UChar32 *)uprv_malloc(table->codePointsCapacity*4);
950 if(table->codePoints==NULL) {
952 (int)table->codePointsCapacity);
957 if(m->bLen>4 && table->bytesCapacity==0) {
958 table->bytesCapacity=10000;
959 table->bytes=(uint8_t *)uprv_malloc(table->bytesCapacity);
960 if(table->bytes==NULL) {
962 (int)table->bytesCapacity);
968 idx=table->codePointsLength;
969 table->codePointsLength+=m->uLen;
970 if(table->codePointsLength>table->codePointsCapacity) {
975 uprv_memcpy(table->codePoints+idx, codePoints, (size_t)m->uLen*4);
980 idx=table->bytesLength;
981 table->bytesLength+=m->bLen;
982 if(table->bytesLength>table->bytesCapacity) {
987 uprv_memcpy(table->bytes+idx, bytes, m->bLen);
995 table->unicodeMask|=UCNV_HAS_SUPPLEMENTARY; /* there are supplementary code points */
997 table->unicodeMask|=UCNV_HAS_SURROGATES; /* there are surrogate code points */
1003 table->flagsType|=UCM_FLAGS_IMPLICIT;
1005 table->flagsType|=UCM_FLAGS_EXPLICIT;
1008 tm=table->mappings+table->mappingsLength++;
1011 table->isSorted=FALSE;
1058 * Suitable for an ICU conversion base table means:
1062 * (the table stores additional bits to distinguish mapping types)
1077 * makeconv uses a hack for moving mappings only for the fromUnicode table
1086 return 0; /* suitable for a base table */
1088 return 1; /* needs to go into an extension table */
1114 /* not used - adding a mapping for an extension-only table before its base table is read */
1119 * Add the mapping to the base table if this is requested and suitable.
1120 * Otherwise, add it to the extension table.
1183 /* stop at the end of the mapping table */