1999-08-16 21:50:52 +00:00
|
|
|
/*
|
2001-03-21 20:44:20 +00:00
|
|
|
**********************************************************************
|
2006-06-11 16:57:02 +00:00
|
|
|
* Copyright (C) 1999-2006, International Business Machines
|
2001-03-21 20:44:20 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
**********************************************************************
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* ucnv_io.h:
|
2005-08-30 20:37:50 +00:00
|
|
|
* defines variables and functions pertaining to converter name resolution
|
|
|
|
* aspect of the conversion code
|
1999-08-16 21:50:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef UCNV_IO_H
|
|
|
|
#define UCNV_IO_H
|
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
#include "unicode/utypes.h"
|
2004-08-26 22:51:40 +00:00
|
|
|
|
|
|
|
#if !UCONFIG_NO_CONVERSION
|
|
|
|
|
2003-08-13 20:45:50 +00:00
|
|
|
#include "udataswp.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2002-06-28 23:13:30 +00:00
|
|
|
#define UCNV_AMBIGUOUS_ALIAS_MAP_BIT 0x8000
|
2006-06-12 10:05:08 +00:00
|
|
|
#define UCNV_CONTAINS_OPTION_BIT 0x4000
|
2002-07-12 23:55:31 +00:00
|
|
|
#define UCNV_CONVERTER_INDEX_MASK 0xFFF
|
2002-08-08 22:46:05 +00:00
|
|
|
#define UCNV_NUM_RESERVED_TAGS 2
|
2002-10-30 22:52:08 +00:00
|
|
|
#define UCNV_NUM_HIDDEN_TAGS 1
|
2002-06-28 23:13:30 +00:00
|
|
|
|
2006-06-11 16:57:02 +00:00
|
|
|
typedef enum {
|
|
|
|
UCNV_IO_UNNORMALIZED,
|
|
|
|
UCNV_IO_STD_NORMALIZED,
|
|
|
|
UCNV_IO_NORM_TYPE_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint16_t stringNormalizationType;
|
2006-06-12 10:05:08 +00:00
|
|
|
uint16_t containsCnvOptionInfo;
|
2006-06-11 16:57:02 +00:00
|
|
|
} UConverterAliasOptions;
|
|
|
|
|
2005-08-30 20:37:50 +00:00
|
|
|
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;
|
2006-06-11 16:57:02 +00:00
|
|
|
const UConverterAliasOptions *optionTable;
|
2005-08-30 20:37:50 +00:00
|
|
|
const uint16_t *stringTable;
|
2006-06-11 16:57:02 +00:00
|
|
|
const uint16_t *normalizedStringTable;
|
2005-08-30 20:37:50 +00:00
|
|
|
|
|
|
|
uint32_t converterListSize;
|
|
|
|
uint32_t tagListSize;
|
|
|
|
uint32_t aliasListSize;
|
|
|
|
uint32_t untaggedConvArraySize;
|
|
|
|
uint32_t taggedAliasArraySize;
|
|
|
|
uint32_t taggedAliasListsSize;
|
2006-06-11 16:57:02 +00:00
|
|
|
uint32_t optionTableSize;
|
|
|
|
uint32_t stringTableSize;
|
|
|
|
uint32_t normalizedStringTableSize;
|
2005-08-30 20:37:50 +00:00
|
|
|
} UConverterAlias;
|
|
|
|
|
2002-09-06 00:48:35 +00:00
|
|
|
/**
|
2003-08-08 23:39:34 +00:00
|
|
|
* \var ucnv_io_stripForCompare
|
2002-09-06 00:48:35 +00:00
|
|
|
* 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.
|
2005-08-30 20:37:50 +00:00
|
|
|
* @see ucnv_compareNames
|
2002-09-06 00:48:35 +00:00
|
|
|
* @return the destination buffer.
|
|
|
|
*/
|
2003-08-08 23:39:34 +00:00
|
|
|
#if U_CHARSET_FAMILY==U_ASCII_FAMILY
|
|
|
|
# define ucnv_io_stripForCompare ucnv_io_stripASCIIForCompare
|
|
|
|
#elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
|
|
|
|
# define ucnv_io_stripForCompare ucnv_io_stripEBCDICForCompare
|
|
|
|
#else
|
|
|
|
# error U_CHARSET_FAMILY is not valid
|
|
|
|
#endif
|
|
|
|
|
2006-06-11 16:57:02 +00:00
|
|
|
U_CAPI char * U_EXPORT2
|
2003-08-08 23:39:34 +00:00
|
|
|
ucnv_io_stripASCIIForCompare(char *dst, const char *name);
|
|
|
|
|
2006-06-11 16:57:02 +00:00
|
|
|
U_CAPI char * U_EXPORT2
|
2003-08-08 23:39:34 +00:00
|
|
|
ucnv_io_stripEBCDICForCompare(char *dst, const char *name);
|
2002-09-06 00:48:35 +00:00
|
|
|
|
1999-11-24 00:39:43 +00:00
|
|
|
/**
|
|
|
|
* Map a converter alias name to a canonical converter name.
|
|
|
|
* The alias is searched for case-insensitively, the converter name
|
|
|
|
* is returned in mixed-case.
|
|
|
|
* Returns NULL if the alias is not found.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @param alias The alias name to be searched.
|
2006-06-12 10:05:08 +00:00
|
|
|
* @param containsOption A return value stating whether the returned converter name contains an option (a comma)
|
2002-09-06 00:48:35 +00:00
|
|
|
* @param pErrorCode The error code
|
2002-07-03 12:05:56 +00:00
|
|
|
* @return the converter name in mixed-case, return NULL if the alias is not found.
|
1999-11-24 00:39:43 +00:00
|
|
|
*/
|
1999-11-23 23:02:55 +00:00
|
|
|
U_CFUNC const char *
|
2006-06-12 10:05:08 +00:00
|
|
|
ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *pErrorCode);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2002-06-28 23:13:30 +00:00
|
|
|
/**
|
2005-08-30 20:37:50 +00:00
|
|
|
* Return the number of all aliases and converter names.
|
|
|
|
* This is helpful if you need a number for creating an alias table.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @param pErrorCode The error code
|
|
|
|
* @return the number of all aliases
|
1999-11-24 00:39:43 +00:00
|
|
|
*/
|
1999-11-23 23:02:55 +00:00
|
|
|
U_CFUNC uint16_t
|
2005-05-08 07:56:44 +00:00
|
|
|
ucnv_io_countTotalAliases(UErrorCode *pErrorCode);
|
1999-12-04 00:55:54 +00:00
|
|
|
|
2003-08-12 00:26:07 +00:00
|
|
|
/**
|
2005-08-30 20:37:50 +00:00
|
|
|
* Swap an ICU converter alias table. See implementation for details.
|
2003-08-12 00:26:07 +00:00
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
|
|
|
ucnv_swapAliases(const UDataSwapper *ds,
|
|
|
|
const void *inData, int32_t length, void *outData,
|
|
|
|
UErrorCode *pErrorCode);
|
|
|
|
|
2004-08-26 22:51:40 +00:00
|
|
|
#endif
|
|
|
|
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif /* _UCNV_IO */
|
2000-08-10 01:32:29 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Hey, Emacs, please set the following:
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
*/
|