2004-10-06 23:10:53 +00:00
|
|
|
/*
|
|
|
|
******************************************************************************
|
2015-07-16 18:13:02 +00:00
|
|
|
* Copyright (C) 2001-2015, International Business Machines
|
2013-09-10 00:34:12 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
2004-10-06 23:10:53 +00:00
|
|
|
******************************************************************************
|
2013-09-10 00:34:12 +00:00
|
|
|
* file name: uinit.cpp
|
2004-10-06 23:10:53 +00:00
|
|
|
* encoding: US-ASCII
|
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created on: 2001July05
|
|
|
|
* created by: George Rhoten
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
2010-06-01 06:10:26 +00:00
|
|
|
#include "unicode/icuplug.h"
|
2004-10-06 23:10:53 +00:00
|
|
|
#include "unicode/uclean.h"
|
2010-06-01 06:10:26 +00:00
|
|
|
#include "cmemory.h"
|
|
|
|
#include "icuplugimp.h"
|
2013-08-09 19:53:07 +00:00
|
|
|
#include "ucln_cmn.h"
|
2005-05-03 22:59:01 +00:00
|
|
|
#include "ucnv_io.h"
|
2013-08-09 19:53:07 +00:00
|
|
|
#include "umutex.h"
|
2010-06-01 06:10:26 +00:00
|
|
|
#include "utracimp.h"
|
2004-10-06 23:10:53 +00:00
|
|
|
|
2013-09-10 00:13:41 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2013-08-09 19:53:07 +00:00
|
|
|
static UInitOnce gICUInitOnce = U_INITONCE_INITIALIZER;
|
|
|
|
|
|
|
|
static UBool U_CALLCONV uinit_cleanup() {
|
|
|
|
gICUInitOnce.reset();
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-08-11 04:57:13 +00:00
|
|
|
static void U_CALLCONV
|
2013-08-09 19:53:07 +00:00
|
|
|
initData(UErrorCode &status)
|
2012-08-11 04:57:13 +00:00
|
|
|
{
|
2015-07-16 18:13:02 +00:00
|
|
|
#if UCONFIG_ENABLE_PLUGINS
|
2013-08-09 19:53:07 +00:00
|
|
|
/* initialize plugins */
|
|
|
|
uplug_init(&status);
|
2015-07-16 18:13:02 +00:00
|
|
|
#endif
|
2013-08-09 19:53:07 +00:00
|
|
|
|
|
|
|
#if !UCONFIG_NO_CONVERSION
|
2005-05-03 22:59:01 +00:00
|
|
|
/*
|
|
|
|
* 2005-may-02
|
|
|
|
*
|
|
|
|
* ICU4C 3.4 (jitterbug 4497) hardcodes the data for Unicode character
|
|
|
|
* properties for APIs that want to be fast.
|
|
|
|
* Therefore, we need not load them here nor check for errors.
|
|
|
|
* Instead, we load the converter alias table to see if any ICU data
|
|
|
|
* is available.
|
|
|
|
* Users should really open the service objects they need and check
|
|
|
|
* for errors there, to make sure that the actual items they need are
|
|
|
|
* available.
|
|
|
|
*/
|
2013-08-09 19:53:07 +00:00
|
|
|
ucnv_io_countKnownConverters(&status);
|
2004-10-06 23:10:53 +00:00
|
|
|
#endif
|
2013-08-09 19:53:07 +00:00
|
|
|
ucln_common_registerCleanup(UCLN_COMMON_UINIT, uinit_cleanup);
|
2012-08-11 04:57:13 +00:00
|
|
|
}
|
|
|
|
|
2013-12-10 18:10:44 +00:00
|
|
|
U_NAMESPACE_END
|
2013-12-12 19:25:46 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_USE
|
|
|
|
|
2012-08-11 04:57:13 +00:00
|
|
|
/*
|
|
|
|
* ICU Initialization Function. Need not be called.
|
|
|
|
*/
|
|
|
|
U_CAPI void U_EXPORT2
|
|
|
|
u_init(UErrorCode *status) {
|
|
|
|
UTRACE_ENTRY_OC(UTRACE_U_INIT);
|
2013-12-12 19:25:46 +00:00
|
|
|
umtx_initOnce(gICUInitOnce, &initData, *status);
|
2004-10-06 23:10:53 +00:00
|
|
|
UTRACE_EXIT_STATUS(*status);
|
|
|
|
}
|