ICU-3963 Make sure that better symbol names are exported for urename.h
X-SVN-Rev: 16333
This commit is contained in:
parent
9213e3c9fa
commit
18ffb7c81f
@ -57,11 +57,6 @@ U_CFUNC UBool umtx_cleanup(void);
|
||||
|
||||
U_CFUNC UBool utrace_cleanup(void);
|
||||
|
||||
/* Only mutexes should be initialized in these functions. */
|
||||
|
||||
U_CFUNC void ucnv_init(UErrorCode *status);
|
||||
|
||||
U_CFUNC void ures_init(UErrorCode *status);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -2150,7 +2150,7 @@ ucnv_getType(const UConverter* converter)
|
||||
int8_t type = converter->sharedData->staticData->conversionType;
|
||||
#if !UCONFIG_NO_LEGACY_CONVERSION
|
||||
if(type == UCNV_MBCS) {
|
||||
return _MBCSGetType(converter);
|
||||
return ucnv_MBCSGetType(converter);
|
||||
}
|
||||
#endif
|
||||
return (UConverterType)type;
|
||||
|
@ -182,17 +182,11 @@ typedef struct{
|
||||
|
||||
/*Forward declaration */
|
||||
U_CFUNC void
|
||||
T_UConverter_fromUnicode_UTF8 (UConverterFromUnicodeArgs * args,
|
||||
UErrorCode * err);
|
||||
ucnv_fromUnicode_UTF8(UConverterFromUnicodeArgs * args,
|
||||
UErrorCode * err);
|
||||
U_CFUNC void
|
||||
T_UConverter_fromUnicode_UTF8_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
|
||||
UErrorCode * err);
|
||||
U_CFUNC void
|
||||
_MBCSFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode);
|
||||
U_CFUNC void
|
||||
_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode);
|
||||
ucnv_fromUnicode_UTF8_OFFSETS_LOGIC(UConverterFromUnicodeArgs * args,
|
||||
UErrorCode * err);
|
||||
|
||||
#define ESC_2022 0x1B /*ESC*/
|
||||
|
||||
@ -1776,7 +1770,7 @@ getTrailByte:
|
||||
tempBuf[0] = (char) (mySourceChar);
|
||||
tempBuf[1] = trailByte = *mySource++;
|
||||
mySourceChar = (mySourceChar << 8) | (uint8_t)(trailByte);
|
||||
targetUniChar = _MBCSSimpleGetNextUChar(myData->myConverterArray[cs], tempBuf, 2, FALSE);
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(myData->myConverterArray[cs], tempBuf, 2, FALSE);
|
||||
} else {
|
||||
args->converter->toUBytes[0] = (uint8_t)mySourceChar;
|
||||
args->converter->toULength = 1;
|
||||
@ -1844,7 +1838,7 @@ UConverter_fromUnicode_ISO_2022_KR_OFFSETS_LOGIC_IBM(UConverterFromUnicodeArgs*
|
||||
args->converter=myConverterData->currentConverter;
|
||||
|
||||
myConverterData->currentConverter->fromUChar32 = saveConv->fromUChar32;
|
||||
_MBCSFromUnicodeWithOffsets(args,err);
|
||||
ucnv_MBCSFromUnicodeWithOffsets(args,err);
|
||||
saveConv->fromUChar32 = myConverterData->currentConverter->fromUChar32;
|
||||
|
||||
if(*err == U_BUFFER_OVERFLOW_ERROR) {
|
||||
@ -1903,7 +1897,7 @@ UConverter_fromUnicode_ISO_2022_KR_OFFSETS_LOGIC(UConverterFromUnicodeArgs* args
|
||||
|
||||
if(target < (unsigned char*) args->targetLimit){
|
||||
sourceChar = *source++;
|
||||
/* length= _MBCSFromUChar32(converterData->currentConverter->sharedData,
|
||||
/* length= ucnv_MBCSFromUChar32(converterData->currentConverter->sharedData,
|
||||
sourceChar,&targetByteUnit,args->converter->useFallback);*/
|
||||
MBCS_FROM_UCHAR32_ISO2022(sharedData,sourceChar,&targetByteUnit,useFallback,&length,MBCS_OUTPUT_2);
|
||||
/* only DBCS or SBCS characters are expected*/
|
||||
@ -2115,7 +2109,7 @@ UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGIC_IBM(UConverterToUnicodeArgs *args
|
||||
* Does not handle conversion extensions because the preToU[] state etc.
|
||||
* is not copied.
|
||||
*/
|
||||
_MBCSToUnicodeWithOffsets(&subArgs, err);
|
||||
ucnv_MBCSToUnicodeWithOffsets(&subArgs, err);
|
||||
|
||||
if(args->offsets != NULL && sourceStart != args->source) {
|
||||
/* update offsets to base them on the actual start of the input */
|
||||
@ -2232,7 +2226,7 @@ getTrailByte:
|
||||
tempBuf[1] = (char)(trailByte + 0x80);
|
||||
mySourceChar = (mySourceChar << 8) | (uint8_t)(trailByte);
|
||||
if((mySourceChar & 0x8080) == 0) {
|
||||
targetUniChar = _MBCSSimpleGetNextUChar(sharedData, tempBuf, 2, useFallback);
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(sharedData, tempBuf, 2, useFallback);
|
||||
} else {
|
||||
/* illegal bytes > 0x7f */
|
||||
targetUniChar = missingCharMarker;
|
||||
@ -2244,7 +2238,7 @@ getTrailByte:
|
||||
}
|
||||
}
|
||||
else{
|
||||
targetUniChar = _MBCSSimpleGetNextUChar(sharedData, mySource - 1, 1, useFallback);
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(sharedData, mySource - 1, 1, useFallback);
|
||||
}
|
||||
if(targetUniChar < 0xfffe){
|
||||
if(args->offsets) {
|
||||
@ -2776,7 +2770,7 @@ getTrailByte:
|
||||
/* return from a single-shift state to the previous one */
|
||||
pToU2022State->g=pToU2022State->prevG;
|
||||
}
|
||||
targetUniChar = _MBCSSimpleGetNextUChar(cnv, tempBuf, tempBufLen, FALSE);
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(cnv, tempBuf, tempBufLen, FALSE);
|
||||
} else {
|
||||
args->converter->toUBytes[0] = (uint8_t)mySourceChar;
|
||||
args->converter->toULength = 1;
|
||||
@ -3048,13 +3042,13 @@ _ISO_2022_GetUnicodeSet(const UConverter *cnv,
|
||||
cnvData->version==0 && i==CNS_11643
|
||||
) {
|
||||
/* special handling for non-EXT ISO-2022-CN: add only code points for CNS planes 1 and 2 */
|
||||
_MBCSGetUnicodeSetForBytes(
|
||||
ucnv_MBCSGetUnicodeSetForBytes(
|
||||
cnvData->myConverterArray[i],
|
||||
sa, UCNV_ROUNDTRIP_SET,
|
||||
0, 0x81, 0x82,
|
||||
pErrorCode);
|
||||
} else {
|
||||
_MBCSGetUnicodeSetForUnicode(cnvData->myConverterArray[i], sa, which, pErrorCode);
|
||||
ucnv_MBCSGetUnicodeSetForUnicode(cnvData->myConverterArray[i], sa, which, pErrorCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3073,8 +3067,8 @@ static const UConverterImpl _ISO2022Impl={
|
||||
#ifdef U_ENABLE_GENERIC_ISO_2022
|
||||
T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC,
|
||||
T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC,
|
||||
T_UConverter_fromUnicode_UTF8,
|
||||
T_UConverter_fromUnicode_UTF8_OFFSETS_LOGIC,
|
||||
ucnv_fromUnicode_UTF8,
|
||||
ucnv_fromUnicode_UTF8_OFFSETS_LOGIC,
|
||||
#else
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -176,10 +176,6 @@ U_CFUNC UBool U_EXPORT2 ucnv_cleanup(void) {
|
||||
return (SHARED_DATA_HASHTABLE == NULL);
|
||||
}
|
||||
|
||||
U_CFUNC void ucnv_init(UErrorCode *status) {
|
||||
umtx_init(&cnvCacheMutex);
|
||||
}
|
||||
|
||||
static UBool U_CALLCONV
|
||||
isCnvAcceptable(void *context,
|
||||
const char *type, const char *name,
|
||||
@ -1159,7 +1155,7 @@ ucnv_swap(const UDataSwapper *ds,
|
||||
uprv_memcpy(outBytes, inBytes, size);
|
||||
}
|
||||
|
||||
/* swap the _MBCSHeader */
|
||||
/* swap the MBCSHeader */
|
||||
ds->swapArray32(ds, &inMBCSHeader->countStates, 7*4,
|
||||
&outMBCSHeader->countStates, pErrorCode);
|
||||
|
||||
|
@ -1026,7 +1026,7 @@ ucnv_extGetUnicodeSet(const UConverterSharedData *sharedData,
|
||||
|
||||
/*
|
||||
* the trie enumeration is almost the same as
|
||||
* in _MBCSGetUnicodeSet() for MBCS_OUTPUT_1
|
||||
* in MBCSGetUnicodeSet() for MBCS_OUTPUT_1
|
||||
*/
|
||||
for(st1=0; st1<stage1Length; ++st1) {
|
||||
st2=stage12[st1];
|
||||
|
@ -699,7 +699,7 @@ LMBCSConversionWorker (
|
||||
U_ASSERT(xcnv);
|
||||
U_ASSERT(group<ULMBCS_GRP_UNICODE);
|
||||
|
||||
bytesConverted = _MBCSFromUChar32(xcnv, *pUniChar, &value, FALSE);
|
||||
bytesConverted = ucnv_MBCSFromUChar32(xcnv, *pUniChar, &value, FALSE);
|
||||
|
||||
/* get the first result byte */
|
||||
if(bytesConverted > 0) {
|
||||
@ -1087,11 +1087,11 @@ _LMBCSGetNextUCharWorker(UConverterToUnicodeArgs* args,
|
||||
if (*args->source == group) {
|
||||
/* single byte */
|
||||
++args->source;
|
||||
uniChar = _MBCSSimpleGetNextUChar(cnv, args->source, 1, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source, 1, FALSE);
|
||||
++args->source;
|
||||
} else {
|
||||
/* double byte */
|
||||
uniChar = _MBCSSimpleGetNextUChar(cnv, args->source, 2, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source, 2, FALSE);
|
||||
args->source += 2;
|
||||
}
|
||||
}
|
||||
@ -1116,7 +1116,7 @@ _LMBCSGetNextUCharWorker(UConverterToUnicodeArgs* args,
|
||||
/* Lookup value must include opt group */
|
||||
bytes[0] = group;
|
||||
bytes[1] = CurByte;
|
||||
uniChar = _MBCSSimpleGetNextUChar(cnv, bytes, 2, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, bytes, 2, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1127,18 +1127,18 @@ _LMBCSGetNextUCharWorker(UConverterToUnicodeArgs* args,
|
||||
cnv = extraInfo->OptGrpConverter[group];
|
||||
if (group >= ULMBCS_DOUBLEOPTGROUP_START) /* double byte conversion */
|
||||
{
|
||||
if (!_MBCSIsLeadByte(cnv, CurByte))
|
||||
if (!ucnv_MBCSIsLeadByte(cnv, CurByte))
|
||||
{
|
||||
CHECK_SOURCE_LIMIT(0);
|
||||
|
||||
/* let the MBCS conversion consume CurByte again */
|
||||
uniChar = _MBCSSimpleGetNextUChar(cnv, args->source - 1, 1, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source - 1, 1, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
CHECK_SOURCE_LIMIT(1);
|
||||
/* let the MBCS conversion consume CurByte again */
|
||||
uniChar = _MBCSSimpleGetNextUChar(cnv, args->source - 1, 2, FALSE);
|
||||
uniChar = ucnv_MBCSSimpleGetNextUChar(cnv, args->source - 1, 2, FALSE);
|
||||
++args->source;
|
||||
}
|
||||
}
|
||||
|
@ -31,13 +31,9 @@
|
||||
|
||||
/* Keep these here to make finicky compilers happy */
|
||||
|
||||
/*U_CFUNC void T_UConverter_toUnicode_UTF8(UConverterToUnicodeArgs *args,
|
||||
UErrorCode *err);
|
||||
U_CFUNC void T_UConverter_toUnicode_UTF8_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
||||
UErrorCode *err);*/
|
||||
U_CFUNC void T_UConverter_fromUnicode_UTF8(UConverterFromUnicodeArgs *args,
|
||||
U_CFUNC void ucnv_fromUnicode_UTF8(UConverterFromUnicodeArgs *args,
|
||||
UErrorCode *err);
|
||||
U_CFUNC void T_UConverter_fromUnicode_UTF8_OFFSETS_LOGIC(UConverterFromUnicodeArgs *args,
|
||||
U_CFUNC void ucnv_fromUnicode_UTF8_OFFSETS_LOGIC(UConverterFromUnicodeArgs *args,
|
||||
UErrorCode *err);
|
||||
|
||||
|
||||
@ -88,7 +84,7 @@ static const int8_t bytesFromUTF8[256] = {
|
||||
static const uint32_t
|
||||
utf8_minChar32[7]={ 0, 0, 0x80, 0x800, 0x10000, 0xffffffff, 0xffffffff };
|
||||
|
||||
static void T_UConverter_toUnicode_UTF8 (UConverterToUnicodeArgs * args,
|
||||
static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args,
|
||||
UErrorCode * err)
|
||||
{
|
||||
const unsigned char *mySource = (unsigned char *) args->source;
|
||||
@ -215,7 +211,7 @@ donefornow:
|
||||
args->source = (const char *) mySource;
|
||||
}
|
||||
|
||||
static void T_UConverter_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args,
|
||||
static void ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeArgs * args,
|
||||
UErrorCode * err)
|
||||
{
|
||||
const unsigned char *mySource = (unsigned char *) args->source;
|
||||
@ -344,7 +340,7 @@ donefornow:
|
||||
args->offsets = myOffsets;
|
||||
}
|
||||
|
||||
U_CFUNC void T_UConverter_fromUnicode_UTF8 (UConverterFromUnicodeArgs * args,
|
||||
U_CFUNC void ucnv_fromUnicode_UTF8 (UConverterFromUnicodeArgs * args,
|
||||
UErrorCode * err)
|
||||
{
|
||||
UConverter *cnv = args->converter;
|
||||
@ -460,7 +456,7 @@ lowsurrogate:
|
||||
args->source = mySource;
|
||||
}
|
||||
|
||||
U_CFUNC void T_UConverter_fromUnicode_UTF8_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
|
||||
U_CFUNC void ucnv_fromUnicode_UTF8_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
|
||||
UErrorCode * err)
|
||||
{
|
||||
UConverter *cnv = args->converter;
|
||||
@ -591,7 +587,7 @@ lowsurrogate:
|
||||
args->offsets = myOffsets;
|
||||
}
|
||||
|
||||
static UChar32 T_UConverter_getNextUChar_UTF8(UConverterToUnicodeArgs *args,
|
||||
static UChar32 ucnv_getNextUChar_UTF8(UConverterToUnicodeArgs *args,
|
||||
UErrorCode *err) {
|
||||
UConverter *cnv;
|
||||
const uint8_t *sourceInitial;
|
||||
@ -742,11 +738,11 @@ static const UConverterImpl _UTF8Impl={
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
T_UConverter_toUnicode_UTF8,
|
||||
T_UConverter_toUnicode_UTF8_OFFSETS_LOGIC,
|
||||
T_UConverter_fromUnicode_UTF8,
|
||||
T_UConverter_fromUnicode_UTF8_OFFSETS_LOGIC,
|
||||
T_UConverter_getNextUChar_UTF8,
|
||||
ucnv_toUnicode_UTF8,
|
||||
ucnv_toUnicode_UTF8_OFFSETS_LOGIC,
|
||||
ucnv_fromUnicode_UTF8,
|
||||
ucnv_fromUnicode_UTF8_OFFSETS_LOGIC,
|
||||
ucnv_getNextUChar_UTF8,
|
||||
|
||||
NULL,
|
||||
NULL,
|
||||
@ -786,10 +782,10 @@ static const UConverterImpl _CESU8Impl={
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
T_UConverter_toUnicode_UTF8,
|
||||
T_UConverter_toUnicode_UTF8_OFFSETS_LOGIC,
|
||||
T_UConverter_fromUnicode_UTF8,
|
||||
T_UConverter_fromUnicode_UTF8_OFFSETS_LOGIC,
|
||||
ucnv_toUnicode_UTF8,
|
||||
ucnv_toUnicode_UTF8_OFFSETS_LOGIC,
|
||||
ucnv_fromUnicode_UTF8,
|
||||
ucnv_fromUnicode_UTF8_OFFSETS_LOGIC,
|
||||
NULL,
|
||||
|
||||
NULL,
|
||||
|
@ -231,13 +231,13 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
|
||||
tempBuf[1] = (char) (mySourceChar+0x80);
|
||||
mySourceChar= (UChar)(((args->converter->toUnicodeStatus+0x80) << 8) | ((mySourceChar & 0x00ff)+0x80));
|
||||
args->converter->toUnicodeStatus =0x00;
|
||||
targetUniChar = _MBCSSimpleGetNextUChar(myData->gbConverter->sharedData,
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(myData->gbConverter->sharedData,
|
||||
tempBuf, 2, args->converter->useFallback);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(args->converter->fromUnicodeStatus == 0x00){
|
||||
targetUniChar = _MBCSSimpleGetNextUChar(myData->gbConverter->sharedData,
|
||||
targetUniChar = ucnv_MBCSSimpleGetNextUChar(myData->gbConverter->sharedData,
|
||||
mySource - 1, 1, args->converter->useFallback);
|
||||
}
|
||||
else{
|
||||
@ -327,7 +327,7 @@ UConverter_fromUnicode_HZ_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
|
||||
continue;
|
||||
}
|
||||
else{
|
||||
length= _MBCSFromUChar32(myConverterData->gbConverter->sharedData,
|
||||
length= ucnv_MBCSFromUChar32(myConverterData->gbConverter->sharedData,
|
||||
mySourceChar,&targetUniChar,args->converter->useFallback);
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
/* ISO 8859-1 --------------------------------------------------------------- */
|
||||
|
||||
/* This is a table-less and callback-less version of _MBCSSingleToBMPWithOffsets(). */
|
||||
/* This is a table-less and callback-less version of ucnv_MBCSSingleToBMPWithOffsets(). */
|
||||
static void
|
||||
_Latin1ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
@ -128,7 +128,7 @@ _Latin1ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
}
|
||||
}
|
||||
|
||||
/* This is a table-less and callback-less version of _MBCSSingleGetNextUChar(). */
|
||||
/* This is a table-less and callback-less version of ucnv_MBCSSingleGetNextUChar(). */
|
||||
static UChar32
|
||||
_Latin1GetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
@ -143,7 +143,7 @@ _Latin1GetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
/* This is a table-less version of _MBCSSingleFromBMPWithOffsets(). */
|
||||
/* This is a table-less version of ucnv_MBCSSingleFromBMPWithOffsets(). */
|
||||
static void
|
||||
_Latin1FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
@ -379,7 +379,7 @@ const UConverterSharedData _Latin1Data={
|
||||
|
||||
/* US-ASCII ----------------------------------------------------------------- */
|
||||
|
||||
/* This is a table-less version of _MBCSSingleToBMPWithOffsets(). */
|
||||
/* This is a table-less version of ucnv_MBCSSingleToBMPWithOffsets(). */
|
||||
static void
|
||||
_ASCIIToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
@ -505,7 +505,7 @@ _ASCIIToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
pArgs->offsets=offsets;
|
||||
}
|
||||
|
||||
/* This is a table-less version of _MBCSSingleGetNextUChar(). */
|
||||
/* This is a table-less version of ucnv_MBCSSingleGetNextUChar(). */
|
||||
static UChar32
|
||||
_ASCIIGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
|
@ -284,7 +284,7 @@
|
||||
* Leading zero bytes are ignored, and the number of bytes is counted.
|
||||
* A zero byte mapping result is possible as a roundtrip result.
|
||||
* For some output types, the actual result is processed from this;
|
||||
* see _MBCSFromUnicodeWithOffsets().
|
||||
* see ucnv_MBCSFromUnicodeWithOffsets().
|
||||
*
|
||||
* Note that stage 1 always contains 0x440=1088 entries (0x440==0x110000>>10),
|
||||
* or (version 3 and up) for BMP-only codepages, it contains 64 entries.
|
||||
@ -341,7 +341,7 @@ gb18030Ranges[13][4]={
|
||||
/* Miscellaneous ------------------------------------------------------------ */
|
||||
|
||||
static uint32_t
|
||||
_MBCSSizeofFromUBytes(UConverterMBCSTable *mbcsTable) {
|
||||
ucnv_MBCSSizeofFromUBytes(UConverterMBCSTable *mbcsTable) {
|
||||
const uint16_t *table;
|
||||
|
||||
uint32_t st3, maxStage3;
|
||||
@ -426,7 +426,7 @@ _MBCSSizeofFromUBytes(UConverterMBCSTable *mbcsTable) {
|
||||
}
|
||||
}
|
||||
|
||||
/* similar to _MBCSGetNextUChar() but recursive */
|
||||
/* similar to ucnv_MBCSGetNextUChar() but recursive */
|
||||
static void
|
||||
_getUnicodeSetForBytes(const UConverterSharedData *sharedData,
|
||||
const int32_t (*stateTable)[256], const uint16_t *unicodeCodeUnits,
|
||||
@ -506,7 +506,7 @@ _getUnicodeSetForBytes(const UConverterSharedData *sharedData,
|
||||
* Does not empty the set first.
|
||||
*/
|
||||
U_CFUNC void
|
||||
_MBCSGetUnicodeSetForBytes(const UConverterSharedData *sharedData,
|
||||
ucnv_MBCSGetUnicodeSetForBytes(const UConverterSharedData *sharedData,
|
||||
USetAdder *sa,
|
||||
UConverterUnicodeSet which,
|
||||
uint8_t state, int32_t lowByte, int32_t highByte,
|
||||
@ -519,7 +519,7 @@ _MBCSGetUnicodeSetForBytes(const UConverterSharedData *sharedData,
|
||||
}
|
||||
|
||||
U_CFUNC void
|
||||
_MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData,
|
||||
ucnv_MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData,
|
||||
USetAdder *sa,
|
||||
UConverterUnicodeSet which,
|
||||
UErrorCode *pErrorCode) {
|
||||
@ -560,7 +560,7 @@ _MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData,
|
||||
* Add code points for which the roundtrip flag is set.
|
||||
* Once we get a set for fallback mappings, we have to use
|
||||
* a threshold variable with a value of 0x800.
|
||||
* See _MBCSSingleFromBMPWithOffsets() and
|
||||
* See ucnv_MBCSSingleFromBMPWithOffsets() and
|
||||
* MBCS_SINGLE_RESULT_FROM_U() for details.
|
||||
*/
|
||||
do {
|
||||
@ -599,7 +599,7 @@ _MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData,
|
||||
* Add code points for which the roundtrip flag is set.
|
||||
* Once we get a set for fallback mappings, we have to check
|
||||
* non-roundtrip stage 3 results for whether they are 0.
|
||||
* See _MBCSFromUnicodeWithOffsets() for details.
|
||||
* See ucnv_MBCSFromUnicodeWithOffsets() for details.
|
||||
*
|
||||
* Ignore single-byte results (<0x100).
|
||||
*/
|
||||
@ -634,7 +634,7 @@ _MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData,
|
||||
* Add code points for which the roundtrip flag is set.
|
||||
* Once we get a set for fallback mappings, we have to check
|
||||
* non-roundtrip stage 3 results for whether they are 0.
|
||||
* See _MBCSFromUnicodeWithOffsets() for details.
|
||||
* See ucnv_MBCSFromUnicodeWithOffsets() for details.
|
||||
*/
|
||||
do {
|
||||
if(st3&1) {
|
||||
@ -656,7 +656,7 @@ _MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData,
|
||||
}
|
||||
|
||||
static void
|
||||
_MBCSGetUnicodeSet(const UConverter *cnv,
|
||||
ucnv_MBCSGetUnicodeSet(const UConverter *cnv,
|
||||
USetAdder *sa,
|
||||
UConverterUnicodeSet which,
|
||||
UErrorCode *pErrorCode) {
|
||||
@ -664,7 +664,7 @@ _MBCSGetUnicodeSet(const UConverter *cnv,
|
||||
sa->addRange(sa->set, 0, 0xd7ff);
|
||||
sa->addRange(sa->set, 0xe000, 0x10ffff);
|
||||
} else {
|
||||
_MBCSGetUnicodeSetForUnicode(cnv->sharedData, sa, which, pErrorCode);
|
||||
ucnv_MBCSGetUnicodeSetForUnicode(cnv->sharedData, sa, which, pErrorCode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -905,7 +905,7 @@ _EBCDICSwapLFNL(UConverterSharedData *sharedData, UErrorCode *pErrorCode) {
|
||||
* - a modified from-Unicode output array
|
||||
* - a converter name string with the swap option appended
|
||||
*/
|
||||
sizeofFromUBytes=_MBCSSizeofFromUBytes(mbcsTable);
|
||||
sizeofFromUBytes=ucnv_MBCSSizeofFromUBytes(mbcsTable);
|
||||
size=
|
||||
mbcsTable->countStates*1024+
|
||||
sizeofFromUBytes+
|
||||
@ -965,7 +965,7 @@ _EBCDICSwapLFNL(UConverterSharedData *sharedData, UErrorCode *pErrorCode) {
|
||||
/* MBCS setup functions ----------------------------------------------------- */
|
||||
|
||||
static void
|
||||
_MBCSLoad(UConverterSharedData *sharedData,
|
||||
ucnv_MBCSLoad(UConverterSharedData *sharedData,
|
||||
UConverterLoadArgs *pArgs,
|
||||
const uint8_t *raw,
|
||||
UErrorCode *pErrorCode) {
|
||||
@ -1168,7 +1168,7 @@ _MBCSLoad(UConverterSharedData *sharedData,
|
||||
}
|
||||
|
||||
static void
|
||||
_MBCSUnload(UConverterSharedData *sharedData) {
|
||||
ucnv_MBCSUnload(UConverterSharedData *sharedData) {
|
||||
UConverterMBCSTable *mbcsTable=&sharedData->mbcs;
|
||||
|
||||
if(mbcsTable->swapLFNLStateTable!=NULL) {
|
||||
@ -1183,7 +1183,7 @@ _MBCSUnload(UConverterSharedData *sharedData) {
|
||||
}
|
||||
|
||||
static void
|
||||
_MBCSOpen(UConverter *cnv,
|
||||
ucnv_MBCSOpen(UConverter *cnv,
|
||||
const char *name,
|
||||
const char *locale,
|
||||
uint32_t options,
|
||||
@ -1259,7 +1259,7 @@ _MBCSOpen(UConverter *cnv,
|
||||
}
|
||||
|
||||
static const char *
|
||||
_MBCSGetName(const UConverter *cnv) {
|
||||
ucnv_MBCSGetName(const UConverter *cnv) {
|
||||
if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0 && cnv->sharedData->mbcs.swapLFNLName!=NULL) {
|
||||
return cnv->sharedData->mbcs.swapLFNLName;
|
||||
} else {
|
||||
@ -1270,7 +1270,7 @@ _MBCSGetName(const UConverter *cnv) {
|
||||
/* MBCS-to-Unicode conversion functions ------------------------------------- */
|
||||
|
||||
static UChar32
|
||||
_MBCSGetFallback(UConverterMBCSTable *mbcsTable, uint32_t offset) {
|
||||
ucnv_MBCSGetFallback(UConverterMBCSTable *mbcsTable, uint32_t offset) {
|
||||
const _MBCSToUFallback *toUFallbacks;
|
||||
uint32_t i, start, limit;
|
||||
|
||||
@ -1297,9 +1297,9 @@ _MBCSGetFallback(UConverterMBCSTable *mbcsTable, uint32_t offset) {
|
||||
return 0xfffe;
|
||||
}
|
||||
|
||||
/* This version of _MBCSToUnicodeWithOffsets() is optimized for single-byte, single-state codepages. */
|
||||
/* This version of ucnv_MBCSToUnicodeWithOffsets() is optimized for single-byte, single-state codepages. */
|
||||
static void
|
||||
_MBCSSingleToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
ucnv_MBCSSingleToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv;
|
||||
const uint8_t *source, *sourceLimit;
|
||||
@ -1445,13 +1445,13 @@ _MBCSSingleToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
}
|
||||
|
||||
/*
|
||||
* This version of _MBCSSingleToUnicodeWithOffsets() is optimized for single-byte, single-state codepages
|
||||
* This version of ucnv_MBCSSingleToUnicodeWithOffsets() is optimized for single-byte, single-state codepages
|
||||
* that only map to and from the BMP.
|
||||
* In addition to single-byte optimizations, the offset calculations
|
||||
* become much easier.
|
||||
*/
|
||||
static void
|
||||
_MBCSSingleToBMPWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
ucnv_MBCSSingleToBMPWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv;
|
||||
const uint8_t *source, *sourceLimit, *lastSource;
|
||||
@ -1672,7 +1672,7 @@ unrolled:
|
||||
}
|
||||
|
||||
U_CFUNC void
|
||||
_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv;
|
||||
const uint8_t *source, *sourceLimit;
|
||||
@ -1711,9 +1711,9 @@ _MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
|
||||
if(cnv->sharedData->mbcs.countStates==1) {
|
||||
if(!(cnv->sharedData->mbcs.unicodeMask&UCNV_HAS_SUPPLEMENTARY)) {
|
||||
_MBCSSingleToBMPWithOffsets(pArgs, pErrorCode);
|
||||
ucnv_MBCSSingleToBMPWithOffsets(pArgs, pErrorCode);
|
||||
} else {
|
||||
_MBCSSingleToUnicodeWithOffsets(pArgs, pErrorCode);
|
||||
ucnv_MBCSSingleToUnicodeWithOffsets(pArgs, pErrorCode);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1897,7 +1897,7 @@ _MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
}
|
||||
byteIndex=0;
|
||||
} else if(c==0xfffe) {
|
||||
if(UCNV_TO_U_USE_FALLBACK(cnv) && (entry=(int32_t)_MBCSGetFallback(&cnv->sharedData->mbcs, offset))!=0xfffe) {
|
||||
if(UCNV_TO_U_USE_FALLBACK(cnv) && (entry=(int32_t)ucnv_MBCSGetFallback(&cnv->sharedData->mbcs, offset))!=0xfffe) {
|
||||
/* output fallback BMP code point */
|
||||
*target++=(UChar)entry;
|
||||
if(offsets!=NULL) {
|
||||
@ -2057,11 +2057,11 @@ _MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
}
|
||||
|
||||
/*
|
||||
* This version of _MBCSGetNextUChar() is optimized for single-byte, single-state codepages.
|
||||
* This version of ucnv_MBCSGetNextUChar() is optimized for single-byte, single-state codepages.
|
||||
* We still need a conversion loop in case we find reserved action codes, which are to be ignored.
|
||||
*/
|
||||
static UChar32
|
||||
_MBCSSingleGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
ucnv_MBCSSingleGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv;
|
||||
const int32_t (*stateTable)[256];
|
||||
@ -2146,7 +2146,7 @@ _MBCSSingleGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
* All normal mappings and errors are handled here.
|
||||
*/
|
||||
static UChar32
|
||||
_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
ucnv_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv;
|
||||
const uint8_t *source, *sourceLimit, *lastSource;
|
||||
@ -2177,7 +2177,7 @@ _MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
*/
|
||||
return UCNV_GET_NEXT_UCHAR_USE_TO_U;
|
||||
} else if(cnv->sharedData->mbcs.countStates==1) {
|
||||
return _MBCSSingleGetNextUChar(pArgs, pErrorCode);
|
||||
return ucnv_MBCSSingleGetNextUChar(pArgs, pErrorCode);
|
||||
}
|
||||
|
||||
/* set up the local pointers */
|
||||
@ -2245,7 +2245,7 @@ _MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
/* output BMP code point */
|
||||
break;
|
||||
} else if(c==0xfffe) {
|
||||
if(UCNV_TO_U_USE_FALLBACK(cnv) && (c=_MBCSGetFallback(&cnv->sharedData->mbcs, offset))!=0xfffe) {
|
||||
if(UCNV_TO_U_USE_FALLBACK(cnv) && (c=ucnv_MBCSGetFallback(&cnv->sharedData->mbcs, offset))!=0xfffe) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -2358,12 +2358,12 @@ _MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs,
|
||||
* Removal improves code coverage.
|
||||
*/
|
||||
/**
|
||||
* This version of _MBCSSimpleGetNextUChar() is optimized for single-byte, single-state codepages.
|
||||
* This version of ucnv_MBCSSimpleGetNextUChar() is optimized for single-byte, single-state codepages.
|
||||
* It does not handle the EBCDIC swaplfnl option (set in UConverter).
|
||||
* It does not handle conversion extensions (_extToU()).
|
||||
*/
|
||||
U_CFUNC UChar32
|
||||
_MBCSSingleSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
ucnv_MBCSSingleSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
uint8_t b, UBool useFallback) {
|
||||
int32_t entry;
|
||||
uint8_t action;
|
||||
@ -2421,7 +2421,7 @@ _MBCSSingleSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
* otherwise the Unicode code point
|
||||
*/
|
||||
U_CFUNC UChar32
|
||||
_MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
ucnv_MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
const char *source, int32_t length,
|
||||
UBool useFallback) {
|
||||
const int32_t (*stateTable)[256];
|
||||
@ -2448,7 +2448,7 @@ _MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
/* use optimized function if possible */
|
||||
if(sharedData->mbcs.countStates==1) {
|
||||
if(length==1) {
|
||||
return _MBCSSingleSimpleGetNextUChar(sharedData, (uint8_t)*source, useFallback);
|
||||
return ucnv_MBCSSingleSimpleGetNextUChar(sharedData, (uint8_t)*source, useFallback);
|
||||
} else {
|
||||
return 0xffff; /* illegal: more than a single byte for an SBCS converter */
|
||||
}
|
||||
@ -2485,7 +2485,7 @@ _MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
if(c!=0xfffe) {
|
||||
/* done */
|
||||
} else if(UCNV_TO_U_USE_FALLBACK(cnv)) {
|
||||
c=_MBCSGetFallback(&sharedData->mbcs, offset);
|
||||
c=ucnv_MBCSGetFallback(&sharedData->mbcs, offset);
|
||||
/* else done with 0xfffe */
|
||||
}
|
||||
break;
|
||||
@ -2561,9 +2561,9 @@ _MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
|
||||
/* MBCS-from-Unicode conversion functions ----------------------------------- */
|
||||
|
||||
/* This version of _MBCSFromUnicodeWithOffsets() is optimized for double-byte codepages. */
|
||||
/* This version of ucnv_MBCSFromUnicodeWithOffsets() is optimized for double-byte codepages. */
|
||||
static void
|
||||
_MBCSDoubleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
ucnv_MBCSDoubleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv;
|
||||
const UChar *source, *sourceLimit;
|
||||
@ -2771,9 +2771,9 @@ unassigned:
|
||||
pArgs->offsets=offsets;
|
||||
}
|
||||
|
||||
/* This version of _MBCSFromUnicodeWithOffsets() is optimized for single-byte codepages. */
|
||||
/* This version of ucnv_MBCSFromUnicodeWithOffsets() is optimized for single-byte codepages. */
|
||||
static void
|
||||
_MBCSSingleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
ucnv_MBCSSingleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv;
|
||||
const UChar *source, *sourceLimit;
|
||||
@ -2938,13 +2938,13 @@ unassigned:
|
||||
}
|
||||
|
||||
/*
|
||||
* This version of _MBCSFromUnicode() is optimized for single-byte codepages
|
||||
* This version of ucnv_MBCSFromUnicode() is optimized for single-byte codepages
|
||||
* that map only to and from the BMP.
|
||||
* In addition to single-byte/state optimizations, the offset calculations
|
||||
* become much easier.
|
||||
*/
|
||||
static void
|
||||
_MBCSSingleFromBMPWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
ucnv_MBCSSingleFromBMPWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv;
|
||||
const UChar *source, *sourceLimit, *lastSource;
|
||||
@ -3183,7 +3183,7 @@ getTrail:
|
||||
}
|
||||
|
||||
U_CFUNC void
|
||||
_MBCSFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
ucnv_MBCSFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv;
|
||||
const UChar *source, *sourceLimit;
|
||||
@ -3223,13 +3223,13 @@ _MBCSFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
unicodeMask=cnv->sharedData->mbcs.unicodeMask;
|
||||
if(outputType==MBCS_OUTPUT_1 && !(unicodeMask&UCNV_HAS_SURROGATES)) {
|
||||
if(!(unicodeMask&UCNV_HAS_SUPPLEMENTARY)) {
|
||||
_MBCSSingleFromBMPWithOffsets(pArgs, pErrorCode);
|
||||
ucnv_MBCSSingleFromBMPWithOffsets(pArgs, pErrorCode);
|
||||
} else {
|
||||
_MBCSSingleFromUnicodeWithOffsets(pArgs, pErrorCode);
|
||||
ucnv_MBCSSingleFromUnicodeWithOffsets(pArgs, pErrorCode);
|
||||
}
|
||||
return;
|
||||
} else if(outputType==MBCS_OUTPUT_2) {
|
||||
_MBCSDoubleFromUnicodeWithOffsets(pArgs, pErrorCode);
|
||||
ucnv_MBCSDoubleFromUnicodeWithOffsets(pArgs, pErrorCode);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3714,7 +3714,7 @@ unassigned:
|
||||
* Currently, the function assumes but does not check that 0<=c<=0x10ffff.
|
||||
*/
|
||||
U_CFUNC int32_t
|
||||
_MBCSFromUChar32(UConverterSharedData *sharedData,
|
||||
ucnv_MBCSFromUChar32(UConverterSharedData *sharedData,
|
||||
UChar32 c, uint32_t *pValue,
|
||||
UBool useFallback) {
|
||||
const int32_t *cx;
|
||||
@ -3854,14 +3854,14 @@ _MBCSFromUChar32(UConverterSharedData *sharedData,
|
||||
*/
|
||||
|
||||
/**
|
||||
* This version of _MBCSFromUChar32() is optimized for single-byte codepages.
|
||||
* This version of ucnv_MBCSFromUChar32() is optimized for single-byte codepages.
|
||||
* It does not handle the EBCDIC swaplfnl option (set in UConverter).
|
||||
* It does not handle conversion extensions (_extFromU()).
|
||||
*
|
||||
* It returns the codepage byte for the code point, or -1 if it is unassigned.
|
||||
*/
|
||||
U_CFUNC int32_t
|
||||
_MBCSSingleFromUChar32(UConverterSharedData *sharedData,
|
||||
ucnv_MBCSSingleFromUChar32(UConverterSharedData *sharedData,
|
||||
UChar32 c,
|
||||
UBool useFallback) {
|
||||
const uint16_t *table;
|
||||
@ -3889,7 +3889,7 @@ _MBCSSingleFromUChar32(UConverterSharedData *sharedData,
|
||||
/* miscellaneous ------------------------------------------------------------ */
|
||||
|
||||
static void
|
||||
_MBCSGetStarters(const UConverter* cnv,
|
||||
ucnv_MBCSGetStarters(const UConverter* cnv,
|
||||
UBool starters[256],
|
||||
UErrorCode *pErrorCode) {
|
||||
const int32_t *state0;
|
||||
@ -3907,12 +3907,12 @@ _MBCSGetStarters(const UConverter* cnv,
|
||||
* to check whether a byte is a lead byte.
|
||||
*/
|
||||
U_CFUNC UBool
|
||||
_MBCSIsLeadByte(UConverterSharedData *sharedData, char byte) {
|
||||
ucnv_MBCSIsLeadByte(UConverterSharedData *sharedData, char byte) {
|
||||
return (UBool)MBCS_ENTRY_IS_TRANSITION(sharedData->mbcs.stateTable[0][(uint8_t)byte]);
|
||||
}
|
||||
|
||||
static void
|
||||
_MBCSWriteSub(UConverterFromUnicodeArgs *pArgs,
|
||||
ucnv_MBCSWriteSub(UConverterFromUnicodeArgs *pArgs,
|
||||
int32_t offsetIndex,
|
||||
UErrorCode *pErrorCode) {
|
||||
UConverter *cnv=pArgs->converter;
|
||||
@ -3978,7 +3978,7 @@ _MBCSWriteSub(UConverterFromUnicodeArgs *pArgs,
|
||||
}
|
||||
|
||||
U_CFUNC UConverterType
|
||||
_MBCSGetType(const UConverter* converter) {
|
||||
ucnv_MBCSGetType(const UConverter* converter) {
|
||||
/* SBCS, DBCS, and EBCDIC_STATEFUL are replaced by MBCS, but here we cheat a little */
|
||||
if(converter->sharedData->mbcs.countStates==1) {
|
||||
return (UConverterType)UCNV_SBCS;
|
||||
@ -3993,24 +3993,24 @@ _MBCSGetType(const UConverter* converter) {
|
||||
static const UConverterImpl _MBCSImpl={
|
||||
UCNV_MBCS,
|
||||
|
||||
_MBCSLoad,
|
||||
_MBCSUnload,
|
||||
ucnv_MBCSLoad,
|
||||
ucnv_MBCSUnload,
|
||||
|
||||
_MBCSOpen,
|
||||
ucnv_MBCSOpen,
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
_MBCSToUnicodeWithOffsets,
|
||||
_MBCSToUnicodeWithOffsets,
|
||||
_MBCSFromUnicodeWithOffsets,
|
||||
_MBCSFromUnicodeWithOffsets,
|
||||
_MBCSGetNextUChar,
|
||||
ucnv_MBCSToUnicodeWithOffsets,
|
||||
ucnv_MBCSToUnicodeWithOffsets,
|
||||
ucnv_MBCSFromUnicodeWithOffsets,
|
||||
ucnv_MBCSFromUnicodeWithOffsets,
|
||||
ucnv_MBCSGetNextUChar,
|
||||
|
||||
_MBCSGetStarters,
|
||||
_MBCSGetName,
|
||||
_MBCSWriteSub,
|
||||
ucnv_MBCSGetStarters,
|
||||
ucnv_MBCSGetName,
|
||||
ucnv_MBCSWriteSub,
|
||||
NULL,
|
||||
_MBCSGetUnicodeSet
|
||||
ucnv_MBCSGetUnicodeSet
|
||||
};
|
||||
|
||||
|
||||
|
@ -283,7 +283,7 @@ typedef struct {
|
||||
* otherwise the Unicode code point
|
||||
*/
|
||||
U_CFUNC UChar32
|
||||
_MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
ucnv_MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
const char *source, int32_t length,
|
||||
UBool useFallback);
|
||||
|
||||
@ -293,7 +293,7 @@ _MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
* It does not handle conversion extensions (_extToU()).
|
||||
*/
|
||||
U_CFUNC UChar32
|
||||
_MBCSSingleSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
ucnv_MBCSSingleSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
uint8_t b, UBool useFallback);
|
||||
|
||||
/**
|
||||
@ -310,7 +310,7 @@ _MBCSSingleSimpleGetNextUChar(UConverterSharedData *sharedData,
|
||||
* to check whether a byte is a lead byte.
|
||||
*/
|
||||
U_CFUNC UBool
|
||||
_MBCSIsLeadByte(UConverterSharedData *sharedData, char byte);
|
||||
ucnv_MBCSIsLeadByte(UConverterSharedData *sharedData, char byte);
|
||||
|
||||
/** This is a macro version of _MBCSIsLeadByte(). */
|
||||
#define _MBCS_IS_LEAD_BYTE(sharedData, byte) \
|
||||
@ -334,7 +334,7 @@ _MBCSIsLeadByte(UConverterSharedData *sharedData, char byte);
|
||||
* Currently, the function assumes but does not check that 0<=c<=0x10ffff.
|
||||
*/
|
||||
U_CFUNC int32_t
|
||||
_MBCSFromUChar32(UConverterSharedData *sharedData,
|
||||
ucnv_MBCSFromUChar32(UConverterSharedData *sharedData,
|
||||
UChar32 c, uint32_t *pValue,
|
||||
UBool useFallback);
|
||||
|
||||
@ -345,7 +345,7 @@ _MBCSFromUChar32(UConverterSharedData *sharedData,
|
||||
* It returns the codepage byte for the code point, or -1 if it is unassigned.
|
||||
*/
|
||||
U_CFUNC int32_t
|
||||
_MBCSSingleFromUChar32(UConverterSharedData *sharedData,
|
||||
ucnv_MBCSSingleFromUChar32(UConverterSharedData *sharedData,
|
||||
UChar32 c,
|
||||
UBool useFallback);
|
||||
|
||||
@ -354,13 +354,13 @@ _MBCSSingleFromUChar32(UConverterSharedData *sharedData,
|
||||
* we cheat a little about the type, returning the old types if appropriate.
|
||||
*/
|
||||
U_CFUNC UConverterType
|
||||
_MBCSGetType(const UConverter* converter);
|
||||
ucnv_MBCSGetType(const UConverter* converter);
|
||||
|
||||
U_CFUNC void
|
||||
_MBCSFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
ucnv_MBCSFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode);
|
||||
U_CFUNC void
|
||||
_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
UErrorCode *pErrorCode);
|
||||
|
||||
/*
|
||||
@ -372,7 +372,7 @@ _MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
|
||||
* Does not empty the set first.
|
||||
*/
|
||||
U_CFUNC void
|
||||
_MBCSGetUnicodeSetForBytes(const UConverterSharedData *sharedData,
|
||||
ucnv_MBCSGetUnicodeSetForBytes(const UConverterSharedData *sharedData,
|
||||
USetAdder *sa,
|
||||
UConverterUnicodeSet which,
|
||||
uint8_t state, int32_t lowByte, int32_t highByte,
|
||||
@ -387,7 +387,7 @@ _MBCSGetUnicodeSetForBytes(const UConverterSharedData *sharedData,
|
||||
* Does not empty the set first.
|
||||
*/
|
||||
U_CFUNC void
|
||||
_MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData,
|
||||
ucnv_MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData,
|
||||
USetAdder *sa,
|
||||
UConverterUnicodeSet which,
|
||||
UErrorCode *pErrorCode);
|
||||
|
@ -229,10 +229,6 @@ UBool ures_cleanup(void)
|
||||
return (cache == NULL);
|
||||
}
|
||||
|
||||
U_CFUNC void ures_init(UErrorCode *status) {
|
||||
umtx_init(&resbMutex);
|
||||
}
|
||||
|
||||
|
||||
/** INTERNAL: sets the name (locale) of the resource bundle to given name */
|
||||
|
||||
@ -414,6 +410,26 @@ static UResourceDataEntry *findFirstExisting(const char* path, char* name, UBool
|
||||
return r;
|
||||
}
|
||||
|
||||
static void ures_setIsStackObject( UResourceBundle* resB, UBool state) {
|
||||
if(state) {
|
||||
resB->fMagic1 = 0;
|
||||
resB->fMagic2 = 0;
|
||||
} else {
|
||||
resB->fMagic1 = MAGIC1;
|
||||
resB->fMagic2 = MAGIC2;
|
||||
}
|
||||
}
|
||||
|
||||
static UBool ures_isStackObject(const UResourceBundle* resB) {
|
||||
return((resB->fMagic1 == MAGIC1 && resB->fMagic2 == MAGIC2)?FALSE:TRUE);
|
||||
}
|
||||
|
||||
|
||||
U_CFUNC void ures_initStackObject(UResourceBundle* resB) {
|
||||
uprv_memset(resB, 0, sizeof(UResourceBundle));
|
||||
ures_setIsStackObject(resB, TRUE);
|
||||
}
|
||||
|
||||
static UResourceDataEntry *entryOpen(const char* path, const char* localeID, UErrorCode* status) {
|
||||
UErrorCode intStatus = U_ZERO_ERROR;
|
||||
UErrorCode parentStatus = U_ZERO_ERROR;
|
||||
@ -1750,26 +1766,6 @@ ures_openDirect(const char* path, const char* localeID, UErrorCode* status) {
|
||||
return r;
|
||||
}
|
||||
|
||||
U_CFUNC void ures_setIsStackObject( UResourceBundle* resB, UBool state) {
|
||||
if(state) {
|
||||
resB->fMagic1 = 0;
|
||||
resB->fMagic2 = 0;
|
||||
} else {
|
||||
resB->fMagic1 = MAGIC1;
|
||||
resB->fMagic2 = MAGIC2;
|
||||
}
|
||||
}
|
||||
|
||||
U_CFUNC UBool ures_isStackObject(const UResourceBundle* resB) {
|
||||
return((resB->fMagic1 == MAGIC1 && resB->fMagic2 == MAGIC2)?FALSE:TRUE);
|
||||
}
|
||||
|
||||
|
||||
U_CFUNC void ures_initStackObject(UResourceBundle* resB) {
|
||||
uprv_memset(resB, 0, sizeof(UResourceBundle));
|
||||
ures_setIsStackObject(resB, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* API: Counts members. For arrays and tables, returns number of resources.
|
||||
* For strings, returns 1.
|
||||
|
@ -79,8 +79,6 @@ struct UResourceBundle {
|
||||
};
|
||||
|
||||
U_CAPI void U_EXPORT2 ures_initStackObject(UResourceBundle* resB);
|
||||
U_CFUNC void ures_setIsStackObject( UResourceBundle* resB, UBool state);
|
||||
U_CFUNC UBool ures_isStackObject(const UResourceBundle* resB);
|
||||
|
||||
/* Some getters used by the copy constructor */
|
||||
U_CFUNC const char* ures_getName(const UResourceBundle* resB);
|
||||
|
Loading…
Reference in New Issue
Block a user