1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/fontservices/textshaperplugin/IcuSource/common/ucnv_io.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,134 @@
1.4 +/*
1.5 + **********************************************************************
1.6 + * Copyright (C) 1999-2005, 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 file access, and name resolution
1.13 + * aspect of the library
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_CONVERTER_INDEX_MASK 0xFFF
1.27 +#define UCNV_NUM_RESERVED_TAGS 2
1.28 +#define UCNV_NUM_HIDDEN_TAGS 1
1.29 +
1.30 +/**
1.31 + * \var ucnv_io_stripForCompare
1.32 + * Remove the underscores, dashes and spaces from the name, and convert
1.33 + * the name to lower case.
1.34 + * @param dst The destination buffer, which is <= the buffer of name.
1.35 + * @param dst The destination buffer, which is <= the buffer of name.
1.36 + * @return the destination buffer.
1.37 + */
1.38 +#if U_CHARSET_FAMILY==U_ASCII_FAMILY
1.39 +# define ucnv_io_stripForCompare ucnv_io_stripASCIIForCompare
1.40 +#elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
1.41 +# define ucnv_io_stripForCompare ucnv_io_stripEBCDICForCompare
1.42 +#else
1.43 +# error U_CHARSET_FAMILY is not valid
1.44 +#endif
1.45 +
1.46 +U_CFUNC char * U_EXPORT2
1.47 +ucnv_io_stripASCIIForCompare(char *dst, const char *name);
1.48 +
1.49 +U_CFUNC char * U_EXPORT2
1.50 +ucnv_io_stripEBCDICForCompare(char *dst, const char *name);
1.51 +
1.52 +/**
1.53 + * Map a converter alias name to a canonical converter name.
1.54 + * The alias is searched for case-insensitively, the converter name
1.55 + * is returned in mixed-case.
1.56 + * Returns NULL if the alias is not found.
1.57 + * @param alias The alias name to be searched.
1.58 + * @param pErrorCode The error code
1.59 + * @return the converter name in mixed-case, return NULL if the alias is not found.
1.60 + */
1.61 +U_CFUNC const char *
1.62 +ucnv_io_getConverterName(const char *alias, UErrorCode *pErrorCode);
1.63 +
1.64 +/**
1.65 + * The count for ucnv_io_getAliases and ucnv_io_getAlias
1.66 + * @param alias The alias name to be counted
1.67 + * @param pErrorCode The error code
1.68 + * @return the alias count
1.69 + */
1.70 +U_CFUNC uint16_t
1.71 +ucnv_io_countAliases(const char *alias, UErrorCode *pErrorCode);
1.72 +
1.73 +/**
1.74 + * Search case-insensitively for a converter alias and set aliases to
1.75 + * a pointer to the list of aliases for the actual converter.
1.76 + * The first "alias" is the canonical converter name.
1.77 + * The aliases are stored consecutively, in mixed case, each NUL-terminated.
1.78 + * There are as many strings in this list as the return value specifies.
1.79 + * Returns the number of aliases including the canonical converter name,
1.80 + * or 0 if the alias is not found.
1.81 + * @param alias The canonical converter name
1.82 + * @param start
1.83 + * @param aliases A pointer to the list of aliases for the actual converter
1.84 + * @return the number of aliases including the canonical converter name, or 0 if the alias is not found.
1.85 + */
1.86 +U_CFUNC uint16_t
1.87 +ucnv_io_getAliases(const char *alias, uint16_t start, const char **aliases, UErrorCode *pErrorCode);
1.88 +
1.89 +/**
1.90 + * Search case-insensitively for a converter alias and return
1.91 + * the (n)th alias.
1.92 + * Returns NULL if the alias is not found.
1.93 + * @param alias The converter alias
1.94 + * @param n The number specifies which alias to get
1.95 + * @param pErrorCode The error code
1.96 + * @return the (n)th alias and return NULL if the alias is not found.
1.97 + */
1.98 +U_CFUNC const char *
1.99 +ucnv_io_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
1.100 +
1.101 +/**
1.102 + * Return the number of all standard names.
1.103 + * @param pErrorCode The error code
1.104 + * @return the number of all standard names
1.105 + */
1.106 +U_CFUNC uint16_t
1.107 +ucnv_io_countStandards(UErrorCode *pErrorCode);
1.108 +
1.109 +/**
1.110 + * Return the number of all aliases (and converter names).
1.111 + * @param pErrorCode The error code
1.112 + * @return the number of all aliases
1.113 + */
1.114 +U_CFUNC uint16_t
1.115 +ucnv_io_countTotalAliases(UErrorCode *pErrorCode);
1.116 +
1.117 +/**
1.118 + * Swap an ICU converter alias table. See ucnv_io.c.
1.119 + * @internal
1.120 + */
1.121 +U_CAPI int32_t U_EXPORT2
1.122 +ucnv_swapAliases(const UDataSwapper *ds,
1.123 + const void *inData, int32_t length, void *outData,
1.124 + UErrorCode *pErrorCode);
1.125 +
1.126 +#endif
1.127 +
1.128 +#endif /* _UCNV_IO */
1.129 +
1.130 +/*
1.131 + * Hey, Emacs, please set the following:
1.132 + *
1.133 + * Local Variables:
1.134 + * indent-tabs-mode: nil
1.135 + * End:
1.136 + *
1.137 + */