intl/icu/source/i18n/ucln_in.c

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /*
     2 ******************************************************************************
     3 *                                                                            *
     4 * Copyright (C) 2001-2009, International Business Machines                   *
     5 *                Corporation and others. All Rights Reserved.                *
     6 *                                                                            *
     7 ******************************************************************************
     8 *   file name:  ucln_in.c
     9 *   encoding:   US-ASCII
    10 *   tab size:   8 (not used)
    11 *   indentation:4
    12 *
    13 *   created on: 2001July05
    14 *   created by: George Rhoten
    15 */
    17 #include "ucln.h"
    18 #include "ucln_in.h"
    19 #include "uassert.h"
    21 /**  Auto-client for UCLN_I18N **/
    22 #define UCLN_TYPE UCLN_I18N
    23 #include "ucln_imp.h"
    25 /* Leave this copyright notice here! It needs to go somewhere in this library. */
    26 static const char copyright[] = U_COPYRIGHT_STRING;
    28 static cleanupFunc *gCleanupFunctions[UCLN_I18N_COUNT];
    30 static UBool i18n_cleanup(void)
    31 {
    32     ECleanupI18NType libType = UCLN_I18N_START;
    34     while (++libType<UCLN_I18N_COUNT) {
    35         if (gCleanupFunctions[libType])
    36         {
    37             gCleanupFunctions[libType]();
    38             gCleanupFunctions[libType] = NULL;
    39         }
    40     }
    41 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
    42     ucln_unRegisterAutomaticCleanup();
    43 #endif
    44     return TRUE;
    45 }
    47 void ucln_i18n_registerCleanup(ECleanupI18NType type,
    48                                cleanupFunc *func)
    49 {
    50     U_ASSERT(UCLN_I18N_START < type && type < UCLN_I18N_COUNT);
    51     ucln_registerCleanup(UCLN_I18N, i18n_cleanup);
    52     if (UCLN_I18N_START < type && type < UCLN_I18N_COUNT)
    53     {
    54         gCleanupFunctions[type] = func;
    55     }
    56 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
    57     ucln_registerAutomaticCleanup();
    58 #endif
    59 }

mercurial