X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..729e4ab9bc6618bc3d8a898e575df7f4019e29ca:/icuSources/common/ucnv_io.h diff --git a/icuSources/common/ucnv_io.h b/icuSources/common/ucnv_io.h index 7ae6def4..060ffd05 100644 --- a/icuSources/common/ucnv_io.h +++ b/icuSources/common/ucnv_io.h @@ -1,13 +1,13 @@ /* ********************************************************************** - * Copyright (C) 1999-2004, International Business Machines + * Copyright (C) 1999-2006, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * * * ucnv_io.h: - * defines variables and functions pertaining to file access, and name resolution - * aspect of the library + * defines variables and functions pertaining to converter name resolution + * aspect of the conversion code */ #ifndef UCNV_IO_H @@ -20,16 +20,51 @@ #include "udataswp.h" #define UCNV_AMBIGUOUS_ALIAS_MAP_BIT 0x8000 +#define UCNV_CONTAINS_OPTION_BIT 0x4000 #define UCNV_CONVERTER_INDEX_MASK 0xFFF #define UCNV_NUM_RESERVED_TAGS 2 #define UCNV_NUM_HIDDEN_TAGS 1 +enum { + UCNV_IO_UNNORMALIZED, + UCNV_IO_STD_NORMALIZED, + UCNV_IO_NORM_TYPE_COUNT +}; + +typedef struct { + uint16_t stringNormalizationType; + uint16_t containsCnvOptionInfo; +} UConverterAliasOptions; + +typedef struct UConverterAlias { + const uint16_t *converterList; + const uint16_t *tagList; + const uint16_t *aliasList; + const uint16_t *untaggedConvArray; + const uint16_t *taggedAliasArray; + const uint16_t *taggedAliasLists; + const UConverterAliasOptions *optionTable; + const uint16_t *stringTable; + const uint16_t *normalizedStringTable; + + uint32_t converterListSize; + uint32_t tagListSize; + uint32_t aliasListSize; + uint32_t untaggedConvArraySize; + uint32_t taggedAliasArraySize; + uint32_t taggedAliasListsSize; + uint32_t optionTableSize; + uint32_t stringTableSize; + uint32_t normalizedStringTableSize; +} UConverterAlias; + /** * \var ucnv_io_stripForCompare * Remove the underscores, dashes and spaces from the name, and convert * the name to lower case. * @param dst The destination buffer, which is <= the buffer of name. * @param dst The destination buffer, which is <= the buffer of name. + * @see ucnv_compareNames * @return the destination buffer. */ #if U_CHARSET_FAMILY==U_ASCII_FAMILY @@ -40,10 +75,10 @@ # error U_CHARSET_FAMILY is not valid #endif -U_CFUNC char * U_EXPORT2 +U_CAPI char * U_EXPORT2 ucnv_io_stripASCIIForCompare(char *dst, const char *name); -U_CFUNC char * U_EXPORT2 +U_CAPI char * U_EXPORT2 ucnv_io_stripEBCDICForCompare(char *dst, const char *name); /** @@ -52,109 +87,23 @@ ucnv_io_stripEBCDICForCompare(char *dst, const char *name); * is returned in mixed-case. * Returns NULL if the alias is not found. * @param alias The alias name to be searched. + * @param containsOption A return value stating whether the returned converter name contains an option (a comma) * @param pErrorCode The error code * @return the converter name in mixed-case, return NULL if the alias is not found. */ U_CFUNC const char * -ucnv_io_getConverterName(const char *alias, UErrorCode *pErrorCode); - -/** - * The count for ucnv_io_getAliases and ucnv_io_getAlias - * @param alias The alias name to be counted - * @param pErrorCode The error code - * @return the alias count - */ -U_CFUNC uint16_t -ucnv_io_countAliases(const char *alias, UErrorCode *pErrorCode); - -/** - * Search case-insensitively for a converter alias and set aliases to - * a pointer to the list of aliases for the actual converter. - * The first "alias" is the canonical converter name. - * The aliases are stored consecutively, in mixed case, each NUL-terminated. - * There are as many strings in this list as the return value specifies. - * Returns the number of aliases including the canonical converter name, - * or 0 if the alias is not found. - * @param alias The canonical converter name - * @param start - * @param aliases A pointer to the list of aliases for the actual converter - * @return the number of aliases including the canonical converter name, or 0 if the alias is not found. - */ -U_CFUNC uint16_t -ucnv_io_getAliases(const char *alias, uint16_t start, const char **aliases, UErrorCode *pErrorCode); - -/** - * Search case-insensitively for a converter alias and return - * the (n)th alias. - * Returns NULL if the alias is not found. - * @param alias The converter alias - * @param n The number specifies which alias to get - * @param pErrorCode The error code - * @return the (n)th alias and return NULL if the alias is not found. - */ -U_CFUNC const char * -ucnv_io_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode); - -/** - * Return the number of all standard names. - * @param pErrorCode The error code - * @return the number of all standard names - */ -U_CFUNC uint16_t -ucnv_io_countStandards(UErrorCode *pErrorCode); +ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *pErrorCode); /** - * Return the number of all converter names. - * @param pErrorCode The error code - * @return the number of all converter names - */ -U_CFUNC uint16_t -ucnv_io_countAvailableConverters(UErrorCode *pErrorCode); - -/** - * Return the (n)th converter name in mixed case, or NULL - * if there is none (typically, if the data cannot be loaded). - * 0<=indexucnv_io_getConverterName(). - * @return the name of the default converter - */ -U_CFUNC const char * -ucnv_io_getDefaultConverterName(void); - -/** - * Set the name of the default converter. - * @param name The name set to the default converter - */ -U_CFUNC void -ucnv_io_setDefaultConverterName(const char *name); +ucnv_io_countKnownConverters(UErrorCode *pErrorCode); /** - * Swap an ICU converter alias table. See ucnv_io.c. + * Swap an ICU converter alias table. See implementation for details. * @internal */ U_CAPI int32_t U_EXPORT2