1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (C) 1999-2006, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
11 * defines variables and functions pertaining to converter name resolution
12 * aspect of the conversion code
18 #include "unicode/utypes.h"
20 #if !UCONFIG_NO_CONVERSION
24 #define UCNV_AMBIGUOUS_ALIAS_MAP_BIT 0x8000
25 #define UCNV_CONTAINS_OPTION_BIT 0x4000
26 #define UCNV_CONVERTER_INDEX_MASK 0xFFF
27 #define UCNV_NUM_RESERVED_TAGS 2
28 #define UCNV_NUM_HIDDEN_TAGS 1
32 UCNV_IO_STD_NORMALIZED,
33 UCNV_IO_NORM_TYPE_COUNT
37 uint16_t stringNormalizationType;
38 uint16_t containsCnvOptionInfo;
39 } UConverterAliasOptions;
41 typedef struct UConverterAlias {
42 const uint16_t *converterList;
43 const uint16_t *tagList;
44 const uint16_t *aliasList;
45 const uint16_t *untaggedConvArray;
46 const uint16_t *taggedAliasArray;
47 const uint16_t *taggedAliasLists;
48 const UConverterAliasOptions *optionTable;
49 const uint16_t *stringTable;
50 const uint16_t *normalizedStringTable;
52 uint32_t converterListSize;
54 uint32_t aliasListSize;
55 uint32_t untaggedConvArraySize;
56 uint32_t taggedAliasArraySize;
57 uint32_t taggedAliasListsSize;
58 uint32_t optionTableSize;
59 uint32_t stringTableSize;
60 uint32_t normalizedStringTableSize;
64 * \var ucnv_io_stripForCompare
65 * Remove the underscores, dashes and spaces from the name, and convert
66 * the name to lower case.
67 * @param dst The destination buffer, which is <= the buffer of name.
68 * @param dst The destination buffer, which is <= the buffer of name.
69 * @see ucnv_compareNames
70 * @return the destination buffer.
72 #if U_CHARSET_FAMILY==U_ASCII_FAMILY
73 # define ucnv_io_stripForCompare ucnv_io_stripASCIIForCompare
74 #elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
75 # define ucnv_io_stripForCompare ucnv_io_stripEBCDICForCompare
77 # error U_CHARSET_FAMILY is not valid
80 U_CAPI char * U_CALLCONV
81 ucnv_io_stripASCIIForCompare(char *dst, const char *name);
83 U_CAPI char * U_CALLCONV
84 ucnv_io_stripEBCDICForCompare(char *dst, const char *name);
87 * Map a converter alias name to a canonical converter name.
88 * The alias is searched for case-insensitively, the converter name
89 * is returned in mixed-case.
90 * Returns NULL if the alias is not found.
91 * @param alias The alias name to be searched.
92 * @param containsOption A return value stating whether the returned converter name contains an option (a comma)
93 * @param pErrorCode The error code
94 * @return the converter name in mixed-case, return NULL if the alias is not found.
97 ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *pErrorCode);
100 * Return the number of all known converter names (no aliases).
101 * @param pErrorCode The error code
102 * @return the number of all aliases
105 ucnv_io_countKnownConverters(UErrorCode *pErrorCode);
108 * Swap an ICU converter alias table. See implementation for details.
111 U_CAPI int32_t U_EXPORT2
112 ucnv_swapAliases(const UDataSwapper *ds,
113 const void *inData, int32_t length, void *outData,
114 UErrorCode *pErrorCode);
118 #endif /* _UCNV_IO */
121 * Hey, Emacs, please set the following:
124 * indent-tabs-mode: nil