From d7e0797b2c92055facd0f2400a5caab14e32f50e Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Wed, 21 Aug 2002 19:12:24 +0000 Subject: [PATCH] ICU-2085 #ifdef out deprecated code X-SVN-Rev: 9756 --- icu4c/source/common/bidi.cpp | 7 +- icu4c/source/common/convert.cpp | 2 + icu4c/source/common/locid.cpp | 46 --- icu4c/source/common/normlzr.cpp | 4 + icu4c/source/common/putil.c | 2 + icu4c/source/common/resbund.cpp | 4 + icu4c/source/common/ucln_cmn.c | 2 + icu4c/source/common/ucln_cmn.h | 2 + icu4c/source/common/ucnv.c | 2 +- icu4c/source/common/udata.c | 2 +- icu4c/source/common/unicode.cpp | 2 + icu4c/source/common/unicode/bidi.h | 2 + icu4c/source/common/unicode/convert.h | 4 + icu4c/source/common/unicode/locid.h | 38 +-- icu4c/source/common/unicode/normlzr.h | 90 +++--- icu4c/source/common/unicode/putil.h | 2 + icu4c/source/common/unicode/resbund.h | 4 + icu4c/source/common/unicode/uchar.h | 414 +++++++++++++------------- icu4c/source/common/unicode/unicode.h | 2 + icu4c/source/common/unicode/unorm.h | 4 + icu4c/source/common/unicode/ures.h | 2 + icu4c/source/common/unicode/utypes.h | 24 +- icu4c/source/common/uresbund.c | 22 +- icu4c/source/common/uscript.c | 2 +- icu4c/source/i18n/calendar.cpp | 2 +- icu4c/source/i18n/choicfmt.cpp | 2 + icu4c/source/i18n/cpdtrans.cpp | 4 + icu4c/source/i18n/dcfmtsym.cpp | 2 +- icu4c/source/i18n/dtfmtsym.cpp | 6 +- icu4c/source/i18n/nultrans.cpp | 4 + icu4c/source/i18n/numfmt.cpp | 2 +- icu4c/source/i18n/rbnf.cpp | 2 +- icu4c/source/i18n/rbt.cpp | 4 + icu4c/source/i18n/tblcoll.cpp | 75 ++--- icu4c/source/i18n/translit.cpp | 6 + icu4c/source/i18n/transreg.cpp | 11 +- icu4c/source/i18n/ucln_in.c | 4 +- icu4c/source/i18n/ucln_in.h | 8 +- icu4c/source/i18n/ucol.cpp | 16 +- icu4c/source/i18n/ucol_bld.cpp | 3 +- icu4c/source/i18n/ucol_elm.cpp | 1 + icu4c/source/i18n/unicode/choicfmt.h | 4 + icu4c/source/i18n/unicode/coll.h | 90 +++--- icu4c/source/i18n/unicode/cpdtrans.h | 3 + icu4c/source/i18n/unicode/dtfmtsym.h | 2 + icu4c/source/i18n/unicode/nultrans.h | 2 + icu4c/source/i18n/unicode/rbt.h | 3 + icu4c/source/i18n/unicode/tblcoll.h | 2 + icu4c/source/i18n/unicode/timezone.h | 3 + icu4c/source/i18n/unicode/ucol.h | 38 +-- icu4c/source/i18n/unicode/unitohex.h | 3 + icu4c/source/i18n/unitohex.cpp | 4 + icu4c/source/i18n/utrans.cpp | 3 + 53 files changed, 511 insertions(+), 483 deletions(-) diff --git a/icu4c/source/common/bidi.cpp b/icu4c/source/common/bidi.cpp index 2199dbc1f80..e11fc8c78a0 100644 --- a/icu4c/source/common/bidi.cpp +++ b/icu4c/source/common/bidi.cpp @@ -12,16 +12,13 @@ * created by: Markus W. Scherer */ -/* set import/export definitions */ -#ifndef U_COMMON_IMPLEMENTATION -# define U_COMMON_IMPLEMENTATION -#endif - // provide an object for the implementations of the member functions of BiDi #include "unicode/bidi.h" +#ifdef ICU_UBIDI_USE_DEPRECATES U_NAMESPACE_BEGIN const char BiDi::fgClassID=0; U_NAMESPACE_END +#endif /* ICU_UBIDI_USE_DEPRECATES */ diff --git a/icu4c/source/common/convert.cpp b/icu4c/source/common/convert.cpp index 47dba565089..b150c26b650 100644 --- a/icu4c/source/common/convert.cpp +++ b/icu4c/source/common/convert.cpp @@ -8,6 +8,7 @@ #include "unicode/utypes.h" +#ifdef ICU_UNICODECONVERTER_USE_DEPRECATES U_NAMESPACE_BEGIN class Locale; @@ -486,3 +487,4 @@ UBool UnicodeConverter::isAmbiguous(void) const } U_NAMESPACE_END +#endif /* ICU_UNICODECONVERTER_USE_DEPRECATES */ diff --git a/icu4c/source/common/locid.cpp b/icu4c/source/common/locid.cpp index fa1d581f8dd..f07f8eb0119 100644 --- a/icu4c/source/common/locid.cpp +++ b/icu4c/source/common/locid.cpp @@ -100,9 +100,6 @@ void locale_set_default_internal(const char *id) { U_NAMESPACE_USE -#ifdef ICU_LOCID_USE_DEPRECATES - Locale::fgDefaultLocale.init(id); -#else if (gLocaleCache == NULL) { Locale::initLocaleCache(); } @@ -111,7 +108,6 @@ void locale_set_default_internal(const char *id) Mutex lock; gLocaleCache[eDEFAULT].init(id); } -#endif } U_NAMESPACE_END @@ -145,37 +141,6 @@ U_NAMESPACE_BEGIN * static variables */ #ifdef ICU_LOCID_USE_DEPRECATES -Locale Locale::fgDefaultLocale; - -/** - * Constant definitions - */ -const Locale Locale::ENGLISH("en"); -const Locale Locale::FRENCH("fr"); -const Locale Locale::GERMAN("de"); -const Locale Locale::ITALIAN("it"); -const Locale Locale::JAPANESE("ja"); -const Locale Locale::KOREAN("ko"); -const Locale Locale::CHINESE("zh"); -const Locale Locale::SIMPLIFIED_CHINESE("zh", "CN"); -const Locale Locale::TRADITIONAL_CHINESE("zh", "TW"); - -// Useful constant for country. - -const Locale Locale::FRANCE ("fr", "FR"); -const Locale Locale::GERMANY ("de", "DE"); -const Locale Locale::ITALY ("it", "IT"); -const Locale Locale::JAPAN ("ja", "JP"); -const Locale Locale::KOREA ("ko", "KR"); -const Locale Locale::CHINA ("zh", "CN"); -const Locale Locale::PRC ("zh", "CN"); -const Locale Locale::TAIWAN ("zh", "TW"); -const Locale Locale::UK ("en", "GB"); -const Locale Locale::US ("en", "US"); -const Locale Locale::CANADA ("en", "CA"); -const Locale Locale::CANADA_FRENCH("fr", "CA"); - -#else const Locale::LocaleProxy Locale::ENGLISH = {eENGLISH}; const Locale::LocaleProxy Locale::FRENCH = {eFRENCH}; const Locale::LocaleProxy Locale::GERMAN = {eGERMAN}; @@ -508,11 +473,7 @@ Locale::setToBogus() { const Locale& Locale::getDefault() { -#ifdef ICU_LOCID_USE_DEPRECATES - return fgDefaultLocale; -#else return getLocale(eDEFAULT); -#endif } void @@ -522,9 +483,6 @@ Locale::setDefault( const Locale& newLocale, if (U_FAILURE(status)) return; -#ifdef ICU_LOCID_USE_DEPRECATES - fgDefaultLocale = newLocale; -#else if (gLocaleCache == NULL) { initLocaleCache(); } @@ -533,7 +491,6 @@ Locale::setDefault( const Locale& newLocale, Mutex lock; gLocaleCache[eDEFAULT] = newLocale; } -#endif } Locale @@ -800,7 +757,6 @@ void Locale::setFromPOSIXID(const char *posixID) init(posixID); } -#ifndef ICU_LOCID_USE_DEPRECATES const Locale & Locale::getEnglish(void) { @@ -1000,7 +956,5 @@ Locale::initLocaleCache(void) } } -#endif - //eof U_NAMESPACE_END diff --git a/icu4c/source/common/normlzr.cpp b/icu4c/source/common/normlzr.cpp index e3769c8bd3d..f72feef6aba 100644 --- a/icu4c/source/common/normlzr.cpp +++ b/icu4c/source/common/normlzr.cpp @@ -50,6 +50,7 @@ Normalizer::Normalizer(const CharacterIterator& iter, UNormalizationMode mode) : // deprecated constructors +#ifdef ICU_NORMALIZER_USE_DEPRECATES Normalizer::Normalizer(const UnicodeString& str, EMode mode) : UObject(), fUMode(getUMode(mode)), fOptions(0), @@ -95,6 +96,7 @@ Normalizer::Normalizer(const CharacterIterator& iter, { init(iter.clone()); } +#endif /* ICU_NORMALIZER_USE_DEPRECATES */ Normalizer::Normalizer(const Normalizer ©) : UObject(copy), fUMode(copy.fUMode), fOptions(copy.fOptions), @@ -356,6 +358,7 @@ Normalizer::setIndexOnly(int32_t index) { clearBuffer(); } +#ifdef ICU_NORMALIZER_USE_DEPRECATES /** * Set the iteration position in the input text that is being normalized * and return the first normalized character at that position. @@ -379,6 +382,7 @@ UChar32 Normalizer::setIndex(int32_t index) { setIndexOnly(index); return current(); } +#endif /* ICU_NORMALIZER_USE_DEPRECATES */ /** * Return the first character in the normalized text-> This resets diff --git a/icu4c/source/common/putil.c b/icu4c/source/common/putil.c index 82bafe4556c..4e3601dfce8 100644 --- a/icu4c/source/common/putil.c +++ b/icu4c/source/common/putil.c @@ -602,6 +602,7 @@ uprv_digitsAfterDecimal(double x) return numDigits; } +#ifdef ICU_NEXTDOUBLE_USE_DEPRECATES U_CAPI double U_EXPORT2 uprv_nextDouble(double d, UBool next) { @@ -708,6 +709,7 @@ uprv_nextDouble(double d, UBool next) return d + last_eps; #endif } +#endif /* ICU_NEXTDOUBLE_USE_DEPRECATES */ static char* u_topNBytesOfDouble(double* d, int n) diff --git a/icu4c/source/common/resbund.cpp b/icu4c/source/common/resbund.cpp index ecf693ed3a8..1b12faac53d 100644 --- a/icu4c/source/common/resbund.cpp +++ b/icu4c/source/common/resbund.cpp @@ -190,6 +190,7 @@ ResourceBundle::ResourceBundle( const UnicodeString& path, constructForLocale(path, Locale::getDefault(), error); } +#ifdef ICU_RESOURCEBUNDLE_USE_DEPRECATES ResourceBundle::ResourceBundle(const wchar_t* path, const Locale& locale, UErrorCode& err) @@ -197,6 +198,7 @@ ResourceBundle::ResourceBundle(const wchar_t* path, { constructForLocale(path, locale, err); } +#endif /* ICU_RESOURCEBUNDLE_USE_DEPRECATES */ ResourceBundle::ResourceBundle(const ResourceBundle &other) :UObject(other), locName(NULL) @@ -273,6 +275,7 @@ ResourceBundle::constructForLocale(const UnicodeString& path, } } +#ifdef ICU_RESOURCEBUNDLE_USE_DEPRECATES void ResourceBundle::constructForLocale(const wchar_t* path, const Locale& locale, @@ -284,6 +287,7 @@ ResourceBundle::constructForLocale(const wchar_t* path, resource = ures_open(0, locale.getName(), &error); } } +#endif /* ICU_RESOURCEBUNDLE_USE_DEPRECATES */ UnicodeString ResourceBundle::getString(UErrorCode& status) const { int32_t len = 0; diff --git a/icu4c/source/common/ucln_cmn.c b/icu4c/source/common/ucln_cmn.c index 3152db863e3..89701b9d777 100644 --- a/icu4c/source/common/ucln_cmn.c +++ b/icu4c/source/common/ucln_cmn.c @@ -55,7 +55,9 @@ u_cleanup(void) locale_cleanup(); uloc_cleanup(); ustring_cleanup(); +#ifdef ICU_UNICODECONVERTER_USE_DEPRECATES UnicodeConverter_cleanup(); /* <-- deprecated code */ +#endif /* ICU_UNICODECONVERTER_USE_DEPRECATES */ ucnv_cleanup(); ucnv_io_cleanup(); ures_cleanup(); diff --git a/icu4c/source/common/ucln_cmn.h b/icu4c/source/common/ucln_cmn.h index cedc3586488..a267e0d9c36 100644 --- a/icu4c/source/common/ucln_cmn.h +++ b/icu4c/source/common/ucln_cmn.h @@ -33,9 +33,11 @@ U_CFUNC UBool uloc_cleanup(void); U_CFUNC UBool ustring_cleanup(void); +#ifdef ICU_UNICODECONVERTER_USE_DEPRECATES /* @deprecated this functionality is going away */ /* @return true if cleanup complete successfully*/ U_CFUNC UBool UnicodeConverter_cleanup(void); +#endif /* ICU_UNICODECONVERTER_USE_DEPRECATES */ U_CAPI UBool U_EXPORT2 ucnv_cleanup(void); diff --git a/icu4c/source/common/ucnv.c b/icu4c/source/common/ucnv.c index c38be71c93f..aac70a3c5eb 100644 --- a/icu4c/source/common/ucnv.c +++ b/icu4c/source/common/ucnv.c @@ -256,7 +256,7 @@ ucnv_safeClone(const UConverter* cnv, void *stackBuffer, int32_t *pBufferSize, U } if (U_SUCCESS(*status)) { - *status = U_SAFECLONE_ALLOCATED_ERROR; + *status = U_SAFECLONE_ALLOCATED_WARNING; } /* record the fact that memory was allocated */ diff --git a/icu4c/source/common/udata.c b/icu4c/source/common/udata.c index 9e62436fd0d..a09cf9f40fd 100644 --- a/icu4c/source/common/udata.c +++ b/icu4c/source/common/udata.c @@ -805,7 +805,7 @@ udata_setCommonData(const void *data, UErrorCode *pErrorCode) { /* do we already have common ICU data set? */ if(gCommonICUData != NULL) { - *pErrorCode=U_USING_DEFAULT_ERROR; + *pErrorCode=U_USING_DEFAULT_WARNING; return; } diff --git a/icu4c/source/common/unicode.cpp b/icu4c/source/common/unicode.cpp index faa40503172..5d61d313cc3 100644 --- a/icu4c/source/common/unicode.cpp +++ b/icu4c/source/common/unicode.cpp @@ -37,6 +37,7 @@ #include "unicode/uchar.h" #include "unicode/unicode.h" +#ifdef ICU_UNICODE_CLASS_USE_DEPRECATES U_NAMESPACE_BEGIN /* @@ -51,3 +52,4 @@ Unicode::operator=(const Unicode &) { return *this; } U_NAMESPACE_END +#endif /* ICU_UNICODE_CLASS_USE_DEPRECATES */ diff --git a/icu4c/source/common/unicode/bidi.h b/icu4c/source/common/unicode/bidi.h index 40c63758230..0ebb2b6b052 100644 --- a/icu4c/source/common/unicode/bidi.h +++ b/icu4c/source/common/unicode/bidi.h @@ -21,6 +21,7 @@ #include "unicode/uobject.h" #include "unicode/ubidi.h" +#ifdef ICU_UBIDI_USE_DEPRECATES #ifndef XP_CPLUSPLUS # error This is a C++ header file. #endif @@ -408,5 +409,6 @@ BiDi::writeReverse(const UChar *src, int32_t srcLength, } U_NAMESPACE_END +#endif /* ICU_UBIDI_USE_DEPRECATES */ #endif diff --git a/icu4c/source/common/unicode/convert.h b/icu4c/source/common/unicode/convert.h index 18519849436..c62ce235083 100644 --- a/icu4c/source/common/unicode/convert.h +++ b/icu4c/source/common/unicode/convert.h @@ -13,6 +13,8 @@ #define CONVERT_H #include "unicode/utypes.h" + +#ifdef ICU_UNICODECONVERTER_USE_DEPRECATES #include "unicode/uobject.h" #include "unicode/unistr.h" #include "unicode/ucnv.h" @@ -473,4 +475,6 @@ private: }; U_NAMESPACE_END +#endif /* ICU_UNICODECONVERTER_USE_DEPRECATES */ + #endif diff --git a/icu4c/source/common/unicode/locid.h b/icu4c/source/common/unicode/locid.h index b0a4699e58d..988442d19c4 100644 --- a/icu4c/source/common/unicode/locid.h +++ b/icu4c/source/common/unicode/locid.h @@ -177,37 +177,6 @@ U_NAMESPACE_BEGIN class U_COMMON_API Locale : public UObject { public: #ifdef ICU_LOCID_USE_DEPRECATES - /** - * Useful constants for language. - * @deprecated Remove after 2002-aug-31. Use one of the Locale get functions. - */ - static const Locale ENGLISH; - static const Locale FRENCH; - static const Locale GERMAN; - static const Locale ITALIAN; - static const Locale JAPANESE; - static const Locale KOREAN; - static const Locale CHINESE; - static const Locale SIMPLIFIED_CHINESE; - static const Locale TRADITIONAL_CHINESE; - - /** - * Useful constants for country. - * @deprecated Remove after 2002-aug-31. Use one of the Locale get functions. - */ - static const Locale FRANCE; - static const Locale GERMANY; - static const Locale ITALY; - static const Locale JAPAN; - static const Locale KOREA; - static const Locale CHINA; /* Alias for PRC */ - static const Locale PRC; /* Peoples Republic of China */ - static const Locale TAIWAN; - static const Locale UK; - static const Locale US; - static const Locale CANADA; - static const Locale CANADA_FRENCH; -#else /** * A proxy for the Locale. * This is defined to stay source code compatible and to remove static initialization. @@ -216,7 +185,8 @@ public: */ typedef struct U_COMMON_API LocaleProxy { - int32_t magicLocaleNumber; /* Try not to access this. This is not meant for normal use. */ + /* Try not to access this. This is not meant for normal use. */ + int32_t magicLocaleNumber; /** Calls Locale's equivalent function */ inline const char *getLanguage( ) const; @@ -726,8 +696,6 @@ private: // static int32_t localeListCount; #ifdef ICU_LOCID_USE_DEPRECATES - static Locale fgDefaultLocale; -#else friend struct LocaleProxy; #endif @@ -771,7 +739,7 @@ Locale::isBogus(void) const { return fIsBogus; } -#ifndef ICU_LOCID_USE_DEPRECATES +#ifdef ICU_LOCID_USE_DEPRECATES /* Proxy functions */ inline const char *Locale::LocaleProxy::getLanguage( ) const { diff --git a/icu4c/source/common/unicode/normlzr.h b/icu4c/source/common/unicode/normlzr.h index 1e901ee4245..58ff69dccd9 100644 --- a/icu4c/source/common/unicode/normlzr.h +++ b/icu4c/source/common/unicode/normlzr.h @@ -49,7 +49,7 @@ U_NAMESPACE_BEGIN * and previous() could not be used after setIndex(), next(), first(), and current(). * * Normalizer allows to start normalizing from anywhere in the input text by - * calling setIndexOnly(), setIndex(), first(), or last(). + * calling setIndexOnly(), first(), or last(). * Without calling any of these, the iterator will start at the beginning of the text. * * At any time, next() returns the next normalized code point (UChar32), @@ -57,13 +57,11 @@ U_NAMESPACE_BEGIN * previous() returns the previous normalized code point (UChar32), * with pre-decrement semantics (like CharacterIterator::previous32()). * - * current() and setIndex() return the current code point + * current() returns the current code point * (respectively the one at the newly set index) without moving * the getIndex(). Note that if the text at the current position * needs to be normalized, then these functions will do that. * (This is why current() is not const.) - * If you call setIndex() and then previous() then you normalize a piece of - * text (and get a code point from setIndex()) that you probably do not need. * It is more efficient to call setIndexOnly() instead, which does not * normalize. * @@ -454,6 +452,7 @@ public: */ UChar32 previous(void); +#ifdef ICU_NORMALIZER_USE_DEPRECATES /** * Set the iteration position in the input text that is being normalized * and return the first normalized character at that position. @@ -474,6 +473,7 @@ public: * @deprecated To be removed after 2002-aug-31. Use setIndexOnly(). */ UChar32 setIndex(int32_t index); +#endif /** * Set the iteration position in the input text that is being normalized, @@ -691,6 +691,30 @@ public: // Deprecated APIs //------------------------------------------------------------------------- + /** The options for a Normalizer object */ + enum { + /** + * Option to disable Hangul/Jamo composition and decomposition. + * This option applies to Korean text, + * which can be represented either in the Jamo alphabet or in Hangul + * characters, which are really just two or three Jamo combined + * into one visual glyph. Since Jamo takes up more storage space than + * Hangul, applications that process only Hangul text may wish to turn + * this option on when decomposing text. + *

+ * The Unicode standard treates Hangul to Jamo conversion as a + * canonical decomposition, so this option must be turned off if you + * wish to transform strings into one of the standard + * + * Unicode Normalization Forms. + *

+ * @see #setOption + * @deprecated To be removed (or moved to private for documentation) after 2002-aug-31. Obsolete option. + */ + IGNORE_HANGUL = 0x001 + }; + +#ifdef ICU_NORMALIZER_USE_DEPRECATES /** * This tells us what the bits in the "mode" mean. * @deprecated To be removed after 2002-sep-30. Use UNormalizationMode. @@ -796,29 +820,6 @@ public: FCD = FCD_BIT }; - /** The options for a Normalizer object */ - enum { - /** - * Option to disable Hangul/Jamo composition and decomposition. - * This option applies to Korean text, - * which can be represented either in the Jamo alphabet or in Hangul - * characters, which are really just two or three Jamo combined - * into one visual glyph. Since Jamo takes up more storage space than - * Hangul, applications that process only Hangul text may wish to turn - * this option on when decomposing text. - *

- * The Unicode standard treates Hangul to Jamo conversion as a - * canonical decomposition, so this option must be turned off if you - * wish to transform strings into one of the standard - * - * Unicode Normalization Forms. - *

- * @see #setOption - * @deprecated To be removed (or moved to private for documentation) after 2002-aug-31. Obsolete option. - */ - IGNORE_HANGUL = 0x001 - }; - /** * Creates a new Normalizer object for iterating over the * normalized form of a given string. @@ -1024,6 +1025,7 @@ public: * @deprecated To be removed after 2002-sep-30. Use UNormalizationMode. */ inline EMode getMode(void) const; +#endif /* ICU_NORMALIZER_USE_DEPRECATES */ private: //------------------------------------------------------------------------- @@ -1038,9 +1040,11 @@ private: void init(CharacterIterator *iter); void clearBuffer(void); +#ifdef ICU_NORMALIZER_USE_DEPRECATES // Helper, without UErrorCode, for easier transitional code // remove after 2002-sep-30 with EMode etc. inline static UNormalizationMode getUMode(EMode mode); +#endif /* ICU_NORMALIZER_USE_DEPRECATES */ //------------------------------------------------------------------------- // Private data @@ -1075,21 +1079,6 @@ inline UBool Normalizer::operator!= (const Normalizer& other) const { return ! operator==(other); } -inline void -Normalizer::normalize(const UnicodeString& source, - EMode mode, int32_t options, - UnicodeString& result, - UErrorCode &status) { - normalize(source, getUNormalizationMode(mode, status), options, result, status); -} - -inline UNormalizationCheckResult -Normalizer::quickCheck(const UnicodeString& source, - EMode mode, - UErrorCode &status) { - return quickCheck(source, getUNormalizationMode(mode, status), status); -} - inline UNormalizationCheckResult Normalizer::quickCheck(const UnicodeString& source, UNormalizationMode mode, @@ -1125,6 +1114,22 @@ Normalizer::compare(const UnicodeString &s1, const UnicodeString &s2, &errorCode); } +#ifdef ICU_NORMALIZER_USE_DEPRECATES +inline void +Normalizer::normalize(const UnicodeString& source, + EMode mode, int32_t options, + UnicodeString& result, + UErrorCode &status) { + normalize(source, getUNormalizationMode(mode, status), options, result, status); +} + +inline UNormalizationCheckResult +Normalizer::quickCheck(const UnicodeString& source, + EMode mode, + UErrorCode &status) { + return quickCheck(source, getUNormalizationMode(mode, status), status); +} + inline void Normalizer::setMode(EMode newMode) { UErrorCode status = U_ZERO_ERROR; @@ -1208,6 +1213,7 @@ inline Normalizer::EMode Normalizer::getNormalizerEMode( } return Normalizer::DECOMP_COMPAT; } +#endif /* ICU_NORMALIZER_USE_DEPRECATES */ U_NAMESPACE_END #endif // _NORMLZR diff --git a/icu4c/source/common/unicode/putil.h b/icu4c/source/common/unicode/putil.h index cd6a29a6a4a..d182de0eb78 100644 --- a/icu4c/source/common/unicode/putil.h +++ b/icu4c/source/common/unicode/putil.h @@ -214,6 +214,7 @@ U_CAPI const char* U_EXPORT2 uprv_getDefaultCodepage(void); */ U_CAPI const char* U_EXPORT2 uprv_getDefaultLocaleID(void); +#ifdef ICU_NEXTDOUBLE_USE_DEPRECATES /* * Finds the least double greater than d (if positive == true), * or the greatest double less than d (if positive == false). @@ -226,6 +227,7 @@ U_CAPI const char* U_EXPORT2 uprv_getDefaultLocaleID(void); * @deprecated This will be removed after 2002-Jun-30. Use the ChoiceFormat closures API instead. */ U_CAPI double U_EXPORT2 uprv_nextDouble(double d, UBool positive); +#endif /* ICU_NEXTDOUBLE_USE_DEPRECATES */ /** * Filesystem file and path separator characters. diff --git a/icu4c/source/common/unicode/resbund.h b/icu4c/source/common/unicode/resbund.h index 07f0ad33b54..73dc050039d 100644 --- a/icu4c/source/common/unicode/resbund.h +++ b/icu4c/source/common/unicode/resbund.h @@ -119,6 +119,7 @@ public: */ ResourceBundle(UErrorCode &err); +#ifdef ICU_RESOURCEBUNDLE_USE_DEPRECATES /** * Constructs a ResourceBundle * @@ -127,6 +128,7 @@ public: ResourceBundle(const wchar_t* path, const Locale& locale, UErrorCode& err); +#endif /* ICU_RESOURCEBUNDLE_USE_DEPRECATES */ /** * Standard constructor, onstructs a resource bundle for the locale-specific @@ -440,10 +442,12 @@ public: private: UResourceBundle *resource; void constructForLocale(const UnicodeString& path, const Locale& locale, UErrorCode& error); +#ifdef ICU_RESOURCEBUNDLE_USE_DEPRECATES /** *@deprecated Remove after Aug 2002 */ void constructForLocale(const wchar_t* path, const Locale& locale, UErrorCode& error); +#endif /* ICU_RESOURCEBUNDLE_USE_DEPRECATES */ Locale *locName; /** diff --git a/icu4c/source/common/unicode/uchar.h b/icu4c/source/common/unicode/uchar.h index d401623d52c..0f9644bcd64 100644 --- a/icu4c/source/common/unicode/uchar.h +++ b/icu4c/source/common/unicode/uchar.h @@ -97,7 +97,7 @@ U_CDECL_BEGIN * @see u_getUnicodeVersion * @draft ICU 2.1 */ -enum UProperty { +typedef enum UProperty { /** Binary property Alphabetic. Same as u_isUAlphabetic, different from u_isalpha. Lu+Ll+Lt+Lm+Lo+Nl+Other_Alphabetic @draft ICU 2.1 */ UCHAR_ALPHABETIC, @@ -261,17 +261,14 @@ enum UProperty { /** One more than the last constant for enumerated/integer Unicode properties. @draft ICU 2.2 */ UCHAR_INT_LIMIT -}; - -/** @draft ICU 2.1 */ -typedef enum UProperty UProperty; +} UProperty; /** * Data for enumerated Unicode general category types. * See http://www.unicode.org/Public/UNIDATA/UnicodeData.html . * @stable */ -enum UCharCategory +typedef enum UCharCategory { /** Non-category for unassigned and non-character code points. @stable */ U_UNASSIGNED = 0, @@ -337,9 +334,7 @@ enum UCharCategory U_FINAL_PUNCTUATION = 29, /** One higher than the last enum UCharCategory constant. @stable */ U_CHAR_CATEGORY_COUNT -}; - -typedef enum UCharCategory UCharCategory; +} UCharCategory; /** * U_GC_XX_MASK constants are bit flags corresponding to Unicode @@ -470,394 +465,240 @@ typedef enum UCharDirection UCharDirection; enum UBlockCode { /** @draft ICU 2.0 */ UBLOCK_BASIC_LATIN = 1, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_BASIC_LATIN = 1, /** @draft ICU 2.0 */ UBLOCK_LATIN_1_SUPPLEMENT=2, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_LATIN_1_SUPPLEMENT=2, /** @draft ICU 2.0 */ UBLOCK_LATIN_EXTENDED_A =3, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_LATIN_EXTENDED_A=3, /** @draft ICU 2.0 */ UBLOCK_LATIN_EXTENDED_B =4, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_LATIN_EXTENDED_B=4, /** @draft ICU 2.0 */ UBLOCK_IPA_EXTENSIONS =5, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_IPA_EXTENSIONS=5, /** @draft ICU 2.0 */ UBLOCK_SPACING_MODIFIER_LETTERS =6, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_SPACING_MODIFIER_LETTERS=6, /** @draft ICU 2.0 */ UBLOCK_COMBINING_DIACRITICAL_MARKS =7, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_COMBINING_DIACRITICAL_MARKS=7, /** * Unicode 3.2 renames this block to "Greek and Coptic". * @draft ICU 2.0 */ UBLOCK_GREEK =8, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_GREEK=8, /** @draft ICU 2.0 */ UBLOCK_CYRILLIC =9, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CYRILLIC=9, /** @draft ICU 2.0 */ UBLOCK_ARMENIAN =10, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ARMENIAN=10, /** @draft ICU 2.0 */ UBLOCK_HEBREW =11, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_HEBREW=11, /** @draft ICU 2.0 */ UBLOCK_ARABIC =12, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ARABIC=12, /** @draft ICU 2.0 */ UBLOCK_SYRIAC =13, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_SYRIAC=13, /** @draft ICU 2.0 */ UBLOCK_THAANA =14, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_THAANA=14, /** @draft ICU 2.0 */ UBLOCK_DEVANAGARI =15, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_DEVANAGARI=15, /** @draft ICU 2.0 */ UBLOCK_BENGALI =16, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_BENGALI=16, /** @draft ICU 2.0 */ UBLOCK_GURMUKHI =17, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_GURMUKHI=17, /** @draft ICU 2.0 */ UBLOCK_GUJARATI =18, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_GUJARATI=18, /** @draft ICU 2.0 */ UBLOCK_ORIYA =19, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ORIYA=19, /** @draft ICU 2.0 */ UBLOCK_TAMIL =20, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_TAMIL=20, /** @draft ICU 2.0 */ UBLOCK_TELUGU =21, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_TELUGU=21, /** @draft ICU 2.0 */ UBLOCK_KANNADA =22, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_KANNADA=22, /** @draft ICU 2.0 */ UBLOCK_MALAYALAM =23, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_MALAYALAM=23, /** @draft ICU 2.0 */ UBLOCK_SINHALA =24, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_SINHALA=24, /** @draft ICU 2.0 */ UBLOCK_THAI =25, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_THAI=25, /** @draft ICU 2.0 */ UBLOCK_LAO =26, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_LAO=26, /** @draft ICU 2.0 */ UBLOCK_TIBETAN =27, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_TIBETAN=27, /** @draft ICU 2.0 */ UBLOCK_MYANMAR =28, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_MYANMAR=28, /** @draft ICU 2.0 */ UBLOCK_GEORGIAN =29, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_GEORGIAN=29, /** @draft ICU 2.0 */ UBLOCK_HANGUL_JAMO =30, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_HANGUL_JAMO=30, /** @draft ICU 2.0 */ UBLOCK_ETHIOPIC =31, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ETHIOPIC=31, /** @draft ICU 2.0 */ UBLOCK_CHEROKEE =32, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CHEROKEE=32, /** @draft ICU 2.0 */ UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS =33, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS=33, /** @draft ICU 2.0 */ UBLOCK_OGHAM =34, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_OGHAM=34, /** @draft ICU 2.0 */ UBLOCK_RUNIC =35, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_RUNIC=35, /** @draft ICU 2.0 */ UBLOCK_KHMER =36, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_KHMER=36, /** @draft ICU 2.0 */ UBLOCK_MONGOLIAN =37, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_MONGOLIAN=37, /** @draft ICU 2.0 */ UBLOCK_LATIN_EXTENDED_ADDITIONAL =38, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_LATIN_EXTENDED_ADDITIONAL=38, /** @draft ICU 2.0 */ UBLOCK_GREEK_EXTENDED =39, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_GREEK_EXTENDED=39, /** @draft ICU 2.0 */ UBLOCK_GENERAL_PUNCTUATION =40, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_GENERAL_PUNCTUATION=40, /** @draft ICU 2.0 */ UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS =41, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_SUPERSCRIPTS_AND_SUBSCRIPTS=41, /** @draft ICU 2.0 */ UBLOCK_CURRENCY_SYMBOLS =42, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CURRENCY_SYMBOLS=42, /** * Unicode 3.2 renames this block to "Combining Diacritical Marks for Symbols". * @draft ICU 2.0 */ UBLOCK_COMBINING_MARKS_FOR_SYMBOLS =43, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_COMBINING_MARKS_FOR_SYMBOLS=43, /** @draft ICU 2.0 */ UBLOCK_LETTERLIKE_SYMBOLS =44, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_LETTERLIKE_SYMBOLS=44, /** @draft ICU 2.0 */ UBLOCK_NUMBER_FORMS =45, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_NUMBER_FORMS=45, /** @draft ICU 2.0 */ UBLOCK_ARROWS =46, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ARROWS=46, /** @draft ICU 2.0 */ UBLOCK_MATHEMATICAL_OPERATORS =47, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_MATHEMATICAL_OPERATORS=47, /** @draft ICU 2.0 */ UBLOCK_MISCELLANEOUS_TECHNICAL =48, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_MISCELLANEOUS_TECHNICAL=48, /** @draft ICU 2.0 */ UBLOCK_CONTROL_PICTURES =49, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CONTROL_PICTURES=49, /** @draft ICU 2.0 */ UBLOCK_OPTICAL_CHARACTER_RECOGNITION =50, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_OPTICAL_CHARACTER_RECOGNITION=50, /** @draft ICU 2.0 */ UBLOCK_ENCLOSED_ALPHANUMERICS =51, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ENCLOSED_ALPHANUMERICS=51, /** @draft ICU 2.0 */ UBLOCK_BOX_DRAWING =52, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_BOX_DRAWING=52, /** @draft ICU 2.0 */ UBLOCK_BLOCK_ELEMENTS =53, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_BLOCK_ELEMENTS=53, /** @draft ICU 2.0 */ UBLOCK_GEOMETRIC_SHAPES =54, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_GEOMETRIC_SHAPES=54, /** @draft ICU 2.0 */ UBLOCK_MISCELLANEOUS_SYMBOLS =55, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_MISCELLANEOUS_SYMBOLS=55, /** @draft ICU 2.0 */ UBLOCK_DINGBATS =56, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_DINGBATS=56, /** @draft ICU 2.0 */ UBLOCK_BRAILLE_PATTERNS =57, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_BRAILLE_PATTERNS=57, /** @draft ICU 2.0 */ UBLOCK_CJK_RADICALS_SUPPLEMENT =58, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CJK_RADICALS_SUPPLEMENT=58, /** @draft ICU 2.0 */ UBLOCK_KANGXI_RADICALS =59, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_KANGXI_RADICALS=59, /** @draft ICU 2.0 */ UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS =60, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_IDEOGRAPHIC_DESCRIPTION_CHARACTERS=60, /** @draft ICU 2.0 */ UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION =61, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CJK_SYMBOLS_AND_PUNCTUATION=61, /** @draft ICU 2.0 */ UBLOCK_HIRAGANA =62, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_HIRAGANA=62, /** @draft ICU 2.0 */ UBLOCK_KATAKANA =63, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_KATAKANA=63, /** @draft ICU 2.0 */ UBLOCK_BOPOMOFO =64, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_BOPOMOFO=64, /** @draft ICU 2.0 */ UBLOCK_HANGUL_COMPATIBILITY_JAMO =65, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_HANGUL_COMPATIBILITY_JAMO=65, /** @draft ICU 2.0 */ UBLOCK_KANBUN =66, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_KANBUN=66, /** @draft ICU 2.0 */ UBLOCK_BOPOMOFO_EXTENDED =67, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_BOPOMOFO_EXTENDED=67, /** @draft ICU 2.0 */ UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS =68, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ENCLOSED_CJK_LETTERS_AND_MONTHS=68, /** @draft ICU 2.0 */ UBLOCK_CJK_COMPATIBILITY =69, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CJK_COMPATIBILITY=69, /** @draft ICU 2.0 */ UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A =70, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A=70, /** @draft ICU 2.0 */ UBLOCK_CJK_UNIFIED_IDEOGRAPHS =71, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CJK_UNIFIED_IDEOGRAPHS=71, /** @draft ICU 2.0 */ UBLOCK_YI_SYLLABLES =72, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_YI_SYLLABLES=72, /** @draft ICU 2.0 */ UBLOCK_YI_RADICALS =73, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_YI_RADICALS=73, /** @draft ICU 2.0 */ UBLOCK_HANGUL_SYLLABLES =74, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_HANGUL_SYLLABLES=74, /** @draft ICU 2.0 */ UBLOCK_HIGH_SURROGATES =75, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_HIGH_SURROGATES=75, /** @draft ICU 2.0 */ UBLOCK_HIGH_PRIVATE_USE_SURROGATES =76, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_HIGH_PRIVATE_USE_SURROGATES=76, /** @draft ICU 2.0 */ UBLOCK_LOW_SURROGATES =77, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_LOW_SURROGATES=77, /** * Same as UBLOCK_PRIVATE_USE_AREA. @@ -879,53 +720,33 @@ enum UBlockCode { * @draft ICU 2.0 */ UBLOCK_PRIVATE_USE_AREA =UBLOCK_PRIVATE_USE, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_PRIVATE_USE_AREA=78, /** @draft ICU 2.0 */ UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS =79, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CJK_COMPATIBILITY_IDEOGRAPHS=79, /** @draft ICU 2.0 */ UBLOCK_ALPHABETIC_PRESENTATION_FORMS =80, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ALPHABETIC_PRESENTATION_FORMS=80, /** @draft ICU 2.0 */ UBLOCK_ARABIC_PRESENTATION_FORMS_A =81, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ARABIC_PRESENTATION_FORMS_A=81, /** @draft ICU 2.0 */ UBLOCK_COMBINING_HALF_MARKS =82, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_COMBINING_HALF_MARKS=82, /** @draft ICU 2.0 */ UBLOCK_CJK_COMPATIBILITY_FORMS =83, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_CJK_COMPATIBILITY_FORMS=83, /** @draft ICU 2.0 */ UBLOCK_SMALL_FORM_VARIANTS =84, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_SMALL_FORM_VARIANTS=84, /** @draft ICU 2.0 */ UBLOCK_ARABIC_PRESENTATION_FORMS_B =85, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_ARABIC_PRESENTATION_FORMS_B=85, /** @draft ICU 2.0 */ UBLOCK_SPECIALS =86, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_SPECIALS=86, /** @draft ICU 2.0 */ UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS =87, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_HALFWIDTH_AND_FULLWIDTH_FORMS=87, /** @draft ICU 2.0 */ UBLOCK_OLD_ITALIC = 88 , @@ -979,16 +800,192 @@ enum UBlockCode { /** @draft ICU 2.0 */ UBLOCK_COUNT, - /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ - U_SCRIPT_COUNT=UBLOCK_COUNT, /** @draft ICU 2.0 */ UBLOCK_INVALID_CODE=-1, +#ifdef ICU_UCHAR_USE_DEPRECATES + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_BASIC_LATIN = 1, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_LATIN_1_SUPPLEMENT=2, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_LATIN_EXTENDED_A=3, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_LATIN_EXTENDED_B=4, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_IPA_EXTENSIONS=5, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_SPACING_MODIFIER_LETTERS=6, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_COMBINING_DIACRITICAL_MARKS=7, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_GREEK=8, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CYRILLIC=9, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ARMENIAN=10, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_HEBREW=11, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ARABIC=12, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_SYRIAC=13, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_THAANA=14, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_DEVANAGARI=15, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_BENGALI=16, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_GURMUKHI=17, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_GUJARATI=18, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ORIYA=19, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_TAMIL=20, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_TELUGU=21, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_KANNADA=22, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_MALAYALAM=23, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_SINHALA=24, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_THAI=25, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_LAO=26, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_TIBETAN=27, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_MYANMAR=28, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_GEORGIAN=29, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_HANGUL_JAMO=30, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ETHIOPIC=31, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CHEROKEE=32, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS=33, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_OGHAM=34, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_RUNIC=35, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_KHMER=36, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_MONGOLIAN=37, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_LATIN_EXTENDED_ADDITIONAL=38, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_GREEK_EXTENDED=39, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_GENERAL_PUNCTUATION=40, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_SUPERSCRIPTS_AND_SUBSCRIPTS=41, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CURRENCY_SYMBOLS=42, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_COMBINING_MARKS_FOR_SYMBOLS=43, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_LETTERLIKE_SYMBOLS=44, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_NUMBER_FORMS=45, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ARROWS=46, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_MATHEMATICAL_OPERATORS=47, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_MISCELLANEOUS_TECHNICAL=48, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CONTROL_PICTURES=49, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_OPTICAL_CHARACTER_RECOGNITION=50, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ENCLOSED_ALPHANUMERICS=51, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_BOX_DRAWING=52, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_BLOCK_ELEMENTS=53, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_GEOMETRIC_SHAPES=54, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_MISCELLANEOUS_SYMBOLS=55, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_DINGBATS=56, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_BRAILLE_PATTERNS=57, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CJK_RADICALS_SUPPLEMENT=58, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_KANGXI_RADICALS=59, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_IDEOGRAPHIC_DESCRIPTION_CHARACTERS=60, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CJK_SYMBOLS_AND_PUNCTUATION=61, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_HIRAGANA=62, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_KATAKANA=63, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_BOPOMOFO=64, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_HANGUL_COMPATIBILITY_JAMO=65, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_KANBUN=66, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_BOPOMOFO_EXTENDED=67, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ENCLOSED_CJK_LETTERS_AND_MONTHS=68, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CJK_COMPATIBILITY=69, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A=70, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CJK_UNIFIED_IDEOGRAPHS=71, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_YI_SYLLABLES=72, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_YI_RADICALS=73, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_HANGUL_SYLLABLES=74, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_HIGH_SURROGATES=75, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_HIGH_PRIVATE_USE_SURROGATES=76, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_LOW_SURROGATES=77, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_PRIVATE_USE_AREA=78, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CJK_COMPATIBILITY_IDEOGRAPHS=79, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ALPHABETIC_PRESENTATION_FORMS=80, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ARABIC_PRESENTATION_FORMS_A=81, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_COMBINING_HALF_MARKS=82, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_CJK_COMPATIBILITY_FORMS=83, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_SMALL_FORM_VARIANTS=84, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_ARABIC_PRESENTATION_FORMS_B=85, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_SPECIALS=86, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_HALFWIDTH_AND_FULLWIDTH_FORMS=87, + /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ + U_SCRIPT_COUNT=UBLOCK_COUNT, /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ U_CHAR_SCRIPT_COUNT =UBLOCK_COUNT, /** @deprecated Use the enum that begins with UBLOCK. Remove after Aug, 2002*/ U_NO_SCRIPT = UBLOCK_COUNT +#endif /* ICU_UCHAR_USE_DEPRECATES */ }; /** @draft ICU 2.0 */ @@ -998,7 +995,7 @@ typedef enum UBlockCode UBlockCode; * Values returned by the u_getCellWidth() function. * @deprecated To be removed after 2003-jun-30; use UCHAR_EAST_ASIAN_WIDTH. */ -enum UCellWidth +typedef enum UCellWidth { /** @stable */ U_ZERO_WIDTH = 0, @@ -1010,18 +1007,16 @@ enum UCellWidth U_NEUTRAL_WIDTH = 3, /** @stable */ U_CELL_WIDTH_COUNT -}; - -/** @deprecated To be removed after 2003-jun-30; use UCHAR_EAST_ASIAN_WIDTH. */ -typedef enum UCellWidth UCellWidth; +} UCellWidth; /** * East Asian Width constants. * * @see UCHAR_EAST_ASIAN_WIDTH + * @see u_getIntPropertyValue * @draft ICU 2.2 */ -enum UEastAsianWidth { +typedef enum UEastAsianWidth { U_EA_NEUTRAL, U_EA_AMBIGUOUS, U_EA_HALFWIDTH, @@ -1029,8 +1024,7 @@ enum UEastAsianWidth { U_EA_NARROW, U_EA_WIDE, U_EA_COUNT -}; -typedef enum UEastAsianWidth UEastAsianWidth; +} UEastAsianWidth; /* * Implementation note: * Keep UEastAsianWidth constant values in sync with names list in genprops/props2.c. @@ -1047,15 +1041,12 @@ typedef enum UEastAsianWidth UEastAsianWidth; * @see u_charName * @stable */ -enum UCharNameChoice { +typedef enum UCharNameChoice { U_UNICODE_CHAR_NAME, U_UNICODE_10_CHAR_NAME, U_EXTENDED_CHAR_NAME, U_CHAR_NAME_CHOICE_COUNT -}; - -/** @stable */ -typedef enum UCharNameChoice UCharNameChoice; +} UCharNameChoice; /** * Decomposition Type constants. @@ -1063,7 +1054,7 @@ typedef enum UCharNameChoice UCharNameChoice; * @see UCHAR_DECOMPOSITION_TYPE * @draft ICU 2.2 */ -enum UDecompositionType { +typedef enum UDecompositionType { U_DT_NONE, U_DT_CANONICAL, U_DT_COMPAT, @@ -1083,8 +1074,7 @@ enum UDecompositionType { U_DT_VERTICAL, U_DT_WIDE, U_DT_COUNT /* 18 */ -}; -typedef enum UDecompositionType UDecompositionType; +} UDecompositionType; /** * Joining Type constants. @@ -1092,7 +1082,7 @@ typedef enum UDecompositionType UDecompositionType; * @see UCHAR_JOINING_TYPE * @draft ICU 2.2 */ -enum UJoiningType { +typedef enum UJoiningType { U_JT_NON_JOINING, U_JT_JOIN_CAUSING, U_JT_DUAL_JOINING, @@ -1100,8 +1090,7 @@ enum UJoiningType { U_JT_RIGHT_JOINING, U_JT_TRANSPARENT, U_JT_COUNT /* 6 */ -}; -typedef enum UJoiningType UJoiningType; +} UJoiningType; /** * Joining Group constants. @@ -1109,7 +1098,7 @@ typedef enum UJoiningType UJoiningType; * @see UCHAR_JOINING_GROUP * @draft ICU 2.2 */ -enum UJoiningGroup { +typedef enum UJoiningGroup { U_JG_NO_JOINING_GROUP, U_JG_AIN, U_JG_ALAPH, @@ -1162,8 +1151,7 @@ enum UJoiningGroup { U_JG_YUDH_HE, U_JG_ZAIN, U_JG_COUNT /* 51 */ -}; -typedef enum UJoiningGroup UJoiningGroup; +} UJoiningGroup; /** * Line Break constants. @@ -1171,7 +1159,7 @@ typedef enum UJoiningGroup UJoiningGroup; * @see UCHAR_LINE_BREAK * @draft ICU 2.2 */ -enum ULineBreak { +typedef enum ULineBreak { U_LB_UNKNOWN, U_LB_AMBIGUOUS, U_LB_ALPHABETIC, @@ -1202,8 +1190,7 @@ enum ULineBreak { U_LB_BREAK_SYMBOLS, U_LB_ZWSPACE, U_LB_COUNT /* 29 */ -}; -typedef enum ULineBreak ULineBreak; +} ULineBreak; /** * Numeric Type constants. @@ -1211,14 +1198,13 @@ typedef enum ULineBreak ULineBreak; * @see UCHAR_NUMERIC_TYPE * @draft ICU 2.2 */ -enum UNumericType { +typedef enum UNumericType { U_NT_NONE, U_NT_DECIMAL, U_NT_DIGIT, U_NT_NUMERIC, U_NT_COUNT -}; -typedef enum UNumericType UNumericType; +} UNumericType; /** * Check a binary Unicode property for a code point. @@ -2302,12 +2288,14 @@ U_CAPI int32_t U_EXPORT2 u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *pErrorCode); +#ifdef ICU_UCHAR_USE_DEPRECATES /** *@deprecated Use u_charBlock instead. Remove after Aug,2002 */ #define u_charScript ublock_getCode /** @deprecated Use the enum UCharBlock instead. Remove after Aug,2002*/ typedef UBlockCode UCharScript; +#endif /* ICU_UCHAR_USE_DEPRECATES */ U_CDECL_END diff --git a/icu4c/source/common/unicode/unicode.h b/icu4c/source/common/unicode/unicode.h index 83dc9ee6be4..42c72ed1b4f 100644 --- a/icu4c/source/common/unicode/unicode.h +++ b/icu4c/source/common/unicode/unicode.h @@ -30,6 +30,7 @@ #include "unicode/utypes.h" #include "unicode/uchar.h" +#ifdef ICU_UNICODE_CLASS_USE_DEPRECATES U_NAMESPACE_BEGIN /** * This class is deprecated and will be removed. @@ -1352,5 +1353,6 @@ Unicode::getUnicodeVersion(UVersionInfo versionArray) { u_getUnicodeVersion(versionArray); } U_NAMESPACE_END +#endif /* ICU_UNICODE_CLASS_USE_DEPRECATES */ #endif diff --git a/icu4c/source/common/unicode/unorm.h b/icu4c/source/common/unicode/unorm.h index 506758d1279..2682e7758d6 100644 --- a/icu4c/source/common/unicode/unorm.h +++ b/icu4c/source/common/unicode/unorm.h @@ -142,6 +142,7 @@ typedef enum { /* *** The rest of this enum is entirely deprecated. *** */ +#ifdef ICU_UNORM_USE_DEPRECATES /** * No decomposition/composition * @deprecated To be removed after 2002-sep-30, use UNORM_NONE. @@ -178,6 +179,7 @@ typedef enum { * @deprecated To be removed without replacement after 2002-mar-31. */ UCOL_IGNORE_HANGUL = 16, +#endif /* ICU_UNORM_USE_DEPRECATES */ /** * Do not normalize Hangul. * @deprecated To be removed without replacement after 2002-mar-31. @@ -210,12 +212,14 @@ unorm_normalize(const UChar *source, int32_t sourceLength, UChar *result, int32_t resultLength, UErrorCode *status); +#ifdef ICU_UNORM_USE_DEPRECATES /** * The function u_normalize() has been renamed to unorm_normalize() * for consistency. The old name is deprecated. * @deprecated To be removed after 2002-mar-31. */ #define u_normalize unorm_normalize +#endif /* ICU_UNORM_USE_DEPRECATES */ /** * Result values for unorm_quickCheck(). diff --git a/icu4c/source/common/unicode/ures.h b/icu4c/source/common/unicode/ures.h index 9b88c70de9a..71227156f61 100644 --- a/icu4c/source/common/unicode/ures.h +++ b/icu4c/source/common/unicode/ures.h @@ -207,6 +207,7 @@ ures_openDirect(const char* path, const char* locale, UErrorCode* status); +#ifdef ICU_URES_USE_DEPRECATES /** *Opens a UResourceBundle, from which users can extract strings by using *their corresponding keys. This version of open requires the path @@ -230,6 +231,7 @@ U_CAPI UResourceBundle* U_EXPORT2 ures_openW(const wchar_t* path, const char* locale, UErrorCode* status); +#endif /* ICU_URES_USE_DEPRECATES */ /** * Same as ures_open() but takes a const UChar *path. diff --git a/icu4c/source/common/unicode/utypes.h b/icu4c/source/common/unicode/utypes.h index 3cdc1be9ab4..b3e2d240680 100644 --- a/icu4c/source/common/unicode/utypes.h +++ b/icu4c/source/common/unicode/utypes.h @@ -354,21 +354,12 @@ typedef enum UErrorCode { */ U_USING_FALLBACK_WARNING = -128, /**< A resource bundle lookup returned a fallback result (not an error) */ - /** @deprecated remove after 09/01/2002. use the enum that ends in _WARNING */ - U_USING_FALLBACK_ERROR = -128, /**< A resource bundle lookup returned a fallback result (not an error) */ U_ERROR_WARNING_START = -128, /**< Start of information results (semantically successful) */ - /** @deprecated remove after 09/01/2002. use the enum that ends in _WARNING */ - U_ERROR_INFO_START = U_ERROR_WARNING_START, /**< Start of information results (semantically successful) */ - U_USING_DEFAULT_WARNING = -127, /**< A resource bundle lookup returned a result from the root locale (not an error) */ - /** @deprecated remove after 09/01/2002. use the enum that ends in _WARNING */ - U_USING_DEFAULT_ERROR = -127, /**< A resource bundle lookup returned a result from the root locale (not an error) */ U_SAFECLONE_ALLOCATED_WARNING = -126, /**< A SafeClone operation required allocating memory (informational only) */ - /** @deprecated remove after 09/01/2002. use the enum that ends in _WARNING */ - U_SAFECLONE_ALLOCATED_ERROR = -126, /**< A SafeClone operation required allocating memory (informational only) */ U_STATE_OLD_WARNING = -125, /**< ICU has to use compatibility layer to construct the service. Expect performance/memory usage degradation. Consider upgrading */ @@ -378,10 +369,21 @@ typedef enum UErrorCode { U_AMBIGUOUS_ALIAS_WARNING = -122, /**< This converter alias can go to different converter implementations */ - U_ERROR_WARNING_LIMIT, /**< This must always be the last warning value to indicate the limit for UErrorCode warnings (last warning code +1) */ - + U_ERROR_WARNING_LIMIT, /**< This must always be the last warning value to indicate the limit for UErrorCode warnings (last warning code +1) */ + +#ifdef ICU_UERRORCODE_USE_DEPRECATES + /** @deprecated remove after 09/01/2002. use the enum that ends in _WARNING */ + U_USING_FALLBACK_ERROR = -128, /**< A resource bundle lookup returned a fallback result (not an error) */ + /** @deprecated remove after 09/01/2002. use the enum that ends in _WARNING */ + U_ERROR_INFO_START = U_ERROR_WARNING_START, /**< Start of information results (semantically successful) */ + /** @deprecated remove after 09/01/2002. use the enum that ends in _WARNING */ + U_USING_DEFAULT_ERROR = -127, /**< A resource bundle lookup returned a result from the root locale (not an error) */ + /** @deprecated remove after 09/01/2002. use the enum that ends in _WARNING */ + U_SAFECLONE_ALLOCATED_ERROR = -126, /**< A SafeClone operation required allocating memory (informational only) */ /** @deprecated remove after 09/01/2002. use the enum that ends in _WARNING */ U_ERROR_INFO_LIMIT = U_ERROR_WARNING_LIMIT, /**< This must always be the last warning value to indicate the limit for UErrorCode warnings (last warning code +1) */ +#endif /* ICU_UERRORCODE_USE_DEPRECATES */ + U_ZERO_ERROR = 0, /**< No error, no warning. */ diff --git a/icu4c/source/common/uresbund.c b/icu4c/source/common/uresbund.c index 6b5d8d42414..42f8ecac470 100644 --- a/icu4c/source/common/uresbund.c +++ b/icu4c/source/common/uresbund.c @@ -120,9 +120,9 @@ static const ResourceData *getFallbackData(const UResourceBundle* resBundle, con if(*res != RES_BOGUS) { /* If the resource is found in parents, we need to adjust the error */ if(i>1) { if(uprv_strcmp(resB->fName, uloc_getDefault())==0 || uprv_strcmp(resB->fName, kRootLocaleName)==0) { - *status = U_USING_DEFAULT_ERROR; + *status = U_USING_DEFAULT_WARNING; } else { - *status = U_USING_FALLBACK_ERROR; + *status = U_USING_FALLBACK_WARNING; } } *realData = resB; @@ -316,8 +316,8 @@ static UResourceDataEntry *init_entry(const char *localeID, const char *path, UE if (result == FALSE || U_FAILURE(*status)) { /* we have no such entry in dll, so it will always use fallback */ - *status = U_USING_FALLBACK_ERROR; - r->fBogus = U_USING_FALLBACK_ERROR; + *status = U_USING_FALLBACK_WARNING; + r->fBogus = U_USING_FALLBACK_WARNING; } else { /* if we have a regular entry */ /* We might be able to do this a wee bit more efficiently (we could check whether the aliased data) */ /* is already in the cache), but it's good the way it is */ @@ -332,8 +332,8 @@ static UResourceDataEntry *init_entry(const char *localeID, const char *path, UE result = res_load(&(r->fData), r->fPath, aliasName, status); if (result == FALSE || U_FAILURE(*status)) { /* we couldn't load aliased data - so we have no data */ - *status = U_USING_FALLBACK_ERROR; - r->fBogus = U_USING_FALLBACK_ERROR; + *status = U_USING_FALLBACK_WARNING; + r->fBogus = U_USING_FALLBACK_WARNING; } setEntryName(r, aliasName, status); } @@ -383,7 +383,7 @@ static UResourceDataEntry *findFirstExisting(const char* path, char* name, UBool r->fCountExisting--; /*entryCloseInt(r);*/ r = NULL; - *status = U_USING_FALLBACK_ERROR; + *status = U_USING_FALLBACK_WARNING; } else { uprv_strcpy(name, r->fName); /* this is needed for supporting aliases */ } @@ -438,7 +438,7 @@ static UResourceDataEntry *entryOpen(const char* path, const char* localeID, UEr /* insert default locale */ uprv_strcpy(name, uloc_getDefault()); r = findFirstExisting(path, name, &isRoot, &hasChopped, &isDefault, &intStatus); - intStatus = U_USING_DEFAULT_ERROR; + intStatus = U_USING_DEFAULT_WARNING; if(r != NULL) { /* the default locale exists */ t1 = r; hasRealData = TRUE; @@ -460,7 +460,7 @@ static UResourceDataEntry *entryOpen(const char* path, const char* localeID, UEr r = findFirstExisting(path, name, &isRoot, &hasChopped, &isDefault, &intStatus); if(r != NULL) { t1 = r; - intStatus = U_USING_DEFAULT_ERROR; + intStatus = U_USING_DEFAULT_WARNING; hasRealData = TRUE; } else { /* we don't even have the root locale */ *status = U_MISSING_RESOURCE_ERROR; @@ -469,7 +469,7 @@ static UResourceDataEntry *entryOpen(const char* path, const char* localeID, UEr /* insert root locale */ t2 = init_entry(kRootLocaleName, r->fPath, status); if(!hasRealData) { - r->fBogus = U_USING_DEFAULT_ERROR; + r->fBogus = U_USING_DEFAULT_WARNING; } hasRealData = (UBool)((t2->fBogus == U_ZERO_ERROR) | hasRealData); t1->fParent = t2; @@ -1470,6 +1470,7 @@ ures_open(const char* path, return r; } +#ifdef ICU_URES_USE_DEPRECATES U_CAPI UResourceBundle* U_EXPORT2 ures_openW(const wchar_t* myPath, const char* localeID, @@ -1497,6 +1498,7 @@ ures_openW(const wchar_t* myPath, return r; } +#endif /* ICU_URES_USE_DEPRECATES */ U_CAPI UResourceBundle* U_EXPORT2 ures_openU(const UChar* myPath, diff --git a/icu4c/source/common/uscript.c b/icu4c/source/common/uscript.c index 1bd422492c4..14b355720b6 100644 --- a/icu4c/source/common/uscript.c +++ b/icu4c/source/common/uscript.c @@ -217,7 +217,7 @@ uscript_getCode(const char* nameOrAbbrOrLocale, /* Do not propagate error codes from just not finding a locale bundle. */ UErrorCode localErrorCode = U_ZERO_ERROR; UResourceBundle* resB = ures_open(u_getDataDirectory(),nameOrAbbrOrLocale,&localErrorCode); - if(U_SUCCESS(localErrorCode)&& localErrorCode != U_USING_DEFAULT_ERROR){ + if(U_SUCCESS(localErrorCode)&& localErrorCode != U_USING_DEFAULT_WARNING){ UResourceBundle* resD = ures_getByKey(resB,kLocaleScript,NULL,&localErrorCode); int index =0; if(U_SUCCESS(localErrorCode) ){ diff --git a/icu4c/source/i18n/calendar.cpp b/icu4c/source/i18n/calendar.cpp index b3c3ae23e57..eb3fa146944 100644 --- a/icu4c/source/i18n/calendar.cpp +++ b/icu4c/source/i18n/calendar.cpp @@ -799,7 +799,7 @@ Calendar::setWeekCountData(const Locale& desiredLocale, UErrorCode& status) // hard-coded data. if (U_FAILURE(status)) { - status = U_USING_FALLBACK_ERROR; + status = U_USING_FALLBACK_WARNING; ures_close(resource); return; } diff --git a/icu4c/source/i18n/choicfmt.cpp b/icu4c/source/i18n/choicfmt.cpp index b96167b8697..68754ee0c7a 100644 --- a/icu4c/source/i18n/choicfmt.cpp +++ b/icu4c/source/i18n/choicfmt.cpp @@ -695,11 +695,13 @@ ChoiceFormat::clone() const // ------------------------------------- +#ifdef ICU_NEXTDOUBLE_USE_DEPRECATES double ChoiceFormat::nextDouble( double d, UBool positive ) { return uprv_nextDouble( d, positive ); } +#endif /* ICU_NEXTDOUBLE_USE_DEPRECATES */ U_NAMESPACE_END diff --git a/icu4c/source/i18n/cpdtrans.cpp b/icu4c/source/i18n/cpdtrans.cpp index 8240e40a0d8..747cff18609 100644 --- a/icu4c/source/i18n/cpdtrans.cpp +++ b/icu4c/source/i18n/cpdtrans.cpp @@ -7,6 +7,10 @@ * 11/17/99 aliu Creation. ********************************************************************** */ + +/* These APIs are becoming private */ +#define ICU_COMPOUNDTRANSLITERATOR_USE_DEPRECATES 1 + #include "unicode/cpdtrans.h" #include "unicode/unifilt.h" #include "unicode/unifltlg.h" diff --git a/icu4c/source/i18n/dcfmtsym.cpp b/icu4c/source/i18n/dcfmtsym.cpp index 061aba956b9..b019fa340e9 100644 --- a/icu4c/source/i18n/dcfmtsym.cpp +++ b/icu4c/source/i18n/dcfmtsym.cpp @@ -118,7 +118,7 @@ DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status, // Initializes with last resort data if necessary. if (useLastResortData) { - status = U_USING_FALLBACK_ERROR; + status = U_USING_FALLBACK_WARNING; initialize(); } return; diff --git a/icu4c/source/i18n/dtfmtsym.cpp b/icu4c/source/i18n/dtfmtsym.cpp index cd42c42aad7..4461a89c90f 100644 --- a/icu4c/source/i18n/dtfmtsym.cpp +++ b/icu4c/source/i18n/dtfmtsym.cpp @@ -104,6 +104,7 @@ static const UChar gLastResortZoneStrings[5][4] = {0x0047, 0x004D, 0x0054, 0x0000} /* "GMT" */ }; +#ifdef ICU_DATEFORMATSYMBOLS_USE_DEPRECATES static UnicodeString *gPatternCharsStr = NULL; U_CFUNC UBool dateFormatSymbols_cleanup() { @@ -112,6 +113,7 @@ U_CFUNC UBool dateFormatSymbols_cleanup() { } return TRUE; } +#endif U_NAMESPACE_BEGIN @@ -442,6 +444,7 @@ DateFormatSymbols::setZoneStrings(const UnicodeString* const *strings, int32_t r //------------------------------------------------------ +#ifdef ICU_DATEFORMATSYMBOLS_USE_DEPRECATES const UnicodeString& DateFormatSymbols::getPatternChars(void) { @@ -452,6 +455,7 @@ DateFormatSymbols::getPatternChars(void) } return *gPatternCharsStr; } +#endif //------------------------------------------------------ @@ -536,7 +540,7 @@ DateFormatSymbols::initializeData(const Locale& locale, UErrorCode& status, UBoo // we just need to produce something that will be semi-intelligible // in most locales. - status = U_USING_FALLBACK_ERROR; + status = U_USING_FALLBACK_WARNING; initField(&fEras, fErasCount, (const UChar *)gLastResortEras, kEraNum, kEraLen, status); initField(&fMonths, fMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status); diff --git a/icu4c/source/i18n/nultrans.cpp b/icu4c/source/i18n/nultrans.cpp index fa4d130f23d..fc696e3e478 100644 --- a/icu4c/source/i18n/nultrans.cpp +++ b/icu4c/source/i18n/nultrans.cpp @@ -7,6 +7,10 @@ * 01/11/2000 aliu Creation. ********************************************************************** */ + +/* These APIs are becoming private */ +#define ICU_NULLTRANSLITERATOR_USE_DEPRECATES 1 + #include "unicode/nultrans.h" U_NAMESPACE_BEGIN diff --git a/icu4c/source/i18n/numfmt.cpp b/icu4c/source/i18n/numfmt.cpp index b08a46af07b..de0366dec47 100644 --- a/icu4c/source/i18n/numfmt.cpp +++ b/icu4c/source/i18n/numfmt.cpp @@ -425,7 +425,7 @@ NumberFormat::createInstance(const Locale& desiredLocale, if (U_FAILURE(status)) { // We don't appear to have resource data available -- use the last-resort data - status = U_USING_FALLBACK_ERROR; + status = U_USING_FALLBACK_WARNING; // Use the DecimalFormatSymbols constructor which uses last-resort data DecimalFormatSymbols* symbolsToAdopt = new DecimalFormatSymbols(status); diff --git a/icu4c/source/i18n/rbnf.cpp b/icu4c/source/i18n/rbnf.cpp index fcdff9141c0..7507ac12f16 100644 --- a/icu4c/source/i18n/rbnf.cpp +++ b/icu4c/source/i18n/rbnf.cpp @@ -647,7 +647,7 @@ RuleBasedNumberFormat::getCollator() const temp = NULL; } if (U_SUCCESS(status)) { - newCollator->setDecomposition(Normalizer::DECOMP); + newCollator->setAttribute(UCOL_DECOMPOSITION_MODE, UCOL_ON, status); // cast away const ((RuleBasedNumberFormat*)this)->collator = newCollator; } else { diff --git a/icu4c/source/i18n/rbt.cpp b/icu4c/source/i18n/rbt.cpp index ca6f4e487cc..dd7d6c15c62 100644 --- a/icu4c/source/i18n/rbt.cpp +++ b/icu4c/source/i18n/rbt.cpp @@ -7,6 +7,10 @@ * 11/17/99 aliu Creation. ********************************************************************** */ + +/* These APIs are becoming private */ +#define ICU_RULEBASEDTRANSLITERATOR_USE_DEPRECATES 1 + #include "unicode/rbt.h" #include "unicode/rep.h" #include "unicode/uniset.h" diff --git a/icu4c/source/i18n/tblcoll.cpp b/icu4c/source/i18n/tblcoll.cpp index 63df614d97e..712613cefe9 100644 --- a/icu4c/source/i18n/tblcoll.cpp +++ b/icu4c/source/i18n/tblcoll.cpp @@ -95,6 +95,7 @@ RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules, status); } +#ifdef ICU_NORMALIZER_USE_DEPRECATES // TODO this is a deprecated constructor, remove >2002-sep-30 RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules, Normalizer::EMode decompositionMode, @@ -107,17 +108,6 @@ RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules, status); } -RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules, - UColAttributeValue decompositionMode, - UErrorCode& status) : - dataIsOwned(FALSE) -{ - construct(rules, - UCOL_DEFAULT_STRENGTH, - decompositionMode, - status); -} - // TODO this is a deprecated constructor, remove >2002-sep-30 RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules, ECollationStrength collationStrength, @@ -130,6 +120,43 @@ RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules, status); } +/** +* Set the decomposition mode of the Collator object. +* @param the new decomposition mode +* @see Collator#getDecomposition +*/ +void RuleBasedCollator::setDecomposition(Normalizer::EMode mode) +{ + UErrorCode status = U_ZERO_ERROR; + ucol_setNormalization(ucollator, Normalizer::getUNormalizationMode(mode, + status)); +} + +/** +* Get the decomposition mode of the Collator object. +* @return the decomposition mode +* @see Collator#setDecomposition +*/ +Normalizer::EMode RuleBasedCollator::getDecomposition(void) const +{ + UErrorCode status = U_ZERO_ERROR; + return Normalizer::getNormalizerEMode(ucol_getNormalization(ucollator), + status); +} + +#endif /* ICU_NORMALIZER_USE_DEPRECATES */ + +RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules, + UColAttributeValue decompositionMode, + UErrorCode& status) : + dataIsOwned(FALSE) +{ + construct(rules, + UCOL_DEFAULT_STRENGTH, + decompositionMode, + status); +} + RuleBasedCollator::RuleBasedCollator(const UnicodeString& rules, ECollationStrength collationStrength, UColAttributeValue decompositionMode, @@ -517,30 +544,6 @@ const Locale RuleBasedCollator::getLocale(ULocDataLocaleType type, UErrorCode &s } } -/** -* Set the decomposition mode of the Collator object. -* @param the new decomposition mode -* @see Collator#getDecomposition -*/ -void RuleBasedCollator::setDecomposition(Normalizer::EMode mode) -{ - UErrorCode status = U_ZERO_ERROR; - ucol_setNormalization(ucollator, Normalizer::getUNormalizationMode(mode, - status)); -} - -/** -* Get the decomposition mode of the Collator object. -* @return the decomposition mode -* @see Collator#setDecomposition -*/ -Normalizer::EMode RuleBasedCollator::getDecomposition(void) const -{ - UErrorCode status = U_ZERO_ERROR; - return Normalizer::getNormalizerEMode(ucol_getNormalization(ucollator), - status); -} - // RuleBaseCollatorNew private constructor ---------------------------------- RuleBasedCollator::RuleBasedCollator() : dataIsOwned(FALSE), ucollator(0) @@ -592,7 +595,7 @@ RuleBasedCollator::RuleBasedCollator(const Locale& desiredLocale, setUCollator(kRootLocaleName, status); if (status == U_ZERO_ERROR) { - status = U_USING_DEFAULT_ERROR; + status = U_USING_DEFAULT_WARNING; } } diff --git a/icu4c/source/i18n/translit.cpp b/icu4c/source/i18n/translit.cpp index 06856ba3abe..79ed8a9debd 100644 --- a/icu4c/source/i18n/translit.cpp +++ b/icu4c/source/i18n/translit.cpp @@ -7,6 +7,12 @@ * 11/17/99 aliu Creation. ********************************************************************** */ + +/* These APIs are becoming private */ +#define ICU_COMPOUNDTRANSLITERATOR_USE_DEPRECATES 1 +#define ICU_NULLTRANSLITERATOR_USE_DEPRECATES 1 +#define ICU_RULEBASEDTRANSLITERATOR_USE_DEPRECATES 1 + #include "unicode/putil.h" #include "unicode/translit.h" #include "unicode/cpdtrans.h" diff --git a/icu4c/source/i18n/transreg.cpp b/icu4c/source/i18n/transreg.cpp index 710bf37e5fe..2776c667b87 100644 --- a/icu4c/source/i18n/transreg.cpp +++ b/icu4c/source/i18n/transreg.cpp @@ -8,6 +8,11 @@ ********************************************************************** */ +/* These APIs are becoming private */ +#define ICU_RULEBASEDTRANSLITERATOR_USE_DEPRECATES 1 +#define ICU_COMPOUNDTRANSLITERATOR_USE_DEPRECATES 1 +#define ICU_NULLTRANSLITERATOR_USE_DEPRECATES 1 + #include "unicode/utypes.h" #include "unicode/uobject.h" #include "unicode/cpdtrans.h" @@ -181,8 +186,7 @@ Spec::Spec(const UnicodeString& theSpec) : top(theSpec) { if (res == 0) { return; } - if (U_FAILURE(status) || - status == U_USING_DEFAULT_ERROR) { + if (U_FAILURE(status) || status == U_USING_DEFAULT_WARNING) { delete res; res = 0; } @@ -860,8 +864,7 @@ Entry* TransliteratorRegistry::findInBundle(const Spec& specToOpen, UErrorCode status = U_ZERO_ERROR; ResourceBundle subres(specToOpen.getBundle().get(tag, status)); - if (U_FAILURE(status) || - status == U_USING_DEFAULT_ERROR) { + if (U_FAILURE(status) || status == U_USING_DEFAULT_WARNING) { continue; } diff --git a/icu4c/source/i18n/ucln_in.c b/icu4c/source/i18n/ucln_in.c index fd9cb5303ad..9bee3ca2237 100644 --- a/icu4c/source/i18n/ucln_in.c +++ b/icu4c/source/i18n/ucln_in.c @@ -19,8 +19,10 @@ static UBool i18n_cleanup(void) { - transliterator_cleanup(); +#ifdef ICU_DATEFORMATSYMBOLS_USE_DEPRECATES dateFormatSymbols_cleanup(); +#endif + transliterator_cleanup(); timeZone_cleanup(); ucol_cleanup(); ucol_bld_cleanup(); diff --git a/icu4c/source/i18n/ucln_in.h b/icu4c/source/i18n/ucln_in.h index 242b3e893da..b8ea1718a75 100644 --- a/icu4c/source/i18n/ucln_in.h +++ b/icu4c/source/i18n/ucln_in.h @@ -26,14 +26,14 @@ U_CFUNC void ucln_i18n_registerCleanup(void); U_CFUNC UBool transliterator_cleanup(void); -U_CFUNC UBool unicodePropertySet_cleanup(void); - -U_CFUNC UBool dateFormatSymbols_cleanup(void); - U_CFUNC UBool timeZone_cleanup(void); U_CFUNC UBool ucol_cleanup(void); U_CFUNC UBool ucol_bld_cleanup(void); +#ifdef ICU_DATEFORMATSYMBOLS_USE_DEPRECATES +U_CFUNC UBool dateFormatSymbols_cleanup(void); +#endif + #endif diff --git a/icu4c/source/i18n/ucol.cpp b/icu4c/source/i18n/ucol.cpp index 44d75eac993..f879d512c7b 100644 --- a/icu4c/source/i18n/ucol.cpp +++ b/icu4c/source/i18n/ucol.cpp @@ -285,7 +285,7 @@ ucol_open( const char *loc, UResourceBundle *binary = ures_getByKey(collElem, "%%CollationBin", NULL, status); if(*status == U_MISSING_RESOURCE_ERROR) { /* if we don't find tailoring, we'll fallback to UCA */ - *status = U_USING_DEFAULT_ERROR; + *status = U_USING_DEFAULT_WARNING; result = ucol_initCollator(UCA->image, result, status); // if we use UCA, real locale is root result->rb = ures_open(NULL, "", status); @@ -427,17 +427,23 @@ ucol_openRules( const UChar *rules, parseError = &tErr; } - switch((int)normalizationMode) { // TODO friendly deprecation helper, remove the (int) cast >2002-sep-30 + switch(normalizationMode) { // TODO friendly deprecation helper, remove the (int) cast >2002-sep-30 case UCOL_OFF: +#ifdef ICU_NORMALIZER_USE_DEPRECATES case UNORM_NONE: // TODO friendly deprecation helper, remove >2002-sep-30 +#endif norm = UCOL_OFF; break; case UCOL_ON: +#ifdef ICU_NORMALIZER_USE_DEPRECATES case UNORM_NFD: // TODO friendly deprecation helper, remove >2002-sep-30 +#endif norm = UCOL_ON; break; - case UCOL_DEFAULT_NORMALIZATION: // TODO friendly deprecation helper, remove >2002-sep-30 case UCOL_DEFAULT: +#ifdef ICU_NORMALIZER_USE_DEPRECATES + case UCOL_DEFAULT_NORMALIZATION: // TODO friendly deprecation helper, remove >2002-sep-30 +#endif norm = UCOL_DEFAULT; break; default: @@ -5023,6 +5029,7 @@ ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status) return UCOL_DEFAULT; } +#ifdef U_USE_DEPRECATED_UCOL_API // deprecated U_CAPI void U_EXPORT2 ucol_setNormalization( UCollator *coll, @@ -5055,6 +5062,7 @@ ucol_getNormalization(const UCollator* coll) return UNORM_NONE; } } +#endif U_CAPI void U_EXPORT2 ucol_setStrength( UCollator *coll, @@ -5117,7 +5125,7 @@ ucol_safeClone(const UCollator *coll, void *stackBuffer, int32_t * pBufferSize, status); if (U_SUCCESS(*status)) { - *status = U_SAFECLONE_ALLOCATED_ERROR; + *status = U_SAFECLONE_ALLOCATED_WARNING; } } else { localCollator = (UCollator *)stackBuffer; diff --git a/icu4c/source/i18n/ucol_bld.cpp b/icu4c/source/i18n/ucol_bld.cpp index 9b9d7754e96..8bea1beff29 100644 --- a/icu4c/source/i18n/ucol_bld.cpp +++ b/icu4c/source/i18n/ucol_bld.cpp @@ -17,9 +17,10 @@ * */ +#include "unicode/ucoleitr.h" +#include "unicode/uchar.h" #include "ucol_bld.h" #include "ucln_in.h" -#include "unicode/uchar.h" #include "umutex.h" diff --git a/icu4c/source/i18n/ucol_elm.cpp b/icu4c/source/i18n/ucol_elm.cpp index b8806bed362..e80d9947c77 100644 --- a/icu4c/source/i18n/ucol_elm.cpp +++ b/icu4c/source/i18n/ucol_elm.cpp @@ -25,6 +25,7 @@ #include "unicode/uchar.h" #include "unicode/unistr.h" +#include "unicode/ucoleitr.h" #include "ucol_elm.h" #include "unormimp.h" #include "caniter.h" diff --git a/icu4c/source/i18n/unicode/choicfmt.h b/icu4c/source/i18n/unicode/choicfmt.h index b9cf5468cd7..7cb79ff7188 100644 --- a/icu4c/source/i18n/unicode/choicfmt.h +++ b/icu4c/source/i18n/unicode/choicfmt.h @@ -628,6 +628,7 @@ public: */ static UClassID getStaticClassID(void) { return (UClassID)&fgClassID; } +#ifdef ICU_NEXTDOUBLE_USE_DEPRECATES /** * Finds the least double greater than d (if positive == true), * or the greatest double less than d (if positive == false). @@ -654,6 +655,7 @@ public: * @deprecated This will be removed after 2002-Jun-30. Use closures API instead. */ static double previousDouble(double d ); +#endif /* ICU_NEXTDOUBLE_USE_DEPRECATES */ private: // static cache management (thread-safe) @@ -748,6 +750,7 @@ ChoiceFormat::getDynamicClassID() const return ChoiceFormat::getStaticClassID(); } +#ifdef ICU_NEXTDOUBLE_USE_DEPRECATES inline double ChoiceFormat::nextDouble( double d ) { return ChoiceFormat::nextDouble( d, TRUE ); @@ -757,6 +760,7 @@ inline double ChoiceFormat::previousDouble( double d ) { return ChoiceFormat::nextDouble( d, FALSE ); } +#endif /* ICU_NEXTDOUBLE_USE_DEPRECATES */ inline UnicodeString& ChoiceFormat::format(const Formattable& obj, diff --git a/icu4c/source/i18n/unicode/coll.h b/icu4c/source/i18n/unicode/coll.h index 3b94608871d..b0c46cdcc79 100644 --- a/icu4c/source/i18n/unicode/coll.h +++ b/icu4c/source/i18n/unicode/coll.h @@ -648,6 +648,7 @@ public: virtual int32_t getSortKey(const UChar*source, int32_t sourceLength, uint8_t*result, int32_t resultLength) const = 0; +#ifdef ICU_NORMALIZER_USE_DEPRECATES // start deprecated APIs /** * Get the decomposition mode of the Collator object. @@ -665,52 +666,53 @@ public: * @deprecated To be removed after 2002-sep-30; use setAttribute(). */ virtual void setDecomposition(Normalizer::EMode mode) = 0; +#endif /* ICU_NORMALIZER_USE_DEPRECATES */ -/** - * Produce a bound for a given sortkey and a number of levels. - * Return value is always the number of bytes needed, regardless of - * whether the result buffer was big enough or even valid.
- * Resulting bounds can be used to produce a range of strings that are - * between upper and lower bounds. For example, if bounds are produced - * for a sortkey of string "smith", strings between upper and lower - * bounds with one level would include "Smith", "SMITH", "sMiTh".
- * There are two upper bounds that can be produced. If UCOL_BOUND_UPPER - * is produced, strings matched would be as above. However, if bound - * produced using UCOL_BOUND_UPPER_LONG is used, the above example will - * also match "Smithsonian" and similar.
- * For more on usage, see example in cintltst/capitst.c in procedure - * TestBounds. - * Sort keys may be compared using strcmp. - * @param source The source sortkey. - * @param sourceLength The length of source, or -1 if null-terminated. - * (If an unmodified sortkey is passed, it is always null - * terminated). - * @param boundType Type of bound required. It can be UCOL_BOUND_LOWER, which - * produces a lower inclusive bound, UCOL_BOUND_UPPER, that - * produces upper bound that matches strings of the same length - * or UCOL_BOUND_UPPER_LONG that matches strings that have the - * same starting substring as the source string. - * @param noOfLevels Number of levels required in the resulting bound (for most - * uses, the recommended value is 1). See users guide for - * explanation on number of levels a sortkey can have. - * @param result A pointer to a buffer to receive the resulting sortkey. - * @param resultLength The maximum size of result. - * @param status Used for returning error code if something went wrong. If the - * number of levels requested is higher than the number of levels - * in the source key, a warning (U_SORT_KEY_TOO_SHORT_WARNING) is - * issued. - * @return The size needed to fully store the bound. - * @see ucol_keyHashCode - * @draft ICU 2.1 - */ -static int32_t getBound(const uint8_t *source, - int32_t sourceLength, - UColBoundMode boundType, - uint32_t noOfLevels, - uint8_t *result, - int32_t resultLength, - UErrorCode &status); + /** + * Produce a bound for a given sortkey and a number of levels. + * Return value is always the number of bytes needed, regardless of + * whether the result buffer was big enough or even valid.
+ * Resulting bounds can be used to produce a range of strings that are + * between upper and lower bounds. For example, if bounds are produced + * for a sortkey of string "smith", strings between upper and lower + * bounds with one level would include "Smith", "SMITH", "sMiTh".
+ * There are two upper bounds that can be produced. If UCOL_BOUND_UPPER + * is produced, strings matched would be as above. However, if bound + * produced using UCOL_BOUND_UPPER_LONG is used, the above example will + * also match "Smithsonian" and similar.
+ * For more on usage, see example in cintltst/capitst.c in procedure + * TestBounds. + * Sort keys may be compared using strcmp. + * @param source The source sortkey. + * @param sourceLength The length of source, or -1 if null-terminated. + * (If an unmodified sortkey is passed, it is always null + * terminated). + * @param boundType Type of bound required. It can be UCOL_BOUND_LOWER, which + * produces a lower inclusive bound, UCOL_BOUND_UPPER, that + * produces upper bound that matches strings of the same length + * or UCOL_BOUND_UPPER_LONG that matches strings that have the + * same starting substring as the source string. + * @param noOfLevels Number of levels required in the resulting bound (for most + * uses, the recommended value is 1). See users guide for + * explanation on number of levels a sortkey can have. + * @param result A pointer to a buffer to receive the resulting sortkey. + * @param resultLength The maximum size of result. + * @param status Used for returning error code if something went wrong. If the + * number of levels requested is higher than the number of levels + * in the source key, a warning (U_SORT_KEY_TOO_SHORT_WARNING) is + * issued. + * @return The size needed to fully store the bound. + * @see ucol_keyHashCode + * @draft ICU 2.1 + */ + static int32_t getBound(const uint8_t *source, + int32_t sourceLength, + UColBoundMode boundType, + uint32_t noOfLevels, + uint8_t *result, + int32_t resultLength, + UErrorCode &status); protected: diff --git a/icu4c/source/i18n/unicode/cpdtrans.h b/icu4c/source/i18n/unicode/cpdtrans.h index e835a47d72b..75909d04275 100644 --- a/icu4c/source/i18n/unicode/cpdtrans.h +++ b/icu4c/source/i18n/unicode/cpdtrans.h @@ -12,6 +12,8 @@ #include "unicode/translit.h" +#ifdef ICU_COMPOUNDTRANSLITERATOR_USE_DEPRECATES + U_NAMESPACE_BEGIN class U_I18N_API UVector; @@ -311,5 +313,6 @@ inline CompoundTransliterator::CompoundTransliterator(const UnicodeString& id, #endif U_NAMESPACE_END +#endif /* ICU_COMPOUNDTRANSLITERATOR_USE_DEPRECATES */ #endif diff --git a/icu4c/source/i18n/unicode/dtfmtsym.h b/icu4c/source/i18n/unicode/dtfmtsym.h index 87fe94b1068..39a2f218340 100644 --- a/icu4c/source/i18n/unicode/dtfmtsym.h +++ b/icu4c/source/i18n/unicode/dtfmtsym.h @@ -242,11 +242,13 @@ public: */ void setZoneStrings(const UnicodeString* const* strings, int32_t rowCount, int32_t columnCount); +#ifdef ICU_DATEFORMATSYMBOLS_USE_DEPRECATES /** * Get the non-localized date-time pattern characters. * @deprecated remove after Aug 2002. Use getPatternUChars instead. */ static const UnicodeString& getPatternChars(void); +#endif /* ICU_DATEFORMATSYMBOLS_USE_DEPRECATES */ /** * Get the non-localized date-time pattern characters. diff --git a/icu4c/source/i18n/unicode/nultrans.h b/icu4c/source/i18n/unicode/nultrans.h index fe6eafedd1e..690b7f17e3b 100644 --- a/icu4c/source/i18n/unicode/nultrans.h +++ b/icu4c/source/i18n/unicode/nultrans.h @@ -12,6 +12,7 @@ #include "unicode/translit.h" +#ifdef ICU_NULLTRANSLITERATOR_USE_DEPRECATES U_NAMESPACE_BEGIN /** @@ -88,5 +89,6 @@ inline NullTransliterator::NullTransliterator() : Transliterator(ID, 0) {} inline NullTransliterator::~NullTransliterator() {} U_NAMESPACE_END +#endif /* ICU_NULLTRANSLITERATOR_USE_DEPRECATES */ #endif diff --git a/icu4c/source/i18n/unicode/rbt.h b/icu4c/source/i18n/unicode/rbt.h index 93d56e21f5d..f91eaeece0d 100644 --- a/icu4c/source/i18n/unicode/rbt.h +++ b/icu4c/source/i18n/unicode/rbt.h @@ -11,6 +11,8 @@ #define RBT_H #include "unicode/translit.h" + +#ifdef ICU_RULEBASEDTRANSLITERATOR_USE_DEPRECATES #include "unicode/utypes.h" #include "unicode/parseerr.h" @@ -557,5 +559,6 @@ inline RuleBasedTransliterator::RuleBasedTransliterator( } U_NAMESPACE_END +#endif /* ICU_RULEBASEDTRANSLITERATOR_USE_DEPRECATES */ #endif diff --git a/icu4c/source/i18n/unicode/tblcoll.h b/icu4c/source/i18n/unicode/tblcoll.h index 9e5b68286e8..043c18eee29 100644 --- a/icu4c/source/i18n/unicode/tblcoll.h +++ b/icu4c/source/i18n/unicode/tblcoll.h @@ -545,6 +545,7 @@ public: */ virtual void setStrength(ECollationStrength newStrength); +#ifdef ICU_NORMALIZER_USE_DEPRECATES // deprecated functions --------------------------------------------------- /** @@ -593,6 +594,7 @@ public: * @deprecated To be removed after 2002-sep-30; use getAttribute(). */ virtual Normalizer::EMode getDecomposition(void) const; +#endif /* ICU_NORMALIZER_USE_DEPRECATES */ private: diff --git a/icu4c/source/i18n/unicode/timezone.h b/icu4c/source/i18n/unicode/timezone.h index d0ffaf6c726..515dada0180 100644 --- a/icu4c/source/i18n/unicode/timezone.h +++ b/icu4c/source/i18n/unicode/timezone.h @@ -315,11 +315,14 @@ public: */ virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const = 0; + +#ifdef ICU_TIMEZONE_USE_DEPRECATES /** * @deprecated Remove after 2000-dec-31. Use the other getOffset(). */ virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t millis) const = 0; +#endif /* ICU_TIMEZONE_USE_DEPRECATES */ /** * Gets the time zone offset, for current date, modified in case of diff --git a/icu4c/source/i18n/unicode/ucol.h b/icu4c/source/i18n/unicode/ucol.h index ff707795c23..a46b780f5b0 100644 --- a/icu4c/source/i18n/unicode/ucol.h +++ b/icu4c/source/i18n/unicode/ucol.h @@ -688,6 +688,25 @@ ucol_safeClone(const UCollator *coll, U_CAPI int32_t U_EXPORT2 ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen); +/** + * gets the locale name of the collator. If the collator + * is instantiated from the rules, then this function returns + * NULL. + * @param coll The UCollator for which the locale is needed + * @param type You can choose between requested, valid and actual + * locale. For description see the definition of + * ULocDataLocaleType in uloc.h + * @param status error code of the operation + * @return real locale name from which the collation data comes. + * If the collator was instantiated from rules, returns + * NULL. + * @draft ICU 2.1 + */ +U_CAPI const char * U_EXPORT2 +ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status); + + +#ifdef U_USE_DEPRECATED_UCOL_API /********************************* Deprecated API ********************************/ /* This is the C API wrapper for CollationIterator that got booted out from here, including just for */ @@ -746,28 +765,9 @@ U_CAPI void U_EXPORT2 ucol_setNormalization( UCollator *coll, UNormalizationMode mode); -/** - * gets the locale name of the collator. If the collator - * is instantiated from the rules, then this function returns - * NULL. - * @param coll The UCollator for which the locale is needed - * @param type You can choose between requested, valid and actual - * locale. For description see the definition of - * ULocDataLocaleType in uloc.h - * @param status error code of the operation - * @return real locale name from which the collation data comes. - * If the collator was instantiated from rules, returns - * NULL. - * @draft ICU 2.1 - */ -U_CAPI const char * U_EXPORT2 -ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status); - /** *@deprecated Remove after Aug 2002 */ -#ifdef U_USE_DEPRECATED_FORMAT_API - #if ((U_ICU_VERSION_MAJOR_NUM != 2) || (U_ICU_VERSION_MINOR_NUM != 2)) # error "ICU version has changed. Please redefine the macros under U_USE_DEPRECATED_FORMAT_API pre-processor definition" #else diff --git a/icu4c/source/i18n/unicode/unitohex.h b/icu4c/source/i18n/unicode/unitohex.h index 7b154ea2219..090e327e760 100644 --- a/icu4c/source/i18n/unicode/unitohex.h +++ b/icu4c/source/i18n/unicode/unitohex.h @@ -10,6 +10,8 @@ #define UNITOHEX_H #include "unicode/translit.h" + +#ifdef ICU_UNICODETOHEXTRANSLITERATOR_USE_DEPRECATES #include "unicode/unistr.h" U_NAMESPACE_BEGIN @@ -221,5 +223,6 @@ public: inline UnicodeToHexTransliterator::~UnicodeToHexTransliterator() {} U_NAMESPACE_END +#endif /* ICU_COMPOUNDTRANSLITERATOR_USE_DEPRECATES */ #endif diff --git a/icu4c/source/i18n/unitohex.cpp b/icu4c/source/i18n/unitohex.cpp index 9ae3f7bac31..2f9966914c1 100644 --- a/icu4c/source/i18n/unitohex.cpp +++ b/icu4c/source/i18n/unitohex.cpp @@ -7,6 +7,10 @@ * 11/17/99 aliu Creation. ********************************************************************** */ + +/* These APIs are becoming private */ +#define ICU_UNICODETOHEXTRANSLITERATOR_USE_DEPRECATES 1 + #include "unicode/unitohex.h" #include "unicode/rep.h" #include "unicode/unifilt.h" diff --git a/icu4c/source/i18n/utrans.cpp b/icu4c/source/i18n/utrans.cpp index 0b215374627..34bbb032d29 100644 --- a/icu4c/source/i18n/utrans.cpp +++ b/icu4c/source/i18n/utrans.cpp @@ -8,6 +8,9 @@ ******************************************************************************* */ +/* These APIs are becoming private */ +#define ICU_RULEBASEDTRANSLITERATOR_USE_DEPRECATES 1 + #include "unicode/utrans.h" #include "unicode/putil.h" #include "unicode/rbt.h"