sl@0: /* sl@0: ********************************************************************** sl@0: * Copyright (C) 1999-2005, International Business Machines sl@0: * Corporation and others. All Rights Reserved. sl@0: ********************************************************************** sl@0: * sl@0: * sl@0: * ucnv_io.h: sl@0: * defines variables and functions pertaining to file access, and name resolution sl@0: * aspect of the library sl@0: */ sl@0: sl@0: #ifndef UCNV_IO_H sl@0: #define UCNV_IO_H sl@0: sl@0: #include "unicode/utypes.h" sl@0: sl@0: #if !UCONFIG_NO_CONVERSION sl@0: sl@0: #include "udataswp.h" sl@0: sl@0: #define UCNV_AMBIGUOUS_ALIAS_MAP_BIT 0x8000 sl@0: #define UCNV_CONVERTER_INDEX_MASK 0xFFF sl@0: #define UCNV_NUM_RESERVED_TAGS 2 sl@0: #define UCNV_NUM_HIDDEN_TAGS 1 sl@0: sl@0: /** sl@0: * \var ucnv_io_stripForCompare sl@0: * Remove the underscores, dashes and spaces from the name, and convert sl@0: * the name to lower case. sl@0: * @param dst The destination buffer, which is <= the buffer of name. sl@0: * @param dst The destination buffer, which is <= the buffer of name. sl@0: * @return the destination buffer. sl@0: */ sl@0: #if U_CHARSET_FAMILY==U_ASCII_FAMILY sl@0: # define ucnv_io_stripForCompare ucnv_io_stripASCIIForCompare sl@0: #elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY sl@0: # define ucnv_io_stripForCompare ucnv_io_stripEBCDICForCompare sl@0: #else sl@0: # error U_CHARSET_FAMILY is not valid sl@0: #endif sl@0: sl@0: U_CFUNC char * U_EXPORT2 sl@0: ucnv_io_stripASCIIForCompare(char *dst, const char *name); sl@0: sl@0: U_CFUNC char * U_EXPORT2 sl@0: ucnv_io_stripEBCDICForCompare(char *dst, const char *name); sl@0: sl@0: /** sl@0: * Map a converter alias name to a canonical converter name. sl@0: * The alias is searched for case-insensitively, the converter name sl@0: * is returned in mixed-case. sl@0: * Returns NULL if the alias is not found. sl@0: * @param alias The alias name to be searched. sl@0: * @param pErrorCode The error code sl@0: * @return the converter name in mixed-case, return NULL if the alias is not found. sl@0: */ sl@0: U_CFUNC const char * sl@0: ucnv_io_getConverterName(const char *alias, UErrorCode *pErrorCode); sl@0: sl@0: /** sl@0: * The count for ucnv_io_getAliases and ucnv_io_getAlias sl@0: * @param alias The alias name to be counted sl@0: * @param pErrorCode The error code sl@0: * @return the alias count sl@0: */ sl@0: U_CFUNC uint16_t sl@0: ucnv_io_countAliases(const char *alias, UErrorCode *pErrorCode); sl@0: sl@0: /** sl@0: * Search case-insensitively for a converter alias and set aliases to sl@0: * a pointer to the list of aliases for the actual converter. sl@0: * The first "alias" is the canonical converter name. sl@0: * The aliases are stored consecutively, in mixed case, each NUL-terminated. sl@0: * There are as many strings in this list as the return value specifies. sl@0: * Returns the number of aliases including the canonical converter name, sl@0: * or 0 if the alias is not found. sl@0: * @param alias The canonical converter name sl@0: * @param start sl@0: * @param aliases A pointer to the list of aliases for the actual converter sl@0: * @return the number of aliases including the canonical converter name, or 0 if the alias is not found. sl@0: */ sl@0: U_CFUNC uint16_t sl@0: ucnv_io_getAliases(const char *alias, uint16_t start, const char **aliases, UErrorCode *pErrorCode); sl@0: sl@0: /** sl@0: * Search case-insensitively for a converter alias and return sl@0: * the (n)th alias. sl@0: * Returns NULL if the alias is not found. sl@0: * @param alias The converter alias sl@0: * @param n The number specifies which alias to get sl@0: * @param pErrorCode The error code sl@0: * @return the (n)th alias and return NULL if the alias is not found. sl@0: */ sl@0: U_CFUNC const char * sl@0: ucnv_io_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode); sl@0: sl@0: /** sl@0: * Return the number of all standard names. sl@0: * @param pErrorCode The error code sl@0: * @return the number of all standard names sl@0: */ sl@0: U_CFUNC uint16_t sl@0: ucnv_io_countStandards(UErrorCode *pErrorCode); sl@0: sl@0: /** sl@0: * Return the number of all aliases (and converter names). sl@0: * @param pErrorCode The error code sl@0: * @return the number of all aliases sl@0: */ sl@0: U_CFUNC uint16_t sl@0: ucnv_io_countTotalAliases(UErrorCode *pErrorCode); sl@0: sl@0: /** sl@0: * Swap an ICU converter alias table. See ucnv_io.c. sl@0: * @internal sl@0: */ sl@0: U_CAPI int32_t U_EXPORT2 sl@0: ucnv_swapAliases(const UDataSwapper *ds, sl@0: const void *inData, int32_t length, void *outData, sl@0: UErrorCode *pErrorCode); sl@0: sl@0: #endif sl@0: sl@0: #endif /* _UCNV_IO */ sl@0: sl@0: /* sl@0: * Hey, Emacs, please set the following: sl@0: * sl@0: * Local Variables: sl@0: * indent-tabs-mode: nil sl@0: * End: sl@0: * sl@0: */