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