intl/icu/source/common/ucnv_io.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/common/ucnv_io.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,125 @@
     1.4 +/*
     1.5 + **********************************************************************
     1.6 + *   Copyright (C) 1999-2006, International Business Machines
     1.7 + *   Corporation and others.  All Rights Reserved.
     1.8 + **********************************************************************
     1.9 + *
    1.10 + *
    1.11 + *  ucnv_io.h:
    1.12 + *  defines  variables and functions pertaining to converter name resolution
    1.13 + *  aspect of the conversion code
    1.14 + */
    1.15 +
    1.16 +#ifndef UCNV_IO_H
    1.17 +#define UCNV_IO_H
    1.18 +
    1.19 +#include "unicode/utypes.h"
    1.20 +
    1.21 +#if !UCONFIG_NO_CONVERSION
    1.22 +
    1.23 +#include "udataswp.h"
    1.24 +
    1.25 +#define UCNV_AMBIGUOUS_ALIAS_MAP_BIT 0x8000
    1.26 +#define UCNV_CONTAINS_OPTION_BIT 0x4000
    1.27 +#define UCNV_CONVERTER_INDEX_MASK 0xFFF
    1.28 +#define UCNV_NUM_RESERVED_TAGS 2
    1.29 +#define UCNV_NUM_HIDDEN_TAGS 1
    1.30 +
    1.31 +enum {
    1.32 +    UCNV_IO_UNNORMALIZED,
    1.33 +    UCNV_IO_STD_NORMALIZED,
    1.34 +    UCNV_IO_NORM_TYPE_COUNT
    1.35 +};
    1.36 +
    1.37 +typedef struct {
    1.38 +    uint16_t stringNormalizationType;
    1.39 +    uint16_t containsCnvOptionInfo;
    1.40 +} UConverterAliasOptions;
    1.41 +
    1.42 +typedef struct UConverterAlias {
    1.43 +    const uint16_t *converterList;
    1.44 +    const uint16_t *tagList;
    1.45 +    const uint16_t *aliasList;
    1.46 +    const uint16_t *untaggedConvArray;
    1.47 +    const uint16_t *taggedAliasArray;
    1.48 +    const uint16_t *taggedAliasLists;
    1.49 +    const UConverterAliasOptions *optionTable;
    1.50 +    const uint16_t *stringTable;
    1.51 +    const uint16_t *normalizedStringTable;
    1.52 +
    1.53 +    uint32_t converterListSize;
    1.54 +    uint32_t tagListSize;
    1.55 +    uint32_t aliasListSize;
    1.56 +    uint32_t untaggedConvArraySize;
    1.57 +    uint32_t taggedAliasArraySize;
    1.58 +    uint32_t taggedAliasListsSize;
    1.59 +    uint32_t optionTableSize;
    1.60 +    uint32_t stringTableSize;
    1.61 +    uint32_t normalizedStringTableSize;
    1.62 +} UConverterAlias;
    1.63 +
    1.64 +/**
    1.65 + * \var ucnv_io_stripForCompare
    1.66 + * Remove the underscores, dashes and spaces from the name, and convert
    1.67 + * the name to lower case.
    1.68 + * @param dst The destination buffer, which is <= the buffer of name.
    1.69 + * @param dst The destination buffer, which is <= the buffer of name.
    1.70 + * @see ucnv_compareNames
    1.71 + * @return the destination buffer.
    1.72 + */
    1.73 +#if U_CHARSET_FAMILY==U_ASCII_FAMILY
    1.74 +#   define ucnv_io_stripForCompare ucnv_io_stripASCIIForCompare
    1.75 +#elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
    1.76 +#   define ucnv_io_stripForCompare ucnv_io_stripEBCDICForCompare
    1.77 +#else
    1.78 +#   error U_CHARSET_FAMILY is not valid
    1.79 +#endif
    1.80 +
    1.81 +U_CAPI char * U_EXPORT2
    1.82 +ucnv_io_stripASCIIForCompare(char *dst, const char *name);
    1.83 +
    1.84 +U_CAPI char * U_EXPORT2
    1.85 +ucnv_io_stripEBCDICForCompare(char *dst, const char *name);
    1.86 +
    1.87 +/**
    1.88 + * Map a converter alias name to a canonical converter name.
    1.89 + * The alias is searched for case-insensitively, the converter name
    1.90 + * is returned in mixed-case.
    1.91 + * Returns NULL if the alias is not found.
    1.92 + * @param alias The alias name to be searched.
    1.93 + * @param containsOption A return value stating whether the returned converter name contains an option (a comma)
    1.94 + * @param pErrorCode The error code
    1.95 + * @return the converter name in mixed-case, return NULL if the alias is not found.
    1.96 + */
    1.97 +U_CFUNC const char *
    1.98 +ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *pErrorCode);
    1.99 +
   1.100 +/**
   1.101 + * Return the number of all known converter names (no aliases).
   1.102 + * @param pErrorCode The error code
   1.103 + * @return the number of all aliases
   1.104 + */
   1.105 +U_CFUNC uint16_t
   1.106 +ucnv_io_countKnownConverters(UErrorCode *pErrorCode);
   1.107 +
   1.108 +/**
   1.109 + * Swap an ICU converter alias table. See implementation for details.
   1.110 + * @internal
   1.111 + */
   1.112 +U_CAPI int32_t U_EXPORT2
   1.113 +ucnv_swapAliases(const UDataSwapper *ds,
   1.114 +                 const void *inData, int32_t length, void *outData,
   1.115 +                 UErrorCode *pErrorCode);
   1.116 +
   1.117 +#endif
   1.118 +
   1.119 +#endif /* _UCNV_IO */
   1.120 +
   1.121 +/*
   1.122 + * Hey, Emacs, please set the following:
   1.123 + *
   1.124 + * Local Variables:
   1.125 + * indent-tabs-mode: nil
   1.126 + * End:
   1.127 + *
   1.128 + */

mercurial