[ICU-6] more renaming of constant names

FAILURE -> U_FAILURE etc.
X-Commit-URL: https://ssl.icu-project.org/trac/changeset/80
This commit is contained in:
Markus Scherer 1999-10-18 23:44:20 +00:00
parent c77e433b87
commit ff3f26ab9b
24 changed files with 237 additions and 331 deletions

View file

@ -37,69 +37,69 @@
typedef struct _FileStream FileStream;
CAPI FileStream* U_EXPORT2
U_CAPI FileStream* U_EXPORT2
T_FileStream_open(const char* filename, const char* mode);
CAPI FileStream* U_EXPORT2
U_CAPI FileStream* U_EXPORT2
T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode);
CAPI void U_EXPORT2
U_CAPI void U_EXPORT2
T_FileStream_close(FileStream* fileStream);
CAPI bool_t U_EXPORT2
U_CAPI bool_t U_EXPORT2
T_FileStream_file_exists(const char* filename);
CAPI FileStream* U_EXPORT2
U_CAPI FileStream* U_EXPORT2
T_FileStream_tmpfile(void);
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
T_FileStream_read(FileStream* fileStream, void* addr, int32_t len);
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
T_FileStream_write(FileStream* fileStream, const void* addr, int32_t len);
CAPI void U_EXPORT2
U_CAPI void U_EXPORT2
T_FileStream_rewind(FileStream* fileStream);
/*Added by Bertrand A. D. */
CAPI char * U_EXPORT2
U_CAPI char * U_EXPORT2
T_FileStream_readLine(FileStream* fileStream, char* buffer, int32_t length);
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
T_FileStream_writeLine(FileStream* fileStream, const char* buffer);
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
T_FileStream_putc(FileStream* fileStream, int32_t ch);
CAPI int U_EXPORT2
U_CAPI int U_EXPORT2
T_FileStream_getc(FileStream* fileStream);
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
T_FileStream_ungetc(int32_t ch, FileStream *fileStream);
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
T_FileStream_peek(FileStream* fileStream);
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
T_FileStream_size(FileStream* fileStream);
CAPI int U_EXPORT2
U_CAPI int U_EXPORT2
T_FileStream_eof(FileStream* fileStream);
CAPI int U_EXPORT2
U_CAPI int U_EXPORT2
T_FileStream_error(FileStream* fileStream);
CAPI void U_EXPORT2
U_CAPI void U_EXPORT2
T_FileStream_setError(FileStream* fileStream);
CAPI FileStream* U_EXPORT2
U_CAPI FileStream* U_EXPORT2
T_FileStream_stdin(void);
CAPI FileStream* U_EXPORT2
U_CAPI FileStream* U_EXPORT2
T_FileStream_stdout(void);
CAPI FileStream* U_EXPORT2
U_CAPI FileStream* U_EXPORT2
T_FileStream_stderr(void);
#endif /* _FILESTRM*/

View file

@ -41,26 +41,26 @@
* functions may have to be re-implemented. */
/* Floating point utilities */
CAPI bool_t U_EXPORT2 icu_isNaN(double);
CAPI bool_t U_EXPORT2 icu_isInfinite(double);
CAPI bool_t U_EXPORT2 icu_isPositiveInfinity(double);
CAPI bool_t U_EXPORT2 icu_isNegativeInfinity(double);
CAPI double U_EXPORT2 icu_getNaN(void);
CAPI double U_EXPORT2 icu_getInfinity(void);
U_CAPI bool_t U_EXPORT2 icu_isNaN(double);
U_CAPI bool_t U_EXPORT2 icu_isInfinite(double);
U_CAPI bool_t U_EXPORT2 icu_isPositiveInfinity(double);
U_CAPI bool_t U_EXPORT2 icu_isNegativeInfinity(double);
U_CAPI double U_EXPORT2 icu_getNaN(void);
U_CAPI double U_EXPORT2 icu_getInfinity(void);
CAPI double U_EXPORT2 icu_floor(double x);
CAPI double U_EXPORT2 icu_ceil(double x);
CAPI double U_EXPORT2 icu_fabs(double x);
CAPI double U_EXPORT2 icu_modf(double x, double* y);
CAPI double U_EXPORT2 icu_fmod(double x, double y);
CAPI double U_EXPORT2 icu_pow10(int32_t x);
CAPI double U_EXPORT2 icu_IEEEremainder(double x, double y);
CAPI double U_EXPORT2 icu_fmax(double x, double y);
CAPI double U_EXPORT2 icu_fmin(double x, double y);
CAPI int32_t U_EXPORT2 icu_max(int32_t x, int32_t y);
CAPI int32_t U_EXPORT2 icu_min(int32_t x, int32_t y);
CAPI double U_EXPORT2 icu_trunc(double d);
CAPI void U_EXPORT2 icu_longBitsFromDouble(double d, int32_t *hi, uint32_t *lo);
U_CAPI double U_EXPORT2 icu_floor(double x);
U_CAPI double U_EXPORT2 icu_ceil(double x);
U_CAPI double U_EXPORT2 icu_fabs(double x);
U_CAPI double U_EXPORT2 icu_modf(double x, double* y);
U_CAPI double U_EXPORT2 icu_fmod(double x, double y);
U_CAPI double U_EXPORT2 icu_pow10(int32_t x);
U_CAPI double U_EXPORT2 icu_IEEEremainder(double x, double y);
U_CAPI double U_EXPORT2 icu_fmax(double x, double y);
U_CAPI double U_EXPORT2 icu_fmin(double x, double y);
U_CAPI int32_t U_EXPORT2 icu_max(int32_t x, int32_t y);
U_CAPI int32_t U_EXPORT2 icu_min(int32_t x, int32_t y);
U_CAPI double U_EXPORT2 icu_trunc(double d);
U_CAPI void U_EXPORT2 icu_longBitsFromDouble(double d, int32_t *hi, uint32_t *lo);
/*
* Return the floor of the log base 10 of a given double.
@ -74,13 +74,13 @@ CAPI void U_EXPORT2 icu_longBitsFromDouble(double d, int32_t *hi, uint32_t *
* @param d the double value to apply the common log function for.
* @return the log of value d.
*/
CAPI int16_t U_EXPORT2 icu_log10(double d);
U_CAPI int16_t U_EXPORT2 icu_log10(double d);
/**
* Returns the number of digits after the decimal point in a double number x.
* @param x the double number
*/
CAPI int32_t U_EXPORT2 icu_digitsAfterDecimal(double x);
U_CAPI int32_t U_EXPORT2 icu_digitsAfterDecimal(double x);
/**
* Time zone utilities
@ -113,29 +113,22 @@ CAPI int32_t U_EXPORT2 icu_digitsAfterDecimal(double x);
* and Windows 95, this information is specified in the Control Panels
* Date/Time application.
*/
CAPI void U_EXPORT2 icu_tzset(void);
CAPI int32_t U_EXPORT2 icu_timezone(void);
CAPI char* U_EXPORT2 icu_tzname(int index);
U_CAPI void U_EXPORT2 icu_tzset(void);
U_CAPI int32_t U_EXPORT2 icu_timezone(void);
U_CAPI char* U_EXPORT2 icu_tzname(int index);
/* Get UTC (GMT) time measured in seconds since 0:00 on 1/1/70. */
CAPI int32_t U_EXPORT2 icu_getUTCtime(void);
U_CAPI int32_t U_EXPORT2 icu_getUTCtime(void);
/* Return the default data directory for this platform. See Locale. */
CAPI const char* U_EXPORT2 icu_getDefaultDataDirectory(void);
U_CAPI const char* U_EXPORT2 icu_getDefaultDataDirectory(void);
/* Return the default codepage for this platform and locale */
CAPI const char* U_EXPORT2 icu_getDefaultCodepage(void);
U_CAPI const char* U_EXPORT2 icu_getDefaultCodepage(void);
/* Return the default locale ID string by querying ths system, or
zero if one cannot be found. */
CAPI const char* U_EXPORT2 icu_getDefaultLocaleID(void);
/**
* Retrun true if this platform is big-endian, that is, if the number
* 0x1234 is stored 0x12, 0x34 in memory. Return false if this platform
* is little-endian, and is, if 0x1234 is stored 0x34, 0x12 in memory.
*/
CAPI bool_t U_EXPORT2 icu_isBigEndian(void);
U_CAPI const char* U_EXPORT2 icu_getDefaultLocaleID(void);
/*
* Finds the least double greater than d (if positive == true),
@ -145,7 +138,7 @@ CAPI bool_t U_EXPORT2 icu_isBigEndian(void);
* documentation.
* It is not a general purpose function and not defined for NaN or Infinity
*/
CAPI double U_EXPORT2 icu_nextDouble(double d, bool_t positive);
U_CAPI double U_EXPORT2 icu_nextDouble(double d, bool_t positive);
#endif

View file

@ -35,7 +35,7 @@ class ResourceBundleData
{
public:
virtual ~ResourceBundleData() {}
virtual ClassID getDynamicClassID(void) const = 0;
virtual UClassID getDynamicClassID(void) const = 0;
};
/** Concrete data class representing a list of strings. */
@ -46,10 +46,10 @@ public:
StringList(UnicodeString* adopted, int32_t count);
virtual ~StringList();
const UnicodeString& operator[](int32_t i) const;
virtual ClassID getDynamicClassID(void) const;
static ClassID getStaticClassID(void);
virtual UClassID getDynamicClassID(void) const;
static UClassID getStaticClassID(void);
static ClassID fgClassID;
static UClassID fgClassID;
int32_t fCount;
UnicodeString *fStrings;
};
@ -62,10 +62,10 @@ public:
String2dList(UnicodeString** adopted, int32_t rowCount, int32_t colCount);
virtual ~String2dList();
const UnicodeString& getString(int32_t rowIndex, int32_t colIndex);
virtual ClassID getDynamicClassID(void) const;
static ClassID getStaticClassID(void);
virtual UClassID getDynamicClassID(void) const;
static UClassID getStaticClassID(void);
static ClassID fgClassID;
static UClassID fgClassID;
int32_t fRowCount;
int32_t fColCount;
UnicodeString **fStrings;
@ -82,12 +82,12 @@ public:
virtual ~TaggedList();
void put(const UnicodeString& tag, const UnicodeString& data);
const UnicodeString* get(const UnicodeString& tag) const;
virtual ClassID getDynamicClassID(void) const;
static ClassID getStaticClassID(void);
virtual UClassID getDynamicClassID(void) const;
static UClassID getStaticClassID(void);
static void deleteValue(void* value);
static ClassID fgClassID;
static UClassID fgClassID;
UHashtable *fHashtableValues;
UHashtable *fHashtableKeys;
};

View file

@ -22,7 +22,7 @@
#include "schriter.h"
ClassID StringCharacterIterator::fgClassID = 0;
UClassID StringCharacterIterator::fgClassID = 0;
StringCharacterIterator::StringCharacterIterator()
: CharacterIterator(),

View file

@ -151,13 +151,13 @@ public:
/**
* Return a class ID for this object (not really public) */
virtual ClassID getDynamicClassID(void) const
virtual UClassID getDynamicClassID(void) const
{ return getStaticClassID(); }
/**
* Return a class ID for this class (not really public) */
static ClassID getStaticClassID(void)
{ return (ClassID)(&fgClassID); }
static UClassID getStaticClassID(void)
{ return (UClassID)(&fgClassID); }
private:
StringCharacterIterator();
@ -167,7 +167,7 @@ private:
UTextOffset begin;
UTextOffset end;
static ClassID fgClassID;
static UClassID fgClassID;
};
#endif

View file

@ -122,13 +122,13 @@ public:
/**
* Return a class ID for this object (not really public) */
virtual ClassID getDynamicClassID(void) const
virtual UClassID getDynamicClassID(void) const
{ return getStaticClassID(); }
/**
* Return a class ID for this class (not really public) */
static ClassID getStaticClassID(void)
{ return (ClassID)(&fgClassID); }
static UClassID getStaticClassID(void)
{ return (UClassID)(&fgClassID); }
private:
UCharCharacterIterator();

View file

@ -63,17 +63,17 @@ static uint32_t debugSmallLimit = 30000;
int32_t ucmp32_getkUnicodeCount() { return UCMP32_kUnicodeCount;}
int32_t ucmp32_getkBlockCount() { return UCMP32_kBlockCount;}
CAPI int32_t ucmp32_get(CompactIntArray* array, uint16_t index)
U_CAPI int32_t ucmp32_get(CompactIntArray* array, uint16_t index)
{
return (array->fArray[(array->fIndex[index >> UCMP32_kBlockShift]) +
(index & UCMP32_kBlockMask)]);
}
CAPI uint32_t ucmp32_getu(CompactIntArray* array, uint16_t index)
U_CAPI uint32_t ucmp32_getu(CompactIntArray* array, uint16_t index)
{
return (uint32_t)ucmp32_get(array, index);
}
CAPI void ucmp32_streamIn(CompactIntArray* this_obj, FileStream* is)
U_CAPI void ucmp32_streamIn(CompactIntArray* this_obj, FileStream* is)
{
int32_t newCount, len;
char c;
@ -122,7 +122,7 @@ char c;
}
}
CAPI void ucmp32_streamOut(CompactIntArray* this_obj, FileStream* os)
U_CAPI void ucmp32_streamOut(CompactIntArray* this_obj, FileStream* os)
{
char c;
if (!T_FileStream_error(os))

View file

@ -50,11 +50,11 @@ int32_t ucmp8_getkUnicodeCount() { return UCMP8_kUnicodeCount;}
int32_t ucmp8_getkBlockCount() { return UCMP8_kBlockCount;}
/* debug flags*/
/*=======================================================*/
CAPI int8_t ucmp8_get(CompactByteArray* array, uint16_t index)
U_CAPI int8_t ucmp8_get(CompactByteArray* array, uint16_t index)
{
return (array->fArray[(array->fIndex[index >> UCMP8_kBlockShift] & 0xFFFF) + (index & UCMP8_kBlockMask)]);
}
CAPI uint8_t ucmp8_getu(CompactByteArray* array, uint16_t index)
U_CAPI uint8_t ucmp8_getu(CompactByteArray* array, uint16_t index)
{
return (uint8_t)ucmp8_get(array,index);
}

View file

@ -27,10 +27,10 @@
*====================================
*/
CAPI int32_t U_EXPORT2 ucmp8_getkUnicodeCount(void);
CAPI int32_t U_EXPORT2 ucmp8_getkBlockCount(void);
U_CAPI int32_t U_EXPORT2 ucmp8_getkUnicodeCount(void);
U_CAPI int32_t U_EXPORT2 ucmp8_getkBlockCount(void);
typedef struct{
typedef struct CompactByteArray {
int8_t* fArray;
uint16_t* fIndex;
int32_t fCount;
@ -38,29 +38,29 @@ typedef struct{
bool_t fBogus;
} CompactByteArray;
CAPI CompactByteArray* U_EXPORT2 ucmp8_open(int8_t defaultValue);
CAPI CompactByteArray* U_EXPORT2 ucmp8_openAdopt(uint16_t* indexArray,
U_CAPI CompactByteArray* U_EXPORT2 ucmp8_open(int8_t defaultValue);
U_CAPI CompactByteArray* U_EXPORT2 ucmp8_openAdopt(uint16_t* indexArray,
int8_t* newValues,
int32_t count);
CAPI void U_EXPORT2 ucmp8_close(CompactByteArray* array);
CAPI bool_t U_EXPORT2 isBogus(const CompactByteArray* array);
U_CAPI void U_EXPORT2 ucmp8_close(CompactByteArray* array);
U_CAPI bool_t U_EXPORT2 isBogus(const CompactByteArray* array);
CAPI int8_t U_EXPORT2 ucmp8_get(CompactByteArray* array, uint16_t index);
CAPI uint8_t U_EXPORT2 ucmp8_getu(CompactByteArray* array, uint16_t index);
U_CAPI int8_t U_EXPORT2 ucmp8_get(CompactByteArray* array, uint16_t index);
U_CAPI uint8_t U_EXPORT2 ucmp8_getu(CompactByteArray* array, uint16_t index);
CAPI void U_EXPORT2 ucmp8_set(CompactByteArray* array,
U_CAPI void U_EXPORT2 ucmp8_set(CompactByteArray* array,
UChar index,
int8_t value);
CAPI void U_EXPORT2 ucmp8_setRange(CompactByteArray* array,
U_CAPI void U_EXPORT2 ucmp8_setRange(CompactByteArray* array,
UChar start,
UChar end,
int8_t value);
CAPI int32_t U_EXPORT2 ucmp8_getCount(const CompactByteArray* array);
CAPI const int8_t* U_EXPORT2 ucmp8_getArray(const CompactByteArray* array);
CAPI const uint16_t* U_EXPORT2 ucmp8_getIndex(const CompactByteArray* array);
U_CAPI int32_t U_EXPORT2 ucmp8_getCount(const CompactByteArray* array);
U_CAPI const int8_t* U_EXPORT2 ucmp8_getArray(const CompactByteArray* array);
U_CAPI const uint16_t* U_EXPORT2 ucmp8_getIndex(const CompactByteArray* array);
/* Compact the array.
The value of cycle determines how large the overlap can be.
@ -69,11 +69,11 @@ CAPI const uint16_t* U_EXPORT2 ucmp8_getIndex(const CompactByteArray* array);
then using that will be faster than cycle = 1, and get almost the
same compression.
*/
CAPI void U_EXPORT2 ucmp8_compact(CompactByteArray* array,
U_CAPI void U_EXPORT2 ucmp8_compact(CompactByteArray* array,
uint32_t cycle);
/* Expanded takes the array back to a 65536 element array*/
CAPI void U_EXPORT2 ucmp8_expand(CompactByteArray* array);
U_CAPI void U_EXPORT2 ucmp8_expand(CompactByteArray* array);

View file

@ -28,69 +28,54 @@
#include "utypes.h"
#ifndef UHASH_H
typedef struct _UHashtable UHashtable;
#endif
#define UCNV_MAX_SUBCHAR_LEN 4
#define UCNV_ERROR_BUFFER_LENGTH 20
#ifndef UCMP16_H
typedef struct _CompactShortArray CompactShortArray;
#endif
typedef struct CompactShortArray CompactShortArray;
typedef struct CompactByteArray CompactByteArray;
#ifndef UCMP8_H
typedef struct _CompactByteArray CompactByteArray;
#endif
#define MAX_SUBCHAR_LEN 4
#define ERROR_BUFFER_LENGTH 20
#define IMPLEMENTED_CONVERSION_TYPES 9
#define UCNV_IMPLEMENTED_CONVERSION_TYPES 9
/*Sentinel Value used to check the integrity of the binary data files */
#define FILE_CHECK_MARKER 0xBEDA
#define UCNV_FILE_CHECK_MARKER 0xBEDA
extern const char* COPYRIGHT_STRING;
extern const int32_t COPYRIGHT_STRING_LENGTH;
#define UCNV_COPYRIGHT_STRING \
" * COPYRIGHT: *\n" \
" * (C) Copyright International Business Machines Corporation, 1999 *\n"
#define COPYRIGHT_STRING " * COPYRIGHT: *\n * (C) Copyright International Business Machines Corporation, 1999 *\n"
#define COPYRIGHT_STRING_LENGTH 200
#define UCNV_COPYRIGHT_STRING_LENGTH 200
/*maximum length of the converter names */
#define MAX_CONVERTER_NAME_LENGTH 60
#define MAX_FULL_FILE_NAME_LENGTH 600+MAX_CONVERTER_NAME_LENGTH
#define UCNV_MAX_CONVERTER_NAME_LENGTH 60
#define UCNV_MAX_FULL_FILE_NAME_LENGTH (600+UCNV_MAX_CONVERTER_NAME_LENGTH)
/*Pointer to the aforementionned file */
#define MAX_LINE_TEXT MAX_CONVERTER_NAME_LENGTH*400
/*Pointer to the aforementioned file */
#define UCNV_MAX_LINE_TEXT (UCNV_MAX_CONVERTER_NAME_LENGTH*400)
#define UCNV_SI 0x0F /*Shift in for EBDCDIC_STATEFUL and iso2022 states */
#define UCNV_SO 0x0E /*Shift out for EBDCDIC_STATEFUL and iso2022 states */
typedef enum
{
UNSUPPORTED_CONVERTER = -1,
SBCS = 0,
DBCS = 1,
MBCS = 2,
LATIN_1 = 3,
UTF8 = 4,
UTF16_BigEndian = 5,
UTF16_LittleEndian = 6,
EBCDIC_STATEFUL = 7,
ISO_2022 = 8,
JIS = 9,
EUC = 10,
GB = 11
}
UCNV_TYPE;
typedef enum {
UCNV_UNSUPPORTED_CONVERTER = -1,
UCNV_SBCS = 0,
UCNV_DBCS = 1,
UCNV_MBCS = 2,
UCNV_LATIN_1 = 3,
UCNV_UTF8 = 4,
UCNV_UTF16_BigEndian = 5,
UCNV_UTF16_LittleEndian = 6,
UCNV_EBCDIC_STATEFUL = 7,
UCNV_ISO_2022 = 8,
/** Number of converter types for which we have conversion routines. */
UCNV_NUMBER_OF_SUPPORTED_CONVERTER_TYPES = 9,
UCNV_JIS = 9,
UCNV_EUC = 10,
UCNV_GB = 11
} UConverterType;
/*Number of converters types for which we have conversion routines */
#define NUMBER_OF_SUPPORTED_CONVERTER_TYPES 9
#ifdef UNKNOWN
#undef UNKNOWN
#endif
typedef enum {UNKNOWN = -1, IBM = 0}
UCNV_PLATFORM;
typedef enum {
UCNV_UNKNOWN = -1,
UCNV_IBM = 0
} UConverterPlatform;
/*Table Node Definitions */
@ -99,14 +84,14 @@ typedef struct
UChar toUnicode[256];
CompactByteArray *fromUnicode;
}
SBCS_TABLE;
UConverterSBCSTable;
typedef struct
{
CompactShortArray *toUnicode;
CompactShortArray *fromUnicode;
}
DBCS_TABLE;
UConverterDBCSTable;
typedef struct
{
@ -114,15 +99,15 @@ typedef struct
CompactShortArray *toUnicode;
CompactShortArray *fromUnicode;
}
MBCS_TABLE;
UConverterMBCSTable;
typedef union
{
SBCS_TABLE sbcs;
DBCS_TABLE dbcs;
MBCS_TABLE mbcs;
UConverterSBCSTable sbcs;
UConverterDBCSTable dbcs;
UConverterMBCSTable mbcs;
}
ConverterTable;
UConverterTable;
/*Defines the struct of a UConverterSharedData the immutable, shared part of
@ -131,20 +116,20 @@ ConverterTable;
typedef struct
{
uint32_t referenceCounter; /*used to count number of clients */
char name[MAX_CONVERTER_NAME_LENGTH]; /*internal name of the converter */
UCNV_PLATFORM platform; /*platform of the converter (only IBM now */
char name[UCNV_MAX_CONVERTER_NAME_LENGTH]; /*internal name of the converter */
UConverterPlatform platform; /*platform of the converter (only IBM now) */
int32_t codepage; /*codepage # (now IBM-$codepage) */
UCNV_TYPE conversionType; /*conversion type */
UConverterType conversionType; /*conversion type */
int8_t minBytesPerChar; /*Minimum # bytes per char in this codepage */
int8_t maxBytesPerChar; /*Maximum # bytes per char in this codepage */
struct
{ /*initial values of some members of the mutable part of object */
uint32_t toUnicodeStatus;
int8_t subCharLen;
unsigned char subChar[MAX_SUBCHAR_LEN];
unsigned char subChar[UCNV_MAX_SUBCHAR_LEN];
}
defaultConverterValues;
ConverterTable *table; /*Pointer to conversion data */
UConverterTable *table; /*Pointer to conversion data */
}
UConverterSharedData;
@ -159,11 +144,11 @@ struct UConverter
int8_t pad;
int32_t mode;
int8_t subCharLen; /*length of the codepage specific character sequence */
unsigned char subChar[MAX_SUBCHAR_LEN]; /*codepage specific character sequence */
UChar UCharErrorBuffer[ERROR_BUFFER_LENGTH]; /*used to store unicode data meant for
unsigned char subChar[UCNV_MAX_SUBCHAR_LEN]; /*codepage specific character sequence */
UChar UCharErrorBuffer[UCNV_ERROR_BUFFER_LENGTH]; /*used to store unicode data meant for
*output stream by the Error function pointers
*/
unsigned char charErrorBuffer[ERROR_BUFFER_LENGTH]; /*used to store codepage data meant for
unsigned char charErrorBuffer[UCNV_ERROR_BUFFER_LENGTH]; /*used to store codepage data meant for
* output stream by the Error function pointers
*/
int8_t UCharErrorBufferLength; /*used to indicate the number of valid UChars
@ -174,7 +159,7 @@ struct UConverter
*/
UChar invalidUCharBuffer[3];
char invalidCharBuffer[MAX_SUBCHAR_LEN];
char invalidCharBuffer[UCNV_MAX_SUBCHAR_LEN];
/*Error function pointer called when conversion issues
*occur during a T_UConverter_fromUnicode call
*/
@ -216,79 +201,7 @@ typedef struct
unsigned char escSeq2022[10];
int8_t escSeq2022Length;
}
UCNV_Data2022;
typedef void (*UCNV_ToUCallBack) (UConverter *,
UChar **,
const UChar *,
const char **,
const char *,
int32_t* offsets,
bool_t,
UErrorCode *);
typedef void (*UCNV_FromUCallBack) (UConverter *,
char **,
const char *,
const UChar **,
const UChar *,
int32_t* offsets,
bool_t,
UErrorCode *);
/*Hashtable used to store UConverterSharedData objects supporting
*the Caching mechanism
*/
extern UHashtable *SHARED_DATA_HASHTABLE;
/*Hashtable generated (lazy eval) by algorithmicConverterNames for fast lookup
*Behaviour is completely different for the Algorithmic conversions.
*we use this table to as a litmus test.
*/
extern UHashtable *ALGORITHMIC_CONVERTERS_HASHTABLE;
/*Array used to generate ALGORITHMIC_CONVERTERS_HASHTABLE
*should ALWAYS BE NULL STRING TERMINATED.
*/
static const char *algorithmicConverterNames[MAX_CONVERTER_NAME_LENGTH] = {
"LATIN_1",
"UTF8",
"UTF16_BigEndian",
"UTF16_LittleEndian",
"ISO_2022",
"JIS",
"EUC",
"GB",
"ISO_2022",
""
};
/* figures out if we need to go to file to read in the data tables.
*/
UConverter *createConverter (const char *converterName, UErrorCode * err);
/* Stores the shared data in the SHARED_DATA_HASHTABLE
*/
void shareConverterData (UConverterSharedData * data);
/* gets the shared data from the SHARED_DATA_HASHTABLE (might return NULL if it isn't there)
*/
UConverterSharedData *getSharedConverterData (const char *name);
/* Deletes (frees) the Shared data it's passed. first it checks the referenceCounter to
* see if anyone is using it, if not it frees all the memory stemming from sharedConverterData and
* returns TRUE,
* otherwise returns FALSE
*/
bool_t deleteSharedConverterData (UConverterSharedData * sharedConverterData);
/* returns true if "name" is in algorithmicConverterNames
*/
bool_t isDataBasedConverter (const char *name);
void copyPlatformString (char *platformString, UCNV_PLATFORM pltfrm);
UConverterDataISO2022;
#endif /* _UCNV_BLD */

View file

@ -21,7 +21,7 @@
#include "utypes.h"
#include "ucnv_bld.h"
bool_t CONVERSION_SUCCESS (UErrorCode err);
bool_t CONVERSION_U_SUCCESS (UErrorCode err);
void T_UConverter_toUnicode_SBCS (UConverter * converter,
UChar ** target,

View file

@ -36,14 +36,14 @@ extern int32_t AVAILABLE_CONVERTERS;
bool_t isInSet (char c, const char *setOfChars);
/*Remove all characters followed by '#' */
CAPI char * U_EXPORT2 removeComments (char *line);
U_CAPI char * U_EXPORT2 removeComments (char *line);
/*Returns pointer to the next non-whitespace (or non-separators) */
CAPI int32_t U_EXPORT2 nextTokenOffset (const char *line, const char *separators);
U_CAPI int32_t U_EXPORT2 nextTokenOffset (const char *line, const char *separators);
/*Copies the next string in token and returns an updated pointer to the next token */
CAPI char * U_EXPORT2 getToken (char *token, char *line, const char *separators);
U_CAPI char * U_EXPORT2 getToken (char *token, char *line, const char *separators);
/*Takes an alias name and returns a FileStream pointer of the requested converter table or NULL, if not found */
FileStream * U_EXPORT2 openConverterFile (const char *name);
@ -57,8 +57,8 @@ bool_t resolveName (char *realName, const char *alias);
void setupAliasTableAndAvailableConverters (UErrorCode * err);
/*Uppercases a null-terminate string */
CAPI char * U_EXPORT2 strtoupper (char *);
U_CAPI char * U_EXPORT2 strtoupper (char *);
/*case insensitive hash key*/
CAPI int32_t U_EXPORT2 uhash_hashIString(const void* name);
U_CAPI int32_t U_EXPORT2 uhash_hashIString(const void* name);
#endif /* _UCNV_IO */

View file

@ -57,15 +57,15 @@ typedef void *UMTX;
/* Lock a mutex. Pass in NULL if you want the (ick) Single Global
Mutex. */
CAPI void U_EXPORT2 umtx_lock ( UMTX* mutex );
U_CAPI void U_EXPORT2 umtx_lock ( UMTX* mutex );
/* Unlock a mutex. Pass in NULL if you want the single global
mutex. */
CAPI void U_EXPORT2 umtx_unlock ( UMTX* mutex );
U_CAPI void U_EXPORT2 umtx_unlock ( UMTX* mutex );
/* Initialize a mutex. Use it this way:
umtx_init( &aMutex ); */
CAPI void U_EXPORT2 umtx_init ( UMTX* mutex );
U_CAPI void U_EXPORT2 umtx_init ( UMTX* mutex );
#endif /*_CMUTEX*/
/*eof*/

View file

@ -27,7 +27,7 @@
* @param s The array of UChars, NULL (U+0000) terminated.
* @return The number of UChars in <TT>chars</TT>, minus the terminator.
*/
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
u_strlen(const UChar *s);
/**
@ -39,7 +39,7 @@ u_strlen(const UChar *s);
* @return A pointer to <TT>dst</TT>.
*/
CAPI UChar* U_EXPORT2
U_CAPI UChar* U_EXPORT2
u_strcat(UChar *dst,
const UChar *src);
@ -52,7 +52,7 @@ u_strcat(UChar *dst,
* @param n The maximum number of characters to compare.
* @return A pointer to <TT>dst</TT>.
*/
CAPI UChar* U_EXPORT2
U_CAPI UChar* U_EXPORT2
u_strncat(UChar *dst,
const UChar *src,
int32_t n);
@ -64,7 +64,7 @@ u_strncat(UChar *dst,
* @return A pointer to the first occurrence of <TT>c</TT> in <TT>s</TT>,
* or a null pointer if <TT>s</TT> does not contain <TT>c</TT>.
*/
CAPI UChar* U_EXPORT2
U_CAPI UChar* U_EXPORT2
u_strchr(const UChar *s,
UChar c);
@ -76,7 +76,7 @@ u_strchr(const UChar *s,
* value if <TT>s1</TT> is bitwise less than <TT>s2,/TT>; a positive
* value if <TT>s1</TT> is bitwise greater than <TT>s2,/TT>.
*/
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
u_strcmp(const UChar *s1,
const UChar *s2);
@ -90,7 +90,7 @@ u_strcmp(const UChar *s1,
* value if <TT>s1</TT> is bitwise less than <TT>s2,/TT>; a positive
* value if <TT>s1</TT> is bitwise greater than <TT>s2,/TT>.
*/
CAPI int32_t U_EXPORT2
U_CAPI int32_t U_EXPORT2
u_strncmp(const UChar *ucs1,
const UChar *ucs2,
int32_t n);
@ -102,7 +102,7 @@ u_strncmp(const UChar *ucs1,
* @param src The source string.
* @return A pointer to <TT>dst</TT>.
*/
CAPI UChar* U_EXPORT2
U_CAPI UChar* U_EXPORT2
u_strcpy(UChar *dst,
const UChar *src);
@ -115,7 +115,7 @@ u_strcpy(UChar *dst,
* @param n The maximum number of characters to copy.
* @return A pointer to <TT>dst</TT>.
*/
CAPI UChar* U_EXPORT2
U_CAPI UChar* U_EXPORT2
u_strncpy(UChar *dst,
const UChar *src,
int32_t n);
@ -128,7 +128,7 @@ u_strncpy(UChar *dst,
* @param src The source string.
* @return A pointer to <TT>dst</TT>.
*/
CAPI UChar* U_EXPORT2 u_uastrcpy(UChar *ucs1,
U_CAPI UChar* U_EXPORT2 u_uastrcpy(UChar *ucs1,
const char *s2 );
/**
@ -141,7 +141,7 @@ CAPI UChar* U_EXPORT2 u_uastrcpy(UChar *ucs1,
* @param n The maximum number of characters to copy.
* @return A pointer to <TT>dst</TT>.
*/
CAPI UChar* U_EXPORT2 u_uastrncpy(UChar *ucs1,
U_CAPI UChar* U_EXPORT2 u_uastrncpy(UChar *ucs1,
const char *s2,
int32_t n);
@ -153,7 +153,7 @@ CAPI UChar* U_EXPORT2 u_uastrncpy(UChar *ucs1,
* @param src The source string.
* @return A pointer to <TT>dst</TT>.
*/
CAPI char* U_EXPORT2 u_austrcpy(char *s1,
U_CAPI char* U_EXPORT2 u_austrcpy(char *s1,
const UChar *us2 );
#endif

View file

@ -198,7 +198,7 @@ public:
* Return a polymorphic class ID for this object. Different subclasses
* will return distinct unequal values.
*/
virtual ClassID getDynamicClassID(void) const = 0;
virtual UClassID getDynamicClassID(void) const = 0;
/**
* Get the text for which this object is finding the boundaries.

View file

@ -87,7 +87,7 @@ Collator::operator=(const Collator& other)
Collator*
Collator::createInstance(UErrorCode& success) {
if (FAILURE(success))
if (U_FAILURE(success))
return 0;
return createInstance(Locale::getDefault(), success);
}
@ -96,7 +96,7 @@ Collator*
Collator::createInstance(const Locale& desiredLocale,
UErrorCode& status)
{
if (FAILURE(status)) return 0;
if (U_FAILURE(status)) return 0;
/**
* A bit of explanation is required here. Although in the current implementation
@ -119,7 +119,7 @@ Collator::createInstance(const Locale& desiredLocale,
* have no way of checking.
*/
RuleBasedCollator* collation = new RuleBasedCollator(desiredLocale, status);
if (FAILURE(status))
if (U_FAILURE(status))
{
delete collation;
collation = 0;

View file

@ -208,14 +208,14 @@ public:
* Concrete subclasses of Format must implement getDynamicClassID()
* and also a static method and data member:
*
* static ClassID getStaticClassID() { return (ClassID)&fgClassID; }
* static UClassID getStaticClassID() { return (UClassID)&fgClassID; }
* static char fgClassID;
*
* @return The class ID for this object. All objects of a
* given class have the same class ID. Objects of
* other classes have different class IDs.
*/
virtual ClassID getDynamicClassID() const = 0;
virtual UClassID getDynamicClassID() const = 0;
protected:
/**

View file

@ -390,7 +390,7 @@ public:
* @return The class ID for this object. All objects of a given class have the
* same class ID. Objects of other classes have different class IDs.
*/
virtual ClassID getDynamicClassID(void) const { return (ClassID)&fgClassID; }
virtual UClassID getDynamicClassID(void) const { return (UClassID)&fgClassID; }
/**
* Return the class ID for this class. This is useful only for comparing to a return
@ -402,7 +402,7 @@ public:
* </pre>
* @return The class ID for all objects of this class.
*/
static ClassID getStaticClassID(void) { return (ClassID)&fgClassID; }
static UClassID getStaticClassID(void) { return (UClassID)&fgClassID; }
private:
/**

View file

@ -71,12 +71,12 @@ public:
* Return a polymorphic class ID for this object. Different subclasses
* will return distinct unequal values.
*/
virtual ClassID getDynamicClassID(void) const { return getStaticClassID(); }
virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); }
/**
* Return a static class ID for this class.
*/
static ClassID getStaticClassID(void) { return (ClassID)&fgClassID; }
static UClassID getStaticClassID(void) { return (UClassID)&fgClassID; }
/**
* Return the text iterator over which this operates.

View file

@ -393,7 +393,7 @@ public:
* </pre>
* @return The class ID for all objects of this class.
*/
static ClassID getStaticClassID(void) { return (ClassID)&fgClassID; }
static UClassID getStaticClassID(void) { return (UClassID)&fgClassID; }
/**
* Returns a unique class ID POLYMORPHICALLY. Pure virtual method. This method is to
@ -403,13 +403,13 @@ public:
* Concrete subclasses of TimeZone must implement getDynamicClassID() and also a
* static method and data member:
* <pre>
* . static ClassID getStaticClassID() { return (ClassID)&fgClassID; }
* . static UClassID getStaticClassID() { return (UClassID)&fgClassID; }
* . static char fgClassID;
* </pre>
* @return The class ID for this object. All objects of a given class have the
* same class ID. Objects of other classes have different class IDs.
*/
virtual ClassID getDynamicClassID(void) const = 0;
virtual UClassID getDynamicClassID(void) const = 0;
protected:

View file

@ -188,7 +188,7 @@ typedef enum UBreakIteratorType UBreakIteratorType;
* @return A UBreakIterator for the specified locale.
* @see ubrk_openRules
*/
CAPI UBreakIterator*
U_CAPI UBreakIterator*
ubrk_open(UBreakIteratorType type,
const char *locale,
const UChar *text,
@ -206,7 +206,7 @@ ubrk_open(UBreakIteratorType type,
* @return A UBreakIterator for the specified rules.
* @see ubrk_open
*/
CAPI UBreakIterator*
U_CAPI UBreakIterator*
ubrk_openRules(const UChar *rules,
int32_t rulesLength,
const UChar *text,
@ -218,7 +218,7 @@ ubrk_openRules(const UChar *rules,
* Once closed, a UBreakIterator may no longer be used.
* @param bi The break iterator to close.
*/
CAPI void
U_CAPI void
ubrk_close(UBreakIterator *bi);
/**
@ -228,7 +228,7 @@ ubrk_close(UBreakIterator *bi);
* @return The character index most recently returned by \Ref{ubrk_next}, \Ref{ubrk_previous},
* \Ref{ubrk_first}, or \Ref{ubrk_last}.
*/
CAPI UTextOffset
U_CAPI UTextOffset
ubrk_current(const UBreakIterator *bi);
/**
@ -239,7 +239,7 @@ ubrk_current(const UBreakIterator *bi);
* if all text boundaries have been returned.
* @see ubrk_previous
*/
CAPI UTextOffset
U_CAPI UTextOffset
ubrk_next(UBreakIterator *bi);
/**
@ -250,7 +250,7 @@ ubrk_next(UBreakIterator *bi);
* if all text boundaries have been returned.
* @see ubrk_next
*/
CAPI UTextOffset
U_CAPI UTextOffset
ubrk_previous(UBreakIterator *bi);
/**
@ -260,7 +260,7 @@ ubrk_previous(UBreakIterator *bi);
* @return The character index of the first character in the text being scanned.
* @see ubrk_last
*/
CAPI UTextOffset
U_CAPI UTextOffset
ubrk_first(UBreakIterator *bi);
/**
@ -272,7 +272,7 @@ ubrk_first(UBreakIterator *bi);
* text being scanned.
* @see ubrk_first
*/
CAPI UTextOffset
U_CAPI UTextOffset
ubrk_last(UBreakIterator *bi);
/**
@ -283,7 +283,7 @@ ubrk_last(UBreakIterator *bi);
* @return The text boundary preceding offset, or UBRK_DONE.
* @see ubrk_following
*/
CAPI UTextOffset
U_CAPI UTextOffset
ubrk_preceding(UBreakIterator *bi,
UTextOffset offset);
@ -295,7 +295,7 @@ ubrk_preceding(UBreakIterator *bi,
* @return The text boundary following offset, or UBRK_DONE.
* @see ubrk_preceding
*/
CAPI UTextOffset
U_CAPI UTextOffset
ubrk_following(UBreakIterator *bi,
UTextOffset offset);
@ -307,7 +307,7 @@ ubrk_following(UBreakIterator *bi,
* @return A locale for which number text breaking information is available, or 0 if none.
* @see ubrk_countAvailable
*/
CAPI const char*
U_CAPI const char*
ubrk_getAvailable(int32_t index);
/**
@ -317,7 +317,7 @@ ubrk_getAvailable(int32_t index);
* @return The number of locales for which text breaking information is available.
* @see ubrk_getAvailable
*/
CAPI int32_t
U_CAPI int32_t
ubrk_countAvailable(void);
#endif

View file

@ -26,7 +26,7 @@
*
* <p>
* Types of <code>UCalendar</code> interpret a <code>UDate</code>
* according to the rules of a specific calendar system. The CAPI
* according to the rules of a specific calendar system. The U_CAPI
* provides the enum UCalendarType with UCAL_TRADITIONAL and
* UCAL_GREGORIAN.
* <p>
@ -253,7 +253,7 @@ typedef enum UCalendarAMPMs UCalendarAMPMs;
* @return The requested TimeZone ID, or 0 if not found
* @see ucal_countAvailableTZIDs
*/
CAPI const UChar*
U_CAPI const UChar*
ucal_getAvailableTZIDs( int32_t rawOffset,
int32_t index,
UErrorCode* status);
@ -266,7 +266,7 @@ ucal_getAvailableTZIDs( int32_t rawOffset,
* @return The number of TimeZones with rawOffset.
* @see ucal_getAvailableTZIDs
*/
CAPI int32_t
U_CAPI int32_t
ucal_countAvailableTZIDs(int32_t rawOffset);
/**
@ -274,7 +274,7 @@ ucal_countAvailableTZIDs(int32_t rawOffset);
* The value returned is represented as milliseconds from the epoch.
* @return The current date and time.
*/
CAPI UDate
U_CAPI UDate
ucal_getNow(void);
/**
@ -288,7 +288,7 @@ ucal_getNow(void);
* @param status A pointer to an UErrorCode to receive any errors
* @return A pointer to a UCalendar, or 0 if an error occurred.
*/
CAPI UCalendar*
U_CAPI UCalendar*
ucal_open( const UChar* zoneID,
int32_t len,
const char* locale,
@ -300,7 +300,7 @@ ucal_open( const UChar* zoneID,
* Once closed, a UCalendar may no longer be used.
* @param cal The UCalendar to close.
*/
CAPI void
U_CAPI void
ucal_close(UCalendar *cal);
/**
@ -311,7 +311,7 @@ ucal_close(UCalendar *cal);
* @param len The length of zoneID, or -1 if null-terminated.
* @param status A pointer to an UErrorCode to receive any errors.
*/
CAPI void
U_CAPI void
ucal_setTimeZone( UCalendar* cal,
const UChar* zoneID,
int32_t len,
@ -344,7 +344,7 @@ typedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
* written to result.
* @return The total buffer size needed; if greater than resultLength, the output was truncated.
*/
CAPI int32_t
U_CAPI int32_t
ucal_getTimeZoneDisplayName( const UCalendar* cal,
UCalendarDisplayNameType type,
const char *locale,
@ -359,7 +359,7 @@ ucal_getTimeZoneDisplayName( const UCalendar* cal,
* @param status A pointer to an UErrorCode to receive any errors
* @return TRUE if cal is currently in daylight savings time, FALSE otherwise
*/
CAPI bool_t
U_CAPI bool_t
ucal_inDaylightTime( const UCalendar* cal,
UErrorCode* status );
@ -384,7 +384,7 @@ typedef enum UCalendarAttribute UCalendarAttribute;
* @return The value of attr.
* @see ucal_setAttribute
*/
CAPI int32_t
U_CAPI int32_t
ucal_getAttribute( const UCalendar* cal,
UCalendarAttribute attr);
@ -398,7 +398,7 @@ ucal_getAttribute( const UCalendar* cal,
* @param newValue The new value of attr.
* @see ucal_getAttribute
*/
CAPI void
U_CAPI void
ucal_setAttribute( UCalendar* cal,
UCalendarAttribute attr,
int32_t newValue);
@ -411,7 +411,7 @@ ucal_setAttribute( UCalendar* cal,
* @return A locale for which calendars are available, or 0 if none.
* @see ucal_countAvailable
*/
CAPI const char*
U_CAPI const char*
ucal_getAvailable(int32_t index);
/**
@ -421,7 +421,7 @@ ucal_getAvailable(int32_t index);
* @return The number of locales for which calendars are available.
* @see ucal_getAvailable
*/
CAPI int32_t
U_CAPI int32_t
ucal_countAvailable(void);
/**
@ -434,7 +434,7 @@ ucal_countAvailable(void);
* @see ucal_setDate
* @see ucal_setDateTime
*/
CAPI UDate
U_CAPI UDate
ucal_getMillis( const UCalendar* cal,
UErrorCode* status);
@ -448,7 +448,7 @@ ucal_getMillis( const UCalendar* cal,
* @see ucal_setDate
* @see ucal_setDateTime
*/
CAPI void
U_CAPI void
ucal_setMillis( UCalendar* cal,
UDate dateTime,
UErrorCode* status );
@ -466,7 +466,7 @@ ucal_setMillis( UCalendar* cal,
* @see ucal_setMillis
* @see ucal_setDateTime
*/
CAPI void
U_CAPI void
ucal_setDate( UCalendar* cal,
int32_t year,
int32_t month,
@ -489,7 +489,7 @@ ucal_setDate( UCalendar* cal,
* @see ucal_setMillis
* @see ucal_setDate
*/
CAPI void
U_CAPI void
ucal_setDateTime( UCalendar* cal,
int32_t year,
int32_t month,
@ -507,7 +507,7 @@ ucal_setDateTime( UCalendar* cal,
* @param cal2 The second of the UCalendars to compare.
* @return TRUE if cal1 and cal2 represent the same date, FALSE otherwise.
*/
CAPI bool_t
U_CAPI bool_t
ucal_equivalentTo( const UCalendar* cal1,
const UCalendar* cal2);
@ -525,7 +525,7 @@ ucal_equivalentTo( const UCalendar* cal1,
* @param status A pointer to an UErrorCode to receive any errors
* @see ucal_roll
*/
CAPI void
U_CAPI void
ucal_add( UCalendar* cal,
UCalendarDateFields field,
int32_t amount,
@ -545,7 +545,7 @@ ucal_add( UCalendar* cal,
* @param status A pointer to an UErrorCode to receive any errors
* @see ucal_add
*/
CAPI void
U_CAPI void
ucal_roll( UCalendar* cal,
UCalendarDateFields field,
int32_t amount,
@ -566,7 +566,7 @@ ucal_roll( UCalendar* cal,
* @see ucal_clearField
* @see ucal_clear
*/
CAPI int32_t
U_CAPI int32_t
ucal_get( const UCalendar* cal,
UCalendarDateFields field,
UErrorCode* status );
@ -585,7 +585,7 @@ ucal_get( const UCalendar* cal,
* @see ucal_clearField
* @see ucal_clear
*/
CAPI void
U_CAPI void
ucal_set( UCalendar* cal,
UCalendarDateFields field,
int32_t value);
@ -604,7 +604,7 @@ ucal_set( UCalendar* cal,
* @see ucal_clearField
* @see ucal_clear
*/
CAPI bool_t
U_CAPI bool_t
ucal_isSet( const UCalendar* cal,
UCalendarDateFields field);
@ -621,7 +621,7 @@ ucal_isSet( const UCalendar* cal,
* @see ucal_isSet
* @see ucal_clear
*/
CAPI void
U_CAPI void
ucal_clearField( UCalendar* cal,
UCalendarDateFields field);
@ -634,7 +634,7 @@ ucal_clearField( UCalendar* cal,
* @see ucal_isSet
* @see ucal_clearField
*/
CAPI void
U_CAPI void
ucal_clear(UCalendar* calendar);
/** Possible limit values for a UCalendar */
@ -667,7 +667,7 @@ typedef enum UCalendarLimitType UCalendarLimitType;
* @param status A pointer to an UErrorCode to receive any errors.
* @return The requested value.
*/
CAPI int32_t
U_CAPI int32_t
ucal_getLimit( const UCalendar* cal,
UCalendarDateFields field,
UCalendarLimitType type,

View file

@ -51,11 +51,11 @@ int32_t ucmp8_getkBlockCount() { return UCMP8_kBlockCount;}
int32_t ucmp8_getkIndexCount(){ return UCMP8_kIndexCount;}
/* debug flags*/
/*=======================================================*/
CAPI int8_t ucmp8_get(CompactByteArray* array, uint16_t index)
U_CAPI int8_t ucmp8_get(CompactByteArray* array, uint16_t index)
{
return (array->fArray[(array->fIndex[index >> UCMP8_kBlockShift] & 0xFFFF) + (index & UCMP8_kBlockMask)]);
}
CAPI uint8_t ucmp8_getu(CompactByteArray* array, uint16_t index)
U_CAPI uint8_t ucmp8_getu(CompactByteArray* array, uint16_t index)
{
return (uint8_t)ucmp8_get(array,index);
}

View file

@ -27,16 +27,16 @@
*====================================
*/
CAPI const int32_t UCMP8_kUnicodeCount;
CAPI const int32_t UCMP8_kBlockShift;
CAPI const int32_t UCMP8_kBlockCount;
CAPI const int32_t UCMP8_kIndexShift;
CAPI const int32_t UCMP8_kIndexCount;
CAPI const uint32_t UCMP8_kBlockMask;
U_CAPI const int32_t UCMP8_kUnicodeCount;
U_CAPI const int32_t UCMP8_kBlockShift;
U_CAPI const int32_t UCMP8_kBlockCount;
U_CAPI const int32_t UCMP8_kIndexShift;
U_CAPI const int32_t UCMP8_kIndexCount;
U_CAPI const uint32_t UCMP8_kBlockMask;
CAPI int32_t ucmp8_getkUnicodeCount(void);
CAPI int32_t ucmp8_getkBlockCount(void);
CAPI int32_t ucmp8_getkIndexCount(void);
U_CAPI int32_t ucmp8_getkUnicodeCount(void);
U_CAPI int32_t ucmp8_getkBlockCount(void);
U_CAPI int32_t ucmp8_getkIndexCount(void);
typedef struct{
int8_t* fArray;
uint16_t* fIndex;
@ -45,29 +45,29 @@ typedef struct{
bool_t fBogus;
} CompactByteArray;
CAPI CompactByteArray* ucmp8_open(int8_t defaultValue);
CAPI CompactByteArray* ucmp8_openAdopt(uint16_t* indexArray,
U_CAPI CompactByteArray* ucmp8_open(int8_t defaultValue);
U_CAPI CompactByteArray* ucmp8_openAdopt(uint16_t* indexArray,
int8_t* newValues,
int32_t count);
CAPI void ucmp8_close(CompactByteArray* array);
CAPI bool_t isBogus(const CompactByteArray* array);
U_CAPI void ucmp8_close(CompactByteArray* array);
U_CAPI bool_t isBogus(const CompactByteArray* array);
CAPI int8_t ucmp8_get(CompactByteArray* array, uint16_t index);
CAPI uint8_t ucmp8_getu(CompactByteArray* array, uint16_t index);
U_CAPI int8_t ucmp8_get(CompactByteArray* array, uint16_t index);
U_CAPI uint8_t ucmp8_getu(CompactByteArray* array, uint16_t index);
CAPI void ucmp8_set(CompactByteArray* array,
U_CAPI void ucmp8_set(CompactByteArray* array,
UChar index,
int8_t value);
CAPI void ucmp8_setRange(CompactByteArray* array,
U_CAPI void ucmp8_setRange(CompactByteArray* array,
UChar start,
UChar end,
int8_t value);
CAPI int32_t ucmp8_getCount(const CompactByteArray* array);
CAPI const int8_t* ucmp8_getArray(const CompactByteArray* array);
CAPI const uint16_t* ucmp8_getIndex(const CompactByteArray* array);
U_CAPI int32_t ucmp8_getCount(const CompactByteArray* array);
U_CAPI const int8_t* ucmp8_getArray(const CompactByteArray* array);
U_CAPI const uint16_t* ucmp8_getIndex(const CompactByteArray* array);
/* Compact the array.
The value of cycle determines how large the overlap can be.
@ -76,11 +76,11 @@ CAPI const uint16_t* ucmp8_getIndex(const CompactByteArray* array);
then using that will be faster than cycle = 1, and get almost the
same compression.
*/
CAPI void ucmp8_compact(CompactByteArray* array,
U_CAPI void ucmp8_compact(CompactByteArray* array,
uint32_t cycle);
/* Expanded takes the array back to a 65536 element array*/
CAPI void ucmp8_expand(CompactByteArray* array);
U_CAPI void ucmp8_expand(CompactByteArray* array);