mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-19 03:34:38 +00:00
ICU-1541 consistently added U_CAPI & U_EXPORT2 to all the declarations and definitions
X-SVN-Rev: 7038
This commit is contained in:
parent
6fa43163de
commit
1b0596cd30
35 changed files with 452 additions and 357 deletions
|
@ -26,7 +26,7 @@
|
|||
#include "cmemory.h"
|
||||
#include "cstring.h"
|
||||
|
||||
char*
|
||||
U_CAPI char* U_EXPORT2
|
||||
T_CString_toLowerCase(char* str)
|
||||
{
|
||||
char* origPtr = str;
|
||||
|
@ -40,7 +40,7 @@ T_CString_toLowerCase(char* str)
|
|||
return origPtr;
|
||||
}
|
||||
|
||||
char*
|
||||
U_CAPI char* U_EXPORT2
|
||||
T_CString_toUpperCase(char* str)
|
||||
{
|
||||
char* origPtr = str;
|
||||
|
@ -56,7 +56,8 @@ T_CString_toUpperCase(char* str)
|
|||
|
||||
/*Takes a int32_t and fills in a char* string with that number "radix"-based*/
|
||||
|
||||
void T_CString_integerToString(char* buffer, int32_t i, int32_t radix)
|
||||
U_CAPI void U_EXPORT2
|
||||
T_CString_integerToString(char* buffer, int32_t i, int32_t radix)
|
||||
{
|
||||
int32_t length=0;
|
||||
int32_t num = 0;
|
||||
|
@ -86,7 +87,7 @@ void T_CString_integerToString(char* buffer, int32_t i, int32_t radix)
|
|||
}
|
||||
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
T_CString_stringToInteger(const char *integerString, int32_t radix)
|
||||
{
|
||||
char *end;
|
||||
|
@ -174,7 +175,8 @@ T_CString_strnicmp(const char *str1, const char *str2, uint32_t n) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
U_CAPI char *uprv_strdup(const char *src) {
|
||||
U_CAPI char* U_EXPORT2
|
||||
uprv_strdup(const char *src) {
|
||||
size_t len = strlen(src) + 1;
|
||||
char *dup = (char *) malloc(len);
|
||||
|
||||
|
|
|
@ -40,9 +40,12 @@
|
|||
# define uprv_wcscat wcscat
|
||||
# define uprv_wcslen wcslen
|
||||
#else
|
||||
U_CAPI wchar_t *uprv_wcscpy(wchar_t *dst, const wchar_t *src);
|
||||
U_CAPI wchar_t *uprv_wcscat(wchar_t *dst, const wchar_t *src);
|
||||
U_CAPI size_t uprv_wcslen(const wchar_t *src);
|
||||
U_CAPI wchar_t* U_EXPORT2
|
||||
uprv_wcscpy(wchar_t *dst, const wchar_t *src);
|
||||
U_CAPI wchar_t* U_EXPORT2
|
||||
uprv_wcscat(wchar_t *dst, const wchar_t *src);
|
||||
U_CAPI size_t U_EXPORT2
|
||||
uprv_wcslen(const wchar_t *src);
|
||||
#endif
|
||||
|
||||
/* The following are part of the ANSI C standard, defined in stdlib.h . */
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
U_CAPI FileStream*
|
||||
U_CAPI FileStream* U_EXPORT2
|
||||
T_FileStream_open(const char* filename, const char* mode)
|
||||
{
|
||||
if(filename != NULL && *filename != 0 && mode != NULL && *mode != 0) {
|
||||
|
@ -38,7 +38,7 @@ T_FileStream_open(const char* filename, const char* mode)
|
|||
}
|
||||
|
||||
|
||||
U_CAPI FileStream*
|
||||
U_CAPI FileStream* U_EXPORT2
|
||||
T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode)
|
||||
{
|
||||
/* TBD: _wfopen is believed to be MS-specific? */
|
||||
|
@ -68,13 +68,13 @@ T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode)
|
|||
#endif
|
||||
}
|
||||
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
T_FileStream_close(FileStream* fileStream)
|
||||
{
|
||||
if (fileStream != 0) fclose((FILE*)fileStream);
|
||||
}
|
||||
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
T_FileStream_file_exists(const char* filename)
|
||||
{
|
||||
FILE* temp = fopen(filename, "r");
|
||||
|
@ -97,40 +97,40 @@ T_FileStream_tmpfile()
|
|||
}
|
||||
*/
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
T_FileStream_read(FileStream* fileStream, void* addr, int32_t len)
|
||||
{
|
||||
return fread(addr, 1, len, (FILE*)fileStream);
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
T_FileStream_write(FileStream* fileStream, const void* addr, int32_t len)
|
||||
{
|
||||
|
||||
return fwrite(addr, 1, len, (FILE*)fileStream);
|
||||
}
|
||||
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
T_FileStream_rewind(FileStream* fileStream)
|
||||
{
|
||||
rewind((FILE*)fileStream);
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
T_FileStream_putc(FileStream* fileStream, int32_t ch)
|
||||
{
|
||||
int32_t c = fputc(ch, (FILE*)fileStream);
|
||||
return c;
|
||||
}
|
||||
|
||||
U_CAPI int
|
||||
U_CAPI int U_EXPORT2
|
||||
T_FileStream_getc(FileStream* fileStream)
|
||||
{
|
||||
int c = fgetc((FILE*)fileStream);
|
||||
return c;
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
T_FileStream_ungetc(int32_t ch, FileStream* fileStream)
|
||||
{
|
||||
|
||||
|
@ -138,27 +138,26 @@ T_FileStream_ungetc(int32_t ch, FileStream* fileStream)
|
|||
return c;
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
T_FileStream_peek(FileStream* fileStream)
|
||||
{
|
||||
int32_t c = fgetc((FILE*)fileStream);
|
||||
return ungetc(c, (FILE*)fileStream);
|
||||
}
|
||||
|
||||
/*Added by Bertrand A. D. */
|
||||
U_CAPI char *
|
||||
U_CAPI char* U_EXPORT2
|
||||
T_FileStream_readLine(FileStream* fileStream, char* buffer, int32_t length)
|
||||
{
|
||||
return fgets(buffer, length, (FILE*)fileStream);
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
T_FileStream_writeLine(FileStream* fileStream, const char* buffer)
|
||||
{
|
||||
return fputs(buffer, (FILE*)fileStream);
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
T_FileStream_size(FileStream* fileStream)
|
||||
{
|
||||
int32_t savedPos = ftell((FILE*)fileStream);
|
||||
|
@ -172,19 +171,19 @@ T_FileStream_size(FileStream* fileStream)
|
|||
return size;
|
||||
}
|
||||
|
||||
U_CAPI int
|
||||
U_CAPI int U_EXPORT2
|
||||
T_FileStream_eof(FileStream* fileStream)
|
||||
{
|
||||
return feof((FILE*)fileStream);
|
||||
}
|
||||
|
||||
U_CAPI int
|
||||
U_CAPI int U_EXPORT2
|
||||
T_FileStream_error(FileStream* fileStream)
|
||||
{
|
||||
return (fileStream == 0 || ferror((FILE*)fileStream));
|
||||
}
|
||||
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
T_FileStream_setError(FileStream* fileStream)
|
||||
{
|
||||
/* force the stream to set its error flag*/
|
||||
|
@ -192,20 +191,20 @@ T_FileStream_setError(FileStream* fileStream)
|
|||
}
|
||||
|
||||
|
||||
U_CAPI FileStream*
|
||||
U_CAPI FileStream* U_EXPORT2
|
||||
T_FileStream_stdin(void)
|
||||
{
|
||||
return (FileStream*)stdin;
|
||||
}
|
||||
|
||||
U_CAPI FileStream*
|
||||
U_CAPI FileStream* U_EXPORT2
|
||||
T_FileStream_stdout(void)
|
||||
{
|
||||
return (FileStream*)stdout;
|
||||
}
|
||||
|
||||
|
||||
U_CAPI FileStream*
|
||||
U_CAPI FileStream* U_EXPORT2
|
||||
T_FileStream_stderr(void)
|
||||
{
|
||||
return (FileStream*)stderr;
|
||||
|
|
|
@ -101,7 +101,7 @@ const _localeToDefaultCharmapTable [] =
|
|||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
U_CAPI const char *
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uprv_defaultCodePageForLocale(const char *locale)
|
||||
{
|
||||
int32_t i;
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
#ifndef LOCMAP_H
|
||||
#define LOCMAP_H
|
||||
|
||||
U_CAPI const char *uprv_defaultCodePageForLocale(const char *locale);
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uprv_defaultCodePageForLocale(const char *locale);
|
||||
|
||||
#ifdef WIN32
|
||||
#define LANGUAGE_LCID(hostID) (uint16_t)(0x03FF & hostID)
|
||||
|
|
|
@ -177,7 +177,7 @@ static char* u_bottomNBytesOfDouble(double* d, int n);
|
|||
---------------------------------------------------------------------------*/
|
||||
|
||||
/* Get UTC (GMT) time measured in seconds since 0:00 on 1/1/70.*/
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uprv_getUTCtime()
|
||||
{
|
||||
#ifdef XP_MAC
|
||||
|
@ -211,7 +211,7 @@ uprv_getUTCtime()
|
|||
for getNaN and getInfinity, and false for isNaN and isInfinite.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uprv_isNaN(double number)
|
||||
{
|
||||
#if IEEE_754
|
||||
|
@ -255,7 +255,7 @@ uprv_isNaN(double number)
|
|||
#endif
|
||||
}
|
||||
|
||||
UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uprv_isInfinite(double number)
|
||||
{
|
||||
#if IEEE_754
|
||||
|
@ -295,7 +295,7 @@ uprv_isInfinite(double number)
|
|||
#endif
|
||||
}
|
||||
|
||||
UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uprv_isPositiveInfinity(double number)
|
||||
{
|
||||
#if IEEE_754 || defined(OS390)
|
||||
|
@ -305,7 +305,7 @@ uprv_isPositiveInfinity(double number)
|
|||
#endif
|
||||
}
|
||||
|
||||
UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uprv_isNegativeInfinity(double number)
|
||||
{
|
||||
#if IEEE_754 || defined(OS390)
|
||||
|
@ -319,7 +319,7 @@ uprv_isNegativeInfinity(double number)
|
|||
#endif
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_getNaN()
|
||||
{
|
||||
#if IEEE_754 || defined(OS390)
|
||||
|
@ -344,7 +344,7 @@ uprv_getNaN()
|
|||
#endif
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_getInfinity()
|
||||
{
|
||||
#if IEEE_754 || defined(OS390)
|
||||
|
@ -366,56 +366,56 @@ uprv_getInfinity()
|
|||
#endif
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_floor(double x)
|
||||
{
|
||||
return floor(x);
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_ceil(double x)
|
||||
{
|
||||
return ceil(x);
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_round(double x)
|
||||
{
|
||||
return uprv_floor(x + 0.5);
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_fabs(double x)
|
||||
{
|
||||
return fabs(x);
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_modf(double x, double* y)
|
||||
{
|
||||
return modf(x, y);
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_fmod(double x, double y)
|
||||
{
|
||||
return fmod(x, y);
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_pow(double x, double y)
|
||||
{
|
||||
/* This is declared as "double pow(double x, double y)" */
|
||||
return pow(x, y);
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_pow10(int32_t x)
|
||||
{
|
||||
return pow(10.0, (double)x);
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_fmax(double x, double y)
|
||||
{
|
||||
#if IEEE_754
|
||||
|
@ -436,13 +436,13 @@ uprv_fmax(double x, double y)
|
|||
return (x > y ? x : y);
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uprv_max(int32_t x, int32_t y)
|
||||
{
|
||||
return (x > y ? x : y);
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_fmin(double x, double y)
|
||||
{
|
||||
#if IEEE_754
|
||||
|
@ -463,7 +463,7 @@ uprv_fmin(double x, double y)
|
|||
return (x > y ? y : x);
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uprv_min(int32_t x, int32_t y)
|
||||
{
|
||||
return (x > y ? y : x);
|
||||
|
@ -476,7 +476,7 @@ uprv_min(int32_t x, int32_t y)
|
|||
* floor(3.3) = 3, floor(-3.3) = -4
|
||||
* ceil(3.3) = 4, ceil(-3.3) = -3
|
||||
*/
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_trunc(double d)
|
||||
{
|
||||
#if IEEE_754
|
||||
|
@ -513,7 +513,7 @@ uprv_longBitsFromDouble(double d, int32_t *hi, uint32_t *lo)
|
|||
* Return the largest positive number that can be represented by an integer
|
||||
* type of arbitrary bit length.
|
||||
*/
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_maxMantissa(void)
|
||||
{
|
||||
return pow(2.0, DBL_MANT_DIG + 1.0) - 1.0;
|
||||
|
@ -526,7 +526,7 @@ uprv_maxMantissa(void)
|
|||
* must be positive and finite.
|
||||
* (Thanks to Alan Liu for supplying this function.)
|
||||
*/
|
||||
int16_t
|
||||
U_CAPI int16_t U_EXPORT2
|
||||
uprv_log10(double d)
|
||||
{
|
||||
#ifdef OS400
|
||||
|
@ -553,13 +553,13 @@ uprv_log10(double d)
|
|||
#endif
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_log(double d)
|
||||
{
|
||||
return log(d);
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uprv_digitsAfterDecimal(double x)
|
||||
{
|
||||
char buffer[20];
|
||||
|
@ -602,7 +602,7 @@ uprv_digitsAfterDecimal(double x)
|
|||
return numDigits;
|
||||
}
|
||||
|
||||
double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_nextDouble(double d, UBool next)
|
||||
{
|
||||
#if IEEE_754
|
||||
|
@ -735,7 +735,7 @@ static char* u_bottomNBytesOfDouble(double* d, int n)
|
|||
---------------------------------------------------------------------------*/
|
||||
|
||||
/* Time zone utilities */
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
uprv_tzset()
|
||||
{
|
||||
#ifdef U_TZSET
|
||||
|
@ -745,7 +745,7 @@ uprv_tzset()
|
|||
#endif
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uprv_timezone()
|
||||
{
|
||||
#if U_HAVE_TIMEZONE
|
||||
|
@ -771,7 +771,7 @@ uprv_timezone()
|
|||
#endif
|
||||
}
|
||||
|
||||
char*
|
||||
U_CAPI char* U_EXPORT2
|
||||
uprv_tzname(int n)
|
||||
{
|
||||
#ifdef U_TZNAME
|
||||
|
@ -1080,7 +1080,7 @@ static const char *uprv_getPOSIXID()
|
|||
}
|
||||
#endif
|
||||
|
||||
const char*
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uprv_getDefaultLocaleID()
|
||||
{
|
||||
#if U_POSIX_LOCALE
|
||||
|
@ -1354,7 +1354,8 @@ The leftmost codepage (.xxx) wins.
|
|||
|
||||
}
|
||||
|
||||
const char* uprv_getDefaultCodepage()
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uprv_getDefaultCodepage()
|
||||
{
|
||||
#if defined(OS400)
|
||||
uint32_t ccsid = 37; /* Default to ibm-37 */
|
||||
|
@ -1622,7 +1623,7 @@ u_UCharsToChars(const UChar *us, char *cs, UTextOffset length) {
|
|||
|
||||
/* end of platform-specific implementation */
|
||||
|
||||
U_CFUNC void
|
||||
U_CAPI void U_EXPORT2
|
||||
u_versionFromString(UVersionInfo versionArray, const char *versionString) {
|
||||
char *end;
|
||||
uint16_t part=0;
|
||||
|
|
|
@ -228,14 +228,14 @@ static const int32_t sOffsets [] = {
|
|||
};
|
||||
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
scsu_init(UnicodeCompressor *comp)
|
||||
{
|
||||
/* initialize to defaults*/
|
||||
scsu_reset(comp);
|
||||
}
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
scsu_compress(UnicodeCompressor *comp,
|
||||
uint8_t **target,
|
||||
const uint8_t *targetLimit,
|
||||
|
@ -834,7 +834,7 @@ scsu_compress(UnicodeCompressor *comp,
|
|||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
}
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
scsu_decompress(UnicodeCompressor *comp,
|
||||
UChar **target,
|
||||
const UChar *targetLimit,
|
||||
|
@ -1228,7 +1228,7 @@ scsu_decompress(UnicodeCompressor *comp,
|
|||
}
|
||||
|
||||
/** Reset the compressor to its initial state. */
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
scsu_reset(UnicodeCompressor *comp)
|
||||
{
|
||||
int32_t i;
|
||||
|
|
|
@ -500,7 +500,7 @@ u_iscntrl(UChar32 c) {
|
|||
}
|
||||
|
||||
/* Checks if the Unicode character is a space character.*/
|
||||
UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
u_isspace(UChar32 c) {
|
||||
return (UBool)(((1UL<<GET_CATEGORY(GET_PROPS(c)))&
|
||||
(1UL<<U_SPACE_SEPARATOR|1UL<<U_LINE_SEPARATOR|1UL<<U_PARAGRAPH_SEPARATOR)
|
||||
|
@ -914,7 +914,7 @@ static const UBlockCodeMap blockCodeIndex[UBLOCK_CODE_INDEX_SIZE] = {
|
|||
};
|
||||
|
||||
/* Get the script associated with the character*/
|
||||
UBlockCode
|
||||
U_CAPI UBlockCode U_EXPORT2
|
||||
ublock_getCode(UChar32 codepoint)
|
||||
{
|
||||
/* binary search the map and return the code */
|
||||
|
@ -991,7 +991,7 @@ static const UChar cellWidthValues[] =
|
|||
|
||||
#define NUM_CELL_WIDTH_VALUES (sizeof(cellWidthValues)/sizeof(cellWidthValues[0]))
|
||||
/* Gets table cell width of the Unicode character.*/
|
||||
uint16_t
|
||||
U_CAPI uint16_t U_EXPORT2
|
||||
u_charCellWidth(UChar32 ch)
|
||||
{
|
||||
int16_t i;
|
||||
|
@ -1030,7 +1030,8 @@ u_charCellWidth(UChar32 ch)
|
|||
}
|
||||
}
|
||||
|
||||
void u_getUnicodeVersion(UVersionInfo versionArray) {
|
||||
U_CAPI void U_EXPORT2
|
||||
u_getUnicodeVersion(UVersionInfo versionArray) {
|
||||
if(versionArray!=NULL) {
|
||||
if(HAVE_DATA) {
|
||||
uprv_memcpy(versionArray, dataVersion, U_MAX_VERSION_LENGTH);
|
||||
|
|
|
@ -35,7 +35,8 @@ ucln_registerCleanup(ECleanupLibraryType type,
|
|||
}
|
||||
}
|
||||
|
||||
void u_cleanup(void)
|
||||
U_CAPI void U_EXPORT2
|
||||
u_cleanup(void)
|
||||
{
|
||||
|
||||
ECleanupLibraryType libType = UCLN_START;
|
||||
|
|
|
@ -18,9 +18,14 @@ static int32_t findOverlappingPosition(CompactByteArray* this_obj,
|
|||
/* internal constants*/
|
||||
|
||||
|
||||
int32_t ucmp8_getkUnicodeCount() { return UCMP8_kUnicodeCount;}
|
||||
int32_t ucmp8_getkBlockCount() { return UCMP8_kBlockCount;}
|
||||
void ucmp8_initBogus(CompactByteArray* array)
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucmp8_getkUnicodeCount() { return UCMP8_kUnicodeCount;}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucmp8_getkBlockCount() { return UCMP8_kBlockCount;}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmp8_initBogus(CompactByteArray* array)
|
||||
{
|
||||
CompactByteArray* this_obj = array;
|
||||
|
||||
|
@ -38,7 +43,8 @@ void ucmp8_initBogus(CompactByteArray* array)
|
|||
|
||||
/* debug flags*/
|
||||
/*=======================================================*/
|
||||
void ucmp8_init(CompactByteArray* array, int8_t defaultValue)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmp8_init(CompactByteArray* array, int8_t defaultValue)
|
||||
{
|
||||
/* set up the index array and the data array.
|
||||
* the index array always points into particular parts of the data array
|
||||
|
@ -99,7 +105,8 @@ void ucmp8_init(CompactByteArray* array, int8_t defaultValue)
|
|||
}
|
||||
}
|
||||
|
||||
CompactByteArray* ucmp8_open(int8_t defaultValue)
|
||||
U_CAPI CompactByteArray* U_EXPORT2
|
||||
ucmp8_open(int8_t defaultValue)
|
||||
{
|
||||
/* set up the index array and the data array.
|
||||
* the index array always points into particular parts of the data array
|
||||
|
@ -163,7 +170,8 @@ CompactByteArray* ucmp8_open(int8_t defaultValue)
|
|||
return this_obj;
|
||||
}
|
||||
|
||||
CompactByteArray* ucmp8_openAdopt(uint16_t *indexArray,
|
||||
U_CAPI CompactByteArray* U_EXPORT2
|
||||
ucmp8_openAdopt(uint16_t *indexArray,
|
||||
int8_t *newValues,
|
||||
int32_t count)
|
||||
{
|
||||
|
@ -174,7 +182,8 @@ CompactByteArray* ucmp8_openAdopt(uint16_t *indexArray,
|
|||
return this_obj;
|
||||
}
|
||||
|
||||
CompactByteArray* ucmp8_openAlias(uint16_t *indexArray,
|
||||
U_CAPI CompactByteArray* U_EXPORT2
|
||||
ucmp8_openAlias(uint16_t *indexArray,
|
||||
int8_t *newValues,
|
||||
int32_t count)
|
||||
{
|
||||
|
@ -187,7 +196,8 @@ CompactByteArray* ucmp8_openAlias(uint16_t *indexArray,
|
|||
|
||||
/*=======================================================*/
|
||||
|
||||
CompactByteArray* ucmp8_initAdopt(CompactByteArray *this_obj,
|
||||
U_CAPI CompactByteArray* U_EXPORT2
|
||||
ucmp8_initAdopt(CompactByteArray *this_obj,
|
||||
uint16_t *indexArray,
|
||||
int8_t *newValues,
|
||||
int32_t count)
|
||||
|
@ -207,7 +217,8 @@ CompactByteArray* ucmp8_initAdopt(CompactByteArray *this_obj,
|
|||
return this_obj;
|
||||
}
|
||||
|
||||
CompactByteArray* ucmp8_initAlias(CompactByteArray *this_obj,
|
||||
U_CAPI CompactByteArray* U_EXPORT2
|
||||
ucmp8_initAlias(CompactByteArray *this_obj,
|
||||
uint16_t *indexArray,
|
||||
int8_t *newValues,
|
||||
int32_t count)
|
||||
|
@ -231,7 +242,8 @@ CompactByteArray* ucmp8_initAlias(CompactByteArray *this_obj,
|
|||
|
||||
/*=======================================================*/
|
||||
|
||||
void ucmp8_close(CompactByteArray* this_obj)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmp8_close(CompactByteArray* this_obj)
|
||||
{
|
||||
if(this_obj != NULL) {
|
||||
if(!this_obj->fAlias) {
|
||||
|
@ -252,7 +264,8 @@ void ucmp8_close(CompactByteArray* this_obj)
|
|||
|
||||
/*=======================================================*/
|
||||
|
||||
void ucmp8_expand(CompactByteArray* this_obj)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmp8_expand(CompactByteArray* this_obj)
|
||||
{
|
||||
/* can optimize later.
|
||||
* if we have to expand, then walk through the blocks instead of using Get
|
||||
|
@ -334,32 +347,32 @@ findOverlappingPosition(CompactByteArray* this_obj,
|
|||
return i;
|
||||
}
|
||||
|
||||
UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
ucmp8_isBogus(const CompactByteArray* this_obj)
|
||||
{
|
||||
return (UBool)(this_obj == NULL || this_obj->fBogus);
|
||||
}
|
||||
|
||||
const int8_t*
|
||||
U_CAPI const int8_t* U_EXPORT2
|
||||
ucmp8_getArray(const CompactByteArray* this_obj)
|
||||
{
|
||||
return this_obj->fArray;
|
||||
}
|
||||
|
||||
const uint16_t*
|
||||
U_CAPI const uint16_t* U_EXPORT2
|
||||
ucmp8_getIndex(const CompactByteArray* this_obj)
|
||||
{
|
||||
return this_obj->fIndex;
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucmp8_getCount(const CompactByteArray* this_obj)
|
||||
{
|
||||
return this_obj->fCount;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmp8_set(CompactByteArray* this_obj,
|
||||
UChar c,
|
||||
int8_t value)
|
||||
|
@ -373,7 +386,7 @@ ucmp8_set(CompactByteArray* this_obj,
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmp8_setRange(CompactByteArray* this_obj,
|
||||
UChar start,
|
||||
UChar end,
|
||||
|
@ -394,7 +407,7 @@ ucmp8_setRange(CompactByteArray* this_obj,
|
|||
|
||||
/*=======================================================*/
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmp8_compact(CompactByteArray* this_obj,
|
||||
uint32_t cycle)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
/* builder data ------------------------------------------------------------- */
|
||||
|
||||
CompactEIntArray*
|
||||
U_CAPI CompactEIntArray* U_EXPORT2
|
||||
ucmpe32_open(int32_t defaultValue, int32_t surrogateValue, int32_t leadSurrogateValue, UErrorCode *status)
|
||||
{
|
||||
int32_t *bla;
|
||||
|
@ -83,7 +83,7 @@ ucmpe32_open(int32_t defaultValue, int32_t surrogateValue, int32_t leadSurrogate
|
|||
/*
|
||||
* Set a range of UnicodeChars to the same value
|
||||
*/
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmpe32_setRange32(CompactEIntArray* this_obj, UChar32 start, UChar32 end, int32_t value) {
|
||||
UChar32 code = 0;
|
||||
|
||||
|
@ -130,7 +130,7 @@ ucmpe32_setRange32(CompactEIntArray* this_obj, UChar32 start, UChar32 end, int32
|
|||
}
|
||||
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucmpe32_get32(CompactEIntArray* this_obj, UChar32 code) {
|
||||
int16_t stage1 = (this_obj->stage1[(code >> _UCMPE32_TRIE_SHIFT)]);
|
||||
int32_t offset = (code & _UCMPE32_STAGE_2_MASK);
|
||||
|
@ -141,7 +141,7 @@ ucmpe32_get32(CompactEIntArray* this_obj, UChar32 code) {
|
|||
}
|
||||
|
||||
/********* THIS IS THE ADD FUNCTION ********************/
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmpe32_set32(CompactEIntArray* this_obj, UChar32 code, int32_t value)
|
||||
{
|
||||
uint16_t stage2Block, k;
|
||||
|
@ -185,7 +185,7 @@ ucmpe32_set32(CompactEIntArray* this_obj, UChar32 code, int32_t value)
|
|||
this_obj->stage2[k] = value;
|
||||
}
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmpe32_setSurrogate(CompactEIntArray* this_obj, UChar lead, UChar trail, int32_t value)
|
||||
{
|
||||
if (this_obj->fCompact == TRUE) {
|
||||
|
@ -284,7 +284,7 @@ foldSupplementary(CompactEIntArray* this_obj, int32_t top) {
|
|||
return top;
|
||||
}
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmpe32_compact(CompactEIntArray* this_obj) {
|
||||
|
||||
if(this_obj->fCompact == FALSE) { /* compacting can be done only once */
|
||||
|
@ -346,7 +346,7 @@ ucmpe32_compact(CompactEIntArray* this_obj) {
|
|||
}
|
||||
|
||||
|
||||
CompactEIntArray*
|
||||
U_CAPI CompactEIntArray* U_EXPORT2
|
||||
ucmpe32_clone(CompactEIntArray* orig, UErrorCode *status)
|
||||
{
|
||||
CompactEIntArray* this_obj = NULL;
|
||||
|
@ -395,7 +395,7 @@ ucmpe32_clone(CompactEIntArray* orig, UErrorCode *status)
|
|||
}
|
||||
|
||||
|
||||
CompactEIntArray*
|
||||
U_CAPI CompactEIntArray* U_EXPORT2
|
||||
ucmpe32_openFromData( const uint8_t **source,
|
||||
UErrorCode *status)
|
||||
{
|
||||
|
@ -444,7 +444,7 @@ ucmpe32_openFromData( const uint8_t **source,
|
|||
return this_obj;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
U_CAPI uint32_t U_EXPORT2
|
||||
ucmpe32_flattenMem (const CompactEIntArray* this_obj, UMemoryStream *MS)
|
||||
{
|
||||
/* This dumps stuff in memory */
|
||||
|
@ -473,7 +473,8 @@ ucmpe32_flattenMem (const CompactEIntArray* this_obj, UMemoryStream *MS)
|
|||
|
||||
/*=======================================================*/
|
||||
|
||||
void ucmpe32_close(CompactEIntArray* this_obj)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmpe32_close(CompactEIntArray* this_obj)
|
||||
{
|
||||
if(this_obj != NULL) {
|
||||
if(this_obj->fAlias == FALSE) {
|
||||
|
@ -488,7 +489,7 @@ void ucmpe32_close(CompactEIntArray* this_obj)
|
|||
}
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucmpe32_getSurrogateEx(CompactEIntArray *array, UChar lead, UChar trail) {
|
||||
if(array->fCompact == FALSE) {
|
||||
return(ucmpe32_get(array, (int32_t)UTF16_GET_PAIR_VALUE(lead, trail)));
|
||||
|
|
|
@ -122,8 +122,7 @@ U_CAPI void U_EXPORT2 ucmpe32_close(CompactEIntArray* array);
|
|||
*/
|
||||
#define ucmpe32_get(this_obj, index) (this_obj->stage2[(this_obj->stage1[(index >> _UCMPE32_TRIE_SHIFT)] )+ \
|
||||
(index & _UCMPE32_STAGE_2_MASK)])
|
||||
U_CAPI
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucmpe32_get32(CompactEIntArray* this_obj, UChar32 code);
|
||||
|
||||
/**
|
||||
|
@ -162,7 +161,7 @@ U_CAPI void U_EXPORT2 ucmpe32_set32(CompactEIntArray *array,
|
|||
* @param end end of the range
|
||||
* @param value value to be set
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucmpe32_setRange32(CompactEIntArray* this_obj, UChar32 start, UChar32 end, int32_t value);
|
||||
|
||||
/**
|
||||
|
|
|
@ -70,17 +70,20 @@ static const UAmbiguousConverter ambiguousConverters[]={
|
|||
{ "ISO_2022,locale=ko,version=0", 0x20a9 }
|
||||
};
|
||||
|
||||
const char* ucnv_getDefaultName ()
|
||||
U_CAPI const char* U_EXPORT2
|
||||
ucnv_getDefaultName ()
|
||||
{
|
||||
return ucnv_io_getDefaultConverterName();
|
||||
}
|
||||
|
||||
void ucnv_setDefaultName (const char *converterName)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_setDefaultName (const char *converterName)
|
||||
{
|
||||
ucnv_io_setDefaultConverterName(converterName);
|
||||
}
|
||||
/*Calls through createConverter */
|
||||
UConverter* ucnv_open (const char *name,
|
||||
U_CAPI UConverter* U_EXPORT2
|
||||
ucnv_open (const char *name,
|
||||
UErrorCode * err)
|
||||
{
|
||||
if (err == NULL || U_FAILURE (*err)) {
|
||||
|
@ -91,7 +94,8 @@ UConverter* ucnv_open (const char *name,
|
|||
}
|
||||
|
||||
/*Extracts the UChar* to a char* and calls through createConverter */
|
||||
UConverter* ucnv_openU (const UChar * name,
|
||||
U_CAPI UConverter* U_EXPORT2
|
||||
ucnv_openU (const UChar * name,
|
||||
UErrorCode * err)
|
||||
{
|
||||
char asciiName[UCNV_MAX_CONVERTER_NAME_LENGTH];
|
||||
|
@ -110,9 +114,10 @@ UConverter* ucnv_openU (const UChar * name,
|
|||
|
||||
/*Assumes a $platform-#codepage.$CONVERTER_FILE_EXTENSION scheme and calls
|
||||
*through createConverter*/
|
||||
UConverter* ucnv_openCCSID (int32_t codepage,
|
||||
UConverterPlatform platform,
|
||||
UErrorCode * err)
|
||||
U_CAPI UConverter* U_EXPORT2
|
||||
ucnv_openCCSID (int32_t codepage,
|
||||
UConverterPlatform platform,
|
||||
UErrorCode * err)
|
||||
{
|
||||
char myName[UCNV_MAX_CONVERTER_NAME_LENGTH];
|
||||
int32_t myNameLen;
|
||||
|
@ -133,7 +138,8 @@ UConverter* ucnv_openCCSID (int32_t codepage,
|
|||
and created from a converter that is shared across threads.
|
||||
*/
|
||||
|
||||
UConverter *ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
|
||||
U_CAPI UConverter* U_EXPORT2
|
||||
ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status)
|
||||
{
|
||||
UConverter * localConverter;
|
||||
int32_t bufferSizeNeeded;
|
||||
|
@ -199,7 +205,8 @@ UConverter *ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pB
|
|||
/*Decreases the reference counter in the shared immutable section of the object
|
||||
*and frees the mutable part*/
|
||||
|
||||
void ucnv_close (UConverter * converter)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_close (UConverter * converter)
|
||||
{
|
||||
/* first, notify the callback functions that the converter is closed */
|
||||
UConverterToUnicodeArgs toUArgs = {
|
||||
|
@ -253,7 +260,8 @@ void ucnv_close (UConverter * converter)
|
|||
|
||||
/*returns a single Name from the list, will return NULL if out of bounds
|
||||
*/
|
||||
const char* ucnv_getAvailableName (int32_t n)
|
||||
U_CAPI const char* U_EXPORT2
|
||||
ucnv_getAvailableName (int32_t n)
|
||||
{
|
||||
if (0 <= n && n <= 0xffff) {
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
@ -265,13 +273,14 @@ const char* ucnv_getAvailableName (int32_t n)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int32_t ucnv_countAvailable ()
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucnv_countAvailable ()
|
||||
{
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
return ucnv_io_countAvailableConverters(&err);
|
||||
}
|
||||
|
||||
U_CAPI uint16_t
|
||||
U_CAPI uint16_t U_EXPORT2
|
||||
ucnv_countAliases(const char *alias, UErrorCode *pErrorCode)
|
||||
{
|
||||
const char *p;
|
||||
|
@ -279,13 +288,13 @@ ucnv_countAliases(const char *alias, UErrorCode *pErrorCode)
|
|||
}
|
||||
|
||||
|
||||
U_CAPI const char *
|
||||
U_CAPI const char* U_EXPORT2
|
||||
ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode)
|
||||
{
|
||||
return ucnv_io_getAlias(alias, n, pErrorCode);
|
||||
}
|
||||
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode)
|
||||
{
|
||||
const char *p;
|
||||
|
@ -298,17 +307,18 @@ ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode)
|
|||
}
|
||||
}
|
||||
|
||||
U_CAPI uint16_t
|
||||
U_CAPI uint16_t U_EXPORT2
|
||||
ucnv_countStandards(void)
|
||||
{
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
return ucnv_io_countStandards(&err);
|
||||
}
|
||||
|
||||
void ucnv_getSubstChars (const UConverter * converter,
|
||||
char *mySubChar,
|
||||
int8_t * len,
|
||||
UErrorCode * err)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_getSubstChars (const UConverter * converter,
|
||||
char *mySubChar,
|
||||
int8_t * len,
|
||||
UErrorCode * err)
|
||||
{
|
||||
if (U_FAILURE (*err))
|
||||
return;
|
||||
|
@ -325,10 +335,11 @@ void ucnv_getSubstChars (const UConverter * converter,
|
|||
*len = converter->subCharLen; /*store # of bytes copied to buffer */
|
||||
}
|
||||
|
||||
void ucnv_setSubstChars (UConverter * converter,
|
||||
const char *mySubChar,
|
||||
int8_t len,
|
||||
UErrorCode * err)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_setSubstChars (UConverter * converter,
|
||||
const char *mySubChar,
|
||||
int8_t len,
|
||||
UErrorCode * err)
|
||||
{
|
||||
if (U_FAILURE (*err))
|
||||
return;
|
||||
|
@ -354,7 +365,7 @@ void ucnv_setSubstChars (UConverter * converter,
|
|||
return;
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucnv_getDisplayName(const UConverter *cnv,
|
||||
const char *displayLocale,
|
||||
UChar *displayName, int32_t displayNameCapacity,
|
||||
|
@ -454,33 +465,39 @@ static void _reset(UConverter *converter, UConverterResetChoice choice) {
|
|||
}
|
||||
}
|
||||
|
||||
void ucnv_reset(UConverter *converter)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_reset(UConverter *converter)
|
||||
{
|
||||
_reset(converter, UCNV_RESET_BOTH);
|
||||
}
|
||||
|
||||
void ucnv_resetToUnicode(UConverter *converter)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_resetToUnicode(UConverter *converter)
|
||||
{
|
||||
_reset(converter, UCNV_RESET_TO_UNICODE);
|
||||
}
|
||||
|
||||
void ucnv_resetFromUnicode(UConverter *converter)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_resetFromUnicode(UConverter *converter)
|
||||
{
|
||||
_reset(converter, UCNV_RESET_FROM_UNICODE);
|
||||
}
|
||||
|
||||
int8_t ucnv_getMaxCharSize (const UConverter * converter)
|
||||
U_CAPI int8_t U_EXPORT2
|
||||
ucnv_getMaxCharSize (const UConverter * converter)
|
||||
{
|
||||
return converter->sharedData->staticData->maxBytesPerChar;
|
||||
}
|
||||
|
||||
|
||||
int8_t ucnv_getMinCharSize (const UConverter * converter)
|
||||
U_CAPI int8_t U_EXPORT2
|
||||
ucnv_getMinCharSize (const UConverter * converter)
|
||||
{
|
||||
return converter->sharedData->staticData->minBytesPerChar;
|
||||
}
|
||||
|
||||
const char* ucnv_getName (const UConverter * converter, UErrorCode * err)
|
||||
U_CAPI const char* U_EXPORT2
|
||||
ucnv_getName (const UConverter * converter, UErrorCode * err)
|
||||
|
||||
{
|
||||
if (U_FAILURE (*err))
|
||||
|
@ -493,7 +510,8 @@ const char* ucnv_getName (const UConverter * converter, UErrorCode * err)
|
|||
return converter->sharedData->staticData->name;
|
||||
}
|
||||
|
||||
int32_t ucnv_getCCSID (const UConverter * converter,
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucnv_getCCSID (const UConverter * converter,
|
||||
UErrorCode * err)
|
||||
{
|
||||
if (U_FAILURE (*err))
|
||||
|
@ -503,7 +521,8 @@ int32_t ucnv_getCCSID (const UConverter * converter,
|
|||
}
|
||||
|
||||
|
||||
UConverterPlatform ucnv_getPlatform (const UConverter * converter,
|
||||
U_CAPI UConverterPlatform U_EXPORT2
|
||||
ucnv_getPlatform (const UConverter * converter,
|
||||
UErrorCode * err)
|
||||
{
|
||||
if (U_FAILURE (*err))
|
||||
|
@ -530,7 +549,8 @@ U_CAPI void U_EXPORT2
|
|||
*context = converter->fromUContext;
|
||||
}
|
||||
|
||||
void ucnv_setToUCallBack (UConverter * converter,
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_setToUCallBack (UConverter * converter,
|
||||
UConverterToUCallback newAction,
|
||||
const void* newContext,
|
||||
UConverterToUCallback *oldAction,
|
||||
|
@ -545,7 +565,8 @@ void ucnv_setToUCallBack (UConverter * converter,
|
|||
converter->toUContext = newContext;
|
||||
}
|
||||
|
||||
void ucnv_setFromUCallBack (UConverter * converter,
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_setFromUCallBack (UConverter * converter,
|
||||
UConverterFromUCallback newAction,
|
||||
const void* newContext,
|
||||
UConverterFromUCallback *oldAction,
|
||||
|
@ -560,7 +581,8 @@ void ucnv_setFromUCallBack (UConverter * converter,
|
|||
converter->fromUContext = newContext;
|
||||
}
|
||||
|
||||
void ucnv_fromUnicode (UConverter * _this,
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_fromUnicode (UConverter * _this,
|
||||
char **target,
|
||||
const char *targetLimit,
|
||||
const UChar ** source,
|
||||
|
@ -655,14 +677,15 @@ void ucnv_fromUnicode (UConverter * _this,
|
|||
|
||||
|
||||
|
||||
void ucnv_toUnicode (UConverter * _this,
|
||||
UChar ** target,
|
||||
const UChar * targetLimit,
|
||||
const char **source,
|
||||
const char *sourceLimit,
|
||||
int32_t* offsets,
|
||||
UBool flush,
|
||||
UErrorCode * err)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_toUnicode (UConverter * _this,
|
||||
UChar ** target,
|
||||
const UChar * targetLimit,
|
||||
const char **source,
|
||||
const char *sourceLimit,
|
||||
int32_t* offsets,
|
||||
UBool flush,
|
||||
UErrorCode * err)
|
||||
{
|
||||
UConverterToUnicodeArgs args;
|
||||
const UChar *t;
|
||||
|
@ -745,7 +768,7 @@ void ucnv_toUnicode (UConverter * _this,
|
|||
return;
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucnv_fromUChars(UConverter *cnv,
|
||||
char *dest, int32_t destCapacity,
|
||||
const UChar *src, int32_t srcLength,
|
||||
|
@ -805,7 +828,7 @@ ucnv_fromUChars(UConverter *cnv,
|
|||
return u_terminateChars(originalDest, destCapacity, destLength, pErrorCode);
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucnv_toUChars(UConverter *cnv,
|
||||
UChar *dest, int32_t destCapacity,
|
||||
const char *src, int32_t srcLength,
|
||||
|
@ -867,10 +890,11 @@ ucnv_toUChars(UConverter *cnv,
|
|||
return u_terminateUChars(originalDest, destCapacity, destLength, pErrorCode);
|
||||
}
|
||||
|
||||
UChar32 ucnv_getNextUChar(UConverter * converter,
|
||||
const char **source,
|
||||
const char *sourceLimit,
|
||||
UErrorCode * err)
|
||||
U_CAPI UChar32 U_EXPORT2
|
||||
ucnv_getNextUChar(UConverter * converter,
|
||||
const char **source,
|
||||
const char *sourceLimit,
|
||||
UErrorCode * err)
|
||||
{
|
||||
UConverterToUnicodeArgs args;
|
||||
UChar32 ch;
|
||||
|
@ -925,7 +949,7 @@ UChar32 ucnv_getNextUChar(UConverter * converter,
|
|||
return ch;
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucnv_convert(const char *toConverterName, const char *fromConverterName,
|
||||
char *target, int32_t targetSize,
|
||||
const char *source, int32_t sourceSize,
|
||||
|
@ -1072,7 +1096,8 @@ ucnv_convert(const char *toConverterName, const char *fromConverterName,
|
|||
return u_terminateChars(target, targetSize, targetCapacity, pErrorCode);
|
||||
}
|
||||
|
||||
UConverterType ucnv_getType(const UConverter* converter)
|
||||
U_CAPI UConverterType U_EXPORT2
|
||||
ucnv_getType(const UConverter* converter)
|
||||
{
|
||||
int8_t type = converter->sharedData->staticData->conversionType;
|
||||
if(type == UCNV_MBCS) {
|
||||
|
@ -1081,9 +1106,10 @@ UConverterType ucnv_getType(const UConverter* converter)
|
|||
return (UConverterType)type;
|
||||
}
|
||||
|
||||
void ucnv_getStarters(const UConverter* converter,
|
||||
UBool starters[256],
|
||||
UErrorCode* err)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_getStarters(const UConverter* converter,
|
||||
UBool starters[256],
|
||||
UErrorCode* err)
|
||||
{
|
||||
if (err == NULL || U_FAILURE(*err)) {
|
||||
return;
|
||||
|
@ -1123,9 +1149,10 @@ static const UAmbiguousConverter *ucnv_getAmbiguous(const UConverter *cnv)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void ucnv_fixFileSeparator(const UConverter *cnv,
|
||||
UChar* source,
|
||||
int32_t sourceLength) {
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_fixFileSeparator(const UConverter *cnv,
|
||||
UChar* source,
|
||||
int32_t sourceLength) {
|
||||
const UAmbiguousConverter *a;
|
||||
int32_t i;
|
||||
UChar variant5c;
|
||||
|
@ -1143,21 +1170,24 @@ void ucnv_fixFileSeparator(const UConverter *cnv,
|
|||
}
|
||||
}
|
||||
|
||||
UBool ucnv_isAmbiguous(const UConverter *cnv) {
|
||||
U_CAPI UBool U_EXPORT2
|
||||
ucnv_isAmbiguous(const UConverter *cnv) {
|
||||
return (UBool)(ucnv_getAmbiguous(cnv)!=NULL);
|
||||
}
|
||||
|
||||
void ucnv_setFallback(UConverter *cnv, UBool usesFallback)
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_setFallback(UConverter *cnv, UBool usesFallback)
|
||||
{
|
||||
cnv->useFallback = usesFallback;
|
||||
}
|
||||
|
||||
UBool ucnv_usesFallback(const UConverter *cnv)
|
||||
U_CAPI UBool U_EXPORT2
|
||||
ucnv_usesFallback(const UConverter *cnv)
|
||||
{
|
||||
return cnv->useFallback;
|
||||
}
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_getInvalidChars (const UConverter * converter,
|
||||
char *errBytes,
|
||||
int8_t * len,
|
||||
|
@ -1183,7 +1213,7 @@ ucnv_getInvalidChars (const UConverter * converter,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_getInvalidUChars (const UConverter * converter,
|
||||
UChar *errChars,
|
||||
int8_t * len,
|
||||
|
|
|
@ -472,7 +472,7 @@ ucnv_createConverter (const char *converterName, UErrorCode * err)
|
|||
return myUConverter;
|
||||
}
|
||||
|
||||
UConverterSharedData*
|
||||
U_CAPI UConverterSharedData* U_EXPORT2
|
||||
ucnv_data_unFlattenClone(UDataMemory *pData, UErrorCode *status)
|
||||
{
|
||||
/* UDataInfo info; -- necessary only if some converters have different formatVersion */
|
||||
|
@ -539,7 +539,7 @@ ucnv_data_unFlattenClone(UDataMemory *pData, UErrorCode *status)
|
|||
|
||||
/*Frees all shared immutable objects that aren't referred to (reference count = 0)
|
||||
*/
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ucnv_flushCache ()
|
||||
{
|
||||
UConverterSharedData *mySharedData = NULL;
|
||||
|
|
|
@ -117,7 +117,7 @@ struct UConverter {
|
|||
* Error function pointer called when conversion issues
|
||||
* occur during a ucnv_fromUnicode call
|
||||
*/
|
||||
void (*fromUCharErrorBehaviour) (const void *context,
|
||||
void (U_EXPORT2 *fromUCharErrorBehaviour) (const void *context,
|
||||
UConverterFromUnicodeArgs *args,
|
||||
const UChar *codeUnits,
|
||||
int32_t length,
|
||||
|
@ -128,7 +128,7 @@ struct UConverter {
|
|||
* Error function pointer called when conversion issues
|
||||
* occur during a T_UConverter_toUnicode call
|
||||
*/
|
||||
void (*fromCharErrorBehaviour) (const void *context,
|
||||
void (U_EXPORT2 *fromCharErrorBehaviour) (const void *context,
|
||||
UConverterToUnicodeArgs *args,
|
||||
const char *codeUnits,
|
||||
int32_t length,
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
/* Note: Recursion may occur in the cb functions, be sure to update the offsets correctly
|
||||
if you don't use ucnv_cbXXX functions. Make sure you don't use the same callback within
|
||||
the same call stack if the complexity arises. */
|
||||
void ucnv_cbFromUWriteBytes (UConverterFromUnicodeArgs *args,
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_cbFromUWriteBytes (UConverterFromUnicodeArgs *args,
|
||||
const char* source,
|
||||
int32_t length,
|
||||
int32_t offsetIndex,
|
||||
|
@ -80,7 +81,8 @@ void ucnv_cbFromUWriteBytes (UConverterFromUnicodeArgs *args,
|
|||
}
|
||||
}
|
||||
|
||||
void ucnv_cbFromUWriteUChars(UConverterFromUnicodeArgs *args,
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_cbFromUWriteUChars(UConverterFromUnicodeArgs *args,
|
||||
const UChar** source,
|
||||
const UChar* sourceLimit,
|
||||
int32_t offsetIndex,
|
||||
|
@ -200,7 +202,8 @@ void ucnv_cbFromUWriteUChars(UConverterFromUnicodeArgs *args,
|
|||
}
|
||||
}
|
||||
|
||||
void ucnv_cbFromUWriteSub (UConverterFromUnicodeArgs *args,
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_cbFromUWriteSub (UConverterFromUnicodeArgs *args,
|
||||
int32_t offsetIndex,
|
||||
UErrorCode * err)
|
||||
{
|
||||
|
@ -221,7 +224,8 @@ void ucnv_cbFromUWriteSub (UConverterFromUnicodeArgs *args,
|
|||
}
|
||||
}
|
||||
|
||||
void ucnv_cbToUWriteUChars (UConverterToUnicodeArgs *args,
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_cbToUWriteUChars (UConverterToUnicodeArgs *args,
|
||||
const UChar* source,
|
||||
int32_t length,
|
||||
int32_t offsetIndex,
|
||||
|
@ -278,7 +282,8 @@ void ucnv_cbToUWriteUChars (UConverterToUnicodeArgs *args,
|
|||
}
|
||||
}
|
||||
|
||||
void ucnv_cbToUWriteSub (UConverterToUnicodeArgs *args,
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_cbToUWriteSub (UConverterToUnicodeArgs *args,
|
||||
int32_t offsetIndex,
|
||||
UErrorCode * err)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,8 @@
|
|||
|
||||
|
||||
/*Function Pointer STOPS at the ILLEGAL_SEQUENCE */
|
||||
void UCNV_FROM_U_CALLBACK_STOP (
|
||||
U_CAPI void U_EXPORT2
|
||||
UCNV_FROM_U_CALLBACK_STOP (
|
||||
const void *context,
|
||||
UConverterFromUnicodeArgs *fromUArgs,
|
||||
const UChar* codeUnits,
|
||||
|
@ -56,7 +57,8 @@ void UCNV_FROM_U_CALLBACK_STOP (
|
|||
|
||||
|
||||
/*Function Pointer STOPS at the ILLEGAL_SEQUENCE */
|
||||
void UCNV_TO_U_CALLBACK_STOP (
|
||||
U_CAPI void U_EXPORT2
|
||||
UCNV_TO_U_CALLBACK_STOP (
|
||||
const void *context,
|
||||
UConverterToUnicodeArgs *toUArgs,
|
||||
const char* codePoints,
|
||||
|
@ -68,7 +70,8 @@ void UCNV_TO_U_CALLBACK_STOP (
|
|||
return;
|
||||
}
|
||||
|
||||
void UCNV_FROM_U_CALLBACK_SKIP (
|
||||
U_CAPI void U_EXPORT2
|
||||
UCNV_FROM_U_CALLBACK_SKIP (
|
||||
const void *context,
|
||||
UConverterFromUnicodeArgs *fromUArgs,
|
||||
const UChar* codeUnits,
|
||||
|
@ -103,7 +106,8 @@ void UCNV_FROM_U_CALLBACK_SKIP (
|
|||
}
|
||||
}
|
||||
|
||||
void UCNV_FROM_U_CALLBACK_SUBSTITUTE (
|
||||
U_CAPI void U_EXPORT2
|
||||
UCNV_FROM_U_CALLBACK_SUBSTITUTE (
|
||||
const void *context,
|
||||
UConverterFromUnicodeArgs *fromArgs,
|
||||
const UChar* codeUnits,
|
||||
|
@ -146,7 +150,8 @@ void UCNV_FROM_U_CALLBACK_SUBSTITUTE (
|
|||
*escape sequence to the target codepage (if conversion failure happens then
|
||||
*we revert to substituting with subchar)
|
||||
*/
|
||||
void UCNV_FROM_U_CALLBACK_ESCAPE (
|
||||
U_CAPI void U_EXPORT2
|
||||
UCNV_FROM_U_CALLBACK_ESCAPE (
|
||||
const void *context,
|
||||
UConverterFromUnicodeArgs *fromArgs,
|
||||
const UChar *codeUnits,
|
||||
|
@ -289,7 +294,8 @@ void UCNV_FROM_U_CALLBACK_ESCAPE (
|
|||
|
||||
|
||||
|
||||
void UCNV_TO_U_CALLBACK_SKIP (
|
||||
U_CAPI void U_EXPORT2
|
||||
UCNV_TO_U_CALLBACK_SKIP (
|
||||
const void *context,
|
||||
UConverterToUnicodeArgs *toArgs,
|
||||
const char* codeUnits,
|
||||
|
@ -323,7 +329,8 @@ void UCNV_TO_U_CALLBACK_SKIP (
|
|||
}
|
||||
}
|
||||
|
||||
void UCNV_TO_U_CALLBACK_SUBSTITUTE (
|
||||
U_CAPI void U_EXPORT2
|
||||
UCNV_TO_U_CALLBACK_SUBSTITUTE (
|
||||
const void *context,
|
||||
UConverterToUnicodeArgs *toArgs,
|
||||
const char* codeUnits,
|
||||
|
@ -364,7 +371,8 @@ void UCNV_TO_U_CALLBACK_SUBSTITUTE (
|
|||
/*uses uprv_itou to get a unicode escape sequence of the offensive sequence,
|
||||
*and uses that as the substitution sequence
|
||||
*/
|
||||
void UCNV_TO_U_CALLBACK_ESCAPE (
|
||||
U_CAPI void U_EXPORT2
|
||||
UCNV_TO_U_CALLBACK_ESCAPE (
|
||||
const void *context,
|
||||
UConverterToUnicodeArgs *toArgs,
|
||||
const char* codeUnits,
|
||||
|
|
|
@ -242,14 +242,13 @@ typedef struct DataCacheElement {
|
|||
* udata cleanup function closes the hash table; hash table in turn calls back to
|
||||
* here for each entry.
|
||||
*/
|
||||
static void U_CALLCONV DataCacheElement_deleter(void *pDCEl) {
|
||||
static void U_EXPORT2 U_CALLCONV DataCacheElement_deleter(void *pDCEl) {
|
||||
DataCacheElement *p = (DataCacheElement *)pDCEl;
|
||||
udata_close(p->item); /* unmaps storage */
|
||||
uprv_free(p->name); /* delete the hash key string. */
|
||||
uprv_free(pDCEl); /* delete 'this' */
|
||||
}
|
||||
|
||||
|
||||
/* udata_getCacheHashTable()
|
||||
* Get the hash table used to store the data cache entries.
|
||||
* Lazy create it if it doesn't yet exist.
|
||||
|
|
|
@ -188,14 +188,14 @@ static void _uhash_internalSetResizePolicy(UHashtable *hash, enum UHashResizePol
|
|||
* PUBLIC API
|
||||
********************************************************************/
|
||||
|
||||
U_CAPI UHashtable*
|
||||
U_CAPI UHashtable* U_EXPORT2
|
||||
uhash_open(UHashFunction keyHash, UKeyComparator keyComp,
|
||||
UErrorCode *status) {
|
||||
|
||||
return _uhash_create(keyHash, keyComp, 3, status);
|
||||
}
|
||||
|
||||
U_CAPI UHashtable*
|
||||
U_CAPI UHashtable* U_EXPORT2
|
||||
uhash_openSize(UHashFunction keyHash, UKeyComparator keyComp,
|
||||
int32_t size,
|
||||
UErrorCode *status) {
|
||||
|
@ -209,7 +209,7 @@ uhash_openSize(UHashFunction keyHash, UKeyComparator keyComp,
|
|||
return _uhash_create(keyHash, keyComp, i, status);
|
||||
}
|
||||
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_close(UHashtable *hash) {
|
||||
assert(hash != NULL);
|
||||
if (hash->elements != NULL) {
|
||||
|
@ -226,35 +226,35 @@ uhash_close(UHashtable *hash) {
|
|||
uprv_free(hash);
|
||||
}
|
||||
|
||||
U_CAPI UHashFunction
|
||||
U_CAPI UHashFunction U_EXPORT2
|
||||
uhash_setKeyHasher(UHashtable *hash, UHashFunction fn) {
|
||||
UHashFunction result = hash->keyHasher;
|
||||
hash->keyHasher = fn;
|
||||
return result;
|
||||
}
|
||||
|
||||
U_CAPI UKeyComparator
|
||||
U_CAPI UKeyComparator U_EXPORT2
|
||||
uhash_setKeyComparator(UHashtable *hash, UKeyComparator fn) {
|
||||
UKeyComparator result = hash->keyComparator;
|
||||
hash->keyComparator = fn;
|
||||
return result;
|
||||
}
|
||||
|
||||
U_CAPI UObjectDeleter
|
||||
U_CAPI UObjectDeleter U_EXPORT2
|
||||
uhash_setKeyDeleter(UHashtable *hash, UObjectDeleter fn) {
|
||||
UObjectDeleter result = hash->keyDeleter;
|
||||
hash->keyDeleter = fn;
|
||||
return result;
|
||||
}
|
||||
|
||||
U_CAPI UObjectDeleter
|
||||
U_CAPI UObjectDeleter U_EXPORT2
|
||||
uhash_setValueDeleter(UHashtable *hash, UObjectDeleter fn) {
|
||||
UObjectDeleter result = hash->valueDeleter;
|
||||
hash->valueDeleter = fn;
|
||||
return result;
|
||||
}
|
||||
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_setResizePolicy(UHashtable *hash, enum UHashResizePolicy policy) {
|
||||
_uhash_internalSetResizePolicy(hash, policy);
|
||||
hash->lowWaterMark = (int32_t)(hash->length * hash->lowWaterRatio);
|
||||
|
@ -262,12 +262,12 @@ uhash_setResizePolicy(UHashtable *hash, enum UHashResizePolicy policy) {
|
|||
_uhash_rehash(hash);
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_count(const UHashtable *hash) {
|
||||
return hash->count;
|
||||
}
|
||||
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_get(const UHashtable *hash,
|
||||
const void* key) {
|
||||
UHashTok keyholder;
|
||||
|
@ -275,7 +275,7 @@ uhash_get(const UHashtable *hash,
|
|||
return _uhash_find(hash, keyholder, hash->keyHasher(keyholder))->value.pointer;
|
||||
}
|
||||
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_iget(const UHashtable *hash,
|
||||
int32_t key) {
|
||||
UHashTok keyholder;
|
||||
|
@ -283,7 +283,7 @@ uhash_iget(const UHashtable *hash,
|
|||
return _uhash_find(hash, keyholder, hash->keyHasher(keyholder))->value.pointer;
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_geti(const UHashtable *hash,
|
||||
const void* key) {
|
||||
UHashTok keyholder;
|
||||
|
@ -291,7 +291,7 @@ uhash_geti(const UHashtable *hash,
|
|||
return _uhash_find(hash, keyholder, hash->keyHasher(keyholder))->value.integer;
|
||||
}
|
||||
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_put(UHashtable *hash,
|
||||
void* key,
|
||||
void* value,
|
||||
|
@ -304,7 +304,7 @@ uhash_put(UHashtable *hash,
|
|||
status).pointer;
|
||||
}
|
||||
|
||||
void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_iput(UHashtable *hash,
|
||||
int32_t key,
|
||||
void* value,
|
||||
|
@ -317,7 +317,7 @@ uhash_iput(UHashtable *hash,
|
|||
status).pointer;
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_puti(UHashtable *hash,
|
||||
void* key,
|
||||
int32_t value,
|
||||
|
@ -330,7 +330,7 @@ uhash_puti(UHashtable *hash,
|
|||
status).integer;
|
||||
}
|
||||
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_remove(UHashtable *hash,
|
||||
const void* key) {
|
||||
UHashTok keyholder;
|
||||
|
@ -338,7 +338,7 @@ uhash_remove(UHashtable *hash,
|
|||
return _uhash_remove(hash, keyholder).pointer;
|
||||
}
|
||||
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_iremove(UHashtable *hash,
|
||||
int32_t key) {
|
||||
UHashTok keyholder;
|
||||
|
@ -346,7 +346,7 @@ uhash_iremove(UHashtable *hash,
|
|||
return _uhash_remove(hash, keyholder).pointer;
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_removei(UHashtable *hash,
|
||||
const void* key) {
|
||||
UHashTok keyholder;
|
||||
|
@ -354,7 +354,7 @@ uhash_removei(UHashtable *hash,
|
|||
return _uhash_remove(hash, keyholder).integer;
|
||||
}
|
||||
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_removeAll(UHashtable *hash) {
|
||||
int32_t pos = -1;
|
||||
const UHashElement *e;
|
||||
|
@ -367,7 +367,7 @@ uhash_removeAll(UHashtable *hash) {
|
|||
assert(hash->count == 0);
|
||||
}
|
||||
|
||||
U_CAPI const UHashElement*
|
||||
U_CAPI const UHashElement* U_EXPORT2
|
||||
uhash_find(const UHashtable *hash, const void* key) {
|
||||
UHashTok keyholder;
|
||||
const UHashElement *e;
|
||||
|
@ -376,7 +376,7 @@ uhash_find(const UHashtable *hash, const void* key) {
|
|||
return IS_EMPTY_OR_DELETED(e->hashcode) ? NULL : e;
|
||||
}
|
||||
|
||||
U_CAPI const UHashElement*
|
||||
U_CAPI const UHashElement* U_EXPORT2
|
||||
uhash_nextElement(const UHashtable *hash, int32_t *pos) {
|
||||
/* Walk through the array until we find an element that is not
|
||||
* EMPTY and not DELETED.
|
||||
|
@ -394,7 +394,7 @@ uhash_nextElement(const UHashtable *hash, int32_t *pos) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_removeElement(UHashtable *hash, const UHashElement* e) {
|
||||
assert(hash != NULL);
|
||||
assert(e != NULL);
|
||||
|
@ -411,7 +411,7 @@ uhash_removeElement(UHashtable *hash, const UHashElement* e) {
|
|||
/**
|
||||
* Return a UHashTok for an integer.
|
||||
*/
|
||||
U_CAPI UHashTok
|
||||
U_CAPI UHashTok U_EXPORT2
|
||||
uhash_toki(int32_t i) {
|
||||
UHashTok tok;
|
||||
tok.integer = i;
|
||||
|
@ -421,7 +421,7 @@ uhash_toki(int32_t i) {
|
|||
/**
|
||||
* Return a UHashTok for a pointer.
|
||||
*/
|
||||
U_CAPI UHashTok
|
||||
U_CAPI UHashTok U_EXPORT2
|
||||
uhash_tokp(void* p) {
|
||||
UHashTok tok;
|
||||
tok.pointer = p;
|
||||
|
@ -455,23 +455,23 @@ uhash_tokp(void* p) {
|
|||
} \
|
||||
return hash
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashUChars(const UHashTok key) {
|
||||
STRING_HASH(UChar, key.pointer, u_strlen(p), *p);
|
||||
}
|
||||
|
||||
/* Used by UnicodeString to compute its hashcode - Not public API. */
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashUCharsN(const UChar *str, int32_t length) {
|
||||
STRING_HASH(UChar, str, length, *p);
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashChars(const UHashTok key) {
|
||||
STRING_HASH(uint8_t, key.pointer, uprv_strlen((char*)p), *p);
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashIChars(const UHashTok key) {
|
||||
STRING_HASH(uint8_t, key.pointer, uprv_strlen((char*)p), uprv_tolower(*p));
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ uhash_hashIChars(const UHashTok key) {
|
|||
* PUBLIC Comparator Functions
|
||||
********************************************************************/
|
||||
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareUChars(const UHashTok key1, const UHashTok key2) {
|
||||
const UChar *p1 = (const UChar*) key1.pointer;
|
||||
const UChar *p2 = (const UChar*) key2.pointer;
|
||||
|
@ -497,7 +497,7 @@ uhash_compareUChars(const UHashTok key1, const UHashTok key2) {
|
|||
return (UBool)(*p1 == *p2);
|
||||
}
|
||||
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareChars(const UHashTok key1, const UHashTok key2) {
|
||||
const char *p1 = (const char*) key1.pointer;
|
||||
const char *p2 = (const char*) key2.pointer;
|
||||
|
@ -514,7 +514,7 @@ uhash_compareChars(const UHashTok key1, const UHashTok key2) {
|
|||
return (UBool)(*p1 == *p2);
|
||||
}
|
||||
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareIChars(const UHashTok key1, const UHashTok key2) {
|
||||
const char *p1 = (const char*) key1.pointer;
|
||||
const char *p2 = (const char*) key2.pointer;
|
||||
|
@ -535,12 +535,12 @@ uhash_compareIChars(const UHashTok key1, const UHashTok key2) {
|
|||
* PUBLIC int32_t Support Functions
|
||||
********************************************************************/
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashLong(const UHashTok key) {
|
||||
return key.integer;
|
||||
}
|
||||
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareLong(const UHashTok key1, const UHashTok key2) {
|
||||
return (UBool)(key1.integer == key2.integer);
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ uhash_compareLong(const UHashTok key1, const UHashTok key2) {
|
|||
* PUBLIC Deleter Functions
|
||||
********************************************************************/
|
||||
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_freeBlock(void *obj) {
|
||||
uprv_free(obj);
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ typedef struct UHashElement UHashElement;
|
|||
* @param key A key stored in a hashtable
|
||||
* @return A NON-NEGATIVE hash code for parm.
|
||||
*/
|
||||
typedef int32_t (* U_CALLCONV UHashFunction)(const UHashTok key);
|
||||
typedef int32_t (U_EXPORT2 * U_CALLCONV UHashFunction)(const UHashTok key);
|
||||
|
||||
/**
|
||||
* A key comparison function.
|
||||
|
@ -115,7 +115,7 @@ typedef int32_t (* U_CALLCONV UHashFunction)(const UHashTok key);
|
|||
* @param key2 A key stored in a hashtable
|
||||
* @return TRUE if the two keys are equal.
|
||||
*/
|
||||
typedef UBool (* U_CALLCONV UKeyComparator)(const UHashTok key1,
|
||||
typedef UBool (U_EXPORT2 * U_CALLCONV UKeyComparator)(const UHashTok key1,
|
||||
const UHashTok key2);
|
||||
|
||||
/**
|
||||
|
@ -124,7 +124,7 @@ typedef UBool (* U_CALLCONV UKeyComparator)(const UHashTok key1,
|
|||
* an existing key or value.
|
||||
* @param obj A key or value stored in a hashtable
|
||||
*/
|
||||
typedef void (* U_CALLCONV UObjectDeleter)(void* obj);
|
||||
typedef void (U_EXPORT2 * U_CALLCONV UObjectDeleter)(void* obj);
|
||||
|
||||
/**
|
||||
* This specifies whether or not, and how, the hastable resizes itself.
|
||||
|
@ -192,7 +192,7 @@ U_CDECL_END
|
|||
* @return A pointer to a UHashtable, or 0 if an error occurred.
|
||||
* @see uhash_openSize
|
||||
*/
|
||||
U_CAPI UHashtable*
|
||||
U_CAPI UHashtable* U_EXPORT2
|
||||
uhash_open(UHashFunction keyHash,
|
||||
UKeyComparator keyComp,
|
||||
UErrorCode *status);
|
||||
|
@ -208,7 +208,7 @@ uhash_open(UHashFunction keyHash,
|
|||
* @return A pointer to a UHashtable, or 0 if an error occurred.
|
||||
* @see uhash_open
|
||||
*/
|
||||
U_CAPI UHashtable*
|
||||
U_CAPI UHashtable* U_EXPORT2
|
||||
uhash_openSize(UHashFunction keyHash,
|
||||
UKeyComparator keyComp,
|
||||
int32_t size,
|
||||
|
@ -218,7 +218,7 @@ uhash_openSize(UHashFunction keyHash,
|
|||
* Close a UHashtable, releasing the memory used.
|
||||
* @param hash The UHashtable to close.
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_close(UHashtable *hash);
|
||||
|
||||
|
||||
|
@ -228,7 +228,7 @@ uhash_close(UHashtable *hash);
|
|||
* @param fn the function to be used hash keys; must not be NULL
|
||||
* @return the previous key hasher; non-NULL
|
||||
*/
|
||||
U_CAPI UHashFunction
|
||||
U_CAPI UHashFunction U_EXPORT2
|
||||
uhash_setKeyHasher(UHashtable *hash, UHashFunction fn);
|
||||
|
||||
/**
|
||||
|
@ -237,7 +237,7 @@ uhash_setKeyHasher(UHashtable *hash, UHashFunction fn);
|
|||
* @param fn the function to be used compare keys; must not be NULL
|
||||
* @return the previous key comparator; non-NULL
|
||||
*/
|
||||
U_CAPI UKeyComparator
|
||||
U_CAPI UKeyComparator U_EXPORT2
|
||||
uhash_setKeyComparator(UHashtable *hash, UKeyComparator fn);
|
||||
|
||||
/**
|
||||
|
@ -249,7 +249,7 @@ uhash_setKeyComparator(UHashtable *hash, UKeyComparator fn);
|
|||
* @param fn the function to be used delete keys, or NULL
|
||||
* @return the previous key deleter; may be NULL
|
||||
*/
|
||||
U_CAPI UObjectDeleter
|
||||
U_CAPI UObjectDeleter U_EXPORT2
|
||||
uhash_setKeyDeleter(UHashtable *hash, UObjectDeleter fn);
|
||||
|
||||
/**
|
||||
|
@ -261,7 +261,7 @@ uhash_setKeyDeleter(UHashtable *hash, UObjectDeleter fn);
|
|||
* @param fn the function to be used delete values, or NULL
|
||||
* @return the previous value deleter; may be NULL
|
||||
*/
|
||||
U_CAPI UObjectDeleter
|
||||
U_CAPI UObjectDeleter U_EXPORT2
|
||||
uhash_setValueDeleter(UHashtable *hash, UObjectDeleter fn);
|
||||
|
||||
/**
|
||||
|
@ -269,7 +269,7 @@ uhash_setValueDeleter(UHashtable *hash, UObjectDeleter fn);
|
|||
* By default, tables grow but do not shrink (policy U_GROW).
|
||||
* See enum UHashResizePolicy.
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_setResizePolicy(UHashtable *hash, enum UHashResizePolicy policy);
|
||||
|
||||
/**
|
||||
|
@ -277,7 +277,7 @@ uhash_setResizePolicy(UHashtable *hash, enum UHashResizePolicy policy);
|
|||
* @param hash The UHashtable to query.
|
||||
* @return The number of key-value pairs stored in hash.
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_count(const UHashtable *hash);
|
||||
|
||||
/**
|
||||
|
@ -293,7 +293,7 @@ uhash_count(const UHashtable *hash);
|
|||
* @return The previous value, or NULL if none.
|
||||
* @see uhash_get
|
||||
*/
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_put(UHashtable *hash,
|
||||
void *key,
|
||||
void *value,
|
||||
|
@ -311,7 +311,7 @@ uhash_put(UHashtable *hash,
|
|||
* @return The previous value, or NULL if none.
|
||||
* @see uhash_get
|
||||
*/
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_iput(UHashtable *hash,
|
||||
int32_t key,
|
||||
void* value,
|
||||
|
@ -329,7 +329,7 @@ uhash_iput(UHashtable *hash,
|
|||
* @return The previous value, or 0 if none.
|
||||
* @see uhash_get
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_puti(UHashtable *hash,
|
||||
void* key,
|
||||
int32_t value,
|
||||
|
@ -342,7 +342,7 @@ uhash_puti(UHashtable *hash,
|
|||
* @param key A pointer key stored in a hashtable
|
||||
* @return The requested item, or NULL if not found.
|
||||
*/
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_get(const UHashtable *hash,
|
||||
const void *key);
|
||||
|
||||
|
@ -353,7 +353,7 @@ uhash_get(const UHashtable *hash,
|
|||
* @param key An integer key stored in a hashtable
|
||||
* @return The requested item, or NULL if not found.
|
||||
*/
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_iget(const UHashtable *hash,
|
||||
int32_t key);
|
||||
|
||||
|
@ -364,7 +364,7 @@ uhash_iget(const UHashtable *hash,
|
|||
* @param key A pointer key stored in a hashtable
|
||||
* @return The requested item, or 0 if not found.
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_geti(const UHashtable *hash,
|
||||
const void* key);
|
||||
|
||||
|
@ -374,7 +374,7 @@ uhash_geti(const UHashtable *hash,
|
|||
* @param key A key stored in a hashtable
|
||||
* @return The item removed, or NULL if not found.
|
||||
*/
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_remove(UHashtable *hash,
|
||||
const void *key);
|
||||
|
||||
|
@ -384,7 +384,7 @@ uhash_remove(UHashtable *hash,
|
|||
* @param key An integer key stored in a hashtable
|
||||
* @return The item removed, or NULL if not found.
|
||||
*/
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_iremove(UHashtable *hash,
|
||||
int32_t key);
|
||||
|
||||
|
@ -394,7 +394,7 @@ uhash_iremove(UHashtable *hash,
|
|||
* @param key An key stored in a hashtable
|
||||
* @return The item removed, or 0 if not found.
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_removei(UHashtable *hash,
|
||||
const void* key);
|
||||
|
||||
|
@ -402,7 +402,7 @@ uhash_removei(UHashtable *hash,
|
|||
* Remove all items from a UHashtable.
|
||||
* @param hash The target UHashtable.
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_removeAll(UHashtable *hash);
|
||||
|
||||
/**
|
||||
|
@ -416,7 +416,7 @@ uhash_removeAll(UHashtable *hash);
|
|||
* @param key A key stored in a hashtable
|
||||
* @return a hash element, or NULL if the key is not found.
|
||||
*/
|
||||
U_CAPI const UHashElement*
|
||||
U_CAPI const UHashElement* U_EXPORT2
|
||||
uhash_find(const UHashtable *hash, const void* key);
|
||||
|
||||
/**
|
||||
|
@ -432,7 +432,7 @@ uhash_find(const UHashtable *hash, const void* key);
|
|||
* @return a hash element, or NULL if no further key-value pairs
|
||||
* exist in the table.
|
||||
*/
|
||||
U_CAPI const UHashElement*
|
||||
U_CAPI const UHashElement* U_EXPORT2
|
||||
uhash_nextElement(const UHashtable *hash,
|
||||
int32_t *pos);
|
||||
|
||||
|
@ -447,7 +447,7 @@ uhash_nextElement(const UHashtable *hash,
|
|||
* modified.
|
||||
* @return the value that was removed.
|
||||
*/
|
||||
U_CAPI void*
|
||||
U_CAPI void* U_EXPORT2
|
||||
uhash_removeElement(UHashtable *hash, const UHashElement* e);
|
||||
|
||||
/********************************************************************
|
||||
|
@ -457,13 +457,13 @@ uhash_removeElement(UHashtable *hash, const UHashElement* e);
|
|||
/**
|
||||
* Return a UHashTok for an integer.
|
||||
*/
|
||||
U_CAPI UHashTok
|
||||
U_CAPI UHashTok U_EXPORT2
|
||||
uhash_toki(int32_t i);
|
||||
|
||||
/**
|
||||
* Return a UHashTok for a pointer.
|
||||
*/
|
||||
U_CAPI UHashTok
|
||||
U_CAPI UHashTok U_EXPORT2
|
||||
uhash_tokp(void* p);
|
||||
|
||||
/********************************************************************
|
||||
|
@ -477,7 +477,7 @@ uhash_tokp(void* p);
|
|||
* @param key The string (const UChar*) to hash.
|
||||
* @return A hash code for the key.
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashUChars(const UHashTok key);
|
||||
|
||||
/**
|
||||
|
@ -487,11 +487,11 @@ uhash_hashUChars(const UHashTok key);
|
|||
* @param key The string (const char*) to hash.
|
||||
* @return A hash code for the key.
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashChars(const UHashTok key);
|
||||
|
||||
/* Used by UnicodeString to compute its hashcode - Not public API. */
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashUCharsN(const UChar *key, int32_t length);
|
||||
|
||||
/**
|
||||
|
@ -501,28 +501,28 @@ uhash_hashUCharsN(const UChar *key, int32_t length);
|
|||
* @param key The string (const char*) to hash.
|
||||
* @return A hash code for the key.
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashIChars(const UHashTok key);
|
||||
|
||||
/**
|
||||
* Comparator for null-terminated UChar* strings. Use together with
|
||||
* uhash_hashUChars.
|
||||
*/
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareUChars(const UHashTok key1, const UHashTok key2);
|
||||
|
||||
/**
|
||||
* Comparator for null-terminated char* strings. Use together with
|
||||
* uhash_hashChars.
|
||||
*/
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareChars(const UHashTok key1, const UHashTok key2);
|
||||
|
||||
/**
|
||||
* Case-insensitive comparator for null-terminated char* strings. Use
|
||||
* together with uhash_hashIChars.
|
||||
*/
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareIChars(const UHashTok key1, const UHashTok key2);
|
||||
|
||||
/********************************************************************
|
||||
|
@ -532,33 +532,33 @@ uhash_compareIChars(const UHashTok key1, const UHashTok key2);
|
|||
/**
|
||||
* Hash function for UnicodeString* keys.
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashUnicodeString(const UHashTok key);
|
||||
|
||||
/**
|
||||
* Hash function for UnicodeString* keys (case insensitive).
|
||||
* Make sure to use together with uhash_compareCaselessUnicodeString.
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashCaselessUnicodeString(const UHashTok key);
|
||||
|
||||
/**
|
||||
* Comparator function for UnicodeString* keys.
|
||||
*/
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareUnicodeString(const UHashTok key1, const UHashTok key2);
|
||||
|
||||
/**
|
||||
* Comparator function for UnicodeString* keys (case insensitive).
|
||||
* Make sure to use together with uhash_hashCaselessUnicodeString.
|
||||
*/
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareCaselessUnicodeString(const UHashTok key1, const UHashTok key2);
|
||||
|
||||
/**
|
||||
* Deleter function for UnicodeString* keys or values.
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_deleteUnicodeString(void *obj);
|
||||
|
||||
/********************************************************************
|
||||
|
@ -568,13 +568,13 @@ uhash_deleteUnicodeString(void *obj);
|
|||
/**
|
||||
* Hash function for 32-bit integer keys.
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashLong(const UHashTok key);
|
||||
|
||||
/**
|
||||
* Comparator function for 32-bit integer keys.
|
||||
*/
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareLong(const UHashTok key1, const UHashTok key2);
|
||||
|
||||
/********************************************************************
|
||||
|
@ -584,20 +584,20 @@ uhash_compareLong(const UHashTok key1, const UHashTok key2);
|
|||
/**
|
||||
* Deleter for Hashtable objects.
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_deleteHashtable(void *obj);
|
||||
|
||||
/**
|
||||
* Deleter for UVector objects.
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_deleteUVector(void *obj);
|
||||
|
||||
/**
|
||||
* Deleter for any key or value allocated using uprv_malloc. Calls
|
||||
* uprv_free.
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_freeBlock(void *obj);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
* PUBLIC UnicodeString support functions for UHashtable
|
||||
********************************************************************/
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashUnicodeString(const UHashTok key) {
|
||||
U_NAMESPACE_USE
|
||||
const UnicodeString *str = (const UnicodeString*) key.pointer;
|
||||
return (str == NULL) ? 0 : str->hashCode();
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uhash_hashCaselessUnicodeString(const UHashTok key) {
|
||||
U_NAMESPACE_USE
|
||||
const UnicodeString *str = (const UnicodeString*) key.pointer;
|
||||
|
@ -39,13 +39,13 @@ uhash_hashCaselessUnicodeString(const UHashTok key) {
|
|||
return copy.foldCase().hashCode();
|
||||
}
|
||||
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_deleteUnicodeString(void *obj) {
|
||||
U_NAMESPACE_USE
|
||||
delete (UnicodeString*) obj;
|
||||
}
|
||||
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareUnicodeString(const UHashTok key1, const UHashTok key2) {
|
||||
U_NAMESPACE_USE
|
||||
const UnicodeString *str1 = (const UnicodeString*) key1.pointer;
|
||||
|
@ -59,7 +59,7 @@ uhash_compareUnicodeString(const UHashTok key1, const UHashTok key2) {
|
|||
return *str1 == *str2;
|
||||
}
|
||||
|
||||
U_CAPI UBool
|
||||
U_CAPI UBool U_EXPORT2
|
||||
uhash_compareCaselessUnicodeString(const UHashTok key1, const UHashTok key2) {
|
||||
U_NAMESPACE_USE
|
||||
const UnicodeString *str1 = (const UnicodeString*) key1.pointer;
|
||||
|
@ -76,7 +76,7 @@ uhash_compareCaselessUnicodeString(const UHashTok key1, const UHashTok key2) {
|
|||
/**
|
||||
* Deleter for Hashtable objects.
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_deleteHashtable(void *obj) {
|
||||
U_NAMESPACE_USE
|
||||
delete (Hashtable*) obj;
|
||||
|
@ -85,7 +85,7 @@ uhash_deleteHashtable(void *obj) {
|
|||
/**
|
||||
* Deleter for UVector objects.
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
uhash_deleteUVector(void *obj) {
|
||||
U_NAMESPACE_USE
|
||||
delete (UVector*) obj;
|
||||
|
|
|
@ -439,12 +439,14 @@ _copyCount(char *dest, int32_t destCapacity, const char *src) {
|
|||
API function definitions
|
||||
*******************************************************************************/
|
||||
|
||||
const char* uloc_getDefault()
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uloc_getDefault()
|
||||
{
|
||||
return locale_get_default();
|
||||
}
|
||||
|
||||
void uloc_setDefault(const char* newDefaultLocale,
|
||||
U_CAPI void U_EXPORT2
|
||||
uloc_setDefault(const char* newDefaultLocale,
|
||||
UErrorCode* err)
|
||||
{
|
||||
if (U_FAILURE(*err))
|
||||
|
@ -461,7 +463,8 @@ void uloc_setDefault(const char* newDefaultLocale,
|
|||
}
|
||||
|
||||
|
||||
int32_t uloc_getParent(const char* localeID,
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getParent(const char* localeID,
|
||||
char* parent,
|
||||
int32_t parentCapacity,
|
||||
UErrorCode* err)
|
||||
|
@ -542,7 +545,7 @@ _getLanguage(const char *localeID,
|
|||
return i;
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getLanguage(const char* localeID,
|
||||
char* language,
|
||||
int32_t languageCapacity,
|
||||
|
@ -597,7 +600,8 @@ _getCountry(const char *localeID,
|
|||
return i;
|
||||
}
|
||||
|
||||
int32_t uloc_getCountry(const char* localeID,
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getCountry(const char* localeID,
|
||||
char* country,
|
||||
int32_t countryCapacity,
|
||||
UErrorCode* err)
|
||||
|
@ -665,7 +669,8 @@ _getVariant(const char *localeID,
|
|||
return i;
|
||||
}
|
||||
|
||||
int32_t uloc_getVariant(const char* localeID,
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getVariant(const char* localeID,
|
||||
char* variant,
|
||||
int32_t variantCapacity,
|
||||
UErrorCode* err)
|
||||
|
@ -698,7 +703,8 @@ int32_t uloc_getVariant(const char* localeID,
|
|||
return u_terminateChars(variant, variantCapacity, i, err);
|
||||
}
|
||||
|
||||
int32_t uloc_getName(const char* localeID,
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getName(const char* localeID,
|
||||
char* name,
|
||||
int32_t nameCapacity,
|
||||
UErrorCode* err)
|
||||
|
@ -747,7 +753,8 @@ int32_t uloc_getName(const char* localeID,
|
|||
return u_terminateChars(name, nameCapacity, i, err);
|
||||
}
|
||||
|
||||
const char* uloc_getISO3Language(const char* localeID)
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uloc_getISO3Language(const char* localeID)
|
||||
{
|
||||
int16_t offset;
|
||||
char lang[TEMPBUFSIZE];
|
||||
|
@ -766,7 +773,8 @@ const char* uloc_getISO3Language(const char* localeID)
|
|||
return _languages3[offset];
|
||||
}
|
||||
|
||||
const char* uloc_getISO3Country(const char* localeID)
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uloc_getISO3Country(const char* localeID)
|
||||
{
|
||||
int16_t offset;
|
||||
char cntry[TEMPBUFSIZE];
|
||||
|
@ -786,7 +794,8 @@ const char* uloc_getISO3Country(const char* localeID)
|
|||
return _countries3[offset];
|
||||
}
|
||||
|
||||
uint32_t uloc_getLCID(const char* localeID)
|
||||
U_CAPI uint32_t U_EXPORT2
|
||||
uloc_getLCID(const char* localeID)
|
||||
{
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
char temp[30];
|
||||
|
@ -1026,7 +1035,7 @@ _getStringOrCopyKey(const char *path, const char *locale,
|
|||
return u_terminateUChars(dest, destCapacity, length, pErrorCode);
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getDisplayLanguage(const char *locale,
|
||||
const char *displayLocale,
|
||||
UChar *dest, int32_t destCapacity,
|
||||
|
@ -1061,7 +1070,7 @@ uloc_getDisplayLanguage(const char *locale,
|
|||
pErrorCode);
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getDisplayCountry(const char *locale,
|
||||
const char *displayLocale,
|
||||
UChar *dest, int32_t destCapacity,
|
||||
|
@ -1101,7 +1110,7 @@ uloc_getDisplayCountry(const char *locale,
|
|||
* by getting each tag's display string and concatenating them with ", "
|
||||
* in between - similar to uloc_getDisplayName()
|
||||
*/
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getDisplayVariant(const char *locale,
|
||||
const char *displayLocale,
|
||||
UChar *dest, int32_t destCapacity,
|
||||
|
@ -1143,7 +1152,7 @@ uloc_getDisplayVariant(const char *locale,
|
|||
pErrorCode);
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getDisplayName(const char *locale,
|
||||
const char *displayLocale,
|
||||
UChar *dest, int32_t destCapacity,
|
||||
|
@ -1258,7 +1267,7 @@ uloc_getDisplayName(const char *locale,
|
|||
return u_terminateUChars(dest, destCapacity, length, pErrorCode);
|
||||
}
|
||||
|
||||
const char*
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uloc_getAvailable(int32_t offset)
|
||||
{
|
||||
|
||||
|
@ -1272,7 +1281,8 @@ uloc_getAvailable(int32_t offset)
|
|||
|
||||
}
|
||||
|
||||
int32_t uloc_countAvailable()
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_countAvailable()
|
||||
{
|
||||
if (_installedLocales == NULL)
|
||||
_lazyEvaluate_installedLocales();
|
||||
|
@ -1353,7 +1363,8 @@ static void _lazyEvaluate_installedLocales()
|
|||
* by ICU-- do not delete them, and do not write through them. The array is
|
||||
* terminated with a null pointer.
|
||||
*/
|
||||
const char* const* uloc_getISOLanguages()
|
||||
U_CAPI const char* const* U_EXPORT2
|
||||
uloc_getISOLanguages()
|
||||
{
|
||||
return _languages;
|
||||
}
|
||||
|
@ -1364,7 +1375,8 @@ const char* const* uloc_getISOLanguages()
|
|||
* owned by ICU-- do not delete them, and do not write through them. The array is
|
||||
* terminated with a null pointer.
|
||||
*/
|
||||
const char* const* uloc_getISOCountries()
|
||||
U_CAPI const char* const* U_EXPORT2
|
||||
uloc_getISOCountries()
|
||||
{
|
||||
return _countries;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,8 @@ static pthread_mutex_t gPlatformMutex;
|
|||
#endif
|
||||
#endif /* ICU_USE_THREADS==1 */
|
||||
|
||||
void umtx_lock(UMTX *mutex)
|
||||
U_CAPI void U_EXPORT2
|
||||
umtx_lock(UMTX *mutex)
|
||||
{
|
||||
#if (ICU_USE_THREADS == 1)
|
||||
if (mutex == NULL)
|
||||
|
@ -116,7 +117,8 @@ void umtx_lock(UMTX *mutex)
|
|||
#endif /* ICU_USE_THREADS==1 */
|
||||
}
|
||||
|
||||
void umtx_unlock(UMTX* mutex)
|
||||
U_CAPI void U_EXPORT2
|
||||
umtx_unlock(UMTX* mutex)
|
||||
{
|
||||
#if (ICU_USE_THREADS==1)
|
||||
if(mutex == NULL)
|
||||
|
@ -143,7 +145,8 @@ void umtx_unlock(UMTX* mutex)
|
|||
#endif /* ICU_USE_THREADS == 1 */
|
||||
}
|
||||
|
||||
U_CAPI void umtx_init(UMTX *mutex)
|
||||
U_CAPI void U_EXPORT2
|
||||
umtx_init(UMTX *mutex)
|
||||
{
|
||||
#if (ICU_USE_THREADS == 1)
|
||||
|
||||
|
@ -186,7 +189,8 @@ U_CAPI void umtx_init(UMTX *mutex)
|
|||
#endif /* ICU_USE_THREADS==1 */
|
||||
}
|
||||
|
||||
U_CAPI void umtx_destroy(UMTX *mutex) {
|
||||
U_CAPI void U_EXPORT2
|
||||
umtx_destroy(UMTX *mutex) {
|
||||
#if (ICU_USE_THREADS == 1)
|
||||
if (mutex == NULL) /* initialize the global mutex */
|
||||
{
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
*
|
||||
* @draft ICU 2.0
|
||||
*/
|
||||
U_CAPI void U_EXPORT2 u_cleanup(void);
|
||||
U_CAPI void U_EXPORT2
|
||||
u_cleanup(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -114,7 +114,7 @@ typedef enum {
|
|||
* @see UConverterToUnicodeArgs
|
||||
* @stable
|
||||
*/
|
||||
typedef void (*UConverterToUCallback) (
|
||||
typedef void (U_EXPORT2 *UConverterToUCallback) (
|
||||
const void* context,
|
||||
UConverterToUnicodeArgs *args,
|
||||
const char *codePoints,
|
||||
|
@ -134,7 +134,7 @@ typedef void (*UConverterToUCallback) (
|
|||
* @see ucnv_setFromUCallBack
|
||||
* @stable
|
||||
*/
|
||||
typedef void (*UConverterFromUCallback) (
|
||||
typedef void (U_EXPORT2 *UConverterFromUCallback) (
|
||||
const void* context,
|
||||
UConverterFromUnicodeArgs *args,
|
||||
const UChar* codeUnits,
|
||||
|
@ -334,7 +334,7 @@ ucnv_openCCSID (int32_t codepage,
|
|||
* @return pointer to the new clone
|
||||
* @draft ICU 1.8
|
||||
*/
|
||||
U_CAPI UConverter *
|
||||
U_CAPI UConverter * U_EXPORT2
|
||||
ucnv_safeClone(const UConverter *cnv,
|
||||
void *stackBuffer,
|
||||
int32_t *pBufferSize,
|
||||
|
@ -451,7 +451,7 @@ ucnv_reset (UConverter * converter);
|
|||
* @param converter the Unicode converter
|
||||
* @draft ICU 1.8
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_resetToUnicode(UConverter *converter);
|
||||
|
||||
/**
|
||||
|
@ -462,7 +462,7 @@ ucnv_resetToUnicode(UConverter *converter);
|
|||
* @param converter the Unicode converter
|
||||
* @draft ICU 1.8
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_resetFromUnicode(UConverter *converter);
|
||||
|
||||
/**
|
||||
|
@ -983,7 +983,7 @@ ucnv_getAvailableName (int32_t n);
|
|||
* @return number of names on alias list for given alias
|
||||
* @stable
|
||||
*/
|
||||
U_CAPI uint16_t
|
||||
U_CAPI uint16_t U_EXPORT2
|
||||
ucnv_countAliases(const char *alias, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
|
@ -997,7 +997,7 @@ ucnv_countAliases(const char *alias, UErrorCode *pErrorCode);
|
|||
* @see ucnv_countAliases
|
||||
* @stable
|
||||
*/
|
||||
U_CAPI const char *
|
||||
U_CAPI const char * U_EXPORT2
|
||||
ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
|
@ -1012,7 +1012,7 @@ ucnv_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
|
|||
* @param pErrorCode result of operation
|
||||
* @stable
|
||||
*/
|
||||
U_CAPI void
|
||||
U_CAPI void U_EXPORT2
|
||||
ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
|
|
|
@ -493,7 +493,7 @@ uloc_getISOCountries(void);
|
|||
* @return The length of the parent locale ID.
|
||||
* @stable
|
||||
*/
|
||||
int32_t U_EXPORT2
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uloc_getParent(const char* localeID,
|
||||
char* parent,
|
||||
int32_t parentCapacity,
|
||||
|
|
|
@ -203,7 +203,7 @@ typedef enum {
|
|||
* the output was truncated, and the error code is set to U_BUFFER_OVERFLOW_ERROR.
|
||||
* @stable
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
unorm_normalize(const UChar *source, int32_t sourceLength,
|
||||
UNormalizationMode mode, int32_t options,
|
||||
UChar *result, int32_t resultLength,
|
||||
|
|
|
@ -242,7 +242,8 @@ U_CAPI UResourceBundle* U_EXPORT2 ures_open(const char* path, /* NULL if n
|
|||
* @see ures_close
|
||||
* @draft ICU 2.0
|
||||
*/
|
||||
U_CAPI UResourceBundle* ures_openDirect(const char* path, const char* locale, UErrorCode* status);
|
||||
U_CAPI UResourceBundle* U_EXPORT2
|
||||
ures_openDirect(const char* path, const char* locale, UErrorCode* status);
|
||||
|
||||
/**
|
||||
*Opens a UResourceBundle, from which users can extract strings by using
|
||||
|
@ -339,7 +340,8 @@ U_CAPI void U_EXPORT2 ures_getVersion(const UResourceBundle* resB, UVersionInfo
|
|||
* @return A Locale name
|
||||
* @stable
|
||||
*/
|
||||
U_CAPI const char* ures_getLocale(const UResourceBundle* resourceBundle, UErrorCode* status);
|
||||
U_CAPI const char* U_EXPORT2
|
||||
ures_getLocale(const UResourceBundle* resourceBundle, UErrorCode* status);
|
||||
|
||||
/**
|
||||
* Same as ures_open() but uses the fill-in parameter instead of allocating
|
||||
|
@ -348,7 +350,8 @@ U_CAPI const char* ures_getLocale(const UResourceBundle* resourceBundle, UErrorC
|
|||
* and usage model for fillIn parameters without knowing sizeof(UResourceBundle)
|
||||
* @internal
|
||||
*/
|
||||
U_CAPI void ures_openFillIn(UResourceBundle *r, const char* path,
|
||||
U_CAPI void U_EXPORT2
|
||||
ures_openFillIn(UResourceBundle *r, const char* path,
|
||||
const char* localeID, UErrorCode* status);
|
||||
|
||||
/**
|
||||
|
|
|
@ -81,7 +81,7 @@ typedef enum UScriptCode {
|
|||
* @return The number of script codes filled in the buffer passed in
|
||||
* @draft ICU 2.0
|
||||
*/
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uscript_getCode(const char* nameOrAbbrOrLocale,UScriptCode* fillIn,int32_t capacity,UErrorCode *err);
|
||||
|
||||
/**
|
||||
|
@ -91,7 +91,7 @@ uscript_getCode(const char* nameOrAbbrOrLocale,UScriptCode* fillIn,int32_t capac
|
|||
* @return script name as a string in full as given in TR#24
|
||||
* @draft ICU 2.0
|
||||
*/
|
||||
U_CAPI const char*
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uscript_getName(UScriptCode scriptCode);
|
||||
|
||||
/**
|
||||
|
@ -101,7 +101,7 @@ uscript_getName(UScriptCode scriptCode);
|
|||
* @return script abbreviated name as a string as given in TR#24
|
||||
* @draft ICU 2.0
|
||||
*/
|
||||
U_CAPI const char*
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uscript_getShortName(UScriptCode scriptCode);
|
||||
|
||||
/**
|
||||
|
@ -112,7 +112,7 @@ uscript_getShortName(UScriptCode scriptCode);
|
|||
* @return The UScriptCode
|
||||
* @draft ICU 2.0
|
||||
*/
|
||||
U_CAPI UScriptCode
|
||||
U_CAPI UScriptCode U_EXPORT2
|
||||
uscript_getScript(UChar32 codepoint, UErrorCode *err);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2235,7 +2235,7 @@ unorm_internalNormalize(UChar *dest, int32_t destCapacity,
|
|||
}
|
||||
|
||||
/** Public API for normalizing. */
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
unorm_normalize(const UChar *src, int32_t srcLength,
|
||||
UNormalizationMode mode, int32_t option,
|
||||
UChar *dest, int32_t destCapacity,
|
||||
|
|
|
@ -43,7 +43,7 @@ static UBool isMutexInited = FALSE;
|
|||
static UMTX resbMutex = NULL;
|
||||
|
||||
/* INTERNAL: hashes an entry */
|
||||
static int32_t hashEntry(const UHashTok parm) {
|
||||
static int32_t U_EXPORT2 U_CALLCONV hashEntry(const UHashTok parm) {
|
||||
UResourceDataEntry *b = (UResourceDataEntry *)parm.pointer;
|
||||
UHashTok namekey, pathkey;
|
||||
namekey.pointer = b->fName;
|
||||
|
@ -52,7 +52,7 @@ static int32_t hashEntry(const UHashTok parm) {
|
|||
}
|
||||
|
||||
/* INTERNAL: compares two entries */
|
||||
static UBool compareEntries(const UHashTok p1, const UHashTok p2) {
|
||||
static UBool U_EXPORT2 U_CALLCONV compareEntries(const UHashTok p1, const UHashTok p2) {
|
||||
UResourceDataEntry *b1 = (UResourceDataEntry *)p1.pointer;
|
||||
UResourceDataEntry *b2 = (UResourceDataEntry *)p2.pointer;
|
||||
UHashTok name1, name2, path1, path2;
|
||||
|
@ -983,7 +983,8 @@ U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, c
|
|||
* INTERNAL: Get the name of the first real locale (not placeholder)
|
||||
* that has resource bundle data.
|
||||
*/
|
||||
U_CAPI const char* ures_getLocale(const UResourceBundle* resourceBundle, UErrorCode* status)
|
||||
U_CAPI const char* U_EXPORT2
|
||||
ures_getLocale(const UResourceBundle* resourceBundle, UErrorCode* status)
|
||||
{
|
||||
if (status==NULL || U_FAILURE(*status)) {
|
||||
return NULL;
|
||||
|
@ -1059,7 +1060,8 @@ U_CFUNC const char* ures_getPath(const UResourceBundle* resB) {
|
|||
* proper fallback chaining is executed while initialization.
|
||||
* The result is stored in cache for later fallback search.
|
||||
*/
|
||||
U_CAPI void ures_openFillIn(UResourceBundle *r, const char* path,
|
||||
U_CAPI void U_EXPORT2
|
||||
ures_openFillIn(UResourceBundle *r, const char* path,
|
||||
const char* localeID, UErrorCode* status) {
|
||||
if(r == NULL) {
|
||||
*status = U_INTERNAL_PROGRAM_ERROR;
|
||||
|
@ -1083,7 +1085,8 @@ U_CAPI void ures_openFillIn(UResourceBundle *r, const char* path,
|
|||
r->fSize = res_countArrayItems(&(r->fResData), r->fRes);
|
||||
}
|
||||
}
|
||||
U_CAPI UResourceBundle* ures_open(const char* path,
|
||||
U_CAPI UResourceBundle* U_EXPORT2
|
||||
ures_open(const char* path,
|
||||
const char* localeID,
|
||||
UErrorCode* status)
|
||||
{
|
||||
|
@ -1143,7 +1146,8 @@ U_CAPI UResourceBundle* ures_open(const char* path,
|
|||
return r;
|
||||
}
|
||||
|
||||
U_CAPI UResourceBundle* ures_openW(const wchar_t* myPath,
|
||||
U_CAPI UResourceBundle* U_EXPORT2
|
||||
ures_openW(const wchar_t* myPath,
|
||||
const char* localeID,
|
||||
UErrorCode* status)
|
||||
{
|
||||
|
@ -1190,7 +1194,8 @@ U_CAPI UResourceBundle* U_EXPORT2 ures_openU(const UChar* myPath,
|
|||
* Opens a resource bundle without "canonicalizing" the locale name. No fallback will be performed
|
||||
* or sought. However, alias substitution will happen!
|
||||
*/
|
||||
U_CFUNC UResourceBundle* ures_openDirect(const char* path, const char* localeID, UErrorCode* status) {
|
||||
U_CAPI UResourceBundle* U_EXPORT2
|
||||
ures_openDirect(const char* path, const char* localeID, UErrorCode* status) {
|
||||
UResourceBundle *r;
|
||||
|
||||
if(status == NULL || U_FAILURE(*status)) {
|
||||
|
@ -1249,7 +1254,8 @@ U_CFUNC UBool ures_isStackObject(UResourceBundle* resB) {
|
|||
* API: Counts members. For arrays and tables, returns number of resources.
|
||||
* For strings, returns 1.
|
||||
*/
|
||||
U_CAPI int32_t ures_countArrayItems(const UResourceBundle* resourceBundle,
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ures_countArrayItems(const UResourceBundle* resourceBundle,
|
||||
const char* resourceKey,
|
||||
UErrorCode* status)
|
||||
{
|
||||
|
@ -1275,7 +1281,8 @@ U_CAPI int32_t ures_countArrayItems(const UResourceBundle* resourceBundle,
|
|||
}
|
||||
}
|
||||
|
||||
U_CAPI void ures_close(UResourceBundle* resB)
|
||||
U_CAPI void U_EXPORT2
|
||||
ures_close(UResourceBundle* resB)
|
||||
{
|
||||
if(resB != NULL) {
|
||||
if(resB->fData != NULL) {
|
||||
|
@ -1296,7 +1303,8 @@ U_CAPI void ures_close(UResourceBundle* resB)
|
|||
}
|
||||
}
|
||||
|
||||
U_CAPI const char* ures_getVersionNumber(const UResourceBundle* resourceBundle)
|
||||
U_CAPI const char* U_EXPORT2
|
||||
ures_getVersionNumber(const UResourceBundle* resourceBundle)
|
||||
{
|
||||
if (!resourceBundle) return NULL;
|
||||
|
||||
|
|
|
@ -770,7 +770,7 @@ findCodeIndex(const UScriptCode unsorted[], const UScriptCode target, int size){
|
|||
return -1;
|
||||
}
|
||||
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uscript_getCode(const char* nameOrAbbrOrLocale,
|
||||
UScriptCode* fillIn,
|
||||
int32_t capacity,
|
||||
|
@ -845,7 +845,7 @@ uscript_getCode(const char* nameOrAbbrOrLocale,
|
|||
return numFilled;
|
||||
}
|
||||
|
||||
U_CAPI const char*
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uscript_getName(UScriptCode scriptCode){
|
||||
int index = -1;
|
||||
if(scriptCode > USCRIPT_CODE_LIMIT){
|
||||
|
@ -859,7 +859,7 @@ uscript_getName(UScriptCode scriptCode){
|
|||
}
|
||||
|
||||
}
|
||||
U_CAPI const char*
|
||||
U_CAPI const char* U_EXPORT2
|
||||
uscript_getShortName(UScriptCode scriptCode){
|
||||
int index = -1;
|
||||
if(scriptCode > USCRIPT_CODE_LIMIT){
|
||||
|
@ -873,7 +873,7 @@ uscript_getShortName(UScriptCode scriptCode){
|
|||
}
|
||||
}
|
||||
|
||||
U_CAPI UScriptCode
|
||||
U_CAPI UScriptCode U_EXPORT2
|
||||
uscript_getScript(UChar32 codepoint, UErrorCode *err){
|
||||
|
||||
if(codepoint > 0x10ffff){
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
|
||||
#include "ustrfmt.h"
|
||||
|
||||
U_CAPI double
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_strtod(const char* source, char** end)
|
||||
{
|
||||
return strtod(source,end);
|
||||
}
|
||||
|
||||
|
||||
U_CAPI char*
|
||||
U_CAPI char* U_EXPORT2
|
||||
uprv_dtostr(double value, char *buffer, int maximumDigits,UBool fixedPoint)
|
||||
{
|
||||
char *itrPtr = buffer + 1; /* skip '-' or a number before the decimal */
|
||||
|
@ -47,7 +47,7 @@ uprv_dtostr(double value, char *buffer, int maximumDigits,UBool fixedPoint)
|
|||
* and padded with "pad" zeroes
|
||||
*/
|
||||
#define MAX_DIGITS 10
|
||||
U_CAPI int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uprv_itou (UChar * buffer, uint32_t i, uint32_t radix, int32_t pad)
|
||||
{
|
||||
int32_t length = 0;
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
#include "unicode/utypes.h"
|
||||
#include "cstring.h"
|
||||
|
||||
U_CAPI double
|
||||
U_EXPORT2 uprv_strtod(const char* source, char** end);
|
||||
U_CAPI char*
|
||||
U_EXPORT2 uprv_dtostr(double value, char *buffer, int maximumDigits,UBool fixedPoint);
|
||||
U_CAPI int32_t
|
||||
U_EXPORT2 uprv_itou (UChar * buffer, uint32_t i, uint32_t radix, int32_t pad);
|
||||
U_CAPI double U_EXPORT2
|
||||
uprv_strtod(const char* source, char** end);
|
||||
U_CAPI char* U_EXPORT2
|
||||
uprv_dtostr(double value, char *buffer, int maximumDigits,UBool fixedPoint);
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
uprv_itou (UChar * buffer, uint32_t i, uint32_t radix, int32_t pad);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -36,7 +36,7 @@ static UConverter *gDefaultConverter = NULL;
|
|||
|
||||
/* ---- String searching functions ---- */
|
||||
|
||||
UChar*
|
||||
U_CAPI UChar* U_EXPORT2
|
||||
u_strchr(const UChar *s, UChar c)
|
||||
{
|
||||
while (*s && *s != c) {
|
||||
|
@ -93,7 +93,7 @@ u_strchr32(const UChar *s, UChar32 c) {
|
|||
}
|
||||
|
||||
/* Search for a codepoint in a string that matches one of the matchSet codepoints. */
|
||||
UChar *
|
||||
U_CAPI UChar * U_EXPORT2
|
||||
u_strpbrk(const UChar *string, const UChar *matchSet)
|
||||
{
|
||||
int32_t matchLen;
|
||||
|
@ -151,7 +151,7 @@ u_strpbrk(const UChar *string, const UChar *matchSet)
|
|||
}
|
||||
|
||||
/* Search for a codepoint in a string that matches one of the matchSet codepoints. */
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
u_strcspn(const UChar *string, const UChar *matchSet)
|
||||
{
|
||||
const UChar *foundStr = u_strpbrk(string, matchSet);
|
||||
|
@ -163,7 +163,7 @@ u_strcspn(const UChar *string, const UChar *matchSet)
|
|||
}
|
||||
|
||||
/* Search for a codepoint in a string that does not match one of the matchSet codepoints. */
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
u_strspn(const UChar *string, const UChar *matchSet)
|
||||
{
|
||||
UBool single = TRUE;
|
||||
|
@ -230,7 +230,7 @@ u_strspn(const UChar *string, const UChar *matchSet)
|
|||
|
||||
/* ----- Text manipulation functions --- */
|
||||
|
||||
UChar*
|
||||
U_CAPI UChar* U_EXPORT2
|
||||
u_strtok_r(UChar *src,
|
||||
const UChar *delim,
|
||||
UChar **saveState)
|
||||
|
@ -274,7 +274,7 @@ u_strtok_r(UChar *src,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
UChar*
|
||||
U_CAPI UChar* U_EXPORT2
|
||||
u_strcat(UChar *dst,
|
||||
const UChar *src)
|
||||
{
|
||||
|
@ -289,7 +289,7 @@ u_strcat(UChar *dst,
|
|||
return anchor;
|
||||
}
|
||||
|
||||
UChar*
|
||||
U_CAPI UChar* U_EXPORT2
|
||||
u_strncat(UChar *dst,
|
||||
const UChar *src,
|
||||
int32_t n )
|
||||
|
@ -317,7 +317,7 @@ u_strncat(UChar *dst,
|
|||
|
||||
/* ----- Text property functions --- */
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
u_strcmp(const UChar *s1,
|
||||
const UChar *s2)
|
||||
{
|
||||
|
@ -367,7 +367,7 @@ u_strcmpCodePointOrder(const UChar *s1, const UChar *s2) {
|
|||
return (int32_t)c1-(int32_t)c2;
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
u_strncmp(const UChar *s1,
|
||||
const UChar *s2,
|
||||
int32_t n)
|
||||
|
@ -420,7 +420,7 @@ u_strncmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t n) {
|
|||
return (int32_t)c1-(int32_t)c2;
|
||||
}
|
||||
|
||||
UChar*
|
||||
U_CAPI UChar* U_EXPORT2
|
||||
u_strcpy(UChar *dst,
|
||||
const UChar *src)
|
||||
{
|
||||
|
@ -432,7 +432,7 @@ u_strcpy(UChar *dst,
|
|||
return anchor;
|
||||
}
|
||||
|
||||
UChar*
|
||||
U_CAPI UChar* U_EXPORT2
|
||||
u_strncpy(UChar *dst,
|
||||
const UChar *src,
|
||||
int32_t n)
|
||||
|
@ -445,7 +445,7 @@ u_strncpy(UChar *dst,
|
|||
return anchor;
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
u_strlen(const UChar *s)
|
||||
{
|
||||
#if U_SIZEOF_WCHAR_T == U_SIZEOF_UCHAR
|
||||
|
@ -500,17 +500,17 @@ u_countChar32(const UChar *s, int32_t length) {
|
|||
return count;
|
||||
}
|
||||
|
||||
UChar *
|
||||
U_CAPI UChar * U_EXPORT2
|
||||
u_memcpy(UChar *dest, const UChar *src, int32_t count) {
|
||||
return (UChar *)uprv_memcpy(dest, src, count*U_SIZEOF_UCHAR);
|
||||
}
|
||||
|
||||
UChar *
|
||||
U_CAPI UChar * U_EXPORT2
|
||||
u_memmove(UChar *dest, const UChar *src, int32_t count) {
|
||||
return (UChar *)uprv_memmove(dest, src, count*U_SIZEOF_UCHAR);
|
||||
}
|
||||
|
||||
UChar *
|
||||
U_CAPI UChar * U_EXPORT2
|
||||
u_memset(UChar *dest, UChar c, int32_t count) {
|
||||
UChar *ptr = dest;
|
||||
UChar *limit = dest + count;
|
||||
|
@ -521,7 +521,7 @@ u_memset(UChar *dest, UChar c, int32_t count) {
|
|||
return dest;
|
||||
}
|
||||
|
||||
int32_t
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
u_memcmp(UChar *buf1, UChar *buf2, int32_t count) {
|
||||
UChar *limit = buf1 + count;
|
||||
int32_t result;
|
||||
|
@ -570,7 +570,7 @@ u_memcmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t count) {
|
|||
return (int32_t)c1-(int32_t)c2;
|
||||
}
|
||||
|
||||
UChar *
|
||||
U_CAPI UChar * U_EXPORT2
|
||||
u_memchr(UChar *src, UChar ch, int32_t count) {
|
||||
UChar *ptr = src;
|
||||
UChar *limit = src + count;
|
||||
|
@ -585,7 +585,7 @@ u_memchr(UChar *src, UChar ch, int32_t count) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
UChar *
|
||||
U_CAPI UChar * U_EXPORT2
|
||||
u_memchr32(UChar *src, UChar32 ch, int32_t count) {
|
||||
int32_t strItr = 0;
|
||||
int32_t lastIndex;
|
||||
|
@ -910,7 +910,8 @@ static int32_t u_astrnlen(const char *s1, int32_t n)
|
|||
return len;
|
||||
}
|
||||
|
||||
UChar* u_uastrncpy(UChar *ucs1,
|
||||
U_CAPI UChar* U_EXPORT2
|
||||
u_uastrncpy(UChar *ucs1,
|
||||
const char *s2,
|
||||
int32_t n)
|
||||
{
|
||||
|
@ -941,7 +942,8 @@ UChar* u_uastrncpy(UChar *ucs1,
|
|||
return ucs1;
|
||||
}
|
||||
|
||||
UChar* u_uastrcpy(UChar *ucs1,
|
||||
U_CAPI UChar* U_EXPORT2
|
||||
u_uastrcpy(UChar *ucs1,
|
||||
const char *s2 )
|
||||
{
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
@ -980,7 +982,8 @@ static int32_t u_ustrnlen(const UChar *ucs1, int32_t n)
|
|||
return len;
|
||||
}
|
||||
|
||||
char* u_austrncpy(char *s1,
|
||||
U_CAPI char* U_EXPORT2
|
||||
u_austrncpy(char *s1,
|
||||
const UChar *ucs2,
|
||||
int32_t n)
|
||||
{
|
||||
|
@ -1011,7 +1014,8 @@ char* u_austrncpy(char *s1,
|
|||
return s1;
|
||||
}
|
||||
|
||||
char* u_austrcpy(char *s1,
|
||||
U_CAPI char* U_EXPORT2
|
||||
u_austrcpy(char *s1,
|
||||
const UChar *ucs2 )
|
||||
{
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
@ -1043,7 +1047,7 @@ UBool ustring_cleanup(void) {
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
UConverter*
|
||||
U_CAPI UConverter* U_EXPORT2
|
||||
u_getDefaultConverter(UErrorCode *status)
|
||||
{
|
||||
UConverter *converter = NULL;
|
||||
|
@ -1070,7 +1074,7 @@ u_getDefaultConverter(UErrorCode *status)
|
|||
return converter;
|
||||
}
|
||||
|
||||
void
|
||||
U_CAPI void U_EXPORT2
|
||||
u_releaseDefaultConverter(UConverter *converter)
|
||||
{
|
||||
if(gDefaultConverter == NULL) {
|
||||
|
|
Loading…
Add table
Reference in a new issue