Home | History | Annotate | Download | only in common

Lines Matching full:alias

24 *   06/28/2002  grhoten     Major overhaul of the converter alias design.
25 * Now an alias can map to different converters
73 * list contains indexes into the string table for the alias name. The
76 * alias -> converter name mapping. Section 3 and 4 form a two column table.
85 * an alias mapped to this converter is ambiguous. See UCNV_CONVERTER_INDEX_MASK
87 * the predigested form of the 5th section so that an alias lookup can be fast.
90 * section is the full form of all alias mappings. The column index is the
96 * and is followed by indexes to alias names in the string table. This is
117 * has a unique alias among all converters. That same alias can
119 * but only one alias per tag can be unique.
317 isAlias(const char *alias, UErrorCode *pErrorCode) {
318 if(alias==NULL) {
322 return (UBool)(*alias!=0);
454 * Do a fuzzy compare of two converter/alias names.
458 * See section 1.4, Charset Alias Matching in Unicode Technical Standard #22
466 * @param name1 a converter name or alias, zero-terminated
467 * @param name2 a converter name or alias, zero-terminated
545 * search for an alias
549 findConverter(const char *alias, UBool *containsOption, UErrorCode *pErrorCode) {
557 if (uprv_strlen(alias) >= UCNV_MAX_CONVERTER_NAME_LENGTH) {
563 ucnv_io_stripForCompare(strippedName, alias);
564 alias = strippedName;
567 /* do a binary search for the alias */
580 result = ucnv_compareNames(alias, GET_STRING(gMainTable.aliasList[mid]));
583 result = uprv_strcmp(alias, GET_NORMALIZED_STRING(gMainTable.aliasList[mid]));
592 * this alias in gAliasList is unique, but different standards
593 * may map an alias to different converters.
614 * Is this alias in this list?
615 * alias and listOffset should be non-NULL.
618 isAliasInList(const char *alias, uint32_t listOffset) {
626 && ucnv_compareNames(alias, GET_STRING(currList[currAlias]))==0)
636 * Search for an standard name of an alias (what is the default name
642 findTaggedAliasListsOffset(const char *alias, const char *standard, UErrorCode *pErrorCode) {
649 /* Make a quick guess. Hopefully they used a TR22 canonical alias. */
650 convNum = findConverter(alias, NULL, &myErr);
661 /* Uh Oh! They used an ambiguous alias.
668 if (listOffset && isAliasInList(alias, listOffset)) {
677 because an alias is unique per row, right now.
678 This would change if alias versioning appears. */
681 /* The standard doesn't know about the alias */
693 findTaggedConverterNum(const char *alias, const char *standard, UErrorCode *pErrorCode) {
700 /* Make a quick guess. Hopefully they used a TR22 canonical alias. */
701 convNum = findConverter(alias, NULL, &myErr);
708 if (listOffset && isAliasInList(alias, listOffset)) {
712 /* Uh Oh! They used an ambiguous alias.
721 if (listOffset && isAliasInList(alias, listOffset)) {
725 /* The standard doesn't know about the alias */
737 ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *pErrorCode) {
738 const char *aliasTmp = alias;
865 ucnv_io_countAliases(const char *alias, UErrorCode *pErrorCode) {
866 if(haveAliasData(pErrorCode) && isAlias(alias, pErrorCode)) {
867 uint32_t convNum = findConverter(alias, NULL, pErrorCode);
883 ucnv_io_getAliases(const char *alias, uint16_t start, const char **aliases, UErrorCode *pErrorCode) {
884 if(haveAliasData(pErrorCode) && isAlias(alias, pErrorCode)) {
886 uint32_t convNum = findConverter(alias, NULL, pErrorCode);
908 ucnv_io_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode) {
909 if(haveAliasData(pErrorCode) && isAlias(alias, pErrorCode)) {
910 uint32_t convNum = findConverter(alias, NULL, pErrorCode);
955 ucnv_getStandardName(const char *alias, const char *standard, UErrorCode *pErrorCode) {
956 if (haveAliasData(pErrorCode) && isAlias(alias, pErrorCode)) {
957 uint32_t listOffset = findTaggedAliasListsOffset(alias, standard, pErrorCode);
966 /* else someone screwed up the alias table. */
975 ucnv_countAliases(const char *alias, UErrorCode *pErrorCode)
977 return ucnv_io_countAliases(alias, pErrorCode);
982 ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode)
984 return ucnv_io_getAlias(alias, n, pErrorCode);
988 ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode)
990 ucnv_io_getAliases(alias, 0, aliases, pErrorCode);
1001 ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *pErrorCode) {
1002 if (haveAliasData(pErrorCode) && isAlias(alias, pErrorCode)) {
1003 uint32_t convNum = findTaggedConverterNum(alias, standard, pErrorCode);
1086 /* alias table swapping ----------------------------------------------------- */
1156 udata_printError(ds, "ucnv_swapAliases(): data format %02x.%02x.%02x.%02x (format version %02x) is not an alias table\n",
1164 /* an alias table must contain at least the table of contents array */
1166 udata_printError(ds, "ucnv_swapAliases(): too few bytes (%d after header) for an alias table\n",
1204 udata_printError(ds, "ucnv_swapAliases(): too few bytes (%d after header) for an alias table\n",