summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu-xetex/i18n/ucln_in.c
blob: afcf07112fb0fac5ac50f807493eab0bd70e50e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
******************************************************************************
*                                                                            *
* Copyright (C) 2001-2006, International Business Machines                   *
*                Corporation and others. All Rights Reserved.                *
*                                                                            *
******************************************************************************
*   file name:  ucln_in.c
*   encoding:   US-ASCII
*   tab size:   8 (not used)
*   indentation:4
*
*   created on: 2001July05
*   created by: George Rhoten
*/

#include "ucln.h"
#include "ucln_in.h"
#include "uassert.h"

/* Leave this copyright notice here! It needs to go somewhere in this library. */
static const char copyright[] = U_COPYRIGHT_STRING;

static cleanupFunc *gCleanupFunctions[UCLN_I18N_COUNT];

static UBool i18n_cleanup(void)
{
    ECleanupI18NType libType = UCLN_I18N_START;

    while (++libType<UCLN_I18N_COUNT) {
        if (gCleanupFunctions[libType])
        {
            gCleanupFunctions[libType]();
            gCleanupFunctions[libType] = NULL;
        }
    }
    return TRUE;
}

void ucln_i18n_registerCleanup(ECleanupI18NType type,
                               cleanupFunc *func)
{
    U_ASSERT(UCLN_I18N_START < type && type < UCLN_I18N_COUNT);
    ucln_registerCleanup(UCLN_I18N, i18n_cleanup);
    if (UCLN_I18N_START < type && type < UCLN_I18N_COUNT)
    {
        gCleanupFunctions[type] = func;
    }
}