os/textandloc/fontservices/textshaperplugin/IcuSource/common/ucnv_io.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2  **********************************************************************
     3  *   Copyright (C) 1999-2005, International Business Machines
     4  *   Corporation and others.  All Rights Reserved.
     5  **********************************************************************
     6  *
     7  *
     8  *  ucnv_io.h:
     9  *  defines  variables and functions pertaining to file access, and name resolution
    10  *  aspect of the library
    11  */
    12 
    13 #ifndef UCNV_IO_H
    14 #define UCNV_IO_H
    15 
    16 #include "unicode/utypes.h"
    17 
    18 #if !UCONFIG_NO_CONVERSION
    19 
    20 #include "udataswp.h"
    21 
    22 #define UCNV_AMBIGUOUS_ALIAS_MAP_BIT 0x8000
    23 #define UCNV_CONVERTER_INDEX_MASK 0xFFF
    24 #define UCNV_NUM_RESERVED_TAGS 2
    25 #define UCNV_NUM_HIDDEN_TAGS 1
    26 
    27 /**
    28  * \var ucnv_io_stripForCompare
    29  * Remove the underscores, dashes and spaces from the name, and convert
    30  * the name to lower case.
    31  * @param dst The destination buffer, which is <= the buffer of name.
    32  * @param dst The destination buffer, which is <= the buffer of name.
    33  * @return the destination buffer.
    34  */
    35 #if U_CHARSET_FAMILY==U_ASCII_FAMILY
    36 #   define ucnv_io_stripForCompare ucnv_io_stripASCIIForCompare
    37 #elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
    38 #   define ucnv_io_stripForCompare ucnv_io_stripEBCDICForCompare
    39 #else
    40 #   error U_CHARSET_FAMILY is not valid
    41 #endif
    42 
    43 U_CFUNC char * U_EXPORT2
    44 ucnv_io_stripASCIIForCompare(char *dst, const char *name);
    45 
    46 U_CFUNC char * U_EXPORT2
    47 ucnv_io_stripEBCDICForCompare(char *dst, const char *name);
    48 
    49 /**
    50  * Map a converter alias name to a canonical converter name.
    51  * The alias is searched for case-insensitively, the converter name
    52  * is returned in mixed-case.
    53  * Returns NULL if the alias is not found.
    54  * @param alias The alias name to be searched.
    55  * @param pErrorCode The error code
    56  * @return the converter name in mixed-case, return NULL if the alias is not found.
    57  */
    58 U_CFUNC const char *
    59 ucnv_io_getConverterName(const char *alias, UErrorCode *pErrorCode);
    60 
    61 /**
    62  * The count for ucnv_io_getAliases and ucnv_io_getAlias
    63  * @param alias The alias name to be counted
    64  * @param pErrorCode The error code
    65  * @return the alias count
    66  */
    67 U_CFUNC uint16_t
    68 ucnv_io_countAliases(const char *alias, UErrorCode *pErrorCode);
    69 
    70 /**
    71  * Search case-insensitively for a converter alias and set aliases to
    72  * a pointer to the list of aliases for the actual converter.
    73  * The first "alias" is the canonical converter name.
    74  * The aliases are stored consecutively, in mixed case, each NUL-terminated.
    75  * There are as many strings in this list as the return value specifies.
    76  * Returns the number of aliases including the canonical converter name,
    77  * or 0 if the alias is not found.
    78  * @param alias The canonical converter name
    79  * @param start 
    80  * @param aliases A pointer to the list of aliases for the actual converter
    81  * @return the number of aliases including the canonical converter name, or 0 if the alias is not found.
    82  */
    83 U_CFUNC uint16_t
    84 ucnv_io_getAliases(const char *alias, uint16_t start, const char **aliases, UErrorCode *pErrorCode);
    85 
    86 /**
    87  * Search case-insensitively for a converter alias and return
    88  * the (n)th alias.
    89  * Returns NULL if the alias is not found.
    90  * @param alias The converter alias
    91  * @param n The number specifies which alias to get
    92  * @param pErrorCode The error code
    93  * @return the (n)th alias and return NULL if the alias is not found.
    94  */
    95 U_CFUNC const char *
    96 ucnv_io_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
    97 
    98 /**
    99  * Return the number of all standard names.
   100  * @param pErrorCode The error code
   101  * @return the number of all standard names
   102  */
   103 U_CFUNC uint16_t
   104 ucnv_io_countStandards(UErrorCode *pErrorCode);
   105 
   106 /**
   107  * Return the number of all aliases (and converter names).
   108  * @param pErrorCode The error code
   109  * @return the number of all aliases
   110  */
   111 U_CFUNC uint16_t
   112 ucnv_io_countTotalAliases(UErrorCode *pErrorCode);
   113 
   114 /**
   115  * Swap an ICU converter alias table. See ucnv_io.c.
   116  * @internal
   117  */
   118 U_CAPI int32_t U_EXPORT2
   119 ucnv_swapAliases(const UDataSwapper *ds,
   120                  const void *inData, int32_t length, void *outData,
   121                  UErrorCode *pErrorCode);
   122 
   123 #endif
   124 
   125 #endif /* _UCNV_IO */
   126 
   127 /*
   128  * Hey, Emacs, please set the following:
   129  *
   130  * Local Variables:
   131  * indent-tabs-mode: nil
   132  * End:
   133  *
   134  */