1999-10-18 22:48:32 +00:00
|
|
|
/*
|
1999-12-09 23:27:55 +00:00
|
|
|
**********************************************************************
|
2003-04-21 02:12:46 +00:00
|
|
|
* Copyright (C) 1999-2003, International Business Machines
|
1999-12-09 23:27:55 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
**********************************************************************
|
1999-10-18 22:48:32 +00:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* ucnv_imp.h:
|
|
|
|
* Contains all internal and external data structure definitions
|
|
|
|
* Created & Maitained by Bertrand A. Damiba
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* ATTENTION:
|
|
|
|
* ---------
|
|
|
|
* Although the data structures in this file are open and stack allocatable
|
|
|
|
* we reserve the right to hide them in further releases.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef UCNV_IMP_H
|
|
|
|
#define UCNV_IMP_H
|
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
#include "unicode/utypes.h"
|
2003-12-16 05:16:55 +00:00
|
|
|
#include "unicode/uloc.h"
|
2000-06-27 20:47:56 +00:00
|
|
|
#include "ucnv_bld.h"
|
1999-10-22 21:27:33 +00:00
|
|
|
|
1999-10-18 22:48:32 +00:00
|
|
|
/* figures out if we need to go to file to read in the data tables.
|
2002-07-03 12:05:56 +00:00
|
|
|
* @param converterName The name of the converter
|
|
|
|
* @param err The error code
|
|
|
|
* @return the newly created converter
|
1999-10-18 22:48:32 +00:00
|
|
|
*/
|
2003-04-21 02:12:46 +00:00
|
|
|
UConverter *ucnv_createConverter (UConverter *myUConverter, const char *converterName, UErrorCode * err);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Open a purely algorithmic converter, specified by a type constant.
|
|
|
|
* @param myUConverter NULL, or pre-allocated UConverter structure to avoid
|
|
|
|
* a memory allocation
|
|
|
|
* @param type requested converter type
|
|
|
|
* @param locale locale parameter, or ""
|
|
|
|
* @param options converter options bit set (default 0)
|
|
|
|
* @param err ICU error code, not tested for U_FAILURE on input
|
|
|
|
* because this is an internal function
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
U_CFUNC UConverter *
|
|
|
|
ucnv_createAlgorithmicConverter(UConverter *myUConverter,
|
|
|
|
UConverterType type,
|
|
|
|
const char *locale, uint32_t options,
|
|
|
|
UErrorCode *err);
|
1999-10-18 22:48:32 +00:00
|
|
|
|
2002-07-17 02:34:50 +00:00
|
|
|
/* Creates a converter from shared data
|
|
|
|
*/
|
|
|
|
UConverter*
|
2003-04-21 02:12:46 +00:00
|
|
|
ucnv_createConverterFromSharedData(UConverter *myUConverter, UConverterSharedData *mySharedConverterData, const char *realName, const char *locale, uint32_t options, UErrorCode *err);
|
2002-07-17 02:34:50 +00:00
|
|
|
|
|
|
|
UConverter* ucnv_createConverterFromPackage(const char *packageName, const char *converterName,
|
|
|
|
UErrorCode *err);
|
|
|
|
|
2003-12-16 05:16:55 +00:00
|
|
|
typedef struct {
|
|
|
|
char cnvName[UCNV_MAX_CONVERTER_NAME_LENGTH], locale[ULOC_FULLNAME_CAPACITY];
|
|
|
|
const char *realName;
|
|
|
|
uint32_t options;
|
|
|
|
} UConverterLookupData;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load a converter but do not create a UConverter object.
|
|
|
|
* Simply return the UConverterSharedData.
|
|
|
|
* Performs alias lookup etc.
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
UConverterSharedData *
|
|
|
|
ucnv_loadSharedData(const char *converterName, UConverterLookupData *lookup, UErrorCode * err);
|
|
|
|
|
2003-05-07 00:53:32 +00:00
|
|
|
/**
|
|
|
|
* This may unload the shared data in a thread safe manner.
|
|
|
|
* This will only unload the data if no other converters are sharing it.
|
1999-10-18 22:48:32 +00:00
|
|
|
*/
|
2003-05-07 00:53:32 +00:00
|
|
|
void
|
|
|
|
ucnv_unloadSharedDataIfReady(UConverterSharedData *sharedData);
|
1999-10-18 22:48:32 +00:00
|
|
|
|
2003-05-07 00:53:32 +00:00
|
|
|
/**
|
|
|
|
* This is a thread safe way to increment the reference count.
|
1999-10-18 22:48:32 +00:00
|
|
|
*/
|
2003-05-07 00:53:32 +00:00
|
|
|
void
|
|
|
|
ucnv_incrementRefCount(UConverterSharedData *sharedData);
|
1999-10-18 22:48:32 +00:00
|
|
|
|
2002-07-03 16:54:59 +00:00
|
|
|
/* Copy the string that is represented by the UConverterPlatform enum
|
|
|
|
* @param platformString An output buffer
|
|
|
|
* @param platform An enum representing a platform
|
|
|
|
* @return the length of the copied string.
|
|
|
|
*/
|
|
|
|
int32_t ucnv_copyPlatformString(char *platformString, UConverterPlatform platform);
|
1999-10-18 22:48:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* _UCNV_IMP */
|