2 **********************************************************************
3 * Copyright (C) 1999-2007, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
9 * Contains all internal and external data structure definitions
10 * Created & Maitained by Bertrand A. Damiba
16 * Although the data structures in this file are open and stack allocatable
17 * we reserve the right to hide them in further releases.
23 #include "unicode/utypes.h"
25 #if !UCONFIG_NO_CONVERSION
27 #include "unicode/uloc.h"
30 /* figures out if we need to go to file to read in the data tables.
31 * @param converterName The name of the converter
32 * @param err The error code
33 * @return the newly created converter
35 UConverter
*ucnv_createConverter (UConverter
*myUConverter
, const char *converterName
, UErrorCode
* err
);
38 * Open a purely algorithmic converter, specified by a type constant.
39 * @param myUConverter NULL, or pre-allocated UConverter structure to avoid
41 * @param type requested converter type
42 * @param locale locale parameter, or ""
43 * @param options converter options bit set (default 0)
44 * @param err ICU error code, not tested for U_FAILURE on input
45 * because this is an internal function
49 ucnv_createAlgorithmicConverter(UConverter
*myUConverter
,
51 const char *locale
, uint32_t options
,
54 /* Creates a converter from shared data
57 ucnv_createConverterFromSharedData(UConverter
*myUConverter
, UConverterSharedData
*mySharedConverterData
, const char *realName
, const char *locale
, uint32_t options
, UErrorCode
*err
);
59 UConverter
* ucnv_createConverterFromPackage(const char *packageName
, const char *converterName
,
63 char cnvName
[UCNV_MAX_CONVERTER_NAME_LENGTH
], locale
[ULOC_FULLNAME_CAPACITY
];
66 } UConverterLookupData
;
69 * Load a converter but do not create a UConverter object.
70 * Simply return the UConverterSharedData.
71 * Performs alias lookup etc.
74 UConverterSharedData
*
75 ucnv_loadSharedData(const char *converterName
, UConverterLookupData
*lookup
, UErrorCode
* err
);
78 * This may unload the shared data in a thread safe manner.
79 * This will only unload the data if no other converters are sharing it.
82 ucnv_unloadSharedDataIfReady(UConverterSharedData
*sharedData
);
85 * This is a thread safe way to increment the reference count.
88 ucnv_incrementRefCount(UConverterSharedData
*sharedData
);
91 * These are the default error handling callbacks for the charset conversion framework.
92 * For performance reasons, they are only called to handle an error (not normally called for a reset or close).
94 #define UCNV_TO_U_DEFAULT_CALLBACK ((UConverterToUCallback) UCNV_TO_U_CALLBACK_SUBSTITUTE)
95 #define UCNV_FROM_U_DEFAULT_CALLBACK ((UConverterFromUCallback) UCNV_FROM_U_CALLBACK_SUBSTITUTE)
99 #endif /* _UCNV_IMP */