Lines Matching defs:ucm

8 *   file name:  ucm.c
16 * This file reads a .ucm file, stores its mappings and sorts them.
17 * It implements handling of Unicode conversion mappings from .ucm files
35 #include "ucm.h"
135 * Comparing by lengths first is for compatibility with old .ucm tools
245 fprintf(stderr, "ucm error: unable to allocate reverseMap\n");
259 fprintf(stderr, "ucm error: sortTable()/uprv_sortArray() fails - %s\n",
372 "ucm error: the base table contains a mapping whose input sequence\n"
397 "ucm error: the base table contains a mapping whose input sequence\n"
489 "ucm error: the base table contains a mapping whose input sequence\n"
514 "ucm error: the base table contains a mapping whose input sequence\n"
559 fprintf(stderr, "ucm error: the base table contains mappings without precision flags\n");
563 fprintf(stderr, "ucm error: extension table contains mappings without precision flags\n");
693 ucm_separateMappings(UCMFile *ucm, UBool isSISO) {
699 table=ucm->base;
716 &ucm->states, m,
732 ucm_moveMappings(ucm->base, ucm->ext);
733 return ucm_checkBaseExt(&ucm->states, ucm->base, ucm->ext, ucm->ext, FALSE);
735 ucm_sortTable(ucm->base);
740 /* ucm parser --------------------------------------------------------------- */
762 fprintf(stderr, "ucm error: byte must be formatted as \\xXX (2 hex digits) - \"%s\"\n", line);
767 fprintf(stderr, "ucm error: too many bytes on \"%s\"\n", line);
807 fprintf(stderr, "ucm error: Unicode code point must be formatted as <UXXXX> (1..6 hex digits) - \"%s\"\n", line);
811 fprintf(stderr, "ucm error: Unicode code point must be 0..d7ff or e000..10ffff - \"%s\"\n", line);
816 fprintf(stderr, "ucm error: too many code points on \"%s\"\n", line);
824 fprintf(stderr, "ucm error: no Unicode code points on \"%s\"\n", line);
834 fprintf(stderr, "ucm error: too many UChars on \"%s\"\n", line);
847 fprintf(stderr, "ucm error: no bytes on \"%s\"\n", line);
861 fprintf(stderr, "ucm error: fallback indicator must be |0..|4 - \"%s\"\n", line);
881 fprintf(stderr, "ucm error: unable to allocate a UCMTable\n");
930 fprintf(stderr, "ucm error: unable to allocate %d UCMappings\n",
946 fprintf(stderr, "ucm error: unable to allocate %d UChar32s\n",
956 fprintf(stderr, "ucm error: unable to allocate %d bytes\n",
966 fprintf(stderr, "ucm error: too many code points in multiple-code point mappings\n");
978 fprintf(stderr, "ucm error: too many bytes in mappings with >4 charset bytes\n");
1011 UCMFile *ucm=(UCMFile *)uprv_malloc(sizeof(UCMFile));
1012 if(ucm==NULL) {
1013 fprintf(stderr, "ucm error: unable to allocate a UCMFile\n");
1017 memset(ucm, 0, sizeof(UCMFile));
1019 ucm->base=ucm_openTable();
1020 ucm->ext=ucm_openTable();
1022 ucm->states.stateFlags[0]=MBCS_STATE_FLAG_DIRECT;
1023 ucm->states.conversionType=UCNV_UNSUPPORTED_CONVERTER;
1024 ucm->states.outputType=-1;
1025 ucm->states.minCharLength=ucm->states.maxCharLength=1;
1027 return ucm;
1031 ucm_close(UCMFile *ucm) {
1032 if(ucm!=NULL) {
1033 ucm_closeTable(ucm->base);
1034 ucm_closeTable(ucm->ext);
1035 uprv_free(ucm);
1087 ucm_addMappingAuto(UCMFile *ucm, UBool forBase, UCMStates *baseStates,
1094 fprintf(stderr, "ucm error: illegal <subchar1> |2 mapping from multiple code points\n");
1117 ucm_addMapping(ucm->base, m, codePoints, bytes);
1119 ucm_addMapping(ucm->ext, m, codePoints, bytes);
1126 ucm_addMappingFromLine(UCMFile *ucm, const char *line, UBool forBase, UCMStates *baseStates) {
1140 ucm_addMappingAuto(ucm, forBase, baseStates, &m, codePoints, bytes);
1144 ucm_readTable(UCMFile *ucm, FileStream* convFile,
1182 isOK&=ucm_addMappingFromLine(ucm, line, forBase, baseStates);