os/textandloc/fontservices/textshaperplugin/IcuSource/common/ucnv_imp.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_imp.h:
sl@0
     9
*  Contains all internal and external data structure definitions
sl@0
    10
* Created & Maitained by Bertrand A. Damiba
sl@0
    11
*
sl@0
    12
*
sl@0
    13
*
sl@0
    14
* ATTENTION:
sl@0
    15
* ---------
sl@0
    16
* Although the data structures in this file are open and stack allocatable
sl@0
    17
* we reserve the right to hide them in further releases.
sl@0
    18
*/
sl@0
    19
sl@0
    20
#ifndef UCNV_IMP_H
sl@0
    21
#define UCNV_IMP_H
sl@0
    22
sl@0
    23
#include "unicode/utypes.h"
sl@0
    24
sl@0
    25
#if !UCONFIG_NO_CONVERSION
sl@0
    26
sl@0
    27
#include "unicode/uloc.h"
sl@0
    28
#include "ucnv_bld.h"
sl@0
    29
sl@0
    30
/* figures out if we need to go to file to read in the data tables.
sl@0
    31
 * @param converterName The name of the converter
sl@0
    32
 * @param err The error code
sl@0
    33
 * @return the newly created converter
sl@0
    34
 */
sl@0
    35
UConverter *ucnv_createConverter (UConverter *myUConverter, const char *converterName, UErrorCode * err);
sl@0
    36
sl@0
    37
/*
sl@0
    38
 * Open a purely algorithmic converter, specified by a type constant.
sl@0
    39
 * @param myUConverter  NULL, or pre-allocated UConverter structure to avoid
sl@0
    40
 *                      a memory allocation
sl@0
    41
 * @param type          requested converter type
sl@0
    42
 * @param locale        locale parameter, or ""
sl@0
    43
 * @param options       converter options bit set (default 0)
sl@0
    44
 * @param err           ICU error code, not tested for U_FAILURE on input
sl@0
    45
 *                      because this is an internal function
sl@0
    46
 * @internal
sl@0
    47
 */
sl@0
    48
U_CFUNC UConverter *
sl@0
    49
ucnv_createAlgorithmicConverter(UConverter *myUConverter,
sl@0
    50
                                UConverterType type,
sl@0
    51
                                const char *locale, uint32_t options,
sl@0
    52
                                UErrorCode *err);
sl@0
    53
sl@0
    54
/* Creates a converter from shared data 
sl@0
    55
 */
sl@0
    56
UConverter*
sl@0
    57
ucnv_createConverterFromSharedData(UConverter *myUConverter, UConverterSharedData *mySharedConverterData, const char *realName, const char *locale, uint32_t options, UErrorCode *err);
sl@0
    58
sl@0
    59
UConverter* ucnv_createConverterFromPackage(const char *packageName, const char *converterName,  
sl@0
    60
                                            UErrorCode *err);
sl@0
    61
sl@0
    62
typedef struct {
sl@0
    63
    char cnvName[UCNV_MAX_CONVERTER_NAME_LENGTH], locale[ULOC_FULLNAME_CAPACITY];
sl@0
    64
    const char *realName;
sl@0
    65
    uint32_t options;
sl@0
    66
} UConverterLookupData;
sl@0
    67
sl@0
    68
/**
sl@0
    69
 * Load a converter but do not create a UConverter object.
sl@0
    70
 * Simply return the UConverterSharedData.
sl@0
    71
 * Performs alias lookup etc.
sl@0
    72
 * @internal
sl@0
    73
 */
sl@0
    74
UConverterSharedData *
sl@0
    75
ucnv_loadSharedData(const char *converterName, UConverterLookupData *lookup, UErrorCode * err);
sl@0
    76
sl@0
    77
/**
sl@0
    78
 * This may unload the shared data in a thread safe manner.
sl@0
    79
 * This will only unload the data if no other converters are sharing it.
sl@0
    80
 */
sl@0
    81
void
sl@0
    82
ucnv_unloadSharedDataIfReady(UConverterSharedData *sharedData);
sl@0
    83
sl@0
    84
/**
sl@0
    85
 * This is a thread safe way to increment the reference count.
sl@0
    86
 */
sl@0
    87
void
sl@0
    88
ucnv_incrementRefCount(UConverterSharedData *sharedData);
sl@0
    89
sl@0
    90
#endif
sl@0
    91
sl@0
    92
#endif /* _UCNV_IMP */