From 09633de40c74455b32518e08cb4bacb183ccb02a Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Fri, 15 Jun 2007 06:40:59 +0000 Subject: [PATCH] ICU-5279 Don't export some API. X-SVN-Rev: 21746 --- icu4c/source/common/serv.cpp | 5 ++++- icu4c/source/common/serv.h | 8 +------- icu4c/source/common/ucase.c | 8 ++++---- icu4c/source/common/ucase.h | 8 ++++---- icu4c/source/common/wintz.c | 2 +- icu4c/source/common/wintz.h | 4 ++-- icu4c/source/test/intltest/icusvtst.cpp | 10 +++++----- icu4c/source/test/intltest/uobjtest.cpp | 1 - 8 files changed, 21 insertions(+), 25 deletions(-) diff --git a/icu4c/source/common/serv.cpp b/icu4c/source/common/serv.cpp index bf019e68e5..8dc15b2c0f 100644 --- a/icu4c/source/common/serv.cpp +++ b/icu4c/source/common/serv.cpp @@ -316,10 +316,12 @@ StringPair::StringPair(const UnicodeString& _displayName, { } -U_CAPI void U_EXPORT2 +U_CDECL_BEGIN +static void U_CALLCONV userv_deleteStringPair(void *obj) { U_NAMESPACE_USE delete (StringPair*) obj; } +U_CDECL_END /* ****************************************************************** @@ -736,6 +738,7 @@ ICUService::getDisplayNames(UVector& result, UErrorCode& status) const { result.removeAllElements(); + result.setDeleter(userv_deleteStringPair); if (U_SUCCESS(status)) { ICUService* ncthis = (ICUService*)this; // cast away semantic const Mutex mutex(&ncthis->lock); diff --git a/icu4c/source/common/serv.h b/icu4c/source/common/serv.h index 72f0a9f4ae..2e498fb4a0 100644 --- a/icu4c/source/common/serv.h +++ b/icu4c/source/common/serv.h @@ -1,6 +1,6 @@ /** ******************************************************************************* - * Copyright (C) 2001-2006, International Business Machines Corporation. * + * Copyright (C) 2001-2007, International Business Machines Corporation. * * All Rights Reserved. * ******************************************************************************* */ @@ -431,12 +431,6 @@ private: StringPair(const UnicodeString& displayName, const UnicodeString& id); }; -/** - * Deleter for StringPairs - */ -U_CAPI void U_EXPORT2 -userv_deleteStringPair(void *obj); - /******************************************************************* * ICUService */ diff --git a/icu4c/source/common/ucase.c b/icu4c/source/common/ucase.c index c21045a06a..2352176be1 100644 --- a/icu4c/source/common/ucase.c +++ b/icu4c/source/common/ucase.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2004-2006, International Business Machines +* Copyright (C) 2004-2007, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -333,7 +333,7 @@ _enumPropertyStartsRange(const void *context, UChar32 start, UChar32 limit, uint return TRUE; } -U_CAPI void U_EXPORT2 +U_CFUNC void U_EXPORT2 ucase_addPropertyStarts(const UCaseProps *csp, const USetAdder *sa, UErrorCode *pErrorCode) { if(U_FAILURE(*pErrorCode)) { return; @@ -466,7 +466,7 @@ ucase_totitle(const UCaseProps *csp, UChar32 c) { return c; } -U_CAPI void U_EXPORT2 +U_CFUNC void U_EXPORT2 ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa) { uint16_t props; @@ -608,7 +608,7 @@ strcmpMax(const UChar *s, int32_t length, const UChar *t, int32_t max) { } } -U_CAPI UBool U_EXPORT2 +U_CFUNC UBool U_EXPORT2 ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length, const USetAdder *sa) { const UChar *unfold, *p; int32_t i, start, limit, result, unfoldRows, unfoldRowWidth, unfoldStringWidth; diff --git a/icu4c/source/common/ucase.h b/icu4c/source/common/ucase.h index e3e5be0517..1310031f12 100644 --- a/icu4c/source/common/ucase.h +++ b/icu4c/source/common/ucase.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2004-2006, International Business Machines +* Copyright (C) 2004-2007, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -58,7 +58,7 @@ ucase_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *outData, UErrorCode *pErrorCode); -U_CAPI void U_EXPORT2 +U_CFUNC void U_EXPORT2 ucase_addPropertyStarts(const UCaseProps *csp, const USetAdder *sa, UErrorCode *pErrorCode); /** @@ -108,7 +108,7 @@ ucase_fold(const UCaseProps *csp, UChar32 c, uint32_t options); * - for sharp s include ss * - for k include the Kelvin sign */ -U_CAPI void U_EXPORT2 +U_CFUNC void U_EXPORT2 ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa); /** @@ -123,7 +123,7 @@ ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa); * * @return TRUE if the string was found */ -U_CAPI UBool U_EXPORT2 +U_CFUNC UBool U_EXPORT2 ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length, const USetAdder *sa); /** @return UCASE_NONE, UCASE_LOWER, UCASE_UPPER, UCASE_TITLE */ diff --git a/icu4c/source/common/wintz.c b/icu4c/source/common/wintz.c index 253b059db4..64bc626812 100644 --- a/icu4c/source/common/wintz.c +++ b/icu4c/source/common/wintz.c @@ -453,7 +453,7 @@ uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid, * Main Windows time zone detection function. Returns the Windows * time zone, translated to an ICU time zone, or NULL upon failure. */ -U_CAPI const char* U_EXPORT2 +U_CFUNC const char* U_EXPORT2 uprv_detectWindowsTimeZone() { LONG result; HKEY hkey; diff --git a/icu4c/source/common/wintz.h b/icu4c/source/common/wintz.h index b8af862f38..0704953f46 100644 --- a/icu4c/source/common/wintz.h +++ b/icu4c/source/common/wintz.h @@ -1,6 +1,6 @@ /* ******************************************************************************** -* Copyright (C) 2005-2006, International Business Machines +* Copyright (C) 2005-2007, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************** * @@ -29,7 +29,7 @@ U_CDECL_END U_CAPI UBool U_EXPORT2 uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid, int32_t length); -U_CAPI const char* U_EXPORT2 +U_CFUNC const char* U_EXPORT2 uprv_detectWindowsTimeZone(); #endif /* #ifdef U_WINDOWS */ diff --git a/icu4c/source/test/intltest/icusvtst.cpp b/icu4c/source/test/intltest/icusvtst.cpp index 4835b56a33..b3aff063ae 100644 --- a/icu4c/source/test/intltest/icusvtst.cpp +++ b/icu4c/source/test/intltest/icusvtst.cpp @@ -1,6 +1,6 @@ /** ******************************************************************************* - * Copyright (C) 2001-2005, International Business Machines Corporation and * + * Copyright (C) 2001-2007, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* * @@ -695,7 +695,7 @@ ICUServiceTest::testAPI_Two() // iterate over the display names { UErrorCode status = U_ZERO_ERROR; - UVector names(userv_deleteStringPair, NULL, status); + UVector names(status); service.getDisplayNames(names, status); for (int i = 0; i < names.size(); ++i) { const StringPair* pair = (const StringPair*)names[i]; @@ -735,7 +735,7 @@ ICUServiceTest::testAPI_Two() // Rad dude's surfer gal 'replaces' Later's surfer gal { UErrorCode status = U_ZERO_ERROR; - UVector names(userv_deleteStringPair, NULL, status); + UVector names(status); service.getDisplayNames(names, Locale("es"), status); for (int i = 0; i < names.size(); ++i) { const StringPair* pair = (const StringPair*)names[i]; @@ -906,7 +906,7 @@ ICUServiceTest::testRBF() // this should be fast since the display names were cached. { UErrorCode status = U_ZERO_ERROR; - UVector names(userv_deleteStringPair, NULL, status); + UVector names(status); service.getDisplayNames(names, Locale::getGermany(), status); logln("service display names for de_DE"); for (int i = 0; i < names.size(); ++i) { @@ -932,7 +932,7 @@ ICUServiceTest::testRBF() logln(UnicodeString("\n --- ") + idNames[i] + " ---"); { UErrorCode status = U_ZERO_ERROR; - UVector names(userv_deleteStringPair, NULL, status); + UVector names(status); service.getDisplayNames(names, idNames[i], status); for (int i = 0; i < names.size(); ++i) { const StringPair* pair = (const StringPair*)names[i]; diff --git a/icu4c/source/test/intltest/uobjtest.cpp b/icu4c/source/test/intltest/uobjtest.cpp index 2fd12e866f..fa88297017 100644 --- a/icu4c/source/test/intltest/uobjtest.cpp +++ b/icu4c/source/test/intltest/uobjtest.cpp @@ -174,7 +174,6 @@ UObject *UObjectTest::testClass(UObject *obj, #include "unicode/coll.h" #include "unicode/curramt.h" #include "unicode/datefmt.h" -#include "unicode/dbbi.h" #include "unicode/dcfmtsym.h" #include "unicode/decimfmt.h" #include "unicode/dtfmtsym.h"