sl@0: /* sl@0: ********************************************************************** sl@0: * Copyright (C) 1999-2005, International Business Machines sl@0: * Corporation and others. All Rights Reserved. sl@0: ********************************************************************** sl@0: * sl@0: * sl@0: * ucnv_imp.h: sl@0: * Contains all internal and external data structure definitions sl@0: * Created & Maitained by Bertrand A. Damiba sl@0: * sl@0: * sl@0: * sl@0: * ATTENTION: sl@0: * --------- sl@0: * Although the data structures in this file are open and stack allocatable sl@0: * we reserve the right to hide them in further releases. sl@0: */ sl@0: sl@0: #ifndef UCNV_IMP_H sl@0: #define UCNV_IMP_H sl@0: sl@0: #include "unicode/utypes.h" sl@0: sl@0: #if !UCONFIG_NO_CONVERSION sl@0: sl@0: #include "unicode/uloc.h" sl@0: #include "ucnv_bld.h" sl@0: sl@0: /* figures out if we need to go to file to read in the data tables. sl@0: * @param converterName The name of the converter sl@0: * @param err The error code sl@0: * @return the newly created converter sl@0: */ sl@0: UConverter *ucnv_createConverter (UConverter *myUConverter, const char *converterName, UErrorCode * err); sl@0: sl@0: /* sl@0: * Open a purely algorithmic converter, specified by a type constant. sl@0: * @param myUConverter NULL, or pre-allocated UConverter structure to avoid sl@0: * a memory allocation sl@0: * @param type requested converter type sl@0: * @param locale locale parameter, or "" sl@0: * @param options converter options bit set (default 0) sl@0: * @param err ICU error code, not tested for U_FAILURE on input sl@0: * because this is an internal function sl@0: * @internal sl@0: */ sl@0: U_CFUNC UConverter * sl@0: ucnv_createAlgorithmicConverter(UConverter *myUConverter, sl@0: UConverterType type, sl@0: const char *locale, uint32_t options, sl@0: UErrorCode *err); sl@0: sl@0: /* Creates a converter from shared data sl@0: */ sl@0: UConverter* sl@0: ucnv_createConverterFromSharedData(UConverter *myUConverter, UConverterSharedData *mySharedConverterData, const char *realName, const char *locale, uint32_t options, UErrorCode *err); sl@0: sl@0: UConverter* ucnv_createConverterFromPackage(const char *packageName, const char *converterName, sl@0: UErrorCode *err); sl@0: sl@0: typedef struct { sl@0: char cnvName[UCNV_MAX_CONVERTER_NAME_LENGTH], locale[ULOC_FULLNAME_CAPACITY]; sl@0: const char *realName; sl@0: uint32_t options; sl@0: } UConverterLookupData; sl@0: sl@0: /** sl@0: * Load a converter but do not create a UConverter object. sl@0: * Simply return the UConverterSharedData. sl@0: * Performs alias lookup etc. sl@0: * @internal sl@0: */ sl@0: UConverterSharedData * sl@0: ucnv_loadSharedData(const char *converterName, UConverterLookupData *lookup, UErrorCode * err); sl@0: sl@0: /** sl@0: * This may unload the shared data in a thread safe manner. sl@0: * This will only unload the data if no other converters are sharing it. sl@0: */ sl@0: void sl@0: ucnv_unloadSharedDataIfReady(UConverterSharedData *sharedData); sl@0: sl@0: /** sl@0: * This is a thread safe way to increment the reference count. sl@0: */ sl@0: void sl@0: ucnv_incrementRefCount(UConverterSharedData *sharedData); sl@0: sl@0: #endif sl@0: sl@0: #endif /* _UCNV_IMP */