X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/729e4ab9bc6618bc3d8a898e575df7f4019e29ca..f59164e3d128c7675a4d3934206346a3384e53a5:/icuSources/common/icudataver.c?ds=sidebyside diff --git a/icuSources/common/icudataver.c b/icuSources/common/icudataver.c index 51fe9ce9..beb5e735 100644 --- a/icuSources/common/icudataver.c +++ b/icuSources/common/icudataver.c @@ -1,7 +1,7 @@ /* ****************************************************************************** * -* Copyright (C) 2009, International Business Machines +* Copyright (C) 2009-2011, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** @@ -9,31 +9,8 @@ #include "unicode/utypes.h" #include "unicode/icudataver.h" -#include "unicode/uversion.h" #include "unicode/ures.h" #include "uresimp.h" /* for ures_getVersionByKey */ -#include "cmemory.h" - -/* - * Determines if icustd is in the data. - */ -static UBool hasICUSTDBundle(); - -static UBool hasICUSTDBundle() { - UErrorCode status = U_ZERO_ERROR; - UBool result = TRUE; - - UResourceBundle *icustdbundle = ures_openDirect(NULL, U_ICU_STD_BUNDLE, &status); - if (U_SUCCESS(status)) { - result = TRUE; - } else { - result = FALSE; - } - - ures_close(icustdbundle); - - return result; -} U_CAPI void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErrorCode *status) { UResourceBundle *icudatares = NULL; @@ -50,34 +27,3 @@ U_CAPI void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErrorCod ures_close(icudatares); } } - -U_CAPI UBool U_EXPORT2 u_isDataOlder(UVersionInfo dataVersionFillin, UBool *isModifiedFillin, UErrorCode *status) { - UBool result = TRUE; - UVersionInfo dataVersion; - UVersionInfo wiredVersion; - - if (U_FAILURE(*status)) { - return result; - } - - u_getDataVersion(dataVersion, status); - if (U_SUCCESS(*status)) { - u_versionFromString(wiredVersion, U_ICU_DATA_VERSION); - - if (uprv_memcmp(dataVersion, wiredVersion, sizeof(UVersionInfo)) >= 0) { - result = FALSE; - } - - if (dataVersionFillin != NULL) { - uprv_memcpy(dataVersionFillin, dataVersion, sizeof(UVersionInfo)); - } - - if (hasICUSTDBundle()) { - *isModifiedFillin = FALSE; - } else { - *isModifiedFillin = TRUE; - } - } - - return result; -}