U_CAPI void U_EXPORT2 u_init(UErrorCode *status) { UTRACE_ENTRY_OC(UTRACE_U_INIT); /* Make sure the global mutexes are initialized. */ umtx_init(NULL); umtx_lock(&gICUInitMutex); if (gICUInitialized || U_FAILURE(*status)) { umtx_unlock(&gICUInitMutex); UTRACE_EXIT_STATUS(*status); return; } /* Do any required init for services that don't have open operations * and use "only" the double-check initialization method for performance * reasons (avoiding a mutex lock even for _checking_ whether the * initialization had occurred). */ /* Char Properties */ uprv_loadPropsData(status); #if !UCONFIG_NO_NORMALIZATION /* Normalization */ unorm_haveData(status); #endif gICUInitialized = TRUE; /* TODO: don't set if U_FAILURE? */ umtx_unlock(&gICUInitMutex); UTRACE_EXIT_STATUS(*status); }
U_CFUNC UBool uprv_haveProperties(UErrorCode *pErrorCode) { if(U_FAILURE(*pErrorCode)) { return FALSE; } #if !UCHAR_HARDCODE_DATA if(havePropsData==0) { uprv_loadPropsData(pErrorCode); } if(havePropsData<0) { *pErrorCode=dataErrorCode; return FALSE; } #endif return TRUE; }
static int8_t loadPropsData(void) { UErrorCode errorCode = U_ZERO_ERROR; int8_t retVal = uprv_loadPropsData(&errorCode); return retVal; }